blob: c1cd98e88a701e37a81067095c64eb45191e9742 [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.
//
// Code generated by third_party/go/regen-fidl; DO NOT EDIT.
// WARNING: This file is machine generated by fidlgen.
package io
import (
_strings "strings"
_zx "syscall/zx"
_bindings "syscall/zx/fidl"
fuchsiaunknown "syscall/zx/unknown"
)
const (
DirectoryProtocolName_ string = "fuchsia.io/Directory"
FileProtocolName_ string = "fuchsia.io/File"
// Nodes which do not have ino values should return this value
// from Readdir and GetAttr.
InoUnknown uint64 = 18446744073709551615
// The maximum size for an extended attribute name.
MaxAttributeName_ uint64 = 255
// 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 single filesystem component.
MaxFilename uint64 = 255
MaxFsNameBuffer uint64 = 32
// The maximum size for an extended attribute value to be included inline.
// Values larger than this size are passed in a vmo.
MaxInlineAttributeValue uint64 = 32768
// The maximum size of a chunk in the ListExtendedAttributes iterator.
MaxListAttributesChunk uint64 = 128
// The maximum length, in bytes, of a single filesystem component.
MaxNameLength uint64 = 255
// The maximum length, in bytes, of a filesystem path.
MaxPathLength uint64 = 4095
// The maximum I/O size that is allowed for read/write operations using
// byte vectors.
MaxTransferSize uint64 = 8192
// 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
ModeTypeBlockDevice uint32 = 24576
ModeTypeDirectory uint32 = 16384
ModeTypeFile uint32 = 32768
// 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
ModeTypeService uint32 = 65536
ModeTypeSymlink uint32 = 40960
NodeProtocolName_ string = "fuchsia.io/Node"
// Flags used when opening a node reference must fall within this mask.
OpenFlagsAllowedWithNodeReference OpenFlags = 46661632
// All known rights.
OpenRights OpenFlags = 11
// Alias for directory permission alias rw*
RwStarDir Operations = 503
// Alias for directory permission alias rx*
RxStarDir Operations = 219
// Alias for directory permission alias r*
RStarDir Operations = 211
SymlinkProtocolName_ string = "fuchsia.io/Symlink"
// Alias for directory permission alias w*
WStarDir Operations = 485
// Alias for directory permission alias x*
XStarDir Operations = 201
)
type Abilities = Operations
type ExtendedAttributeName_ = []uint8
type Id = uint64
type Name_ = string
type Path = string
type Rights = Operations
type SymlinkTarget = []uint8
type Token = _zx.Event
type Transfer = []uint8
var _ _bindings.Enum = AdvisoryLockType(0)
type AdvisoryLockType uint32
const (
// Zero or more connections can hold read locks on a file simultaneously.
AdvisoryLockTypeRead AdvisoryLockType = 1
// At most one connection can hold a write lock on a file simultaneously.
// When a write lock is held on a file, no other types of locks can be held
// on that file.
AdvisoryLockTypeWrite AdvisoryLockType = 2
// The region specifies a region to be unlocked.
AdvisoryLockTypeUnlock AdvisoryLockType = 3
)
func (_ AdvisoryLockType) I_EnumValues() []AdvisoryLockType {
return []AdvisoryLockType{
AdvisoryLockTypeRead,
AdvisoryLockTypeWrite,
AdvisoryLockTypeUnlock,
}
}
func (_ AdvisoryLockType) I_EnumIsStrict() bool {
return true
}
func (x AdvisoryLockType) IsUnknown() bool {
switch x {
case 1:
return false
case 2:
return false
case 3:
return false
}
return true
}
func (x AdvisoryLockType) String() string {
switch x {
case 1:
return "Read"
case 2:
return "Write"
case 3:
return "Unlock"
}
return "Unknown"
}
var _ _bindings.Enum = DirentType(0)
type DirentType uint8
const (
// A dirent with an unknown type.
DirentTypeUnknown DirentType = 0
// A dirent representing a directory object.
DirentTypeDirectory DirentType = 4
// A dirent representing a block device object.
DirentTypeBlockDevice DirentType = 6
// A dirent representing a file object.
DirentTypeFile DirentType = 8
// A symbolic link.
DirentTypeSymlink DirentType = 10
// A dirent representing a service object.
DirentTypeService DirentType = 16
)
func (_ DirentType) I_EnumValues() []DirentType {
return []DirentType{
DirentTypeUnknown,
DirentTypeDirectory,
DirentTypeBlockDevice,
DirentTypeFile,
DirentTypeSymlink,
DirentTypeService,
}
}
func (_ DirentType) I_EnumIsStrict() bool {
return true
}
func (x DirentType) IsUnknown() bool {
switch x {
case 0:
return false
case 4:
return false
case 6:
return false
case 8:
return false
case 10:
return false
case 16:
return false
}
return true
}
func (x DirentType) String() string {
switch x {
case 0:
return "Unknown"
case 4:
return "Directory"
case 6:
return "BlockDevice"
case 8:
return "File"
case 10:
return "Symlink"
case 16:
return "Service"
}
return "Unknown"
}
var _ _bindings.Enum = HashAlgorithm(0)
// Denotes which hash algorithm is used to build the merkle tree for
// fsverity-enabled files.
type HashAlgorithm uint8
const (
HashAlgorithmSha256 HashAlgorithm = 1
HashAlgorithmSha512 HashAlgorithm = 2
// HashAlgorithm_Unknown is the default unknown placeholder.
HashAlgorithm_Unknown HashAlgorithm = 0xff
)
func (_ HashAlgorithm) I_EnumValues() []HashAlgorithm {
return []HashAlgorithm{
HashAlgorithmSha256,
HashAlgorithmSha512,
}
}
func (_ HashAlgorithm) I_EnumIsStrict() bool {
return false
}
func (x HashAlgorithm) IsUnknown() bool {
switch x {
case 1:
return false
case 2:
return false
}
return true
}
func (x HashAlgorithm) String() string {
switch x {
case 1:
return "Sha256"
case 2:
return "Sha512"
}
return "Unknown"
}
var _ _bindings.Enum = OpenMode(0)
type OpenMode uint32
const (
// Only succeed if the object exists.
OpenModeOpenExisting OpenMode = 1
// Create the object if it does not exist, otherwise open
// existing. The check and the creation are performed in
// one atomic step.
OpenModeMaybeCreate OpenMode = 2
// Assert that the object does not exist, then create it.
// The assertion and creation are performed in one atomic
// step.
OpenModeAlwaysCreate OpenMode = 3
)
func (_ OpenMode) I_EnumValues() []OpenMode {
return []OpenMode{
OpenModeOpenExisting,
OpenModeMaybeCreate,
OpenModeAlwaysCreate,
}
}
func (_ OpenMode) I_EnumIsStrict() bool {
return true
}
func (x OpenMode) IsUnknown() bool {
switch x {
case 1:
return false
case 2:
return false
case 3:
return false
}
return true
}
func (x OpenMode) String() string {
switch x {
case 1:
return "OpenExisting"
case 2:
return "MaybeCreate"
case 3:
return "AlwaysCreate"
}
return "Unknown"
}
var _ _bindings.Enum = SeekOrigin(0)
// The reference point for updating the seek offset. See [`File.Seek`].
//
// This enum matches the `zx_stream_seek_origin_t` enum.
type SeekOrigin uint32
const (
// Seek from the start of the file.
// The seek offset will be set to `offset` bytes.
// The seek offset cannot be negative in this case.
SeekOriginStart SeekOrigin = 0
// Seek from the current position in the file.
// The seek offset will be the current seek offset plus `offset` bytes.
SeekOriginCurrent SeekOrigin = 1
// Seek from the end of the file.
// The seek offset will be the file size plus `offset` bytes.
SeekOriginEnd SeekOrigin = 2
)
func (_ SeekOrigin) I_EnumValues() []SeekOrigin {
return []SeekOrigin{
SeekOriginStart,
SeekOriginCurrent,
SeekOriginEnd,
}
}
func (_ SeekOrigin) I_EnumIsStrict() bool {
return true
}
func (x SeekOrigin) IsUnknown() bool {
switch x {
case 0:
return false
case 1:
return false
case 2:
return false
}
return true
}
func (x SeekOrigin) String() string {
switch x {
case 0:
return "Start"
case 1:
return "Current"
case 2:
return "End"
}
return "Unknown"
}
var _ _bindings.Enum = SetExtendedAttributeMode(0)
type SetExtendedAttributeMode uint32
const (
// Set the value of the extended attribute regardless of whether it
// already exists.
SetExtendedAttributeModeSet SetExtendedAttributeMode = 1
// Create a new extended attribute. Fail if it already exists.
SetExtendedAttributeModeCreate SetExtendedAttributeMode = 2
// Replace the value of an existing extended attribute. Fail if it
// doesn't already exist.
SetExtendedAttributeModeReplace SetExtendedAttributeMode = 3
)
func (_ SetExtendedAttributeMode) I_EnumValues() []SetExtendedAttributeMode {
return []SetExtendedAttributeMode{
SetExtendedAttributeModeSet,
SetExtendedAttributeModeCreate,
SetExtendedAttributeModeReplace,
}
}
func (_ SetExtendedAttributeMode) I_EnumIsStrict() bool {
return true
}
func (x SetExtendedAttributeMode) IsUnknown() bool {
switch x {
case 1:
return false
case 2:
return false
case 3:
return false
}
return true
}
func (x SetExtendedAttributeMode) String() string {
switch x {
case 1:
return "Set"
case 2:
return "Create"
case 3:
return "Replace"
}
return "Unknown"
}
var _ _bindings.Enum = WatchEvent(0)
type WatchEvent uint8
const (
// Indicates the directory being watched has been deleted. The name returned for this event
// will be `.` (dot), as it is refering to the directory itself.
WatchEventDeleted WatchEvent = 0
// Indicates a node has been created (either new or moved) into a directory.
WatchEventAdded WatchEvent = 1
// Identifies a node has been removed (either deleted or moved) from the directory.
WatchEventRemoved WatchEvent = 2
// Identifies a node already existed in the directory when watching started.
WatchEventExisting WatchEvent = 3
// Identifies that no more `EXISTING` events will be sent. The name returned for this event
// will be empty, as it is not refering to a specific entry.
WatchEventIdle WatchEvent = 4
)
func (_ WatchEvent) I_EnumValues() []WatchEvent {
return []WatchEvent{
WatchEventDeleted,
WatchEventAdded,
WatchEventRemoved,
WatchEventExisting,
WatchEventIdle,
}
}
func (_ WatchEvent) I_EnumIsStrict() bool {
return true
}
func (x WatchEvent) IsUnknown() bool {
switch x {
case 0:
return false
case 1:
return false
case 2:
return false
case 3:
return false
case 4:
return false
}
return true
}
func (x WatchEvent) String() string {
switch x {
case 0:
return "Deleted"
case 1:
return "Added"
case 2:
return "Removed"
case 3:
return "Existing"
case 4:
return "Idle"
}
return "Unknown"
}
var _ _bindings.Bits = AllocateMode(0)
type AllocateMode uint32
const (
AllocateModeKeepSize AllocateMode = 1
AllocateModeUnshareRange AllocateMode = 2
AllocateModePunchHole AllocateMode = 4
AllocateModeCollapseRange AllocateMode = 8
AllocateModeZeroRange AllocateMode = 16
AllocateModeInsertRange AllocateMode = 32
AllocateMode_Mask AllocateMode = 63
)
func (_ AllocateMode) I_BitsMask() AllocateMode {
return AllocateMode_Mask
}
func (_ AllocateMode) I_BitsIsStrict() bool {
return false
}
func (x AllocateMode) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x AllocateMode) GetUnknownBits() uint64 {
return uint64(^AllocateMode_Mask & x)
}
func (x AllocateMode) InvertBits() AllocateMode {
return AllocateMode_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x AllocateMode) HasBits(mask AllocateMode) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x AllocateMode) ClearBits(mask AllocateMode) AllocateMode {
return ^mask & x
}
func (x AllocateMode) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("KeepSize")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("UnshareRange")
}
if 4&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("PunchHole")
}
if 8&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("CollapseRange")
}
if 16&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("ZeroRange")
}
if 32&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("InsertRange")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = ConnectorFlags(0)
type ConnectorFlags uint64
const (
ConnectorFlags_Mask ConnectorFlags = 0
)
func (_ ConnectorFlags) I_BitsMask() ConnectorFlags {
return ConnectorFlags_Mask
}
func (_ ConnectorFlags) I_BitsIsStrict() bool {
return false
}
func (x ConnectorFlags) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x ConnectorFlags) GetUnknownBits() uint64 {
return uint64(^ConnectorFlags_Mask & x)
}
func (x ConnectorFlags) InvertBits() ConnectorFlags {
return ConnectorFlags_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x ConnectorFlags) HasBits(mask ConnectorFlags) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x ConnectorFlags) ClearBits(mask ConnectorFlags) ConnectorFlags {
return ^mask & x
}
func (x ConnectorFlags) String() string {
var buf _strings.Builder
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = FileProtocolFlags(0)
type FileProtocolFlags uint64
const (
FileProtocolFlagsAppend FileProtocolFlags = 1
FileProtocolFlagsTruncate FileProtocolFlags = 2
FileProtocolFlags_Mask FileProtocolFlags = 3
)
func (_ FileProtocolFlags) I_BitsMask() FileProtocolFlags {
return FileProtocolFlags_Mask
}
func (_ FileProtocolFlags) I_BitsIsStrict() bool {
return false
}
func (x FileProtocolFlags) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x FileProtocolFlags) GetUnknownBits() uint64 {
return uint64(^FileProtocolFlags_Mask & x)
}
func (x FileProtocolFlags) InvertBits() FileProtocolFlags {
return FileProtocolFlags_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x FileProtocolFlags) HasBits(mask FileProtocolFlags) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x FileProtocolFlags) ClearBits(mask FileProtocolFlags) FileProtocolFlags {
return ^mask & x
}
func (x FileProtocolFlags) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Append")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Truncate")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = FileSignal(0)
type FileSignal uint32
const (
FileSignalReadable FileSignal = 16777216
FileSignalWritable FileSignal = 33554432
FileSignal_Mask FileSignal = 50331648
)
func (_ FileSignal) I_BitsMask() FileSignal {
return FileSignal_Mask
}
func (_ FileSignal) I_BitsIsStrict() bool {
return true
}
func (x FileSignal) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x FileSignal) GetUnknownBits() uint64 {
return uint64(^FileSignal_Mask & x)
}
func (x FileSignal) InvertBits() FileSignal {
return FileSignal_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x FileSignal) HasBits(mask FileSignal) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x FileSignal) ClearBits(mask FileSignal) FileSignal {
return ^mask & x
}
func (x FileSignal) String() string {
var buf _strings.Builder
if 16777216&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Readable")
}
if 33554432&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Writable")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = ModeType(0)
type ModeType uint32
const (
ModeTypeDoNotUse ModeType = 2147483648
ModeType_Mask ModeType = 2147483648
)
func (_ ModeType) I_BitsMask() ModeType {
return ModeType_Mask
}
func (_ ModeType) I_BitsIsStrict() bool {
return true
}
func (x ModeType) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x ModeType) GetUnknownBits() uint64 {
return uint64(^ModeType_Mask & x)
}
func (x ModeType) InvertBits() ModeType {
return ModeType_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x ModeType) HasBits(mask ModeType) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x ModeType) ClearBits(mask ModeType) ModeType {
return ^mask & x
}
func (x ModeType) String() string {
var buf _strings.Builder
if 2147483648&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("DoNotUse")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = NodeAttributeFlags(0)
// The fields of 'attributes' which are used to update the Node are indicated
// by the 'flags' argument.
type NodeAttributeFlags uint32
const (
NodeAttributeFlagsCreationTime NodeAttributeFlags = 1
NodeAttributeFlagsModificationTime NodeAttributeFlags = 2
NodeAttributeFlags_Mask NodeAttributeFlags = 3
)
func (_ NodeAttributeFlags) I_BitsMask() NodeAttributeFlags {
return NodeAttributeFlags_Mask
}
func (_ NodeAttributeFlags) I_BitsIsStrict() bool {
return true
}
func (x NodeAttributeFlags) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x NodeAttributeFlags) GetUnknownBits() uint64 {
return uint64(^NodeAttributeFlags_Mask & x)
}
func (x NodeAttributeFlags) InvertBits() NodeAttributeFlags {
return NodeAttributeFlags_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x NodeAttributeFlags) HasBits(mask NodeAttributeFlags) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x NodeAttributeFlags) ClearBits(mask NodeAttributeFlags) NodeAttributeFlags {
return ^mask & x
}
func (x NodeAttributeFlags) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("CreationTime")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("ModificationTime")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = NodeAttributesQuery(0)
type NodeAttributesQuery uint64
const (
NodeAttributesQueryProtocols NodeAttributesQuery = 1
NodeAttributesQueryAbilities NodeAttributesQuery = 2
NodeAttributesQueryContentSize NodeAttributesQuery = 4
NodeAttributesQueryStorageSize NodeAttributesQuery = 8
NodeAttributesQueryLinkCount NodeAttributesQuery = 16
NodeAttributesQueryId NodeAttributesQuery = 32
NodeAttributesQueryCreationTime NodeAttributesQuery = 64
NodeAttributesQueryModificationTime NodeAttributesQuery = 128
NodeAttributesQueryMode NodeAttributesQuery = 256
NodeAttributesQueryUid NodeAttributesQuery = 512
NodeAttributesQueryGid NodeAttributesQuery = 1024
NodeAttributesQueryRdev NodeAttributesQuery = 2048
NodeAttributesQueryAccessTime NodeAttributesQuery = 4096
NodeAttributesQueryChangeTime NodeAttributesQuery = 8192
NodeAttributesQueryOptions NodeAttributesQuery = 16384
NodeAttributesQueryRootHash NodeAttributesQuery = 32768
NodeAttributesQuery_Mask NodeAttributesQuery = 65535
)
func (_ NodeAttributesQuery) I_BitsMask() NodeAttributesQuery {
return NodeAttributesQuery_Mask
}
func (_ NodeAttributesQuery) I_BitsIsStrict() bool {
return true
}
func (x NodeAttributesQuery) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x NodeAttributesQuery) GetUnknownBits() uint64 {
return uint64(^NodeAttributesQuery_Mask & x)
}
func (x NodeAttributesQuery) InvertBits() NodeAttributesQuery {
return NodeAttributesQuery_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x NodeAttributesQuery) HasBits(mask NodeAttributesQuery) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x NodeAttributesQuery) ClearBits(mask NodeAttributesQuery) NodeAttributesQuery {
return ^mask & x
}
func (x NodeAttributesQuery) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Protocols")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Abilities")
}
if 4&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("ContentSize")
}
if 8&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("StorageSize")
}
if 16&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("LinkCount")
}
if 32&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Id")
}
if 64&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("CreationTime")
}
if 128&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("ModificationTime")
}
if 256&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Mode")
}
if 512&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Uid")
}
if 1024&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Gid")
}
if 2048&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Rdev")
}
if 4096&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("AccessTime")
}
if 8192&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("ChangeTime")
}
if 16384&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Options")
}
if 32768&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("RootHash")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = NodeFlags(0)
type NodeFlags uint64
const (
NodeFlagsGetRepresentation NodeFlags = 1
NodeFlags_Mask NodeFlags = 1
)
func (_ NodeFlags) I_BitsMask() NodeFlags {
return NodeFlags_Mask
}
func (_ NodeFlags) I_BitsIsStrict() bool {
return false
}
func (x NodeFlags) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x NodeFlags) GetUnknownBits() uint64 {
return uint64(^NodeFlags_Mask & x)
}
func (x NodeFlags) InvertBits() NodeFlags {
return NodeFlags_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x NodeFlags) HasBits(mask NodeFlags) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x NodeFlags) ClearBits(mask NodeFlags) NodeFlags {
return ^mask & x
}
func (x NodeFlags) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("GetRepresentation")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = NodeProtocolFlags(0)
type NodeProtocolFlags uint64
const (
NodeProtocolFlagsMustBeDirectory NodeProtocolFlags = 1
NodeProtocolFlags_Mask NodeProtocolFlags = 1
)
func (_ NodeProtocolFlags) I_BitsMask() NodeProtocolFlags {
return NodeProtocolFlags_Mask
}
func (_ NodeProtocolFlags) I_BitsIsStrict() bool {
return false
}
func (x NodeProtocolFlags) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x NodeProtocolFlags) GetUnknownBits() uint64 {
return uint64(^NodeProtocolFlags_Mask & x)
}
func (x NodeProtocolFlags) InvertBits() NodeProtocolFlags {
return NodeProtocolFlags_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x NodeProtocolFlags) HasBits(mask NodeProtocolFlags) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x NodeProtocolFlags) ClearBits(mask NodeProtocolFlags) NodeProtocolFlags {
return ^mask & x
}
func (x NodeProtocolFlags) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("MustBeDirectory")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = NodeProtocolKinds(0)
// A node may have multiple supported representations when opening, even though
// it may have a fixed underlying identity.
//
// Today, a file is accessed via the [`File`] protocol, and sends a
// [`Representation.FileInfo`] when opened with `GET_REPRESENTATION`. However,
// in the future we might introduce a more sophisticated `FileV2` protocol, or
// a more efficient `SuperFastFile` backed by a specialized kernel object. New
// clients can request the more advanced representations by specifying the
// corresponding bits in [`NodeProtocolKinds`], whereas existing clients would
// continue to talk to the node via the old representation.
//
// [`NodeProtocolKinds`] enables forward-compatibility through a form of protocol
// negotiation.
//
// The elements have one-to-one correspondence with the members of
// [`Representation`].
type NodeProtocolKinds uint64
const (
NodeProtocolKindsConnector NodeProtocolKinds = 1
NodeProtocolKindsDirectory NodeProtocolKinds = 2
NodeProtocolKindsFile NodeProtocolKinds = 4
NodeProtocolKindsSymlink NodeProtocolKinds = 8
NodeProtocolKinds_Mask NodeProtocolKinds = 15
)
func (_ NodeProtocolKinds) I_BitsMask() NodeProtocolKinds {
return NodeProtocolKinds_Mask
}
func (_ NodeProtocolKinds) I_BitsIsStrict() bool {
return false
}
func (x NodeProtocolKinds) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x NodeProtocolKinds) GetUnknownBits() uint64 {
return uint64(^NodeProtocolKinds_Mask & x)
}
func (x NodeProtocolKinds) InvertBits() NodeProtocolKinds {
return NodeProtocolKinds_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x NodeProtocolKinds) HasBits(mask NodeProtocolKinds) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x NodeProtocolKinds) ClearBits(mask NodeProtocolKinds) NodeProtocolKinds {
return ^mask & x
}
func (x NodeProtocolKinds) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Connector")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Directory")
}
if 4&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("File")
}
if 8&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Symlink")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = OpenFlags(0)
type OpenFlags uint32
const (
OpenFlagsRightReadable OpenFlags = 1
OpenFlagsRightWritable OpenFlags = 2
OpenFlagsRightExecutable OpenFlags = 8
OpenFlagsCreate OpenFlags = 65536
OpenFlagsCreateIfAbsent OpenFlags = 131072
OpenFlagsTruncate OpenFlags = 262144
OpenFlagsDirectory OpenFlags = 524288
OpenFlagsAppend OpenFlags = 1048576
OpenFlagsNodeReference OpenFlags = 4194304
OpenFlagsDescribe OpenFlags = 8388608
OpenFlagsPosixWritable OpenFlags = 134217728
OpenFlagsPosixExecutable OpenFlags = 268435456
OpenFlagsNotDirectory OpenFlags = 33554432
OpenFlagsCloneSameRights OpenFlags = 67108864
OpenFlagsBlockDevice OpenFlags = 16777216
OpenFlags_Mask OpenFlags = 534708235
)
func (_ OpenFlags) I_BitsMask() OpenFlags {
return OpenFlags_Mask
}
func (_ OpenFlags) I_BitsIsStrict() bool {
return true
}
func (x OpenFlags) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x OpenFlags) GetUnknownBits() uint64 {
return uint64(^OpenFlags_Mask & x)
}
func (x OpenFlags) InvertBits() OpenFlags {
return OpenFlags_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x OpenFlags) HasBits(mask OpenFlags) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x OpenFlags) ClearBits(mask OpenFlags) OpenFlags {
return ^mask & x
}
func (x OpenFlags) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("RightReadable")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("RightWritable")
}
if 8&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("RightExecutable")
}
if 65536&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Create")
}
if 131072&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("CreateIfAbsent")
}
if 262144&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Truncate")
}
if 524288&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Directory")
}
if 1048576&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Append")
}
if 4194304&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("NodeReference")
}
if 8388608&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Describe")
}
if 134217728&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("PosixWritable")
}
if 268435456&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("PosixExecutable")
}
if 33554432&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("NotDirectory")
}
if 67108864&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("CloneSameRights")
}
if 16777216&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("BlockDevice")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = Operations(0)
// The common members definition behind [`Rights`] and [`Abilities`].
// Note that Directory operations are distinct from File operations, with the
// exception of some common operations (e.g. `GET_ATTRIBUTES`) defined on the
// underlying [`Node`].
type Operations uint64
const (
OperationsConnect Operations = 1
OperationsReadBytes Operations = 2
OperationsWriteBytes Operations = 4
OperationsExecute Operations = 8
OperationsGetAttributes Operations = 16
OperationsUpdateAttributes Operations = 32
OperationsEnumerate Operations = 64
OperationsTraverse Operations = 128
OperationsModifyDirectory Operations = 256
Operations_Mask Operations = 511
)
func (_ Operations) I_BitsMask() Operations {
return Operations_Mask
}
func (_ Operations) I_BitsIsStrict() bool {
return true
}
func (x Operations) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x Operations) GetUnknownBits() uint64 {
return uint64(^Operations_Mask & x)
}
func (x Operations) InvertBits() Operations {
return Operations_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x Operations) HasBits(mask Operations) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x Operations) ClearBits(mask Operations) Operations {
return ^mask & x
}
func (x Operations) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Connect")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("ReadBytes")
}
if 4&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("WriteBytes")
}
if 8&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Execute")
}
if 16&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("GetAttributes")
}
if 32&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("UpdateAttributes")
}
if 64&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Enumerate")
}
if 128&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Traverse")
}
if 256&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("ModifyDirectory")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = SymlinkProtocolFlags(0)
type SymlinkProtocolFlags uint64
const (
SymlinkProtocolFlags_Mask SymlinkProtocolFlags = 0
)
func (_ SymlinkProtocolFlags) I_BitsMask() SymlinkProtocolFlags {
return SymlinkProtocolFlags_Mask
}
func (_ SymlinkProtocolFlags) I_BitsIsStrict() bool {
return false
}
func (x SymlinkProtocolFlags) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x SymlinkProtocolFlags) GetUnknownBits() uint64 {
return uint64(^SymlinkProtocolFlags_Mask & x)
}
func (x SymlinkProtocolFlags) InvertBits() SymlinkProtocolFlags {
return SymlinkProtocolFlags_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x SymlinkProtocolFlags) HasBits(mask SymlinkProtocolFlags) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x SymlinkProtocolFlags) ClearBits(mask SymlinkProtocolFlags) SymlinkProtocolFlags {
return ^mask & x
}
func (x SymlinkProtocolFlags) String() string {
var buf _strings.Builder
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = UnlinkFlags(0)
type UnlinkFlags uint64
const (
UnlinkFlagsMustBeDirectory UnlinkFlags = 1
UnlinkFlags_Mask UnlinkFlags = 1
)
func (_ UnlinkFlags) I_BitsMask() UnlinkFlags {
return UnlinkFlags_Mask
}
func (_ UnlinkFlags) I_BitsIsStrict() bool {
return true
}
func (x UnlinkFlags) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x UnlinkFlags) GetUnknownBits() uint64 {
return uint64(^UnlinkFlags_Mask & x)
}
func (x UnlinkFlags) InvertBits() UnlinkFlags {
return UnlinkFlags_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x UnlinkFlags) HasBits(mask UnlinkFlags) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x UnlinkFlags) ClearBits(mask UnlinkFlags) UnlinkFlags {
return ^mask & x
}
func (x UnlinkFlags) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("MustBeDirectory")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = VmoFlags(0)
type VmoFlags uint32
const (
VmoFlagsRead VmoFlags = 1
VmoFlagsWrite VmoFlags = 2
VmoFlagsExecute VmoFlags = 4
VmoFlagsPrivateClone VmoFlags = 65536
VmoFlagsSharedBuffer VmoFlags = 131072
VmoFlags_Mask VmoFlags = 196615
)
func (_ VmoFlags) I_BitsMask() VmoFlags {
return VmoFlags_Mask
}
func (_ VmoFlags) I_BitsIsStrict() bool {
return true
}
func (x VmoFlags) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x VmoFlags) GetUnknownBits() uint64 {
return uint64(^VmoFlags_Mask & x)
}
func (x VmoFlags) InvertBits() VmoFlags {
return VmoFlags_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x VmoFlags) HasBits(mask VmoFlags) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x VmoFlags) ClearBits(mask VmoFlags) VmoFlags {
return ^mask & x
}
func (x VmoFlags) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Read")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Write")
}
if 4&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Execute")
}
if 65536&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("PrivateClone")
}
if 131072&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("SharedBuffer")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
var _ _bindings.Bits = WatchMask(0)
type WatchMask uint32
const (
WatchMaskDeleted WatchMask = 1
WatchMaskAdded WatchMask = 2
WatchMaskRemoved WatchMask = 4
WatchMaskExisting WatchMask = 8
WatchMaskIdle WatchMask = 16
WatchMask_Mask WatchMask = 31
)
func (_ WatchMask) I_BitsMask() WatchMask {
return WatchMask_Mask
}
func (_ WatchMask) I_BitsIsStrict() bool {
return true
}
func (x WatchMask) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x WatchMask) GetUnknownBits() uint64 {
return uint64(^WatchMask_Mask & x)
}
func (x WatchMask) InvertBits() WatchMask {
return WatchMask_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x WatchMask) HasBits(mask WatchMask) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x WatchMask) ClearBits(mask WatchMask) WatchMask {
return ^mask & x
}
func (x WatchMask) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Deleted")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Added")
}
if 4&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Removed")
}
if 8&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Existing")
}
if 16&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("Idle")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}
type AdvisoryLockRange struct {
_ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"`
// The location in the file from which [`offset`] is computed.
Origin SeekOrigin `fidl_offset_v2:"0"`
// The start of the byte range, expressed as an offset from [`origin`].
// Cannot be negative if [`origin`] is [`SeekOrigin.START`].
Offset int64 `fidl_offset_v2:"8"`
// The length of the byte range in bytes.
//
// If the length is zero, then the byte range extends until the end of the
// file, regardless of how large the file becomes.
//
// If the length is negative, the byte range includes the bytes `offset` +
// `length` up to, and including, `offset` - 1, provided this range does
// not extend beyond the beginning of the file.
Length int64 `fidl_offset_v2:"16"`
}
var _mAdvisoryLockRange = _bindings.CreateLazyMarshaler(AdvisoryLockRange{})
func (msg *AdvisoryLockRange) Marshaler() _bindings.Marshaler {
return _mAdvisoryLockRange
}
type AdvisoryLockingAdvisoryLockRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Request AdvisoryLockRequest `fidl_offset_v2:"0"`
}
var _mAdvisoryLockingAdvisoryLockRequest = _bindings.CreateLazyMarshaler(AdvisoryLockingAdvisoryLockRequest{})
func (msg *AdvisoryLockingAdvisoryLockRequest) Marshaler() _bindings.Marshaler {
return _mAdvisoryLockingAdvisoryLockRequest
}
type AdvisoryLockingAdvisoryLockResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mAdvisoryLockingAdvisoryLockResponse = _bindings.CreateLazyMarshaler(AdvisoryLockingAdvisoryLockResponse{})
func (msg *AdvisoryLockingAdvisoryLockResponse) Marshaler() _bindings.Marshaler {
return _mAdvisoryLockingAdvisoryLockResponse
}
type Directory1GetTokenResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"`
S int32 `fidl_offset_v2:"0"`
Token _zx.Handle `fidl_offset_v2:"4" fidl_handle_subtype:"0" fidl_handle_rights:"2147483648" fidl_bounds:"1"`
}
var _mDirectory1GetTokenResponse = _bindings.CreateLazyMarshaler(Directory1GetTokenResponse{})
func (msg *Directory1GetTokenResponse) Marshaler() _bindings.Marshaler {
return _mDirectory1GetTokenResponse
}
type Directory1LinkRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"40" fidl_alignment_v2:"8"`
Src string `fidl_offset_v2:"0" fidl_bounds:"255"`
DstParentToken _zx.Handle `fidl_offset_v2:"16" fidl_handle_subtype:"0" fidl_handle_rights:"2147483648" fidl_bounds:"0"`
Dst string `fidl_offset_v2:"24" fidl_bounds:"255"`
}
var _mDirectory1LinkRequest = _bindings.CreateLazyMarshaler(Directory1LinkRequest{})
func (msg *Directory1LinkRequest) Marshaler() _bindings.Marshaler {
return _mDirectory1LinkRequest
}
type Directory1LinkResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"`
S int32 `fidl_offset_v2:"0"`
}
var _mDirectory1LinkResponse = _bindings.CreateLazyMarshaler(Directory1LinkResponse{})
func (msg *Directory1LinkResponse) Marshaler() _bindings.Marshaler {
return _mDirectory1LinkResponse
}
type Directory1ReadDirentsRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"8"`
MaxBytes uint64 `fidl_offset_v2:"0"`
}
var _mDirectory1ReadDirentsRequest = _bindings.CreateLazyMarshaler(Directory1ReadDirentsRequest{})
func (msg *Directory1ReadDirentsRequest) Marshaler() _bindings.Marshaler {
return _mDirectory1ReadDirentsRequest
}
type Directory1ReadDirentsResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"`
S int32 `fidl_offset_v2:"0"`
Dirents []uint8 `fidl_offset_v2:"8" fidl_bounds:"8192"`
}
var _mDirectory1ReadDirentsResponse = _bindings.CreateLazyMarshaler(Directory1ReadDirentsResponse{})
func (msg *Directory1ReadDirentsResponse) Marshaler() _bindings.Marshaler {
return _mDirectory1ReadDirentsResponse
}
type Directory1RewindResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"`
S int32 `fidl_offset_v2:"0"`
}
var _mDirectory1RewindResponse = _bindings.CreateLazyMarshaler(Directory1RewindResponse{})
func (msg *Directory1RewindResponse) Marshaler() _bindings.Marshaler {
return _mDirectory1RewindResponse
}
type Directory1WatchRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"12" fidl_alignment_v2:"4"`
Mask WatchMask `fidl_offset_v2:"0"`
Options uint32 `fidl_offset_v2:"4"`
Watcher DirectoryWatcherWithCtxInterfaceRequest `fidl_offset_v2:"8" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mDirectory1WatchRequest = _bindings.CreateLazyMarshaler(Directory1WatchRequest{})
func (msg *Directory1WatchRequest) Marshaler() _bindings.Marshaler {
return _mDirectory1WatchRequest
}
type Directory1WatchResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"`
S int32 `fidl_offset_v2:"0"`
}
var _mDirectory1WatchResponse = _bindings.CreateLazyMarshaler(Directory1WatchResponse{})
func (msg *Directory1WatchResponse) Marshaler() _bindings.Marshaler {
return _mDirectory1WatchResponse
}
type Directory2CreateSymlinkRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"40" fidl_alignment_v2:"8"`
Name string `fidl_offset_v2:"0" fidl_bounds:"255"`
Target []uint8 `fidl_offset_v2:"16" fidl_bounds:"4095"`
Connection SymlinkWithCtxInterfaceRequest `fidl_offset_v2:"32" fidl_handle_subtype:"4" fidl_bounds:"1"`
}
var _mDirectory2CreateSymlinkRequest = _bindings.CreateLazyMarshaler(Directory2CreateSymlinkRequest{})
func (msg *Directory2CreateSymlinkRequest) Marshaler() _bindings.Marshaler {
return _mDirectory2CreateSymlinkRequest
}
type Directory2EnumerateRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"`
Options DirectoryEnumerateOptions `fidl_offset_v2:"0"`
Iterator DirectoryIteratorWithCtxInterfaceRequest `fidl_offset_v2:"16" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mDirectory2EnumerateRequest = _bindings.CreateLazyMarshaler(Directory2EnumerateRequest{})
func (msg *Directory2EnumerateRequest) Marshaler() _bindings.Marshaler {
return _mDirectory2EnumerateRequest
}
type Directory2Open2Request struct {
_ struct{} `fidl:"s" fidl_size_v2:"40" fidl_alignment_v2:"8"`
// Identifies the node to open.
//
// If it contains multiple segments, then the directory is traversed,
// one segment at a time, relative to the directory represented by this
// connection.
Path string `fidl_offset_v2:"0" fidl_bounds:"4095"`
// The representations accepted by the caller to support a form of
// protocol negotiation on the node being opened.
Protocols ConnectionProtocols `fidl_offset_v2:"16"`
// The server end of a channel created for the new connection. The
// caller may proceed to send messages on the corresponding client end
// right away.
ObjectRequest _zx.Channel `fidl_offset_v2:"32" fidl_handle_subtype:"4" fidl_handle_rights:"2147483648" fidl_bounds:"0"`
}
var _mDirectory2Open2Request = _bindings.CreateLazyMarshaler(Directory2Open2Request{})
func (msg *Directory2Open2Request) Marshaler() _bindings.Marshaler {
return _mDirectory2Open2Request
}
type Directory2RenameRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"40" fidl_alignment_v2:"8"`
Src string `fidl_offset_v2:"0" fidl_bounds:"255"`
DstParentToken _zx.Event `fidl_offset_v2:"16" fidl_handle_subtype:"5" fidl_handle_rights:"2147483648" fidl_bounds:"0"`
Dst string `fidl_offset_v2:"24" fidl_bounds:"255"`
}
var _mDirectory2RenameRequest = _bindings.CreateLazyMarshaler(Directory2RenameRequest{})
func (msg *Directory2RenameRequest) Marshaler() _bindings.Marshaler {
return _mDirectory2RenameRequest
}
type Directory2UnlinkRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"32" fidl_alignment_v2:"8"`
Name string `fidl_offset_v2:"0" fidl_bounds:"255"`
Options UnlinkOptions `fidl_offset_v2:"16"`
}
var _mDirectory2UnlinkRequest = _bindings.CreateLazyMarshaler(Directory2UnlinkRequest{})
func (msg *Directory2UnlinkRequest) Marshaler() _bindings.Marshaler {
return _mDirectory2UnlinkRequest
}
type Directory2CreateSymlinkResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mDirectory2CreateSymlinkResponse = _bindings.CreateLazyMarshaler(Directory2CreateSymlinkResponse{})
func (msg *Directory2CreateSymlinkResponse) Marshaler() _bindings.Marshaler {
return _mDirectory2CreateSymlinkResponse
}
type Directory2RenameResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mDirectory2RenameResponse = _bindings.CreateLazyMarshaler(Directory2RenameResponse{})
func (msg *Directory2RenameResponse) Marshaler() _bindings.Marshaler {
return _mDirectory2RenameResponse
}
type Directory2UnlinkResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mDirectory2UnlinkResponse = _bindings.CreateLazyMarshaler(Directory2UnlinkResponse{})
func (msg *Directory2UnlinkResponse) Marshaler() _bindings.Marshaler {
return _mDirectory2UnlinkResponse
}
type DirectoryIteratorGetNextResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
// Information about an immediate child node of a directory.
//
// If a particular attribute is not applicable or not supported,
// implementations should leave the corresponding field absent.
Entries []DirectoryEntry `fidl_offset_v2:"0" fidl_bounds:"8192"`
}
var _mDirectoryIteratorGetNextResponse = _bindings.CreateLazyMarshaler(DirectoryIteratorGetNextResponse{})
func (msg *DirectoryIteratorGetNextResponse) Marshaler() _bindings.Marshaler {
return _mDirectoryIteratorGetNextResponse
}
type DirectoryObject struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mDirectoryObject = _bindings.CreateLazyMarshaler(DirectoryObject{})
func (msg *DirectoryObject) Marshaler() _bindings.Marshaler {
return _mDirectoryObject
}
type ExtendedAttributeIteratorGetNextResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"`
Attributes [][]uint8 `fidl_offset_v2:"0" fidl_bounds:"128,255"`
Last bool `fidl_offset_v2:"16"`
}
var _mExtendedAttributeIteratorGetNextResponse = _bindings.CreateLazyMarshaler(ExtendedAttributeIteratorGetNextResponse{})
func (msg *ExtendedAttributeIteratorGetNextResponse) Marshaler() _bindings.Marshaler {
return _mExtendedAttributeIteratorGetNextResponse
}
type FileAllocateRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"`
Offset uint64 `fidl_offset_v2:"0"`
Length uint64 `fidl_offset_v2:"8"`
// If an empty bits is passed for mode, the default behavior is used. Otherwise the
// behavior is modified as described for each mode bit. If the backing filesystem doesn't
// support a particular provided mode bit, or combination of mode bits, an error is
// returned.
Mode AllocateMode `fidl_offset_v2:"16"`
}
var _mFileAllocateRequest = _bindings.CreateLazyMarshaler(FileAllocateRequest{})
func (msg *FileAllocateRequest) Marshaler() _bindings.Marshaler {
return _mFileAllocateRequest
}
type FileEnableVerityRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Options VerificationOptions `fidl_offset_v2:"0"`
}
var _mFileEnableVerityRequest = _bindings.CreateLazyMarshaler(FileEnableVerityRequest{})
func (msg *FileEnableVerityRequest) Marshaler() _bindings.Marshaler {
return _mFileEnableVerityRequest
}
type FileGetBackingMemoryRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"`
Flags VmoFlags `fidl_offset_v2:"0"`
}
var _mFileGetBackingMemoryRequest = _bindings.CreateLazyMarshaler(FileGetBackingMemoryRequest{})
func (msg *FileGetBackingMemoryRequest) Marshaler() _bindings.Marshaler {
return _mFileGetBackingMemoryRequest
}
type FileObject struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"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_offset_v2:"0" fidl_handle_subtype:"5" fidl_handle_rights:"2147483648" fidl_bounds:"1"`
// A placeholder for future stream support.
//
// Currently, servers are required not to send a handle in this field.
Stream _zx.Handle `fidl_offset_v2:"4" fidl_handle_subtype:"31" fidl_handle_rights:"2147483648" fidl_bounds:"1"`
}
var _mFileObject = _bindings.CreateLazyMarshaler(FileObject{})
func (msg *FileObject) Marshaler() _bindings.Marshaler {
return _mFileObject
}
type FileReadAtRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Count uint64 `fidl_offset_v2:"0"`
Offset uint64 `fidl_offset_v2:"8"`
}
var _mFileReadAtRequest = _bindings.CreateLazyMarshaler(FileReadAtRequest{})
func (msg *FileReadAtRequest) Marshaler() _bindings.Marshaler {
return _mFileReadAtRequest
}
type FileResizeRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Length uint64 `fidl_offset_v2:"0"`
}
var _mFileResizeRequest = _bindings.CreateLazyMarshaler(FileResizeRequest{})
func (msg *FileResizeRequest) Marshaler() _bindings.Marshaler {
return _mFileResizeRequest
}
type FileSeekRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Origin SeekOrigin `fidl_offset_v2:"0"`
Offset int64 `fidl_offset_v2:"8"`
}
var _mFileSeekRequest = _bindings.CreateLazyMarshaler(FileSeekRequest{})
func (msg *FileSeekRequest) Marshaler() _bindings.Marshaler {
return _mFileSeekRequest
}
type FileWriteAtRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"`
Data []uint8 `fidl_offset_v2:"0" fidl_bounds:"8192"`
Offset uint64 `fidl_offset_v2:"16"`
}
var _mFileWriteAtRequest = _bindings.CreateLazyMarshaler(FileWriteAtRequest{})
func (msg *FileWriteAtRequest) Marshaler() _bindings.Marshaler {
return _mFileWriteAtRequest
}
type FileAllocateResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mFileAllocateResponse = _bindings.CreateLazyMarshaler(FileAllocateResponse{})
func (msg *FileAllocateResponse) Marshaler() _bindings.Marshaler {
return _mFileAllocateResponse
}
type FileEnableVerityResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mFileEnableVerityResponse = _bindings.CreateLazyMarshaler(FileEnableVerityResponse{})
func (msg *FileEnableVerityResponse) Marshaler() _bindings.Marshaler {
return _mFileEnableVerityResponse
}
type FileGetBackingMemoryResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"`
Vmo _zx.VMO `fidl_offset_v2:"0" fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:"0"`
}
var _mFileGetBackingMemoryResponse = _bindings.CreateLazyMarshaler(FileGetBackingMemoryResponse{})
func (msg *FileGetBackingMemoryResponse) Marshaler() _bindings.Marshaler {
return _mFileGetBackingMemoryResponse
}
type FileReadAtResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Data []uint8 `fidl_offset_v2:"0" fidl_bounds:"8192"`
}
var _mFileReadAtResponse = _bindings.CreateLazyMarshaler(FileReadAtResponse{})
func (msg *FileReadAtResponse) Marshaler() _bindings.Marshaler {
return _mFileReadAtResponse
}
type FileResizeResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mFileResizeResponse = _bindings.CreateLazyMarshaler(FileResizeResponse{})
func (msg *FileResizeResponse) Marshaler() _bindings.Marshaler {
return _mFileResizeResponse
}
type FileSeekResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"8"`
OffsetFromStart uint64 `fidl_offset_v2:"0"`
}
var _mFileSeekResponse = _bindings.CreateLazyMarshaler(FileSeekResponse{})
func (msg *FileSeekResponse) Marshaler() _bindings.Marshaler {
return _mFileSeekResponse
}
type FileWriteAtResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"8"`
ActualCount uint64 `fidl_offset_v2:"0"`
}
var _mFileWriteAtResponse = _bindings.CreateLazyMarshaler(FileWriteAtResponse{})
func (msg *FileWriteAtResponse) Marshaler() _bindings.Marshaler {
return _mFileWriteAtResponse
}
type FilesystemInfo struct {
_ struct{} `fidl:"s" fidl_size_v2:"96" fidl_alignment_v2:"8"`
// The number of data bytes which may be stored in a filesystem. This does not count
// metadata or other filesystem overhead like block rounding.
TotalBytes uint64 `fidl_offset_v2:"0"`
// The number of data bytes which are in use by the filesystem. This does not count
// metadata or other filesystem overhead like block rounding.
UsedBytes uint64 `fidl_offset_v2:"8"`
// The number of nodes which may be stored in the filesystem.
TotalNodes uint64 `fidl_offset_v2:"16"`
// The number of nodes used by the filesystem.
UsedNodes uint64 `fidl_offset_v2:"24"`
// The amount of additional space which may be allocated from the underlying volume
// manager. If unsupported or there is no space for the filesystem to grow, this will
// be zero.
FreeSharedPoolBytes uint64 `fidl_offset_v2:"32"`
// A unique identifier for this filesystem instance. Will not be preserved across
// reboots.
//
// Implementors should create a kernel object (normally an event) and use its koid for
// the filesystem ID. This koid guarantees uniqueness in the system.
FsId uint64 `fidl_offset_v2:"40"`
// The size in bytes of a single filesystem block.
BlockSize uint32 `fidl_offset_v2:"48"`
// The maximum length of a filesystem name.
MaxFilenameSize uint32 `fidl_offset_v2:"52"`
// A unique identifier for the type of the underlying filesystem.
FsType uint32 `fidl_offset_v2:"56"`
Padding uint32 `fidl_offset_v2:"60"`
Name [32]int8 `fidl_offset_v2:"64"`
}
var _mFilesystemInfo = _bindings.CreateLazyMarshaler(FilesystemInfo{})
func (msg *FilesystemInfo) Marshaler() _bindings.Marshaler {
return _mFilesystemInfo
}
type LinkableLinkIntoRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"`
DstParentToken _zx.Event `fidl_offset_v2:"0" fidl_handle_subtype:"5" fidl_handle_rights:"2147483648" fidl_bounds:"0"`
Dst string `fidl_offset_v2:"8" fidl_bounds:"255"`
}
var _mLinkableLinkIntoRequest = _bindings.CreateLazyMarshaler(LinkableLinkIntoRequest{})
func (msg *LinkableLinkIntoRequest) Marshaler() _bindings.Marshaler {
return _mLinkableLinkIntoRequest
}
type LinkableLinkIntoResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mLinkableLinkIntoResponse = _bindings.CreateLazyMarshaler(LinkableLinkIntoResponse{})
func (msg *LinkableLinkIntoResponse) Marshaler() _bindings.Marshaler {
return _mLinkableLinkIntoResponse
}
type Node1CloneRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"`
Flags OpenFlags `fidl_offset_v2:"0"`
Object NodeWithCtxInterfaceRequest `fidl_offset_v2:"4" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mNode1CloneRequest = _bindings.CreateLazyMarshaler(Node1CloneRequest{})
func (msg *Node1CloneRequest) Marshaler() _bindings.Marshaler {
return _mNode1CloneRequest
}
type Node1GetAttrResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"64" fidl_alignment_v2:"8"`
S int32 `fidl_offset_v2:"0"`
Attributes NodeAttributes `fidl_offset_v2:"8"`
}
var _mNode1GetAttrResponse = _bindings.CreateLazyMarshaler(Node1GetAttrResponse{})
func (msg *Node1GetAttrResponse) Marshaler() _bindings.Marshaler {
return _mNode1GetAttrResponse
}
type Node1GetFlagsResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"4"`
S int32 `fidl_offset_v2:"0"`
Flags OpenFlags `fidl_offset_v2:"4"`
}
var _mNode1GetFlagsResponse = _bindings.CreateLazyMarshaler(Node1GetFlagsResponse{})
func (msg *Node1GetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mNode1GetFlagsResponse
}
type Node1OnOpenRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"`
S int32 `fidl_offset_v2:"0"`
Info *NodeInfoDeprecated `fidl_offset_v2:"8"`
}
var _mNode1OnOpenRequest = _bindings.CreateLazyMarshaler(Node1OnOpenRequest{})
func (msg *Node1OnOpenRequest) Marshaler() _bindings.Marshaler {
return _mNode1OnOpenRequest
}
type Node1QueryFilesystemResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
S int32 `fidl_offset_v2:"0"`
Info *FilesystemInfo `fidl_offset_v2:"8"`
}
var _mNode1QueryFilesystemResponse = _bindings.CreateLazyMarshaler(Node1QueryFilesystemResponse{})
func (msg *Node1QueryFilesystemResponse) Marshaler() _bindings.Marshaler {
return _mNode1QueryFilesystemResponse
}
type Node1SetAttrRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"64" fidl_alignment_v2:"8"`
Flags NodeAttributeFlags `fidl_offset_v2:"0"`
Attributes NodeAttributes `fidl_offset_v2:"8"`
}
var _mNode1SetAttrRequest = _bindings.CreateLazyMarshaler(Node1SetAttrRequest{})
func (msg *Node1SetAttrRequest) Marshaler() _bindings.Marshaler {
return _mNode1SetAttrRequest
}
type Node1SetAttrResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"`
S int32 `fidl_offset_v2:"0"`
}
var _mNode1SetAttrResponse = _bindings.CreateLazyMarshaler(Node1SetAttrResponse{})
func (msg *Node1SetAttrResponse) Marshaler() _bindings.Marshaler {
return _mNode1SetAttrResponse
}
type Node1SetFlagsRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"`
Flags OpenFlags `fidl_offset_v2:"0"`
}
var _mNode1SetFlagsRequest = _bindings.CreateLazyMarshaler(Node1SetFlagsRequest{})
func (msg *Node1SetFlagsRequest) Marshaler() _bindings.Marshaler {
return _mNode1SetFlagsRequest
}
type Node1SetFlagsResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"`
S int32 `fidl_offset_v2:"0"`
}
var _mNode1SetFlagsResponse = _bindings.CreateLazyMarshaler(Node1SetFlagsResponse{})
func (msg *Node1SetFlagsResponse) Marshaler() _bindings.Marshaler {
return _mNode1SetFlagsResponse
}
type Node2GetAttributesRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"8"`
// Set the corresponding bit to one to query that particular attribute.
//
// The elements here correspond one-to-one with [`NodeAttributes`].
Query NodeAttributesQuery `fidl_offset_v2:"0"`
}
var _mNode2GetAttributesRequest = _bindings.CreateLazyMarshaler(Node2GetAttributesRequest{})
func (msg *Node2GetAttributesRequest) Marshaler() _bindings.Marshaler {
return _mNode2GetAttributesRequest
}
type Node2GetExtendedAttributeRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Name []uint8 `fidl_offset_v2:"0" fidl_bounds:"255"`
}
var _mNode2GetExtendedAttributeRequest = _bindings.CreateLazyMarshaler(Node2GetExtendedAttributeRequest{})
func (msg *Node2GetExtendedAttributeRequest) Marshaler() _bindings.Marshaler {
return _mNode2GetExtendedAttributeRequest
}
type Node2ListExtendedAttributesRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"`
Iterator ExtendedAttributeIteratorWithCtxInterfaceRequest `fidl_offset_v2:"0" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mNode2ListExtendedAttributesRequest = _bindings.CreateLazyMarshaler(Node2ListExtendedAttributesRequest{})
func (msg *Node2ListExtendedAttributesRequest) Marshaler() _bindings.Marshaler {
return _mNode2ListExtendedAttributesRequest
}
type Node2RemoveExtendedAttributeRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Name []uint8 `fidl_offset_v2:"0" fidl_bounds:"255"`
}
var _mNode2RemoveExtendedAttributeRequest = _bindings.CreateLazyMarshaler(Node2RemoveExtendedAttributeRequest{})
func (msg *Node2RemoveExtendedAttributeRequest) Marshaler() _bindings.Marshaler {
return _mNode2RemoveExtendedAttributeRequest
}
type Node2ReopenRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"24" fidl_alignment_v2:"8"`
RightsRequest RightsRequest `fidl_offset_v2:"0"`
ObjectRequest NodeWithCtxInterfaceRequest `fidl_offset_v2:"16" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mNode2ReopenRequest = _bindings.CreateLazyMarshaler(Node2ReopenRequest{})
func (msg *Node2ReopenRequest) Marshaler() _bindings.Marshaler {
return _mNode2ReopenRequest
}
type Node2SetExtendedAttributeRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"40" fidl_alignment_v2:"8"`
Name []uint8 `fidl_offset_v2:"0" fidl_bounds:"255"`
Value ExtendedAttributeValue `fidl_offset_v2:"16"`
// Specifies the behavior based on the current state of the attribute.
Mode SetExtendedAttributeMode `fidl_offset_v2:"32"`
}
var _mNode2SetExtendedAttributeRequest = _bindings.CreateLazyMarshaler(Node2SetExtendedAttributeRequest{})
func (msg *Node2SetExtendedAttributeRequest) Marshaler() _bindings.Marshaler {
return _mNode2SetExtendedAttributeRequest
}
type Node2RemoveExtendedAttributeResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mNode2RemoveExtendedAttributeResponse = _bindings.CreateLazyMarshaler(Node2RemoveExtendedAttributeResponse{})
func (msg *Node2RemoveExtendedAttributeResponse) Marshaler() _bindings.Marshaler {
return _mNode2RemoveExtendedAttributeResponse
}
type Node2SetExtendedAttributeResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mNode2SetExtendedAttributeResponse = _bindings.CreateLazyMarshaler(Node2SetExtendedAttributeResponse{})
func (msg *Node2SetExtendedAttributeResponse) Marshaler() _bindings.Marshaler {
return _mNode2SetExtendedAttributeResponse
}
type Node2SyncResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mNode2SyncResponse = _bindings.CreateLazyMarshaler(Node2SyncResponse{})
func (msg *Node2SyncResponse) Marshaler() _bindings.Marshaler {
return _mNode2SyncResponse
}
type Node2UpdateAttributesResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mNode2UpdateAttributesResponse = _bindings.CreateLazyMarshaler(Node2UpdateAttributesResponse{})
func (msg *Node2UpdateAttributesResponse) Marshaler() _bindings.Marshaler {
return _mNode2UpdateAttributesResponse
}
// NodeAttributes defines generic information about a filesystem node.
type NodeAttributes struct {
_ struct{} `fidl:"s" fidl_size_v2:"56" fidl_alignment_v2:"8"`
// Protection bits and node type information describe in 'mode'.
Mode uint32 `fidl_offset_v2:"0"`
// A filesystem-unique ID.
Id uint64 `fidl_offset_v2:"8"`
// Node size, in bytes.
ContentSize uint64 `fidl_offset_v2:"16"`
// Space needed to store node (possibly larger than size), in bytes.
StorageSize uint64 `fidl_offset_v2:"24"`
// Hard link count.
LinkCount uint64 `fidl_offset_v2:"32"`
// Time of creation (may be updated manually after creation) in ns since Unix epoch, UTC.
CreationTime uint64 `fidl_offset_v2:"40"`
// Time of last modification in ns since Unix epoch, UTC.
ModificationTime uint64 `fidl_offset_v2:"48"`
}
var _mNodeAttributes = _bindings.CreateLazyMarshaler(NodeAttributes{})
func (msg *NodeAttributes) Marshaler() _bindings.Marshaler {
return _mNodeAttributes
}
type NodeAttributes2 struct {
_ struct{} `fidl:"s" fidl_size_v2:"32" fidl_alignment_v2:"8"`
MutableAttributes MutableNodeAttributes `fidl_offset_v2:"0"`
ImmutableAttributes ImmutableNodeAttributes `fidl_offset_v2:"16"`
}
var _mNodeAttributes2 = _bindings.CreateLazyMarshaler(NodeAttributes2{})
func (msg *NodeAttributes2) Marshaler() _bindings.Marshaler {
return _mNodeAttributes2
}
type OpenableOpenRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"32" fidl_alignment_v2:"8"`
Flags OpenFlags `fidl_offset_v2:"0"`
Mode ModeType `fidl_offset_v2:"4"`
Path string `fidl_offset_v2:"8" fidl_bounds:"4095"`
Object NodeWithCtxInterfaceRequest `fidl_offset_v2:"24" fidl_handle_subtype:"4" fidl_bounds:"0"`
}
var _mOpenableOpenRequest = _bindings.CreateLazyMarshaler(OpenableOpenRequest{})
func (msg *OpenableOpenRequest) Marshaler() _bindings.Marshaler {
return _mOpenableOpenRequest
}
type ReadableReadRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Count uint64 `fidl_offset_v2:"0"`
}
var _mReadableReadRequest = _bindings.CreateLazyMarshaler(ReadableReadRequest{})
func (msg *ReadableReadRequest) Marshaler() _bindings.Marshaler {
return _mReadableReadRequest
}
type ReadableReadResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Data []uint8 `fidl_offset_v2:"0" fidl_bounds:"8192"`
}
var _mReadableReadResponse = _bindings.CreateLazyMarshaler(ReadableReadResponse{})
func (msg *ReadableReadResponse) Marshaler() _bindings.Marshaler {
return _mReadableReadResponse
}
type Service struct {
_ struct{} `fidl:"s" fidl_size_v2:"1" fidl_alignment_v2:"1"`
}
var _mService = _bindings.CreateLazyMarshaler(Service{})
func (msg *Service) Marshaler() _bindings.Marshaler {
return _mService
}
type SymlinkObject struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Target []uint8 `fidl_offset_v2:"0" fidl_bounds:"4095"`
}
var _mSymlinkObject = _bindings.CreateLazyMarshaler(SymlinkObject{})
func (msg *SymlinkObject) Marshaler() _bindings.Marshaler {
return _mSymlinkObject
}
type WritableWriteRequest struct {
_ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Data []uint8 `fidl_offset_v2:"0" fidl_bounds:"8192"`
}
var _mWritableWriteRequest = _bindings.CreateLazyMarshaler(WritableWriteRequest{})
func (msg *WritableWriteRequest) Marshaler() _bindings.Marshaler {
return _mWritableWriteRequest
}
type WritableWriteResponse struct {
_ struct{} `fidl:"s" fidl_size_v2:"8" fidl_alignment_v2:"8"`
ActualCount uint64 `fidl_offset_v2:"0"`
}
var _mWritableWriteResponse = _bindings.CreateLazyMarshaler(WritableWriteResponse{})
func (msg *WritableWriteResponse) Marshaler() _bindings.Marshaler {
return _mWritableWriteResponse
}
type I_advisoryLockingAdvisoryLockResultTag uint64
const (
AdvisoryLockingAdvisoryLockResultResponse = 1 // 0x00000001
AdvisoryLockingAdvisoryLockResultErr = 2 // 0x00000002
)
type AdvisoryLockingAdvisoryLockResult struct {
I_advisoryLockingAdvisoryLockResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response AdvisoryLockingAdvisoryLockResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mAdvisoryLockingAdvisoryLockResult = _bindings.CreateLazyMarshaler(AdvisoryLockingAdvisoryLockResult{})
func (msg *AdvisoryLockingAdvisoryLockResult) Marshaler() _bindings.Marshaler {
return _mAdvisoryLockingAdvisoryLockResult
}
func (_m *AdvisoryLockingAdvisoryLockResult) reset() {
switch _m.I_advisoryLockingAdvisoryLockResultTag {
case 1:
var _zeroed AdvisoryLockingAdvisoryLockResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *AdvisoryLockingAdvisoryLockResult) Which() I_advisoryLockingAdvisoryLockResultTag {
return _m.I_advisoryLockingAdvisoryLockResultTag
}
func (_m *AdvisoryLockingAdvisoryLockResult) Ordinal() uint64 {
return uint64(_m.I_advisoryLockingAdvisoryLockResultTag)
}
func (_m *AdvisoryLockingAdvisoryLockResult) SetResponse(response AdvisoryLockingAdvisoryLockResponse) {
_m.reset()
_m.I_advisoryLockingAdvisoryLockResultTag = AdvisoryLockingAdvisoryLockResultResponse
_m.Response = response
}
func AdvisoryLockingAdvisoryLockResultWithResponse(response AdvisoryLockingAdvisoryLockResponse) AdvisoryLockingAdvisoryLockResult {
var _u AdvisoryLockingAdvisoryLockResult
_u.SetResponse(response)
return _u
}
func (_m *AdvisoryLockingAdvisoryLockResult) SetErr(err int32) {
_m.reset()
_m.I_advisoryLockingAdvisoryLockResultTag = AdvisoryLockingAdvisoryLockResultErr
_m.Err = err
}
func AdvisoryLockingAdvisoryLockResultWithErr(err int32) AdvisoryLockingAdvisoryLockResult {
var _u AdvisoryLockingAdvisoryLockResult
_u.SetErr(err)
return _u
}
type I_connectionProtocolsTag uint64
const (
ConnectionProtocols_unknownData = 0 // 0x00000000
ConnectionProtocolsConnector = 1 // 0x00000001
ConnectionProtocolsNode = 2 // 0x00000002
)
type ConnectionProtocols struct {
I_connectionProtocolsTag `fidl:"x" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Requests that the node's underlying protocol be served on the
// connection.
Connector ConnectorFlags `fidl_ordinal:"1"`
// Requests that the underlying [`Node`] protocol be served on the
// connection.
Node NodeOptions `fidl_ordinal:"2"`
}
var _mConnectionProtocols = _bindings.CreateLazyMarshaler(ConnectionProtocols{})
func (msg *ConnectionProtocols) Marshaler() _bindings.Marshaler {
return _mConnectionProtocols
}
func (_m *ConnectionProtocols) reset() {
switch _m.I_connectionProtocolsTag {
case 1:
var _zeroed ConnectorFlags
_m.Connector = _zeroed
case 2:
var _zeroed NodeOptions
_m.Node = _zeroed
default:
var _zeroed interface{}
_m.I_unknownData = _zeroed
}
}
func (_m *ConnectionProtocols) Which() I_connectionProtocolsTag {
switch _m.I_connectionProtocolsTag {
case 1:
return ConnectionProtocolsConnector
case 2:
return ConnectionProtocolsNode
default:
return ConnectionProtocols_unknownData
}
}
func (_m *ConnectionProtocols) Ordinal() uint64 {
return uint64(_m.I_connectionProtocolsTag)
}
func (_m *ConnectionProtocols) SetConnector(connector ConnectorFlags) {
_m.reset()
_m.I_connectionProtocolsTag = ConnectionProtocolsConnector
_m.Connector = connector
}
func ConnectionProtocolsWithConnector(connector ConnectorFlags) ConnectionProtocols {
var _u ConnectionProtocols
_u.SetConnector(connector)
return _u
}
func (_m *ConnectionProtocols) SetNode(node NodeOptions) {
_m.reset()
_m.I_connectionProtocolsTag = ConnectionProtocolsNode
_m.Node = node
}
func ConnectionProtocolsWithNode(node NodeOptions) ConnectionProtocols {
var _u ConnectionProtocols
_u.SetNode(node)
return _u
}
func (_m *ConnectionProtocols) GetUnknownData() _bindings.UnknownData {
return _m.I_unknownData.(_bindings.UnknownData)
}
type I_directory2CreateSymlinkResultTag uint64
const (
Directory2CreateSymlinkResultResponse = 1 // 0x00000001
Directory2CreateSymlinkResultErr = 2 // 0x00000002
)
type Directory2CreateSymlinkResult struct {
I_directory2CreateSymlinkResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response Directory2CreateSymlinkResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mDirectory2CreateSymlinkResult = _bindings.CreateLazyMarshaler(Directory2CreateSymlinkResult{})
func (msg *Directory2CreateSymlinkResult) Marshaler() _bindings.Marshaler {
return _mDirectory2CreateSymlinkResult
}
func (_m *Directory2CreateSymlinkResult) reset() {
switch _m.I_directory2CreateSymlinkResultTag {
case 1:
var _zeroed Directory2CreateSymlinkResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *Directory2CreateSymlinkResult) Which() I_directory2CreateSymlinkResultTag {
return _m.I_directory2CreateSymlinkResultTag
}
func (_m *Directory2CreateSymlinkResult) Ordinal() uint64 {
return uint64(_m.I_directory2CreateSymlinkResultTag)
}
func (_m *Directory2CreateSymlinkResult) SetResponse(response Directory2CreateSymlinkResponse) {
_m.reset()
_m.I_directory2CreateSymlinkResultTag = Directory2CreateSymlinkResultResponse
_m.Response = response
}
func Directory2CreateSymlinkResultWithResponse(response Directory2CreateSymlinkResponse) Directory2CreateSymlinkResult {
var _u Directory2CreateSymlinkResult
_u.SetResponse(response)
return _u
}
func (_m *Directory2CreateSymlinkResult) SetErr(err int32) {
_m.reset()
_m.I_directory2CreateSymlinkResultTag = Directory2CreateSymlinkResultErr
_m.Err = err
}
func Directory2CreateSymlinkResultWithErr(err int32) Directory2CreateSymlinkResult {
var _u Directory2CreateSymlinkResult
_u.SetErr(err)
return _u
}
type I_directory2RenameResultTag uint64
const (
Directory2RenameResultResponse = 1 // 0x00000001
Directory2RenameResultErr = 2 // 0x00000002
)
type Directory2RenameResult struct {
I_directory2RenameResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response Directory2RenameResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mDirectory2RenameResult = _bindings.CreateLazyMarshaler(Directory2RenameResult{})
func (msg *Directory2RenameResult) Marshaler() _bindings.Marshaler {
return _mDirectory2RenameResult
}
func (_m *Directory2RenameResult) reset() {
switch _m.I_directory2RenameResultTag {
case 1:
var _zeroed Directory2RenameResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *Directory2RenameResult) Which() I_directory2RenameResultTag {
return _m.I_directory2RenameResultTag
}
func (_m *Directory2RenameResult) Ordinal() uint64 {
return uint64(_m.I_directory2RenameResultTag)
}
func (_m *Directory2RenameResult) SetResponse(response Directory2RenameResponse) {
_m.reset()
_m.I_directory2RenameResultTag = Directory2RenameResultResponse
_m.Response = response
}
func Directory2RenameResultWithResponse(response Directory2RenameResponse) Directory2RenameResult {
var _u Directory2RenameResult
_u.SetResponse(response)
return _u
}
func (_m *Directory2RenameResult) SetErr(err int32) {
_m.reset()
_m.I_directory2RenameResultTag = Directory2RenameResultErr
_m.Err = err
}
func Directory2RenameResultWithErr(err int32) Directory2RenameResult {
var _u Directory2RenameResult
_u.SetErr(err)
return _u
}
type I_directory2UnlinkResultTag uint64
const (
Directory2UnlinkResultResponse = 1 // 0x00000001
Directory2UnlinkResultErr = 2 // 0x00000002
)
type Directory2UnlinkResult struct {
I_directory2UnlinkResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response Directory2UnlinkResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mDirectory2UnlinkResult = _bindings.CreateLazyMarshaler(Directory2UnlinkResult{})
func (msg *Directory2UnlinkResult) Marshaler() _bindings.Marshaler {
return _mDirectory2UnlinkResult
}
func (_m *Directory2UnlinkResult) reset() {
switch _m.I_directory2UnlinkResultTag {
case 1:
var _zeroed Directory2UnlinkResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *Directory2UnlinkResult) Which() I_directory2UnlinkResultTag {
return _m.I_directory2UnlinkResultTag
}
func (_m *Directory2UnlinkResult) Ordinal() uint64 {
return uint64(_m.I_directory2UnlinkResultTag)
}
func (_m *Directory2UnlinkResult) SetResponse(response Directory2UnlinkResponse) {
_m.reset()
_m.I_directory2UnlinkResultTag = Directory2UnlinkResultResponse
_m.Response = response
}
func Directory2UnlinkResultWithResponse(response Directory2UnlinkResponse) Directory2UnlinkResult {
var _u Directory2UnlinkResult
_u.SetResponse(response)
return _u
}
func (_m *Directory2UnlinkResult) SetErr(err int32) {
_m.reset()
_m.I_directory2UnlinkResultTag = Directory2UnlinkResultErr
_m.Err = err
}
func Directory2UnlinkResultWithErr(err int32) Directory2UnlinkResult {
var _u Directory2UnlinkResult
_u.SetErr(err)
return _u
}
type I_directoryIteratorGetNextResultTag uint64
const (
DirectoryIteratorGetNextResultResponse = 1 // 0x00000001
DirectoryIteratorGetNextResultErr = 2 // 0x00000002
)
type DirectoryIteratorGetNextResult struct {
I_directoryIteratorGetNextResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response DirectoryIteratorGetNextResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mDirectoryIteratorGetNextResult = _bindings.CreateLazyMarshaler(DirectoryIteratorGetNextResult{})
func (msg *DirectoryIteratorGetNextResult) Marshaler() _bindings.Marshaler {
return _mDirectoryIteratorGetNextResult
}
func (_m *DirectoryIteratorGetNextResult) reset() {
switch _m.I_directoryIteratorGetNextResultTag {
case 1:
var _zeroed DirectoryIteratorGetNextResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *DirectoryIteratorGetNextResult) Which() I_directoryIteratorGetNextResultTag {
return _m.I_directoryIteratorGetNextResultTag
}
func (_m *DirectoryIteratorGetNextResult) Ordinal() uint64 {
return uint64(_m.I_directoryIteratorGetNextResultTag)
}
func (_m *DirectoryIteratorGetNextResult) SetResponse(response DirectoryIteratorGetNextResponse) {
_m.reset()
_m.I_directoryIteratorGetNextResultTag = DirectoryIteratorGetNextResultResponse
_m.Response = response
}
func DirectoryIteratorGetNextResultWithResponse(response DirectoryIteratorGetNextResponse) DirectoryIteratorGetNextResult {
var _u DirectoryIteratorGetNextResult
_u.SetResponse(response)
return _u
}
func (_m *DirectoryIteratorGetNextResult) SetErr(err int32) {
_m.reset()
_m.I_directoryIteratorGetNextResultTag = DirectoryIteratorGetNextResultErr
_m.Err = err
}
func DirectoryIteratorGetNextResultWithErr(err int32) DirectoryIteratorGetNextResult {
var _u DirectoryIteratorGetNextResult
_u.SetErr(err)
return _u
}
type I_extendedAttributeIteratorGetNextResultTag uint64
const (
ExtendedAttributeIteratorGetNextResultResponse = 1 // 0x00000001
ExtendedAttributeIteratorGetNextResultErr = 2 // 0x00000002
)
type ExtendedAttributeIteratorGetNextResult struct {
I_extendedAttributeIteratorGetNextResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response ExtendedAttributeIteratorGetNextResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mExtendedAttributeIteratorGetNextResult = _bindings.CreateLazyMarshaler(ExtendedAttributeIteratorGetNextResult{})
func (msg *ExtendedAttributeIteratorGetNextResult) Marshaler() _bindings.Marshaler {
return _mExtendedAttributeIteratorGetNextResult
}
func (_m *ExtendedAttributeIteratorGetNextResult) reset() {
switch _m.I_extendedAttributeIteratorGetNextResultTag {
case 1:
var _zeroed ExtendedAttributeIteratorGetNextResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *ExtendedAttributeIteratorGetNextResult) Which() I_extendedAttributeIteratorGetNextResultTag {
return _m.I_extendedAttributeIteratorGetNextResultTag
}
func (_m *ExtendedAttributeIteratorGetNextResult) Ordinal() uint64 {
return uint64(_m.I_extendedAttributeIteratorGetNextResultTag)
}
func (_m *ExtendedAttributeIteratorGetNextResult) SetResponse(response ExtendedAttributeIteratorGetNextResponse) {
_m.reset()
_m.I_extendedAttributeIteratorGetNextResultTag = ExtendedAttributeIteratorGetNextResultResponse
_m.Response = response
}
func ExtendedAttributeIteratorGetNextResultWithResponse(response ExtendedAttributeIteratorGetNextResponse) ExtendedAttributeIteratorGetNextResult {
var _u ExtendedAttributeIteratorGetNextResult
_u.SetResponse(response)
return _u
}
func (_m *ExtendedAttributeIteratorGetNextResult) SetErr(err int32) {
_m.reset()
_m.I_extendedAttributeIteratorGetNextResultTag = ExtendedAttributeIteratorGetNextResultErr
_m.Err = err
}
func ExtendedAttributeIteratorGetNextResultWithErr(err int32) ExtendedAttributeIteratorGetNextResult {
var _u ExtendedAttributeIteratorGetNextResult
_u.SetErr(err)
return _u
}
type I_extendedAttributeValueTag uint64
const (
ExtendedAttributeValueBytes = 1 // 0x00000001
ExtendedAttributeValueBuffer = 2 // 0x00000002
)
// The value type for an extended attribute. If the value is less than 32768
// bytes, then it is included inline. Values larger than this size are written
// into a vmo buffer.
type ExtendedAttributeValue struct {
I_extendedAttributeValueTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"`
Bytes []uint8 `fidl_bounds:"32768" fidl_ordinal:"1"`
Buffer _zx.VMO `fidl_handle_subtype:"3" fidl_handle_rights:"2147483648" fidl_bounds:"0" fidl_ordinal:"2"`
}
var _mExtendedAttributeValue = _bindings.CreateLazyMarshaler(ExtendedAttributeValue{})
func (msg *ExtendedAttributeValue) Marshaler() _bindings.Marshaler {
return _mExtendedAttributeValue
}
func (_m *ExtendedAttributeValue) reset() {
switch _m.I_extendedAttributeValueTag {
case 1:
var _zeroed []uint8
_m.Bytes = _zeroed
case 2:
var _zeroed _zx.VMO
_m.Buffer = _zeroed
}
}
func (_m *ExtendedAttributeValue) Which() I_extendedAttributeValueTag {
return _m.I_extendedAttributeValueTag
}
func (_m *ExtendedAttributeValue) Ordinal() uint64 {
return uint64(_m.I_extendedAttributeValueTag)
}
func (_m *ExtendedAttributeValue) SetBytes(bytes []uint8) {
_m.reset()
_m.I_extendedAttributeValueTag = ExtendedAttributeValueBytes
_m.Bytes = bytes
}
func ExtendedAttributeValueWithBytes(bytes []uint8) ExtendedAttributeValue {
var _u ExtendedAttributeValue
_u.SetBytes(bytes)
return _u
}
func (_m *ExtendedAttributeValue) SetBuffer(buffer _zx.VMO) {
_m.reset()
_m.I_extendedAttributeValueTag = ExtendedAttributeValueBuffer
_m.Buffer = buffer
}
func ExtendedAttributeValueWithBuffer(buffer _zx.VMO) ExtendedAttributeValue {
var _u ExtendedAttributeValue
_u.SetBuffer(buffer)
return _u
}
type I_fileAllocateResultTag uint64
const (
FileAllocateResultResponse = 1 // 0x00000001
FileAllocateResultErr = 2 // 0x00000002
)
type FileAllocateResult struct {
I_fileAllocateResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response FileAllocateResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mFileAllocateResult = _bindings.CreateLazyMarshaler(FileAllocateResult{})
func (msg *FileAllocateResult) Marshaler() _bindings.Marshaler {
return _mFileAllocateResult
}
func (_m *FileAllocateResult) reset() {
switch _m.I_fileAllocateResultTag {
case 1:
var _zeroed FileAllocateResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *FileAllocateResult) Which() I_fileAllocateResultTag {
return _m.I_fileAllocateResultTag
}
func (_m *FileAllocateResult) Ordinal() uint64 {
return uint64(_m.I_fileAllocateResultTag)
}
func (_m *FileAllocateResult) SetResponse(response FileAllocateResponse) {
_m.reset()
_m.I_fileAllocateResultTag = FileAllocateResultResponse
_m.Response = response
}
func FileAllocateResultWithResponse(response FileAllocateResponse) FileAllocateResult {
var _u FileAllocateResult
_u.SetResponse(response)
return _u
}
func (_m *FileAllocateResult) SetErr(err int32) {
_m.reset()
_m.I_fileAllocateResultTag = FileAllocateResultErr
_m.Err = err
}
func FileAllocateResultWithErr(err int32) FileAllocateResult {
var _u FileAllocateResult
_u.SetErr(err)
return _u
}
type I_fileEnableVerityResultTag uint64
const (
FileEnableVerityResultResponse = 1 // 0x00000001
FileEnableVerityResultErr = 2 // 0x00000002
)
type FileEnableVerityResult struct {
I_fileEnableVerityResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response FileEnableVerityResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mFileEnableVerityResult = _bindings.CreateLazyMarshaler(FileEnableVerityResult{})
func (msg *FileEnableVerityResult) Marshaler() _bindings.Marshaler {
return _mFileEnableVerityResult
}
func (_m *FileEnableVerityResult) reset() {
switch _m.I_fileEnableVerityResultTag {
case 1:
var _zeroed FileEnableVerityResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *FileEnableVerityResult) Which() I_fileEnableVerityResultTag {
return _m.I_fileEnableVerityResultTag
}
func (_m *FileEnableVerityResult) Ordinal() uint64 {
return uint64(_m.I_fileEnableVerityResultTag)
}
func (_m *FileEnableVerityResult) SetResponse(response FileEnableVerityResponse) {
_m.reset()
_m.I_fileEnableVerityResultTag = FileEnableVerityResultResponse
_m.Response = response
}
func FileEnableVerityResultWithResponse(response FileEnableVerityResponse) FileEnableVerityResult {
var _u FileEnableVerityResult
_u.SetResponse(response)
return _u
}
func (_m *FileEnableVerityResult) SetErr(err int32) {
_m.reset()
_m.I_fileEnableVerityResultTag = FileEnableVerityResultErr
_m.Err = err
}
func FileEnableVerityResultWithErr(err int32) FileEnableVerityResult {
var _u FileEnableVerityResult
_u.SetErr(err)
return _u
}
type I_fileGetBackingMemoryResultTag uint64
const (
FileGetBackingMemoryResultResponse = 1 // 0x00000001
FileGetBackingMemoryResultErr = 2 // 0x00000002
)
type FileGetBackingMemoryResult struct {
I_fileGetBackingMemoryResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"`
Response FileGetBackingMemoryResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mFileGetBackingMemoryResult = _bindings.CreateLazyMarshaler(FileGetBackingMemoryResult{})
func (msg *FileGetBackingMemoryResult) Marshaler() _bindings.Marshaler {
return _mFileGetBackingMemoryResult
}
func (_m *FileGetBackingMemoryResult) reset() {
switch _m.I_fileGetBackingMemoryResultTag {
case 1:
var _zeroed FileGetBackingMemoryResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *FileGetBackingMemoryResult) Which() I_fileGetBackingMemoryResultTag {
return _m.I_fileGetBackingMemoryResultTag
}
func (_m *FileGetBackingMemoryResult) Ordinal() uint64 {
return uint64(_m.I_fileGetBackingMemoryResultTag)
}
func (_m *FileGetBackingMemoryResult) SetResponse(response FileGetBackingMemoryResponse) {
_m.reset()
_m.I_fileGetBackingMemoryResultTag = FileGetBackingMemoryResultResponse
_m.Response = response
}
func FileGetBackingMemoryResultWithResponse(response FileGetBackingMemoryResponse) FileGetBackingMemoryResult {
var _u FileGetBackingMemoryResult
_u.SetResponse(response)
return _u
}
func (_m *FileGetBackingMemoryResult) SetErr(err int32) {
_m.reset()
_m.I_fileGetBackingMemoryResultTag = FileGetBackingMemoryResultErr
_m.Err = err
}
func FileGetBackingMemoryResultWithErr(err int32) FileGetBackingMemoryResult {
var _u FileGetBackingMemoryResult
_u.SetErr(err)
return _u
}
type I_fileReadAtResultTag uint64
const (
FileReadAtResultResponse = 1 // 0x00000001
FileReadAtResultErr = 2 // 0x00000002
)
type FileReadAtResult struct {
I_fileReadAtResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response FileReadAtResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mFileReadAtResult = _bindings.CreateLazyMarshaler(FileReadAtResult{})
func (msg *FileReadAtResult) Marshaler() _bindings.Marshaler {
return _mFileReadAtResult
}
func (_m *FileReadAtResult) reset() {
switch _m.I_fileReadAtResultTag {
case 1:
var _zeroed FileReadAtResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *FileReadAtResult) Which() I_fileReadAtResultTag {
return _m.I_fileReadAtResultTag
}
func (_m *FileReadAtResult) Ordinal() uint64 {
return uint64(_m.I_fileReadAtResultTag)
}
func (_m *FileReadAtResult) SetResponse(response FileReadAtResponse) {
_m.reset()
_m.I_fileReadAtResultTag = FileReadAtResultResponse
_m.Response = response
}
func FileReadAtResultWithResponse(response FileReadAtResponse) FileReadAtResult {
var _u FileReadAtResult
_u.SetResponse(response)
return _u
}
func (_m *FileReadAtResult) SetErr(err int32) {
_m.reset()
_m.I_fileReadAtResultTag = FileReadAtResultErr
_m.Err = err
}
func FileReadAtResultWithErr(err int32) FileReadAtResult {
var _u FileReadAtResult
_u.SetErr(err)
return _u
}
type I_fileResizeResultTag uint64
const (
FileResizeResultResponse = 1 // 0x00000001
FileResizeResultErr = 2 // 0x00000002
)
type FileResizeResult struct {
I_fileResizeResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response FileResizeResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mFileResizeResult = _bindings.CreateLazyMarshaler(FileResizeResult{})
func (msg *FileResizeResult) Marshaler() _bindings.Marshaler {
return _mFileResizeResult
}
func (_m *FileResizeResult) reset() {
switch _m.I_fileResizeResultTag {
case 1:
var _zeroed FileResizeResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *FileResizeResult) Which() I_fileResizeResultTag {
return _m.I_fileResizeResultTag
}
func (_m *FileResizeResult) Ordinal() uint64 {
return uint64(_m.I_fileResizeResultTag)
}
func (_m *FileResizeResult) SetResponse(response FileResizeResponse) {
_m.reset()
_m.I_fileResizeResultTag = FileResizeResultResponse
_m.Response = response
}
func FileResizeResultWithResponse(response FileResizeResponse) FileResizeResult {
var _u FileResizeResult
_u.SetResponse(response)
return _u
}
func (_m *FileResizeResult) SetErr(err int32) {
_m.reset()
_m.I_fileResizeResultTag = FileResizeResultErr
_m.Err = err
}
func FileResizeResultWithErr(err int32) FileResizeResult {
var _u FileResizeResult
_u.SetErr(err)
return _u
}
type I_fileSeekResultTag uint64
const (
FileSeekResultResponse = 1 // 0x00000001
FileSeekResultErr = 2 // 0x00000002
)
type FileSeekResult struct {
I_fileSeekResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response FileSeekResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mFileSeekResult = _bindings.CreateLazyMarshaler(FileSeekResult{})
func (msg *FileSeekResult) Marshaler() _bindings.Marshaler {
return _mFileSeekResult
}
func (_m *FileSeekResult) reset() {
switch _m.I_fileSeekResultTag {
case 1:
var _zeroed FileSeekResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *FileSeekResult) Which() I_fileSeekResultTag {
return _m.I_fileSeekResultTag
}
func (_m *FileSeekResult) Ordinal() uint64 {
return uint64(_m.I_fileSeekResultTag)
}
func (_m *FileSeekResult) SetResponse(response FileSeekResponse) {
_m.reset()
_m.I_fileSeekResultTag = FileSeekResultResponse
_m.Response = response
}
func FileSeekResultWithResponse(response FileSeekResponse) FileSeekResult {
var _u FileSeekResult
_u.SetResponse(response)
return _u
}
func (_m *FileSeekResult) SetErr(err int32) {
_m.reset()
_m.I_fileSeekResultTag = FileSeekResultErr
_m.Err = err
}
func FileSeekResultWithErr(err int32) FileSeekResult {
var _u FileSeekResult
_u.SetErr(err)
return _u
}
type I_fileWriteAtResultTag uint64
const (
FileWriteAtResultResponse = 1 // 0x00000001
FileWriteAtResultErr = 2 // 0x00000002
)
type FileWriteAtResult struct {
I_fileWriteAtResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response FileWriteAtResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mFileWriteAtResult = _bindings.CreateLazyMarshaler(FileWriteAtResult{})
func (msg *FileWriteAtResult) Marshaler() _bindings.Marshaler {
return _mFileWriteAtResult
}
func (_m *FileWriteAtResult) reset() {
switch _m.I_fileWriteAtResultTag {
case 1:
var _zeroed FileWriteAtResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *FileWriteAtResult) Which() I_fileWriteAtResultTag {
return _m.I_fileWriteAtResultTag
}
func (_m *FileWriteAtResult) Ordinal() uint64 {
return uint64(_m.I_fileWriteAtResultTag)
}
func (_m *FileWriteAtResult) SetResponse(response FileWriteAtResponse) {
_m.reset()
_m.I_fileWriteAtResultTag = FileWriteAtResultResponse
_m.Response = response
}
func FileWriteAtResultWithResponse(response FileWriteAtResponse) FileWriteAtResult {
var _u FileWriteAtResult
_u.SetResponse(response)
return _u
}
func (_m *FileWriteAtResult) SetErr(err int32) {
_m.reset()
_m.I_fileWriteAtResultTag = FileWriteAtResultErr
_m.Err = err
}
func FileWriteAtResultWithErr(err int32) FileWriteAtResult {
var _u FileWriteAtResult
_u.SetErr(err)
return _u
}
type I_linkableLinkIntoResultTag uint64
const (
LinkableLinkIntoResultResponse = 1 // 0x00000001
LinkableLinkIntoResultErr = 2 // 0x00000002
)
type LinkableLinkIntoResult struct {
I_linkableLinkIntoResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response LinkableLinkIntoResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mLinkableLinkIntoResult = _bindings.CreateLazyMarshaler(LinkableLinkIntoResult{})
func (msg *LinkableLinkIntoResult) Marshaler() _bindings.Marshaler {
return _mLinkableLinkIntoResult
}
func (_m *LinkableLinkIntoResult) reset() {
switch _m.I_linkableLinkIntoResultTag {
case 1:
var _zeroed LinkableLinkIntoResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *LinkableLinkIntoResult) Which() I_linkableLinkIntoResultTag {
return _m.I_linkableLinkIntoResultTag
}
func (_m *LinkableLinkIntoResult) Ordinal() uint64 {
return uint64(_m.I_linkableLinkIntoResultTag)
}
func (_m *LinkableLinkIntoResult) SetResponse(response LinkableLinkIntoResponse) {
_m.reset()
_m.I_linkableLinkIntoResultTag = LinkableLinkIntoResultResponse
_m.Response = response
}
func LinkableLinkIntoResultWithResponse(response LinkableLinkIntoResponse) LinkableLinkIntoResult {
var _u LinkableLinkIntoResult
_u.SetResponse(response)
return _u
}
func (_m *LinkableLinkIntoResult) SetErr(err int32) {
_m.reset()
_m.I_linkableLinkIntoResultTag = LinkableLinkIntoResultErr
_m.Err = err
}
func LinkableLinkIntoResultWithErr(err int32) LinkableLinkIntoResult {
var _u LinkableLinkIntoResult
_u.SetErr(err)
return _u
}
type I_node2GetAttributesResultTag uint64
const (
Node2GetAttributesResultResponse = 1 // 0x00000001
Node2GetAttributesResultErr = 2 // 0x00000002
)
type Node2GetAttributesResult struct {
I_node2GetAttributesResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response NodeAttributes2 `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mNode2GetAttributesResult = _bindings.CreateLazyMarshaler(Node2GetAttributesResult{})
func (msg *Node2GetAttributesResult) Marshaler() _bindings.Marshaler {
return _mNode2GetAttributesResult
}
func (_m *Node2GetAttributesResult) reset() {
switch _m.I_node2GetAttributesResultTag {
case 1:
var _zeroed NodeAttributes2
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *Node2GetAttributesResult) Which() I_node2GetAttributesResultTag {
return _m.I_node2GetAttributesResultTag
}
func (_m *Node2GetAttributesResult) Ordinal() uint64 {
return uint64(_m.I_node2GetAttributesResultTag)
}
func (_m *Node2GetAttributesResult) SetResponse(response NodeAttributes2) {
_m.reset()
_m.I_node2GetAttributesResultTag = Node2GetAttributesResultResponse
_m.Response = response
}
func Node2GetAttributesResultWithResponse(response NodeAttributes2) Node2GetAttributesResult {
var _u Node2GetAttributesResult
_u.SetResponse(response)
return _u
}
func (_m *Node2GetAttributesResult) SetErr(err int32) {
_m.reset()
_m.I_node2GetAttributesResultTag = Node2GetAttributesResultErr
_m.Err = err
}
func Node2GetAttributesResultWithErr(err int32) Node2GetAttributesResult {
var _u Node2GetAttributesResult
_u.SetErr(err)
return _u
}
type I_node2GetExtendedAttributeResultTag uint64
const (
Node2GetExtendedAttributeResultResponse = 1 // 0x00000001
Node2GetExtendedAttributeResultErr = 2 // 0x00000002
)
type Node2GetExtendedAttributeResult struct {
I_node2GetExtendedAttributeResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"`
Response ExtendedAttributeValue `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mNode2GetExtendedAttributeResult = _bindings.CreateLazyMarshaler(Node2GetExtendedAttributeResult{})
func (msg *Node2GetExtendedAttributeResult) Marshaler() _bindings.Marshaler {
return _mNode2GetExtendedAttributeResult
}
func (_m *Node2GetExtendedAttributeResult) reset() {
switch _m.I_node2GetExtendedAttributeResultTag {
case 1:
var _zeroed ExtendedAttributeValue
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *Node2GetExtendedAttributeResult) Which() I_node2GetExtendedAttributeResultTag {
return _m.I_node2GetExtendedAttributeResultTag
}
func (_m *Node2GetExtendedAttributeResult) Ordinal() uint64 {
return uint64(_m.I_node2GetExtendedAttributeResultTag)
}
func (_m *Node2GetExtendedAttributeResult) SetResponse(response ExtendedAttributeValue) {
_m.reset()
_m.I_node2GetExtendedAttributeResultTag = Node2GetExtendedAttributeResultResponse
_m.Response = response
}
func Node2GetExtendedAttributeResultWithResponse(response ExtendedAttributeValue) Node2GetExtendedAttributeResult {
var _u Node2GetExtendedAttributeResult
_u.SetResponse(response)
return _u
}
func (_m *Node2GetExtendedAttributeResult) SetErr(err int32) {
_m.reset()
_m.I_node2GetExtendedAttributeResultTag = Node2GetExtendedAttributeResultErr
_m.Err = err
}
func Node2GetExtendedAttributeResultWithErr(err int32) Node2GetExtendedAttributeResult {
var _u Node2GetExtendedAttributeResult
_u.SetErr(err)
return _u
}
type I_node2RemoveExtendedAttributeResultTag uint64
const (
Node2RemoveExtendedAttributeResultResponse = 1 // 0x00000001
Node2RemoveExtendedAttributeResultErr = 2 // 0x00000002
)
type Node2RemoveExtendedAttributeResult struct {
I_node2RemoveExtendedAttributeResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response Node2RemoveExtendedAttributeResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mNode2RemoveExtendedAttributeResult = _bindings.CreateLazyMarshaler(Node2RemoveExtendedAttributeResult{})
func (msg *Node2RemoveExtendedAttributeResult) Marshaler() _bindings.Marshaler {
return _mNode2RemoveExtendedAttributeResult
}
func (_m *Node2RemoveExtendedAttributeResult) reset() {
switch _m.I_node2RemoveExtendedAttributeResultTag {
case 1:
var _zeroed Node2RemoveExtendedAttributeResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *Node2RemoveExtendedAttributeResult) Which() I_node2RemoveExtendedAttributeResultTag {
return _m.I_node2RemoveExtendedAttributeResultTag
}
func (_m *Node2RemoveExtendedAttributeResult) Ordinal() uint64 {
return uint64(_m.I_node2RemoveExtendedAttributeResultTag)
}
func (_m *Node2RemoveExtendedAttributeResult) SetResponse(response Node2RemoveExtendedAttributeResponse) {
_m.reset()
_m.I_node2RemoveExtendedAttributeResultTag = Node2RemoveExtendedAttributeResultResponse
_m.Response = response
}
func Node2RemoveExtendedAttributeResultWithResponse(response Node2RemoveExtendedAttributeResponse) Node2RemoveExtendedAttributeResult {
var _u Node2RemoveExtendedAttributeResult
_u.SetResponse(response)
return _u
}
func (_m *Node2RemoveExtendedAttributeResult) SetErr(err int32) {
_m.reset()
_m.I_node2RemoveExtendedAttributeResultTag = Node2RemoveExtendedAttributeResultErr
_m.Err = err
}
func Node2RemoveExtendedAttributeResultWithErr(err int32) Node2RemoveExtendedAttributeResult {
var _u Node2RemoveExtendedAttributeResult
_u.SetErr(err)
return _u
}
type I_node2SetExtendedAttributeResultTag uint64
const (
Node2SetExtendedAttributeResultResponse = 1 // 0x00000001
Node2SetExtendedAttributeResultErr = 2 // 0x00000002
)
type Node2SetExtendedAttributeResult struct {
I_node2SetExtendedAttributeResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response Node2SetExtendedAttributeResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mNode2SetExtendedAttributeResult = _bindings.CreateLazyMarshaler(Node2SetExtendedAttributeResult{})
func (msg *Node2SetExtendedAttributeResult) Marshaler() _bindings.Marshaler {
return _mNode2SetExtendedAttributeResult
}
func (_m *Node2SetExtendedAttributeResult) reset() {
switch _m.I_node2SetExtendedAttributeResultTag {
case 1:
var _zeroed Node2SetExtendedAttributeResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *Node2SetExtendedAttributeResult) Which() I_node2SetExtendedAttributeResultTag {
return _m.I_node2SetExtendedAttributeResultTag
}
func (_m *Node2SetExtendedAttributeResult) Ordinal() uint64 {
return uint64(_m.I_node2SetExtendedAttributeResultTag)
}
func (_m *Node2SetExtendedAttributeResult) SetResponse(response Node2SetExtendedAttributeResponse) {
_m.reset()
_m.I_node2SetExtendedAttributeResultTag = Node2SetExtendedAttributeResultResponse
_m.Response = response
}
func Node2SetExtendedAttributeResultWithResponse(response Node2SetExtendedAttributeResponse) Node2SetExtendedAttributeResult {
var _u Node2SetExtendedAttributeResult
_u.SetResponse(response)
return _u
}
func (_m *Node2SetExtendedAttributeResult) SetErr(err int32) {
_m.reset()
_m.I_node2SetExtendedAttributeResultTag = Node2SetExtendedAttributeResultErr
_m.Err = err
}
func Node2SetExtendedAttributeResultWithErr(err int32) Node2SetExtendedAttributeResult {
var _u Node2SetExtendedAttributeResult
_u.SetErr(err)
return _u
}
type I_node2SyncResultTag uint64
const (
Node2SyncResultResponse = 1 // 0x00000001
Node2SyncResultErr = 2 // 0x00000002
)
type Node2SyncResult struct {
I_node2SyncResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response Node2SyncResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mNode2SyncResult = _bindings.CreateLazyMarshaler(Node2SyncResult{})
func (msg *Node2SyncResult) Marshaler() _bindings.Marshaler {
return _mNode2SyncResult
}
func (_m *Node2SyncResult) reset() {
switch _m.I_node2SyncResultTag {
case 1:
var _zeroed Node2SyncResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *Node2SyncResult) Which() I_node2SyncResultTag {
return _m.I_node2SyncResultTag
}
func (_m *Node2SyncResult) Ordinal() uint64 {
return uint64(_m.I_node2SyncResultTag)
}
func (_m *Node2SyncResult) SetResponse(response Node2SyncResponse) {
_m.reset()
_m.I_node2SyncResultTag = Node2SyncResultResponse
_m.Response = response
}
func Node2SyncResultWithResponse(response Node2SyncResponse) Node2SyncResult {
var _u Node2SyncResult
_u.SetResponse(response)
return _u
}
func (_m *Node2SyncResult) SetErr(err int32) {
_m.reset()
_m.I_node2SyncResultTag = Node2SyncResultErr
_m.Err = err
}
func Node2SyncResultWithErr(err int32) Node2SyncResult {
var _u Node2SyncResult
_u.SetErr(err)
return _u
}
type I_node2UpdateAttributesResultTag uint64
const (
Node2UpdateAttributesResultResponse = 1 // 0x00000001
Node2UpdateAttributesResultErr = 2 // 0x00000002
)
type Node2UpdateAttributesResult struct {
I_node2UpdateAttributesResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response Node2UpdateAttributesResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mNode2UpdateAttributesResult = _bindings.CreateLazyMarshaler(Node2UpdateAttributesResult{})
func (msg *Node2UpdateAttributesResult) Marshaler() _bindings.Marshaler {
return _mNode2UpdateAttributesResult
}
func (_m *Node2UpdateAttributesResult) reset() {
switch _m.I_node2UpdateAttributesResultTag {
case 1:
var _zeroed Node2UpdateAttributesResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *Node2UpdateAttributesResult) Which() I_node2UpdateAttributesResultTag {
return _m.I_node2UpdateAttributesResultTag
}
func (_m *Node2UpdateAttributesResult) Ordinal() uint64 {
return uint64(_m.I_node2UpdateAttributesResultTag)
}
func (_m *Node2UpdateAttributesResult) SetResponse(response Node2UpdateAttributesResponse) {
_m.reset()
_m.I_node2UpdateAttributesResultTag = Node2UpdateAttributesResultResponse
_m.Response = response
}
func Node2UpdateAttributesResultWithResponse(response Node2UpdateAttributesResponse) Node2UpdateAttributesResult {
var _u Node2UpdateAttributesResult
_u.SetResponse(response)
return _u
}
func (_m *Node2UpdateAttributesResult) SetErr(err int32) {
_m.reset()
_m.I_node2UpdateAttributesResultTag = Node2UpdateAttributesResultErr
_m.Err = err
}
func Node2UpdateAttributesResultWithErr(err int32) Node2UpdateAttributesResult {
var _u Node2UpdateAttributesResult
_u.SetErr(err)
return _u
}
type I_nodeInfoDeprecatedTag uint64
const (
NodeInfoDeprecatedService = 1 // 0x00000001
NodeInfoDeprecatedFile = 2 // 0x00000002
NodeInfoDeprecatedDirectory = 3 // 0x00000003
NodeInfoDeprecatedSymlink = 4 // 0x00000004
)
type NodeInfoDeprecated struct {
I_nodeInfoDeprecatedTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"`
// No protocol information was supplied by the connection.
Service Service `fidl_ordinal:"1"`
// The connection composes [`File`].
File FileObject `fidl_ordinal:"2"`
// The connection composes [`Directory`].
Directory DirectoryObject `fidl_ordinal:"3"`
// The connection composes ['Symlink'].
Symlink SymlinkObject `fidl_ordinal:"4"`
}
var _mNodeInfoDeprecated = _bindings.CreateLazyMarshaler(NodeInfoDeprecated{})
func (msg *NodeInfoDeprecated) Marshaler() _bindings.Marshaler {
return _mNodeInfoDeprecated
}
func (_m *NodeInfoDeprecated) reset() {
switch _m.I_nodeInfoDeprecatedTag {
case 1:
var _zeroed Service
_m.Service = _zeroed
case 2:
var _zeroed FileObject
_m.File = _zeroed
case 3:
var _zeroed DirectoryObject
_m.Directory = _zeroed
case 4:
var _zeroed SymlinkObject
_m.Symlink = _zeroed
}
}
func (_m *NodeInfoDeprecated) Which() I_nodeInfoDeprecatedTag {
return _m.I_nodeInfoDeprecatedTag
}
func (_m *NodeInfoDeprecated) Ordinal() uint64 {
return uint64(_m.I_nodeInfoDeprecatedTag)
}
func (_m *NodeInfoDeprecated) SetService(service Service) {
_m.reset()
_m.I_nodeInfoDeprecatedTag = NodeInfoDeprecatedService
_m.Service = service
}
func NodeInfoDeprecatedWithService(service Service) NodeInfoDeprecated {
var _u NodeInfoDeprecated
_u.SetService(service)
return _u
}
func (_m *NodeInfoDeprecated) SetFile(file FileObject) {
_m.reset()
_m.I_nodeInfoDeprecatedTag = NodeInfoDeprecatedFile
_m.File = file
}
func NodeInfoDeprecatedWithFile(file FileObject) NodeInfoDeprecated {
var _u NodeInfoDeprecated
_u.SetFile(file)
return _u
}
func (_m *NodeInfoDeprecated) SetDirectory(directory DirectoryObject) {
_m.reset()
_m.I_nodeInfoDeprecatedTag = NodeInfoDeprecatedDirectory
_m.Directory = directory
}
func NodeInfoDeprecatedWithDirectory(directory DirectoryObject) NodeInfoDeprecated {
var _u NodeInfoDeprecated
_u.SetDirectory(directory)
return _u
}
func (_m *NodeInfoDeprecated) SetSymlink(symlink SymlinkObject) {
_m.reset()
_m.I_nodeInfoDeprecatedTag = NodeInfoDeprecatedSymlink
_m.Symlink = symlink
}
func NodeInfoDeprecatedWithSymlink(symlink SymlinkObject) NodeInfoDeprecated {
var _u NodeInfoDeprecated
_u.SetSymlink(symlink)
return _u
}
type I_readableReadResultTag uint64
const (
ReadableReadResultResponse = 1 // 0x00000001
ReadableReadResultErr = 2 // 0x00000002
)
type ReadableReadResult struct {
I_readableReadResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response ReadableReadResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mReadableReadResult = _bindings.CreateLazyMarshaler(ReadableReadResult{})
func (msg *ReadableReadResult) Marshaler() _bindings.Marshaler {
return _mReadableReadResult
}
func (_m *ReadableReadResult) reset() {
switch _m.I_readableReadResultTag {
case 1:
var _zeroed ReadableReadResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *ReadableReadResult) Which() I_readableReadResultTag {
return _m.I_readableReadResultTag
}
func (_m *ReadableReadResult) Ordinal() uint64 {
return uint64(_m.I_readableReadResultTag)
}
func (_m *ReadableReadResult) SetResponse(response ReadableReadResponse) {
_m.reset()
_m.I_readableReadResultTag = ReadableReadResultResponse
_m.Response = response
}
func ReadableReadResultWithResponse(response ReadableReadResponse) ReadableReadResult {
var _u ReadableReadResult
_u.SetResponse(response)
return _u
}
func (_m *ReadableReadResult) SetErr(err int32) {
_m.reset()
_m.I_readableReadResultTag = ReadableReadResultErr
_m.Err = err
}
func ReadableReadResultWithErr(err int32) ReadableReadResult {
var _u ReadableReadResult
_u.SetErr(err)
return _u
}
type I_representationTag uint64
const (
Representation_unknownData = 0 // 0x00000000
RepresentationConnector = 1 // 0x00000001
RepresentationDirectory = 2 // 0x00000002
RepresentationFile = 3 // 0x00000003
RepresentationSymlink = 4 // 0x00000004
)
type Representation struct {
I_representationTag `fidl:"x" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"`
I_unknownData interface{}
// Auxiliary data for the connector representation of a node, used
// for protocol discovery and connection.
//
// It supports connecting to arbitrary protocols exported by the
// filesystem server at a path, including ones that do not compose
// [`Node2`].
//
// See [`NodeProtocolKinds.CONNECTOR`].
Connector ConnectorInfo `fidl_ordinal:"1"`
// Auxiliary data for the directory representation of a node. The
// selection of this variant in [`Representation`] implies that the
// connection speaks the [`Directory`] protocol.
//
// See [`NodeProtocolKinds.DIRECTORY`].
Directory DirectoryInfo `fidl_ordinal:"2"`
// Auxiliary data for the file representation of a node. The
// selection of this variant in [`Representation`] implies that the
// connection speaks the [`File`] protocol.
//
// See [`NodeProtocolKinds.FILE`].
File FileInfo `fidl_ordinal:"3"`
// Auxilliary data for the symlink representation of a node. The
// selection of this variant in [`Representation`] implies that the
// connection speaks the [`Symlink`] protocol.
//
// See [`NodeProtocolKinds.SYMLINK`].
Symlink SymlinkInfo `fidl_ordinal:"4"`
}
var _mRepresentation = _bindings.CreateLazyMarshaler(Representation{})
func (msg *Representation) Marshaler() _bindings.Marshaler {
return _mRepresentation
}
func (_m *Representation) reset() {
switch _m.I_representationTag {
case 1:
var _zeroed ConnectorInfo
_m.Connector = _zeroed
case 2:
var _zeroed DirectoryInfo
_m.Directory = _zeroed
case 3:
var _zeroed FileInfo
_m.File = _zeroed
case 4:
var _zeroed SymlinkInfo
_m.Symlink = _zeroed
default:
var _zeroed interface{}
_m.I_unknownData = _zeroed
}
}
func (_m *Representation) Which() I_representationTag {
switch _m.I_representationTag {
case 1:
return RepresentationConnector
case 2:
return RepresentationDirectory
case 3:
return RepresentationFile
case 4:
return RepresentationSymlink
default:
return Representation_unknownData
}
}
func (_m *Representation) Ordinal() uint64 {
return uint64(_m.I_representationTag)
}
func (_m *Representation) SetConnector(connector ConnectorInfo) {
_m.reset()
_m.I_representationTag = RepresentationConnector
_m.Connector = connector
}
func RepresentationWithConnector(connector ConnectorInfo) Representation {
var _u Representation
_u.SetConnector(connector)
return _u
}
func (_m *Representation) SetDirectory(directory DirectoryInfo) {
_m.reset()
_m.I_representationTag = RepresentationDirectory
_m.Directory = directory
}
func RepresentationWithDirectory(directory DirectoryInfo) Representation {
var _u Representation
_u.SetDirectory(directory)
return _u
}
func (_m *Representation) SetFile(file FileInfo) {
_m.reset()
_m.I_representationTag = RepresentationFile
_m.File = file
}
func RepresentationWithFile(file FileInfo) Representation {
var _u Representation
_u.SetFile(file)
return _u
}
func (_m *Representation) SetSymlink(symlink SymlinkInfo) {
_m.reset()
_m.I_representationTag = RepresentationSymlink
_m.Symlink = symlink
}
func RepresentationWithSymlink(symlink SymlinkInfo) Representation {
var _u Representation
_u.SetSymlink(symlink)
return _u
}
func (_m *Representation) GetUnknownData() _bindings.UnknownData {
return _m.I_unknownData.(_bindings.UnknownData)
}
type I_writableWriteResultTag uint64
const (
WritableWriteResultResponse = 1 // 0x00000001
WritableWriteResultErr = 2 // 0x00000002
)
type WritableWriteResult struct {
I_writableWriteResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
Response WritableWriteResponse `fidl_ordinal:"1"`
Err int32 `fidl_ordinal:"2"`
}
var _mWritableWriteResult = _bindings.CreateLazyMarshaler(WritableWriteResult{})
func (msg *WritableWriteResult) Marshaler() _bindings.Marshaler {
return _mWritableWriteResult
}
func (_m *WritableWriteResult) reset() {
switch _m.I_writableWriteResultTag {
case 1:
var _zeroed WritableWriteResponse
_m.Response = _zeroed
case 2:
var _zeroed int32
_m.Err = _zeroed
}
}
func (_m *WritableWriteResult) Which() I_writableWriteResultTag {
return _m.I_writableWriteResultTag
}
func (_m *WritableWriteResult) Ordinal() uint64 {
return uint64(_m.I_writableWriteResultTag)
}
func (_m *WritableWriteResult) SetResponse(response WritableWriteResponse) {
_m.reset()
_m.I_writableWriteResultTag = WritableWriteResultResponse
_m.Response = response
}
func WritableWriteResultWithResponse(response WritableWriteResponse) WritableWriteResult {
var _u WritableWriteResult
_u.SetResponse(response)
return _u
}
func (_m *WritableWriteResult) SetErr(err int32) {
_m.reset()
_m.I_writableWriteResultTag = WritableWriteResultErr
_m.Err = err
}
func WritableWriteResultWithErr(err int32) WritableWriteResult {
var _u WritableWriteResult
_u.SetErr(err)
return _u
}
type AdvisoryLockRequest struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// The type of lock to be acquired.
//
// If this field is absent, the [`AdvisoryLock`] method will fail
// with ZX_ERR_INVALID_ARGS.
Type AdvisoryLockType `fidl_ordinal:"1"`
TypePresent bool
// The byte range within the file to be locked.
//
// The range can extend beyond the end of the file but cannot extend beyond
// the beginning of the file.
//
// If this field is absent, the range defaults to the entire file.
Range AdvisoryLockRange `fidl_ordinal:"2"`
RangePresent bool
// Whether the file should wait reply to the [`AdvisoryLock`]
// method until the requested lock can be acquired.
//
// If this field is absent, the file will not wait.
Wait bool `fidl_ordinal:"3"`
WaitPresent bool
}
var _mAdvisoryLockRequest = _bindings.CreateLazyMarshaler(AdvisoryLockRequest{})
func (msg *AdvisoryLockRequest) Marshaler() _bindings.Marshaler {
return _mAdvisoryLockRequest
}
func (u *AdvisoryLockRequest) SetType(type_ AdvisoryLockType) {
u.Type = type_
u.TypePresent = true
}
func (u *AdvisoryLockRequest) GetType() AdvisoryLockType {
return u.Type
}
func (u *AdvisoryLockRequest) GetTypeWithDefault(_default AdvisoryLockType) AdvisoryLockType {
if !u.HasType() {
return _default
}
return u.Type
}
func (u *AdvisoryLockRequest) HasType() bool {
return u.TypePresent
}
func (u *AdvisoryLockRequest) ClearType() {
u.TypePresent = false
}
func (u *AdvisoryLockRequest) SetRange(range_ AdvisoryLockRange) {
u.Range = range_
u.RangePresent = true
}
func (u *AdvisoryLockRequest) GetRange() AdvisoryLockRange {
return u.Range
}
func (u *AdvisoryLockRequest) GetRangeWithDefault(_default AdvisoryLockRange) AdvisoryLockRange {
if !u.HasRange() {
return _default
}
return u.Range
}
func (u *AdvisoryLockRequest) HasRange() bool {
return u.RangePresent
}
func (u *AdvisoryLockRequest) ClearRange() {
u.RangePresent = false
}
func (u *AdvisoryLockRequest) SetWait(wait bool) {
u.Wait = wait
u.WaitPresent = true
}
func (u *AdvisoryLockRequest) GetWait() bool {
return u.Wait
}
func (u *AdvisoryLockRequest) GetWaitWithDefault(_default bool) bool {
if !u.HasWait() {
return _default
}
return u.Wait
}
func (u *AdvisoryLockRequest) HasWait() bool {
return u.WaitPresent
}
func (u *AdvisoryLockRequest) ClearWait() {
u.WaitPresent = false
}
func (u *AdvisoryLockRequest) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *AdvisoryLockRequest) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type ConnectionInfo struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"`
I_unknownData interface{}
// The rights possessed by the current connection. Note: `rights` limits
// the set of operations allowed on the connection, but does not guarantee
// their availability. For example, one may have the [`Rights.EXECUTE`]
// right on a file connection, but the file itself does not have the
// `EXECUTE` ability, and hence cannot be executed. See
// [`ConnectionOptions.rights`].
Rights Operations `fidl_ordinal:"1"`
RightsPresent bool
}
var _mConnectionInfo = _bindings.CreateLazyMarshaler(ConnectionInfo{})
func (msg *ConnectionInfo) Marshaler() _bindings.Marshaler {
return _mConnectionInfo
}
func (u *ConnectionInfo) SetRights(rights Operations) {
u.Rights = rights
u.RightsPresent = true
}
func (u *ConnectionInfo) GetRights() Operations {
return u.Rights
}
func (u *ConnectionInfo) GetRightsWithDefault(_default Operations) Operations {
if !u.HasRights() {
return _default
}
return u.Rights
}
func (u *ConnectionInfo) HasRights() bool {
return u.RightsPresent
}
func (u *ConnectionInfo) ClearRights() {
u.RightsPresent = false
}
func (u *ConnectionInfo) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *ConnectionInfo) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type ConnectorInfo struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Requested attributes for the object. This is only populated if requested.
Attributes NodeAttributes2 `fidl_ordinal:"1"`
AttributesPresent bool
}
var _mConnectorInfo = _bindings.CreateLazyMarshaler(ConnectorInfo{})
func (msg *ConnectorInfo) Marshaler() _bindings.Marshaler {
return _mConnectorInfo
}
func (u *ConnectorInfo) SetAttributes(attributes NodeAttributes2) {
u.Attributes = attributes
u.AttributesPresent = true
}
func (u *ConnectorInfo) GetAttributes() NodeAttributes2 {
return u.Attributes
}
func (u *ConnectorInfo) GetAttributesWithDefault(_default NodeAttributes2) NodeAttributes2 {
if !u.HasAttributes() {
return _default
}
return u.Attributes
}
func (u *ConnectorInfo) HasAttributes() bool {
return u.AttributesPresent
}
func (u *ConnectorInfo) ClearAttributes() {
u.AttributesPresent = false
}
func (u *ConnectorInfo) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *ConnectorInfo) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type DirectoryEntry struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Name of the node. This field must be present.
Name string `fidl_bounds:"255" fidl_ordinal:"1"`
NamePresent bool
// Describes the kinds of representations supported by the node.
Protocols NodeProtocolKinds `fidl_ordinal:"2"`
ProtocolsPresent bool
// Describes the kinds of operations supported by the node.
Abilities Operations `fidl_ordinal:"3"`
AbilitiesPresent bool
// An ID for the node. See [`Id`].
// This `id` should be unique among all entries of a directory.
Id uint64 `fidl_ordinal:"4"`
IdPresent bool
}
var _mDirectoryEntry = _bindings.CreateLazyMarshaler(DirectoryEntry{})
func (msg *DirectoryEntry) Marshaler() _bindings.Marshaler {
return _mDirectoryEntry
}
func (u *DirectoryEntry) SetName(name string) {
u.Name = name
u.NamePresent = true
}
func (u *DirectoryEntry) GetName() string {
return u.Name
}
func (u *DirectoryEntry) GetNameWithDefault(_default string) string {
if !u.HasName() {
return _default
}
return u.Name
}
func (u *DirectoryEntry) HasName() bool {
return u.NamePresent
}
func (u *DirectoryEntry) ClearName() {
u.NamePresent = false
}
func (u *DirectoryEntry) SetProtocols(protocols NodeProtocolKinds) {
u.Protocols = protocols
u.ProtocolsPresent = true
}
func (u *DirectoryEntry) GetProtocols() NodeProtocolKinds {
return u.Protocols
}
func (u *DirectoryEntry) GetProtocolsWithDefault(_default NodeProtocolKinds) NodeProtocolKinds {
if !u.HasProtocols() {
return _default
}
return u.Protocols
}
func (u *DirectoryEntry) HasProtocols() bool {
return u.ProtocolsPresent
}
func (u *DirectoryEntry) ClearProtocols() {
u.ProtocolsPresent = false
}
func (u *DirectoryEntry) SetAbilities(abilities Operations) {
u.Abilities = abilities
u.AbilitiesPresent = true
}
func (u *DirectoryEntry) GetAbilities() Operations {
return u.Abilities
}
func (u *DirectoryEntry) GetAbilitiesWithDefault(_default Operations) Operations {
if !u.HasAbilities() {
return _default
}
return u.Abilities
}
func (u *DirectoryEntry) HasAbilities() bool {
return u.AbilitiesPresent
}
func (u *DirectoryEntry) ClearAbilities() {
u.AbilitiesPresent = false
}
func (u *DirectoryEntry) SetId(id uint64) {
u.Id = id
u.IdPresent = true
}
func (u *DirectoryEntry) GetId() uint64 {
return u.Id
}
func (u *DirectoryEntry) GetIdWithDefault(_default uint64) uint64 {
if !u.HasId() {
return _default
}
return u.Id
}
func (u *DirectoryEntry) HasId() bool {
return u.IdPresent
}
func (u *DirectoryEntry) ClearId() {
u.IdPresent = false
}
func (u *DirectoryEntry) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *DirectoryEntry) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type DirectoryEnumerateOptions struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
}
var _mDirectoryEnumerateOptions = _bindings.CreateLazyMarshaler(DirectoryEnumerateOptions{})
func (msg *DirectoryEnumerateOptions) Marshaler() _bindings.Marshaler {
return _mDirectoryEnumerateOptions
}
func (u *DirectoryEnumerateOptions) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *DirectoryEnumerateOptions) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type DirectoryInfo struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Requested attributes for the directory. This is only populated if requested.
Attributes NodeAttributes2 `fidl_ordinal:"1"`
AttributesPresent bool
}
var _mDirectoryInfo = _bindings.CreateLazyMarshaler(DirectoryInfo{})
func (msg *DirectoryInfo) Marshaler() _bindings.Marshaler {
return _mDirectoryInfo
}
func (u *DirectoryInfo) SetAttributes(attributes NodeAttributes2) {
u.Attributes = attributes
u.AttributesPresent = true
}
func (u *DirectoryInfo) GetAttributes() NodeAttributes2 {
return u.Attributes
}
func (u *DirectoryInfo) GetAttributesWithDefault(_default NodeAttributes2) NodeAttributes2 {
if !u.HasAttributes() {
return _default
}
return u.Attributes
}
func (u *DirectoryInfo) HasAttributes() bool {
return u.AttributesPresent
}
func (u *DirectoryInfo) ClearAttributes() {
u.AttributesPresent = false
}
func (u *DirectoryInfo) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *DirectoryInfo) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type DirectoryProtocolOptions struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Optional rights to be negotiated.
//
// When present, indicates that the caller requests
// additional optional rights equal to the intersection
// of this value and the rights on the requesting
// connection. This acts as a high water mark that
// prevents rights escalation as this request is
// proxied over multiple hops; each proxy must
// intersect the value with the rights on the
// requesting connection before proxying on.
//
// This field is necessary to express POSIX semantics
// where `open` of a directory must be `O_RDONLY` yet
// `openat` can be used to open non-directory nodes
// within that directory with privileges exceeding
// `O_RDONLY`. This means that POSIX clients must
// always set this to the full set of [`Rights`] to
// implement `open` or `openat` calls which do not
// forbid directories (e.g. `O_WRONLY` and `O_RDWR`
// do forbid directories).
OptionalRights Operations `fidl_ordinal:"1"`
OptionalRightsPresent bool
}
var _mDirectoryProtocolOptions = _bindings.CreateLazyMarshaler(DirectoryProtocolOptions{})
func (msg *DirectoryProtocolOptions) Marshaler() _bindings.Marshaler {
return _mDirectoryProtocolOptions
}
func (u *DirectoryProtocolOptions) SetOptionalRights(optionalRights Operations) {
u.OptionalRights = optionalRights
u.OptionalRightsPresent = true
}
func (u *DirectoryProtocolOptions) GetOptionalRights() Operations {
return u.OptionalRights
}
func (u *DirectoryProtocolOptions) GetOptionalRightsWithDefault(_default Operations) Operations {
if !u.HasOptionalRights() {
return _default
}
return u.OptionalRights
}
func (u *DirectoryProtocolOptions) HasOptionalRights() bool {
return u.OptionalRightsPresent
}
func (u *DirectoryProtocolOptions) ClearOptionalRights() {
u.OptionalRightsPresent = false
}
func (u *DirectoryProtocolOptions) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *DirectoryProtocolOptions) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
// Auxiliary data for the file representation of a node.
type FileInfo struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"true"`
I_unknownData interface{}
// True if the file is opened in append mode.
// In append mode, the seek offset is moved to the end before every
// write, the two steps performed in an atomic manner.
IsAppend bool `fidl_ordinal:"1"`
IsAppendPresent bool
// 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.
//
// This event will be present if the following conditions are met:
//
// - The `available_operations` on the file connection is not empty.
// - The filesystem supports signalling readability/writability events.
//
// The [`FileSignal`] values may be observed on this event.
Observer _zx.Event `fidl_handle_subtype:"5" fidl_handle_rights:"2147483648" fidl_bounds:"0" fidl_ordinal:"2"`
ObserverPresent bool
// An optional stream object, which can be used to read to and write from
// the file.
//
// Reading and writing the file using the stream object can be up to 20x
// faster than reading and writing the file using the Read and Write
// operations in the [`File`] protocol.
Stream _zx.Handle `fidl_handle_subtype:"31" fidl_handle_rights:"2147483648" fidl_bounds:"0" fidl_ordinal:"3"`
StreamPresent bool
// Requested attributes for the file. This is only populated if requested.
Attributes NodeAttributes2 `fidl_ordinal:"4"`
AttributesPresent bool
}
var _mFileInfo = _bindings.CreateLazyMarshaler(FileInfo{})
func (msg *FileInfo) Marshaler() _bindings.Marshaler {
return _mFileInfo
}
func (u *FileInfo) SetIsAppend(isAppend bool) {
u.IsAppend = isAppend
u.IsAppendPresent = true
}
func (u *FileInfo) GetIsAppend() bool {
return u.IsAppend
}
func (u *FileInfo) GetIsAppendWithDefault(_default bool) bool {
if !u.HasIsAppend() {
return _default
}
return u.IsAppend
}
func (u *FileInfo) HasIsAppend() bool {
return u.IsAppendPresent
}
func (u *FileInfo) ClearIsAppend() {
u.IsAppendPresent = false
}
func (u *FileInfo) SetObserver(observer _zx.Event) {
u.Observer = observer
u.ObserverPresent = true
}
func (u *FileInfo) GetObserver() _zx.Event {
return u.Observer
}
func (u *FileInfo) GetObserverWithDefault(_default _zx.Event) _zx.Event {
if !u.HasObserver() {
return _default
}
return u.Observer
}
func (u *FileInfo) HasObserver() bool {
return u.ObserverPresent
}
func (u *FileInfo) ClearObserver() {
u.ObserverPresent = false
}
func (u *FileInfo) SetStream(stream _zx.Handle) {
u.Stream = stream
u.StreamPresent = true
}
func (u *FileInfo) GetStream() _zx.Handle {
return u.Stream
}
func (u *FileInfo) GetStreamWithDefault(_default _zx.Handle) _zx.Handle {
if !u.HasStream() {
return _default
}
return u.Stream
}
func (u *FileInfo) HasStream() bool {
return u.StreamPresent
}
func (u *FileInfo) ClearStream() {
u.StreamPresent = false
}
func (u *FileInfo) SetAttributes(attributes NodeAttributes2) {
u.Attributes = attributes
u.AttributesPresent = true
}
func (u *FileInfo) GetAttributes() NodeAttributes2 {
return u.Attributes
}
func (u *FileInfo) GetAttributesWithDefault(_default NodeAttributes2) NodeAttributes2 {
if !u.HasAttributes() {
return _default
}
return u.Attributes
}
func (u *FileInfo) HasAttributes() bool {
return u.AttributesPresent
}
func (u *FileInfo) ClearAttributes() {
u.AttributesPresent = false
}
func (u *FileInfo) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *FileInfo) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type ImmutableNodeAttributes struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Describes the kinds of representations supported by the node.
// Note: This is not the result of the connection-time negotiation,
// which is conveyed via `representation`.
Protocols NodeProtocolKinds `fidl_ordinal:"1"`
ProtocolsPresent bool
// Describes the kinds of operations supported by the node.
// Note: This is distinct from the rights used at connection time.
Abilities Operations `fidl_ordinal:"2"`
AbilitiesPresent bool
// Node size, in bytes.
ContentSize uint64 `fidl_ordinal:"3"`
ContentSizePresent bool
// Space needed to store the node (possibly larger than size), in bytes.
StorageSize uint64 `fidl_ordinal:"4"`
StorageSizePresent bool
// Number of hard links to the node. It must be at least one.
LinkCount uint64 `fidl_ordinal:"5"`
LinkCountPresent bool
// An ID for the node. See [`Id`].
// This `id` should be unique among all entries of a directory.
Id uint64 `fidl_ordinal:"6"`
IdPresent bool
// Time of last change to the metadata in nanoseconds since the Unix epoch, UTC.
ChangeTime uint64 `fidl_ordinal:"7"`
ChangeTimePresent bool
// Contains the verification options for fsverity-enabled files.
Options VerificationOptions `fidl_ordinal:"8"`
OptionsPresent bool
// The root hash for the file. Not all filesystems support this across all files.
RootHash []uint8 `fidl_bounds:"64" fidl_ordinal:"9"`
RootHashPresent bool
}
var _mImmutableNodeAttributes = _bindings.CreateLazyMarshaler(ImmutableNodeAttributes{})
func (msg *ImmutableNodeAttributes) Marshaler() _bindings.Marshaler {
return _mImmutableNodeAttributes
}
func (u *ImmutableNodeAttributes) SetProtocols(protocols NodeProtocolKinds) {
u.Protocols = protocols
u.ProtocolsPresent = true
}
func (u *ImmutableNodeAttributes) GetProtocols() NodeProtocolKinds {
return u.Protocols
}
func (u *ImmutableNodeAttributes) GetProtocolsWithDefault(_default NodeProtocolKinds) NodeProtocolKinds {
if !u.HasProtocols() {
return _default
}
return u.Protocols
}
func (u *ImmutableNodeAttributes) HasProtocols() bool {
return u.ProtocolsPresent
}
func (u *ImmutableNodeAttributes) ClearProtocols() {
u.ProtocolsPresent = false
}
func (u *ImmutableNodeAttributes) SetAbilities(abilities Operations) {
u.Abilities = abilities
u.AbilitiesPresent = true
}
func (u *ImmutableNodeAttributes) GetAbilities() Operations {
return u.Abilities
}
func (u *ImmutableNodeAttributes) GetAbilitiesWithDefault(_default Operations) Operations {
if !u.HasAbilities() {
return _default
}
return u.Abilities
}
func (u *ImmutableNodeAttributes) HasAbilities() bool {
return u.AbilitiesPresent
}
func (u *ImmutableNodeAttributes) ClearAbilities() {
u.AbilitiesPresent = false
}
func (u *ImmutableNodeAttributes) SetContentSize(contentSize uint64) {
u.ContentSize = contentSize
u.ContentSizePresent = true
}
func (u *ImmutableNodeAttributes) GetContentSize() uint64 {
return u.ContentSize
}
func (u *ImmutableNodeAttributes) GetContentSizeWithDefault(_default uint64) uint64 {
if !u.HasContentSize() {
return _default
}
return u.ContentSize
}
func (u *ImmutableNodeAttributes) HasContentSize() bool {
return u.ContentSizePresent
}
func (u *ImmutableNodeAttributes) ClearContentSize() {
u.ContentSizePresent = false
}
func (u *ImmutableNodeAttributes) SetStorageSize(storageSize uint64) {
u.StorageSize = storageSize
u.StorageSizePresent = true
}
func (u *ImmutableNodeAttributes) GetStorageSize() uint64 {
return u.StorageSize
}
func (u *ImmutableNodeAttributes) GetStorageSizeWithDefault(_default uint64) uint64 {
if !u.HasStorageSize() {
return _default
}
return u.StorageSize
}
func (u *ImmutableNodeAttributes) HasStorageSize() bool {
return u.StorageSizePresent
}
func (u *ImmutableNodeAttributes) ClearStorageSize() {
u.StorageSizePresent = false
}
func (u *ImmutableNodeAttributes) SetLinkCount(linkCount uint64) {
u.LinkCount = linkCount
u.LinkCountPresent = true
}
func (u *ImmutableNodeAttributes) GetLinkCount() uint64 {
return u.LinkCount
}
func (u *ImmutableNodeAttributes) GetLinkCountWithDefault(_default uint64) uint64 {
if !u.HasLinkCount() {
return _default
}
return u.LinkCount
}
func (u *ImmutableNodeAttributes) HasLinkCount() bool {
return u.LinkCountPresent
}
func (u *ImmutableNodeAttributes) ClearLinkCount() {
u.LinkCountPresent = false
}
func (u *ImmutableNodeAttributes) SetId(id uint64) {
u.Id = id
u.IdPresent = true
}
func (u *ImmutableNodeAttributes) GetId() uint64 {
return u.Id
}
func (u *ImmutableNodeAttributes) GetIdWithDefault(_default uint64) uint64 {
if !u.HasId() {
return _default
}
return u.Id
}
func (u *ImmutableNodeAttributes) HasId() bool {
return u.IdPresent
}
func (u *ImmutableNodeAttributes) ClearId() {
u.IdPresent = false
}
func (u *ImmutableNodeAttributes) SetChangeTime(changeTime uint64) {
u.ChangeTime = changeTime
u.ChangeTimePresent = true
}
func (u *ImmutableNodeAttributes) GetChangeTime() uint64 {
return u.ChangeTime
}
func (u *ImmutableNodeAttributes) GetChangeTimeWithDefault(_default uint64) uint64 {
if !u.HasChangeTime() {
return _default
}
return u.ChangeTime
}
func (u *ImmutableNodeAttributes) HasChangeTime() bool {
return u.ChangeTimePresent
}
func (u *ImmutableNodeAttributes) ClearChangeTime() {
u.ChangeTimePresent = false
}
func (u *ImmutableNodeAttributes) SetOptions(options VerificationOptions) {
u.Options = options
u.OptionsPresent = true
}
func (u *ImmutableNodeAttributes) GetOptions() VerificationOptions {
return u.Options
}
func (u *ImmutableNodeAttributes) GetOptionsWithDefault(_default VerificationOptions) VerificationOptions {
if !u.HasOptions() {
return _default
}
return u.Options
}
func (u *ImmutableNodeAttributes) HasOptions() bool {
return u.OptionsPresent
}
func (u *ImmutableNodeAttributes) ClearOptions() {
u.OptionsPresent = false
}
func (u *ImmutableNodeAttributes) SetRootHash(rootHash []uint8) {
u.RootHash = rootHash
u.RootHashPresent = true
}
func (u *ImmutableNodeAttributes) GetRootHash() []uint8 {
return u.RootHash
}
func (u *ImmutableNodeAttributes) GetRootHashWithDefault(_default []uint8) []uint8 {
if !u.HasRootHash() {
return _default
}
return u.RootHash
}
func (u *ImmutableNodeAttributes) HasRootHash() bool {
return u.RootHashPresent
}
func (u *ImmutableNodeAttributes) ClearRootHash() {
u.RootHashPresent = false
}
func (u *ImmutableNodeAttributes) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *ImmutableNodeAttributes) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type MutableNodeAttributes struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Time of creation in nanoseconds since the Unix epoch, UTC.
CreationTime uint64 `fidl_ordinal:"1"`
CreationTimePresent bool
// Time of last modification in nanoseconds since the Unix epoch, UTC.
ModificationTime uint64 `fidl_ordinal:"2"`
ModificationTimePresent bool
// POSIX compatibility attributes. Most filesystems will not support
// these. Those that do must simply store and retrieve them (e.g. as
// extended attributes) and not attempt to interpret them (e.g. by doing
// permission checks or handling device opens specially).
Mode uint32 `fidl_ordinal:"3"`
ModePresent bool
Uid uint32 `fidl_ordinal:"4"`
UidPresent bool
Gid uint32 `fidl_ordinal:"5"`
GidPresent bool
Rdev uint64 `fidl_ordinal:"6"`
RdevPresent bool
// Time of last access in nanoseconds since the Unix epoch, UTC. Note that servers might not
// always update this if this is the only attribute being updated.
AccessTime uint64 `fidl_ordinal:"7"`
AccessTimePresent bool
}
var _mMutableNodeAttributes = _bindings.CreateLazyMarshaler(MutableNodeAttributes{})
func (msg *MutableNodeAttributes) Marshaler() _bindings.Marshaler {
return _mMutableNodeAttributes
}
func (u *MutableNodeAttributes) SetCreationTime(creationTime uint64) {
u.CreationTime = creationTime
u.CreationTimePresent = true
}
func (u *MutableNodeAttributes) GetCreationTime() uint64 {
return u.CreationTime
}
func (u *MutableNodeAttributes) GetCreationTimeWithDefault(_default uint64) uint64 {
if !u.HasCreationTime() {
return _default
}
return u.CreationTime
}
func (u *MutableNodeAttributes) HasCreationTime() bool {
return u.CreationTimePresent
}
func (u *MutableNodeAttributes) ClearCreationTime() {
u.CreationTimePresent = false
}
func (u *MutableNodeAttributes) SetModificationTime(modificationTime uint64) {
u.ModificationTime = modificationTime
u.ModificationTimePresent = true
}
func (u *MutableNodeAttributes) GetModificationTime() uint64 {
return u.ModificationTime
}
func (u *MutableNodeAttributes) GetModificationTimeWithDefault(_default uint64) uint64 {
if !u.HasModificationTime() {
return _default
}
return u.ModificationTime
}
func (u *MutableNodeAttributes) HasModificationTime() bool {
return u.ModificationTimePresent
}
func (u *MutableNodeAttributes) ClearModificationTime() {
u.ModificationTimePresent = false
}
func (u *MutableNodeAttributes) SetMode(mode uint32) {
u.Mode = mode
u.ModePresent = true
}
func (u *MutableNodeAttributes) GetMode() uint32 {
return u.Mode
}
func (u *MutableNodeAttributes) GetModeWithDefault(_default uint32) uint32 {
if !u.HasMode() {
return _default
}
return u.Mode
}
func (u *MutableNodeAttributes) HasMode() bool {
return u.ModePresent
}
func (u *MutableNodeAttributes) ClearMode() {
u.ModePresent = false
}
func (u *MutableNodeAttributes) SetUid(uid uint32) {
u.Uid = uid
u.UidPresent = true
}
func (u *MutableNodeAttributes) GetUid() uint32 {
return u.Uid
}
func (u *MutableNodeAttributes) GetUidWithDefault(_default uint32) uint32 {
if !u.HasUid() {
return _default
}
return u.Uid
}
func (u *MutableNodeAttributes) HasUid() bool {
return u.UidPresent
}
func (u *MutableNodeAttributes) ClearUid() {
u.UidPresent = false
}
func (u *MutableNodeAttributes) SetGid(gid uint32) {
u.Gid = gid
u.GidPresent = true
}
func (u *MutableNodeAttributes) GetGid() uint32 {
return u.Gid
}
func (u *MutableNodeAttributes) GetGidWithDefault(_default uint32) uint32 {
if !u.HasGid() {
return _default
}
return u.Gid
}
func (u *MutableNodeAttributes) HasGid() bool {
return u.GidPresent
}
func (u *MutableNodeAttributes) ClearGid() {
u.GidPresent = false
}
func (u *MutableNodeAttributes) SetRdev(rdev uint64) {
u.Rdev = rdev
u.RdevPresent = true
}
func (u *MutableNodeAttributes) GetRdev() uint64 {
return u.Rdev
}
func (u *MutableNodeAttributes) GetRdevWithDefault(_default uint64) uint64 {
if !u.HasRdev() {
return _default
}
return u.Rdev
}
func (u *MutableNodeAttributes) HasRdev() bool {
return u.RdevPresent
}
func (u *MutableNodeAttributes) ClearRdev() {
u.RdevPresent = false
}
func (u *MutableNodeAttributes) SetAccessTime(accessTime uint64) {
u.AccessTime = accessTime
u.AccessTimePresent = true
}
func (u *MutableNodeAttributes) GetAccessTime() uint64 {
return u.AccessTime
}
func (u *MutableNodeAttributes) GetAccessTimeWithDefault(_default uint64) uint64 {
if !u.HasAccessTime() {
return _default
}
return u.AccessTime
}
func (u *MutableNodeAttributes) HasAccessTime() bool {
return u.AccessTimePresent
}
func (u *MutableNodeAttributes) ClearAccessTime() {
u.AccessTimePresent = false
}
func (u *MutableNodeAttributes) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *MutableNodeAttributes) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type NodeOptions struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
Flags NodeFlags `fidl_ordinal:"1"`
FlagsPresent bool
// Callers may assert the type of the object by setting the
// protocol corresponding to the expected type:
//
// * If the caller expected a directory but the node cannot be
// accessed as a directory, the error is `ZX_ERR_NOT_DIR`.
//
// * If the caller expected a file but the node cannot be
// accessed as a file, the error is `ZX_ERR_NOT_FILE`.
//
// * In other mismatched cases, and for an empty table, the error
// is `ZX_ERR_WRONG_TYPE`.
//
// If more than one protocol is present, the resultant protocol
// may become any one of them. Callers should specify
// [`NodeFlags.GET_REPRESENTATION`] to receive a
// [`Node.OnRepresentation`] event, in order to ascertain the
// protocol.
//
// If absent, indicates that the caller accepts any [`Node`]
// protocol (including [`Node`] itself for connector nodes, for
// instance).
Protocols NodeProtocols `fidl_ordinal:"2"`
ProtocolsPresent bool
// Specifies behavior with respect to existence. If an object
// is to be created, its type is specified by `protocols`; it
// must be present. If a valid object type cannot be
// unambiguously inferred e.g. both `directory` and `file` are
// set, the request must fail.
Mode OpenMode `fidl_ordinal:"3"`
ModePresent bool
// Requested rights on the new connection.
//
// If [`rights`] exceed the rights of the requesting connection
// then [`object_request`] will be closed with a
// `ZX_ERR_ACCESS_DENIED` epitaph.
//
// This applies in addition to
// [`DirectoryProtocolOptions.optional_rights`].
//
// If absent, inherits appropriate rights from the requesting
// connection. For example, if using the node protocol, only
// the GET_ATTRIBUTES right is inherited.
Rights Operations `fidl_ordinal:"4"`
RightsPresent bool
// If the `GET_REPRESENTATION` flag is set, attributes to be
// returned in [`Node.OnRepresentation`]. This requires the
// GET_ATTRIBUTES right on the parent connection, but this is
// not required on the resulting connection.
Attributes NodeAttributesQuery `fidl_ordinal:"5"`
AttributesPresent bool
// If an object is to be created, this specifies attributes
// that should be stored with the object at creation time.
// Servers might not support setting any or all attributes in
// which case they will return `ZX_ERR_NOT_SUPPORTED`.
CreateAttributes MutableNodeAttributes `fidl_ordinal:"6"`
CreateAttributesPresent bool
}
var _mNodeOptions = _bindings.CreateLazyMarshaler(NodeOptions{})
func (msg *NodeOptions) Marshaler() _bindings.Marshaler {
return _mNodeOptions
}
func (u *NodeOptions) SetFlags(flags NodeFlags) {
u.Flags = flags
u.FlagsPresent = true
}
func (u *NodeOptions) GetFlags() NodeFlags {
return u.Flags
}
func (u *NodeOptions) GetFlagsWithDefault(_default NodeFlags) NodeFlags {
if !u.HasFlags() {
return _default
}
return u.Flags
}
func (u *NodeOptions) HasFlags() bool {
return u.FlagsPresent
}
func (u *NodeOptions) ClearFlags() {
u.FlagsPresent = false
}
func (u *NodeOptions) SetProtocols(protocols NodeProtocols) {
u.Protocols = protocols
u.ProtocolsPresent = true
}
func (u *NodeOptions) GetProtocols() NodeProtocols {
return u.Protocols
}
func (u *NodeOptions) GetProtocolsWithDefault(_default NodeProtocols) NodeProtocols {
if !u.HasProtocols() {
return _default
}
return u.Protocols
}
func (u *NodeOptions) HasProtocols() bool {
return u.ProtocolsPresent
}
func (u *NodeOptions) ClearProtocols() {
u.ProtocolsPresent = false
}
func (u *NodeOptions) SetMode(mode OpenMode) {
u.Mode = mode
u.ModePresent = true
}
func (u *NodeOptions) GetMode() OpenMode {
return u.Mode
}
func (u *NodeOptions) GetModeWithDefault(_default OpenMode) OpenMode {
if !u.HasMode() {
return _default
}
return u.Mode
}
func (u *NodeOptions) HasMode() bool {
return u.ModePresent
}
func (u *NodeOptions) ClearMode() {
u.ModePresent = false
}
func (u *NodeOptions) SetRights(rights Operations) {
u.Rights = rights
u.RightsPresent = true
}
func (u *NodeOptions) GetRights() Operations {
return u.Rights
}
func (u *NodeOptions) GetRightsWithDefault(_default Operations) Operations {
if !u.HasRights() {
return _default
}
return u.Rights
}
func (u *NodeOptions) HasRights() bool {
return u.RightsPresent
}
func (u *NodeOptions) ClearRights() {
u.RightsPresent = false
}
func (u *NodeOptions) SetAttributes(attributes NodeAttributesQuery) {
u.Attributes = attributes
u.AttributesPresent = true
}
func (u *NodeOptions) GetAttributes() NodeAttributesQuery {
return u.Attributes
}
func (u *NodeOptions) GetAttributesWithDefault(_default NodeAttributesQuery) NodeAttributesQuery {
if !u.HasAttributes() {
return _default
}
return u.Attributes
}
func (u *NodeOptions) HasAttributes() bool {
return u.AttributesPresent
}
func (u *NodeOptions) ClearAttributes() {
u.AttributesPresent = false
}
func (u *NodeOptions) SetCreateAttributes(createAttributes MutableNodeAttributes) {
u.CreateAttributes = createAttributes
u.CreateAttributesPresent = true
}
func (u *NodeOptions) GetCreateAttributes() MutableNodeAttributes {
return u.CreateAttributes
}
func (u *NodeOptions) GetCreateAttributesWithDefault(_default MutableNodeAttributes) MutableNodeAttributes {
if !u.HasCreateAttributes() {
return _default
}
return u.CreateAttributes
}
func (u *NodeOptions) HasCreateAttributes() bool {
return u.CreateAttributesPresent
}
func (u *NodeOptions) ClearCreateAttributes() {
u.CreateAttributesPresent = false
}
func (u *NodeOptions) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *NodeOptions) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type NodeProtocols struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
Directory DirectoryProtocolOptions `fidl_ordinal:"1"`
DirectoryPresent bool
File FileProtocolFlags `fidl_ordinal:"2"`
FilePresent bool
Symlink SymlinkProtocolFlags `fidl_ordinal:"3"`
SymlinkPresent bool
// Asks for the node protocol. The only right supported is
// GET_ATTRIBUTES. Calling `SetFlags` on the resulting
// connection will result in `ZX_ERR_BAD_HANDLE`. If
// [`NodeFlags.GET_REPRESENTATION`] is specified, the
// `connector` variant will be returned (even if the object
// supports a different representation).
Node NodeProtocolFlags `fidl_ordinal:"4"`
NodePresent bool
}
var _mNodeProtocols = _bindings.CreateLazyMarshaler(NodeProtocols{})
func (msg *NodeProtocols) Marshaler() _bindings.Marshaler {
return _mNodeProtocols
}
func (u *NodeProtocols) SetDirectory(directory DirectoryProtocolOptions) {
u.Directory = directory
u.DirectoryPresent = true
}
func (u *NodeProtocols) GetDirectory() DirectoryProtocolOptions {
return u.Directory
}
func (u *NodeProtocols) GetDirectoryWithDefault(_default DirectoryProtocolOptions) DirectoryProtocolOptions {
if !u.HasDirectory() {
return _default
}
return u.Directory
}
func (u *NodeProtocols) HasDirectory() bool {
return u.DirectoryPresent
}
func (u *NodeProtocols) ClearDirectory() {
u.DirectoryPresent = false
}
func (u *NodeProtocols) SetFile(file FileProtocolFlags) {
u.File = file
u.FilePresent = true
}
func (u *NodeProtocols) GetFile() FileProtocolFlags {
return u.File
}
func (u *NodeProtocols) GetFileWithDefault(_default FileProtocolFlags) FileProtocolFlags {
if !u.HasFile() {
return _default
}
return u.File
}
func (u *NodeProtocols) HasFile() bool {
return u.FilePresent
}
func (u *NodeProtocols) ClearFile() {
u.FilePresent = false
}
func (u *NodeProtocols) SetSymlink(symlink SymlinkProtocolFlags) {
u.Symlink = symlink
u.SymlinkPresent = true
}
func (u *NodeProtocols) GetSymlink() SymlinkProtocolFlags {
return u.Symlink
}
func (u *NodeProtocols) GetSymlinkWithDefault(_default SymlinkProtocolFlags) SymlinkProtocolFlags {
if !u.HasSymlink() {
return _default
}
return u.Symlink
}
func (u *NodeProtocols) HasSymlink() bool {
return u.SymlinkPresent
}
func (u *NodeProtocols) ClearSymlink() {
u.SymlinkPresent = false
}
func (u *NodeProtocols) SetNode(node NodeProtocolFlags) {
u.Node = node
u.NodePresent = true
}
func (u *NodeProtocols) GetNode() NodeProtocolFlags {
return u.Node
}
func (u *NodeProtocols) GetNodeWithDefault(_default NodeProtocolFlags) NodeProtocolFlags {
if !u.HasNode() {
return _default
}
return u.Node
}
func (u *NodeProtocols) HasNode() bool {
return u.NodePresent
}
func (u *NodeProtocols) ClearNode() {
u.NodePresent = false
}
func (u *NodeProtocols) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *NodeProtocols) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type RightsRequest struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// Requested rights on the new connection.
//
// If [`rights`] exceed the rights of the requesting connection
// then [`object_request`] will be closed with a
// `ZX_ERR_ACCESS_DENIED` epitaph.
//
// If absent, inherits the rights from the requesting connection.
Rights Operations `fidl_ordinal:"1"`
RightsPresent bool
}
var _mRightsRequest = _bindings.CreateLazyMarshaler(RightsRequest{})
func (msg *RightsRequest) Marshaler() _bindings.Marshaler {
return _mRightsRequest
}
func (u *RightsRequest) SetRights(rights Operations) {
u.Rights = rights
u.RightsPresent = true
}
func (u *RightsRequest) GetRights() Operations {
return u.Rights
}
func (u *RightsRequest) GetRightsWithDefault(_default Operations) Operations {
if !u.HasRights() {
return _default
}
return u.Rights
}
func (u *RightsRequest) HasRights() bool {
return u.RightsPresent
}
func (u *RightsRequest) ClearRights() {
u.RightsPresent = false
}
func (u *RightsRequest) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *RightsRequest) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type SymlinkInfo struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
// The symbolic link has no meaning on the server; the client is free to interpret the
// target however it chooses.
Target []uint8 `fidl_bounds:"4095" fidl_ordinal:"1"`
TargetPresent bool
// Requested attributes for the symbolic link. This is only populated if requested.
Attributes NodeAttributes2 `fidl_ordinal:"2"`
AttributesPresent bool
}
var _mSymlinkInfo = _bindings.CreateLazyMarshaler(SymlinkInfo{})
func (msg *SymlinkInfo) Marshaler() _bindings.Marshaler {
return _mSymlinkInfo
}
func (u *SymlinkInfo) SetTarget(target []uint8) {
u.Target = target
u.TargetPresent = true
}
func (u *SymlinkInfo) GetTarget() []uint8 {
return u.Target
}
func (u *SymlinkInfo) GetTargetWithDefault(_default []uint8) []uint8 {
if !u.HasTarget() {
return _default
}
return u.Target
}
func (u *SymlinkInfo) HasTarget() bool {
return u.TargetPresent
}
func (u *SymlinkInfo) ClearTarget() {
u.TargetPresent = false
}
func (u *SymlinkInfo) SetAttributes(attributes NodeAttributes2) {
u.Attributes = attributes
u.AttributesPresent = true
}
func (u *SymlinkInfo) GetAttributes() NodeAttributes2 {
return u.Attributes
}
func (u *SymlinkInfo) GetAttributesWithDefault(_default NodeAttributes2) NodeAttributes2 {
if !u.HasAttributes() {
return _default
}
return u.Attributes
}
func (u *SymlinkInfo) HasAttributes() bool {
return u.AttributesPresent
}
func (u *SymlinkInfo) ClearAttributes() {
u.AttributesPresent = false
}
func (u *SymlinkInfo) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *SymlinkInfo) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
type UnlinkOptions struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
Flags UnlinkFlags `fidl_ordinal:"1"`
FlagsPresent bool
}
var _mUnlinkOptions = _bindings.CreateLazyMarshaler(UnlinkOptions{})
func (msg *UnlinkOptions) Marshaler() _bindings.Marshaler {
return _mUnlinkOptions
}
func (u *UnlinkOptions) SetFlags(flags UnlinkFlags) {
u.Flags = flags
u.FlagsPresent = true
}
func (u *UnlinkOptions) GetFlags() UnlinkFlags {
return u.Flags
}
func (u *UnlinkOptions) GetFlagsWithDefault(_default UnlinkFlags) UnlinkFlags {
if !u.HasFlags() {
return _default
}
return u.Flags
}
func (u *UnlinkOptions) HasFlags() bool {
return u.FlagsPresent
}
func (u *UnlinkOptions) ClearFlags() {
u.FlagsPresent = false
}
func (u *UnlinkOptions) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *UnlinkOptions) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
// Set of options used to enable verity on a file.
type VerificationOptions struct {
_ struct{} `fidl:"t" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"`
I_unknownData interface{}
HashAlgorithm HashAlgorithm `fidl_ordinal:"1"`
HashAlgorithmPresent bool
// `salt` is prepended to each block before it is hashed.
Salt []uint8 `fidl_bounds:"32" fidl_ordinal:"2"`
SaltPresent bool
}
var _mVerificationOptions = _bindings.CreateLazyMarshaler(VerificationOptions{})
func (msg *VerificationOptions) Marshaler() _bindings.Marshaler {
return _mVerificationOptions
}
func (u *VerificationOptions) SetHashAlgorithm(hashAlgorithm HashAlgorithm) {
u.HashAlgorithm = hashAlgorithm
u.HashAlgorithmPresent = true
}
func (u *VerificationOptions) GetHashAlgorithm() HashAlgorithm {
return u.HashAlgorithm
}
func (u *VerificationOptions) GetHashAlgorithmWithDefault(_default HashAlgorithm) HashAlgorithm {
if !u.HasHashAlgorithm() {
return _default
}
return u.HashAlgorithm
}
func (u *VerificationOptions) HasHashAlgorithm() bool {
return u.HashAlgorithmPresent
}
func (u *VerificationOptions) ClearHashAlgorithm() {
u.HashAlgorithmPresent = false
}
func (u *VerificationOptions) SetSalt(salt []uint8) {
u.Salt = salt
u.SaltPresent = true
}
func (u *VerificationOptions) GetSalt() []uint8 {
return u.Salt
}
func (u *VerificationOptions) GetSaltWithDefault(_default []uint8) []uint8 {
if !u.HasSalt() {
return _default
}
return u.Salt
}
func (u *VerificationOptions) HasSalt() bool {
return u.SaltPresent
}
func (u *VerificationOptions) ClearSalt() {
u.SaltPresent = false
}
func (u *VerificationOptions) HasUnknownData() bool {
return u.I_unknownData != nil
}
func (u *VerificationOptions) GetUnknownData() map[uint64]_bindings.UnknownData {
return u.I_unknownData.(map[uint64]_bindings.UnknownData)
}
const (
AdvisoryLockingAdvisoryLockOrdinal uint64 = 0x6ee9c0ad53ec87aa
)
type AdvisoryLockingWithCtxInterface _bindings.ChannelProxy
// Acquires an advisory lock on the underlying file.
//
// The lock lasts until either this connection is closed or
// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
// explicitly.
//
// Advisory locks are purely advisory. They do not prevent actual read or
// write operations from occurring on the file, either through this
// connection or through other connections.
//
// This method requires the following rights:
//
// - [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
// - [`Rights.WRITE_BYTES`] if `request.type` is
// [`AdvisoryLockType.WRITE`].
//
// # Errors
//
// - `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
// example, another connection might hold a conflicting lock type.
// - `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
// - `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
// to acquire the given type of lock.
func (p *AdvisoryLockingWithCtxInterface) AdvisoryLock(ctx_ _bindings.Context, request AdvisoryLockRequest) (AdvisoryLockingAdvisoryLockResult, error) {
req_ := &AdvisoryLockingAdvisoryLockRequest{Request: request}
resp_ := &AdvisoryLockingAdvisoryLockResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(AdvisoryLockingAdvisoryLockOrdinal, req_, resp_)
return (*resp_), err_
}
// Advisory locking protocol.
//
// This protocol is intended to be composed into the |File| protocol to
// provide support for advisory locking.
//
// Advisory locks are purely advisory. They do not prevent actual read or
// write operations from occurring on the file, either through this
// connection or through other connections.
//
// These primitives are designed to support the flock() and fcntl(),
// specifically F_SETLK, F_SETLKW, and F_GETLK, functionality that code
// running on Fuchsia expects from other operating systems.
type AdvisoryLockingWithCtx interface {
// Acquires an advisory lock on the underlying file.
//
// The lock lasts until either this connection is closed or
// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
// explicitly.
//
// Advisory locks are purely advisory. They do not prevent actual read or
// write operations from occurring on the file, either through this
// connection or through other connections.
//
// This method requires the following rights:
//
// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
// * [`Rights.WRITE_BYTES`] if `request.type` is
// [`AdvisoryLockType.WRITE`].
//
// # Errors
//
// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
// example, another connection might hold a conflicting lock type.
// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
// to acquire the given type of lock.
AdvisoryLock(ctx_ _bindings.Context, request AdvisoryLockRequest) (AdvisoryLockingAdvisoryLockResult, error)
}
type AdvisoryLockingWithCtxTransitionalBase struct{}
type AdvisoryLockingWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewAdvisoryLockingWithCtxInterfaceRequest() (AdvisoryLockingWithCtxInterfaceRequest, *AdvisoryLockingWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return AdvisoryLockingWithCtxInterfaceRequest(req), (*AdvisoryLockingWithCtxInterface)(cli), err
}
type AdvisoryLockingWithCtxStub struct {
Impl AdvisoryLockingWithCtx
}
func (s_ *AdvisoryLockingWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case AdvisoryLockingAdvisoryLockOrdinal:
in_ := &AdvisoryLockingAdvisoryLockRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.AdvisoryLock(args_.Ctx, (*in_).Request)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type AdvisoryLockingEventProxy _bindings.ChannelProxy
const (
DirectoryCloneOrdinal uint64 = 0x5a61678f293ce16f
DirectoryOnOpenOrdinal uint64 = 0x7fc7bbb1dbfd1972
DirectoryGetAttrOrdinal uint64 = 0x78985e216314dafd
DirectorySetAttrOrdinal uint64 = 0x4186c0f40d938f46
DirectoryGetFlagsOrdinal uint64 = 0x5b88fffb8eda3aa1
DirectorySetFlagsOrdinal uint64 = 0x5295b76c71fde733
DirectoryQueryFilesystemOrdinal uint64 = 0x6f344a1c6b0a0610
DirectoryOpenOrdinal uint64 = 0x2c5044561d685ec0
DirectoryReadDirentsOrdinal uint64 = 0x3582806bf27faa0a
DirectoryRewindOrdinal uint64 = 0x16b1202af0f34c71
DirectoryGetTokenOrdinal uint64 = 0x26ae9d18763c8655
DirectoryLinkOrdinal uint64 = 0x740604c0c7c930e7
DirectoryWatchOrdinal uint64 = 0x5717193a59d66d91
DirectoryCloseOrdinal uint64 = 0x5ac5d459ad7f657e
DirectoryQueryOrdinal uint64 = 0x2658edee9decfc06
DirectoryReopenOrdinal uint64 = 0x6a849ef281d2baa1
DirectoryOnRepresentationOrdinal uint64 = 0x5cb40567d80a510c
DirectoryGetConnectionInfoOrdinal uint64 = 0x584c377c7c0a6d0b
DirectoryGetAttributesOrdinal uint64 = 0x3d4396a638ea053b
DirectoryUpdateAttributesOrdinal uint64 = 0x3308c1da5a89bf08
DirectorySyncOrdinal uint64 = 0x2c5c27ca0ab5dc49
DirectoryListExtendedAttributesOrdinal uint64 = 0x4b61033de007fcd0
DirectoryGetExtendedAttributeOrdinal uint64 = 0x45ffa3ccfdeb76db
DirectorySetExtendedAttributeOrdinal uint64 = 0x4a951362f681f23c
DirectoryRemoveExtendedAttributeOrdinal uint64 = 0x7a0b9f3a9bf9032d
DirectoryAdvisoryLockOrdinal uint64 = 0x6ee9c0ad53ec87aa
DirectoryOpen2Ordinal uint64 = 0x2fbc4fbbff7c54d6
DirectoryUnlinkOrdinal uint64 = 0x750a0326a78d7bed
DirectoryEnumerateOrdinal uint64 = 0x36a4ca72c332c37d
DirectoryRenameOrdinal uint64 = 0x7060e7723b9928de
DirectoryCreateSymlinkOrdinal uint64 = 0x21ce0f19ec043889
)
type DirectoryWithCtxInterface _bindings.ChannelProxy
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
func (p *DirectoryWithCtxInterface) Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error {
req_ := &Node1CloneRequest{Flags: flags, Object: object}
err_ := ((*_bindings.ChannelProxy)(p)).Send(DirectoryCloneOrdinal, req_)
return err_
}
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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 *DirectoryWithCtxInterface) ExpectOnOpen(ctx_ _bindings.Context) (int32, *NodeInfoDeprecated, error) {
resp_ := &Node1OnOpenRequest{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(DirectoryOnOpenOrdinal, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *DirectoryWithCtxInterface) GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &Node1GetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetAttrOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Attributes, err_
}
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
func (p *DirectoryWithCtxInterface) SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error) {
req_ := &Node1SetAttrRequest{Flags: flags, Attributes: attributes}
resp_ := &Node1SetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectorySetAttrOrdinal, req_, resp_)
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 *DirectoryWithCtxInterface) GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error) {
var req_ _bindings.Message
resp_ := &Node1GetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetFlagsOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Flags, err_
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
func (p *DirectoryWithCtxInterface) SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error) {
req_ := &Node1SetFlagsRequest{Flags: flags}
resp_ := &Node1SetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectorySetFlagsOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Query the filesystem for filesystem-specific information.
func (p *DirectoryWithCtxInterface) QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error) {
var req_ _bindings.Message
resp_ := &Node1QueryFilesystemResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryQueryFilesystemOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Info, 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. A trailing slash implies OpenFlags.DIRECTORY. Components
// must not be empty (i.e. "foo//bar" is invalid). ".." is disallowed anywhere in the path. "."
// is only allowed if the path is exactly ".", but not otherwise. A leading '/' is allowed (and
// is treated the same way as if not present, i.e. "/foo/bar' and "foo/bar" are the same).
//
// If an unknown value is sent for flags the connection should be closed.
//
// `OpenFlags.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.
//
// `mode` is ignored.
func (p *DirectoryWithCtxInterface) Open(ctx_ _bindings.Context, flags OpenFlags, mode ModeType, path string, object NodeWithCtxInterfaceRequest) error {
req_ := &OpenableOpenRequest{Flags: flags, Mode: mode, Path: path, Object: object}
err_ := ((*_bindings.ChannelProxy)(p)).Send(DirectoryOpenOrdinal, req_)
return 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.
// Each call to ReadDirents will only return whole dirent structures,
// they will not get split across ReadDirent calls. When the seek
// offset reaches the end, `dirents` will be empty.
//
// 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 `DirentType` 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 *DirectoryWithCtxInterface) ReadDirents(ctx_ _bindings.Context, maxBytes uint64) (int32, []uint8, error) {
req_ := &Directory1ReadDirentsRequest{MaxBytes: maxBytes}
resp_ := &Directory1ReadDirentsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryReadDirentsOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Dirents, err_
}
// Resets the directory seek offset.
//
// This method does not require any rights, similar to ReadDirents.
func (p *DirectoryWithCtxInterface) Rewind(ctx_ _bindings.Context) (int32, error) {
var req_ _bindings.Message
resp_ := &Directory1RewindResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryRewindOrdinal, req_, resp_)
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. The token will remain valid for as long as the connection requesting the token
// remains open.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
func (p *DirectoryWithCtxInterface) GetToken(ctx_ _bindings.Context) (int32, _zx.Handle, error) {
var req_ _bindings.Message
resp_ := &Directory1GetTokenResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetTokenOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Token, 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: `OpenFlags.RIGHT_WRITABLE` and
// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
//
// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
// there are two actors operating concurrently, and one actor performs a rename that affects
// the source within this directory, and the other does a link, each will appear to occur
// atomically in an unspecified order.
func (p *DirectoryWithCtxInterface) Link(ctx_ _bindings.Context, src string, dstParentToken _zx.Handle, dst string) (int32, error) {
req_ := &Directory1LinkRequest{Src: src, DstParentToken: dstParentToken, Dst: dst}
resp_ := &Directory1LinkResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryLinkOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Watches a directory, receiving events of added messages on the
// watcher request channel.
//
// Options must be zero; it is reserved.
//
// This method does not require any rights, similar to ReadDirents.
func (p *DirectoryWithCtxInterface) Watch(ctx_ _bindings.Context, mask WatchMask, options uint32, watcher DirectoryWatcherWithCtxInterfaceRequest) (int32, error) {
req_ := &Directory1WatchRequest{Mask: mask, Options: options, Watcher: watcher}
resp_ := &Directory1WatchResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryWatchOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
func (p *DirectoryWithCtxInterface) Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.CloseableCloseResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryCloseOrdinal, req_, resp_)
return (*resp_), err_
}
func (p *DirectoryWithCtxInterface) Query(ctx_ _bindings.Context) ([]uint8, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.QueryableQueryResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryQueryOrdinal, req_, resp_)
return (*resp_).Protocol, err_
}
// Creates another connection to the same node.
func (p *DirectoryWithCtxInterface) Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error {
req_ := &Node2ReopenRequest{RightsRequest: rightsRequest, ObjectRequest: objectRequest}
err_ := ((*_bindings.ChannelProxy)(p)).Send(DirectoryReopenOrdinal, req_)
return err_
}
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
func (p *DirectoryWithCtxInterface) ExpectOnRepresentation(ctx_ _bindings.Context) (Representation, error) {
resp_ := &Representation{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(DirectoryOnRepresentationOrdinal, resp_)
return (*resp_), err_
}
// Acquires information about the connection.
//
// This method does not require any rights.
func (p *DirectoryWithCtxInterface) GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error) {
var req_ _bindings.Message
resp_ := &ConnectionInfo{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetConnectionInfoOrdinal, req_, resp_)
return (*resp_), err_
}
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// - `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *DirectoryWithCtxInterface) GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error) {
req_ := &Node2GetAttributesRequest{Query: query}
resp_ := &Node2GetAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *DirectoryWithCtxInterface) UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error) {
req_ := &payload
resp_ := &Node2UpdateAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryUpdateAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
func (p *DirectoryWithCtxInterface) Sync(ctx_ _bindings.Context) (Node2SyncResult, error) {
var req_ _bindings.Message
resp_ := &Node2SyncResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectorySyncOrdinal, req_, resp_)
return (*resp_), err_
}
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *DirectoryWithCtxInterface) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
req_ := &Node2ListExtendedAttributesRequest{Iterator: iterator}
err_ := ((*_bindings.ChannelProxy)(p)).Send(DirectoryListExtendedAttributesOrdinal, req_)
return err_
}
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *DirectoryWithCtxInterface) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
req_ := &Node2GetExtendedAttributeRequest{Name: name}
resp_ := &Node2GetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryGetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *DirectoryWithCtxInterface) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
req_ := &Node2SetExtendedAttributeRequest{Name: name, Value: value, Mode: mode}
resp_ := &Node2SetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectorySetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *DirectoryWithCtxInterface) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
req_ := &Node2RemoveExtendedAttributeRequest{Name: name}
resp_ := &Node2RemoveExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryRemoveExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Acquires an advisory lock on the underlying file.
//
// The lock lasts until either this connection is closed or
// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
// explicitly.
//
// Advisory locks are purely advisory. They do not prevent actual read or
// write operations from occurring on the file, either through this
// connection or through other connections.
//
// This method requires the following rights:
//
// - [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
// - [`Rights.WRITE_BYTES`] if `request.type` is
// [`AdvisoryLockType.WRITE`].
//
// # Errors
//
// - `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
// example, another connection might hold a conflicting lock type.
// - `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
// - `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
// to acquire the given type of lock.
func (p *DirectoryWithCtxInterface) AdvisoryLock(ctx_ _bindings.Context, request AdvisoryLockRequest) (AdvisoryLockingAdvisoryLockResult, error) {
req_ := &AdvisoryLockingAdvisoryLockRequest{Request: request}
resp_ := &AdvisoryLockingAdvisoryLockResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryAdvisoryLockOrdinal, req_, resp_)
return (*resp_), err_
}
// Opens or creates a new node relative to this directory node.
//
// This method requires the following rights on the current connection:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.TRAVERSE`]
//
// Errors are presented as an epitaph on the `object_request` channel.
//
// - error `ZX_ERR_ACCESS_DENIED` if the requested rights exceeds
// what is allowed.
// - error `ZX_ERR_BAD_PATH` if `path` is invalid.
func (p *DirectoryWithCtxInterface) Open2(ctx_ _bindings.Context, path string, protocols ConnectionProtocols, objectRequest _zx.Channel) error {
req_ := &Directory2Open2Request{Path: path, Protocols: protocols, ObjectRequest: objectRequest}
err_ := ((*_bindings.ChannelProxy)(p)).Send(DirectoryOpen2Ordinal, req_)
return err_
}
// Removes a child node from the this directory's list of entries.
//
// Note: this does not guarantee that the underlying object is destroyed.
// 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 closed.
//
// - error `ZX_ERR_ACCESS_DENIED` if the connection does not have
// [`Rights.WRITE_BYTES`].
// - error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
// support writing.
// - error `ZX_ERR_BAD_PATH` if `name` is invalid.
// - error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
// - error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
// containing a remote channel.
// - error `ZX_ERR_NOT_DIR` if the options requested a directory but
// something other than a directory was found.
//
// Other errors may be returned for filesystem-specific reasons.
//
// This method requires the following rights:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.MODIFY_DIRECTORY`]
func (p *DirectoryWithCtxInterface) Unlink(ctx_ _bindings.Context, name string, options UnlinkOptions) (Directory2UnlinkResult, error) {
req_ := &Directory2UnlinkRequest{Name: name, Options: options}
resp_ := &Directory2UnlinkResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryUnlinkOrdinal, req_, resp_)
return (*resp_), err_
}
// Initiates a directory listing operation over the input channel,
// starting at seek offset 0.
//
// This method requires the [`Rights.ENUMERATE`] right. If this right is
// absent, `iterator` will be closed with a `ZX_ERR_ACCESS_DENIED` epitaph.
func (p *DirectoryWithCtxInterface) Enumerate(ctx_ _bindings.Context, options DirectoryEnumerateOptions, iterator DirectoryIteratorWithCtxInterfaceRequest) error {
req_ := &Directory2EnumerateRequest{Options: options, Iterator: iterator}
err_ := ((*_bindings.ChannelProxy)(p)).Send(DirectoryEnumerateOrdinal, req_)
return err_
}
// Renames a node named `src` to the name `dst`, in a directory represented
// by `dst_parent_token`.
//
// `src` and `dst` must be valid node names.
// See [`Name`] for what constitutes a valid name.
//
// This method requires the following rights on both the current connection, and the connection
// identified by `dst_parent_token`:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.MODIFY_DIRECTORY`]
//
// The following requirements are necessary to avoid rights escalations.
//
// If the source and destination directory differ, the source directory must also have the
// maximal set of abilities supported for files, which would typically be
// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
// right.
//
// If `src` refers to a directory, and differs from the destination directory, then the source
// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
//
// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
func (p *DirectoryWithCtxInterface) Rename(ctx_ _bindings.Context, src string, dstParentToken _zx.Event, dst string) (Directory2RenameResult, error) {
req_ := &Directory2RenameRequest{Src: src, DstParentToken: dstParentToken, Dst: dst}
resp_ := &Directory2RenameResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryRenameOrdinal, req_, resp_)
return (*resp_), err_
}
// Creates a symbolic link.
//
// `name` is the name to be given to the created symbolic link.
// `target` is the target of the symbolic link, which has no meaning on the server. The server
// will perform no validation of `target` except for a server chosen maximum length.
// `connection` is an optional server end of a channel that will speak the Symlink protocol
// on the successfully created node.
//
// * [`Rights.MODIFY_DIRECTORY`]
//
// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
func (p *DirectoryWithCtxInterface) CreateSymlink(ctx_ _bindings.Context, name string, target []uint8, connection SymlinkWithCtxInterfaceRequest) (Directory2CreateSymlinkResult, error) {
req_ := &Directory2CreateSymlinkRequest{Name: name, Target: target, Connection: connection}
resp_ := &Directory2CreateSymlinkResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryCreateSymlinkOrdinal, req_, resp_)
return (*resp_), err_
}
type DirectoryWithCtx interface {
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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`).
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error)
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error)
// Query the filesystem for filesystem-specific information.
QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, 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. A trailing slash implies OpenFlags.DIRECTORY. Components
// must not be empty (i.e. "foo//bar" is invalid). ".." is disallowed anywhere in the path. "."
// is only allowed if the path is exactly ".", but not otherwise. A leading '/' is allowed (and
// is treated the same way as if not present, i.e. "/foo/bar' and "foo/bar" are the same).
//
// If an unknown value is sent for flags the connection should be closed.
//
// `OpenFlags.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.
//
// `mode` is ignored.
Open(ctx_ _bindings.Context, flags OpenFlags, mode ModeType, path string, object NodeWithCtxInterfaceRequest) 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.
// Each call to ReadDirents will only return whole dirent structures,
// they will not get split across ReadDirent calls. When the seek
// offset reaches the end, `dirents` will be empty.
//
// 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 `DirentType` 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(ctx_ _bindings.Context, maxBytes uint64) (int32, []uint8, error)
// Resets the directory seek offset.
//
// This method does not require any rights, similar to ReadDirents.
Rewind(ctx_ _bindings.Context) (int32, error)
// Acquires a token to a Directory which can be used to identify access to it at a later point
// in time. The token will remain valid for as long as the connection requesting the token
// remains open.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
GetToken(ctx_ _bindings.Context) (int32, _zx.Handle, 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: `OpenFlags.RIGHT_WRITABLE` and
// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
//
// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
// there are two actors operating concurrently, and one actor performs a rename that affects
// the source within this directory, and the other does a link, each will appear to occur
// atomically in an unspecified order.
Link(ctx_ _bindings.Context, src string, dstParentToken _zx.Handle, dst string) (int32, error)
// Watches a directory, receiving events of added messages on the
// watcher request channel.
//
// Options must be zero; it is reserved.
//
// This method does not require any rights, similar to ReadDirents.
Watch(ctx_ _bindings.Context, mask WatchMask, options uint32, watcher DirectoryWatcherWithCtxInterfaceRequest) (int32, error)
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error)
Query(ctx_ _bindings.Context) ([]uint8, error)
// Creates another connection to the same node.
Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
// Acquires information about the connection.
//
// This method does not require any rights.
GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error)
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// + `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error)
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error)
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
Sync(ctx_ _bindings.Context) (Node2SyncResult, error)
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error)
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error)
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error)
// Acquires an advisory lock on the underlying file.
//
// The lock lasts until either this connection is closed or
// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
// explicitly.
//
// Advisory locks are purely advisory. They do not prevent actual read or
// write operations from occurring on the file, either through this
// connection or through other connections.
//
// This method requires the following rights:
//
// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
// * [`Rights.WRITE_BYTES`] if `request.type` is
// [`AdvisoryLockType.WRITE`].
//
// # Errors
//
// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
// example, another connection might hold a conflicting lock type.
// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
// to acquire the given type of lock.
AdvisoryLock(ctx_ _bindings.Context, request AdvisoryLockRequest) (AdvisoryLockingAdvisoryLockResult, error)
// Opens or creates a new node relative to this directory node.
//
// This method requires the following rights on the current connection:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.TRAVERSE`]
//
// Errors are presented as an epitaph on the `object_request` channel.
//
// * error `ZX_ERR_ACCESS_DENIED` if the requested rights exceeds
// what is allowed.
// * error `ZX_ERR_BAD_PATH` if `path` is invalid.
Open2(ctx_ _bindings.Context, path string, protocols ConnectionProtocols, objectRequest _zx.Channel) error
// Removes a child node from the this directory's list of entries.
//
// Note: this does not guarantee that the underlying object is destroyed.
// 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 closed.
//
// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
// [`Rights.WRITE_BYTES`].
// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
// support writing.
// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
// containing a remote channel.
// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
// something other than a directory was found.
//
// Other errors may be returned for filesystem-specific reasons.
//
// This method requires the following rights:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.MODIFY_DIRECTORY`]
Unlink(ctx_ _bindings.Context, name string, options UnlinkOptions) (Directory2UnlinkResult, error)
// Initiates a directory listing operation over the input channel,
// starting at seek offset 0.
//
// This method requires the [`Rights.ENUMERATE`] right. If this right is
// absent, `iterator` will be closed with a `ZX_ERR_ACCESS_DENIED` epitaph.
Enumerate(ctx_ _bindings.Context, options DirectoryEnumerateOptions, iterator DirectoryIteratorWithCtxInterfaceRequest) error
// Renames a node named `src` to the name `dst`, in a directory represented
// by `dst_parent_token`.
//
// `src` and `dst` must be valid node names.
// See [`Name`] for what constitutes a valid name.
//
// This method requires the following rights on both the current connection, and the connection
// identified by `dst_parent_token`:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.MODIFY_DIRECTORY`]
//
// The following requirements are necessary to avoid rights escalations.
//
// If the source and destination directory differ, the source directory must also have the
// maximal set of abilities supported for files, which would typically be
// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
// right.
//
// If `src` refers to a directory, and differs from the destination directory, then the source
// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
//
// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
Rename(ctx_ _bindings.Context, src string, dstParentToken _zx.Event, dst string) (Directory2RenameResult, error)
// Creates a symbolic link.
//
// `name` is the name to be given to the created symbolic link.
// `target` is the target of the symbolic link, which has no meaning on the server. The server
// will perform no validation of `target` except for a server chosen maximum length.
// `connection` is an optional server end of a channel that will speak the Symlink protocol
// on the successfully created node.
//
// * [`Rights.MODIFY_DIRECTORY`]
//
// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
CreateSymlink(ctx_ _bindings.Context, name string, target []uint8, connection SymlinkWithCtxInterfaceRequest) (Directory2CreateSymlinkResult, error)
}
type DirectoryWithCtxTransitionalBase struct{}
func (_ *DirectoryWithCtxTransitionalBase) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
panic("Not Implemented")
}
func (_ *DirectoryWithCtxTransitionalBase) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *DirectoryWithCtxTransitionalBase) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *DirectoryWithCtxTransitionalBase) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *DirectoryWithCtxTransitionalBase) CreateSymlink(ctx_ _bindings.Context, name string, target []uint8, connection SymlinkWithCtxInterfaceRequest) (Directory2CreateSymlinkResult, error) {
panic("Not Implemented")
}
type DirectoryWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewDirectoryWithCtxInterfaceRequest() (DirectoryWithCtxInterfaceRequest, *DirectoryWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return DirectoryWithCtxInterfaceRequest(req), (*DirectoryWithCtxInterface)(cli), err
}
type DirectoryWithCtxStub struct {
Impl DirectoryWithCtx
}
func (s_ *DirectoryWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case DirectoryCloneOrdinal:
in_ := &Node1CloneRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(args_.Ctx, (*in_).Flags, (*in_).Object)
return nil, false, err_
case DirectoryGetAttrOrdinal:
s, attributes, err_ := s_.Impl.GetAttr(args_.Ctx)
out_ := &Node1GetAttrResponse{S: s, Attributes: attributes}
return out_, true, err_
case DirectorySetAttrOrdinal:
in_ := &Node1SetAttrRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(args_.Ctx, (*in_).Flags, (*in_).Attributes)
out_ := &Node1SetAttrResponse{S: s}
return out_, true, err_
case DirectoryGetFlagsOrdinal:
s, flags, err_ := s_.Impl.GetFlags(args_.Ctx)
out_ := &Node1GetFlagsResponse{S: s, Flags: flags}
return out_, true, err_
case DirectorySetFlagsOrdinal:
in_ := &Node1SetFlagsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetFlags(args_.Ctx, (*in_).Flags)
out_ := &Node1SetFlagsResponse{S: s}
return out_, true, err_
case DirectoryQueryFilesystemOrdinal:
s, info, err_ := s_.Impl.QueryFilesystem(args_.Ctx)
out_ := &Node1QueryFilesystemResponse{S: s, Info: info}
return out_, true, err_
case DirectoryOpenOrdinal:
in_ := &OpenableOpenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Open(args_.Ctx, (*in_).Flags, (*in_).Mode, (*in_).Path, (*in_).Object)
return nil, false, err_
case DirectoryReadDirentsOrdinal:
in_ := &Directory1ReadDirentsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, dirents, err_ := s_.Impl.ReadDirents(args_.Ctx, (*in_).MaxBytes)
out_ := &Directory1ReadDirentsResponse{S: s, Dirents: dirents}
return out_, true, err_
case DirectoryRewindOrdinal:
s, err_ := s_.Impl.Rewind(args_.Ctx)
out_ := &Directory1RewindResponse{S: s}
return out_, true, err_
case DirectoryGetTokenOrdinal:
s, token, err_ := s_.Impl.GetToken(args_.Ctx)
out_ := &Directory1GetTokenResponse{S: s, Token: token}
return out_, true, err_
case DirectoryLinkOrdinal:
in_ := &Directory1LinkRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Link(args_.Ctx, (*in_).Src, (*in_).DstParentToken, (*in_).Dst)
out_ := &Directory1LinkResponse{S: s}
return out_, true, err_
case DirectoryWatchOrdinal:
in_ := &Directory1WatchRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Watch(args_.Ctx, (*in_).Mask, (*in_).Options, (*in_).Watcher)
out_ := &Directory1WatchResponse{S: s}
return out_, true, err_
case DirectoryCloseOrdinal:
payload, err_ := s_.Impl.Close(args_.Ctx)
out_ := &payload
return out_, true, err_
case DirectoryQueryOrdinal:
protocol, err_ := s_.Impl.Query(args_.Ctx)
out_ := &fuchsiaunknown.QueryableQueryResponse{Protocol: protocol}
return out_, true, err_
case DirectoryReopenOrdinal:
in_ := &Node2ReopenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Reopen(args_.Ctx, (*in_).RightsRequest, (*in_).ObjectRequest)
return nil, false, err_
case DirectoryGetConnectionInfoOrdinal:
payload, err_ := s_.Impl.GetConnectionInfo(args_.Ctx)
out_ := &payload
return out_, true, err_
case DirectoryGetAttributesOrdinal:
in_ := &Node2GetAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetAttributes(args_.Ctx, (*in_).Query)
out_ := &payload
return out_, true, err_
case DirectoryUpdateAttributesOrdinal:
in_ := &MutableNodeAttributes{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.UpdateAttributes(args_.Ctx, (*in_))
out_ := &payload
return out_, true, err_
case DirectorySyncOrdinal:
payload, err_ := s_.Impl.Sync(args_.Ctx)
out_ := &payload
return out_, true, err_
case DirectoryListExtendedAttributesOrdinal:
in_ := &Node2ListExtendedAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.ListExtendedAttributes(args_.Ctx, (*in_).Iterator)
return nil, false, err_
case DirectoryGetExtendedAttributeOrdinal:
in_ := &Node2GetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case DirectorySetExtendedAttributeOrdinal:
in_ := &Node2SetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.SetExtendedAttribute(args_.Ctx, (*in_).Name, (*in_).Value, (*in_).Mode)
out_ := &payload
return out_, true, err_
case DirectoryRemoveExtendedAttributeOrdinal:
in_ := &Node2RemoveExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.RemoveExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case DirectoryAdvisoryLockOrdinal:
in_ := &AdvisoryLockingAdvisoryLockRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.AdvisoryLock(args_.Ctx, (*in_).Request)
out_ := &payload
return out_, true, err_
case DirectoryOpen2Ordinal:
in_ := &Directory2Open2Request{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Open2(args_.Ctx, (*in_).Path, (*in_).Protocols, (*in_).ObjectRequest)
return nil, false, err_
case DirectoryUnlinkOrdinal:
in_ := &Directory2UnlinkRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Unlink(args_.Ctx, (*in_).Name, (*in_).Options)
out_ := &payload
return out_, true, err_
case DirectoryEnumerateOrdinal:
in_ := &Directory2EnumerateRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Enumerate(args_.Ctx, (*in_).Options, (*in_).Iterator)
return nil, false, err_
case DirectoryRenameOrdinal:
in_ := &Directory2RenameRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Rename(args_.Ctx, (*in_).Src, (*in_).DstParentToken, (*in_).Dst)
out_ := &payload
return out_, true, err_
case DirectoryCreateSymlinkOrdinal:
in_ := &Directory2CreateSymlinkRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.CreateSymlink(args_.Ctx, (*in_).Name, (*in_).Target, (*in_).Connection)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type DirectoryEventProxy _bindings.ChannelProxy
func (p *DirectoryEventProxy) OnOpen(s int32, info *NodeInfoDeprecated) error {
event_ := &Node1OnOpenRequest{S: s, Info: info}
return ((*_bindings.ChannelProxy)(p)).Send(DirectoryOnOpenOrdinal, event_)
}
func (p *DirectoryEventProxy) OnRepresentation(payload Representation) error {
event_ := &payload
return ((*_bindings.ChannelProxy)(p)).Send(DirectoryOnRepresentationOrdinal, event_)
}
const (
Directory1CloneOrdinal uint64 = 0x5a61678f293ce16f
Directory1OnOpenOrdinal uint64 = 0x7fc7bbb1dbfd1972
Directory1GetAttrOrdinal uint64 = 0x78985e216314dafd
Directory1SetAttrOrdinal uint64 = 0x4186c0f40d938f46
Directory1GetFlagsOrdinal uint64 = 0x5b88fffb8eda3aa1
Directory1SetFlagsOrdinal uint64 = 0x5295b76c71fde733
Directory1QueryFilesystemOrdinal uint64 = 0x6f344a1c6b0a0610
Directory1OpenOrdinal uint64 = 0x2c5044561d685ec0
Directory1ReadDirentsOrdinal uint64 = 0x3582806bf27faa0a
Directory1RewindOrdinal uint64 = 0x16b1202af0f34c71
Directory1GetTokenOrdinal uint64 = 0x26ae9d18763c8655
Directory1LinkOrdinal uint64 = 0x740604c0c7c930e7
Directory1WatchOrdinal uint64 = 0x5717193a59d66d91
)
type Directory1WithCtxInterface _bindings.ChannelProxy
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
func (p *Directory1WithCtxInterface) Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error {
req_ := &Node1CloneRequest{Flags: flags, Object: object}
err_ := ((*_bindings.ChannelProxy)(p)).Send(Directory1CloneOrdinal, req_)
return err_
}
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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 *Directory1WithCtxInterface) ExpectOnOpen(ctx_ _bindings.Context) (int32, *NodeInfoDeprecated, error) {
resp_ := &Node1OnOpenRequest{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(Directory1OnOpenOrdinal, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *Directory1WithCtxInterface) GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &Node1GetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1GetAttrOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Attributes, err_
}
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
func (p *Directory1WithCtxInterface) SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error) {
req_ := &Node1SetAttrRequest{Flags: flags, Attributes: attributes}
resp_ := &Node1SetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1SetAttrOrdinal, req_, resp_)
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 *Directory1WithCtxInterface) GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error) {
var req_ _bindings.Message
resp_ := &Node1GetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1GetFlagsOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Flags, err_
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
func (p *Directory1WithCtxInterface) SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error) {
req_ := &Node1SetFlagsRequest{Flags: flags}
resp_ := &Node1SetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1SetFlagsOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Query the filesystem for filesystem-specific information.
func (p *Directory1WithCtxInterface) QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error) {
var req_ _bindings.Message
resp_ := &Node1QueryFilesystemResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1QueryFilesystemOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Info, 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. A trailing slash implies OpenFlags.DIRECTORY. Components
// must not be empty (i.e. "foo//bar" is invalid). ".." is disallowed anywhere in the path. "."
// is only allowed if the path is exactly ".", but not otherwise. A leading '/' is allowed (and
// is treated the same way as if not present, i.e. "/foo/bar' and "foo/bar" are the same).
//
// If an unknown value is sent for flags the connection should be closed.
//
// `OpenFlags.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.
//
// `mode` is ignored.
func (p *Directory1WithCtxInterface) Open(ctx_ _bindings.Context, flags OpenFlags, mode ModeType, path string, object NodeWithCtxInterfaceRequest) error {
req_ := &OpenableOpenRequest{Flags: flags, Mode: mode, Path: path, Object: object}
err_ := ((*_bindings.ChannelProxy)(p)).Send(Directory1OpenOrdinal, req_)
return 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.
// Each call to ReadDirents will only return whole dirent structures,
// they will not get split across ReadDirent calls. When the seek
// offset reaches the end, `dirents` will be empty.
//
// 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 `DirentType` 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 *Directory1WithCtxInterface) ReadDirents(ctx_ _bindings.Context, maxBytes uint64) (int32, []uint8, error) {
req_ := &Directory1ReadDirentsRequest{MaxBytes: maxBytes}
resp_ := &Directory1ReadDirentsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1ReadDirentsOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Dirents, err_
}
// Resets the directory seek offset.
//
// This method does not require any rights, similar to ReadDirents.
func (p *Directory1WithCtxInterface) Rewind(ctx_ _bindings.Context) (int32, error) {
var req_ _bindings.Message
resp_ := &Directory1RewindResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1RewindOrdinal, req_, resp_)
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. The token will remain valid for as long as the connection requesting the token
// remains open.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
func (p *Directory1WithCtxInterface) GetToken(ctx_ _bindings.Context) (int32, _zx.Handle, error) {
var req_ _bindings.Message
resp_ := &Directory1GetTokenResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1GetTokenOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Token, 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: `OpenFlags.RIGHT_WRITABLE` and
// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
//
// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
// there are two actors operating concurrently, and one actor performs a rename that affects
// the source within this directory, and the other does a link, each will appear to occur
// atomically in an unspecified order.
func (p *Directory1WithCtxInterface) Link(ctx_ _bindings.Context, src string, dstParentToken _zx.Handle, dst string) (int32, error) {
req_ := &Directory1LinkRequest{Src: src, DstParentToken: dstParentToken, Dst: dst}
resp_ := &Directory1LinkResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1LinkOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Watches a directory, receiving events of added messages on the
// watcher request channel.
//
// Options must be zero; it is reserved.
//
// This method does not require any rights, similar to ReadDirents.
func (p *Directory1WithCtxInterface) Watch(ctx_ _bindings.Context, mask WatchMask, options uint32, watcher DirectoryWatcherWithCtxInterfaceRequest) (int32, error) {
req_ := &Directory1WatchRequest{Mask: mask, Options: options, Watcher: watcher}
resp_ := &Directory1WatchResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory1WatchOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Directory defines a node which is capable of containing other Objects.
type Directory1WithCtx interface {
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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`).
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error)
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error)
// Query the filesystem for filesystem-specific information.
QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, 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. A trailing slash implies OpenFlags.DIRECTORY. Components
// must not be empty (i.e. "foo//bar" is invalid). ".." is disallowed anywhere in the path. "."
// is only allowed if the path is exactly ".", but not otherwise. A leading '/' is allowed (and
// is treated the same way as if not present, i.e. "/foo/bar' and "foo/bar" are the same).
//
// If an unknown value is sent for flags the connection should be closed.
//
// `OpenFlags.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.
//
// `mode` is ignored.
Open(ctx_ _bindings.Context, flags OpenFlags, mode ModeType, path string, object NodeWithCtxInterfaceRequest) 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.
// Each call to ReadDirents will only return whole dirent structures,
// they will not get split across ReadDirent calls. When the seek
// offset reaches the end, `dirents` will be empty.
//
// 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 `DirentType` 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(ctx_ _bindings.Context, maxBytes uint64) (int32, []uint8, error)
// Resets the directory seek offset.
//
// This method does not require any rights, similar to ReadDirents.
Rewind(ctx_ _bindings.Context) (int32, error)
// Acquires a token to a Directory which can be used to identify access to it at a later point
// in time. The token will remain valid for as long as the connection requesting the token
// remains open.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
GetToken(ctx_ _bindings.Context) (int32, _zx.Handle, 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: `OpenFlags.RIGHT_WRITABLE` and
// `OpenFlags.RIGHT_READABLE`, otherwise returns `ZX_ERR_BAD_HANDLE`.
//
// This will be atomic with respect to renaming or unlinking the source concurrently e.g. if
// there are two actors operating concurrently, and one actor performs a rename that affects
// the source within this directory, and the other does a link, each will appear to occur
// atomically in an unspecified order.
Link(ctx_ _bindings.Context, src string, dstParentToken _zx.Handle, dst string) (int32, error)
// Watches a directory, receiving events of added messages on the
// watcher request channel.
//
// Options must be zero; it is reserved.
//
// This method does not require any rights, similar to ReadDirents.
Watch(ctx_ _bindings.Context, mask WatchMask, options uint32, watcher DirectoryWatcherWithCtxInterfaceRequest) (int32, error)
}
type Directory1WithCtxTransitionalBase struct{}
type Directory1WithCtxInterfaceRequest _bindings.InterfaceRequest
func NewDirectory1WithCtxInterfaceRequest() (Directory1WithCtxInterfaceRequest, *Directory1WithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return Directory1WithCtxInterfaceRequest(req), (*Directory1WithCtxInterface)(cli), err
}
type Directory1WithCtxStub struct {
Impl Directory1WithCtx
}
func (s_ *Directory1WithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case Directory1CloneOrdinal:
in_ := &Node1CloneRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(args_.Ctx, (*in_).Flags, (*in_).Object)
return nil, false, err_
case Directory1GetAttrOrdinal:
s, attributes, err_ := s_.Impl.GetAttr(args_.Ctx)
out_ := &Node1GetAttrResponse{S: s, Attributes: attributes}
return out_, true, err_
case Directory1SetAttrOrdinal:
in_ := &Node1SetAttrRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(args_.Ctx, (*in_).Flags, (*in_).Attributes)
out_ := &Node1SetAttrResponse{S: s}
return out_, true, err_
case Directory1GetFlagsOrdinal:
s, flags, err_ := s_.Impl.GetFlags(args_.Ctx)
out_ := &Node1GetFlagsResponse{S: s, Flags: flags}
return out_, true, err_
case Directory1SetFlagsOrdinal:
in_ := &Node1SetFlagsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetFlags(args_.Ctx, (*in_).Flags)
out_ := &Node1SetFlagsResponse{S: s}
return out_, true, err_
case Directory1QueryFilesystemOrdinal:
s, info, err_ := s_.Impl.QueryFilesystem(args_.Ctx)
out_ := &Node1QueryFilesystemResponse{S: s, Info: info}
return out_, true, err_
case Directory1OpenOrdinal:
in_ := &OpenableOpenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Open(args_.Ctx, (*in_).Flags, (*in_).Mode, (*in_).Path, (*in_).Object)
return nil, false, err_
case Directory1ReadDirentsOrdinal:
in_ := &Directory1ReadDirentsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, dirents, err_ := s_.Impl.ReadDirents(args_.Ctx, (*in_).MaxBytes)
out_ := &Directory1ReadDirentsResponse{S: s, Dirents: dirents}
return out_, true, err_
case Directory1RewindOrdinal:
s, err_ := s_.Impl.Rewind(args_.Ctx)
out_ := &Directory1RewindResponse{S: s}
return out_, true, err_
case Directory1GetTokenOrdinal:
s, token, err_ := s_.Impl.GetToken(args_.Ctx)
out_ := &Directory1GetTokenResponse{S: s, Token: token}
return out_, true, err_
case Directory1LinkOrdinal:
in_ := &Directory1LinkRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Link(args_.Ctx, (*in_).Src, (*in_).DstParentToken, (*in_).Dst)
out_ := &Directory1LinkResponse{S: s}
return out_, true, err_
case Directory1WatchOrdinal:
in_ := &Directory1WatchRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.Watch(args_.Ctx, (*in_).Mask, (*in_).Options, (*in_).Watcher)
out_ := &Directory1WatchResponse{S: s}
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type Directory1EventProxy _bindings.ChannelProxy
func (p *Directory1EventProxy) OnOpen(s int32, info *NodeInfoDeprecated) error {
event_ := &Node1OnOpenRequest{S: s, Info: info}
return ((*_bindings.ChannelProxy)(p)).Send(Directory1OnOpenOrdinal, event_)
}
const (
Directory2CloseOrdinal uint64 = 0x5ac5d459ad7f657e
Directory2QueryOrdinal uint64 = 0x2658edee9decfc06
Directory2ReopenOrdinal uint64 = 0x6a849ef281d2baa1
Directory2OnRepresentationOrdinal uint64 = 0x5cb40567d80a510c
Directory2GetConnectionInfoOrdinal uint64 = 0x584c377c7c0a6d0b
Directory2GetAttributesOrdinal uint64 = 0x3d4396a638ea053b
Directory2UpdateAttributesOrdinal uint64 = 0x3308c1da5a89bf08
Directory2SyncOrdinal uint64 = 0x2c5c27ca0ab5dc49
Directory2ListExtendedAttributesOrdinal uint64 = 0x4b61033de007fcd0
Directory2GetExtendedAttributeOrdinal uint64 = 0x45ffa3ccfdeb76db
Directory2SetExtendedAttributeOrdinal uint64 = 0x4a951362f681f23c
Directory2RemoveExtendedAttributeOrdinal uint64 = 0x7a0b9f3a9bf9032d
Directory2AdvisoryLockOrdinal uint64 = 0x6ee9c0ad53ec87aa
Directory2Open2Ordinal uint64 = 0x2fbc4fbbff7c54d6
Directory2UnlinkOrdinal uint64 = 0x750a0326a78d7bed
Directory2EnumerateOrdinal uint64 = 0x36a4ca72c332c37d
Directory2RenameOrdinal uint64 = 0x7060e7723b9928de
Directory2CreateSymlinkOrdinal uint64 = 0x21ce0f19ec043889
)
type Directory2WithCtxInterface _bindings.ChannelProxy
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
func (p *Directory2WithCtxInterface) Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.CloseableCloseResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2CloseOrdinal, req_, resp_)
return (*resp_), err_
}
func (p *Directory2WithCtxInterface) Query(ctx_ _bindings.Context) ([]uint8, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.QueryableQueryResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2QueryOrdinal, req_, resp_)
return (*resp_).Protocol, err_
}
// Creates another connection to the same node.
func (p *Directory2WithCtxInterface) Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error {
req_ := &Node2ReopenRequest{RightsRequest: rightsRequest, ObjectRequest: objectRequest}
err_ := ((*_bindings.ChannelProxy)(p)).Send(Directory2ReopenOrdinal, req_)
return err_
}
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
func (p *Directory2WithCtxInterface) ExpectOnRepresentation(ctx_ _bindings.Context) (Representation, error) {
resp_ := &Representation{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(Directory2OnRepresentationOrdinal, resp_)
return (*resp_), err_
}
// Acquires information about the connection.
//
// This method does not require any rights.
func (p *Directory2WithCtxInterface) GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error) {
var req_ _bindings.Message
resp_ := &ConnectionInfo{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2GetConnectionInfoOrdinal, req_, resp_)
return (*resp_), err_
}
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// - `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *Directory2WithCtxInterface) GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error) {
req_ := &Node2GetAttributesRequest{Query: query}
resp_ := &Node2GetAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2GetAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *Directory2WithCtxInterface) UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error) {
req_ := &payload
resp_ := &Node2UpdateAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2UpdateAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
func (p *Directory2WithCtxInterface) Sync(ctx_ _bindings.Context) (Node2SyncResult, error) {
var req_ _bindings.Message
resp_ := &Node2SyncResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2SyncOrdinal, req_, resp_)
return (*resp_), err_
}
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *Directory2WithCtxInterface) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
req_ := &Node2ListExtendedAttributesRequest{Iterator: iterator}
err_ := ((*_bindings.ChannelProxy)(p)).Send(Directory2ListExtendedAttributesOrdinal, req_)
return err_
}
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *Directory2WithCtxInterface) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
req_ := &Node2GetExtendedAttributeRequest{Name: name}
resp_ := &Node2GetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2GetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *Directory2WithCtxInterface) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
req_ := &Node2SetExtendedAttributeRequest{Name: name, Value: value, Mode: mode}
resp_ := &Node2SetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2SetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *Directory2WithCtxInterface) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
req_ := &Node2RemoveExtendedAttributeRequest{Name: name}
resp_ := &Node2RemoveExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2RemoveExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Acquires an advisory lock on the underlying file.
//
// The lock lasts until either this connection is closed or
// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
// explicitly.
//
// Advisory locks are purely advisory. They do not prevent actual read or
// write operations from occurring on the file, either through this
// connection or through other connections.
//
// This method requires the following rights:
//
// - [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
// - [`Rights.WRITE_BYTES`] if `request.type` is
// [`AdvisoryLockType.WRITE`].
//
// # Errors
//
// - `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
// example, another connection might hold a conflicting lock type.
// - `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
// - `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
// to acquire the given type of lock.
func (p *Directory2WithCtxInterface) AdvisoryLock(ctx_ _bindings.Context, request AdvisoryLockRequest) (AdvisoryLockingAdvisoryLockResult, error) {
req_ := &AdvisoryLockingAdvisoryLockRequest{Request: request}
resp_ := &AdvisoryLockingAdvisoryLockResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2AdvisoryLockOrdinal, req_, resp_)
return (*resp_), err_
}
// Opens or creates a new node relative to this directory node.
//
// This method requires the following rights on the current connection:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.TRAVERSE`]
//
// Errors are presented as an epitaph on the `object_request` channel.
//
// - error `ZX_ERR_ACCESS_DENIED` if the requested rights exceeds
// what is allowed.
// - error `ZX_ERR_BAD_PATH` if `path` is invalid.
func (p *Directory2WithCtxInterface) Open2(ctx_ _bindings.Context, path string, protocols ConnectionProtocols, objectRequest _zx.Channel) error {
req_ := &Directory2Open2Request{Path: path, Protocols: protocols, ObjectRequest: objectRequest}
err_ := ((*_bindings.ChannelProxy)(p)).Send(Directory2Open2Ordinal, req_)
return err_
}
// Removes a child node from the this directory's list of entries.
//
// Note: this does not guarantee that the underlying object is destroyed.
// 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 closed.
//
// - error `ZX_ERR_ACCESS_DENIED` if the connection does not have
// [`Rights.WRITE_BYTES`].
// - error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
// support writing.
// - error `ZX_ERR_BAD_PATH` if `name` is invalid.
// - error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
// - error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
// containing a remote channel.
// - error `ZX_ERR_NOT_DIR` if the options requested a directory but
// something other than a directory was found.
//
// Other errors may be returned for filesystem-specific reasons.
//
// This method requires the following rights:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.MODIFY_DIRECTORY`]
func (p *Directory2WithCtxInterface) Unlink(ctx_ _bindings.Context, name string, options UnlinkOptions) (Directory2UnlinkResult, error) {
req_ := &Directory2UnlinkRequest{Name: name, Options: options}
resp_ := &Directory2UnlinkResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2UnlinkOrdinal, req_, resp_)
return (*resp_), err_
}
// Initiates a directory listing operation over the input channel,
// starting at seek offset 0.
//
// This method requires the [`Rights.ENUMERATE`] right. If this right is
// absent, `iterator` will be closed with a `ZX_ERR_ACCESS_DENIED` epitaph.
func (p *Directory2WithCtxInterface) Enumerate(ctx_ _bindings.Context, options DirectoryEnumerateOptions, iterator DirectoryIteratorWithCtxInterfaceRequest) error {
req_ := &Directory2EnumerateRequest{Options: options, Iterator: iterator}
err_ := ((*_bindings.ChannelProxy)(p)).Send(Directory2EnumerateOrdinal, req_)
return err_
}
// Renames a node named `src` to the name `dst`, in a directory represented
// by `dst_parent_token`.
//
// `src` and `dst` must be valid node names.
// See [`Name`] for what constitutes a valid name.
//
// This method requires the following rights on both the current connection, and the connection
// identified by `dst_parent_token`:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.MODIFY_DIRECTORY`]
//
// The following requirements are necessary to avoid rights escalations.
//
// If the source and destination directory differ, the source directory must also have the
// maximal set of abilities supported for files, which would typically be
// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
// right.
//
// If `src` refers to a directory, and differs from the destination directory, then the source
// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
//
// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
func (p *Directory2WithCtxInterface) Rename(ctx_ _bindings.Context, src string, dstParentToken _zx.Event, dst string) (Directory2RenameResult, error) {
req_ := &Directory2RenameRequest{Src: src, DstParentToken: dstParentToken, Dst: dst}
resp_ := &Directory2RenameResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2RenameOrdinal, req_, resp_)
return (*resp_), err_
}
// Creates a symbolic link.
//
// `name` is the name to be given to the created symbolic link.
// `target` is the target of the symbolic link, which has no meaning on the server. The server
// will perform no validation of `target` except for a server chosen maximum length.
// `connection` is an optional server end of a channel that will speak the Symlink protocol
// on the successfully created node.
//
// * [`Rights.MODIFY_DIRECTORY`]
//
// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
func (p *Directory2WithCtxInterface) CreateSymlink(ctx_ _bindings.Context, name string, target []uint8, connection SymlinkWithCtxInterfaceRequest) (Directory2CreateSymlinkResult, error) {
req_ := &Directory2CreateSymlinkRequest{Name: name, Target: target, Connection: connection}
resp_ := &Directory2CreateSymlinkResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Directory2CreateSymlinkOrdinal, req_, resp_)
return (*resp_), err_
}
// A [`Node2`] that is capable of containing other nodes.
type Directory2WithCtx interface {
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error)
Query(ctx_ _bindings.Context) ([]uint8, error)
// Creates another connection to the same node.
Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
// Acquires information about the connection.
//
// This method does not require any rights.
GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error)
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// + `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error)
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error)
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
Sync(ctx_ _bindings.Context) (Node2SyncResult, error)
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error)
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error)
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error)
// Acquires an advisory lock on the underlying file.
//
// The lock lasts until either this connection is closed or
// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
// explicitly.
//
// Advisory locks are purely advisory. They do not prevent actual read or
// write operations from occurring on the file, either through this
// connection or through other connections.
//
// This method requires the following rights:
//
// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
// * [`Rights.WRITE_BYTES`] if `request.type` is
// [`AdvisoryLockType.WRITE`].
//
// # Errors
//
// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
// example, another connection might hold a conflicting lock type.
// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
// to acquire the given type of lock.
AdvisoryLock(ctx_ _bindings.Context, request AdvisoryLockRequest) (AdvisoryLockingAdvisoryLockResult, error)
// Opens or creates a new node relative to this directory node.
//
// This method requires the following rights on the current connection:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.TRAVERSE`]
//
// Errors are presented as an epitaph on the `object_request` channel.
//
// * error `ZX_ERR_ACCESS_DENIED` if the requested rights exceeds
// what is allowed.
// * error `ZX_ERR_BAD_PATH` if `path` is invalid.
Open2(ctx_ _bindings.Context, path string, protocols ConnectionProtocols, objectRequest _zx.Channel) error
// Removes a child node from the this directory's list of entries.
//
// Note: this does not guarantee that the underlying object is destroyed.
// 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 closed.
//
// * error `ZX_ERR_ACCESS_DENIED` if the connection does not have
// [`Rights.WRITE_BYTES`].
// * error `ZX_ERR_NOT_SUPPORTED` if the underlying filesystem does not
// support writing.
// * error `ZX_ERR_BAD_PATH` if `name` is invalid.
// * error `ZX_ERR_NOT_EMPTY` if `name` refers to a non-empty directory.
// * error `ZX_ERR_UNAVAILABLE` if `name` refers to a mount point,
// containing a remote channel.
// * error `ZX_ERR_NOT_DIR` if the options requested a directory but
// something other than a directory was found.
//
// Other errors may be returned for filesystem-specific reasons.
//
// This method requires the following rights:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.MODIFY_DIRECTORY`]
Unlink(ctx_ _bindings.Context, name string, options UnlinkOptions) (Directory2UnlinkResult, error)
// Initiates a directory listing operation over the input channel,
// starting at seek offset 0.
//
// This method requires the [`Rights.ENUMERATE`] right. If this right is
// absent, `iterator` will be closed with a `ZX_ERR_ACCESS_DENIED` epitaph.
Enumerate(ctx_ _bindings.Context, options DirectoryEnumerateOptions, iterator DirectoryIteratorWithCtxInterfaceRequest) error
// Renames a node named `src` to the name `dst`, in a directory represented
// by `dst_parent_token`.
//
// `src` and `dst` must be valid node names.
// See [`Name`] for what constitutes a valid name.
//
// This method requires the following rights on both the current connection, and the connection
// identified by `dst_parent_token`:
//
// * [`Rights.ENUMERATE`]
// * [`Rights.MODIFY_DIRECTORY`]
//
// The following requirements are necessary to avoid rights escalations.
//
// If the source and destination directory differ, the source directory must also have the
// maximal set of abilities supported for files, which would typically be
// [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`], [`Rights.GET_ATTRIBUTES`] and
// [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also support the [`Rights.EXECUTE`]
// right.
//
// If `src` refers to a directory, and differs from the destination directory, then the source
// directory must have also have the [`Rights.CONNECT`] and [`Rights.TRAVERSE`] rights.
//
// * error `ZX_ERR_INVALID_ARGS` if `src` or `dst` is invalid.
// * error `ZX_ERR_ACCESS_DENIED` for insufficient rights.
Rename(ctx_ _bindings.Context, src string, dstParentToken _zx.Event, dst string) (Directory2RenameResult, error)
// Creates a symbolic link.
//
// `name` is the name to be given to the created symbolic link.
// `target` is the target of the symbolic link, which has no meaning on the server. The server
// will perform no validation of `target` except for a server chosen maximum length.
// `connection` is an optional server end of a channel that will speak the Symlink protocol
// on the successfully created node.
//
// * [`Rights.MODIFY_DIRECTORY`]
//
// * error `ZX_ERR_ALREADY_EXISTS` if `name` already exists.
// * error `ZX_ERR_BAD_PATH` if `target` exceeds the server length limit for symbolic links.
// * error `ZX_ERR_INVALID_ARGS` if `name` is not a valid [`Name`].
// * error `ZX_ERR_NOT_SUPPORTED` if creating symbolic links is not supported by the server.
CreateSymlink(ctx_ _bindings.Context, name string, target []uint8, connection SymlinkWithCtxInterfaceRequest) (Directory2CreateSymlinkResult, error)
}
type Directory2WithCtxTransitionalBase struct{}
func (_ *Directory2WithCtxTransitionalBase) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
panic("Not Implemented")
}
func (_ *Directory2WithCtxTransitionalBase) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *Directory2WithCtxTransitionalBase) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *Directory2WithCtxTransitionalBase) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *Directory2WithCtxTransitionalBase) CreateSymlink(ctx_ _bindings.Context, name string, target []uint8, connection SymlinkWithCtxInterfaceRequest) (Directory2CreateSymlinkResult, error) {
panic("Not Implemented")
}
type Directory2WithCtxInterfaceRequest _bindings.InterfaceRequest
func NewDirectory2WithCtxInterfaceRequest() (Directory2WithCtxInterfaceRequest, *Directory2WithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return Directory2WithCtxInterfaceRequest(req), (*Directory2WithCtxInterface)(cli), err
}
type Directory2WithCtxStub struct {
Impl Directory2WithCtx
}
func (s_ *Directory2WithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case Directory2CloseOrdinal:
payload, err_ := s_.Impl.Close(args_.Ctx)
out_ := &payload
return out_, true, err_
case Directory2QueryOrdinal:
protocol, err_ := s_.Impl.Query(args_.Ctx)
out_ := &fuchsiaunknown.QueryableQueryResponse{Protocol: protocol}
return out_, true, err_
case Directory2ReopenOrdinal:
in_ := &Node2ReopenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Reopen(args_.Ctx, (*in_).RightsRequest, (*in_).ObjectRequest)
return nil, false, err_
case Directory2GetConnectionInfoOrdinal:
payload, err_ := s_.Impl.GetConnectionInfo(args_.Ctx)
out_ := &payload
return out_, true, err_
case Directory2GetAttributesOrdinal:
in_ := &Node2GetAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetAttributes(args_.Ctx, (*in_).Query)
out_ := &payload
return out_, true, err_
case Directory2UpdateAttributesOrdinal:
in_ := &MutableNodeAttributes{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.UpdateAttributes(args_.Ctx, (*in_))
out_ := &payload
return out_, true, err_
case Directory2SyncOrdinal:
payload, err_ := s_.Impl.Sync(args_.Ctx)
out_ := &payload
return out_, true, err_
case Directory2ListExtendedAttributesOrdinal:
in_ := &Node2ListExtendedAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.ListExtendedAttributes(args_.Ctx, (*in_).Iterator)
return nil, false, err_
case Directory2GetExtendedAttributeOrdinal:
in_ := &Node2GetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case Directory2SetExtendedAttributeOrdinal:
in_ := &Node2SetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.SetExtendedAttribute(args_.Ctx, (*in_).Name, (*in_).Value, (*in_).Mode)
out_ := &payload
return out_, true, err_
case Directory2RemoveExtendedAttributeOrdinal:
in_ := &Node2RemoveExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.RemoveExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case Directory2AdvisoryLockOrdinal:
in_ := &AdvisoryLockingAdvisoryLockRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.AdvisoryLock(args_.Ctx, (*in_).Request)
out_ := &payload
return out_, true, err_
case Directory2Open2Ordinal:
in_ := &Directory2Open2Request{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Open2(args_.Ctx, (*in_).Path, (*in_).Protocols, (*in_).ObjectRequest)
return nil, false, err_
case Directory2UnlinkOrdinal:
in_ := &Directory2UnlinkRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Unlink(args_.Ctx, (*in_).Name, (*in_).Options)
out_ := &payload
return out_, true, err_
case Directory2EnumerateOrdinal:
in_ := &Directory2EnumerateRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Enumerate(args_.Ctx, (*in_).Options, (*in_).Iterator)
return nil, false, err_
case Directory2RenameOrdinal:
in_ := &Directory2RenameRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Rename(args_.Ctx, (*in_).Src, (*in_).DstParentToken, (*in_).Dst)
out_ := &payload
return out_, true, err_
case Directory2CreateSymlinkOrdinal:
in_ := &Directory2CreateSymlinkRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.CreateSymlink(args_.Ctx, (*in_).Name, (*in_).Target, (*in_).Connection)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type Directory2EventProxy _bindings.ChannelProxy
func (p *Directory2EventProxy) OnRepresentation(payload Representation) error {
event_ := &payload
return ((*_bindings.ChannelProxy)(p)).Send(Directory2OnRepresentationOrdinal, event_)
}
const (
DirectoryIteratorGetNextOrdinal uint64 = 0x3c70af7d00d750eb
)
type DirectoryIteratorWithCtxInterface _bindings.ChannelProxy
// Reads a collection of variably sized directory entries into a buffer.
//
// The number of entries 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 `Enumerate`.
// The caller should always use a receiving buffer size as large as the
// maximum channel limit.
//
// When the end of iteration is reached, the returned `entries` vector
// will be empty.
//
// This method does not require any rights, as the rights are checked
// in the [`Directory.Enumerate`] call.
func (p *DirectoryIteratorWithCtxInterface) GetNext(ctx_ _bindings.Context) (DirectoryIteratorGetNextResult, error) {
var req_ _bindings.Message
resp_ := &DirectoryIteratorGetNextResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(DirectoryIteratorGetNextOrdinal, req_, resp_)
return (*resp_), err_
}
type DirectoryIteratorWithCtx interface {
// Reads a collection of variably sized directory entries into a buffer.
//
// The number of entries 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 `Enumerate`.
// The caller should always use a receiving buffer size as large as the
// maximum channel limit.
//
// When the end of iteration is reached, the returned `entries` vector
// will be empty.
//
// This method does not require any rights, as the rights are checked
// in the [`Directory.Enumerate`] call.
GetNext(ctx_ _bindings.Context) (DirectoryIteratorGetNextResult, error)
}
type DirectoryIteratorWithCtxTransitionalBase struct{}
type DirectoryIteratorWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewDirectoryIteratorWithCtxInterfaceRequest() (DirectoryIteratorWithCtxInterfaceRequest, *DirectoryIteratorWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return DirectoryIteratorWithCtxInterfaceRequest(req), (*DirectoryIteratorWithCtxInterface)(cli), err
}
type DirectoryIteratorWithCtxStub struct {
Impl DirectoryIteratorWithCtx
}
func (s_ *DirectoryIteratorWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case DirectoryIteratorGetNextOrdinal:
payload, err_ := s_.Impl.GetNext(args_.Ctx)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type DirectoryIteratorEventProxy _bindings.ChannelProxy
type DirectoryWatcherWithCtxInterface _bindings.ChannelProxy
// 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.
//
// The DirectoryWatcher will send messages of the form:
// ```
//
// struct {
// uint8 event;
// uint8 len;
// char name[];
// };
//
// ```
// Where names are NOT null-terminated. The name is the relative
// path to the entry the event is refering to. It will be empty if
// the event isn't referencing a particular entry (e.g. for the
// `IDLE` event).
type DirectoryWatcherWithCtx interface {
}
type DirectoryWatcherWithCtxTransitionalBase struct{}
type DirectoryWatcherWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewDirectoryWatcherWithCtxInterfaceRequest() (DirectoryWatcherWithCtxInterfaceRequest, *DirectoryWatcherWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return DirectoryWatcherWithCtxInterfaceRequest(req), (*DirectoryWatcherWithCtxInterface)(cli), err
}
type DirectoryWatcherWithCtxStub struct {
Impl DirectoryWatcherWithCtx
}
func (s_ *DirectoryWatcherWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type DirectoryWatcherEventProxy _bindings.ChannelProxy
const (
ExtendedAttributeIteratorGetNextOrdinal uint64 = 0x3ba664a1c2e45a7
)
type ExtendedAttributeIteratorWithCtxInterface _bindings.ChannelProxy
// Get the next chunk of extended attribute names. If this is the last
// chunk, last will be true, and the channel will be closed after the
// call.
func (p *ExtendedAttributeIteratorWithCtxInterface) GetNext(ctx_ _bindings.Context) (ExtendedAttributeIteratorGetNextResult, error) {
var req_ _bindings.Message
resp_ := &ExtendedAttributeIteratorGetNextResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(ExtendedAttributeIteratorGetNextOrdinal, req_, resp_)
return (*resp_), err_
}
type ExtendedAttributeIteratorWithCtx interface {
// Get the next chunk of extended attribute names. If this is the last
// chunk, last will be true, and the channel will be closed after the
// call.
GetNext(ctx_ _bindings.Context) (ExtendedAttributeIteratorGetNextResult, error)
}
type ExtendedAttributeIteratorWithCtxTransitionalBase struct{}
type ExtendedAttributeIteratorWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewExtendedAttributeIteratorWithCtxInterfaceRequest() (ExtendedAttributeIteratorWithCtxInterfaceRequest, *ExtendedAttributeIteratorWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return ExtendedAttributeIteratorWithCtxInterfaceRequest(req), (*ExtendedAttributeIteratorWithCtxInterface)(cli), err
}
type ExtendedAttributeIteratorWithCtxStub struct {
Impl ExtendedAttributeIteratorWithCtx
}
func (s_ *ExtendedAttributeIteratorWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case ExtendedAttributeIteratorGetNextOrdinal:
payload, err_ := s_.Impl.GetNext(args_.Ctx)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type ExtendedAttributeIteratorEventProxy _bindings.ChannelProxy
const (
FileAdvisoryLockOrdinal uint64 = 0x6ee9c0ad53ec87aa
FileLinkIntoOrdinal uint64 = 0x54f3949246a03e74
FileCloneOrdinal uint64 = 0x5a61678f293ce16f
FileOnOpenOrdinal uint64 = 0x7fc7bbb1dbfd1972
FileGetAttrOrdinal uint64 = 0x78985e216314dafd
FileSetAttrOrdinal uint64 = 0x4186c0f40d938f46
FileGetFlagsOrdinal uint64 = 0x5b88fffb8eda3aa1
FileSetFlagsOrdinal uint64 = 0x5295b76c71fde733
FileQueryFilesystemOrdinal uint64 = 0x6f344a1c6b0a0610
FileCloseOrdinal uint64 = 0x5ac5d459ad7f657e
FileQueryOrdinal uint64 = 0x2658edee9decfc06
FileReopenOrdinal uint64 = 0x6a849ef281d2baa1
FileOnRepresentationOrdinal uint64 = 0x5cb40567d80a510c
FileGetConnectionInfoOrdinal uint64 = 0x584c377c7c0a6d0b
FileGetAttributesOrdinal uint64 = 0x3d4396a638ea053b
FileUpdateAttributesOrdinal uint64 = 0x3308c1da5a89bf08
FileSyncOrdinal uint64 = 0x2c5c27ca0ab5dc49
FileListExtendedAttributesOrdinal uint64 = 0x4b61033de007fcd0
FileGetExtendedAttributeOrdinal uint64 = 0x45ffa3ccfdeb76db
FileSetExtendedAttributeOrdinal uint64 = 0x4a951362f681f23c
FileRemoveExtendedAttributeOrdinal uint64 = 0x7a0b9f3a9bf9032d
FileReadOrdinal uint64 = 0x57e419a298c8ede
FileWriteOrdinal uint64 = 0x6a31437832469f82
FileDescribeOrdinal uint64 = 0x68b5ac00c62906bc
FileSeekOrdinal uint64 = 0x78079168162c5207
FileReadAtOrdinal uint64 = 0x1607a293a60d723e
FileWriteAtOrdinal uint64 = 0x793eefc0045e792b
FileResizeOrdinal uint64 = 0x2b80825f0535743a
FileGetBackingMemoryOrdinal uint64 = 0xa6a9e654cbf62b
FileAllocateOrdinal uint64 = 0x77fa0c330b57fd2e
FileEnableVerityOrdinal uint64 = 0x2c421ec3faaeb8bb
)
type FileWithCtxInterface _bindings.ChannelProxy
// Acquires an advisory lock on the underlying file.
//
// The lock lasts until either this connection is closed or
// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
// explicitly.
//
// Advisory locks are purely advisory. They do not prevent actual read or
// write operations from occurring on the file, either through this
// connection or through other connections.
//
// This method requires the following rights:
//
// - [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
// - [`Rights.WRITE_BYTES`] if `request.type` is
// [`AdvisoryLockType.WRITE`].
//
// # Errors
//
// - `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
// example, another connection might hold a conflicting lock type.
// - `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
// - `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
// to acquire the given type of lock.
func (p *FileWithCtxInterface) AdvisoryLock(ctx_ _bindings.Context, request AdvisoryLockRequest) (AdvisoryLockingAdvisoryLockResult, error) {
req_ := &AdvisoryLockingAdvisoryLockRequest{Request: request}
resp_ := &AdvisoryLockingAdvisoryLockResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileAdvisoryLockOrdinal, req_, resp_)
return (*resp_), err_
}
// Creates a link to this this object with name `dst` in the directory represented by
// `dst_parent_token`.
//
// `dst` must be a resolved object name. Including "/" in the string will return
// `ZX_ERR_INVALID_ARGS`.
//
// This method requires the maximal set of rights supported by the filesystem for this object.
// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
// `ZX_ERR_ACCESS_DENIED`.
//
// If this object has no links, it will fail with `ZX_ERR_NOT_FOUND`.
//
// This method does not have the same atomicity properties has the `Directory::Link` method,
// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
// because `LinkInto` will not prevent the source from being renamed or unlinked.
func (p *FileWithCtxInterface) LinkInto(ctx_ _bindings.Context, dstParentToken _zx.Event, dst string) (LinkableLinkIntoResult, error) {
req_ := &LinkableLinkIntoRequest{DstParentToken: dstParentToken, Dst: dst}
resp_ := &LinkableLinkIntoResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileLinkIntoOrdinal, req_, resp_)
return (*resp_), err_
}
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
func (p *FileWithCtxInterface) Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error {
req_ := &Node1CloneRequest{Flags: flags, Object: object}
err_ := ((*_bindings.ChannelProxy)(p)).Send(FileCloneOrdinal, req_)
return err_
}
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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 *FileWithCtxInterface) ExpectOnOpen(ctx_ _bindings.Context) (int32, *NodeInfoDeprecated, error) {
resp_ := &Node1OnOpenRequest{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(FileOnOpenOrdinal, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *FileWithCtxInterface) GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &Node1GetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileGetAttrOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Attributes, err_
}
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
func (p *FileWithCtxInterface) SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error) {
req_ := &Node1SetAttrRequest{Flags: flags, Attributes: attributes}
resp_ := &Node1SetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileSetAttrOrdinal, req_, resp_)
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 *FileWithCtxInterface) GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error) {
var req_ _bindings.Message
resp_ := &Node1GetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileGetFlagsOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Flags, err_
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
func (p *FileWithCtxInterface) SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error) {
req_ := &Node1SetFlagsRequest{Flags: flags}
resp_ := &Node1SetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileSetFlagsOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Query the filesystem for filesystem-specific information.
func (p *FileWithCtxInterface) QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error) {
var req_ _bindings.Message
resp_ := &Node1QueryFilesystemResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileQueryFilesystemOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
func (p *FileWithCtxInterface) Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.CloseableCloseResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileCloseOrdinal, req_, resp_)
return (*resp_), err_
}
func (p *FileWithCtxInterface) Query(ctx_ _bindings.Context) ([]uint8, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.QueryableQueryResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileQueryOrdinal, req_, resp_)
return (*resp_).Protocol, err_
}
// Creates another connection to the same node.
func (p *FileWithCtxInterface) Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error {
req_ := &Node2ReopenRequest{RightsRequest: rightsRequest, ObjectRequest: objectRequest}
err_ := ((*_bindings.ChannelProxy)(p)).Send(FileReopenOrdinal, req_)
return err_
}
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
func (p *FileWithCtxInterface) ExpectOnRepresentation(ctx_ _bindings.Context) (Representation, error) {
resp_ := &Representation{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(FileOnRepresentationOrdinal, resp_)
return (*resp_), err_
}
// Acquires information about the connection.
//
// This method does not require any rights.
func (p *FileWithCtxInterface) GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error) {
var req_ _bindings.Message
resp_ := &ConnectionInfo{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileGetConnectionInfoOrdinal, req_, resp_)
return (*resp_), err_
}
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// - `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *FileWithCtxInterface) GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error) {
req_ := &Node2GetAttributesRequest{Query: query}
resp_ := &Node2GetAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileGetAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *FileWithCtxInterface) UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error) {
req_ := &payload
resp_ := &Node2UpdateAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileUpdateAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
func (p *FileWithCtxInterface) Sync(ctx_ _bindings.Context) (Node2SyncResult, error) {
var req_ _bindings.Message
resp_ := &Node2SyncResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileSyncOrdinal, req_, resp_)
return (*resp_), err_
}
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *FileWithCtxInterface) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
req_ := &Node2ListExtendedAttributesRequest{Iterator: iterator}
err_ := ((*_bindings.ChannelProxy)(p)).Send(FileListExtendedAttributesOrdinal, req_)
return err_
}
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *FileWithCtxInterface) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
req_ := &Node2GetExtendedAttributeRequest{Name: name}
resp_ := &Node2GetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileGetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *FileWithCtxInterface) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
req_ := &Node2SetExtendedAttributeRequest{Name: name, Value: value, Mode: mode}
resp_ := &Node2SetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileSetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *FileWithCtxInterface) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
req_ := &Node2RemoveExtendedAttributeRequest{Name: name}
resp_ := &Node2RemoveExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileRemoveExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Reads up to 'count' bytes at the seek offset.
// The seek offset is moved forward by the number of bytes read.
//
// ## Invariants
//
// - The returned `data.length` will never be greater than `count`.
// - If `data.length` is less than `count`, it means that the seek offset
// has reached the end of file as part of this operation.
// - If `data.length` is zero while `count` is not, it means that the
// seek offset is already at or beyond the end of file, and no data could
// be read.
// - If `count` is zero, the server should perform all the checks ensuring
// read access without actually read anything, and return an empty
// `data` vector.
//
// This method requires the [`Rights.READ_BYTES`] right.
//
// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
func (p *FileWithCtxInterface) Read(ctx_ _bindings.Context, count uint64) (ReadableReadResult, error) {
req_ := &ReadableReadRequest{Count: count}
resp_ := &ReadableReadResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileReadOrdinal, req_, resp_)
return (*resp_), err_
}
// Writes data at the seek offset.
// The seek offset is moved forward by the number of bytes written.
// If the file is in append mode, the seek offset is first set to the end
// of the file, followed by the write, in one atomic step.
//
// The file size may grow if the seek offset plus `data.length` is beyond
// the current end of file.
//
// + request `data` the byte buffer to write to the file.
// - response `actual_count` the number of bytes written.
//
// ## Invariants
//
// - The returned `actual_count` will never be greater than `data.length`.
// - If the server is unable to write all the data due to e.g. not enough
// space, `actual_count` may be less than `data.length`. If no bytes
// could be written, an error is returned.
// - If `data.length` is zero, the server should perform all the checks
// ensuring write access without mutating the file and return a
// successful write of zero bytes. The seek offset is still updated if
// in append mode.
//
// This method requires the [`Rights.WRITE_BYTES`] right.
func (p *FileWithCtxInterface) Write(ctx_ _bindings.Context, data []uint8) (WritableWriteResult, error) {
req_ := &WritableWriteRequest{Data: data}
resp_ := &WritableWriteResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileWriteOrdinal, req_, resp_)
return (*resp_), err_
}
func (p *FileWithCtxInterface) Describe(ctx_ _bindings.Context) (FileInfo, error) {
var req_ _bindings.Message
resp_ := &FileInfo{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileDescribeOrdinal, req_, resp_)
return (*resp_), err_
}
// Moves the offset at which the next invocation of [`Read`] or [`Write`]
// will occur. The seek offset is specific to each file connection.
//
// - request `origin` the reference point where `offset` will be based on.
// - request `offset` the number of bytes to seek.
// - response `offset_from_start` the adjusted seek offset, from the start
// of the file.
//
// This method does not require any rights.
func (p *FileWithCtxInterface) Seek(ctx_ _bindings.Context, origin SeekOrigin, offset int64) (FileSeekResult, error) {
req_ := &FileSeekRequest{Origin: origin, Offset: offset}
resp_ := &FileSeekResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileSeekOrdinal, req_, resp_)
return (*resp_), err_
}
// Reads up to 'count' bytes at the provided offset.
// Does not affect the seek offset.
//
// ## Invariants
//
// - The returned `data.length` will never be greater than `count`.
// - If `data.length` is less than `count`, it means that `ReadAt` has hit
// the end of file as part of this operation.
// - If `data.length` is zero while `count` is not, it means that `offset`
// is at or past the end of file, and no data can be read.
// - If `count` is zero, the server should perform all the checks ensuring
// read access without actually reading anything, and return an empty
// `data` vector.
//
// This method requires the [`Rights.READ_BYTES`] right.
//
// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
func (p *FileWithCtxInterface) ReadAt(ctx_ _bindings.Context, count uint64, offset uint64) (FileReadAtResult, error) {
req_ := &FileReadAtRequest{Count: count, Offset: offset}
resp_ := &FileReadAtResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileReadAtOrdinal, req_, resp_)
return (*resp_), err_
}
// Writes data at the provided offset.
// Does not affect the seek offset.
//
// The file size may grow if `offset` plus `data.length` is past the
// current end of file.
//
// + request `data` the byte buffer to write to the file.
// + request `offset` the offset from start of the file to begin writing.
// - response `actual_count` the number of bytes written.
//
// ## Invariants
//
// - The returned `actual_count` will never be greater than `data.length`.
// - If the server is unable to write all the data due to e.g. not enough
// space, `actual_count` may be less than `data.length`. If no bytes
// could be written, an error is returned.
// - If `data.length` is zero, the server should perform all the checks
// ensuring write access without mutating the file, and will return a
// successful write of zero bytes.
//
// This method requires the [`Rights.WRITE_BYTES`] right.
func (p *FileWithCtxInterface) WriteAt(ctx_ _bindings.Context, data []uint8, offset uint64) (FileWriteAtResult, error) {
req_ := &FileWriteAtRequest{Data: data, Offset: offset}
resp_ := &FileWriteAtResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileWriteAtOrdinal, req_, resp_)
return (*resp_), err_
}
// Shrinks or grows the file size to 'length' bytes.
//
// If file size is reduced by this operation, the extra trailing data'
// is discarded.
// If file size is increased by this operation, the extended area appears
// as if it was zeroed.
//
// This method requires the [`Rights.WRITE_BYTES`] right.
func (p *FileWithCtxInterface) Resize(ctx_ _bindings.Context, length uint64) (FileResizeResult, error) {
req_ := &FileResizeRequest{Length: length}
resp_ := &FileResizeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileResizeOrdinal, req_, resp_)
return (*resp_), err_
}
// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
// with the requested access rights.
//
// Implementations are not required to implement files backed by VMOs so
// this request may fail. Additionally, implementations may only support
// a certain subset of the flags. Clients should be prepared with fallback
// behavior if this request fails.
//
// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
// implementation is free to choose the semantics of the returned VMO.
//
// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
// - response `vmo` the requested [`zx.Handle:VMO`].
// * error a [`zx.Status`] value indicating the failure.
//
// This method requires the following rights:
//
// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
func (p *FileWithCtxInterface) GetBackingMemory(ctx_ _bindings.Context, flags VmoFlags) (FileGetBackingMemoryResult, error) {
req_ := &FileGetBackingMemoryRequest{Flags: flags}
resp_ := &FileGetBackingMemoryResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileGetBackingMemoryOrdinal, req_, resp_)
return (*resp_), err_
}
// Pre-allocate on-disk space for this file.
func (p *FileWithCtxInterface) Allocate(ctx_ _bindings.Context, offset uint64, length uint64, mode AllocateMode) (FileAllocateResult, error) {
req_ := &FileAllocateRequest{Offset: offset, Length: length, Mode: mode}
resp_ := &FileAllocateResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileAllocateOrdinal, req_, resp_)
return (*resp_), err_
}
// Enables verification for the file (permanently) which involves computing a merkle tree for
// the file. Forces a flush prior to building the merkle tree to ensure cached data is
// captured. Future reads will be verified against the computed merkle tree and writes will be
// rejected. This method can take some time to complete as it depends on the size of the file.
// This method can be aborted by closing the connection that this method was issued on.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
// Also returns any error that might arise from reading the file, or from flushing the file,
// such as `ZX_ERR_IO`.
func (p *FileWithCtxInterface) EnableVerity(ctx_ _bindings.Context, options VerificationOptions) (FileEnableVerityResult, error) {
req_ := &FileEnableVerityRequest{Options: options}
resp_ := &FileEnableVerityResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(FileEnableVerityOrdinal, req_, resp_)
return (*resp_), err_
}
// A [`Node`] which contains a sequence of bytes of definite length.
//
// NOTE: cloned connections do not share their seek offset with their source
// connection.
type FileWithCtx interface {
// Acquires an advisory lock on the underlying file.
//
// The lock lasts until either this connection is closed or
// this method is called with |AdvisoryLockType.UNLOCK| to release the lock
// explicitly.
//
// Advisory locks are purely advisory. They do not prevent actual read or
// write operations from occurring on the file, either through this
// connection or through other connections.
//
// This method requires the following rights:
//
// * [`Rights.READ_BYTES`] if `request.type` is [`AdvisoryLockType.READ`].
// * [`Rights.WRITE_BYTES`] if `request.type` is
// [`AdvisoryLockType.WRITE`].
//
// # Errors
//
// * `ZX_ERR_BAD_STATE` The specified type of lock cannot be acquired. For
// example, another connection might hold a conflicting lock type.
// * `ZX_ERR_NOT_SUPPORTED` This file does not support advisory locking.
// * `ZX_ERR_ACCESS_DENIED` This connection does not have sufficient rights
// to acquire the given type of lock.
AdvisoryLock(ctx_ _bindings.Context, request AdvisoryLockRequest) (AdvisoryLockingAdvisoryLockResult, error)
// Creates a link to this this object with name `dst` in the directory represented by
// `dst_parent_token`.
//
// `dst` must be a resolved object name. Including "/" in the string will return
// `ZX_ERR_INVALID_ARGS`.
//
// This method requires the maximal set of rights supported by the filesystem for this object.
// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
// `ZX_ERR_ACCESS_DENIED`.
//
// If this object has no links, it will fail with `ZX_ERR_NOT_FOUND`.
//
// This method does not have the same atomicity properties has the `Directory::Link` method,
// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
// because `LinkInto` will not prevent the source from being renamed or unlinked.
LinkInto(ctx_ _bindings.Context, dstParentToken _zx.Event, dst string) (LinkableLinkIntoResult, error)
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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`).
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error)
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error)
// Query the filesystem for filesystem-specific information.
QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error)
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error)
Query(ctx_ _bindings.Context) ([]uint8, error)
// Creates another connection to the same node.
Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
// Acquires information about the connection.
//
// This method does not require any rights.
GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error)
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// + `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error)
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error)
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
Sync(ctx_ _bindings.Context) (Node2SyncResult, error)
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error)
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error)
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error)
// Reads up to 'count' bytes at the seek offset.
// The seek offset is moved forward by the number of bytes read.
//
// ## Invariants
//
// * The returned `data.length` will never be greater than `count`.
// * If `data.length` is less than `count`, it means that the seek offset
// has reached the end of file as part of this operation.
// * If `data.length` is zero while `count` is not, it means that the
// seek offset is already at or beyond the end of file, and no data could
// be read.
// * If `count` is zero, the server should perform all the checks ensuring
// read access without actually read anything, and return an empty
// `data` vector.
//
// This method requires the [`Rights.READ_BYTES`] right.
//
// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
Read(ctx_ _bindings.Context, count uint64) (ReadableReadResult, error)
// Writes data at the seek offset.
// The seek offset is moved forward by the number of bytes written.
// If the file is in append mode, the seek offset is first set to the end
// of the file, followed by the write, in one atomic step.
//
// The file size may grow if the seek offset plus `data.length` is beyond
// the current end of file.
//
// + request `data` the byte buffer to write to the file.
// - response `actual_count` the number of bytes written.
//
// ## Invariants
//
// * The returned `actual_count` will never be greater than `data.length`.
// * If the server is unable to write all the data due to e.g. not enough
// space, `actual_count` may be less than `data.length`. If no bytes
// could be written, an error is returned.
// * If `data.length` is zero, the server should perform all the checks
// ensuring write access without mutating the file and return a
// successful write of zero bytes. The seek offset is still updated if
// in append mode.
//
// This method requires the [`Rights.WRITE_BYTES`] right.
Write(ctx_ _bindings.Context, data []uint8) (WritableWriteResult, error)
Describe(ctx_ _bindings.Context) (FileInfo, error)
// Moves the offset at which the next invocation of [`Read`] or [`Write`]
// will occur. The seek offset is specific to each file connection.
//
// + request `origin` the reference point where `offset` will be based on.
// + request `offset` the number of bytes to seek.
// - response `offset_from_start` the adjusted seek offset, from the start
// of the file.
//
// This method does not require any rights.
Seek(ctx_ _bindings.Context, origin SeekOrigin, offset int64) (FileSeekResult, error)
// Reads up to 'count' bytes at the provided offset.
// Does not affect the seek offset.
//
// ## Invariants
//
// * The returned `data.length` will never be greater than `count`.
// * If `data.length` is less than `count`, it means that `ReadAt` has hit
// the end of file as part of this operation.
// * If `data.length` is zero while `count` is not, it means that `offset`
// is at or past the end of file, and no data can be read.
// * If `count` is zero, the server should perform all the checks ensuring
// read access without actually reading anything, and return an empty
// `data` vector.
//
// This method requires the [`Rights.READ_BYTES`] right.
//
// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
ReadAt(ctx_ _bindings.Context, count uint64, offset uint64) (FileReadAtResult, error)
// Writes data at the provided offset.
// Does not affect the seek offset.
//
// The file size may grow if `offset` plus `data.length` is past the
// current end of file.
//
// + request `data` the byte buffer to write to the file.
// + request `offset` the offset from start of the file to begin writing.
// - response `actual_count` the number of bytes written.
//
// ## Invariants
//
// * The returned `actual_count` will never be greater than `data.length`.
// * If the server is unable to write all the data due to e.g. not enough
// space, `actual_count` may be less than `data.length`. If no bytes
// could be written, an error is returned.
// * If `data.length` is zero, the server should perform all the checks
// ensuring write access without mutating the file, and will return a
// successful write of zero bytes.
//
// This method requires the [`Rights.WRITE_BYTES`] right.
WriteAt(ctx_ _bindings.Context, data []uint8, offset uint64) (FileWriteAtResult, error)
// Shrinks or grows the file size to 'length' bytes.
//
// If file size is reduced by this operation, the extra trailing data'
// is discarded.
// If file size is increased by this operation, the extended area appears
// as if it was zeroed.
//
// This method requires the [`Rights.WRITE_BYTES`] right.
Resize(ctx_ _bindings.Context, length uint64) (FileResizeResult, error)
// Acquires a [`zx.Handle:VMO`] representing this file, if there is one,
// with the requested access rights.
//
// Implementations are not required to implement files backed by VMOs so
// this request may fail. Additionally, implementations may only support
// a certain subset of the flags. Clients should be prepared with fallback
// behavior if this request fails.
//
// If a client specifies neither `PRIVATE_CLONE` nor `SHARED_BUFFER`, the
// implementation is free to choose the semantics of the returned VMO.
//
// + request `flags` a [`VmoFlags`] indicating the desired mode of access.
// - response `vmo` the requested [`zx.Handle:VMO`].
// * error a [`zx.Status`] value indicating the failure.
//
// This method requires the following rights:
//
// * [`Rights.READ_BYTES`] if `flags` includes [`VmoFlags.READ`].
// * [`Rights.WRITE_BYTES`] if `flags` includes [`VmoFlags.WRITE`].
// * [`Rights.EXECUTE`] if `flags` includes [`VmoFlags.EXECUTE`].
GetBackingMemory(ctx_ _bindings.Context, flags VmoFlags) (FileGetBackingMemoryResult, error)
// Pre-allocate on-disk space for this file.
Allocate(ctx_ _bindings.Context, offset uint64, length uint64, mode AllocateMode) (FileAllocateResult, error)
// Enables verification for the file (permanently) which involves computing a merkle tree for
// the file. Forces a flush prior to building the merkle tree to ensure cached data is
// captured. Future reads will be verified against the computed merkle tree and writes will be
// rejected. This method can take some time to complete as it depends on the size of the file.
// This method can be aborted by closing the connection that this method was issued on.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
// Returns `ZX_ERR_NOT_SUPPORTED` if the filesystem does not support verity.
// Returns `ZX_ERR_ALREADY_EXISTS` if the file was already fsverity-enabled.
// Also returns any error that might arise from reading the file, or from flushing the file,
// such as `ZX_ERR_IO`.
EnableVerity(ctx_ _bindings.Context, options VerificationOptions) (FileEnableVerityResult, error)
}
type FileWithCtxTransitionalBase struct{}
func (_ *FileWithCtxTransitionalBase) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
panic("Not Implemented")
}
func (_ *FileWithCtxTransitionalBase) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *FileWithCtxTransitionalBase) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *FileWithCtxTransitionalBase) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
panic("Not Implemented")
}
type FileWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewFileWithCtxInterfaceRequest() (FileWithCtxInterfaceRequest, *FileWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return FileWithCtxInterfaceRequest(req), (*FileWithCtxInterface)(cli), err
}
type FileWithCtxStub struct {
Impl FileWithCtx
}
func (s_ *FileWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case FileAdvisoryLockOrdinal:
in_ := &AdvisoryLockingAdvisoryLockRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.AdvisoryLock(args_.Ctx, (*in_).Request)
out_ := &payload
return out_, true, err_
case FileLinkIntoOrdinal:
in_ := &LinkableLinkIntoRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.LinkInto(args_.Ctx, (*in_).DstParentToken, (*in_).Dst)
out_ := &payload
return out_, true, err_
case FileCloneOrdinal:
in_ := &Node1CloneRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(args_.Ctx, (*in_).Flags, (*in_).Object)
return nil, false, err_
case FileGetAttrOrdinal:
s, attributes, err_ := s_.Impl.GetAttr(args_.Ctx)
out_ := &Node1GetAttrResponse{S: s, Attributes: attributes}
return out_, true, err_
case FileSetAttrOrdinal:
in_ := &Node1SetAttrRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(args_.Ctx, (*in_).Flags, (*in_).Attributes)
out_ := &Node1SetAttrResponse{S: s}
return out_, true, err_
case FileGetFlagsOrdinal:
s, flags, err_ := s_.Impl.GetFlags(args_.Ctx)
out_ := &Node1GetFlagsResponse{S: s, Flags: flags}
return out_, true, err_
case FileSetFlagsOrdinal:
in_ := &Node1SetFlagsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetFlags(args_.Ctx, (*in_).Flags)
out_ := &Node1SetFlagsResponse{S: s}
return out_, true, err_
case FileQueryFilesystemOrdinal:
s, info, err_ := s_.Impl.QueryFilesystem(args_.Ctx)
out_ := &Node1QueryFilesystemResponse{S: s, Info: info}
return out_, true, err_
case FileCloseOrdinal:
payload, err_ := s_.Impl.Close(args_.Ctx)
out_ := &payload
return out_, true, err_
case FileQueryOrdinal:
protocol, err_ := s_.Impl.Query(args_.Ctx)
out_ := &fuchsiaunknown.QueryableQueryResponse{Protocol: protocol}
return out_, true, err_
case FileReopenOrdinal:
in_ := &Node2ReopenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Reopen(args_.Ctx, (*in_).RightsRequest, (*in_).ObjectRequest)
return nil, false, err_
case FileGetConnectionInfoOrdinal:
payload, err_ := s_.Impl.GetConnectionInfo(args_.Ctx)
out_ := &payload
return out_, true, err_
case FileGetAttributesOrdinal:
in_ := &Node2GetAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetAttributes(args_.Ctx, (*in_).Query)
out_ := &payload
return out_, true, err_
case FileUpdateAttributesOrdinal:
in_ := &MutableNodeAttributes{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.UpdateAttributes(args_.Ctx, (*in_))
out_ := &payload
return out_, true, err_
case FileSyncOrdinal:
payload, err_ := s_.Impl.Sync(args_.Ctx)
out_ := &payload
return out_, true, err_
case FileListExtendedAttributesOrdinal:
in_ := &Node2ListExtendedAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.ListExtendedAttributes(args_.Ctx, (*in_).Iterator)
return nil, false, err_
case FileGetExtendedAttributeOrdinal:
in_ := &Node2GetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case FileSetExtendedAttributeOrdinal:
in_ := &Node2SetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.SetExtendedAttribute(args_.Ctx, (*in_).Name, (*in_).Value, (*in_).Mode)
out_ := &payload
return out_, true, err_
case FileRemoveExtendedAttributeOrdinal:
in_ := &Node2RemoveExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.RemoveExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case FileReadOrdinal:
in_ := &ReadableReadRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Read(args_.Ctx, (*in_).Count)
out_ := &payload
return out_, true, err_
case FileWriteOrdinal:
in_ := &WritableWriteRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Write(args_.Ctx, (*in_).Data)
out_ := &payload
return out_, true, err_
case FileDescribeOrdinal:
payload, err_ := s_.Impl.Describe(args_.Ctx)
out_ := &payload
return out_, true, err_
case FileSeekOrdinal:
in_ := &FileSeekRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Seek(args_.Ctx, (*in_).Origin, (*in_).Offset)
out_ := &payload
return out_, true, err_
case FileReadAtOrdinal:
in_ := &FileReadAtRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.ReadAt(args_.Ctx, (*in_).Count, (*in_).Offset)
out_ := &payload
return out_, true, err_
case FileWriteAtOrdinal:
in_ := &FileWriteAtRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.WriteAt(args_.Ctx, (*in_).Data, (*in_).Offset)
out_ := &payload
return out_, true, err_
case FileResizeOrdinal:
in_ := &FileResizeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Resize(args_.Ctx, (*in_).Length)
out_ := &payload
return out_, true, err_
case FileGetBackingMemoryOrdinal:
in_ := &FileGetBackingMemoryRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetBackingMemory(args_.Ctx, (*in_).Flags)
out_ := &payload
return out_, true, err_
case FileAllocateOrdinal:
in_ := &FileAllocateRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Allocate(args_.Ctx, (*in_).Offset, (*in_).Length, (*in_).Mode)
out_ := &payload
return out_, true, err_
case FileEnableVerityOrdinal:
in_ := &FileEnableVerityRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.EnableVerity(args_.Ctx, (*in_).Options)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type FileEventProxy _bindings.ChannelProxy
func (p *FileEventProxy) OnOpen(s int32, info *NodeInfoDeprecated) error {
event_ := &Node1OnOpenRequest{S: s, Info: info}
return ((*_bindings.ChannelProxy)(p)).Send(FileOnOpenOrdinal, event_)
}
func (p *FileEventProxy) OnRepresentation(payload Representation) error {
event_ := &payload
return ((*_bindings.ChannelProxy)(p)).Send(FileOnRepresentationOrdinal, event_)
}
const (
LinkableLinkIntoOrdinal uint64 = 0x54f3949246a03e74
)
type LinkableWithCtxInterface _bindings.ChannelProxy
// Creates a link to this this object with name `dst` in the directory represented by
// `dst_parent_token`.
//
// `dst` must be a resolved object name. Including "/" in the string will return
// `ZX_ERR_INVALID_ARGS`.
//
// This method requires the maximal set of rights supported by the filesystem for this object.
// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
// `ZX_ERR_ACCESS_DENIED`.
//
// If this object has no links, it will fail with `ZX_ERR_NOT_FOUND`.
//
// This method does not have the same atomicity properties has the `Directory::Link` method,
// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
// because `LinkInto` will not prevent the source from being renamed or unlinked.
func (p *LinkableWithCtxInterface) LinkInto(ctx_ _bindings.Context, dstParentToken _zx.Event, dst string) (LinkableLinkIntoResult, error) {
req_ := &LinkableLinkIntoRequest{DstParentToken: dstParentToken, Dst: dst}
resp_ := &LinkableLinkIntoResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(LinkableLinkIntoOrdinal, req_, resp_)
return (*resp_), err_
}
type LinkableWithCtx interface {
// Creates a link to this this object with name `dst` in the directory represented by
// `dst_parent_token`.
//
// `dst` must be a resolved object name. Including "/" in the string will return
// `ZX_ERR_INVALID_ARGS`.
//
// This method requires the maximal set of rights supported by the filesystem for this object.
// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
// `ZX_ERR_ACCESS_DENIED`.
//
// If this object has no links, it will fail with `ZX_ERR_NOT_FOUND`.
//
// This method does not have the same atomicity properties has the `Directory::Link` method,
// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
// because `LinkInto` will not prevent the source from being renamed or unlinked.
LinkInto(ctx_ _bindings.Context, dstParentToken _zx.Event, dst string) (LinkableLinkIntoResult, error)
}
type LinkableWithCtxTransitionalBase struct{}
type LinkableWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewLinkableWithCtxInterfaceRequest() (LinkableWithCtxInterfaceRequest, *LinkableWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return LinkableWithCtxInterfaceRequest(req), (*LinkableWithCtxInterface)(cli), err
}
type LinkableWithCtxStub struct {
Impl LinkableWithCtx
}
func (s_ *LinkableWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case LinkableLinkIntoOrdinal:
in_ := &LinkableLinkIntoRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.LinkInto(args_.Ctx, (*in_).DstParentToken, (*in_).Dst)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type LinkableEventProxy _bindings.ChannelProxy
const (
NodeCloneOrdinal uint64 = 0x5a61678f293ce16f
NodeOnOpenOrdinal uint64 = 0x7fc7bbb1dbfd1972
NodeGetAttrOrdinal uint64 = 0x78985e216314dafd
NodeSetAttrOrdinal uint64 = 0x4186c0f40d938f46
NodeGetFlagsOrdinal uint64 = 0x5b88fffb8eda3aa1
NodeSetFlagsOrdinal uint64 = 0x5295b76c71fde733
NodeQueryFilesystemOrdinal uint64 = 0x6f344a1c6b0a0610
NodeCloseOrdinal uint64 = 0x5ac5d459ad7f657e
NodeQueryOrdinal uint64 = 0x2658edee9decfc06
NodeReopenOrdinal uint64 = 0x6a849ef281d2baa1
NodeOnRepresentationOrdinal uint64 = 0x5cb40567d80a510c
NodeGetConnectionInfoOrdinal uint64 = 0x584c377c7c0a6d0b
NodeGetAttributesOrdinal uint64 = 0x3d4396a638ea053b
NodeUpdateAttributesOrdinal uint64 = 0x3308c1da5a89bf08
NodeSyncOrdinal uint64 = 0x2c5c27ca0ab5dc49
NodeListExtendedAttributesOrdinal uint64 = 0x4b61033de007fcd0
NodeGetExtendedAttributeOrdinal uint64 = 0x45ffa3ccfdeb76db
NodeSetExtendedAttributeOrdinal uint64 = 0x4a951362f681f23c
NodeRemoveExtendedAttributeOrdinal uint64 = 0x7a0b9f3a9bf9032d
)
type NodeWithCtxInterface _bindings.ChannelProxy
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
func (p *NodeWithCtxInterface) Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error {
req_ := &Node1CloneRequest{Flags: flags, Object: object}
err_ := ((*_bindings.ChannelProxy)(p)).Send(NodeCloneOrdinal, req_)
return err_
}
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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 *NodeWithCtxInterface) ExpectOnOpen(ctx_ _bindings.Context) (int32, *NodeInfoDeprecated, error) {
resp_ := &Node1OnOpenRequest{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(NodeOnOpenOrdinal, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *NodeWithCtxInterface) GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &Node1GetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeGetAttrOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Attributes, err_
}
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
func (p *NodeWithCtxInterface) SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error) {
req_ := &Node1SetAttrRequest{Flags: flags, Attributes: attributes}
resp_ := &Node1SetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeSetAttrOrdinal, req_, resp_)
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 *NodeWithCtxInterface) GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error) {
var req_ _bindings.Message
resp_ := &Node1GetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeGetFlagsOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Flags, err_
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
func (p *NodeWithCtxInterface) SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error) {
req_ := &Node1SetFlagsRequest{Flags: flags}
resp_ := &Node1SetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeSetFlagsOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Query the filesystem for filesystem-specific information.
func (p *NodeWithCtxInterface) QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error) {
var req_ _bindings.Message
resp_ := &Node1QueryFilesystemResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeQueryFilesystemOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
func (p *NodeWithCtxInterface) Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.CloseableCloseResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeCloseOrdinal, req_, resp_)
return (*resp_), err_
}
func (p *NodeWithCtxInterface) Query(ctx_ _bindings.Context) ([]uint8, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.QueryableQueryResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeQueryOrdinal, req_, resp_)
return (*resp_).Protocol, err_
}
// Creates another connection to the same node.
func (p *NodeWithCtxInterface) Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error {
req_ := &Node2ReopenRequest{RightsRequest: rightsRequest, ObjectRequest: objectRequest}
err_ := ((*_bindings.ChannelProxy)(p)).Send(NodeReopenOrdinal, req_)
return err_
}
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
func (p *NodeWithCtxInterface) ExpectOnRepresentation(ctx_ _bindings.Context) (Representation, error) {
resp_ := &Representation{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(NodeOnRepresentationOrdinal, resp_)
return (*resp_), err_
}
// Acquires information about the connection.
//
// This method does not require any rights.
func (p *NodeWithCtxInterface) GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error) {
var req_ _bindings.Message
resp_ := &ConnectionInfo{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeGetConnectionInfoOrdinal, req_, resp_)
return (*resp_), err_
}
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// - `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *NodeWithCtxInterface) GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error) {
req_ := &Node2GetAttributesRequest{Query: query}
resp_ := &Node2GetAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeGetAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *NodeWithCtxInterface) UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error) {
req_ := &payload
resp_ := &Node2UpdateAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeUpdateAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
func (p *NodeWithCtxInterface) Sync(ctx_ _bindings.Context) (Node2SyncResult, error) {
var req_ _bindings.Message
resp_ := &Node2SyncResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeSyncOrdinal, req_, resp_)
return (*resp_), err_
}
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *NodeWithCtxInterface) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
req_ := &Node2ListExtendedAttributesRequest{Iterator: iterator}
err_ := ((*_bindings.ChannelProxy)(p)).Send(NodeListExtendedAttributesOrdinal, req_)
return err_
}
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *NodeWithCtxInterface) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
req_ := &Node2GetExtendedAttributeRequest{Name: name}
resp_ := &Node2GetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeGetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *NodeWithCtxInterface) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
req_ := &Node2SetExtendedAttributeRequest{Name: name, Value: value, Mode: mode}
resp_ := &Node2SetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeSetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *NodeWithCtxInterface) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
req_ := &Node2RemoveExtendedAttributeRequest{Name: name}
resp_ := &Node2RemoveExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(NodeRemoveExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
type NodeWithCtx interface {
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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`).
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error)
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error)
// Query the filesystem for filesystem-specific information.
QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error)
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error)
Query(ctx_ _bindings.Context) ([]uint8, error)
// Creates another connection to the same node.
Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
// Acquires information about the connection.
//
// This method does not require any rights.
GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error)
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// + `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error)
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error)
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
Sync(ctx_ _bindings.Context) (Node2SyncResult, error)
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error)
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error)
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error)
}
type NodeWithCtxTransitionalBase struct{}
func (_ *NodeWithCtxTransitionalBase) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
panic("Not Implemented")
}
func (_ *NodeWithCtxTransitionalBase) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *NodeWithCtxTransitionalBase) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *NodeWithCtxTransitionalBase) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
panic("Not Implemented")
}
type NodeWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewNodeWithCtxInterfaceRequest() (NodeWithCtxInterfaceRequest, *NodeWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return NodeWithCtxInterfaceRequest(req), (*NodeWithCtxInterface)(cli), err
}
type NodeWithCtxStub struct {
Impl NodeWithCtx
}
func (s_ *NodeWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case NodeCloneOrdinal:
in_ := &Node1CloneRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(args_.Ctx, (*in_).Flags, (*in_).Object)
return nil, false, err_
case NodeGetAttrOrdinal:
s, attributes, err_ := s_.Impl.GetAttr(args_.Ctx)
out_ := &Node1GetAttrResponse{S: s, Attributes: attributes}
return out_, true, err_
case NodeSetAttrOrdinal:
in_ := &Node1SetAttrRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(args_.Ctx, (*in_).Flags, (*in_).Attributes)
out_ := &Node1SetAttrResponse{S: s}
return out_, true, err_
case NodeGetFlagsOrdinal:
s, flags, err_ := s_.Impl.GetFlags(args_.Ctx)
out_ := &Node1GetFlagsResponse{S: s, Flags: flags}
return out_, true, err_
case NodeSetFlagsOrdinal:
in_ := &Node1SetFlagsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetFlags(args_.Ctx, (*in_).Flags)
out_ := &Node1SetFlagsResponse{S: s}
return out_, true, err_
case NodeQueryFilesystemOrdinal:
s, info, err_ := s_.Impl.QueryFilesystem(args_.Ctx)
out_ := &Node1QueryFilesystemResponse{S: s, Info: info}
return out_, true, err_
case NodeCloseOrdinal:
payload, err_ := s_.Impl.Close(args_.Ctx)
out_ := &payload
return out_, true, err_
case NodeQueryOrdinal:
protocol, err_ := s_.Impl.Query(args_.Ctx)
out_ := &fuchsiaunknown.QueryableQueryResponse{Protocol: protocol}
return out_, true, err_
case NodeReopenOrdinal:
in_ := &Node2ReopenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Reopen(args_.Ctx, (*in_).RightsRequest, (*in_).ObjectRequest)
return nil, false, err_
case NodeGetConnectionInfoOrdinal:
payload, err_ := s_.Impl.GetConnectionInfo(args_.Ctx)
out_ := &payload
return out_, true, err_
case NodeGetAttributesOrdinal:
in_ := &Node2GetAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetAttributes(args_.Ctx, (*in_).Query)
out_ := &payload
return out_, true, err_
case NodeUpdateAttributesOrdinal:
in_ := &MutableNodeAttributes{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.UpdateAttributes(args_.Ctx, (*in_))
out_ := &payload
return out_, true, err_
case NodeSyncOrdinal:
payload, err_ := s_.Impl.Sync(args_.Ctx)
out_ := &payload
return out_, true, err_
case NodeListExtendedAttributesOrdinal:
in_ := &Node2ListExtendedAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.ListExtendedAttributes(args_.Ctx, (*in_).Iterator)
return nil, false, err_
case NodeGetExtendedAttributeOrdinal:
in_ := &Node2GetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case NodeSetExtendedAttributeOrdinal:
in_ := &Node2SetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.SetExtendedAttribute(args_.Ctx, (*in_).Name, (*in_).Value, (*in_).Mode)
out_ := &payload
return out_, true, err_
case NodeRemoveExtendedAttributeOrdinal:
in_ := &Node2RemoveExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.RemoveExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type NodeEventProxy _bindings.ChannelProxy
func (p *NodeEventProxy) OnOpen(s int32, info *NodeInfoDeprecated) error {
event_ := &Node1OnOpenRequest{S: s, Info: info}
return ((*_bindings.ChannelProxy)(p)).Send(NodeOnOpenOrdinal, event_)
}
func (p *NodeEventProxy) OnRepresentation(payload Representation) error {
event_ := &payload
return ((*_bindings.ChannelProxy)(p)).Send(NodeOnRepresentationOrdinal, event_)
}
const (
Node1CloneOrdinal uint64 = 0x5a61678f293ce16f
Node1OnOpenOrdinal uint64 = 0x7fc7bbb1dbfd1972
Node1GetAttrOrdinal uint64 = 0x78985e216314dafd
Node1SetAttrOrdinal uint64 = 0x4186c0f40d938f46
Node1GetFlagsOrdinal uint64 = 0x5b88fffb8eda3aa1
Node1SetFlagsOrdinal uint64 = 0x5295b76c71fde733
Node1QueryFilesystemOrdinal uint64 = 0x6f344a1c6b0a0610
)
type Node1WithCtxInterface _bindings.ChannelProxy
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
func (p *Node1WithCtxInterface) Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error {
req_ := &Node1CloneRequest{Flags: flags, Object: object}
err_ := ((*_bindings.ChannelProxy)(p)).Send(Node1CloneOrdinal, req_)
return err_
}
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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 *Node1WithCtxInterface) ExpectOnOpen(ctx_ _bindings.Context) (int32, *NodeInfoDeprecated, error) {
resp_ := &Node1OnOpenRequest{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(Node1OnOpenOrdinal, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *Node1WithCtxInterface) GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &Node1GetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node1GetAttrOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Attributes, err_
}
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
func (p *Node1WithCtxInterface) SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error) {
req_ := &Node1SetAttrRequest{Flags: flags, Attributes: attributes}
resp_ := &Node1SetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node1SetAttrOrdinal, req_, resp_)
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 *Node1WithCtxInterface) GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error) {
var req_ _bindings.Message
resp_ := &Node1GetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node1GetFlagsOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Flags, err_
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
func (p *Node1WithCtxInterface) SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error) {
req_ := &Node1SetFlagsRequest{Flags: flags}
resp_ := &Node1SetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node1SetFlagsOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Query the filesystem for filesystem-specific information.
func (p *Node1WithCtxInterface) QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error) {
var req_ _bindings.Message
resp_ := &Node1QueryFilesystemResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node1QueryFilesystemOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Node defines the minimal interface for entities which can be accessed in a filesystem.
type Node1WithCtx interface {
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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`).
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error)
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error)
// Query the filesystem for filesystem-specific information.
QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error)
}
type Node1WithCtxTransitionalBase struct{}
type Node1WithCtxInterfaceRequest _bindings.InterfaceRequest
func NewNode1WithCtxInterfaceRequest() (Node1WithCtxInterfaceRequest, *Node1WithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return Node1WithCtxInterfaceRequest(req), (*Node1WithCtxInterface)(cli), err
}
type Node1WithCtxStub struct {
Impl Node1WithCtx
}
func (s_ *Node1WithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case Node1CloneOrdinal:
in_ := &Node1CloneRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(args_.Ctx, (*in_).Flags, (*in_).Object)
return nil, false, err_
case Node1GetAttrOrdinal:
s, attributes, err_ := s_.Impl.GetAttr(args_.Ctx)
out_ := &Node1GetAttrResponse{S: s, Attributes: attributes}
return out_, true, err_
case Node1SetAttrOrdinal:
in_ := &Node1SetAttrRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(args_.Ctx, (*in_).Flags, (*in_).Attributes)
out_ := &Node1SetAttrResponse{S: s}
return out_, true, err_
case Node1GetFlagsOrdinal:
s, flags, err_ := s_.Impl.GetFlags(args_.Ctx)
out_ := &Node1GetFlagsResponse{S: s, Flags: flags}
return out_, true, err_
case Node1SetFlagsOrdinal:
in_ := &Node1SetFlagsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetFlags(args_.Ctx, (*in_).Flags)
out_ := &Node1SetFlagsResponse{S: s}
return out_, true, err_
case Node1QueryFilesystemOrdinal:
s, info, err_ := s_.Impl.QueryFilesystem(args_.Ctx)
out_ := &Node1QueryFilesystemResponse{S: s, Info: info}
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type Node1EventProxy _bindings.ChannelProxy
func (p *Node1EventProxy) OnOpen(s int32, info *NodeInfoDeprecated) error {
event_ := &Node1OnOpenRequest{S: s, Info: info}
return ((*_bindings.ChannelProxy)(p)).Send(Node1OnOpenOrdinal, event_)
}
const (
Node2CloseOrdinal uint64 = 0x5ac5d459ad7f657e
Node2QueryOrdinal uint64 = 0x2658edee9decfc06
Node2ReopenOrdinal uint64 = 0x6a849ef281d2baa1
Node2OnRepresentationOrdinal uint64 = 0x5cb40567d80a510c
Node2GetConnectionInfoOrdinal uint64 = 0x584c377c7c0a6d0b
Node2GetAttributesOrdinal uint64 = 0x3d4396a638ea053b
Node2UpdateAttributesOrdinal uint64 = 0x3308c1da5a89bf08
Node2SyncOrdinal uint64 = 0x2c5c27ca0ab5dc49
Node2ListExtendedAttributesOrdinal uint64 = 0x4b61033de007fcd0
Node2GetExtendedAttributeOrdinal uint64 = 0x45ffa3ccfdeb76db
Node2SetExtendedAttributeOrdinal uint64 = 0x4a951362f681f23c
Node2RemoveExtendedAttributeOrdinal uint64 = 0x7a0b9f3a9bf9032d
)
type Node2WithCtxInterface _bindings.ChannelProxy
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
func (p *Node2WithCtxInterface) Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.CloseableCloseResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node2CloseOrdinal, req_, resp_)
return (*resp_), err_
}
func (p *Node2WithCtxInterface) Query(ctx_ _bindings.Context) ([]uint8, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.QueryableQueryResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node2QueryOrdinal, req_, resp_)
return (*resp_).Protocol, err_
}
// Creates another connection to the same node.
func (p *Node2WithCtxInterface) Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error {
req_ := &Node2ReopenRequest{RightsRequest: rightsRequest, ObjectRequest: objectRequest}
err_ := ((*_bindings.ChannelProxy)(p)).Send(Node2ReopenOrdinal, req_)
return err_
}
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
func (p *Node2WithCtxInterface) ExpectOnRepresentation(ctx_ _bindings.Context) (Representation, error) {
resp_ := &Representation{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(Node2OnRepresentationOrdinal, resp_)
return (*resp_), err_
}
// Acquires information about the connection.
//
// This method does not require any rights.
func (p *Node2WithCtxInterface) GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error) {
var req_ _bindings.Message
resp_ := &ConnectionInfo{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node2GetConnectionInfoOrdinal, req_, resp_)
return (*resp_), err_
}
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// - `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *Node2WithCtxInterface) GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error) {
req_ := &Node2GetAttributesRequest{Query: query}
resp_ := &Node2GetAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node2GetAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *Node2WithCtxInterface) UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error) {
req_ := &payload
resp_ := &Node2UpdateAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node2UpdateAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
func (p *Node2WithCtxInterface) Sync(ctx_ _bindings.Context) (Node2SyncResult, error) {
var req_ _bindings.Message
resp_ := &Node2SyncResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node2SyncOrdinal, req_, resp_)
return (*resp_), err_
}
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *Node2WithCtxInterface) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
req_ := &Node2ListExtendedAttributesRequest{Iterator: iterator}
err_ := ((*_bindings.ChannelProxy)(p)).Send(Node2ListExtendedAttributesOrdinal, req_)
return err_
}
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *Node2WithCtxInterface) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
req_ := &Node2GetExtendedAttributeRequest{Name: name}
resp_ := &Node2GetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node2GetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *Node2WithCtxInterface) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
req_ := &Node2SetExtendedAttributeRequest{Name: name, Value: value, Mode: mode}
resp_ := &Node2SetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node2SetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *Node2WithCtxInterface) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
req_ := &Node2RemoveExtendedAttributeRequest{Name: name}
resp_ := &Node2RemoveExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(Node2RemoveExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Node defines the minimal protocol for entities which can be accessed
// in a filesystem.
type Node2WithCtx interface {
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error)
Query(ctx_ _bindings.Context) ([]uint8, error)
// Creates another connection to the same node.
Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
// Acquires information about the connection.
//
// This method does not require any rights.
GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error)
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// + `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error)
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error)
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
Sync(ctx_ _bindings.Context) (Node2SyncResult, error)
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error)
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error)
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error)
}
type Node2WithCtxTransitionalBase struct{}
func (_ *Node2WithCtxTransitionalBase) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
panic("Not Implemented")
}
func (_ *Node2WithCtxTransitionalBase) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *Node2WithCtxTransitionalBase) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *Node2WithCtxTransitionalBase) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
panic("Not Implemented")
}
type Node2WithCtxInterfaceRequest _bindings.InterfaceRequest
func NewNode2WithCtxInterfaceRequest() (Node2WithCtxInterfaceRequest, *Node2WithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return Node2WithCtxInterfaceRequest(req), (*Node2WithCtxInterface)(cli), err
}
type Node2WithCtxStub struct {
Impl Node2WithCtx
}
func (s_ *Node2WithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case Node2CloseOrdinal:
payload, err_ := s_.Impl.Close(args_.Ctx)
out_ := &payload
return out_, true, err_
case Node2QueryOrdinal:
protocol, err_ := s_.Impl.Query(args_.Ctx)
out_ := &fuchsiaunknown.QueryableQueryResponse{Protocol: protocol}
return out_, true, err_
case Node2ReopenOrdinal:
in_ := &Node2ReopenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Reopen(args_.Ctx, (*in_).RightsRequest, (*in_).ObjectRequest)
return nil, false, err_
case Node2GetConnectionInfoOrdinal:
payload, err_ := s_.Impl.GetConnectionInfo(args_.Ctx)
out_ := &payload
return out_, true, err_
case Node2GetAttributesOrdinal:
in_ := &Node2GetAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetAttributes(args_.Ctx, (*in_).Query)
out_ := &payload
return out_, true, err_
case Node2UpdateAttributesOrdinal:
in_ := &MutableNodeAttributes{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.UpdateAttributes(args_.Ctx, (*in_))
out_ := &payload
return out_, true, err_
case Node2SyncOrdinal:
payload, err_ := s_.Impl.Sync(args_.Ctx)
out_ := &payload
return out_, true, err_
case Node2ListExtendedAttributesOrdinal:
in_ := &Node2ListExtendedAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.ListExtendedAttributes(args_.Ctx, (*in_).Iterator)
return nil, false, err_
case Node2GetExtendedAttributeOrdinal:
in_ := &Node2GetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case Node2SetExtendedAttributeOrdinal:
in_ := &Node2SetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.SetExtendedAttribute(args_.Ctx, (*in_).Name, (*in_).Value, (*in_).Mode)
out_ := &payload
return out_, true, err_
case Node2RemoveExtendedAttributeOrdinal:
in_ := &Node2RemoveExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.RemoveExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type Node2EventProxy _bindings.ChannelProxy
func (p *Node2EventProxy) OnRepresentation(payload Representation) error {
event_ := &payload
return ((*_bindings.ChannelProxy)(p)).Send(Node2OnRepresentationOrdinal, event_)
}
const (
OpenableOpenOrdinal uint64 = 0x2c5044561d685ec0
)
type OpenableWithCtxInterface _bindings.ChannelProxy
// 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. A trailing slash implies OpenFlags.DIRECTORY. Components
// must not be empty (i.e. "foo//bar" is invalid). ".." is disallowed anywhere in the path. "."
// is only allowed if the path is exactly ".", but not otherwise. A leading '/' is allowed (and
// is treated the same way as if not present, i.e. "/foo/bar' and "foo/bar" are the same).
//
// If an unknown value is sent for flags the connection should be closed.
//
// `OpenFlags.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.
//
// `mode` is ignored.
func (p *OpenableWithCtxInterface) Open(ctx_ _bindings.Context, flags OpenFlags, mode ModeType, path string, object NodeWithCtxInterfaceRequest) error {
req_ := &OpenableOpenRequest{Flags: flags, Mode: mode, Path: path, Object: object}
err_ := ((*_bindings.ChannelProxy)(p)).Send(OpenableOpenOrdinal, req_)
return err_
}
type OpenableWithCtx interface {
// 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. A trailing slash implies OpenFlags.DIRECTORY. Components
// must not be empty (i.e. "foo//bar" is invalid). ".." is disallowed anywhere in the path. "."
// is only allowed if the path is exactly ".", but not otherwise. A leading '/' is allowed (and
// is treated the same way as if not present, i.e. "/foo/bar' and "foo/bar" are the same).
//
// If an unknown value is sent for flags the connection should be closed.
//
// `OpenFlags.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.
//
// `mode` is ignored.
Open(ctx_ _bindings.Context, flags OpenFlags, mode ModeType, path string, object NodeWithCtxInterfaceRequest) error
}
type OpenableWithCtxTransitionalBase struct{}
type OpenableWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewOpenableWithCtxInterfaceRequest() (OpenableWithCtxInterfaceRequest, *OpenableWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return OpenableWithCtxInterfaceRequest(req), (*OpenableWithCtxInterface)(cli), err
}
type OpenableWithCtxStub struct {
Impl OpenableWithCtx
}
func (s_ *OpenableWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case OpenableOpenOrdinal:
in_ := &OpenableOpenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Open(args_.Ctx, (*in_).Flags, (*in_).Mode, (*in_).Path, (*in_).Object)
return nil, false, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type OpenableEventProxy _bindings.ChannelProxy
const (
ReadableReadOrdinal uint64 = 0x57e419a298c8ede
)
type ReadableWithCtxInterface _bindings.ChannelProxy
// Reads up to 'count' bytes at the seek offset.
// The seek offset is moved forward by the number of bytes read.
//
// ## Invariants
//
// - The returned `data.length` will never be greater than `count`.
// - If `data.length` is less than `count`, it means that the seek offset
// has reached the end of file as part of this operation.
// - If `data.length` is zero while `count` is not, it means that the
// seek offset is already at or beyond the end of file, and no data could
// be read.
// - If `count` is zero, the server should perform all the checks ensuring
// read access without actually read anything, and return an empty
// `data` vector.
//
// This method requires the [`Rights.READ_BYTES`] right.
//
// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
func (p *ReadableWithCtxInterface) Read(ctx_ _bindings.Context, count uint64) (ReadableReadResult, error) {
req_ := &ReadableReadRequest{Count: count}
resp_ := &ReadableReadResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(ReadableReadOrdinal, req_, resp_)
return (*resp_), err_
}
type ReadableWithCtx interface {
// Reads up to 'count' bytes at the seek offset.
// The seek offset is moved forward by the number of bytes read.
//
// ## Invariants
//
// * The returned `data.length` will never be greater than `count`.
// * If `data.length` is less than `count`, it means that the seek offset
// has reached the end of file as part of this operation.
// * If `data.length` is zero while `count` is not, it means that the
// seek offset is already at or beyond the end of file, and no data could
// be read.
// * If `count` is zero, the server should perform all the checks ensuring
// read access without actually read anything, and return an empty
// `data` vector.
//
// This method requires the [`Rights.READ_BYTES`] right.
//
// Returns `ZX_ERR_OUT_OF_RANGE` if `count` is greater than `MAX_TRANSFER_SIZE`.
Read(ctx_ _bindings.Context, count uint64) (ReadableReadResult, error)
}
type ReadableWithCtxTransitionalBase struct{}
type ReadableWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewReadableWithCtxInterfaceRequest() (ReadableWithCtxInterfaceRequest, *ReadableWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return ReadableWithCtxInterfaceRequest(req), (*ReadableWithCtxInterface)(cli), err
}
type ReadableWithCtxStub struct {
Impl ReadableWithCtx
}
func (s_ *ReadableWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case ReadableReadOrdinal:
in_ := &ReadableReadRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Read(args_.Ctx, (*in_).Count)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type ReadableEventProxy _bindings.ChannelProxy
const (
SymlinkLinkIntoOrdinal uint64 = 0x54f3949246a03e74
SymlinkCloneOrdinal uint64 = 0x5a61678f293ce16f
SymlinkOnOpenOrdinal uint64 = 0x7fc7bbb1dbfd1972
SymlinkGetAttrOrdinal uint64 = 0x78985e216314dafd
SymlinkSetAttrOrdinal uint64 = 0x4186c0f40d938f46
SymlinkGetFlagsOrdinal uint64 = 0x5b88fffb8eda3aa1
SymlinkSetFlagsOrdinal uint64 = 0x5295b76c71fde733
SymlinkQueryFilesystemOrdinal uint64 = 0x6f344a1c6b0a0610
SymlinkCloseOrdinal uint64 = 0x5ac5d459ad7f657e
SymlinkQueryOrdinal uint64 = 0x2658edee9decfc06
SymlinkReopenOrdinal uint64 = 0x6a849ef281d2baa1
SymlinkOnRepresentationOrdinal uint64 = 0x5cb40567d80a510c
SymlinkGetConnectionInfoOrdinal uint64 = 0x584c377c7c0a6d0b
SymlinkGetAttributesOrdinal uint64 = 0x3d4396a638ea053b
SymlinkUpdateAttributesOrdinal uint64 = 0x3308c1da5a89bf08
SymlinkSyncOrdinal uint64 = 0x2c5c27ca0ab5dc49
SymlinkListExtendedAttributesOrdinal uint64 = 0x4b61033de007fcd0
SymlinkGetExtendedAttributeOrdinal uint64 = 0x45ffa3ccfdeb76db
SymlinkSetExtendedAttributeOrdinal uint64 = 0x4a951362f681f23c
SymlinkRemoveExtendedAttributeOrdinal uint64 = 0x7a0b9f3a9bf9032d
SymlinkDescribeOrdinal uint64 = 0x742c2ea5e89831f3
)
type SymlinkWithCtxInterface _bindings.ChannelProxy
// Creates a link to this this object with name `dst` in the directory represented by
// `dst_parent_token`.
//
// `dst` must be a resolved object name. Including "/" in the string will return
// `ZX_ERR_INVALID_ARGS`.
//
// This method requires the maximal set of rights supported by the filesystem for this object.
// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
// `ZX_ERR_ACCESS_DENIED`.
//
// If this object has no links, it will fail with `ZX_ERR_NOT_FOUND`.
//
// This method does not have the same atomicity properties has the `Directory::Link` method,
// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
// because `LinkInto` will not prevent the source from being renamed or unlinked.
func (p *SymlinkWithCtxInterface) LinkInto(ctx_ _bindings.Context, dstParentToken _zx.Event, dst string) (LinkableLinkIntoResult, error) {
req_ := &LinkableLinkIntoRequest{DstParentToken: dstParentToken, Dst: dst}
resp_ := &LinkableLinkIntoResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkLinkIntoOrdinal, req_, resp_)
return (*resp_), err_
}
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
func (p *SymlinkWithCtxInterface) Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error {
req_ := &Node1CloneRequest{Flags: flags, Object: object}
err_ := ((*_bindings.ChannelProxy)(p)).Send(SymlinkCloneOrdinal, req_)
return err_
}
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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 *SymlinkWithCtxInterface) ExpectOnOpen(ctx_ _bindings.Context) (int32, *NodeInfoDeprecated, error) {
resp_ := &Node1OnOpenRequest{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(SymlinkOnOpenOrdinal, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Acquires information about the node.
//
// This method does not require any rights.
func (p *SymlinkWithCtxInterface) GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error) {
var req_ _bindings.Message
resp_ := &Node1GetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkGetAttrOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Attributes, err_
}
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
func (p *SymlinkWithCtxInterface) SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error) {
req_ := &Node1SetAttrRequest{Flags: flags, Attributes: attributes}
resp_ := &Node1SetAttrResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkSetAttrOrdinal, req_, resp_)
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 *SymlinkWithCtxInterface) GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error) {
var req_ _bindings.Message
resp_ := &Node1GetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkGetFlagsOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Flags, err_
}
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
func (p *SymlinkWithCtxInterface) SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error) {
req_ := &Node1SetFlagsRequest{Flags: flags}
resp_ := &Node1SetFlagsResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkSetFlagsOrdinal, req_, resp_)
return (*resp_).S, err_
}
// Query the filesystem for filesystem-specific information.
func (p *SymlinkWithCtxInterface) QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error) {
var req_ _bindings.Message
resp_ := &Node1QueryFilesystemResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkQueryFilesystemOrdinal, req_, resp_)
return (*resp_).S, (*resp_).Info, err_
}
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
func (p *SymlinkWithCtxInterface) Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.CloseableCloseResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkCloseOrdinal, req_, resp_)
return (*resp_), err_
}
func (p *SymlinkWithCtxInterface) Query(ctx_ _bindings.Context) ([]uint8, error) {
var req_ _bindings.Message
resp_ := &fuchsiaunknown.QueryableQueryResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkQueryOrdinal, req_, resp_)
return (*resp_).Protocol, err_
}
// Creates another connection to the same node.
func (p *SymlinkWithCtxInterface) Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error {
req_ := &Node2ReopenRequest{RightsRequest: rightsRequest, ObjectRequest: objectRequest}
err_ := ((*_bindings.ChannelProxy)(p)).Send(SymlinkReopenOrdinal, req_)
return err_
}
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
func (p *SymlinkWithCtxInterface) ExpectOnRepresentation(ctx_ _bindings.Context) (Representation, error) {
resp_ := &Representation{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(SymlinkOnRepresentationOrdinal, resp_)
return (*resp_), err_
}
// Acquires information about the connection.
//
// This method does not require any rights.
func (p *SymlinkWithCtxInterface) GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error) {
var req_ _bindings.Message
resp_ := &ConnectionInfo{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkGetConnectionInfoOrdinal, req_, resp_)
return (*resp_), err_
}
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// - `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *SymlinkWithCtxInterface) GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error) {
req_ := &Node2GetAttributesRequest{Query: query}
resp_ := &Node2GetAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkGetAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *SymlinkWithCtxInterface) UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error) {
req_ := &payload
resp_ := &Node2UpdateAttributesResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkUpdateAttributesOrdinal, req_, resp_)
return (*resp_), err_
}
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
func (p *SymlinkWithCtxInterface) Sync(ctx_ _bindings.Context) (Node2SyncResult, error) {
var req_ _bindings.Message
resp_ := &Node2SyncResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkSyncOrdinal, req_, resp_)
return (*resp_), err_
}
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *SymlinkWithCtxInterface) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
req_ := &Node2ListExtendedAttributesRequest{Iterator: iterator}
err_ := ((*_bindings.ChannelProxy)(p)).Send(SymlinkListExtendedAttributesOrdinal, req_)
return err_
}
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
func (p *SymlinkWithCtxInterface) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
req_ := &Node2GetExtendedAttributeRequest{Name: name}
resp_ := &Node2GetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkGetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *SymlinkWithCtxInterface) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
req_ := &Node2SetExtendedAttributeRequest{Name: name, Value: value, Mode: mode}
resp_ := &Node2SetExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkSetExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
func (p *SymlinkWithCtxInterface) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
req_ := &Node2RemoveExtendedAttributeRequest{Name: name}
resp_ := &Node2RemoveExtendedAttributeResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkRemoveExtendedAttributeOrdinal, req_, resp_)
return (*resp_), err_
}
func (p *SymlinkWithCtxInterface) Describe(ctx_ _bindings.Context) (SymlinkInfo, error) {
var req_ _bindings.Message
resp_ := &SymlinkInfo{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(SymlinkDescribeOrdinal, req_, resp_)
return (*resp_), err_
}
// A ['Node'] which contains a symbolic link.
type SymlinkWithCtx interface {
// Creates a link to this this object with name `dst` in the directory represented by
// `dst_parent_token`.
//
// `dst` must be a resolved object name. Including "/" in the string will return
// `ZX_ERR_INVALID_ARGS`.
//
// This method requires the maximal set of rights supported by the filesystem for this object.
// For files this would typically be [`Rights.READ_BYTES`], [`Rights.WRITE_BYTES`],
// [`Rights.GET_ATTRIBUTES`] and [`Rights.UPDATE_ATTRIBUTES`]. Some filesystems might also
// support the [`Rights.EXECUTE`] right. Insufficient rights will result in
// `ZX_ERR_ACCESS_DENIED`.
//
// If this object has no links, it will fail with `ZX_ERR_NOT_FOUND`.
//
// This method does not have the same atomicity properties has the `Directory::Link` method,
// which means that calling `Open` then `LinkInto` is not equivalent to `Directory::Link`
// because `LinkInto` will not prevent the source from being renamed or unlinked.
LinkInto(ctx_ _bindings.Context, dstParentToken _zx.Event, dst string) (LinkableLinkIntoResult, error)
// Create another connection to the same remote object.
//
// `flags` may be any of:
//
// - `OpenFlags.RIGHT_*`
// - `OpenFlags.APPEND`
// - `OpenFlags.DESCRIBE`
// - `OpenFlags.CLONE_SAME_RIGHTS`
//
// All other flags are ignored.
//
// The `OpenFlags.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, otherwise
// returns `ZX_ERR_ACCESS_DENIED`.
// Alternatively, pass `OpenFlags.CLONE_SAME_RIGHTS` to inherit the rights on the source connection.
// It is invalid to pass any of the `OpenFlags.RIGHT_*` flags together with
// `OpenFlags.CLONE_SAME_RIGHTS`.
Clone(ctx_ _bindings.Context, flags OpenFlags, object NodeWithCtxInterfaceRequest) error
// An event produced eagerly by a FIDL server if requested by `OpenFlags.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`).
// Acquires information about the node.
//
// This method does not require any rights.
GetAttr(ctx_ _bindings.Context) (int32, NodeAttributes, error)
// Updates information about the node.
//
// This method requires following rights: `OpenFlags.RIGHT_WRITABLE`, otherwise returns
// `ZX_ERR_BAD_HANDLE`.
SetAttr(ctx_ _bindings.Context, flags NodeAttributeFlags, attributes NodeAttributes) (int32, error)
// Acquires the `Directory.Open` rights and flags used to access this file.
//
// This method does not require any rights.
GetFlags(ctx_ _bindings.Context) (int32, OpenFlags, error)
// Changes the `Directory.Open` flags used to access the file.
// Supported flags which can be turned on / off:
// - `OpenFlags.APPEND`
//
// This method does not require any rights.
SetFlags(ctx_ _bindings.Context, flags OpenFlags) (int32, error)
// Query the filesystem for filesystem-specific information.
QueryFilesystem(ctx_ _bindings.Context) (int32, *FilesystemInfo, error)
// Terminates the connection.
//
// After calling `Close`, the client must not send any other requests.
//
// Servers, after sending the status response, should close the connection
// regardless of status and without sending an epitaph.
//
// Closing the client end of the channel should be semantically equivalent
// to calling `Close` without knowing when the close has completed or its
// status.
Close(ctx_ _bindings.Context) (fuchsiaunknown.CloseableCloseResult, error)
Query(ctx_ _bindings.Context) ([]uint8, error)
// Creates another connection to the same node.
Reopen(ctx_ _bindings.Context, rightsRequest RightsRequest, objectRequest NodeWithCtxInterfaceRequest) error
// An event produced eagerly by the server if requested by
// [`NodeFlags.GET_REPRESENTATION`]. This event will be the first message
// from the server, and is sent exactly once.
//
// The active variant corresponds to one of the supported protocols of
// the node, and represents the result of the connection-time
// negotiation. Provides auxiliary handles if applicable.
//
// If the client specified more than one protocol in `protocols` during
// [`Directory.Open`], the [`Representation`] carries additionally the
// result of the connection-time negotiation via its tag.
//
// The elements have one-to-one correspondence with the members of
// [`NodeProtocolKinds`].
//
// This is a special case of [`fuchsia.unknown/Queryable.Query`] +
// inherent `Describe` methods on the specific protocols. It exists as
// an optimization to avoid an additional round trip.
// Acquires information about the connection.
//
// This method does not require any rights.
GetConnectionInfo(ctx_ _bindings.Context) (ConnectionInfo, error)
// Acquires information about the node.
//
// The attributes of a node should be stable, independent of the
// specific protocol used to access it.
//
// If a particular attribute is not applicable or not supported,
// filesystems should leave the corresponding field absent.
//
// + `query` a bit-mask specifying which attributes to fetch. The server
// should not return more than necessary.
// - `attributes` the returned attributes.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetAttributes(ctx_ _bindings.Context, query NodeAttributesQuery) (Node2GetAttributesResult, error)
// Updates information about the node.
//
// + `attributes` the presence of a table field in `attributes` indicates
// the intent to update the corresponding attribute.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
UpdateAttributes(ctx_ _bindings.Context, payload MutableNodeAttributes) (Node2UpdateAttributesResult, error)
// Synchronizes updates to the node to the underlying media, if it exists.
//
// This method will return when the filesystem server has flushed the
// relevant updates to the underlying media, but does not guarantee the
// underlying media has persisted the information, nor that any information
// is committed to hardware. Clients may use `Sync` to ensure ordering
// between operations.
//
// This method does not require any rights.
Sync(ctx_ _bindings.Context) (Node2SyncResult, error)
// Creates an iterator over all the extended attribute names associated
// with this node. If an error occurs it is returned as an epitaph on the
// iterator request channel, and then the channel is closed.
//
// GetExtendedAttributes can be used with any of these names to retrieve
// the associated value.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error
// Get the value associated with the given attribute `name` for this node.
//
// Attribute names have a maximum length of MAX_ATTRIBUTE_NAME. No
// particular structure is imposed on them.
//
// This method requires the [`Rights.GET_ATTRIBUTES`] right.
GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error)
// Set the value for the given attribute `name` to `value` for this node.
//
// The attribute name may exist, in which case the attribute is updated.
// If the attribute doesn't exist, it is created. The name should have no
// null bytes in it. If it does, ZX_ERR_INVALID_ARGS is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error)
// Remove the specified extended attribute.
//
// If the attribute doesn't exist, ZX_ERR_NOT_FOUND is returned.
//
// This method requires the [`Rights.UPDATE_ATTRIBUTES`] right.
RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error)
Describe(ctx_ _bindings.Context) (SymlinkInfo, error)
}
type SymlinkWithCtxTransitionalBase struct{}
func (_ *SymlinkWithCtxTransitionalBase) ListExtendedAttributes(ctx_ _bindings.Context, iterator ExtendedAttributeIteratorWithCtxInterfaceRequest) error {
panic("Not Implemented")
}
func (_ *SymlinkWithCtxTransitionalBase) GetExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2GetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *SymlinkWithCtxTransitionalBase) SetExtendedAttribute(ctx_ _bindings.Context, name []uint8, value ExtendedAttributeValue, mode SetExtendedAttributeMode) (Node2SetExtendedAttributeResult, error) {
panic("Not Implemented")
}
func (_ *SymlinkWithCtxTransitionalBase) RemoveExtendedAttribute(ctx_ _bindings.Context, name []uint8) (Node2RemoveExtendedAttributeResult, error) {
panic("Not Implemented")
}
type SymlinkWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewSymlinkWithCtxInterfaceRequest() (SymlinkWithCtxInterfaceRequest, *SymlinkWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return SymlinkWithCtxInterfaceRequest(req), (*SymlinkWithCtxInterface)(cli), err
}
type SymlinkWithCtxStub struct {
Impl SymlinkWithCtx
}
func (s_ *SymlinkWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case SymlinkLinkIntoOrdinal:
in_ := &LinkableLinkIntoRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.LinkInto(args_.Ctx, (*in_).DstParentToken, (*in_).Dst)
out_ := &payload
return out_, true, err_
case SymlinkCloneOrdinal:
in_ := &Node1CloneRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Clone(args_.Ctx, (*in_).Flags, (*in_).Object)
return nil, false, err_
case SymlinkGetAttrOrdinal:
s, attributes, err_ := s_.Impl.GetAttr(args_.Ctx)
out_ := &Node1GetAttrResponse{S: s, Attributes: attributes}
return out_, true, err_
case SymlinkSetAttrOrdinal:
in_ := &Node1SetAttrRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetAttr(args_.Ctx, (*in_).Flags, (*in_).Attributes)
out_ := &Node1SetAttrResponse{S: s}
return out_, true, err_
case SymlinkGetFlagsOrdinal:
s, flags, err_ := s_.Impl.GetFlags(args_.Ctx)
out_ := &Node1GetFlagsResponse{S: s, Flags: flags}
return out_, true, err_
case SymlinkSetFlagsOrdinal:
in_ := &Node1SetFlagsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
s, err_ := s_.Impl.SetFlags(args_.Ctx, (*in_).Flags)
out_ := &Node1SetFlagsResponse{S: s}
return out_, true, err_
case SymlinkQueryFilesystemOrdinal:
s, info, err_ := s_.Impl.QueryFilesystem(args_.Ctx)
out_ := &Node1QueryFilesystemResponse{S: s, Info: info}
return out_, true, err_
case SymlinkCloseOrdinal:
payload, err_ := s_.Impl.Close(args_.Ctx)
out_ := &payload
return out_, true, err_
case SymlinkQueryOrdinal:
protocol, err_ := s_.Impl.Query(args_.Ctx)
out_ := &fuchsiaunknown.QueryableQueryResponse{Protocol: protocol}
return out_, true, err_
case SymlinkReopenOrdinal:
in_ := &Node2ReopenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Reopen(args_.Ctx, (*in_).RightsRequest, (*in_).ObjectRequest)
return nil, false, err_
case SymlinkGetConnectionInfoOrdinal:
payload, err_ := s_.Impl.GetConnectionInfo(args_.Ctx)
out_ := &payload
return out_, true, err_
case SymlinkGetAttributesOrdinal:
in_ := &Node2GetAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetAttributes(args_.Ctx, (*in_).Query)
out_ := &payload
return out_, true, err_
case SymlinkUpdateAttributesOrdinal:
in_ := &MutableNodeAttributes{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.UpdateAttributes(args_.Ctx, (*in_))
out_ := &payload
return out_, true, err_
case SymlinkSyncOrdinal:
payload, err_ := s_.Impl.Sync(args_.Ctx)
out_ := &payload
return out_, true, err_
case SymlinkListExtendedAttributesOrdinal:
in_ := &Node2ListExtendedAttributesRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.ListExtendedAttributes(args_.Ctx, (*in_).Iterator)
return nil, false, err_
case SymlinkGetExtendedAttributeOrdinal:
in_ := &Node2GetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.GetExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case SymlinkSetExtendedAttributeOrdinal:
in_ := &Node2SetExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.SetExtendedAttribute(args_.Ctx, (*in_).Name, (*in_).Value, (*in_).Mode)
out_ := &payload
return out_, true, err_
case SymlinkRemoveExtendedAttributeOrdinal:
in_ := &Node2RemoveExtendedAttributeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.RemoveExtendedAttribute(args_.Ctx, (*in_).Name)
out_ := &payload
return out_, true, err_
case SymlinkDescribeOrdinal:
payload, err_ := s_.Impl.Describe(args_.Ctx)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type SymlinkEventProxy _bindings.ChannelProxy
func (p *SymlinkEventProxy) OnOpen(s int32, info *NodeInfoDeprecated) error {
event_ := &Node1OnOpenRequest{S: s, Info: info}
return ((*_bindings.ChannelProxy)(p)).Send(SymlinkOnOpenOrdinal, event_)
}
func (p *SymlinkEventProxy) OnRepresentation(payload Representation) error {
event_ := &payload
return ((*_bindings.ChannelProxy)(p)).Send(SymlinkOnRepresentationOrdinal, event_)
}
const (
WritableWriteOrdinal uint64 = 0x6a31437832469f82
)
type WritableWithCtxInterface _bindings.ChannelProxy
// Writes data at the seek offset.
// The seek offset is moved forward by the number of bytes written.
// If the file is in append mode, the seek offset is first set to the end
// of the file, followed by the write, in one atomic step.
//
// The file size may grow if the seek offset plus `data.length` is beyond
// the current end of file.
//
// + request `data` the byte buffer to write to the file.
// - response `actual_count` the number of bytes written.
//
// ## Invariants
//
// - The returned `actual_count` will never be greater than `data.length`.
// - If the server is unable to write all the data due to e.g. not enough
// space, `actual_count` may be less than `data.length`. If no bytes
// could be written, an error is returned.
// - If `data.length` is zero, the server should perform all the checks
// ensuring write access without mutating the file and return a
// successful write of zero bytes. The seek offset is still updated if
// in append mode.
//
// This method requires the [`Rights.WRITE_BYTES`] right.
func (p *WritableWithCtxInterface) Write(ctx_ _bindings.Context, data []uint8) (WritableWriteResult, error) {
req_ := &WritableWriteRequest{Data: data}
resp_ := &WritableWriteResult{}
err_ := ((*_bindings.ChannelProxy)(p)).Call(WritableWriteOrdinal, req_, resp_)
return (*resp_), err_
}
type WritableWithCtx interface {
// Writes data at the seek offset.
// The seek offset is moved forward by the number of bytes written.
// If the file is in append mode, the seek offset is first set to the end
// of the file, followed by the write, in one atomic step.
//
// The file size may grow if the seek offset plus `data.length` is beyond
// the current end of file.
//
// + request `data` the byte buffer to write to the file.
// - response `actual_count` the number of bytes written.
//
// ## Invariants
//
// * The returned `actual_count` will never be greater than `data.length`.
// * If the server is unable to write all the data due to e.g. not enough
// space, `actual_count` may be less than `data.length`. If no bytes
// could be written, an error is returned.
// * If `data.length` is zero, the server should perform all the checks
// ensuring write access without mutating the file and return a
// successful write of zero bytes. The seek offset is still updated if
// in append mode.
//
// This method requires the [`Rights.WRITE_BYTES`] right.
Write(ctx_ _bindings.Context, data []uint8) (WritableWriteResult, error)
}
type WritableWithCtxTransitionalBase struct{}
type WritableWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewWritableWithCtxInterfaceRequest() (WritableWithCtxInterfaceRequest, *WritableWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return WritableWithCtxInterfaceRequest(req), (*WritableWithCtxInterface)(cli), err
}
type WritableWithCtxStub struct {
Impl WritableWithCtx
}
func (s_ *WritableWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case WritableWriteOrdinal:
in_ := &WritableWriteRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if err_ := _bindings.Unmarshal(marshalerCtx, args_.Bytes, args_.HandleInfos, in_); err_ != nil {
return nil, false, err_
}
payload, err_ := s_.Impl.Write(args_.Ctx, (*in_).Data)
out_ := &payload
return out_, true, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type WritableEventProxy _bindings.ChannelProxy