blob: 4b1178329f100ca3e0d020d1dc3d6e0b4d7b880f [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// GENERATED FILE: Do not edit!
//
// To rebuild this file, invoke third_party/go/regen-fidl.
// +build fuchsia
package io
import (
_zx "syscall/zx"
_bindings "syscall/zx/fidl"
fuchsiamem "syscall/zx/mem"
)
const (
// Indicates the file is ready for reading.
FileSignalReadable uint32 = 16777216
// Indicates the file is ready for writing.
FileSignalWritable uint32 = 33554432
// Indicates the device is ready for reading.
DeviceSignalReadable uint32 = 16777216
// Indicates an out-of-band state transition has occurred.
DeviceSignalOob uint32 = 33554432
// Indicates the device is ready for writing.
DeviceSignalWritable uint32 = 67108864
// Indicates the device has encountered an error state.
DeviceSignalError uint32 = 134217728
// Indicates the device has hung up on the current connection.
DeviceSignalHangup uint32 = 268435456
// Can read from target object.
OpenRightReadable uint32 = 1
// Can write to target object.
OpenRightWritable uint32 = 2
// Connection can mount/umount filesystem.
OpenRightAdmin uint32 = 4
// Connection can map target object executable.
OpenRightExecutable uint32 = 8
// Create the object if it doesn't exist.
OpenFlagCreate uint32 = 65536
// (with Create) Fail if the object already exists.
OpenFlagCreateIfAbsent uint32 = 131072
// Truncate the object before usage.
OpenFlagTruncate uint32 = 262144
// Assert that the object to be opened is a directory.
// Return an error if the target object is not a directory.
OpenFlagDirectory uint32 = 524288
// Seek to the end of the object before all writes.
OpenFlagAppend uint32 = 1048576
// If the object is a mount point, open the local directory.
OpenFlagNoRemote uint32 = 2097152
// Open a reference to the object, not the object itself.
// It is ONLY valid to pass the following flags together with `OPEN_FLAG_NODE_REFERENCE`:
// - `OPEN_FLAG_DIRECTORY`
// - `OPEN_FLAG_NOT_DIRECTORY`
// - `OPEN_FLAG_DESCRIBE`
// otherwise an error is returned.
// If an object is opened or cloned using this method, the resulting connection does not carry
// any permission flags.
// The resulting node allows a limited set of operations: `GetAttr`, `Clone`, `Close`, `Describe`,
// and, if the node is a file, these extra operations: `GetFlags`, `SetFlags`.
OpenFlagNodeReference uint32 = 4194304
// Binary OR of `OPEN_FLAG_DIRECTORY`, OPEN_FLAG_NOT_DIRECTORY, OPEN_FLAG_DESCRIBE, and
// `OPEN_FLAG_NODE_REFERENCE`. Flags used when opening a node reference must fall within this mask.
OpenFlagsAllowedWithNodeReference uint32 = 46661632
// Requests that an "OnOpen" event is sent to the interface request.
// The event will contain a non-null NodeInfo if the open/clone is successful.
OpenFlagDescribe uint32 = 8388608
// Specify this flag to request POSIX-compatibility. Currently, it affects permission handling.
// During Open:
// - If the target path is a directory, the rights on the new connection expand to include
// `OPEN_RIGHT_WRITABLE` if and only if the current connection and all intermediate mount points
// are writable, and to include `OPEN_RIGHT_EXECUTABLE` if and only if the current connection and
// all intermediate mount points are executable.
// - Otherwise, this flag is ignored. It is an access denied error to request more rights
// than those on the current connection, or any intermediate mount points.
//
// If the posix compatibility flag is not specified, opening always uses the requested rights,
// failing the operation with access denied error if requested rights exceeds the rights attached
// to the current connection.
//
// If the requesting connection is read-only and the requested rights are read-only, the flag
// may be ignored by the server, and is not forwarded downstream. This is an implementation detail,
// necessary to enforce hierarchical permissions across mount points, and should have no effect
// on the expected behavior for clients.
OpenFlagPosix uint32 = 16777216
// Assert that the object to be opened is not a directory.
// Return an error if the target object is a directory.
OpenFlagNotDirectory uint32 = 33554432
// When used during clone, the new connection inherits the rights on the source connection,
// regardless if it is a file or directory. Otherwise, clone attempts to use the requested rights.
// It is invalid to pass any of the `OPEN_RIGHT_*` flags together with `CLONE_FLAG_SAME_RIGHTS`.
CloneFlagSameRights uint32 = 67108864
// Bits reserved for posix protections. Native fuchsia filesystems
// are not required to set bits contained within `MODE_PROTECTION_MASK`,
// but filesystems that wish to do so may refer to sys/stat.h for their
// definitions.
ModeProtectionMask uint32 = 4095
// Bits indicating node type. The canonical mechanism to check
// for a node type is to take 'mode', bitwise AND it with the
// `MODE_TYPE_MASK`, and check exact equality against a mode type.
ModeTypeMask uint32 = 1044480
ModeTypeDirectory uint32 = 16384
ModeTypeBlockDevice uint32 = 24576
ModeTypeFile uint32 = 32768
ModeTypeSocket uint32 = 49152
ModeTypeService uint32 = 65536
// The maximal buffer size which can be transmitted for buffered operations.
// This capacity is currently set somewhat arbitrarily.
MaxBuf uint64 = 8192
// The maximum length, in bytes, of a filesystem string.
MaxPath uint64 = 4096
// The maximum length, in bytes, of a single filesystem component.
MaxFilename uint64 = 255
// The fields of 'attributes' which are used to update the Node are indicated
// by the 'flags' argument.
NodeAttributeFlagCreationTime uint32 = 1
NodeAttributeFlagModificationTime uint32 = 2
// Requests that the VMO be readable.
VmoFlagRead uint32 = 1
// Requests that the VMO be writable.
VmoFlagWrite uint32 = 2
// Requests that the VMO be executable.
VmoFlagExec uint32 = 4
// Require a copy-on-write clone of the underlying VMO.
// The request should fail if the VMO is not cloned.
// May not be supplied with fuchsia_io_`VMO_FLAG_EXACT`.
VmoFlagPrivate uint32 = 65536
// Require an exact (non-cloned) handle to the underlying VMO.
// The request should fail if a handle to the exact VMO is not returned.
// May not be supplied with `VMO_FLAG_PRIVATE`.
VmoFlagExact uint32 = 131072
// A dirent with an unknown type.
DirentTypeUnknown uint8 = 0
// A dirent representing a directory object.
DirentTypeDirectory uint8 = 4
// A dirent representing a block device object.
DirentTypeBlockDevice uint8 = 6
// A dirent representing a file object.
DirentTypeFile uint8 = 8
// A dirent representing a socket object.
DirentTypeSocket uint8 = 12
// A dirent representing a service object.
DirentTypeService uint8 = 16
// Nodes which do not have ino values should return this value
// from Readdir and GetAttr.
InoUnknown uint64 = 18446744073709551615
// Indicates the directory being watched has been deleted.
WatchEventDeleted uint8 = 0
// Indicates a node has been created (either new or moved) into a directory.
WatchEventAdded uint8 = 1
// Identifies a node has been removed (either deleted or moved) from the directory.
WatchEventRemoved uint8 = 2
// Identifies a node already existed in the directory when watching started.
WatchEventExisting uint8 = 3
// Identifies that no more `WATCH_EVENT_EXISTING` events will be sent.
WatchEventIdle uint8 = 4
// Used by `Directory.Watch`. Requests transmission of `WATCH_EVENT_DELETED`.
WatchMaskDeleted uint32 = 1
// Used by `Directory.Watch`. Requests transmission of `WATCH_EVENT_ADDED`.
WatchMaskAdded uint32 = 2
// Used by `Directory.Watch`. Requests transmission of `WATCH_EVENT_REMOVED`.
WatchMaskRemoved uint32 = 4
// Used by `Directory.Watch`. Requests transmission of `WATCH_EVENT_EXISTING`.
WatchMaskExisting uint32 = 8
// Used by `Directory.Watch`. Requests transmission of `WATCH_EVENT_IDLE`.
WatchMaskIdle uint32 = 16
// Used by `Directory.Watch`. Requests transmission of all watcher events.
WatchMaskAll uint32 = 31
MountCreateFlagReplace uint32 = 1
MaxFsNameBuffer uint64 = 32
)
// Update the Seek offset.
type SeekOrigin uint32
const (
SeekOriginStart SeekOrigin = 0
SeekOriginCurrent SeekOrigin = 1
SeekOriginEnd SeekOrigin = 2
)
func (x SeekOrigin) String() string {
switch x {
case 0:
return "Start"
case 1:
return "Current"
case 2:
return "End"
}
return "Unknown"
}
// The default protocol, interface information must be acquired some
// other way.
type Service struct {
_ struct{} `fidl:"s,1,1" fidl_size_v1:"1" fidl_alignment_v1:"1" fidl_size_v1_no_ee:"1" fidl_alignment_v1_no_ee:"1"`
}
var _mService = _bindings.CreateLazyMarshaler(Service{})
func (msg *Service) Marshaler() _bindings.Marshaler {
return _mService
}
// The object may be cast to interface 'File'.
type FileObject struct {
_ struct{} `fidl:"s,4,4" fidl_size_v1:"4" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"4" fidl_alignment_v1_no_ee:"4"`
// An optional event which transmits information about an object's readability
// or writability. This event relays information about the underlying object, not
// the capability granted to client: this event may be signalled "readable" on a
// connection that does not have the capability to read.
//
// The "`FILE_SIGNAL_`" values may be observed on this event.
Event _zx.Event `fidl:"0,1" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mFileObject = _bindings.CreateLazyMarshaler(FileObject{})
func (msg *FileObject) Marshaler() _bindings.Marshaler {
return _mFileObject
}
// The object may be cast to interface 'Directory'.
type DirectoryObject struct {
_ struct{} `fidl:"s,1,1" fidl_size_v1:"1" fidl_alignment_v1:"1" fidl_size_v1_no_ee:"1" fidl_alignment_v1_no_ee:"1"`
}
var _mDirectoryObject = _bindings.CreateLazyMarshaler(DirectoryObject{})
func (msg *DirectoryObject) Marshaler() _bindings.Marshaler {
return _mDirectoryObject
}
// The object is accompanied by a pipe.
type Pipe struct {
_ struct{} `fidl:"s,4,4" fidl_size_v1:"4" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"4" fidl_alignment_v1_no_ee:"4"`
Socket _zx.Socket `fidl:"0,0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mPipe = _bindings.CreateLazyMarshaler(Pipe{})
func (msg *Pipe) Marshaler() _bindings.Marshaler {
return _mPipe
}
// The object is accompanied by a socket.
type Socket struct {
_ struct{} `fidl:"s,4,4" fidl_size_v1:"4" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"4" fidl_alignment_v1_no_ee:"4"`
Socket _zx.Socket `fidl:"0,0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mSocket = _bindings.CreateLazyMarshaler(Socket{})
func (msg *Socket) Marshaler() _bindings.Marshaler {
return _mSocket
}
// The object is a file which is represented as an immutable VMO.
// Although a VMO is returned as a part of this structure, this underlying object
// may represent multiple Vmofiles. To identify the logical portion of the VMO
// that represents the single file, an offset and length parameter are also supplied.
type Vmofile struct {
_ struct{} `fidl:"s,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
// The VMO which backs this file.
Vmo _zx.VMO `fidl:"0,0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
// The index into `vmo` which represents the first byte of the file.
Offset uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
// The number of bytes, starting at `offset`, which may be used to represent this file.
Length uint64 `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
}
var _mVmofile = _bindings.CreateLazyMarshaler(Vmofile{})
func (msg *Vmofile) Marshaler() _bindings.Marshaler {
return _mVmofile
}
// The object may be cast to interface 'Device'.
type Device struct {
_ struct{} `fidl:"s,4,4" fidl_size_v1:"4" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"4" fidl_alignment_v1_no_ee:"4"`
// An optional event which transmits information about a device's state.
//
// The "`DEVICE_SIGNAL_`" values may be observed on this event.
Event _zx.Handle `fidl:"0,1" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mDevice = _bindings.CreateLazyMarshaler(Device{})
func (msg *Device) Marshaler() _bindings.Marshaler {
return _mDevice
}
// The object may be cast to interface 'Tty'
type Tty struct {
_ struct{} `fidl:"s,4,4" fidl_size_v1:"4" fidl_alignment_v1:"4" fidl_size_v1_no_ee:"4" fidl_alignment_v1_no_ee:"4"`
Event _zx.Handle `fidl:"0,1" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mTty = _bindings.CreateLazyMarshaler(Tty{})
func (msg *Tty) Marshaler() _bindings.Marshaler {
return _mTty
}
// NodeAttributes defines generic information about a filesystem node.
type NodeAttributes struct {
_ struct{} `fidl:"s,56,8" fidl_size_v1:"56" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"56" fidl_alignment_v1_no_ee:"8"`
// Protection bits and node type information describe in 'mode'.
Mode uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
// A filesystem-unique ID.
Id uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
// Node size, in bytes.
ContentSize uint64 `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
// Space needed to store node (possibly larger than size), in bytes.
StorageSize uint64 `fidl:"24" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
// Hard link count.
LinkCount uint64 `fidl:"32" fidl_offset_v1:"32" fidl_offset_v1_no_ee:"32"`
// Time of creation (may be updated manually after creation) in ns since Unix epoch, UTC.
CreationTime uint64 `fidl:"40" fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
// Time of last modification in ns since Unix epoch, UTC.
ModificationTime uint64 `fidl:"48" fidl_offset_v1:"48" fidl_offset_v1_no_ee:"48"`
}
var _mNodeAttributes = _bindings.CreateLazyMarshaler(NodeAttributes{})
func (msg *NodeAttributes) Marshaler() _bindings.Marshaler {
return _mNodeAttributes
}
// WatchedEvent describes events returned from a DirectoryWatcher.
type WatchedEvent struct {
_ struct{} `fidl:"s,24,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
Event uint8 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Len uint8 `fidl:"1" fidl_offset_v1:"1" fidl_offset_v1_no_ee:"1"`
Name []uint8 `fidl:"8,255" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mWatchedEvent = _bindings.CreateLazyMarshaler(WatchedEvent{})
func (msg *WatchedEvent) Marshaler() _bindings.Marshaler {
return _mWatchedEvent
}
type FilesystemInfo struct {
_ struct{} `fidl:"s,96,8" fidl_size_v1:"96" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"96" fidl_alignment_v1_no_ee:"8"`
// The number of data bytes which may be stored in a filesystem.
TotalBytes uint64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
// The number of data bytes which are in use by the filesystem.
UsedBytes uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
// The number of nodes which may be stored in the filesystem.
TotalNodes uint64 `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
// The number of nodes used by the filesystem.
UsedNodes uint64 `fidl:"24" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
// The amount of space which may be allocated from the underlying
// volume manager. If unsupported, this will be zero.
FreeSharedPoolBytes uint64 `fidl:"32" fidl_offset_v1:"32" fidl_offset_v1_no_ee:"32"`
// A unique identifier for this filesystem instance. Will not be preserved
// across reboots.
FsId uint64 `fidl:"40" fidl_offset_v1:"40" fidl_offset_v1_no_ee:"40"`
// The size of a single filesystem block.
BlockSize uint32 `fidl:"48" fidl_offset_v1:"48" fidl_offset_v1_no_ee:"48"`
// The maximum length of a filesystem name.
MaxFilenameSize uint32 `fidl:"52" fidl_offset_v1:"52" fidl_offset_v1_no_ee:"52"`
// A unique identifier for the type of the underlying filesystem.
FsType uint32 `fidl:"56" fidl_offset_v1:"56" fidl_offset_v1_no_ee:"56"`
Padding uint32 `fidl:"60" fidl_offset_v1:"60" fidl_offset_v1_no_ee:"60"`
Name [32]int8 `fidl:"64" fidl_offset_v1:"64" fidl_offset_v1_no_ee:"64"`
}
var _mFilesystemInfo = _bindings.CreateLazyMarshaler(FilesystemInfo{})
func (msg *FilesystemInfo) Marshaler() _bindings.Marshaler {
return _mFilesystemInfo
}
type I_nodeInfoTag uint32
const (
_ I_nodeInfoTag = iota
NodeInfoService
NodeInfoFile
NodeInfoDirectory
NodeInfoPipe
NodeInfoVmofile
NodeInfoDevice
NodeInfoTty
NodeInfoSocket
)
// Describes how the connection to an should be handled, as well as
// how to interpret the optional handle.
//
// Refer to `Node.Describe()` and `Node.OnOpen()` for usage.
type NodeInfo struct {
I_nodeInfoTag `fidl:"u,32,8" fidl_size_v1:"24" fidl_alignment_v1:"8" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"8"`
Service Service `fidl:"1"`
File FileObject `fidl:"2"`
Directory DirectoryObject `fidl:"3"`
Pipe Pipe `fidl:"4"`
Vmofile Vmofile `fidl:"5"`
Device Device `fidl:"6"`
Tty Tty `fidl:"7"`
Socket Socket `fidl:"8"`
}
func (u *NodeInfo) Which() I_nodeInfoTag {
return u.I_nodeInfoTag
}
func (u *NodeInfo) SetService(service Service) {
u.I_nodeInfoTag = NodeInfoService
u.Service = service
}
func NodeInfoWithService(service Service) NodeInfo {
var _u NodeInfo
_u.SetService(service)
return _u
}
func (u *NodeInfo) SetFile(file FileObject) {
u.I_nodeInfoTag = NodeInfoFile
u.File = file
}
func NodeInfoWithFile(file FileObject) NodeInfo {
var _u NodeInfo
_u.SetFile(file)
return _u
}
func (u *NodeInfo) SetDirectory(directory DirectoryObject) {
u.I_nodeInfoTag = NodeInfoDirectory
u.Directory = directory
}
func NodeInfoWithDirectory(directory DirectoryObject) NodeInfo {
var _u NodeInfo
_u.SetDirectory(directory)
return _u
}
func (u *NodeInfo) SetPipe(pipe Pipe) {
u.I_nodeInfoTag = NodeInfoPipe
u.Pipe = pipe
}
func NodeInfoWithPipe(pipe Pipe) NodeInfo {
var _u NodeInfo
_u.SetPipe(pipe)
return _u
}
func (u *NodeInfo) SetVmofile(vmofile Vmofile) {
u.I_nodeInfoTag = NodeInfoVmofile
u.Vmofile = vmofile
}
func NodeInfoWithVmofile(vmofile Vmofile) NodeInfo {
var _u NodeInfo
_u.SetVmofile(vmofile)
return _u
}
func (u *NodeInfo) SetDevice(device Device) {
u.I_nodeInfoTag = NodeInfoDevice
u.Device = device
}
func NodeInfoWithDevice(device Device) NodeInfo {
var _u NodeInfo
_u.SetDevice(device)
return _u
}
func (u *NodeInfo) SetTty(tty Tty) {
u.I_nodeInfoTag = NodeInfoTty
u.Tty = tty
}
func NodeInfoWithTty(tty Tty) NodeInfo {
var _u NodeInfo
_u.SetTty(tty)
return _u
}
func (u *NodeInfo) SetSocket(socket Socket) {
u.I_nodeInfoTag = NodeInfoSocket
u.Socket = socket
}
func NodeInfoWithSocket(socket Socket) NodeInfo {
var _u NodeInfo
_u.SetSocket(socket)
return _u
}
const (
NodeCloneOrdinal uint64 = 0x17fe6a4c00000000
NodeCloneGenOrdinal uint64 = 0x5a61678f293ce16f
NodeCloseOrdinal uint64 = 0x52b9568700000000
NodeCloseGenOrdinal uint64 = 0x5309c5bd1c33dc44
NodeDescribeOrdinal uint64 = 0x1f62df5e00000000
NodeDescribeGenOrdinal uint64 = 0xffcec215078dea0
NodeOnOpenOrdinal uint64 = 0x4700a7bd00000000
NodeOnOpenGenOrdinal uint64 = 0x7fc7bbb1dbfd1972
NodeSyncOrdinal uint64 = 0x62423faa00000000
NodeSyncGenOrdinal uint64 = 0x189d88326c18b519
NodeGetAttrOrdinal uint64 = 0x4585e7c800000000
NodeGetAttrGenOrdinal uint64 = 0x78985e216314dafd
NodeSetAttrOrdinal uint64 = 0xbd5559a00000000
NodeSetAttrGenOrdinal uint64 = 0x4186c0f40d938f46
NodeNodeGetFlagsOrdinal uint64 = 0x3c24c22300000000
NodeNodeGetFlagsGenOrdinal uint64 = 0x5b88fffb8eda3aa1
NodeNodeSetFlagsOrdinal uint64 = 0x46940c1600000000
NodeNodeSetFlagsGenOrdinal uint64 = 0x5295b76c71fde733
)
type nodeCloneRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Object NodeInterfaceRequest `fidl:"4,0" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mnodeCloneRequest = _bindings.CreateLazyMarshaler(nodeCloneRequest{})
func (msg *nodeCloneRequest) Marshaler() _bindings.Marshaler {
return _mnodeCloneRequest
}
type nodeCloseResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mnodeCloseResponse = _bindings.CreateLazyMarshaler(nodeCloseResponse{})
func (msg *nodeCloseResponse) Marshaler() _bindings.Marshaler {
return _mnodeCloseResponse
}
type nodeDescribeResponse struct {
_ struct{} `fidl:"s,32,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
Info NodeInfo `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mnodeDescribeResponse = _bindings.CreateLazyMarshaler(nodeDescribeResponse{})
func (msg *nodeDescribeResponse) Marshaler() _bindings.Marshaler {
return _mnodeDescribeResponse
}
type nodeOnOpenResponse struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"32" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"32" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Info *NodeInfo `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mnodeOnOpenResponse = _bindings.CreateLazyMarshaler(nodeOnOpenResponse{})
func (msg *nodeOnOpenResponse) Marshaler() _bindings.Marshaler {
return _mnodeOnOpenResponse
}
type nodeSyncResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mnodeSyncResponse = _bindings.CreateLazyMarshaler(nodeSyncResponse{})
func (msg *nodeSyncResponse) Marshaler() _bindings.Marshaler {
return _mnodeSyncResponse
}
type nodeGetAttrResponse struct {
_ struct{} `fidl:"s,64,0" fidl_size_v1:"64" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mnodeGetAttrResponse = _bindings.CreateLazyMarshaler(nodeGetAttrResponse{})
func (msg *nodeGetAttrResponse) Marshaler() _bindings.Marshaler {
return _mnodeGetAttrResponse
}
type nodeSetAttrRequest struct {
_ struct{} `fidl:"s,64,0" fidl_size_v1:"64" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mnodeSetAttrRequest = _bindings.CreateLazyMarshaler(nodeSetAttrRequest{})
func (msg *nodeSetAttrRequest) Marshaler() _bindings.Marshaler {
return _mnodeSetAttrRequest
}
type nodeSetAttrResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mnodeSetAttrResponse = _bindings.CreateLazyMarshaler(nodeSetAttrResponse{})
func (msg *nodeSetAttrResponse) Marshaler() _bindings.Marshaler {
return _mnodeSetAttrResponse
}
type nodeNodeGetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Flags uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mnodeNodeGetFlagsResponse = _bindings.CreateLazyMarshaler(nodeNodeGetFlagsResponse{})
func (msg *nodeNodeGetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mnodeNodeGetFlagsResponse
}
type nodeNodeSetFlagsRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mnodeNodeSetFlagsRequest = _bindings.CreateLazyMarshaler(nodeNodeSetFlagsRequest{})
func (msg *nodeNodeSetFlagsRequest) Marshaler() _bindings.Marshaler {
return _mnodeNodeSetFlagsRequest
}
type nodeNodeSetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mnodeNodeSetFlagsResponse = _bindings.CreateLazyMarshaler(nodeNodeSetFlagsResponse{})
func (msg *nodeNodeSetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mnodeNodeSetFlagsResponse
}
type NodeInterface _bindings.ChannelProxy
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OPEN_RIGHT_*`
// - `OPEN_FLAG_APPEND`
// - `OPEN_FLAG_NO_REMOTE`
// - `OPEN_FLAG_DESCRIBE`
// - `CLONE_FLAG_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OPEN_RIGHT_*` bits in `flags` request corresponding rights over the resulting
// cloned object.
// The cloned object must have rights less than or equal to the original object.
// Alternatively, pass `CLONE_FLAG_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OPEN_RIGHT_*` flags together with
// `CLONE_FLAG_SAME_RIGHTS`.
func (p *NodeInterface) Clone(flags uint32, object NodeInterfaceRequest) error {
req_ := &nodeCloneRequest{
Flags: flags,
Object: object,
}
err := ((*_bindings.ChannelProxy)(p)).Send(NodeCloneOrdinal, req_)
return err
}
// Terminates connection with object.
//
// This method does not require any rights.
func (p *NodeInterface) Close() (int32, error) {
var req_ _bindings.Message
resp_ := &nodeCloseResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(NodeCloseOrdinal, req_, resp_, NodeCloseOrdinal, NodeCloseGenOrdinal)
return resp_.S, err
}
// Returns extra information about the type of the object.
// If the `Describe` operation fails, the connection is closed.
//
// This method does not require any rights.
func (p *NodeInterface) Describe() (NodeInfo, error) {
var req_ _bindings.Message
resp_ := &nodeDescribeResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(NodeDescribeOrdinal, req_, resp_, NodeDescribeOrdinal, NodeDescribeGenOrdinal)
return resp_.Info, err
}
// An event produced eagerly by a FIDL server if requested by `OPEN_FLAG_DESCRIBE`.
//
// Indicates the success or failure of the open operation, and optionally describes the
// object. If the status is `ZX_OK`, `info` contains descriptive information about the object
// (the same as would be returned by `Describe`).
func (p *NodeInterface) ExpectOnOpen() (int32, *NodeInfo, error) {
resp_ := &nodeOnOpenResponse{}
err := ((*_bindings.ChannelProxy)(p)).Recv(NodeOnOpenOrdinal, resp_, NodeOnOpenGenOrdinal)
return resp_.S, resp_.Info, err
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method does not require any rights.
func (p *NodeInterface) Sync() (int32, error) {
var req_ _bindings.Message
resp_ := &nodeSyncResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(NodeSyncOrdinal, req_, resp_, NodeSyncOrdinal, NodeSyncGenOrdinal)
return resp_.S, err
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *NodeInterface) GetAttr() (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &nodeGetAttrResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(NodeGetAttrOrdinal, req_, resp_, NodeGetAttrOrdinal, NodeGetAttrGenOrdinal)
return resp_.S, resp_.Attributes, err
}
// Updates information about the node.
// `flags` may be any of `NODE_ATTRIBUTE_FLAG_*`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *NodeInterface) SetAttr(flags uint32, attributes NodeAttributes) (int32, error) {
req_ := &nodeSetAttrRequest{
Flags: flags,
Attributes: attributes,
}
resp_ := &nodeSetAttrResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(NodeSetAttrOrdinal, req_, resp_, NodeSetAttrOrdinal, NodeSetAttrGenOrdinal)
return resp_.S, err
}
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
// This method has the same functionality as GetFlags for File and is
// meant as an in-progress replacement.
func (p *NodeInterface) NodeGetFlags() (int32, uint32, error) {
var req_ _bindings.Message
resp_ := &nodeNodeGetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(NodeNodeGetFlagsOrdinal, req_, resp_, NodeNodeGetFlagsOrdinal, NodeNodeGetFlagsGenOrdinal)
return resp_.S, resp_.Flags, err
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
// This method has the same functionality as SetFlags for File and is
// meant as an in-progress replacement.
func (p *NodeInterface) NodeSetFlags(flags uint32) (int32, error) {
req_ := &nodeNodeSetFlagsRequest{
Flags: flags,
}
resp_ := &nodeNodeSetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(NodeNodeSetFlagsOrdinal, req_, resp_, NodeNodeSetFlagsOrdinal, NodeNodeSetFlagsGenOrdinal)
return resp_.S, err
}
// Node defines the minimal interface for entities which can be accessed in a filesystem.
type Node interface {
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OPEN_RIGHT_*`
// - `OPEN_FLAG_APPEND`
// - `OPEN_FLAG_NO_REMOTE`
// - `OPEN_FLAG_DESCRIBE`
// - `CLONE_FLAG_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OPEN_RIGHT_*` bits in `flags` request corresponding rights over the resulting
// cloned object.
// The cloned object must have rights less than or equal to the original object.
// Alternatively, pass `CLONE_FLAG_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OPEN_RIGHT_*` flags together with
// `CLONE_FLAG_SAME_RIGHTS`.
Clone(flags uint32, object NodeInterfaceRequest) error
// Terminates connection with object.
//
// This method does not require any rights.
Close() (int32, error)
// Returns extra information about the type of the object.
// If the `Describe` operation fails, the connection is closed.
//
// This method does not require any rights.
Describe() (NodeInfo, error)
// An event produced eagerly by a FIDL server if requested by `OPEN_FLAG_DESCRIBE`.
//
// Indicates the success or failure of the open operation, and optionally describes the
// object. If the status is `ZX_OK`, `info` contains descriptive information about the object
// (the same as would be returned by `Describe`).
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method does not require any rights.
Sync() (int32, error)
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr() (int32, NodeAttributes, error)
// Updates information about the node.
// `flags` may be any of `NODE_ATTRIBUTE_FLAG_*`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
SetAttr(flags uint32, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
// This method has the same functionality as GetFlags for File and is
// meant as an in-progress replacement.
NodeGetFlags() (int32, uint32, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
// This method has the same functionality as SetFlags for File and is
// meant as an in-progress replacement.
NodeSetFlags(flags uint32) (int32, error)
}
type NodeTransitionalBase struct{}
func (_ *NodeTransitionalBase) NodeGetFlags() (int32, uint32, error) {
panic("Not Implemented")
}
func (_ *NodeTransitionalBase) NodeSetFlags(flags uint32) (int32, error) {
panic("Not Implemented")
}
type NodeInterfaceRequest _bindings.InterfaceRequest
func NewNodeInterfaceRequest() (NodeInterfaceRequest, *NodeInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return NodeInterfaceRequest(req), (*NodeInterface)(cli), err
}
type NodeStub struct {
Impl Node
}
func (s_ *NodeStub) DispatchImpl(ordinal_ uint64, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
var ctx_ _bindings.MarshalerContext
return s_.DispatchImplWithCtx(ordinal_, ctx_, data_, handles_)
}
func (s_ *NodeStub) DispatchImplWithCtx(ordinal_ uint64, ctx_ _bindings.MarshalerContext, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
switch ordinal_ {
case NodeCloneOrdinal:
fallthrough
case NodeCloneGenOrdinal:
in_ := nodeCloneRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(in_.Flags, in_.Object)
return nil, false, err_
case NodeCloseOrdinal:
fallthrough
case NodeCloseGenOrdinal:
s, err_ := s_.Impl.Close()
out_ := nodeCloseResponse{}
out_.S = s
return &out_, true, err_
case NodeDescribeOrdinal:
fallthrough
case NodeDescribeGenOrdinal:
info, err_ := s_.Impl.Describe()
out_ := nodeDescribeResponse{}
out_.Info = info
return &out_, true, err_
case NodeSyncOrdinal:
fallthrough
case NodeSyncGenOrdinal:
s, err_ := s_.Impl.Sync()
out_ := nodeSyncResponse{}
out_.S = s
return &out_, true, err_
case NodeGetAttrOrdinal:
fallthrough
case NodeGetAttrGenOrdinal:
s, attributes, err_ := s_.Impl.GetAttr()
out_ := nodeGetAttrResponse{}
out_.S = s
out_.Attributes = attributes
return &out_, true, err_
case NodeSetAttrOrdinal:
fallthrough
case NodeSetAttrGenOrdinal:
in_ := nodeSetAttrRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(in_.Flags, in_.Attributes)
out_ := nodeSetAttrResponse{}
out_.S = s
return &out_, true, err_
case NodeNodeGetFlagsOrdinal:
fallthrough
case NodeNodeGetFlagsGenOrdinal:
s, flags, err_ := s_.Impl.NodeGetFlags()
out_ := nodeNodeGetFlagsResponse{}
out_.S = s
out_.Flags = flags
return &out_, true, err_
case NodeNodeSetFlagsOrdinal:
fallthrough
case NodeNodeSetFlagsGenOrdinal:
in_ := nodeNodeSetFlagsRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.NodeSetFlags(in_.Flags)
out_ := nodeNodeSetFlagsResponse{}
out_.S = s
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type NodeService struct {
_bindings.BindingSet
}
func (s *NodeService) Add(impl Node, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) {
return s.BindingSet.Add(&NodeStub{Impl: impl}, c, onError)
}
func (s *NodeService) EventProxyFor(key _bindings.BindingKey) (*NodeEventProxy, bool) {
pxy, err := s.BindingSet.ProxyFor(key)
return (*NodeEventProxy)(pxy), err
}
type NodeEventProxy _bindings.ChannelProxy
func (p *NodeEventProxy) OnOpen(s int32, info *NodeInfo) error {
event_ := &nodeOnOpenResponse{
S: s,
Info: info,
}
return ((*_bindings.ChannelProxy)(p)).Send(NodeOnOpenOrdinal, event_)
}
const (
FileCloneOrdinal uint64 = 0x17fe6a4c00000000
FileCloneGenOrdinal uint64 = 0x5a61678f293ce16f
FileCloseOrdinal uint64 = 0x52b9568700000000
FileCloseGenOrdinal uint64 = 0x5309c5bd1c33dc44
FileDescribeOrdinal uint64 = 0x1f62df5e00000000
FileDescribeGenOrdinal uint64 = 0xffcec215078dea0
FileOnOpenOrdinal uint64 = 0x4700a7bd00000000
FileOnOpenGenOrdinal uint64 = 0x7fc7bbb1dbfd1972
FileSyncOrdinal uint64 = 0x62423faa00000000
FileSyncGenOrdinal uint64 = 0x189d88326c18b519
FileGetAttrOrdinal uint64 = 0x4585e7c800000000
FileGetAttrGenOrdinal uint64 = 0x78985e216314dafd
FileSetAttrOrdinal uint64 = 0xbd5559a00000000
FileSetAttrGenOrdinal uint64 = 0x4186c0f40d938f46
FileNodeGetFlagsOrdinal uint64 = 0x3c24c22300000000
FileNodeGetFlagsGenOrdinal uint64 = 0x5b88fffb8eda3aa1
FileNodeSetFlagsOrdinal uint64 = 0x46940c1600000000
FileNodeSetFlagsGenOrdinal uint64 = 0x5295b76c71fde733
FileReadOrdinal uint64 = 0x25f7418400000000
FileReadGenOrdinal uint64 = 0x29b2b7074c95208c
FileReadAtOrdinal uint64 = 0x7c724dc400000000
FileReadAtGenOrdinal uint64 = 0x6527ee3fbc9c5749
FileWriteOrdinal uint64 = 0x512e7a000000000
FileWriteGenOrdinal uint64 = 0x3b6432f57914225b
FileWriteAtOrdinal uint64 = 0x3e5522e500000000
FileWriteAtGenOrdinal uint64 = 0x4b29e1582ab379e4
FileSeekOrdinal uint64 = 0x782a774500000000
FileSeekGenOrdinal uint64 = 0x324968e9b8a0e394
FileTruncateOrdinal uint64 = 0x42ab3a3a00000000
FileTruncateGenOrdinal uint64 = 0x5ec8f337359a2ddb
FileGetFlagsOrdinal uint64 = 0x6416a3f600000000
FileGetFlagsGenOrdinal uint64 = 0x200be82ca523ab96
FileSetFlagsOrdinal uint64 = 0x3f23cc7600000000
FileSetFlagsGenOrdinal uint64 = 0x713f375258671141
FileGetBufferOrdinal uint64 = 0x74c3097300000000
FileGetBufferGenOrdinal uint64 = 0x4b93b8486666d951
)
type fileCloneRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Object NodeInterfaceRequest `fidl:"4,0" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mfileCloneRequest = _bindings.CreateLazyMarshaler(fileCloneRequest{})
func (msg *fileCloneRequest) Marshaler() _bindings.Marshaler {
return _mfileCloneRequest
}
type fileCloseResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileCloseResponse = _bindings.CreateLazyMarshaler(fileCloseResponse{})
func (msg *fileCloseResponse) Marshaler() _bindings.Marshaler {
return _mfileCloseResponse
}
type fileDescribeResponse struct {
_ struct{} `fidl:"s,32,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
Info NodeInfo `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileDescribeResponse = _bindings.CreateLazyMarshaler(fileDescribeResponse{})
func (msg *fileDescribeResponse) Marshaler() _bindings.Marshaler {
return _mfileDescribeResponse
}
type fileOnOpenResponse struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"32" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"32" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Info *NodeInfo `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileOnOpenResponse = _bindings.CreateLazyMarshaler(fileOnOpenResponse{})
func (msg *fileOnOpenResponse) Marshaler() _bindings.Marshaler {
return _mfileOnOpenResponse
}
type fileSyncResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileSyncResponse = _bindings.CreateLazyMarshaler(fileSyncResponse{})
func (msg *fileSyncResponse) Marshaler() _bindings.Marshaler {
return _mfileSyncResponse
}
type fileGetAttrResponse struct {
_ struct{} `fidl:"s,64,0" fidl_size_v1:"64" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileGetAttrResponse = _bindings.CreateLazyMarshaler(fileGetAttrResponse{})
func (msg *fileGetAttrResponse) Marshaler() _bindings.Marshaler {
return _mfileGetAttrResponse
}
type fileSetAttrRequest struct {
_ struct{} `fidl:"s,64,0" fidl_size_v1:"64" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileSetAttrRequest = _bindings.CreateLazyMarshaler(fileSetAttrRequest{})
func (msg *fileSetAttrRequest) Marshaler() _bindings.Marshaler {
return _mfileSetAttrRequest
}
type fileSetAttrResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileSetAttrResponse = _bindings.CreateLazyMarshaler(fileSetAttrResponse{})
func (msg *fileSetAttrResponse) Marshaler() _bindings.Marshaler {
return _mfileSetAttrResponse
}
type fileNodeGetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Flags uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mfileNodeGetFlagsResponse = _bindings.CreateLazyMarshaler(fileNodeGetFlagsResponse{})
func (msg *fileNodeGetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mfileNodeGetFlagsResponse
}
type fileNodeSetFlagsRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileNodeSetFlagsRequest = _bindings.CreateLazyMarshaler(fileNodeSetFlagsRequest{})
func (msg *fileNodeSetFlagsRequest) Marshaler() _bindings.Marshaler {
return _mfileNodeSetFlagsRequest
}
type fileNodeSetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileNodeSetFlagsResponse = _bindings.CreateLazyMarshaler(fileNodeSetFlagsResponse{})
func (msg *fileNodeSetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mfileNodeSetFlagsResponse
}
type fileReadRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Count uint64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileReadRequest = _bindings.CreateLazyMarshaler(fileReadRequest{})
func (msg *fileReadRequest) Marshaler() _bindings.Marshaler {
return _mfileReadRequest
}
type fileReadResponse struct {
_ struct{} `fidl:"s,24,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Data []uint8 `fidl:"8,8192" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileReadResponse = _bindings.CreateLazyMarshaler(fileReadResponse{})
func (msg *fileReadResponse) Marshaler() _bindings.Marshaler {
return _mfileReadResponse
}
type fileReadAtRequest struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
Count uint64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Offset uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileReadAtRequest = _bindings.CreateLazyMarshaler(fileReadAtRequest{})
func (msg *fileReadAtRequest) Marshaler() _bindings.Marshaler {
return _mfileReadAtRequest
}
type fileReadAtResponse struct {
_ struct{} `fidl:"s,24,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Data []uint8 `fidl:"8,8192" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileReadAtResponse = _bindings.CreateLazyMarshaler(fileReadAtResponse{})
func (msg *fileReadAtResponse) Marshaler() _bindings.Marshaler {
return _mfileReadAtResponse
}
type fileWriteRequest struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
Data []uint8 `fidl:"0,8192" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileWriteRequest = _bindings.CreateLazyMarshaler(fileWriteRequest{})
func (msg *fileWriteRequest) Marshaler() _bindings.Marshaler {
return _mfileWriteRequest
}
type fileWriteResponse struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Actual uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileWriteResponse = _bindings.CreateLazyMarshaler(fileWriteResponse{})
func (msg *fileWriteResponse) Marshaler() _bindings.Marshaler {
return _mfileWriteResponse
}
type fileWriteAtRequest struct {
_ struct{} `fidl:"s,24,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
Data []uint8 `fidl:"0,8192" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Offset uint64 `fidl:"16" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
}
var _mfileWriteAtRequest = _bindings.CreateLazyMarshaler(fileWriteAtRequest{})
func (msg *fileWriteAtRequest) Marshaler() _bindings.Marshaler {
return _mfileWriteAtRequest
}
type fileWriteAtResponse struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Actual uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileWriteAtResponse = _bindings.CreateLazyMarshaler(fileWriteAtResponse{})
func (msg *fileWriteAtResponse) Marshaler() _bindings.Marshaler {
return _mfileWriteAtResponse
}
type fileSeekRequest struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
Offset int64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Start SeekOrigin `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileSeekRequest = _bindings.CreateLazyMarshaler(fileSeekRequest{})
func (msg *fileSeekRequest) Marshaler() _bindings.Marshaler {
return _mfileSeekRequest
}
type fileSeekResponse struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Offset uint64 `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileSeekResponse = _bindings.CreateLazyMarshaler(fileSeekResponse{})
func (msg *fileSeekResponse) Marshaler() _bindings.Marshaler {
return _mfileSeekResponse
}
type fileTruncateRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Length uint64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileTruncateRequest = _bindings.CreateLazyMarshaler(fileTruncateRequest{})
func (msg *fileTruncateRequest) Marshaler() _bindings.Marshaler {
return _mfileTruncateRequest
}
type fileTruncateResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileTruncateResponse = _bindings.CreateLazyMarshaler(fileTruncateResponse{})
func (msg *fileTruncateResponse) Marshaler() _bindings.Marshaler {
return _mfileTruncateResponse
}
type fileGetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Flags uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mfileGetFlagsResponse = _bindings.CreateLazyMarshaler(fileGetFlagsResponse{})
func (msg *fileGetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mfileGetFlagsResponse
}
type fileSetFlagsRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileSetFlagsRequest = _bindings.CreateLazyMarshaler(fileSetFlagsRequest{})
func (msg *fileSetFlagsRequest) Marshaler() _bindings.Marshaler {
return _mfileSetFlagsRequest
}
type fileSetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileSetFlagsResponse = _bindings.CreateLazyMarshaler(fileSetFlagsResponse{})
func (msg *fileSetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mfileSetFlagsResponse
}
type fileGetBufferRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mfileGetBufferRequest = _bindings.CreateLazyMarshaler(fileGetBufferRequest{})
func (msg *fileGetBufferRequest) Marshaler() _bindings.Marshaler {
return _mfileGetBufferRequest
}
type fileGetBufferResponse struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Buffer *fuchsiamem.Buffer `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mfileGetBufferResponse = _bindings.CreateLazyMarshaler(fileGetBufferResponse{})
func (msg *fileGetBufferResponse) Marshaler() _bindings.Marshaler {
return _mfileGetBufferResponse
}
type FileInterface _bindings.ChannelProxy
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OPEN_RIGHT_*`
// - `OPEN_FLAG_APPEND`
// - `OPEN_FLAG_NO_REMOTE`
// - `OPEN_FLAG_DESCRIBE`
// - `CLONE_FLAG_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OPEN_RIGHT_*` bits in `flags` request corresponding rights over the resulting
// cloned object.
// The cloned object must have rights less than or equal to the original object.
// Alternatively, pass `CLONE_FLAG_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OPEN_RIGHT_*` flags together with
// `CLONE_FLAG_SAME_RIGHTS`.
func (p *FileInterface) Clone(flags uint32, object NodeInterfaceRequest) error {
req_ := &fileCloneRequest{
Flags: flags,
Object: object,
}
err := ((*_bindings.ChannelProxy)(p)).Send(FileCloneOrdinal, req_)
return err
}
// Terminates connection with object.
//
// This method does not require any rights.
func (p *FileInterface) Close() (int32, error) {
var req_ _bindings.Message
resp_ := &fileCloseResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileCloseOrdinal, req_, resp_, FileCloseOrdinal, FileCloseGenOrdinal)
return resp_.S, err
}
// Returns extra information about the type of the object.
// If the `Describe` operation fails, the connection is closed.
//
// This method does not require any rights.
func (p *FileInterface) Describe() (NodeInfo, error) {
var req_ _bindings.Message
resp_ := &fileDescribeResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileDescribeOrdinal, req_, resp_, FileDescribeOrdinal, FileDescribeGenOrdinal)
return resp_.Info, err
}
// An event produced eagerly by a FIDL server if requested by `OPEN_FLAG_DESCRIBE`.
//
// Indicates the success or failure of the open operation, and optionally describes the
// object. If the status is `ZX_OK`, `info` contains descriptive information about the object
// (the same as would be returned by `Describe`).
func (p *FileInterface) ExpectOnOpen() (int32, *NodeInfo, error) {
resp_ := &fileOnOpenResponse{}
err := ((*_bindings.ChannelProxy)(p)).Recv(FileOnOpenOrdinal, resp_, FileOnOpenGenOrdinal)
return resp_.S, resp_.Info, err
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method does not require any rights.
func (p *FileInterface) Sync() (int32, error) {
var req_ _bindings.Message
resp_ := &fileSyncResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileSyncOrdinal, req_, resp_, FileSyncOrdinal, FileSyncGenOrdinal)
return resp_.S, err
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *FileInterface) GetAttr() (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &fileGetAttrResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileGetAttrOrdinal, req_, resp_, FileGetAttrOrdinal, FileGetAttrGenOrdinal)
return resp_.S, resp_.Attributes, err
}
// Updates information about the node.
// `flags` may be any of `NODE_ATTRIBUTE_FLAG_*`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *FileInterface) SetAttr(flags uint32, attributes NodeAttributes) (int32, error) {
req_ := &fileSetAttrRequest{
Flags: flags,
Attributes: attributes,
}
resp_ := &fileSetAttrResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileSetAttrOrdinal, req_, resp_, FileSetAttrOrdinal, FileSetAttrGenOrdinal)
return resp_.S, err
}
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
// This method has the same functionality as GetFlags for File and is
// meant as an in-progress replacement.
func (p *FileInterface) NodeGetFlags() (int32, uint32, error) {
var req_ _bindings.Message
resp_ := &fileNodeGetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileNodeGetFlagsOrdinal, req_, resp_, FileNodeGetFlagsOrdinal, FileNodeGetFlagsGenOrdinal)
return resp_.S, resp_.Flags, err
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
// This method has the same functionality as SetFlags for File and is
// meant as an in-progress replacement.
func (p *FileInterface) NodeSetFlags(flags uint32) (int32, error) {
req_ := &fileNodeSetFlagsRequest{
Flags: flags,
}
resp_ := &fileNodeSetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileNodeSetFlagsOrdinal, req_, resp_, FileNodeSetFlagsOrdinal, FileNodeSetFlagsGenOrdinal)
return resp_.S, err
}
// Reads `count` bytes at the seek offset.
// The seek offset is moved forward by the number of bytes read.
//
// This method requires following rights: `OPEN_RIGHT_READABLE`.
func (p *FileInterface) Read(count uint64) (int32, []uint8, error) {
req_ := &fileReadRequest{
Count: count,
}
resp_ := &fileReadResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileReadOrdinal, req_, resp_, FileReadOrdinal, FileReadGenOrdinal)
return resp_.S, resp_.Data, err
}
// Reads `count` bytes at the provided offset.
// Does not affect the seek offset.
//
// This method requires following rights: `OPEN_RIGHT_READABLE`.
func (p *FileInterface) ReadAt(count uint64, offset uint64) (int32, []uint8, error) {
req_ := &fileReadAtRequest{
Count: count,
Offset: offset,
}
resp_ := &fileReadAtResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileReadAtOrdinal, req_, resp_, FileReadAtOrdinal, FileReadAtGenOrdinal)
return resp_.S, resp_.Data, err
}
// Writes data at the seek offset.
// The seek offset is moved forward by the number of bytes written.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *FileInterface) Write(data []uint8) (int32, uint64, error) {
req_ := &fileWriteRequest{
Data: data,
}
resp_ := &fileWriteResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileWriteOrdinal, req_, resp_, FileWriteOrdinal, FileWriteGenOrdinal)
return resp_.S, resp_.Actual, err
}
// Writes data to the provided offset.
// Does not affect the seek offset.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *FileInterface) WriteAt(data []uint8, offset uint64) (int32, uint64, error) {
req_ := &fileWriteAtRequest{
Data: data,
Offset: offset,
}
resp_ := &fileWriteAtResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileWriteAtOrdinal, req_, resp_, FileWriteAtOrdinal, FileWriteAtGenOrdinal)
return resp_.S, resp_.Actual, err
}
// Moves the offset at which the next invocation of `Read()` or `Write()` will
// occur.
//
// This method does not require any rights.
func (p *FileInterface) Seek(offset int64, start SeekOrigin) (int32, uint64, error) {
req_ := &fileSeekRequest{
Offset: offset,
Start: start,
}
resp_ := &fileSeekResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileSeekOrdinal, req_, resp_, FileSeekOrdinal, FileSeekGenOrdinal)
return resp_.S, resp_.Offset, err
}
// Shrinks the file size to 'length' bytes.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *FileInterface) Truncate(length uint64) (int32, error) {
req_ := &fileTruncateRequest{
Length: length,
}
resp_ := &fileTruncateResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileTruncateOrdinal, req_, resp_, FileTruncateOrdinal, FileTruncateGenOrdinal)
return resp_.S, err
}
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
func (p *FileInterface) GetFlags() (int32, uint32, error) {
var req_ _bindings.Message
resp_ := &fileGetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileGetFlagsOrdinal, req_, resp_, FileGetFlagsOrdinal, FileGetFlagsGenOrdinal)
return resp_.S, resp_.Flags, err
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
func (p *FileInterface) SetFlags(flags uint32) (int32, error) {
req_ := &fileSetFlagsRequest{
Flags: flags,
}
resp_ := &fileSetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileSetFlagsOrdinal, req_, resp_, FileSetFlagsOrdinal, FileSetFlagsGenOrdinal)
return resp_.S, err
}
// Acquires a buffer representing this file, if there is one, with the
// requested access rights.
//
// `flags` may be any of `VMO_FLAG_*`.
//
// This method requires following rights:
//
// - `OPEN_RIGHT_WRITABLE` if `flags` includes `VMO_FLAG_WRITE`.
// - `OPEN_RIGHT_READABLE` if `flags` includes `VMO_FLAG_READ` or `VMO_FLAG_EXEC`.
func (p *FileInterface) GetBuffer(flags uint32) (int32, *fuchsiamem.Buffer, error) {
req_ := &fileGetBufferRequest{
Flags: flags,
}
resp_ := &fileGetBufferResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(FileGetBufferOrdinal, req_, resp_, FileGetBufferOrdinal, FileGetBufferGenOrdinal)
return resp_.S, resp_.Buffer, err
}
// File defines the interface of a node which contains a flat layout of data.
type File interface {
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OPEN_RIGHT_*`
// - `OPEN_FLAG_APPEND`
// - `OPEN_FLAG_NO_REMOTE`
// - `OPEN_FLAG_DESCRIBE`
// - `CLONE_FLAG_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OPEN_RIGHT_*` bits in `flags` request corresponding rights over the resulting
// cloned object.
// The cloned object must have rights less than or equal to the original object.
// Alternatively, pass `CLONE_FLAG_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OPEN_RIGHT_*` flags together with
// `CLONE_FLAG_SAME_RIGHTS`.
Clone(flags uint32, object NodeInterfaceRequest) error
// Terminates connection with object.
//
// This method does not require any rights.
Close() (int32, error)
// Returns extra information about the type of the object.
// If the `Describe` operation fails, the connection is closed.
//
// This method does not require any rights.
Describe() (NodeInfo, error)
// An event produced eagerly by a FIDL server if requested by `OPEN_FLAG_DESCRIBE`.
//
// Indicates the success or failure of the open operation, and optionally describes the
// object. If the status is `ZX_OK`, `info` contains descriptive information about the object
// (the same as would be returned by `Describe`).
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method does not require any rights.
Sync() (int32, error)
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr() (int32, NodeAttributes, error)
// Updates information about the node.
// `flags` may be any of `NODE_ATTRIBUTE_FLAG_*`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
SetAttr(flags uint32, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
// This method has the same functionality as GetFlags for File and is
// meant as an in-progress replacement.
NodeGetFlags() (int32, uint32, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
// This method has the same functionality as SetFlags for File and is
// meant as an in-progress replacement.
NodeSetFlags(flags uint32) (int32, error)
// Reads `count` bytes at the seek offset.
// The seek offset is moved forward by the number of bytes read.
//
// This method requires following rights: `OPEN_RIGHT_READABLE`.
Read(count uint64) (int32, []uint8, error)
// Reads `count` bytes at the provided offset.
// Does not affect the seek offset.
//
// This method requires following rights: `OPEN_RIGHT_READABLE`.
ReadAt(count uint64, offset uint64) (int32, []uint8, error)
// Writes data at the seek offset.
// The seek offset is moved forward by the number of bytes written.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
Write(data []uint8) (int32, uint64, error)
// Writes data to the provided offset.
// Does not affect the seek offset.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
WriteAt(data []uint8, offset uint64) (int32, uint64, error)
// Moves the offset at which the next invocation of `Read()` or `Write()` will
// occur.
//
// This method does not require any rights.
Seek(offset int64, start SeekOrigin) (int32, uint64, error)
// Shrinks the file size to 'length' bytes.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
Truncate(length uint64) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
GetFlags() (int32, uint32, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
SetFlags(flags uint32) (int32, error)
// Acquires a buffer representing this file, if there is one, with the
// requested access rights.
//
// `flags` may be any of `VMO_FLAG_*`.
//
// This method requires following rights:
//
// - `OPEN_RIGHT_WRITABLE` if `flags` includes `VMO_FLAG_WRITE`.
// - `OPEN_RIGHT_READABLE` if `flags` includes `VMO_FLAG_READ` or `VMO_FLAG_EXEC`.
GetBuffer(flags uint32) (int32, *fuchsiamem.Buffer, error)
}
type FileTransitionalBase struct{}
func (_ *FileTransitionalBase) NodeGetFlags() (int32, uint32, error) {
panic("Not Implemented")
}
func (_ *FileTransitionalBase) NodeSetFlags(flags uint32) (int32, error) {
panic("Not Implemented")
}
type FileInterfaceRequest _bindings.InterfaceRequest
func NewFileInterfaceRequest() (FileInterfaceRequest, *FileInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return FileInterfaceRequest(req), (*FileInterface)(cli), err
}
type FileStub struct {
Impl File
}
func (s_ *FileStub) DispatchImpl(ordinal_ uint64, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
var ctx_ _bindings.MarshalerContext
return s_.DispatchImplWithCtx(ordinal_, ctx_, data_, handles_)
}
func (s_ *FileStub) DispatchImplWithCtx(ordinal_ uint64, ctx_ _bindings.MarshalerContext, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
switch ordinal_ {
case FileCloneOrdinal:
fallthrough
case FileCloneGenOrdinal:
in_ := fileCloneRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(in_.Flags, in_.Object)
return nil, false, err_
case FileCloseOrdinal:
fallthrough
case FileCloseGenOrdinal:
s, err_ := s_.Impl.Close()
out_ := fileCloseResponse{}
out_.S = s
return &out_, true, err_
case FileDescribeOrdinal:
fallthrough
case FileDescribeGenOrdinal:
info, err_ := s_.Impl.Describe()
out_ := fileDescribeResponse{}
out_.Info = info
return &out_, true, err_
case FileSyncOrdinal:
fallthrough
case FileSyncGenOrdinal:
s, err_ := s_.Impl.Sync()
out_ := fileSyncResponse{}
out_.S = s
return &out_, true, err_
case FileGetAttrOrdinal:
fallthrough
case FileGetAttrGenOrdinal:
s, attributes, err_ := s_.Impl.GetAttr()
out_ := fileGetAttrResponse{}
out_.S = s
out_.Attributes = attributes
return &out_, true, err_
case FileSetAttrOrdinal:
fallthrough
case FileSetAttrGenOrdinal:
in_ := fileSetAttrRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(in_.Flags, in_.Attributes)
out_ := fileSetAttrResponse{}
out_.S = s
return &out_, true, err_
case FileNodeGetFlagsOrdinal:
fallthrough
case FileNodeGetFlagsGenOrdinal:
s, flags, err_ := s_.Impl.NodeGetFlags()
out_ := fileNodeGetFlagsResponse{}
out_.S = s
out_.Flags = flags
return &out_, true, err_
case FileNodeSetFlagsOrdinal:
fallthrough
case FileNodeSetFlagsGenOrdinal:
in_ := fileNodeSetFlagsRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.NodeSetFlags(in_.Flags)
out_ := fileNodeSetFlagsResponse{}
out_.S = s
return &out_, true, err_
case FileReadOrdinal:
fallthrough
case FileReadGenOrdinal:
in_ := fileReadRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, data, err_ := s_.Impl.Read(in_.Count)
out_ := fileReadResponse{}
out_.S = s
out_.Data = data
return &out_, true, err_
case FileReadAtOrdinal:
fallthrough
case FileReadAtGenOrdinal:
in_ := fileReadAtRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, data, err_ := s_.Impl.ReadAt(in_.Count, in_.Offset)
out_ := fileReadAtResponse{}
out_.S = s
out_.Data = data
return &out_, true, err_
case FileWriteOrdinal:
fallthrough
case FileWriteGenOrdinal:
in_ := fileWriteRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, actual, err_ := s_.Impl.Write(in_.Data)
out_ := fileWriteResponse{}
out_.S = s
out_.Actual = actual
return &out_, true, err_
case FileWriteAtOrdinal:
fallthrough
case FileWriteAtGenOrdinal:
in_ := fileWriteAtRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, actual, err_ := s_.Impl.WriteAt(in_.Data, in_.Offset)
out_ := fileWriteAtResponse{}
out_.S = s
out_.Actual = actual
return &out_, true, err_
case FileSeekOrdinal:
fallthrough
case FileSeekGenOrdinal:
in_ := fileSeekRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, offset, err_ := s_.Impl.Seek(in_.Offset, in_.Start)
out_ := fileSeekResponse{}
out_.S = s
out_.Offset = offset
return &out_, true, err_
case FileTruncateOrdinal:
fallthrough
case FileTruncateGenOrdinal:
in_ := fileTruncateRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Truncate(in_.Length)
out_ := fileTruncateResponse{}
out_.S = s
return &out_, true, err_
case FileGetFlagsOrdinal:
fallthrough
case FileGetFlagsGenOrdinal:
s, flags, err_ := s_.Impl.GetFlags()
out_ := fileGetFlagsResponse{}
out_.S = s
out_.Flags = flags
return &out_, true, err_
case FileSetFlagsOrdinal:
fallthrough
case FileSetFlagsGenOrdinal:
in_ := fileSetFlagsRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetFlags(in_.Flags)
out_ := fileSetFlagsResponse{}
out_.S = s
return &out_, true, err_
case FileGetBufferOrdinal:
fallthrough
case FileGetBufferGenOrdinal:
in_ := fileGetBufferRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, buffer, err_ := s_.Impl.GetBuffer(in_.Flags)
out_ := fileGetBufferResponse{}
out_.S = s
out_.Buffer = buffer
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type FileService struct {
_bindings.BindingSet
}
func (s *FileService) Add(impl File, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) {
return s.BindingSet.Add(&FileStub{Impl: impl}, c, onError)
}
func (s *FileService) EventProxyFor(key _bindings.BindingKey) (*FileEventProxy, bool) {
pxy, err := s.BindingSet.ProxyFor(key)
return (*FileEventProxy)(pxy), err
}
type FileEventProxy _bindings.ChannelProxy
func (p *FileEventProxy) OnOpen(s int32, info *NodeInfo) error {
event_ := &fileOnOpenResponse{
S: s,
Info: info,
}
return ((*_bindings.ChannelProxy)(p)).Send(FileOnOpenOrdinal, event_)
}
const (
DirectoryWatcherOnEventOrdinal uint64 = 0x208bcc9d00000000
DirectoryWatcherOnEventGenOrdinal uint64 = 0x3937a088fe53412a
)
type directoryWatcherOnEventRequest struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
Events []uint8 `fidl:"0,8192" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryWatcherOnEventRequest = _bindings.CreateLazyMarshaler(directoryWatcherOnEventRequest{})
func (msg *directoryWatcherOnEventRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryWatcherOnEventRequest
}
type DirectoryWatcherInterface _bindings.ChannelProxy
func (p *DirectoryWatcherInterface) OnEvent(events []uint8) error {
req_ := &directoryWatcherOnEventRequest{
Events: events,
}
err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryWatcherOnEventOrdinal, req_)
return err
}
// DirectoryWatcher transmits messages from a filesystem server
// about events happening in the filesystem. Clients can register
// new watchers using the `Directory.Watch` method, where they can
// filter which events they want to receive notifications for.
type DirectoryWatcher interface {
OnEvent(events []uint8) error
}
type DirectoryWatcherTransitionalBase struct{}
type DirectoryWatcherInterfaceRequest _bindings.InterfaceRequest
func NewDirectoryWatcherInterfaceRequest() (DirectoryWatcherInterfaceRequest, *DirectoryWatcherInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return DirectoryWatcherInterfaceRequest(req), (*DirectoryWatcherInterface)(cli), err
}
type DirectoryWatcherStub struct {
Impl DirectoryWatcher
}
func (s_ *DirectoryWatcherStub) DispatchImpl(ordinal_ uint64, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
var ctx_ _bindings.MarshalerContext
return s_.DispatchImplWithCtx(ordinal_, ctx_, data_, handles_)
}
func (s_ *DirectoryWatcherStub) DispatchImplWithCtx(ordinal_ uint64, ctx_ _bindings.MarshalerContext, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
switch ordinal_ {
case DirectoryWatcherOnEventOrdinal:
fallthrough
case DirectoryWatcherOnEventGenOrdinal:
in_ := directoryWatcherOnEventRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.OnEvent(in_.Events)
return nil, false, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type DirectoryWatcherService struct {
_bindings.BindingSet
}
func (s *DirectoryWatcherService) Add(impl DirectoryWatcher, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) {
return s.BindingSet.Add(&DirectoryWatcherStub{Impl: impl}, c, onError)
}
func (s *DirectoryWatcherService) EventProxyFor(key _bindings.BindingKey) (*DirectoryWatcherEventProxy, bool) {
pxy, err := s.BindingSet.ProxyFor(key)
return (*DirectoryWatcherEventProxy)(pxy), err
}
type DirectoryWatcherEventProxy _bindings.ChannelProxy
const (
DirectoryCloneOrdinal uint64 = 0x17fe6a4c00000000
DirectoryCloneGenOrdinal uint64 = 0x5a61678f293ce16f
DirectoryCloseOrdinal uint64 = 0x52b9568700000000
DirectoryCloseGenOrdinal uint64 = 0x5309c5bd1c33dc44
DirectoryDescribeOrdinal uint64 = 0x1f62df5e00000000
DirectoryDescribeGenOrdinal uint64 = 0xffcec215078dea0
DirectoryOnOpenOrdinal uint64 = 0x4700a7bd00000000
DirectoryOnOpenGenOrdinal uint64 = 0x7fc7bbb1dbfd1972
DirectorySyncOrdinal uint64 = 0x62423faa00000000
DirectorySyncGenOrdinal uint64 = 0x189d88326c18b519
DirectoryGetAttrOrdinal uint64 = 0x4585e7c800000000
DirectoryGetAttrGenOrdinal uint64 = 0x78985e216314dafd
DirectorySetAttrOrdinal uint64 = 0xbd5559a00000000
DirectorySetAttrGenOrdinal uint64 = 0x4186c0f40d938f46
DirectoryNodeGetFlagsOrdinal uint64 = 0x3c24c22300000000
DirectoryNodeGetFlagsGenOrdinal uint64 = 0x5b88fffb8eda3aa1
DirectoryNodeSetFlagsOrdinal uint64 = 0x46940c1600000000
DirectoryNodeSetFlagsGenOrdinal uint64 = 0x5295b76c71fde733
DirectoryOpenOrdinal uint64 = 0x77e4cceb00000000
DirectoryOpenGenOrdinal uint64 = 0x2c5044561d685ec0
DirectoryUnlinkOrdinal uint64 = 0x2cbadb1900000000
DirectoryUnlinkGenOrdinal uint64 = 0x5a0ff90760a8bc23
DirectoryReadDirentsOrdinal uint64 = 0x2ea53c2d00000000
DirectoryReadDirentsGenOrdinal uint64 = 0x3582806bf27faa0a
DirectoryRewindOrdinal uint64 = 0x7072fd8700000000
DirectoryRewindGenOrdinal uint64 = 0x16b1202af0f34c71
DirectoryGetTokenOrdinal uint64 = 0x3217bced00000000
DirectoryGetTokenGenOrdinal uint64 = 0x26ae9d18763c8655
DirectoryRenameOrdinal uint64 = 0x4a94b0ac00000000
DirectoryRenameGenOrdinal uint64 = 0xa8e00a247f3c905
DirectoryLinkOrdinal uint64 = 0x1b8a5e6400000000
DirectoryLinkGenOrdinal uint64 = 0x740604c0c7c930e7
DirectoryWatchOrdinal uint64 = 0x5ac28f3400000000
DirectoryWatchGenOrdinal uint64 = 0x5717193a59d66d91
)
type directoryCloneRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Object NodeInterfaceRequest `fidl:"4,0" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mdirectoryCloneRequest = _bindings.CreateLazyMarshaler(directoryCloneRequest{})
func (msg *directoryCloneRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryCloneRequest
}
type directoryCloseResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryCloseResponse = _bindings.CreateLazyMarshaler(directoryCloseResponse{})
func (msg *directoryCloseResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryCloseResponse
}
type directoryDescribeResponse struct {
_ struct{} `fidl:"s,32,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
Info NodeInfo `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryDescribeResponse = _bindings.CreateLazyMarshaler(directoryDescribeResponse{})
func (msg *directoryDescribeResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryDescribeResponse
}
type directoryOnOpenResponse struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"32" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"32" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Info *NodeInfo `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryOnOpenResponse = _bindings.CreateLazyMarshaler(directoryOnOpenResponse{})
func (msg *directoryOnOpenResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryOnOpenResponse
}
type directorySyncResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectorySyncResponse = _bindings.CreateLazyMarshaler(directorySyncResponse{})
func (msg *directorySyncResponse) Marshaler() _bindings.Marshaler {
return _mdirectorySyncResponse
}
type directoryGetAttrResponse struct {
_ struct{} `fidl:"s,64,0" fidl_size_v1:"64" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryGetAttrResponse = _bindings.CreateLazyMarshaler(directoryGetAttrResponse{})
func (msg *directoryGetAttrResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryGetAttrResponse
}
type directorySetAttrRequest struct {
_ struct{} `fidl:"s,64,0" fidl_size_v1:"64" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectorySetAttrRequest = _bindings.CreateLazyMarshaler(directorySetAttrRequest{})
func (msg *directorySetAttrRequest) Marshaler() _bindings.Marshaler {
return _mdirectorySetAttrRequest
}
type directorySetAttrResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectorySetAttrResponse = _bindings.CreateLazyMarshaler(directorySetAttrResponse{})
func (msg *directorySetAttrResponse) Marshaler() _bindings.Marshaler {
return _mdirectorySetAttrResponse
}
type directoryNodeGetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Flags uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mdirectoryNodeGetFlagsResponse = _bindings.CreateLazyMarshaler(directoryNodeGetFlagsResponse{})
func (msg *directoryNodeGetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryNodeGetFlagsResponse
}
type directoryNodeSetFlagsRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryNodeSetFlagsRequest = _bindings.CreateLazyMarshaler(directoryNodeSetFlagsRequest{})
func (msg *directoryNodeSetFlagsRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryNodeSetFlagsRequest
}
type directoryNodeSetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryNodeSetFlagsResponse = _bindings.CreateLazyMarshaler(directoryNodeSetFlagsResponse{})
func (msg *directoryNodeSetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryNodeSetFlagsResponse
}
type directoryOpenRequest struct {
_ struct{} `fidl:"s,32,0" fidl_size_v1:"32" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"32" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Mode uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
Path string `fidl:"8,4096" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
Object NodeInterfaceRequest `fidl:"24,0" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
}
var _mdirectoryOpenRequest = _bindings.CreateLazyMarshaler(directoryOpenRequest{})
func (msg *directoryOpenRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryOpenRequest
}
type directoryUnlinkRequest struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
Path string `fidl:"0,4096" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryUnlinkRequest = _bindings.CreateLazyMarshaler(directoryUnlinkRequest{})
func (msg *directoryUnlinkRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryUnlinkRequest
}
type directoryUnlinkResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryUnlinkResponse = _bindings.CreateLazyMarshaler(directoryUnlinkResponse{})
func (msg *directoryUnlinkResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryUnlinkResponse
}
type directoryReadDirentsRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
MaxBytes uint64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryReadDirentsRequest = _bindings.CreateLazyMarshaler(directoryReadDirentsRequest{})
func (msg *directoryReadDirentsRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryReadDirentsRequest
}
type directoryReadDirentsResponse struct {
_ struct{} `fidl:"s,24,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Dirents []uint8 `fidl:"8,8192" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryReadDirentsResponse = _bindings.CreateLazyMarshaler(directoryReadDirentsResponse{})
func (msg *directoryReadDirentsResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryReadDirentsResponse
}
type directoryRewindResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryRewindResponse = _bindings.CreateLazyMarshaler(directoryRewindResponse{})
func (msg *directoryRewindResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryRewindResponse
}
type directoryGetTokenResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Token _zx.Handle `fidl:"4,1" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mdirectoryGetTokenResponse = _bindings.CreateLazyMarshaler(directoryGetTokenResponse{})
func (msg *directoryGetTokenResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryGetTokenResponse
}
type directoryRenameRequest struct {
_ struct{} `fidl:"s,40,0" fidl_size_v1:"40" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"0"`
Src string `fidl:"0,4096" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
DstParentToken _zx.Handle `fidl:"16,0" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
Dst string `fidl:"24,4096" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
}
var _mdirectoryRenameRequest = _bindings.CreateLazyMarshaler(directoryRenameRequest{})
func (msg *directoryRenameRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryRenameRequest
}
type directoryRenameResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryRenameResponse = _bindings.CreateLazyMarshaler(directoryRenameResponse{})
func (msg *directoryRenameResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryRenameResponse
}
type directoryLinkRequest struct {
_ struct{} `fidl:"s,40,0" fidl_size_v1:"40" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"0"`
Src string `fidl:"0,4096" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
DstParentToken _zx.Handle `fidl:"16,0" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
Dst string `fidl:"24,4096" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
}
var _mdirectoryLinkRequest = _bindings.CreateLazyMarshaler(directoryLinkRequest{})
func (msg *directoryLinkRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryLinkRequest
}
type directoryLinkResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryLinkResponse = _bindings.CreateLazyMarshaler(directoryLinkResponse{})
func (msg *directoryLinkResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryLinkResponse
}
type directoryWatchRequest struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
Mask uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Options uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
Watcher _zx.Channel `fidl:"8,0" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryWatchRequest = _bindings.CreateLazyMarshaler(directoryWatchRequest{})
func (msg *directoryWatchRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryWatchRequest
}
type directoryWatchResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryWatchResponse = _bindings.CreateLazyMarshaler(directoryWatchResponse{})
func (msg *directoryWatchResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryWatchResponse
}
type DirectoryInterface _bindings.ChannelProxy
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OPEN_RIGHT_*`
// - `OPEN_FLAG_APPEND`
// - `OPEN_FLAG_NO_REMOTE`
// - `OPEN_FLAG_DESCRIBE`
// - `CLONE_FLAG_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OPEN_RIGHT_*` bits in `flags` request corresponding rights over the resulting
// cloned object.
// The cloned object must have rights less than or equal to the original object.
// Alternatively, pass `CLONE_FLAG_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OPEN_RIGHT_*` flags together with
// `CLONE_FLAG_SAME_RIGHTS`.
func (p *DirectoryInterface) Clone(flags uint32, object NodeInterfaceRequest) error {
req_ := &directoryCloneRequest{
Flags: flags,
Object: object,
}
err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryCloneOrdinal, req_)
return err
}
// Terminates connection with object.
//
// This method does not require any rights.
func (p *DirectoryInterface) Close() (int32, error) {
var req_ _bindings.Message
resp_ := &directoryCloseResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryCloseOrdinal, req_, resp_, DirectoryCloseOrdinal, DirectoryCloseGenOrdinal)
return resp_.S, err
}
// Returns extra information about the type of the object.
// If the `Describe` operation fails, the connection is closed.
//
// This method does not require any rights.
func (p *DirectoryInterface) Describe() (NodeInfo, error) {
var req_ _bindings.Message
resp_ := &directoryDescribeResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryDescribeOrdinal, req_, resp_, DirectoryDescribeOrdinal, DirectoryDescribeGenOrdinal)
return resp_.Info, err
}
// An event produced eagerly by a FIDL server if requested by `OPEN_FLAG_DESCRIBE`.
//
// Indicates the success or failure of the open operation, and optionally describes the
// object. If the status is `ZX_OK`, `info` contains descriptive information about the object
// (the same as would be returned by `Describe`).
func (p *DirectoryInterface) ExpectOnOpen() (int32, *NodeInfo, error) {
resp_ := &directoryOnOpenResponse{}
err := ((*_bindings.ChannelProxy)(p)).Recv(DirectoryOnOpenOrdinal, resp_, DirectoryOnOpenGenOrdinal)
return resp_.S, resp_.Info, err
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method does not require any rights.
func (p *DirectoryInterface) Sync() (int32, error) {
var req_ _bindings.Message
resp_ := &directorySyncResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectorySyncOrdinal, req_, resp_, DirectorySyncOrdinal, DirectorySyncGenOrdinal)
return resp_.S, err
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *DirectoryInterface) GetAttr() (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &directoryGetAttrResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetAttrOrdinal, req_, resp_, DirectoryGetAttrOrdinal, DirectoryGetAttrGenOrdinal)
return resp_.S, resp_.Attributes, err
}
// Updates information about the node.
// `flags` may be any of `NODE_ATTRIBUTE_FLAG_*`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryInterface) SetAttr(flags uint32, attributes NodeAttributes) (int32, error) {
req_ := &directorySetAttrRequest{
Flags: flags,
Attributes: attributes,
}
resp_ := &directorySetAttrResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectorySetAttrOrdinal, req_, resp_, DirectorySetAttrOrdinal, DirectorySetAttrGenOrdinal)
return resp_.S, err
}
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
// This method has the same functionality as GetFlags for File and is
// meant as an in-progress replacement.
func (p *DirectoryInterface) NodeGetFlags() (int32, uint32, error) {
var req_ _bindings.Message
resp_ := &directoryNodeGetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryNodeGetFlagsOrdinal, req_, resp_, DirectoryNodeGetFlagsOrdinal, DirectoryNodeGetFlagsGenOrdinal)
return resp_.S, resp_.Flags, err
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
// This method has the same functionality as SetFlags for File and is
// meant as an in-progress replacement.
func (p *DirectoryInterface) NodeSetFlags(flags uint32) (int32, error) {
req_ := &directoryNodeSetFlagsRequest{
Flags: flags,
}
resp_ := &directoryNodeSetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryNodeSetFlagsOrdinal, req_, resp_, DirectoryNodeSetFlagsOrdinal, DirectoryNodeSetFlagsGenOrdinal)
return resp_.S, err
}
// Opens a new object relative to this directory object.
//
// `path` may contain multiple segments, separated by "/" characters,
// and should never be empty; i.e., "" is an invalid path.
//
// `flags` may be any of the `OPEN_FLAG_*` and `OPEN_RIGHT_*` values, bitwise ORed together.
// The `OPEN_FLAG_DESCRIBE` flag may cause an `OnOpen` event to be transmitted
// on the `object` handle, indicating the type of object opened.
//
// If an unknown value is sent for either flags or mode, the connection should
// be closed.
//
// `OPEN_RIGHT_*` flags provided in `flags` will restrict access rights on
// the `object` channel which will be connected to the opened entity.
//
// Rights are never increased. When you open a nested entity within a directory, you may only
// request the same rights as what the directory connection already has, or a subset of those.
// Exceeding those rights causes an access denied error to be transmitted in the
// `OnOpen` event if applicable, and the `object` connection closed.
//
// The caller must specify either one or more of the `OPEN_RIGHT_*` flags, or
// the `OPEN_FLAG_NODE_REFERENCE` flag.
func (p *DirectoryInterface) Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error {
req_ := &directoryOpenRequest{
Flags: flags,
Mode: mode,
Path: path,
Object: object,
}
err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryOpenOrdinal, req_)
return err
}
// Detaches an object from this directory object.
//
// The underlying object may or may not be deleted after this method
// completes: although the link will be removed from the containing directory,
// objects with multiple references (such as files which are still open)
// will not actually be destroyed until all references are removed.
//
// If a directory is unlinked while it still has an open reference,
// it must become read-only, preventing new entries from being created
// until all references close and the directory is destroyed.
//
// `path` identifies the file which should be detached.
// If `path` contains multiple segments, separated by "/" characters,
// then the directory is traversed, one segment at a time, relative to the
// originally accessed Directory.
//
// Returns:
// `ZX_ERR_ACCESS_DENIED` if the connection (or the underlying filesystem) does not
// allow writable access.
// `ZX_ERR_INVALID_ARGS` if `path` contains ".." segments.
// `ZX_ERR_NOT_EMPTY` if `path` refers to a non-empty directory.
// `ZX_ERR_UNAVAILABLE` if `path` refers to a mount point, containing a remote channel.
// `ZX_ERR_UNAVAILABLE` if `path` is ".".
//
// Other errors may be returned for filesystem-specific reasons.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryInterface) Unlink(path string) (int32, error) {
req_ := &directoryUnlinkRequest{
Path: path,
}
resp_ := &directoryUnlinkResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryUnlinkOrdinal, req_, resp_, DirectoryUnlinkOrdinal, DirectoryUnlinkGenOrdinal)
return resp_.S, err
}
// Reads a collection of variably sized dirents into a buffer.
// The number of dirents in a directory may be very large: akin to
// calling read multiple times on a file, directories have a seek
// offset which is updated on subsequent calls to ReadDirents.
//
// These dirents are of the form:
// ```
// struct dirent {
// // Describes the inode of the entry.
// uint64 ino;
// // Describes the length of the dirent name in bytes.
// uint8 size;
// // Describes the type of the entry. Aligned with the
// // POSIX d_type values. Use `DIRENT_TYPE_*` constants.
// uint8 type;
// // Unterminated name of entry.
// char name[0];
// }
// ```
//
// This method does not require any rights, since one could always probe for
// directory contents by triggering name conflicts during file creation.
func (p *DirectoryInterface) ReadDirents(maxBytes uint64) (int32, []uint8, error) {
req_ := &directoryReadDirentsRequest{
MaxBytes: maxBytes,
}
resp_ := &directoryReadDirentsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryReadDirentsOrdinal, req_, resp_, DirectoryReadDirentsOrdinal, DirectoryReadDirentsGenOrdinal)
return resp_.S, resp_.Dirents, err
}
// Resets the directory seek offset.
//
// This method does not require any rights, similar to ReadDirents.
func (p *DirectoryInterface) Rewind() (int32, error) {
var req_ _bindings.Message
resp_ := &directoryRewindResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryRewindOrdinal, req_, resp_, DirectoryRewindOrdinal, DirectoryRewindGenOrdinal)
return resp_.S, err
}
// Acquires a token to a Directory which can be used to identify
// access to it at a later point in time.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryInterface) GetToken() (int32, _zx.Handle, error) {
var req_ _bindings.Message
resp_ := &directoryGetTokenResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetTokenOrdinal, req_, resp_, DirectoryGetTokenOrdinal, DirectoryGetTokenGenOrdinal)
return resp_.S, resp_.Token, err
}
// Renames an object named src to the name dst, in a directory represented by token.
//
// `src/dst` must be resolved object names. Including "/" in any position
// other than the end of the string will return `ZX_ERR_INVALID_ARGS`.
// Returning "/" at the end of either string implies that it must be a
// directory, or else `ZX_ERR_NOT_DIR` should be returned.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryInterface) Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error) {
req_ := &directoryRenameRequest{
Src: src,
DstParentToken: dstParentToken,
Dst: dst,
}
resp_ := &directoryRenameResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryRenameOrdinal, req_, resp_, DirectoryRenameOrdinal, DirectoryRenameGenOrdinal)
return resp_.S, err
}
// Creates a link to an object named src by the name dst, within a directory represented by
// token.
//
// `src` must be a resolved object name. Including "/" in the string will
// return `ZX_ERR_INVALID_ARGS`.
//
// `dst` must be a resolved object name. Including "/" in the string will
// return `ZX_ERR_INVALID_ARGS`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryInterface) Link(src string, dstParentToken _zx.Handle, dst string) (int32, error) {
req_ := &directoryLinkRequest{
Src: src,
DstParentToken: dstParentToken,
Dst: dst,
}
resp_ := &directoryLinkResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryLinkOrdinal, req_, resp_, DirectoryLinkOrdinal, DirectoryLinkGenOrdinal)
return resp_.S, err
}
// Watches a directory, receiving events of added messages on the
// watcher request channel.
//
// The `watcher` handle will send messages of the form:
// ```
// struct {
// uint8 event;
// uint8 len;
// char name[];
// };
// ```
// Where names are NOT null-terminated.
//
// This API is unstable; in the future, watcher will be a `DirectoryWatcher` client.
//
// Mask specifies a bitmask of events to observe.
// Options must be zero; it is reserved.
//
// This method does not require any rights, similar to ReadDirents.
func (p *DirectoryInterface) Watch(mask uint32, options uint32, watcher _zx.Channel) (int32, error) {
req_ := &directoryWatchRequest{
Mask: mask,
Options: options,
Watcher: watcher,
}
resp_ := &directoryWatchResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryWatchOrdinal, req_, resp_, DirectoryWatchOrdinal, DirectoryWatchGenOrdinal)
return resp_.S, err
}
// Directory defines a node which is capable of containing other Objects.
type Directory interface {
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OPEN_RIGHT_*`
// - `OPEN_FLAG_APPEND`
// - `OPEN_FLAG_NO_REMOTE`
// - `OPEN_FLAG_DESCRIBE`
// - `CLONE_FLAG_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OPEN_RIGHT_*` bits in `flags` request corresponding rights over the resulting
// cloned object.
// The cloned object must have rights less than or equal to the original object.
// Alternatively, pass `CLONE_FLAG_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OPEN_RIGHT_*` flags together with
// `CLONE_FLAG_SAME_RIGHTS`.
Clone(flags uint32, object NodeInterfaceRequest) error
// Terminates connection with object.
//
// This method does not require any rights.
Close() (int32, error)
// Returns extra information about the type of the object.
// If the `Describe` operation fails, the connection is closed.
//
// This method does not require any rights.
Describe() (NodeInfo, error)
// An event produced eagerly by a FIDL server if requested by `OPEN_FLAG_DESCRIBE`.
//
// Indicates the success or failure of the open operation, and optionally describes the
// object. If the status is `ZX_OK`, `info` contains descriptive information about the object
// (the same as would be returned by `Describe`).
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method does not require any rights.
Sync() (int32, error)
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr() (int32, NodeAttributes, error)
// Updates information about the node.
// `flags` may be any of `NODE_ATTRIBUTE_FLAG_*`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
SetAttr(flags uint32, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
// This method has the same functionality as GetFlags for File and is
// meant as an in-progress replacement.
NodeGetFlags() (int32, uint32, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
// This method has the same functionality as SetFlags for File and is
// meant as an in-progress replacement.
NodeSetFlags(flags uint32) (int32, error)
// Opens a new object relative to this directory object.
//
// `path` may contain multiple segments, separated by "/" characters,
// and should never be empty; i.e., "" is an invalid path.
//
// `flags` may be any of the `OPEN_FLAG_*` and `OPEN_RIGHT_*` values, bitwise ORed together.
// The `OPEN_FLAG_DESCRIBE` flag may cause an `OnOpen` event to be transmitted
// on the `object` handle, indicating the type of object opened.
//
// If an unknown value is sent for either flags or mode, the connection should
// be closed.
//
// `OPEN_RIGHT_*` flags provided in `flags` will restrict access rights on
// the `object` channel which will be connected to the opened entity.
//
// Rights are never increased. When you open a nested entity within a directory, you may only
// request the same rights as what the directory connection already has, or a subset of those.
// Exceeding those rights causes an access denied error to be transmitted in the
// `OnOpen` event if applicable, and the `object` connection closed.
//
// The caller must specify either one or more of the `OPEN_RIGHT_*` flags, or
// the `OPEN_FLAG_NODE_REFERENCE` flag.
Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error
// Detaches an object from this directory object.
//
// The underlying object may or may not be deleted after this method
// completes: although the link will be removed from the containing directory,
// objects with multiple references (such as files which are still open)
// will not actually be destroyed until all references are removed.
//
// If a directory is unlinked while it still has an open reference,
// it must become read-only, preventing new entries from being created
// until all references close and the directory is destroyed.
//
// `path` identifies the file which should be detached.
// If `path` contains multiple segments, separated by "/" characters,
// then the directory is traversed, one segment at a time, relative to the
// originally accessed Directory.
//
// Returns:
// `ZX_ERR_ACCESS_DENIED` if the connection (or the underlying filesystem) does not
// allow writable access.
// `ZX_ERR_INVALID_ARGS` if `path` contains ".." segments.
// `ZX_ERR_NOT_EMPTY` if `path` refers to a non-empty directory.
// `ZX_ERR_UNAVAILABLE` if `path` refers to a mount point, containing a remote channel.
// `ZX_ERR_UNAVAILABLE` if `path` is ".".
//
// Other errors may be returned for filesystem-specific reasons.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
Unlink(path string) (int32, error)
// Reads a collection of variably sized dirents into a buffer.
// The number of dirents in a directory may be very large: akin to
// calling read multiple times on a file, directories have a seek
// offset which is updated on subsequent calls to ReadDirents.
//
// These dirents are of the form:
// ```
// struct dirent {
// // Describes the inode of the entry.
// uint64 ino;
// // Describes the length of the dirent name in bytes.
// uint8 size;
// // Describes the type of the entry. Aligned with the
// // POSIX d_type values. Use `DIRENT_TYPE_*` constants.
// uint8 type;
// // Unterminated name of entry.
// char name[0];
// }
// ```
//
// This method does not require any rights, since one could always probe for
// directory contents by triggering name conflicts during file creation.
ReadDirents(maxBytes uint64) (int32, []uint8, error)
// Resets the directory seek offset.
//
// This method does not require any rights, similar to ReadDirents.
Rewind() (int32, error)
// Acquires a token to a Directory which can be used to identify
// access to it at a later point in time.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
GetToken() (int32, _zx.Handle, error)
// Renames an object named src to the name dst, in a directory represented by token.
//
// `src/dst` must be resolved object names. Including "/" in any position
// other than the end of the string will return `ZX_ERR_INVALID_ARGS`.
// Returning "/" at the end of either string implies that it must be a
// directory, or else `ZX_ERR_NOT_DIR` should be returned.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error)
// Creates a link to an object named src by the name dst, within a directory represented by
// token.
//
// `src` must be a resolved object name. Including "/" in the string will
// return `ZX_ERR_INVALID_ARGS`.
//
// `dst` must be a resolved object name. Including "/" in the string will
// return `ZX_ERR_INVALID_ARGS`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
Link(src string, dstParentToken _zx.Handle, dst string) (int32, error)
// Watches a directory, receiving events of added messages on the
// watcher request channel.
//
// The `watcher` handle will send messages of the form:
// ```
// struct {
// uint8 event;
// uint8 len;
// char name[];
// };
// ```
// Where names are NOT null-terminated.
//
// This API is unstable; in the future, watcher will be a `DirectoryWatcher` client.
//
// Mask specifies a bitmask of events to observe.
// Options must be zero; it is reserved.
//
// This method does not require any rights, similar to ReadDirents.
Watch(mask uint32, options uint32, watcher _zx.Channel) (int32, error)
}
type DirectoryTransitionalBase struct{}
func (_ *DirectoryTransitionalBase) NodeGetFlags() (int32, uint32, error) {
panic("Not Implemented")
}
func (_ *DirectoryTransitionalBase) NodeSetFlags(flags uint32) (int32, error) {
panic("Not Implemented")
}
type DirectoryInterfaceRequest _bindings.InterfaceRequest
func NewDirectoryInterfaceRequest() (DirectoryInterfaceRequest, *DirectoryInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return DirectoryInterfaceRequest(req), (*DirectoryInterface)(cli), err
}
type DirectoryStub struct {
Impl Directory
}
func (s_ *DirectoryStub) DispatchImpl(ordinal_ uint64, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
var ctx_ _bindings.MarshalerContext
return s_.DispatchImplWithCtx(ordinal_, ctx_, data_, handles_)
}
func (s_ *DirectoryStub) DispatchImplWithCtx(ordinal_ uint64, ctx_ _bindings.MarshalerContext, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
switch ordinal_ {
case DirectoryCloneOrdinal:
fallthrough
case DirectoryCloneGenOrdinal:
in_ := directoryCloneRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(in_.Flags, in_.Object)
return nil, false, err_
case DirectoryCloseOrdinal:
fallthrough
case DirectoryCloseGenOrdinal:
s, err_ := s_.Impl.Close()
out_ := directoryCloseResponse{}
out_.S = s
return &out_, true, err_
case DirectoryDescribeOrdinal:
fallthrough
case DirectoryDescribeGenOrdinal:
info, err_ := s_.Impl.Describe()
out_ := directoryDescribeResponse{}
out_.Info = info
return &out_, true, err_
case DirectorySyncOrdinal:
fallthrough
case DirectorySyncGenOrdinal:
s, err_ := s_.Impl.Sync()
out_ := directorySyncResponse{}
out_.S = s
return &out_, true, err_
case DirectoryGetAttrOrdinal:
fallthrough
case DirectoryGetAttrGenOrdinal:
s, attributes, err_ := s_.Impl.GetAttr()
out_ := directoryGetAttrResponse{}
out_.S = s
out_.Attributes = attributes
return &out_, true, err_
case DirectorySetAttrOrdinal:
fallthrough
case DirectorySetAttrGenOrdinal:
in_ := directorySetAttrRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(in_.Flags, in_.Attributes)
out_ := directorySetAttrResponse{}
out_.S = s
return &out_, true, err_
case DirectoryNodeGetFlagsOrdinal:
fallthrough
case DirectoryNodeGetFlagsGenOrdinal:
s, flags, err_ := s_.Impl.NodeGetFlags()
out_ := directoryNodeGetFlagsResponse{}
out_.S = s
out_.Flags = flags
return &out_, true, err_
case DirectoryNodeSetFlagsOrdinal:
fallthrough
case DirectoryNodeSetFlagsGenOrdinal:
in_ := directoryNodeSetFlagsRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.NodeSetFlags(in_.Flags)
out_ := directoryNodeSetFlagsResponse{}
out_.S = s
return &out_, true, err_
case DirectoryOpenOrdinal:
fallthrough
case DirectoryOpenGenOrdinal:
in_ := directoryOpenRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Open(in_.Flags, in_.Mode, in_.Path, in_.Object)
return nil, false, err_
case DirectoryUnlinkOrdinal:
fallthrough
case DirectoryUnlinkGenOrdinal:
in_ := directoryUnlinkRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Unlink(in_.Path)
out_ := directoryUnlinkResponse{}
out_.S = s
return &out_, true, err_
case DirectoryReadDirentsOrdinal:
fallthrough
case DirectoryReadDirentsGenOrdinal:
in_ := directoryReadDirentsRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, dirents, err_ := s_.Impl.ReadDirents(in_.MaxBytes)
out_ := directoryReadDirentsResponse{}
out_.S = s
out_.Dirents = dirents
return &out_, true, err_
case DirectoryRewindOrdinal:
fallthrough
case DirectoryRewindGenOrdinal:
s, err_ := s_.Impl.Rewind()
out_ := directoryRewindResponse{}
out_.S = s
return &out_, true, err_
case DirectoryGetTokenOrdinal:
fallthrough
case DirectoryGetTokenGenOrdinal:
s, token, err_ := s_.Impl.GetToken()
out_ := directoryGetTokenResponse{}
out_.S = s
out_.Token = token
return &out_, true, err_
case DirectoryRenameOrdinal:
fallthrough
case DirectoryRenameGenOrdinal:
in_ := directoryRenameRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Rename(in_.Src, in_.DstParentToken, in_.Dst)
out_ := directoryRenameResponse{}
out_.S = s
return &out_, true, err_
case DirectoryLinkOrdinal:
fallthrough
case DirectoryLinkGenOrdinal:
in_ := directoryLinkRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Link(in_.Src, in_.DstParentToken, in_.Dst)
out_ := directoryLinkResponse{}
out_.S = s
return &out_, true, err_
case DirectoryWatchOrdinal:
fallthrough
case DirectoryWatchGenOrdinal:
in_ := directoryWatchRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Watch(in_.Mask, in_.Options, in_.Watcher)
out_ := directoryWatchResponse{}
out_.S = s
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type DirectoryService struct {
_bindings.BindingSet
}
func (s *DirectoryService) Add(impl Directory, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) {
return s.BindingSet.Add(&DirectoryStub{Impl: impl}, c, onError)
}
func (s *DirectoryService) EventProxyFor(key _bindings.BindingKey) (*DirectoryEventProxy, bool) {
pxy, err := s.BindingSet.ProxyFor(key)
return (*DirectoryEventProxy)(pxy), err
}
type DirectoryEventProxy _bindings.ChannelProxy
func (p *DirectoryEventProxy) OnOpen(s int32, info *NodeInfo) error {
event_ := &directoryOnOpenResponse{
S: s,
Info: info,
}
return ((*_bindings.ChannelProxy)(p)).Send(DirectoryOnOpenOrdinal, event_)
}
const (
DirectoryAdminCloneOrdinal uint64 = 0x17fe6a4c00000000
DirectoryAdminCloneGenOrdinal uint64 = 0x5a61678f293ce16f
DirectoryAdminCloseOrdinal uint64 = 0x52b9568700000000
DirectoryAdminCloseGenOrdinal uint64 = 0x5309c5bd1c33dc44
DirectoryAdminDescribeOrdinal uint64 = 0x1f62df5e00000000
DirectoryAdminDescribeGenOrdinal uint64 = 0xffcec215078dea0
DirectoryAdminOnOpenOrdinal uint64 = 0x4700a7bd00000000
DirectoryAdminOnOpenGenOrdinal uint64 = 0x7fc7bbb1dbfd1972
DirectoryAdminSyncOrdinal uint64 = 0x62423faa00000000
DirectoryAdminSyncGenOrdinal uint64 = 0x189d88326c18b519
DirectoryAdminGetAttrOrdinal uint64 = 0x4585e7c800000000
DirectoryAdminGetAttrGenOrdinal uint64 = 0x78985e216314dafd
DirectoryAdminSetAttrOrdinal uint64 = 0xbd5559a00000000
DirectoryAdminSetAttrGenOrdinal uint64 = 0x4186c0f40d938f46
DirectoryAdminNodeGetFlagsOrdinal uint64 = 0x3c24c22300000000
DirectoryAdminNodeGetFlagsGenOrdinal uint64 = 0x5b88fffb8eda3aa1
DirectoryAdminNodeSetFlagsOrdinal uint64 = 0x46940c1600000000
DirectoryAdminNodeSetFlagsGenOrdinal uint64 = 0x5295b76c71fde733
DirectoryAdminOpenOrdinal uint64 = 0x77e4cceb00000000
DirectoryAdminOpenGenOrdinal uint64 = 0x2c5044561d685ec0
DirectoryAdminUnlinkOrdinal uint64 = 0x2cbadb1900000000
DirectoryAdminUnlinkGenOrdinal uint64 = 0x5a0ff90760a8bc23
DirectoryAdminReadDirentsOrdinal uint64 = 0x2ea53c2d00000000
DirectoryAdminReadDirentsGenOrdinal uint64 = 0x3582806bf27faa0a
DirectoryAdminRewindOrdinal uint64 = 0x7072fd8700000000
DirectoryAdminRewindGenOrdinal uint64 = 0x16b1202af0f34c71
DirectoryAdminGetTokenOrdinal uint64 = 0x3217bced00000000
DirectoryAdminGetTokenGenOrdinal uint64 = 0x26ae9d18763c8655
DirectoryAdminRenameOrdinal uint64 = 0x4a94b0ac00000000
DirectoryAdminRenameGenOrdinal uint64 = 0xa8e00a247f3c905
DirectoryAdminLinkOrdinal uint64 = 0x1b8a5e6400000000
DirectoryAdminLinkGenOrdinal uint64 = 0x740604c0c7c930e7
DirectoryAdminWatchOrdinal uint64 = 0x5ac28f3400000000
DirectoryAdminWatchGenOrdinal uint64 = 0x5717193a59d66d91
DirectoryAdminMountOrdinal uint64 = 0x7e5f12e600000000
DirectoryAdminMountGenOrdinal uint64 = 0xfa166d1522c27d0
DirectoryAdminMountAndCreateOrdinal uint64 = 0x3225f69100000000
DirectoryAdminMountAndCreateGenOrdinal uint64 = 0x7bc782242022b3b3
DirectoryAdminUnmountOrdinal uint64 = 0x2502275400000000
DirectoryAdminUnmountGenOrdinal uint64 = 0x7da45d654c35c9a4
DirectoryAdminUnmountNodeOrdinal uint64 = 0x16da38a700000000
DirectoryAdminUnmountNodeGenOrdinal uint64 = 0x26b9d90ebe5f93db
DirectoryAdminQueryFilesystemOrdinal uint64 = 0x66298d9200000000
DirectoryAdminQueryFilesystemGenOrdinal uint64 = 0x4a879480f1d7875d
DirectoryAdminGetDevicePathOrdinal uint64 = 0x2ef70eb800000000
DirectoryAdminGetDevicePathGenOrdinal uint64 = 0x76f2e3c7331f815b
)
type directoryAdminCloneRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Object NodeInterfaceRequest `fidl:"4,0" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mdirectoryAdminCloneRequest = _bindings.CreateLazyMarshaler(directoryAdminCloneRequest{})
func (msg *directoryAdminCloneRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminCloneRequest
}
type directoryAdminCloseResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminCloseResponse = _bindings.CreateLazyMarshaler(directoryAdminCloseResponse{})
func (msg *directoryAdminCloseResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminCloseResponse
}
type directoryAdminDescribeResponse struct {
_ struct{} `fidl:"s,32,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
Info NodeInfo `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminDescribeResponse = _bindings.CreateLazyMarshaler(directoryAdminDescribeResponse{})
func (msg *directoryAdminDescribeResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminDescribeResponse
}
type directoryAdminOnOpenResponse struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"32" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"32" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Info *NodeInfo `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryAdminOnOpenResponse = _bindings.CreateLazyMarshaler(directoryAdminOnOpenResponse{})
func (msg *directoryAdminOnOpenResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminOnOpenResponse
}
type directoryAdminSyncResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminSyncResponse = _bindings.CreateLazyMarshaler(directoryAdminSyncResponse{})
func (msg *directoryAdminSyncResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminSyncResponse
}
type directoryAdminGetAttrResponse struct {
_ struct{} `fidl:"s,64,0" fidl_size_v1:"64" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryAdminGetAttrResponse = _bindings.CreateLazyMarshaler(directoryAdminGetAttrResponse{})
func (msg *directoryAdminGetAttrResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminGetAttrResponse
}
type directoryAdminSetAttrRequest struct {
_ struct{} `fidl:"s,64,0" fidl_size_v1:"64" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"64" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Attributes NodeAttributes `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryAdminSetAttrRequest = _bindings.CreateLazyMarshaler(directoryAdminSetAttrRequest{})
func (msg *directoryAdminSetAttrRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminSetAttrRequest
}
type directoryAdminSetAttrResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminSetAttrResponse = _bindings.CreateLazyMarshaler(directoryAdminSetAttrResponse{})
func (msg *directoryAdminSetAttrResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminSetAttrResponse
}
type directoryAdminNodeGetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Flags uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mdirectoryAdminNodeGetFlagsResponse = _bindings.CreateLazyMarshaler(directoryAdminNodeGetFlagsResponse{})
func (msg *directoryAdminNodeGetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminNodeGetFlagsResponse
}
type directoryAdminNodeSetFlagsRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminNodeSetFlagsRequest = _bindings.CreateLazyMarshaler(directoryAdminNodeSetFlagsRequest{})
func (msg *directoryAdminNodeSetFlagsRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminNodeSetFlagsRequest
}
type directoryAdminNodeSetFlagsResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminNodeSetFlagsResponse = _bindings.CreateLazyMarshaler(directoryAdminNodeSetFlagsResponse{})
func (msg *directoryAdminNodeSetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminNodeSetFlagsResponse
}
type directoryAdminOpenRequest struct {
_ struct{} `fidl:"s,32,0" fidl_size_v1:"32" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"32" fidl_alignment_v1_no_ee:"0"`
Flags uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Mode uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
Path string `fidl:"8,4096" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
Object NodeInterfaceRequest `fidl:"24,0" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
}
var _mdirectoryAdminOpenRequest = _bindings.CreateLazyMarshaler(directoryAdminOpenRequest{})
func (msg *directoryAdminOpenRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminOpenRequest
}
type directoryAdminUnlinkRequest struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
Path string `fidl:"0,4096" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminUnlinkRequest = _bindings.CreateLazyMarshaler(directoryAdminUnlinkRequest{})
func (msg *directoryAdminUnlinkRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminUnlinkRequest
}
type directoryAdminUnlinkResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminUnlinkResponse = _bindings.CreateLazyMarshaler(directoryAdminUnlinkResponse{})
func (msg *directoryAdminUnlinkResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminUnlinkResponse
}
type directoryAdminReadDirentsRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
MaxBytes uint64 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminReadDirentsRequest = _bindings.CreateLazyMarshaler(directoryAdminReadDirentsRequest{})
func (msg *directoryAdminReadDirentsRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminReadDirentsRequest
}
type directoryAdminReadDirentsResponse struct {
_ struct{} `fidl:"s,24,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Dirents []uint8 `fidl:"8,8192" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryAdminReadDirentsResponse = _bindings.CreateLazyMarshaler(directoryAdminReadDirentsResponse{})
func (msg *directoryAdminReadDirentsResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminReadDirentsResponse
}
type directoryAdminRewindResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminRewindResponse = _bindings.CreateLazyMarshaler(directoryAdminRewindResponse{})
func (msg *directoryAdminRewindResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminRewindResponse
}
type directoryAdminGetTokenResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Token _zx.Handle `fidl:"4,1" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mdirectoryAdminGetTokenResponse = _bindings.CreateLazyMarshaler(directoryAdminGetTokenResponse{})
func (msg *directoryAdminGetTokenResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminGetTokenResponse
}
type directoryAdminRenameRequest struct {
_ struct{} `fidl:"s,40,0" fidl_size_v1:"40" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"0"`
Src string `fidl:"0,4096" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
DstParentToken _zx.Handle `fidl:"16,0" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
Dst string `fidl:"24,4096" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
}
var _mdirectoryAdminRenameRequest = _bindings.CreateLazyMarshaler(directoryAdminRenameRequest{})
func (msg *directoryAdminRenameRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminRenameRequest
}
type directoryAdminRenameResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminRenameResponse = _bindings.CreateLazyMarshaler(directoryAdminRenameResponse{})
func (msg *directoryAdminRenameResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminRenameResponse
}
type directoryAdminLinkRequest struct {
_ struct{} `fidl:"s,40,0" fidl_size_v1:"40" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"40" fidl_alignment_v1_no_ee:"0"`
Src string `fidl:"0,4096" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
DstParentToken _zx.Handle `fidl:"16,0" fidl_offset_v1:"16" fidl_offset_v1_no_ee:"16"`
Dst string `fidl:"24,4096" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
}
var _mdirectoryAdminLinkRequest = _bindings.CreateLazyMarshaler(directoryAdminLinkRequest{})
func (msg *directoryAdminLinkRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminLinkRequest
}
type directoryAdminLinkResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminLinkResponse = _bindings.CreateLazyMarshaler(directoryAdminLinkResponse{})
func (msg *directoryAdminLinkResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminLinkResponse
}
type directoryAdminWatchRequest struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
Mask uint32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Options uint32 `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
Watcher _zx.Channel `fidl:"8,0" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryAdminWatchRequest = _bindings.CreateLazyMarshaler(directoryAdminWatchRequest{})
func (msg *directoryAdminWatchRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminWatchRequest
}
type directoryAdminWatchResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminWatchResponse = _bindings.CreateLazyMarshaler(directoryAdminWatchResponse{})
func (msg *directoryAdminWatchResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminWatchResponse
}
type directoryAdminMountRequest struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
Remote DirectoryInterface `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminMountRequest = _bindings.CreateLazyMarshaler(directoryAdminMountRequest{})
func (msg *directoryAdminMountRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminMountRequest
}
type directoryAdminMountResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminMountResponse = _bindings.CreateLazyMarshaler(directoryAdminMountResponse{})
func (msg *directoryAdminMountResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminMountResponse
}
type directoryAdminMountAndCreateRequest struct {
_ struct{} `fidl:"s,32,0" fidl_size_v1:"32" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"32" fidl_alignment_v1_no_ee:"0"`
Remote DirectoryInterface `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Name string `fidl:"8,255" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
Flags uint32 `fidl:"24" fidl_offset_v1:"24" fidl_offset_v1_no_ee:"24"`
}
var _mdirectoryAdminMountAndCreateRequest = _bindings.CreateLazyMarshaler(directoryAdminMountAndCreateRequest{})
func (msg *directoryAdminMountAndCreateRequest) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminMountAndCreateRequest
}
type directoryAdminMountAndCreateResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminMountAndCreateResponse = _bindings.CreateLazyMarshaler(directoryAdminMountAndCreateResponse{})
func (msg *directoryAdminMountAndCreateResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminMountAndCreateResponse
}
type directoryAdminUnmountResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
}
var _mdirectoryAdminUnmountResponse = _bindings.CreateLazyMarshaler(directoryAdminUnmountResponse{})
func (msg *directoryAdminUnmountResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminUnmountResponse
}
type directoryAdminUnmountNodeResponse struct {
_ struct{} `fidl:"s,8,0" fidl_size_v1:"8" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"8" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Remote DirectoryInterface `fidl:"4" fidl_offset_v1:"4" fidl_offset_v1_no_ee:"4"`
}
var _mdirectoryAdminUnmountNodeResponse = _bindings.CreateLazyMarshaler(directoryAdminUnmountNodeResponse{})
func (msg *directoryAdminUnmountNodeResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminUnmountNodeResponse
}
type directoryAdminQueryFilesystemResponse struct {
_ struct{} `fidl:"s,16,0" fidl_size_v1:"16" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"16" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Info *FilesystemInfo `fidl:"8" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryAdminQueryFilesystemResponse = _bindings.CreateLazyMarshaler(directoryAdminQueryFilesystemResponse{})
func (msg *directoryAdminQueryFilesystemResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminQueryFilesystemResponse
}
type directoryAdminGetDevicePathResponse struct {
_ struct{} `fidl:"s,24,0" fidl_size_v1:"24" fidl_alignment_v1:"0" fidl_size_v1_no_ee:"24" fidl_alignment_v1_no_ee:"0"`
S int32 `fidl:"0" fidl_offset_v1:"0" fidl_offset_v1_no_ee:"0"`
Path *string `fidl:"8,4096" fidl_offset_v1:"8" fidl_offset_v1_no_ee:"8"`
}
var _mdirectoryAdminGetDevicePathResponse = _bindings.CreateLazyMarshaler(directoryAdminGetDevicePathResponse{})
func (msg *directoryAdminGetDevicePathResponse) Marshaler() _bindings.Marshaler {
return _mdirectoryAdminGetDevicePathResponse
}
type DirectoryAdminInterface _bindings.ChannelProxy
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OPEN_RIGHT_*`
// - `OPEN_FLAG_APPEND`
// - `OPEN_FLAG_NO_REMOTE`
// - `OPEN_FLAG_DESCRIBE`
// - `CLONE_FLAG_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OPEN_RIGHT_*` bits in `flags` request corresponding rights over the resulting
// cloned object.
// The cloned object must have rights less than or equal to the original object.
// Alternatively, pass `CLONE_FLAG_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OPEN_RIGHT_*` flags together with
// `CLONE_FLAG_SAME_RIGHTS`.
func (p *DirectoryAdminInterface) Clone(flags uint32, object NodeInterfaceRequest) error {
req_ := &directoryAdminCloneRequest{
Flags: flags,
Object: object,
}
err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryAdminCloneOrdinal, req_)
return err
}
// Terminates connection with object.
//
// This method does not require any rights.
func (p *DirectoryAdminInterface) Close() (int32, error) {
var req_ _bindings.Message
resp_ := &directoryAdminCloseResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminCloseOrdinal, req_, resp_, DirectoryAdminCloseOrdinal, DirectoryAdminCloseGenOrdinal)
return resp_.S, err
}
// Returns extra information about the type of the object.
// If the `Describe` operation fails, the connection is closed.
//
// This method does not require any rights.
func (p *DirectoryAdminInterface) Describe() (NodeInfo, error) {
var req_ _bindings.Message
resp_ := &directoryAdminDescribeResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminDescribeOrdinal, req_, resp_, DirectoryAdminDescribeOrdinal, DirectoryAdminDescribeGenOrdinal)
return resp_.Info, err
}
// An event produced eagerly by a FIDL server if requested by `OPEN_FLAG_DESCRIBE`.
//
// Indicates the success or failure of the open operation, and optionally describes the
// object. If the status is `ZX_OK`, `info` contains descriptive information about the object
// (the same as would be returned by `Describe`).
func (p *DirectoryAdminInterface) ExpectOnOpen() (int32, *NodeInfo, error) {
resp_ := &directoryAdminOnOpenResponse{}
err := ((*_bindings.ChannelProxy)(p)).Recv(DirectoryAdminOnOpenOrdinal, resp_, DirectoryAdminOnOpenGenOrdinal)
return resp_.S, resp_.Info, err
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method does not require any rights.
func (p *DirectoryAdminInterface) Sync() (int32, error) {
var req_ _bindings.Message
resp_ := &directoryAdminSyncResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminSyncOrdinal, req_, resp_, DirectoryAdminSyncOrdinal, DirectoryAdminSyncGenOrdinal)
return resp_.S, err
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *DirectoryAdminInterface) GetAttr() (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &directoryAdminGetAttrResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminGetAttrOrdinal, req_, resp_, DirectoryAdminGetAttrOrdinal, DirectoryAdminGetAttrGenOrdinal)
return resp_.S, resp_.Attributes, err
}
// Updates information about the node.
// `flags` may be any of `NODE_ATTRIBUTE_FLAG_*`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryAdminInterface) SetAttr(flags uint32, attributes NodeAttributes) (int32, error) {
req_ := &directoryAdminSetAttrRequest{
Flags: flags,
Attributes: attributes,
}
resp_ := &directoryAdminSetAttrResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminSetAttrOrdinal, req_, resp_, DirectoryAdminSetAttrOrdinal, DirectoryAdminSetAttrGenOrdinal)
return resp_.S, err
}
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
// This method has the same functionality as GetFlags for File and is
// meant as an in-progress replacement.
func (p *DirectoryAdminInterface) NodeGetFlags() (int32, uint32, error) {
var req_ _bindings.Message
resp_ := &directoryAdminNodeGetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminNodeGetFlagsOrdinal, req_, resp_, DirectoryAdminNodeGetFlagsOrdinal, DirectoryAdminNodeGetFlagsGenOrdinal)
return resp_.S, resp_.Flags, err
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
// This method has the same functionality as SetFlags for File and is
// meant as an in-progress replacement.
func (p *DirectoryAdminInterface) NodeSetFlags(flags uint32) (int32, error) {
req_ := &directoryAdminNodeSetFlagsRequest{
Flags: flags,
}
resp_ := &directoryAdminNodeSetFlagsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminNodeSetFlagsOrdinal, req_, resp_, DirectoryAdminNodeSetFlagsOrdinal, DirectoryAdminNodeSetFlagsGenOrdinal)
return resp_.S, err
}
// Opens a new object relative to this directory object.
//
// `path` may contain multiple segments, separated by "/" characters,
// and should never be empty; i.e., "" is an invalid path.
//
// `flags` may be any of the `OPEN_FLAG_*` and `OPEN_RIGHT_*` values, bitwise ORed together.
// The `OPEN_FLAG_DESCRIBE` flag may cause an `OnOpen` event to be transmitted
// on the `object` handle, indicating the type of object opened.
//
// If an unknown value is sent for either flags or mode, the connection should
// be closed.
//
// `OPEN_RIGHT_*` flags provided in `flags` will restrict access rights on
// the `object` channel which will be connected to the opened entity.
//
// Rights are never increased. When you open a nested entity within a directory, you may only
// request the same rights as what the directory connection already has, or a subset of those.
// Exceeding those rights causes an access denied error to be transmitted in the
// `OnOpen` event if applicable, and the `object` connection closed.
//
// The caller must specify either one or more of the `OPEN_RIGHT_*` flags, or
// the `OPEN_FLAG_NODE_REFERENCE` flag.
func (p *DirectoryAdminInterface) Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error {
req_ := &directoryAdminOpenRequest{
Flags: flags,
Mode: mode,
Path: path,
Object: object,
}
err := ((*_bindings.ChannelProxy)(p)).Send(DirectoryAdminOpenOrdinal, req_)
return err
}
// Detaches an object from this directory object.
//
// The underlying object may or may not be deleted after this method
// completes: although the link will be removed from the containing directory,
// objects with multiple references (such as files which are still open)
// will not actually be destroyed until all references are removed.
//
// If a directory is unlinked while it still has an open reference,
// it must become read-only, preventing new entries from being created
// until all references close and the directory is destroyed.
//
// `path` identifies the file which should be detached.
// If `path` contains multiple segments, separated by "/" characters,
// then the directory is traversed, one segment at a time, relative to the
// originally accessed Directory.
//
// Returns:
// `ZX_ERR_ACCESS_DENIED` if the connection (or the underlying filesystem) does not
// allow writable access.
// `ZX_ERR_INVALID_ARGS` if `path` contains ".." segments.
// `ZX_ERR_NOT_EMPTY` if `path` refers to a non-empty directory.
// `ZX_ERR_UNAVAILABLE` if `path` refers to a mount point, containing a remote channel.
// `ZX_ERR_UNAVAILABLE` if `path` is ".".
//
// Other errors may be returned for filesystem-specific reasons.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryAdminInterface) Unlink(path string) (int32, error) {
req_ := &directoryAdminUnlinkRequest{
Path: path,
}
resp_ := &directoryAdminUnlinkResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminUnlinkOrdinal, req_, resp_, DirectoryAdminUnlinkOrdinal, DirectoryAdminUnlinkGenOrdinal)
return resp_.S, err
}
// Reads a collection of variably sized dirents into a buffer.
// The number of dirents in a directory may be very large: akin to
// calling read multiple times on a file, directories have a seek
// offset which is updated on subsequent calls to ReadDirents.
//
// These dirents are of the form:
// ```
// struct dirent {
// // Describes the inode of the entry.
// uint64 ino;
// // Describes the length of the dirent name in bytes.
// uint8 size;
// // Describes the type of the entry. Aligned with the
// // POSIX d_type values. Use `DIRENT_TYPE_*` constants.
// uint8 type;
// // Unterminated name of entry.
// char name[0];
// }
// ```
//
// This method does not require any rights, since one could always probe for
// directory contents by triggering name conflicts during file creation.
func (p *DirectoryAdminInterface) ReadDirents(maxBytes uint64) (int32, []uint8, error) {
req_ := &directoryAdminReadDirentsRequest{
MaxBytes: maxBytes,
}
resp_ := &directoryAdminReadDirentsResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminReadDirentsOrdinal, req_, resp_, DirectoryAdminReadDirentsOrdinal, DirectoryAdminReadDirentsGenOrdinal)
return resp_.S, resp_.Dirents, err
}
// Resets the directory seek offset.
//
// This method does not require any rights, similar to ReadDirents.
func (p *DirectoryAdminInterface) Rewind() (int32, error) {
var req_ _bindings.Message
resp_ := &directoryAdminRewindResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminRewindOrdinal, req_, resp_, DirectoryAdminRewindOrdinal, DirectoryAdminRewindGenOrdinal)
return resp_.S, err
}
// Acquires a token to a Directory which can be used to identify
// access to it at a later point in time.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryAdminInterface) GetToken() (int32, _zx.Handle, error) {
var req_ _bindings.Message
resp_ := &directoryAdminGetTokenResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminGetTokenOrdinal, req_, resp_, DirectoryAdminGetTokenOrdinal, DirectoryAdminGetTokenGenOrdinal)
return resp_.S, resp_.Token, err
}
// Renames an object named src to the name dst, in a directory represented by token.
//
// `src/dst` must be resolved object names. Including "/" in any position
// other than the end of the string will return `ZX_ERR_INVALID_ARGS`.
// Returning "/" at the end of either string implies that it must be a
// directory, or else `ZX_ERR_NOT_DIR` should be returned.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryAdminInterface) Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error) {
req_ := &directoryAdminRenameRequest{
Src: src,
DstParentToken: dstParentToken,
Dst: dst,
}
resp_ := &directoryAdminRenameResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminRenameOrdinal, req_, resp_, DirectoryAdminRenameOrdinal, DirectoryAdminRenameGenOrdinal)
return resp_.S, err
}
// Creates a link to an object named src by the name dst, within a directory represented by
// token.
//
// `src` must be a resolved object name. Including "/" in the string will
// return `ZX_ERR_INVALID_ARGS`.
//
// `dst` must be a resolved object name. Including "/" in the string will
// return `ZX_ERR_INVALID_ARGS`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
func (p *DirectoryAdminInterface) Link(src string, dstParentToken _zx.Handle, dst string) (int32, error) {
req_ := &directoryAdminLinkRequest{
Src: src,
DstParentToken: dstParentToken,
Dst: dst,
}
resp_ := &directoryAdminLinkResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminLinkOrdinal, req_, resp_, DirectoryAdminLinkOrdinal, DirectoryAdminLinkGenOrdinal)
return resp_.S, err
}
// Watches a directory, receiving events of added messages on the
// watcher request channel.
//
// The `watcher` handle will send messages of the form:
// ```
// struct {
// uint8 event;
// uint8 len;
// char name[];
// };
// ```
// Where names are NOT null-terminated.
//
// This API is unstable; in the future, watcher will be a `DirectoryWatcher` client.
//
// Mask specifies a bitmask of events to observe.
// Options must be zero; it is reserved.
//
// This method does not require any rights, similar to ReadDirents.
func (p *DirectoryAdminInterface) Watch(mask uint32, options uint32, watcher _zx.Channel) (int32, error) {
req_ := &directoryAdminWatchRequest{
Mask: mask,
Options: options,
Watcher: watcher,
}
resp_ := &directoryAdminWatchResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminWatchOrdinal, req_, resp_, DirectoryAdminWatchOrdinal, DirectoryAdminWatchGenOrdinal)
return resp_.S, err
}
// Mount a channel representing a remote filesystem onto this directory.
// All future requests to this node will be forwarded to the remote filesystem.
// To re-open a node without forwarding to the remote target, the node
// should be opened with `OPEN_FLAG_NO_REMOTE`.
func (p *DirectoryAdminInterface) Mount(remote DirectoryInterface) (int32, error) {
req_ := &directoryAdminMountRequest{
Remote: remote,
}
resp_ := &directoryAdminMountResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminMountOrdinal, req_, resp_, DirectoryAdminMountOrdinal, DirectoryAdminMountGenOrdinal)
return resp_.S, err
}
// Atomically create a directory with a provided path, and mount the
// remote handle to the newly created directory.
func (p *DirectoryAdminInterface) MountAndCreate(remote DirectoryInterface, name string, flags uint32) (int32, error) {
req_ := &directoryAdminMountAndCreateRequest{
Remote: remote,
Name: name,
Flags: flags,
}
resp_ := &directoryAdminMountAndCreateResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminMountAndCreateOrdinal, req_, resp_, DirectoryAdminMountAndCreateOrdinal, DirectoryAdminMountAndCreateGenOrdinal)
return resp_.S, err
}
// Unmount this filesystem. After this function returns successfully,
// all connections to the filesystem will be terminated.
func (p *DirectoryAdminInterface) Unmount() (int32, error) {
var req_ _bindings.Message
resp_ := &directoryAdminUnmountResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminUnmountOrdinal, req_, resp_, DirectoryAdminUnmountOrdinal, DirectoryAdminUnmountGenOrdinal)
return resp_.S, err
}
// Detach a node which was previously attached to this directory
// with Mount.
func (p *DirectoryAdminInterface) UnmountNode() (int32, DirectoryInterface, error) {
var req_ _bindings.Message
resp_ := &directoryAdminUnmountNodeResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminUnmountNodeOrdinal, req_, resp_, DirectoryAdminUnmountNodeOrdinal, DirectoryAdminUnmountNodeGenOrdinal)
return resp_.S, resp_.Remote, err
}
// Query the filesystem for filesystem-specific information.
func (p *DirectoryAdminInterface) QueryFilesystem() (int32, *FilesystemInfo, error) {
var req_ _bindings.Message
resp_ := &directoryAdminQueryFilesystemResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminQueryFilesystemOrdinal, req_, resp_, DirectoryAdminQueryFilesystemOrdinal, DirectoryAdminQueryFilesystemGenOrdinal)
return resp_.S, resp_.Info, err
}
// Acquire the path to the device backing this filesystem, if there is one.
func (p *DirectoryAdminInterface) GetDevicePath() (int32, *string, error) {
var req_ _bindings.Message
resp_ := &directoryAdminGetDevicePathResponse{}
err := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdminGetDevicePathOrdinal, req_, resp_, DirectoryAdminGetDevicePathOrdinal, DirectoryAdminGetDevicePathGenOrdinal)
return resp_.S, resp_.Path, err
}
// DirectoryAdmin defines a directory which is capable of handling
// administrator tasks within the filesystem.
type DirectoryAdmin interface {
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OPEN_RIGHT_*`
// - `OPEN_FLAG_APPEND`
// - `OPEN_FLAG_NO_REMOTE`
// - `OPEN_FLAG_DESCRIBE`
// - `CLONE_FLAG_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OPEN_RIGHT_*` bits in `flags` request corresponding rights over the resulting
// cloned object.
// The cloned object must have rights less than or equal to the original object.
// Alternatively, pass `CLONE_FLAG_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OPEN_RIGHT_*` flags together with
// `CLONE_FLAG_SAME_RIGHTS`.
Clone(flags uint32, object NodeInterfaceRequest) error
// Terminates connection with object.
//
// This method does not require any rights.
Close() (int32, error)
// Returns extra information about the type of the object.
// If the `Describe` operation fails, the connection is closed.
//
// This method does not require any rights.
Describe() (NodeInfo, error)
// An event produced eagerly by a FIDL server if requested by `OPEN_FLAG_DESCRIBE`.
//
// Indicates the success or failure of the open operation, and optionally describes the
// object. If the status is `ZX_OK`, `info` contains descriptive information about the object
// (the same as would be returned by `Describe`).
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method does not require any rights.
Sync() (int32, error)
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr() (int32, NodeAttributes, error)
// Updates information about the node.
// `flags` may be any of `NODE_ATTRIBUTE_FLAG_*`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
SetAttr(flags uint32, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
// This method has the same functionality as GetFlags for File and is
// meant as an in-progress replacement.
NodeGetFlags() (int32, uint32, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OPEN_FLAG_APPEND`
//
// This method does not require any rights.
// This method has the same functionality as SetFlags for File and is
// meant as an in-progress replacement.
NodeSetFlags(flags uint32) (int32, error)
// Opens a new object relative to this directory object.
//
// `path` may contain multiple segments, separated by "/" characters,
// and should never be empty; i.e., "" is an invalid path.
//
// `flags` may be any of the `OPEN_FLAG_*` and `OPEN_RIGHT_*` values, bitwise ORed together.
// The `OPEN_FLAG_DESCRIBE` flag may cause an `OnOpen` event to be transmitted
// on the `object` handle, indicating the type of object opened.
//
// If an unknown value is sent for either flags or mode, the connection should
// be closed.
//
// `OPEN_RIGHT_*` flags provided in `flags` will restrict access rights on
// the `object` channel which will be connected to the opened entity.
//
// Rights are never increased. When you open a nested entity within a directory, you may only
// request the same rights as what the directory connection already has, or a subset of those.
// Exceeding those rights causes an access denied error to be transmitted in the
// `OnOpen` event if applicable, and the `object` connection closed.
//
// The caller must specify either one or more of the `OPEN_RIGHT_*` flags, or
// the `OPEN_FLAG_NODE_REFERENCE` flag.
Open(flags uint32, mode uint32, path string, object NodeInterfaceRequest) error
// Detaches an object from this directory object.
//
// The underlying object may or may not be deleted after this method
// completes: although the link will be removed from the containing directory,
// objects with multiple references (such as files which are still open)
// will not actually be destroyed until all references are removed.
//
// If a directory is unlinked while it still has an open reference,
// it must become read-only, preventing new entries from being created
// until all references close and the directory is destroyed.
//
// `path` identifies the file which should be detached.
// If `path` contains multiple segments, separated by "/" characters,
// then the directory is traversed, one segment at a time, relative to the
// originally accessed Directory.
//
// Returns:
// `ZX_ERR_ACCESS_DENIED` if the connection (or the underlying filesystem) does not
// allow writable access.
// `ZX_ERR_INVALID_ARGS` if `path` contains ".." segments.
// `ZX_ERR_NOT_EMPTY` if `path` refers to a non-empty directory.
// `ZX_ERR_UNAVAILABLE` if `path` refers to a mount point, containing a remote channel.
// `ZX_ERR_UNAVAILABLE` if `path` is ".".
//
// Other errors may be returned for filesystem-specific reasons.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
Unlink(path string) (int32, error)
// Reads a collection of variably sized dirents into a buffer.
// The number of dirents in a directory may be very large: akin to
// calling read multiple times on a file, directories have a seek
// offset which is updated on subsequent calls to ReadDirents.
//
// These dirents are of the form:
// ```
// struct dirent {
// // Describes the inode of the entry.
// uint64 ino;
// // Describes the length of the dirent name in bytes.
// uint8 size;
// // Describes the type of the entry. Aligned with the
// // POSIX d_type values. Use `DIRENT_TYPE_*` constants.
// uint8 type;
// // Unterminated name of entry.
// char name[0];
// }
// ```
//
// This method does not require any rights, since one could always probe for
// directory contents by triggering name conflicts during file creation.
ReadDirents(maxBytes uint64) (int32, []uint8, error)
// Resets the directory seek offset.
//
// This method does not require any rights, similar to ReadDirents.
Rewind() (int32, error)
// Acquires a token to a Directory which can be used to identify
// access to it at a later point in time.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
GetToken() (int32, _zx.Handle, error)
// Renames an object named src to the name dst, in a directory represented by token.
//
// `src/dst` must be resolved object names. Including "/" in any position
// other than the end of the string will return `ZX_ERR_INVALID_ARGS`.
// Returning "/" at the end of either string implies that it must be a
// directory, or else `ZX_ERR_NOT_DIR` should be returned.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
Rename(src string, dstParentToken _zx.Handle, dst string) (int32, error)
// Creates a link to an object named src by the name dst, within a directory represented by
// token.
//
// `src` must be a resolved object name. Including "/" in the string will
// return `ZX_ERR_INVALID_ARGS`.
//
// `dst` must be a resolved object name. Including "/" in the string will
// return `ZX_ERR_INVALID_ARGS`.
//
// This method requires following rights: `OPEN_RIGHT_WRITABLE`.
Link(src string, dstParentToken _zx.Handle, dst string) (int32, error)
// Watches a directory, receiving events of added messages on the
// watcher request channel.
//
// The `watcher` handle will send messages of the form:
// ```
// struct {
// uint8 event;
// uint8 len;
// char name[];
// };
// ```
// Where names are NOT null-terminated.
//
// This API is unstable; in the future, watcher will be a `DirectoryWatcher` client.
//
// Mask specifies a bitmask of events to observe.
// Options must be zero; it is reserved.
//
// This method does not require any rights, similar to ReadDirents.
Watch(mask uint32, options uint32, watcher _zx.Channel) (int32, error)
// Mount a channel representing a remote filesystem onto this directory.
// All future requests to this node will be forwarded to the remote filesystem.
// To re-open a node without forwarding to the remote target, the node
// should be opened with `OPEN_FLAG_NO_REMOTE`.
Mount(remote DirectoryInterface) (int32, error)
// Atomically create a directory with a provided path, and mount the
// remote handle to the newly created directory.
MountAndCreate(remote DirectoryInterface, name string, flags uint32) (int32, error)
// Unmount this filesystem. After this function returns successfully,
// all connections to the filesystem will be terminated.
Unmount() (int32, error)
// Detach a node which was previously attached to this directory
// with Mount.
UnmountNode() (int32, DirectoryInterface, error)
// Query the filesystem for filesystem-specific information.
QueryFilesystem() (int32, *FilesystemInfo, error)
// Acquire the path to the device backing this filesystem, if there is one.
GetDevicePath() (int32, *string, error)
}
type DirectoryAdminTransitionalBase struct{}
func (_ *DirectoryAdminTransitionalBase) NodeGetFlags() (int32, uint32, error) {
panic("Not Implemented")
}
func (_ *DirectoryAdminTransitionalBase) NodeSetFlags(flags uint32) (int32, error) {
panic("Not Implemented")
}
type DirectoryAdminInterfaceRequest _bindings.InterfaceRequest
func NewDirectoryAdminInterfaceRequest() (DirectoryAdminInterfaceRequest, *DirectoryAdminInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return DirectoryAdminInterfaceRequest(req), (*DirectoryAdminInterface)(cli), err
}
type DirectoryAdminStub struct {
Impl DirectoryAdmin
}
func (s_ *DirectoryAdminStub) DispatchImpl(ordinal_ uint64, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
var ctx_ _bindings.MarshalerContext
return s_.DispatchImplWithCtx(ordinal_, ctx_, data_, handles_)
}
func (s_ *DirectoryAdminStub) DispatchImplWithCtx(ordinal_ uint64, ctx_ _bindings.MarshalerContext, data_ []byte, handles_ []_zx.Handle) (_bindings.Message, bool, error) {
switch ordinal_ {
case DirectoryAdminCloneOrdinal:
fallthrough
case DirectoryAdminCloneGenOrdinal:
in_ := directoryAdminCloneRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(in_.Flags, in_.Object)
return nil, false, err_
case DirectoryAdminCloseOrdinal:
fallthrough
case DirectoryAdminCloseGenOrdinal:
s, err_ := s_.Impl.Close()
out_ := directoryAdminCloseResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminDescribeOrdinal:
fallthrough
case DirectoryAdminDescribeGenOrdinal:
info, err_ := s_.Impl.Describe()
out_ := directoryAdminDescribeResponse{}
out_.Info = info
return &out_, true, err_
case DirectoryAdminSyncOrdinal:
fallthrough
case DirectoryAdminSyncGenOrdinal:
s, err_ := s_.Impl.Sync()
out_ := directoryAdminSyncResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminGetAttrOrdinal:
fallthrough
case DirectoryAdminGetAttrGenOrdinal:
s, attributes, err_ := s_.Impl.GetAttr()
out_ := directoryAdminGetAttrResponse{}
out_.S = s
out_.Attributes = attributes
return &out_, true, err_
case DirectoryAdminSetAttrOrdinal:
fallthrough
case DirectoryAdminSetAttrGenOrdinal:
in_ := directoryAdminSetAttrRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(in_.Flags, in_.Attributes)
out_ := directoryAdminSetAttrResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminNodeGetFlagsOrdinal:
fallthrough
case DirectoryAdminNodeGetFlagsGenOrdinal:
s, flags, err_ := s_.Impl.NodeGetFlags()
out_ := directoryAdminNodeGetFlagsResponse{}
out_.S = s
out_.Flags = flags
return &out_, true, err_
case DirectoryAdminNodeSetFlagsOrdinal:
fallthrough
case DirectoryAdminNodeSetFlagsGenOrdinal:
in_ := directoryAdminNodeSetFlagsRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.NodeSetFlags(in_.Flags)
out_ := directoryAdminNodeSetFlagsResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminOpenOrdinal:
fallthrough
case DirectoryAdminOpenGenOrdinal:
in_ := directoryAdminOpenRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Open(in_.Flags, in_.Mode, in_.Path, in_.Object)
return nil, false, err_
case DirectoryAdminUnlinkOrdinal:
fallthrough
case DirectoryAdminUnlinkGenOrdinal:
in_ := directoryAdminUnlinkRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Unlink(in_.Path)
out_ := directoryAdminUnlinkResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminReadDirentsOrdinal:
fallthrough
case DirectoryAdminReadDirentsGenOrdinal:
in_ := directoryAdminReadDirentsRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, dirents, err_ := s_.Impl.ReadDirents(in_.MaxBytes)
out_ := directoryAdminReadDirentsResponse{}
out_.S = s
out_.Dirents = dirents
return &out_, true, err_
case DirectoryAdminRewindOrdinal:
fallthrough
case DirectoryAdminRewindGenOrdinal:
s, err_ := s_.Impl.Rewind()
out_ := directoryAdminRewindResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminGetTokenOrdinal:
fallthrough
case DirectoryAdminGetTokenGenOrdinal:
s, token, err_ := s_.Impl.GetToken()
out_ := directoryAdminGetTokenResponse{}
out_.S = s
out_.Token = token
return &out_, true, err_
case DirectoryAdminRenameOrdinal:
fallthrough
case DirectoryAdminRenameGenOrdinal:
in_ := directoryAdminRenameRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Rename(in_.Src, in_.DstParentToken, in_.Dst)
out_ := directoryAdminRenameResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminLinkOrdinal:
fallthrough
case DirectoryAdminLinkGenOrdinal:
in_ := directoryAdminLinkRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Link(in_.Src, in_.DstParentToken, in_.Dst)
out_ := directoryAdminLinkResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminWatchOrdinal:
fallthrough
case DirectoryAdminWatchGenOrdinal:
in_ := directoryAdminWatchRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Watch(in_.Mask, in_.Options, in_.Watcher)
out_ := directoryAdminWatchResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminMountOrdinal:
fallthrough
case DirectoryAdminMountGenOrdinal:
in_ := directoryAdminMountRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Mount(in_.Remote)
out_ := directoryAdminMountResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminMountAndCreateOrdinal:
fallthrough
case DirectoryAdminMountAndCreateGenOrdinal:
in_ := directoryAdminMountAndCreateRequest{}
if _, _, err_ := _bindings.UnmarshalWithContext(ctx_, data_, handles_, &in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.MountAndCreate(in_.Remote, in_.Name, in_.Flags)
out_ := directoryAdminMountAndCreateResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminUnmountOrdinal:
fallthrough
case DirectoryAdminUnmountGenOrdinal:
s, err_ := s_.Impl.Unmount()
out_ := directoryAdminUnmountResponse{}
out_.S = s
return &out_, true, err_
case DirectoryAdminUnmountNodeOrdinal:
fallthrough
case DirectoryAdminUnmountNodeGenOrdinal:
s, remote, err_ := s_.Impl.UnmountNode()
out_ := directoryAdminUnmountNodeResponse{}
out_.S = s
out_.Remote = remote
return &out_, true, err_
case DirectoryAdminQueryFilesystemOrdinal:
fallthrough
case DirectoryAdminQueryFilesystemGenOrdinal:
s, info, err_ := s_.Impl.QueryFilesystem()
out_ := directoryAdminQueryFilesystemResponse{}
out_.S = s
out_.Info = info
return &out_, true, err_
case DirectoryAdminGetDevicePathOrdinal:
fallthrough
case DirectoryAdminGetDevicePathGenOrdinal:
s, path, err_ := s_.Impl.GetDevicePath()
out_ := directoryAdminGetDevicePathResponse{}
out_.S = s
out_.Path = path
return &out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type DirectoryAdminService struct {
_bindings.BindingSet
}
func (s *DirectoryAdminService) Add(impl DirectoryAdmin, c _zx.Channel, onError func(error)) (_bindings.BindingKey, error) {
return s.BindingSet.Add(&DirectoryAdminStub{Impl: impl}, c, onError)
}
func (s *DirectoryAdminService) EventProxyFor(key _bindings.BindingKey) (*DirectoryAdminEventProxy, bool) {
pxy, err := s.BindingSet.ProxyFor(key)
return (*DirectoryAdminEventProxy)(pxy), err
}
type DirectoryAdminEventProxy _bindings.ChannelProxy
func (p *DirectoryAdminEventProxy) OnOpen(s int32, info *NodeInfo) error {
event_ := &directoryAdminOnOpenResponse{
S: s,
Info: info,
}
return ((*_bindings.ChannelProxy)(p)).Send(DirectoryAdminOnOpenOrdinal, event_)
}