#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub type Abilities = Operations;
pub type ExtendedAttributeName = Vec<u8>;
pub type Id = u64;
pub type Name = String;
pub type Path = String;
pub type Rights = Operations;
pub type SymlinkTarget = Vec<u8>;
pub type Token = fidl::Event;
pub type Transfer = Vec<u8>;
pub const DIRECTORY_PROTOCOL_NAME: &str = "fuchsia.io/Directory";
pub const FILE_PROTOCOL_NAME: &str = "fuchsia.io/File";
pub const INHERITED_WRITE_PERMISSIONS: Operations = Operations::from_bits_truncate(356);
pub const INO_UNKNOWN: u64 = 18446744073709551615;
pub const MASK_KNOWN_PERMISSIONS: Flags = Flags::from_bits_truncate(25087);
pub const MASK_KNOWN_PROTOCOLS: Flags = Flags::from_bits_truncate(30069489664);
pub const MASK_PERMISSION_FLAGS: u64 = 65535;
pub const MASK_POSIX_FLAGS: u64 = 4294967295;
pub const MAX_ATTRIBUTE_NAME: u64 = 255;
pub const MAX_BUF: u64 = 8192;
pub const MAX_FILENAME: u64 = 255;
pub const MAX_FS_NAME_BUFFER: u64 = 32;
pub const MAX_INLINE_ATTRIBUTE_VALUE: u64 = 32768;
pub const MAX_LIST_ATTRIBUTES_CHUNK: u64 = 128;
pub const MAX_NAME_LENGTH: u64 = 255;
pub const MAX_PATH_LENGTH: u64 = 4095;
pub const MAX_SELINUX_CONTEXT_ATTRIBUTE_LEN: u64 = 256;
pub const MAX_TRANSFER_SIZE: u64 = 8192;
pub const MODE_PROTECTION_MASK: u32 = 4095;
pub const MODE_TYPE_BLOCK_DEVICE: u32 = 24576;
pub const MODE_TYPE_DIRECTORY: u32 = 16384;
pub const MODE_TYPE_FILE: u32 = 32768;
pub const MODE_TYPE_MASK: u32 = 1044480;
pub const MODE_TYPE_SERVICE: u32 = 65536;
pub const MODE_TYPE_SYMLINK: u32 = 40960;
pub const NODE_PROTOCOL_NAME: &str = "fuchsia.io/Node";
pub const OPEN_FLAGS_ALLOWED_WITH_NODE_REFERENCE: OpenFlags =
OpenFlags::from_bits_truncate(46661632);
pub const OPEN_RIGHTS: OpenFlags = OpenFlags::from_bits_truncate(11);
pub const PERM_EXECUTABLE: Flags = Flags::from_bits_truncate(201);
pub const PERM_READABLE: Flags = Flags::from_bits_truncate(211);
pub const PERM_WRITABLE: Flags = Flags::from_bits_truncate(485);
pub const RW_STAR_DIR: Operations = Operations::from_bits_truncate(503);
pub const RX_STAR_DIR: Operations = Operations::from_bits_truncate(219);
pub const R_STAR_DIR: Operations = Operations::from_bits_truncate(211);
pub const SELINUX_CONTEXT_NAME: &str = "security.selinux";
pub const SYMLINK_PROTOCOL_NAME: &str = "fuchsia.io/Symlink";
pub const W_STAR_DIR: Operations = Operations::from_bits_truncate(485);
pub const X_STAR_DIR: Operations = Operations::from_bits_truncate(201);
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct AllocateMode: u32 {
const KEEP_SIZE = 1;
const UNSHARE_RANGE = 2;
const PUNCH_HOLE = 4;
const COLLAPSE_RANGE = 8;
const ZERO_RANGE = 16;
const INSERT_RANGE = 32;
}
}
impl AllocateMode {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u32) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ConnectorFlags: u64 {
}
}
impl ConnectorFlags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FileProtocolFlags: u64 {
const APPEND = 1;
const TRUNCATE = 2;
}
}
impl FileProtocolFlags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct FileSignal: u32 {
const READABLE = 16777216;
const WRITABLE = 33554432;
}
}
impl FileSignal {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Flags: u64 {
const PERM_CONNECT = 1;
const PERM_READ = 2;
const PERM_WRITE = 4;
const PERM_EXECUTE = 8;
const PERM_GET_ATTRIBUTES = 16;
const PERM_SET_ATTRIBUTES = 32;
const PERM_ENUMERATE = 64;
const PERM_TRAVERSE = 128;
const PERM_MODIFY = 256;
const PERM_INHERIT_WRITE = 8192;
const PERM_INHERIT_EXECUTE = 16384;
const PROTOCOL_SERVICE = 4294967296;
const PROTOCOL_NODE = 4194304;
const PROTOCOL_DIRECTORY = 524288;
const PROTOCOL_FILE = 8589934592;
const PROTOCOL_SYMLINK = 17179869184;
const FLAG_SEND_REPRESENTATION = 1099511627776;
const FLAG_MAYBE_CREATE = 65536;
const FLAG_MUST_CREATE = 131072;
const FILE_APPEND = 1048576;
const FILE_TRUNCATE = 262144;
}
}
impl Flags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct ModeType: u32 {
const DO_NOT_USE = 2147483648;
}
}
impl ModeType {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NodeAttributeFlags: u32 {
const CREATION_TIME = 1;
const MODIFICATION_TIME = 2;
}
}
impl NodeAttributeFlags {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NodeAttributesQuery: u64 {
const PROTOCOLS = 1;
const ABILITIES = 2;
const CONTENT_SIZE = 4;
const STORAGE_SIZE = 8;
const LINK_COUNT = 16;
const ID = 32;
const CREATION_TIME = 64;
const MODIFICATION_TIME = 128;
const MODE = 256;
const UID = 512;
const GID = 1024;
const RDEV = 2048;
const ACCESS_TIME = 4096;
const CHANGE_TIME = 8192;
const OPTIONS = 16384;
const ROOT_HASH = 32768;
const VERITY_ENABLED = 65536;
const CASEFOLD = 131072;
const SELINUX_CONTEXT = 262144;
const WRAPPING_KEY_ID = 524288;
}
}
impl NodeAttributesQuery {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NodeFlags: u64 {
const GET_REPRESENTATION = 1;
}
}
impl NodeFlags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NodeProtocolFlags: u64 {
const MUST_BE_DIRECTORY = 1;
}
}
impl NodeProtocolFlags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NodeProtocolKinds: u64 {
const CONNECTOR = 1;
const DIRECTORY = 2;
const FILE = 4;
const SYMLINK = 8;
}
}
impl NodeProtocolKinds {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct OpenFlags: u32 {
const RIGHT_READABLE = 1;
const RIGHT_WRITABLE = 2;
const RIGHT_EXECUTABLE = 8;
const CREATE = 65536;
const CREATE_IF_ABSENT = 131072;
const TRUNCATE = 262144;
const DIRECTORY = 524288;
const APPEND = 1048576;
const NODE_REFERENCE = 4194304;
const DESCRIBE = 8388608;
const POSIX_WRITABLE = 134217728;
const POSIX_EXECUTABLE = 268435456;
const NOT_DIRECTORY = 33554432;
const CLONE_SAME_RIGHTS = 67108864;
const BLOCK_DEVICE = 16777216;
}
}
impl OpenFlags {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Operations: u64 {
const CONNECT = 1;
const READ_BYTES = 2;
const WRITE_BYTES = 4;
const EXECUTE = 8;
const GET_ATTRIBUTES = 16;
const UPDATE_ATTRIBUTES = 32;
const ENUMERATE = 64;
const TRAVERSE = 128;
const MODIFY_DIRECTORY = 256;
}
}
impl Operations {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SymlinkProtocolFlags: u64 {
}
}
impl SymlinkProtocolFlags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct UnlinkFlags: u64 {
const MUST_BE_DIRECTORY = 1;
}
}
impl UnlinkFlags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u64) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
self.bits() & !Self::all().bits()
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct VmoFlags: u32 {
const READ = 1;
const WRITE = 2;
const EXECUTE = 4;
const PRIVATE_CLONE = 65536;
const SHARED_BUFFER = 131072;
}
}
impl VmoFlags {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct WatchMask: u32 {
const DELETED = 1;
const ADDED = 2;
const REMOVED = 4;
const EXISTING = 8;
const IDLE = 16;
}
}
impl WatchMask {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum AdvisoryLockType {
Read = 1,
Write = 2,
Unlock = 3,
}
impl AdvisoryLockType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Read),
2 => Some(Self::Write),
3 => Some(Self::Unlock),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum CreationMode {
Never = 0,
NeverDeprecated = 1,
AllowExisting = 2,
Always = 3,
}
impl CreationMode {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Never),
1 => Some(Self::NeverDeprecated),
2 => Some(Self::AllowExisting),
3 => Some(Self::Always),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum DirentType {
Unknown,
Directory,
BlockDevice,
File,
Symlink,
Service,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u8 },
}
#[macro_export]
macro_rules! DirentTypeUnknown {
() => {
_
};
}
impl DirentType {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::Unknown),
4 => Some(Self::Directory),
6 => Some(Self::BlockDevice),
8 => Some(Self::File),
10 => Some(Self::Symlink),
16 => Some(Self::Service),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u8) -> Self {
match prim {
0 => Self::Unknown,
4 => Self::Directory,
6 => Self::BlockDevice,
8 => Self::File,
10 => Self::Symlink,
16 => Self::Service,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xff }
}
#[inline]
pub const fn into_primitive(self) -> u8 {
match self {
Self::Unknown => 0,
Self::Directory => 4,
Self::BlockDevice => 6,
Self::File => 8,
Self::Symlink => 10,
Self::Service => 16,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum HashAlgorithm {
Sha256,
Sha512,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u8,
},
}
#[macro_export]
macro_rules! HashAlgorithmUnknown {
() => {
_
};
}
impl HashAlgorithm {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Sha256),
2 => Some(Self::Sha512),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u8) -> Self {
match prim {
1 => Self::Sha256,
2 => Self::Sha512,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xff }
}
#[inline]
pub const fn into_primitive(self) -> u8 {
match self {
Self::Sha256 => 1,
Self::Sha512 => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum SeekOrigin {
Start = 0,
Current = 1,
End = 2,
}
impl SeekOrigin {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Start),
1 => Some(Self::Current),
2 => Some(Self::End),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum SetExtendedAttributeMode {
Set = 1,
Create = 2,
Replace = 3,
}
impl SetExtendedAttributeMode {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Set),
2 => Some(Self::Create),
3 => Some(Self::Replace),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum WatchEvent {
Deleted = 0,
Added = 1,
Removed = 2,
Existing = 3,
Idle = 4,
}
impl WatchEvent {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::Deleted),
1 => Some(Self::Added),
2 => Some(Self::Removed),
3 => Some(Self::Existing),
4 => Some(Self::Idle),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct AdvisoryLockRange {
pub origin: SeekOrigin,
pub offset: i64,
pub length: i64,
}
impl fidl::Persistable for AdvisoryLockRange {}
#[derive(Clone, Debug, PartialEq)]
pub struct AdvisoryLockingAdvisoryLockRequest {
pub request: AdvisoryLockRequest,
}
impl fidl::Persistable for AdvisoryLockingAdvisoryLockRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirectoryCreateSymlinkRequest {
pub name: String,
pub target: Vec<u8>,
pub connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryCreateSymlinkRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirectoryGetTokenResponse {
pub s: i32,
pub token: Option<fidl::Handle>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryGetTokenResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirectoryLinkRequest {
pub src: String,
pub dst_parent_token: fidl::Handle,
pub dst: String,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryLinkRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DirectoryLinkResponse {
pub s: i32,
}
impl fidl::Persistable for DirectoryLinkResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirectoryObject;
impl fidl::Persistable for DirectoryObject {}
#[derive(Debug, PartialEq)]
pub struct DirectoryOpen2Request {
pub path: String,
pub protocols: ConnectionProtocols,
pub object_request: fidl::Channel,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryOpen2Request {}
#[derive(Debug, PartialEq)]
pub struct DirectoryOpen3Request {
pub path: String,
pub flags: Flags,
pub options: Options,
pub object: fidl::Channel,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryOpen3Request {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirectoryOpenRequest {
pub flags: OpenFlags,
pub mode: ModeType,
pub path: String,
pub object: fidl::endpoints::ServerEnd<NodeMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryOpenRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DirectoryReadDirentsRequest {
pub max_bytes: u64,
}
impl fidl::Persistable for DirectoryReadDirentsRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirectoryReadDirentsResponse {
pub s: i32,
pub dirents: Vec<u8>,
}
impl fidl::Persistable for DirectoryReadDirentsResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirectoryRenameRequest {
pub src: String,
pub dst_parent_token: fidl::Event,
pub dst: String,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryRenameRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DirectoryRewindResponse {
pub s: i32,
}
impl fidl::Persistable for DirectoryRewindResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct DirectoryUnlinkRequest {
pub name: String,
pub options: UnlinkOptions,
}
impl fidl::Persistable for DirectoryUnlinkRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirectoryWatchRequest {
pub mask: WatchMask,
pub options: u32,
pub watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirectoryWatchRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DirectoryWatchResponse {
pub s: i32,
}
impl fidl::Persistable for DirectoryWatchResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct EmptyStruct;
impl fidl::Persistable for EmptyStruct {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ExtendedAttributeIteratorGetNextResponse {
pub attributes: Vec<Vec<u8>>,
pub last: bool,
}
impl fidl::Persistable for ExtendedAttributeIteratorGetNextResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FileAllocateRequest {
pub offset: u64,
pub length: u64,
pub mode: AllocateMode,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileAllocateRequest {}
#[derive(Debug, PartialEq)]
pub struct FileEnableVerityRequest {
pub options: VerificationOptions,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileEnableVerityRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FileGetBackingMemoryRequest {
pub flags: VmoFlags,
}
impl fidl::Persistable for FileGetBackingMemoryRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FileObject {
pub event: Option<fidl::Event>,
pub stream: Option<fidl::Stream>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct FileReadAtRequest {
pub count: u64,
pub offset: u64,
}
impl fidl::Persistable for FileReadAtRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct FileResizeRequest {
pub length: u64,
}
impl fidl::Persistable for FileResizeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FileSeekRequest {
pub origin: SeekOrigin,
pub offset: i64,
}
impl fidl::Persistable for FileSeekRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FileWriteAtRequest {
pub data: Vec<u8>,
pub offset: u64,
}
impl fidl::Persistable for FileWriteAtRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FileGetBackingMemoryResponse {
pub vmo: fidl::Vmo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for FileGetBackingMemoryResponse
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FileReadAtResponse {
pub data: Vec<u8>,
}
impl fidl::Persistable for FileReadAtResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct FileSeekResponse {
pub offset_from_start: u64,
}
impl fidl::Persistable for FileSeekResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct FileWriteAtResponse {
pub actual_count: u64,
}
impl fidl::Persistable for FileWriteAtResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct FilesystemInfo {
pub total_bytes: u64,
pub used_bytes: u64,
pub total_nodes: u64,
pub used_nodes: u64,
pub free_shared_pool_bytes: u64,
pub fs_id: u64,
pub block_size: u32,
pub max_filename_size: u32,
pub fs_type: u32,
pub padding: u32,
pub name: [i8; 32],
}
impl fidl::Persistable for FilesystemInfo {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LinkableLinkIntoRequest {
pub dst_parent_token: fidl::Event,
pub dst: String,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LinkableLinkIntoRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct NodeAttributes {
pub mode: u32,
pub id: u64,
pub content_size: u64,
pub storage_size: u64,
pub link_count: u64,
pub creation_time: u64,
pub modification_time: u64,
}
impl fidl::Persistable for NodeAttributes {}
#[derive(Clone, Debug, PartialEq)]
pub struct NodeAttributes2 {
pub mutable_attributes: MutableNodeAttributes,
pub immutable_attributes: ImmutableNodeAttributes,
}
impl fidl::Persistable for NodeAttributes2 {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeCloneRequest {
pub flags: OpenFlags,
pub object: fidl::endpoints::ServerEnd<NodeMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeCloneRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct NodeGetAttrResponse {
pub s: i32,
pub attributes: NodeAttributes,
}
impl fidl::Persistable for NodeGetAttrResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeGetAttributesRequest {
pub query: NodeAttributesQuery,
}
impl fidl::Persistable for NodeGetAttributesRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeGetExtendedAttributeRequest {
pub name: Vec<u8>,
}
impl fidl::Persistable for NodeGetExtendedAttributeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeGetFlagsResponse {
pub s: i32,
pub flags: OpenFlags,
}
impl fidl::Persistable for NodeGetFlagsResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeListExtendedAttributesRequest {
pub iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for NodeListExtendedAttributesRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeOnOpenRequest {
pub s: i32,
pub info: Option<Box<NodeInfoDeprecated>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeOnOpenRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeQueryFilesystemResponse {
pub s: i32,
pub info: Option<Box<FilesystemInfo>>,
}
impl fidl::Persistable for NodeQueryFilesystemResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeRemoveExtendedAttributeRequest {
pub name: Vec<u8>,
}
impl fidl::Persistable for NodeRemoveExtendedAttributeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeSetAttrRequest {
pub flags: NodeAttributeFlags,
pub attributes: NodeAttributes,
}
impl fidl::Persistable for NodeSetAttrRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct NodeSetAttrResponse {
pub s: i32,
}
impl fidl::Persistable for NodeSetAttrResponse {}
#[derive(Debug, PartialEq)]
pub struct NodeSetExtendedAttributeRequest {
pub name: Vec<u8>,
pub value: ExtendedAttributeValue,
pub mode: SetExtendedAttributeMode,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for NodeSetExtendedAttributeRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NodeSetFlagsRequest {
pub flags: OpenFlags,
}
impl fidl::Persistable for NodeSetFlagsRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct NodeSetFlagsResponse {
pub s: i32,
}
impl fidl::Persistable for NodeSetFlagsResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ReadableReadRequest {
pub count: u64,
}
impl fidl::Persistable for ReadableReadRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ReadableReadResponse {
pub data: Vec<u8>,
}
impl fidl::Persistable for ReadableReadResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Service;
impl fidl::Persistable for Service {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SymlinkObject {
pub target: Vec<u8>,
}
impl fidl::Persistable for SymlinkObject {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WritableWriteRequest {
pub data: Vec<u8>,
}
impl fidl::Persistable for WritableWriteRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct WritableWriteResponse {
pub actual_count: u64,
}
impl fidl::Persistable for WritableWriteResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct AdvisoryLockRequest {
pub type_: Option<AdvisoryLockType>,
pub range: Option<AdvisoryLockRange>,
pub wait: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for AdvisoryLockRequest {}
#[derive(Debug, Default, PartialEq)]
pub struct ConnectionInfo {
pub rights: Option<Operations>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ConnectionInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ConnectorInfo {
pub attributes: Option<NodeAttributes2>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ConnectorInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DirectoryInfo {
pub attributes: Option<NodeAttributes2>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DirectoryInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DirectoryProtocolOptions {
pub optional_rights: Option<Operations>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DirectoryProtocolOptions {}
#[derive(Debug, Default, PartialEq)]
pub struct FileInfo {
pub is_append: Option<bool>,
pub observer: Option<fidl::Event>,
pub stream: Option<fidl::Stream>,
pub attributes: Option<NodeAttributes2>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ImmutableNodeAttributes {
pub protocols: Option<NodeProtocolKinds>,
pub abilities: Option<Operations>,
pub content_size: Option<u64>,
pub storage_size: Option<u64>,
pub link_count: Option<u64>,
pub id: Option<u64>,
pub change_time: Option<u64>,
pub options: Option<VerificationOptions>,
pub root_hash: Option<Vec<u8>>,
pub verity_enabled: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ImmutableNodeAttributes {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct MutableNodeAttributes {
pub creation_time: Option<u64>,
pub modification_time: Option<u64>,
pub mode: Option<u32>,
pub uid: Option<u32>,
pub gid: Option<u32>,
pub rdev: Option<u64>,
pub access_time: Option<u64>,
pub casefold: Option<bool>,
pub selinux_context: Option<SelinuxContext>,
pub wrapping_key_id: Option<[u8; 16]>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for MutableNodeAttributes {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct NodeOptions {
pub flags: Option<NodeFlags>,
pub protocols: Option<NodeProtocols>,
pub mode: Option<CreationMode>,
pub rights: Option<Operations>,
pub attributes: Option<NodeAttributesQuery>,
pub create_attributes: Option<MutableNodeAttributes>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for NodeOptions {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct NodeProtocols {
pub directory: Option<DirectoryProtocolOptions>,
pub file: Option<FileProtocolFlags>,
pub symlink: Option<SymlinkProtocolFlags>,
pub node: Option<NodeProtocolFlags>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for NodeProtocols {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Options {
pub attributes: Option<NodeAttributesQuery>,
pub create_attributes: Option<MutableNodeAttributes>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Options {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct SymlinkInfo {
pub target: Option<Vec<u8>>,
pub attributes: Option<NodeAttributes2>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for SymlinkInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct UnlinkOptions {
pub flags: Option<UnlinkFlags>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for UnlinkOptions {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct VerificationOptions {
pub hash_algorithm: Option<HashAlgorithm>,
pub salt: Option<Vec<u8>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for VerificationOptions {}
#[derive(Clone, Debug)]
pub enum ConnectionProtocols {
Connector(ConnectorFlags),
Node(NodeOptions),
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u64 },
}
#[macro_export]
macro_rules! ConnectionProtocolsUnknown {
() => {
_
};
}
impl PartialEq for ConnectionProtocols {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Connector(x), Self::Connector(y)) => *x == *y,
(Self::Node(x), Self::Node(y)) => *x == *y,
_ => false,
}
}
}
impl ConnectionProtocols {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Connector(_) => 1,
Self::Node(_) => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for ConnectionProtocols {}
#[derive(Debug)]
pub enum ExtendedAttributeValue {
Bytes(Vec<u8>),
Buffer(fidl::Vmo),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! ExtendedAttributeValueUnknown {
() => {
_
};
}
impl PartialEq for ExtendedAttributeValue {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Bytes(x), Self::Bytes(y)) => *x == *y,
(Self::Buffer(x), Self::Buffer(y)) => *x == *y,
_ => false,
}
}
}
impl ExtendedAttributeValue {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Bytes(_) => 1,
Self::Buffer(_) => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ExtendedAttributeValue {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum NodeInfoDeprecated {
Service(Service),
File(FileObject),
Directory(DirectoryObject),
Symlink(SymlinkObject),
}
impl NodeInfoDeprecated {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Service(_) => 1,
Self::File(_) => 2,
Self::Directory(_) => 3,
Self::Symlink(_) => 4,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NodeInfoDeprecated {}
#[derive(Debug)]
pub enum Representation {
Connector(ConnectorInfo),
Directory(DirectoryInfo),
File(FileInfo),
Symlink(SymlinkInfo),
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u64 },
}
#[macro_export]
macro_rules! RepresentationUnknown {
() => {
_
};
}
impl PartialEq for Representation {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Connector(x), Self::Connector(y)) => *x == *y,
(Self::Directory(x), Self::Directory(y)) => *x == *y,
(Self::File(x), Self::File(y)) => *x == *y,
(Self::Symlink(x), Self::Symlink(y)) => *x == *y,
_ => false,
}
}
}
impl Representation {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Connector(_) => 1,
Self::Directory(_) => 2,
Self::File(_) => 3,
Self::Symlink(_) => 4,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Representation {}
#[derive(Clone, Debug)]
pub enum SelinuxContext {
Data(Vec<u8>),
UseExtendedAttributes(EmptyStruct),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! SelinuxContextUnknown {
() => {
_
};
}
impl PartialEq for SelinuxContext {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Data(x), Self::Data(y)) => *x == *y,
(Self::UseExtendedAttributes(x), Self::UseExtendedAttributes(y)) => *x == *y,
_ => false,
}
}
}
impl SelinuxContext {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Data(_) => 1,
Self::UseExtendedAttributes(_) => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for SelinuxContext {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct AdvisoryLockingMarker;
impl fidl::endpoints::ProtocolMarker for AdvisoryLockingMarker {
type Proxy = AdvisoryLockingProxy;
type RequestStream = AdvisoryLockingRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = AdvisoryLockingSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) AdvisoryLocking";
}
pub type AdvisoryLockingAdvisoryLockResult = Result<(), i32>;
pub trait AdvisoryLockingProxyInterface: Send + Sync {
type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
+ Send;
fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct AdvisoryLockingSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for AdvisoryLockingSynchronousProxy {
type Proxy = AdvisoryLockingProxy;
type Protocol = AdvisoryLockingMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl AdvisoryLockingSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<AdvisoryLockingEvent, fidl::Error> {
AdvisoryLockingEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#advisory_lock(
&self,
mut request: &AdvisoryLockRequest,
___deadline: zx::MonotonicInstant,
) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
let _response = self.client.send_query::<
AdvisoryLockingAdvisoryLockRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(request,),
0x6ee9c0ad53ec87aa,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct AdvisoryLockingProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for AdvisoryLockingProxy {
type Protocol = AdvisoryLockingMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl AdvisoryLockingProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> AdvisoryLockingEventStream {
AdvisoryLockingEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#advisory_lock(
&self,
mut request: &AdvisoryLockRequest,
) -> fidl::client::QueryResponseFut<
AdvisoryLockingAdvisoryLockResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
AdvisoryLockingProxyInterface::r#advisory_lock(self, request)
}
}
impl AdvisoryLockingProxyInterface for AdvisoryLockingProxy {
type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
AdvisoryLockingAdvisoryLockResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6ee9c0ad53ec87aa,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
AdvisoryLockingAdvisoryLockRequest,
AdvisoryLockingAdvisoryLockResult,
>(
(request,),
0x6ee9c0ad53ec87aa,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct AdvisoryLockingEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for AdvisoryLockingEventStream {}
impl futures::stream::FusedStream for AdvisoryLockingEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for AdvisoryLockingEventStream {
type Item = Result<AdvisoryLockingEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(AdvisoryLockingEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum AdvisoryLockingEvent {}
impl AdvisoryLockingEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<AdvisoryLockingEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct AdvisoryLockingRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for AdvisoryLockingRequestStream {}
impl futures::stream::FusedStream for AdvisoryLockingRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for AdvisoryLockingRequestStream {
type Protocol = AdvisoryLockingMarker;
type ControlHandle = AdvisoryLockingControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
AdvisoryLockingControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for AdvisoryLockingRequestStream {
type Item = Result<AdvisoryLockingRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled AdvisoryLockingRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x6ee9c0ad53ec87aa => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
AdvisoryLockingAdvisoryLockRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
AdvisoryLockingControlHandle { inner: this.inner.clone() };
Ok(AdvisoryLockingRequest::AdvisoryLock {
request: req.request,
responder: AdvisoryLockingAdvisoryLockResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<AdvisoryLockingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum AdvisoryLockingRequest {
AdvisoryLock { request: AdvisoryLockRequest, responder: AdvisoryLockingAdvisoryLockResponder },
}
impl AdvisoryLockingRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_advisory_lock(
self,
) -> Option<(AdvisoryLockRequest, AdvisoryLockingAdvisoryLockResponder)> {
if let AdvisoryLockingRequest::AdvisoryLock { request, responder } = self {
Some((request, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
AdvisoryLockingRequest::AdvisoryLock { .. } => "advisory_lock",
}
}
}
#[derive(Debug, Clone)]
pub struct AdvisoryLockingControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for AdvisoryLockingControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl AdvisoryLockingControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct AdvisoryLockingAdvisoryLockResponder {
control_handle: std::mem::ManuallyDrop<AdvisoryLockingControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for AdvisoryLockingAdvisoryLockResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for AdvisoryLockingAdvisoryLockResponder {
type ControlHandle = AdvisoryLockingControlHandle;
fn control_handle(&self) -> &AdvisoryLockingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl AdvisoryLockingAdvisoryLockResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x6ee9c0ad53ec87aa,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DirectoryMarker;
impl fidl::endpoints::ProtocolMarker for DirectoryMarker {
type Proxy = DirectoryProxy;
type RequestStream = DirectoryRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DirectorySynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.io.Directory";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryMarker {}
pub type DirectoryUnlinkResult = Result<(), i32>;
pub type DirectoryRenameResult = Result<(), i32>;
pub type DirectoryCreateSymlinkResult = Result<(), i32>;
pub trait DirectoryProxyInterface: Send + Sync {
type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
+ Send;
fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
fn r#clone2(
&self,
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error>;
type CloseResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
> + Send;
fn r#close(&self) -> Self::CloseResponseFut;
type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
fn r#query(&self) -> Self::QueryResponseFut;
fn r#clone(
&self,
flags: OpenFlags,
object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error>;
type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
+ Send;
fn r#get_attr(&self) -> Self::GetAttrResponseFut;
type SetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_attr(
&self,
flags: NodeAttributeFlags,
attributes: &NodeAttributes,
) -> Self::SetAttrResponseFut;
type GetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
+ Send;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
type SetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_flags(&self, flags: OpenFlags) -> Self::SetFlagsResponseFut;
type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
+ Send;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
type GetConnectionInfoResponseFut: std::future::Future<Output = Result<ConnectionInfo, fidl::Error>>
+ Send;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut;
type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
+ Send;
fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
+ Send;
fn r#update_attributes(
&self,
payload: &MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut;
type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
fn r#sync(&self) -> Self::SyncResponseFut;
fn r#list_extended_attributes(
&self,
iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error>;
type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#set_extended_attribute(
&self,
name: &[u8],
value: ExtendedAttributeValue,
mode: SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut;
type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
fn r#open(
&self,
flags: OpenFlags,
mode: ModeType,
path: &str,
object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error>;
fn r#open2(
&self,
path: &str,
protocols: &ConnectionProtocols,
object_request: fidl::Channel,
) -> Result<(), fidl::Error>;
fn r#open3(
&self,
path: &str,
flags: Flags,
options: &Options,
object: fidl::Channel,
) -> Result<(), fidl::Error>;
type ReadDirentsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
+ Send;
fn r#read_dirents(&self, max_bytes: u64) -> Self::ReadDirentsResponseFut;
type RewindResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#rewind(&self) -> Self::RewindResponseFut;
type GetTokenResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::Handle>), fidl::Error>>
+ Send;
fn r#get_token(&self) -> Self::GetTokenResponseFut;
type LinkResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#link(&self, src: &str, dst_parent_token: fidl::Handle, dst: &str)
-> Self::LinkResponseFut;
type UnlinkResponseFut: std::future::Future<Output = Result<DirectoryUnlinkResult, fidl::Error>>
+ Send;
fn r#unlink(&self, name: &str, options: &UnlinkOptions) -> Self::UnlinkResponseFut;
type RenameResponseFut: std::future::Future<Output = Result<DirectoryRenameResult, fidl::Error>>
+ Send;
fn r#rename(
&self,
src: &str,
dst_parent_token: fidl::Event,
dst: &str,
) -> Self::RenameResponseFut;
type CreateSymlinkResponseFut: std::future::Future<Output = Result<DirectoryCreateSymlinkResult, fidl::Error>>
+ Send;
fn r#create_symlink(
&self,
name: &str,
target: &[u8],
connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
) -> Self::CreateSymlinkResponseFut;
type WatchResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#watch(
&self,
mask: WatchMask,
options: u32,
watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
) -> Self::WatchResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DirectorySynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DirectorySynchronousProxy {
type Proxy = DirectoryProxy;
type Protocol = DirectoryMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl DirectorySynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<DirectoryEvent, fidl::Error> {
DirectoryEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#advisory_lock(
&self,
mut request: &AdvisoryLockRequest,
___deadline: zx::MonotonicInstant,
) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
let _response = self.client.send_query::<
AdvisoryLockingAdvisoryLockRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(request,),
0x6ee9c0ad53ec87aa,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#close(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::QueryableQueryResponse,
>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.protocol)
}
pub fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeCloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_attr(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, NodeAttributes), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.attributes))
}
pub fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<NodeSetAttrRequest, NodeSetAttrResponse>(
(flags, attributes),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#get_flags(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, OpenFlags), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetFlagsResponse>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.flags))
}
pub fn r#set_flags(
&self,
mut flags: OpenFlags,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<NodeSetFlagsRequest, NodeSetFlagsResponse>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#query_filesystem(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.info))
}
pub fn r#get_connection_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ConnectionInfo, fidl::Error> {
let _response = self.client.send_query::<fidl::encoding::EmptyPayload, ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_attributes(
&self,
mut query: NodeAttributesQuery,
___deadline: zx::MonotonicInstant,
) -> Result<NodeGetAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
NodeGetAttributesRequest,
fidl::encoding::ResultType<NodeAttributes2, i32>,
>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
pub fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
___deadline: zx::MonotonicInstant,
) -> Result<NodeUpdateAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
MutableNodeAttributes,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeGetExtendedAttributeRequest,
fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
___deadline: zx::MonotonicInstant,
) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeSetExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeRemoveExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#open(
&self,
mut flags: OpenFlags,
mut mode: ModeType,
mut path: &str,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DirectoryOpenRequest>(
(flags, mode, path, object),
0x2c5044561d685ec0,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#open2(
&self,
mut path: &str,
mut protocols: &ConnectionProtocols,
mut object_request: fidl::Channel,
) -> Result<(), fidl::Error> {
self.client.send::<DirectoryOpen2Request>(
(path, protocols, object_request),
0x2fbc4fbbff7c54d6,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#open3(
&self,
mut path: &str,
mut flags: Flags,
mut options: &Options,
mut object: fidl::Channel,
) -> Result<(), fidl::Error> {
self.client.send::<DirectoryOpen3Request>(
(path, flags, options, object),
0x568ddcb9a9cbb6d9,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#read_dirents(
&self,
mut max_bytes: u64,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Vec<u8>), fidl::Error> {
let _response =
self.client.send_query::<DirectoryReadDirentsRequest, DirectoryReadDirentsResponse>(
(max_bytes,),
0x3582806bf27faa0a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.dirents))
}
pub fn r#rewind(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryRewindResponse>(
(),
0x16b1202af0f34c71,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#get_token(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<fidl::Handle>), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DirectoryGetTokenResponse>(
(),
0x26ae9d18763c8655,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.token))
}
pub fn r#link(
&self,
mut src: &str,
mut dst_parent_token: fidl::Handle,
mut dst: &str,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<DirectoryLinkRequest, DirectoryLinkResponse>(
(src, dst_parent_token, dst),
0x740604c0c7c930e7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#unlink(
&self,
mut name: &str,
mut options: &UnlinkOptions,
___deadline: zx::MonotonicInstant,
) -> Result<DirectoryUnlinkResult, fidl::Error> {
let _response = self.client.send_query::<
DirectoryUnlinkRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name, options,),
0x750a0326a78d7bed,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#rename(
&self,
mut src: &str,
mut dst_parent_token: fidl::Event,
mut dst: &str,
___deadline: zx::MonotonicInstant,
) -> Result<DirectoryRenameResult, fidl::Error> {
let _response = self.client.send_query::<
DirectoryRenameRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(src, dst_parent_token, dst,),
0x7060e7723b9928de,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#create_symlink(
&self,
mut name: &str,
mut target: &[u8],
mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
___deadline: zx::MonotonicInstant,
) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
let _response = self.client.send_query::<
DirectoryCreateSymlinkRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name, target, connection,),
0x21ce0f19ec043889,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#watch(
&self,
mut mask: WatchMask,
mut options: u32,
mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<DirectoryWatchRequest, DirectoryWatchResponse>(
(mask, options, watcher),
0x5717193a59d66d91,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
}
#[derive(Debug, Clone)]
pub struct DirectoryProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DirectoryProxy {
type Protocol = DirectoryMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl DirectoryProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DirectoryEventStream {
DirectoryEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#advisory_lock(
&self,
mut request: &AdvisoryLockRequest,
) -> fidl::client::QueryResponseFut<
AdvisoryLockingAdvisoryLockResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#advisory_lock(self, request)
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
DirectoryProxyInterface::r#clone2(self, request)
}
pub fn r#close(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#close(self)
}
pub fn r#query(
&self,
) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DirectoryProxyInterface::r#query(self)
}
pub fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
DirectoryProxyInterface::r#clone(self, flags, object)
}
pub fn r#get_attr(
&self,
) -> fidl::client::QueryResponseFut<
(i32, NodeAttributes),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#get_attr(self)
}
pub fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DirectoryProxyInterface::r#set_attr(self, flags, attributes)
}
pub fn r#get_flags(
&self,
) -> fidl::client::QueryResponseFut<
(i32, OpenFlags),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#get_flags(self)
}
pub fn r#set_flags(
&self,
mut flags: OpenFlags,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DirectoryProxyInterface::r#set_flags(self, flags)
}
pub fn r#query_filesystem(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<Box<FilesystemInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#query_filesystem(self)
}
pub fn r#get_connection_info(
&self,
) -> fidl::client::QueryResponseFut<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DirectoryProxyInterface::r#get_connection_info(self)
}
pub fn r#get_attributes(
&self,
mut query: NodeAttributesQuery,
) -> fidl::client::QueryResponseFut<
NodeGetAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#get_attributes(self, query)
}
pub fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
) -> fidl::client::QueryResponseFut<
NodeUpdateAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#update_attributes(self, payload)
}
pub fn r#sync(
&self,
) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DirectoryProxyInterface::r#sync(self)
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
DirectoryProxyInterface::r#list_extended_attributes(self, iterator)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<
NodeGetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#get_extended_attribute(self, name)
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
) -> fidl::client::QueryResponseFut<
NodeSetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#set_extended_attribute(self, name, value, mode)
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<
NodeRemoveExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#remove_extended_attribute(self, name)
}
pub fn r#open(
&self,
mut flags: OpenFlags,
mut mode: ModeType,
mut path: &str,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
DirectoryProxyInterface::r#open(self, flags, mode, path, object)
}
pub fn r#open2(
&self,
mut path: &str,
mut protocols: &ConnectionProtocols,
mut object_request: fidl::Channel,
) -> Result<(), fidl::Error> {
DirectoryProxyInterface::r#open2(self, path, protocols, object_request)
}
pub fn r#open3(
&self,
mut path: &str,
mut flags: Flags,
mut options: &Options,
mut object: fidl::Channel,
) -> Result<(), fidl::Error> {
DirectoryProxyInterface::r#open3(self, path, flags, options, object)
}
pub fn r#read_dirents(
&self,
mut max_bytes: u64,
) -> fidl::client::QueryResponseFut<(i32, Vec<u8>), fidl::encoding::DefaultFuchsiaResourceDialect>
{
DirectoryProxyInterface::r#read_dirents(self, max_bytes)
}
pub fn r#rewind(
&self,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DirectoryProxyInterface::r#rewind(self)
}
pub fn r#get_token(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<fidl::Handle>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#get_token(self)
}
pub fn r#link(
&self,
mut src: &str,
mut dst_parent_token: fidl::Handle,
mut dst: &str,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DirectoryProxyInterface::r#link(self, src, dst_parent_token, dst)
}
pub fn r#unlink(
&self,
mut name: &str,
mut options: &UnlinkOptions,
) -> fidl::client::QueryResponseFut<
DirectoryUnlinkResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#unlink(self, name, options)
}
pub fn r#rename(
&self,
mut src: &str,
mut dst_parent_token: fidl::Event,
mut dst: &str,
) -> fidl::client::QueryResponseFut<
DirectoryRenameResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#rename(self, src, dst_parent_token, dst)
}
pub fn r#create_symlink(
&self,
mut name: &str,
mut target: &[u8],
mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
) -> fidl::client::QueryResponseFut<
DirectoryCreateSymlinkResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryProxyInterface::r#create_symlink(self, name, target, connection)
}
pub fn r#watch(
&self,
mut mask: WatchMask,
mut options: u32,
mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
DirectoryProxyInterface::r#watch(self, mask, options, watcher)
}
}
impl DirectoryProxyInterface for DirectoryProxy {
type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
AdvisoryLockingAdvisoryLockResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6ee9c0ad53ec87aa,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
AdvisoryLockingAdvisoryLockRequest,
AdvisoryLockingAdvisoryLockResult,
>(
(request,),
0x6ee9c0ad53ec87aa,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
type CloseResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#close(&self) -> Self::CloseResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5ac5d459ad7f657e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::CloseableCloseResult,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryResponseFut =
fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#query(&self) -> Self::QueryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_unknown::QueryableQueryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2658edee9decfc06,
>(_buf?)?;
Ok(_response.protocol)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeCloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetAttrResponseFut = fidl::client::QueryResponseFut<
(i32, NodeAttributes),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_attr(&self) -> Self::GetAttrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, NodeAttributes), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeGetAttrResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x78985e216314dafd,
>(_buf?)?;
Ok((_response.s, _response.attributes))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetAttrResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
) -> Self::SetAttrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeSetAttrResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4186c0f40d938f46,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<NodeSetAttrRequest, i32>(
(flags, attributes),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetFlagsResponseFut = fidl::client::QueryResponseFut<
(i32, OpenFlags),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, OpenFlags), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeGetFlagsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5b88fffb8eda3aa1,
>(_buf?)?;
Ok((_response.s, _response.flags))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetFlagsResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_flags(&self, mut flags: OpenFlags) -> Self::SetFlagsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeSetFlagsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5295b76c71fde733,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<NodeSetFlagsRequest, i32>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
(i32, Option<Box<FilesystemInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeQueryFilesystemResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6f344a1c6b0a0610,
>(_buf?)?;
Ok((_response.s, _response.info))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, Option<Box<FilesystemInfo>>),
>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetConnectionInfoResponseFut = fidl::client::QueryResponseFut<
ConnectionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ConnectionInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ConnectionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x584c377c7c0a6d0b,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetAttributesResponseFut = fidl::client::QueryResponseFut<
NodeGetAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeGetAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<NodeAttributes2, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3d4396a638ea053b,
>(_buf?)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
NodeUpdateAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeUpdateAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3308c1da5a89bf08,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SyncResponseFut = fidl::client::QueryResponseFut<
NodeSyncResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#sync(&self) -> Self::SyncResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeSyncResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c5c27ca0ab5dc49,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeGetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x45ffa3ccfdeb76db,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeGetExtendedAttributeRequest,
NodeGetExtendedAttributeResult,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeSetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4a951362f681f23c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeSetExtendedAttributeRequest,
NodeSetExtendedAttributeResult,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeRemoveExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> Self::RemoveExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7a0b9f3a9bf9032d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeRemoveExtendedAttributeRequest,
NodeRemoveExtendedAttributeResult,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#open(
&self,
mut flags: OpenFlags,
mut mode: ModeType,
mut path: &str,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DirectoryOpenRequest>(
(flags, mode, path, object),
0x2c5044561d685ec0,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#open2(
&self,
mut path: &str,
mut protocols: &ConnectionProtocols,
mut object_request: fidl::Channel,
) -> Result<(), fidl::Error> {
self.client.send::<DirectoryOpen2Request>(
(path, protocols, object_request),
0x2fbc4fbbff7c54d6,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#open3(
&self,
mut path: &str,
mut flags: Flags,
mut options: &Options,
mut object: fidl::Channel,
) -> Result<(), fidl::Error> {
self.client.send::<DirectoryOpen3Request>(
(path, flags, options, object),
0x568ddcb9a9cbb6d9,
fidl::encoding::DynamicFlags::empty(),
)
}
type ReadDirentsResponseFut = fidl::client::QueryResponseFut<
(i32, Vec<u8>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#read_dirents(&self, mut max_bytes: u64) -> Self::ReadDirentsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Vec<u8>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DirectoryReadDirentsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3582806bf27faa0a,
>(_buf?)?;
Ok((_response.s, _response.dirents))
}
self.client.send_query_and_decode::<DirectoryReadDirentsRequest, (i32, Vec<u8>)>(
(max_bytes,),
0x3582806bf27faa0a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RewindResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#rewind(&self) -> Self::RewindResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DirectoryRewindResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x16b1202af0f34c71,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
(),
0x16b1202af0f34c71,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetTokenResponseFut = fidl::client::QueryResponseFut<
(i32, Option<fidl::Handle>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_token(&self) -> Self::GetTokenResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<fidl::Handle>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DirectoryGetTokenResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x26ae9d18763c8655,
>(_buf?)?;
Ok((_response.s, _response.token))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Option<fidl::Handle>)>(
(),
0x26ae9d18763c8655,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type LinkResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#link(
&self,
mut src: &str,
mut dst_parent_token: fidl::Handle,
mut dst: &str,
) -> Self::LinkResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DirectoryLinkResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x740604c0c7c930e7,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<DirectoryLinkRequest, i32>(
(src, dst_parent_token, dst),
0x740604c0c7c930e7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UnlinkResponseFut = fidl::client::QueryResponseFut<
DirectoryUnlinkResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#unlink(&self, mut name: &str, mut options: &UnlinkOptions) -> Self::UnlinkResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DirectoryUnlinkResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x750a0326a78d7bed,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<DirectoryUnlinkRequest, DirectoryUnlinkResult>(
(name, options),
0x750a0326a78d7bed,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RenameResponseFut = fidl::client::QueryResponseFut<
DirectoryRenameResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#rename(
&self,
mut src: &str,
mut dst_parent_token: fidl::Event,
mut dst: &str,
) -> Self::RenameResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DirectoryRenameResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7060e7723b9928de,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<DirectoryRenameRequest, DirectoryRenameResult>(
(src, dst_parent_token, dst),
0x7060e7723b9928de,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CreateSymlinkResponseFut = fidl::client::QueryResponseFut<
DirectoryCreateSymlinkResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_symlink(
&self,
mut name: &str,
mut target: &[u8],
mut connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
) -> Self::CreateSymlinkResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DirectoryCreateSymlinkResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x21ce0f19ec043889,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<DirectoryCreateSymlinkRequest, DirectoryCreateSymlinkResult>(
(name, target, connection),
0x21ce0f19ec043889,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WatchResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#watch(
&self,
mut mask: WatchMask,
mut options: u32,
mut watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
) -> Self::WatchResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DirectoryWatchResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5717193a59d66d91,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<DirectoryWatchRequest, i32>(
(mask, options, watcher),
0x5717193a59d66d91,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DirectoryEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DirectoryEventStream {}
impl futures::stream::FusedStream for DirectoryEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DirectoryEventStream {
type Item = Result<DirectoryEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(DirectoryEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DirectoryEvent {
OnOpen_ {
s: i32,
info: Option<Box<NodeInfoDeprecated>>,
},
OnRepresentation {
payload: Representation,
},
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DirectoryEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
if let DirectoryEvent::OnOpen_ { s, info } = self {
Some((s, info))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_representation(self) -> Option<Representation> {
if let DirectoryEvent::OnRepresentation { payload } = self {
Some((payload))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DirectoryEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
0x7fc7bbb1dbfd1972 => {
let mut out = fidl::new_empty!(
NodeOnOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((DirectoryEvent::OnOpen_ { s: out.s, info: out.info }))
}
0x5cb40567d80a510c => {
let mut out =
fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((DirectoryEvent::OnRepresentation { payload: out }))
}
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(DirectoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DirectoryRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DirectoryRequestStream {}
impl futures::stream::FusedStream for DirectoryRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DirectoryRequestStream {
type Protocol = DirectoryMarker;
type ControlHandle = DirectoryControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
DirectoryControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for DirectoryRequestStream {
type Item = Result<DirectoryRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled DirectoryRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x6ee9c0ad53ec87aa => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
AdvisoryLockingAdvisoryLockRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::AdvisoryLock {
request: req.request,
responder: DirectoryAdvisoryLockResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x20d8a7aba2168a79 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_unknown::CloneableClone2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableClone2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Clone2 { request: req.request, control_handle })
}
0x5ac5d459ad7f657e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Close {
responder: DirectoryCloseResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2658edee9decfc06 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Query {
responder: DirectoryQueryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5a61678f293ce16f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
NodeCloneRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeCloneRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Clone {
flags: req.flags,
object: req.object,
control_handle,
})
}
0x78985e216314dafd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::GetAttr {
responder: DirectoryGetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4186c0f40d938f46 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetAttrRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::SetAttr {
flags: req.flags,
attributes: req.attributes,
responder: DirectorySetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5b88fffb8eda3aa1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::GetFlags {
responder: DirectoryGetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5295b76c71fde733 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetFlagsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::SetFlags {
flags: req.flags,
responder: DirectorySetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6f344a1c6b0a0610 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::QueryFilesystem {
responder: DirectoryQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x584c377c7c0a6d0b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::GetConnectionInfo {
responder: DirectoryGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3d4396a638ea053b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeGetAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::GetAttributes {
query: req.query,
responder: DirectoryGetAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3308c1da5a89bf08 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
MutableNodeAttributes,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::UpdateAttributes {
payload: req,
responder: DirectoryUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2c5c27ca0ab5dc49 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Sync {
responder: DirectorySyncResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4b61033de007fcd0 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
NodeListExtendedAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::ListExtendedAttributes {
iterator: req.iterator,
control_handle,
})
}
0x45ffa3ccfdeb76db => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeGetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::GetExtendedAttribute {
name: req.name,
responder: DirectoryGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4a951362f681f23c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::SetExtendedAttribute {
name: req.name,
value: req.value,
mode: req.mode,
responder: DirectorySetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a0b9f3a9bf9032d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeRemoveExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::RemoveExtendedAttribute {
name: req.name,
responder: DirectoryRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2c5044561d685ec0 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DirectoryOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryOpenRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Open {
flags: req.flags,
mode: req.mode,
path: req.path,
object: req.object,
control_handle,
})
}
0x2fbc4fbbff7c54d6 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DirectoryOpen2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryOpen2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Open2 {
path: req.path,
protocols: req.protocols,
object_request: req.object_request,
control_handle,
})
}
0x568ddcb9a9cbb6d9 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DirectoryOpen3Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryOpen3Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Open3 {
path: req.path,
flags: req.flags,
options: req.options,
object: req.object,
control_handle,
})
}
0x3582806bf27faa0a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DirectoryReadDirentsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryReadDirentsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::ReadDirents {
max_bytes: req.max_bytes,
responder: DirectoryReadDirentsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x16b1202af0f34c71 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Rewind {
responder: DirectoryRewindResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x26ae9d18763c8655 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::GetToken {
responder: DirectoryGetTokenResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x740604c0c7c930e7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DirectoryLinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryLinkRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Link {
src: req.src,
dst_parent_token: req.dst_parent_token,
dst: req.dst,
responder: DirectoryLinkResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x750a0326a78d7bed => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DirectoryUnlinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryUnlinkRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Unlink {
name: req.name,
options: req.options,
responder: DirectoryUnlinkResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7060e7723b9928de => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DirectoryRenameRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryRenameRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Rename {
src: req.src,
dst_parent_token: req.dst_parent_token,
dst: req.dst,
responder: DirectoryRenameResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x21ce0f19ec043889 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DirectoryCreateSymlinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryCreateSymlinkRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::CreateSymlink {
name: req.name,
target: req.target,
connection: req.connection,
responder: DirectoryCreateSymlinkResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5717193a59d66d91 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DirectoryWatchRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirectoryWatchRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirectoryControlHandle { inner: this.inner.clone() };
Ok(DirectoryRequest::Watch {
mask: req.mask,
options: req.options,
watcher: req.watcher,
responder: DirectoryWatchResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(DirectoryRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirectoryControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(DirectoryRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirectoryControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DirectoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DirectoryRequest {
AdvisoryLock {
request: AdvisoryLockRequest,
responder: DirectoryAdvisoryLockResponder,
},
Clone2 {
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
control_handle: DirectoryControlHandle,
},
Close {
responder: DirectoryCloseResponder,
},
Query {
responder: DirectoryQueryResponder,
},
Clone {
flags: OpenFlags,
object: fidl::endpoints::ServerEnd<NodeMarker>,
control_handle: DirectoryControlHandle,
},
GetAttr {
responder: DirectoryGetAttrResponder,
},
SetAttr {
flags: NodeAttributeFlags,
attributes: NodeAttributes,
responder: DirectorySetAttrResponder,
},
GetFlags {
responder: DirectoryGetFlagsResponder,
},
SetFlags {
flags: OpenFlags,
responder: DirectorySetFlagsResponder,
},
QueryFilesystem {
responder: DirectoryQueryFilesystemResponder,
},
GetConnectionInfo {
responder: DirectoryGetConnectionInfoResponder,
},
GetAttributes {
query: NodeAttributesQuery,
responder: DirectoryGetAttributesResponder,
},
UpdateAttributes {
payload: MutableNodeAttributes,
responder: DirectoryUpdateAttributesResponder,
},
Sync {
responder: DirectorySyncResponder,
},
ListExtendedAttributes {
iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
control_handle: DirectoryControlHandle,
},
GetExtendedAttribute {
name: Vec<u8>,
responder: DirectoryGetExtendedAttributeResponder,
},
SetExtendedAttribute {
name: Vec<u8>,
value: ExtendedAttributeValue,
mode: SetExtendedAttributeMode,
responder: DirectorySetExtendedAttributeResponder,
},
RemoveExtendedAttribute {
name: Vec<u8>,
responder: DirectoryRemoveExtendedAttributeResponder,
},
Open {
flags: OpenFlags,
mode: ModeType,
path: String,
object: fidl::endpoints::ServerEnd<NodeMarker>,
control_handle: DirectoryControlHandle,
},
Open2 {
path: String,
protocols: ConnectionProtocols,
object_request: fidl::Channel,
control_handle: DirectoryControlHandle,
},
Open3 {
path: String,
flags: Flags,
options: Options,
object: fidl::Channel,
control_handle: DirectoryControlHandle,
},
ReadDirents {
max_bytes: u64,
responder: DirectoryReadDirentsResponder,
},
Rewind {
responder: DirectoryRewindResponder,
},
GetToken {
responder: DirectoryGetTokenResponder,
},
Link {
src: String,
dst_parent_token: fidl::Handle,
dst: String,
responder: DirectoryLinkResponder,
},
Unlink {
name: String,
options: UnlinkOptions,
responder: DirectoryUnlinkResponder,
},
Rename {
src: String,
dst_parent_token: fidl::Event,
dst: String,
responder: DirectoryRenameResponder,
},
CreateSymlink {
name: String,
target: Vec<u8>,
connection: Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
responder: DirectoryCreateSymlinkResponder,
},
Watch {
mask: WatchMask,
options: u32,
watcher: fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
responder: DirectoryWatchResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DirectoryControlHandle,
method_type: fidl::MethodType,
},
}
impl DirectoryRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_advisory_lock(
self,
) -> Option<(AdvisoryLockRequest, DirectoryAdvisoryLockResponder)> {
if let DirectoryRequest::AdvisoryLock { request, responder } = self {
Some((request, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone2(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
DirectoryControlHandle,
)> {
if let DirectoryRequest::Clone2 { request, control_handle } = self {
Some((request, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_close(self) -> Option<(DirectoryCloseResponder)> {
if let DirectoryRequest::Close { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query(self) -> Option<(DirectoryQueryResponder)> {
if let DirectoryRequest::Query { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone(
self,
) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, DirectoryControlHandle)> {
if let DirectoryRequest::Clone { flags, object, control_handle } = self {
Some((flags, object, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attr(self) -> Option<(DirectoryGetAttrResponder)> {
if let DirectoryRequest::GetAttr { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_attr(
self,
) -> Option<(NodeAttributeFlags, NodeAttributes, DirectorySetAttrResponder)> {
if let DirectoryRequest::SetAttr { flags, attributes, responder } = self {
Some((flags, attributes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_flags(self) -> Option<(DirectoryGetFlagsResponder)> {
if let DirectoryRequest::GetFlags { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_flags(self) -> Option<(OpenFlags, DirectorySetFlagsResponder)> {
if let DirectoryRequest::SetFlags { flags, responder } = self {
Some((flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_filesystem(self) -> Option<(DirectoryQueryFilesystemResponder)> {
if let DirectoryRequest::QueryFilesystem { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_connection_info(self) -> Option<(DirectoryGetConnectionInfoResponder)> {
if let DirectoryRequest::GetConnectionInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attributes(
self,
) -> Option<(NodeAttributesQuery, DirectoryGetAttributesResponder)> {
if let DirectoryRequest::GetAttributes { query, responder } = self {
Some((query, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_update_attributes(
self,
) -> Option<(MutableNodeAttributes, DirectoryUpdateAttributesResponder)> {
if let DirectoryRequest::UpdateAttributes { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_sync(self) -> Option<(DirectorySyncResponder)> {
if let DirectoryRequest::Sync { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_extended_attributes(
self,
) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, DirectoryControlHandle)>
{
if let DirectoryRequest::ListExtendedAttributes { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_extended_attribute(
self,
) -> Option<(Vec<u8>, DirectoryGetExtendedAttributeResponder)> {
if let DirectoryRequest::GetExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_extended_attribute(
self,
) -> Option<(
Vec<u8>,
ExtendedAttributeValue,
SetExtendedAttributeMode,
DirectorySetExtendedAttributeResponder,
)> {
if let DirectoryRequest::SetExtendedAttribute { name, value, mode, responder } = self {
Some((name, value, mode, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove_extended_attribute(
self,
) -> Option<(Vec<u8>, DirectoryRemoveExtendedAttributeResponder)> {
if let DirectoryRequest::RemoveExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_open(
self,
) -> Option<(
OpenFlags,
ModeType,
String,
fidl::endpoints::ServerEnd<NodeMarker>,
DirectoryControlHandle,
)> {
if let DirectoryRequest::Open { flags, mode, path, object, control_handle } = self {
Some((flags, mode, path, object, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_open2(
self,
) -> Option<(String, ConnectionProtocols, fidl::Channel, DirectoryControlHandle)> {
if let DirectoryRequest::Open2 { path, protocols, object_request, control_handle } = self {
Some((path, protocols, object_request, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_open3(
self,
) -> Option<(String, Flags, Options, fidl::Channel, DirectoryControlHandle)> {
if let DirectoryRequest::Open3 { path, flags, options, object, control_handle } = self {
Some((path, flags, options, object, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_read_dirents(self) -> Option<(u64, DirectoryReadDirentsResponder)> {
if let DirectoryRequest::ReadDirents { max_bytes, responder } = self {
Some((max_bytes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_rewind(self) -> Option<(DirectoryRewindResponder)> {
if let DirectoryRequest::Rewind { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_token(self) -> Option<(DirectoryGetTokenResponder)> {
if let DirectoryRequest::GetToken { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_link(self) -> Option<(String, fidl::Handle, String, DirectoryLinkResponder)> {
if let DirectoryRequest::Link { src, dst_parent_token, dst, responder } = self {
Some((src, dst_parent_token, dst, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_unlink(self) -> Option<(String, UnlinkOptions, DirectoryUnlinkResponder)> {
if let DirectoryRequest::Unlink { name, options, responder } = self {
Some((name, options, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_rename(self) -> Option<(String, fidl::Event, String, DirectoryRenameResponder)> {
if let DirectoryRequest::Rename { src, dst_parent_token, dst, responder } = self {
Some((src, dst_parent_token, dst, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_symlink(
self,
) -> Option<(
String,
Vec<u8>,
Option<fidl::endpoints::ServerEnd<SymlinkMarker>>,
DirectoryCreateSymlinkResponder,
)> {
if let DirectoryRequest::CreateSymlink { name, target, connection, responder } = self {
Some((name, target, connection, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch(
self,
) -> Option<(
WatchMask,
u32,
fidl::endpoints::ServerEnd<DirectoryWatcherMarker>,
DirectoryWatchResponder,
)> {
if let DirectoryRequest::Watch { mask, options, watcher, responder } = self {
Some((mask, options, watcher, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DirectoryRequest::AdvisoryLock { .. } => "advisory_lock",
DirectoryRequest::Clone2 { .. } => "clone2",
DirectoryRequest::Close { .. } => "close",
DirectoryRequest::Query { .. } => "query",
DirectoryRequest::Clone { .. } => "clone",
DirectoryRequest::GetAttr { .. } => "get_attr",
DirectoryRequest::SetAttr { .. } => "set_attr",
DirectoryRequest::GetFlags { .. } => "get_flags",
DirectoryRequest::SetFlags { .. } => "set_flags",
DirectoryRequest::QueryFilesystem { .. } => "query_filesystem",
DirectoryRequest::GetConnectionInfo { .. } => "get_connection_info",
DirectoryRequest::GetAttributes { .. } => "get_attributes",
DirectoryRequest::UpdateAttributes { .. } => "update_attributes",
DirectoryRequest::Sync { .. } => "sync",
DirectoryRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
DirectoryRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
DirectoryRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
DirectoryRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
DirectoryRequest::Open { .. } => "open",
DirectoryRequest::Open2 { .. } => "open2",
DirectoryRequest::Open3 { .. } => "open3",
DirectoryRequest::ReadDirents { .. } => "read_dirents",
DirectoryRequest::Rewind { .. } => "rewind",
DirectoryRequest::GetToken { .. } => "get_token",
DirectoryRequest::Link { .. } => "link",
DirectoryRequest::Unlink { .. } => "unlink",
DirectoryRequest::Rename { .. } => "rename",
DirectoryRequest::CreateSymlink { .. } => "create_symlink",
DirectoryRequest::Watch { .. } => "watch",
DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
DirectoryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct DirectoryControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DirectoryControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl DirectoryControlHandle {
pub fn send_on_open_(
&self,
mut s: i32,
mut info: Option<NodeInfoDeprecated>,
) -> Result<(), fidl::Error> {
self.inner.send::<NodeOnOpenRequest>(
(s, info.as_mut()),
0,
0x7fc7bbb1dbfd1972,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
self.inner.send::<Representation>(
&mut payload,
0,
0x5cb40567d80a510c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryAdvisoryLockResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryAdvisoryLockResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryAdvisoryLockResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryAdvisoryLockResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x6ee9c0ad53ec87aa,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryCloseResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryCloseResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryCloseResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryCloseResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryQueryResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryQueryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryQueryResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryQueryResponder {
pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
(protocol,),
self.tx_id,
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryGetAttrResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryGetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryGetAttrResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryGetAttrResponder {
pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut attributes: &NodeAttributes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeGetAttrResponse>(
(s, attributes),
self.tx_id,
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectorySetAttrResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectorySetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectorySetAttrResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectorySetAttrResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeSetAttrResponse>(
(s,),
self.tx_id,
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryGetFlagsResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryGetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryGetFlagsResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryGetFlagsResponder {
pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut flags: OpenFlags,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeGetFlagsResponse>(
(s, flags),
self.tx_id,
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectorySetFlagsResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectorySetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectorySetFlagsResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectorySetFlagsResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeSetFlagsResponse>(
(s,),
self.tx_id,
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryQueryFilesystemResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryQueryFilesystemResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryQueryFilesystemResponder {
pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut info: Option<&FilesystemInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
(s, info),
self.tx_id,
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryGetConnectionInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryGetConnectionInfoResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryGetConnectionInfoResponder {
pub fn send(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ConnectionInfo>(
&mut payload,
self.tx_id,
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryGetAttributesResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryGetAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryGetAttributesResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryGetAttributesResponder {
pub fn send(
self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
result,
self.tx_id,
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryUpdateAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryUpdateAttributesResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryUpdateAttributesResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectorySyncResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectorySyncResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectorySyncResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectorySyncResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryGetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryGetExtendedAttributeResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryGetExtendedAttributeResponder {
pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<ExtendedAttributeValue, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
result.as_mut().map_err(|e| *e),
self.tx_id,
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectorySetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectorySetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectorySetExtendedAttributeResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectorySetExtendedAttributeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryRemoveExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryRemoveExtendedAttributeResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryRemoveExtendedAttributeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryReadDirentsResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryReadDirentsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryReadDirentsResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryReadDirentsResponder {
pub fn send(self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, dirents);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut dirents: &[u8],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, dirents);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut dirents: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DirectoryReadDirentsResponse>(
(s, dirents),
self.tx_id,
0x3582806bf27faa0a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryRewindResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryRewindResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryRewindResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryRewindResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DirectoryRewindResponse>(
(s,),
self.tx_id,
0x16b1202af0f34c71,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryGetTokenResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryGetTokenResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryGetTokenResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryGetTokenResponder {
pub fn send(self, mut s: i32, mut token: Option<fidl::Handle>) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, token);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut token: Option<fidl::Handle>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, token);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut token: Option<fidl::Handle>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DirectoryGetTokenResponse>(
(s, token),
self.tx_id,
0x26ae9d18763c8655,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryLinkResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryLinkResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryLinkResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryLinkResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DirectoryLinkResponse>(
(s,),
self.tx_id,
0x740604c0c7c930e7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryUnlinkResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryUnlinkResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryUnlinkResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryUnlinkResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x750a0326a78d7bed,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryRenameResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryRenameResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryRenameResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryRenameResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x7060e7723b9928de,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryCreateSymlinkResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryCreateSymlinkResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryCreateSymlinkResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryCreateSymlinkResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x21ce0f19ec043889,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryWatchResponder {
control_handle: std::mem::ManuallyDrop<DirectoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryWatchResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryWatchResponder {
type ControlHandle = DirectoryControlHandle;
fn control_handle(&self) -> &DirectoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryWatchResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DirectoryWatchResponse>(
(s,),
self.tx_id,
0x5717193a59d66d91,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DirectoryWatcherMarker;
impl fidl::endpoints::ProtocolMarker for DirectoryWatcherMarker {
type Proxy = DirectoryWatcherProxy;
type RequestStream = DirectoryWatcherRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DirectoryWatcherSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DirectoryWatcher";
}
pub trait DirectoryWatcherProxyInterface: Send + Sync {}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DirectoryWatcherSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DirectoryWatcherSynchronousProxy {
type Proxy = DirectoryWatcherProxy;
type Protocol = DirectoryWatcherMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl DirectoryWatcherSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<DirectoryWatcherEvent, fidl::Error> {
DirectoryWatcherEvent::decode(self.client.wait_for_event(deadline)?)
}
}
#[derive(Debug, Clone)]
pub struct DirectoryWatcherProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DirectoryWatcherProxy {
type Protocol = DirectoryWatcherMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl DirectoryWatcherProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DirectoryWatcherEventStream {
DirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
}
}
impl DirectoryWatcherProxyInterface for DirectoryWatcherProxy {}
pub struct DirectoryWatcherEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DirectoryWatcherEventStream {}
impl futures::stream::FusedStream for DirectoryWatcherEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DirectoryWatcherEventStream {
type Item = Result<DirectoryWatcherEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(DirectoryWatcherEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DirectoryWatcherEvent {}
impl DirectoryWatcherEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DirectoryWatcherEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DirectoryWatcherRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DirectoryWatcherRequestStream {}
impl futures::stream::FusedStream for DirectoryWatcherRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DirectoryWatcherRequestStream {
type Protocol = DirectoryWatcherMarker;
type ControlHandle = DirectoryWatcherControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
DirectoryWatcherControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for DirectoryWatcherRequestStream {
type Item = Result<DirectoryWatcherRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled DirectoryWatcherRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DirectoryWatcherRequest {}
impl DirectoryWatcherRequest {
pub fn method_name(&self) -> &'static str {
match *self {}
}
}
#[derive(Debug, Clone)]
pub struct DirectoryWatcherControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DirectoryWatcherControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl DirectoryWatcherControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ExtendedAttributeIteratorMarker;
impl fidl::endpoints::ProtocolMarker for ExtendedAttributeIteratorMarker {
type Proxy = ExtendedAttributeIteratorProxy;
type RequestStream = ExtendedAttributeIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ExtendedAttributeIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) ExtendedAttributeIterator";
}
pub type ExtendedAttributeIteratorGetNextResult = Result<(Vec<Vec<u8>>, bool), i32>;
pub trait ExtendedAttributeIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<ExtendedAttributeIteratorGetNextResult, fidl::Error>>
+ Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ExtendedAttributeIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ExtendedAttributeIteratorSynchronousProxy {
type Proxy = ExtendedAttributeIteratorProxy;
type Protocol = ExtendedAttributeIteratorMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl ExtendedAttributeIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
ExtendedAttributeIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
>(
(),
0x3ba664a1c2e45a7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.attributes, x.last)))
}
}
#[derive(Debug, Clone)]
pub struct ExtendedAttributeIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ExtendedAttributeIteratorProxy {
type Protocol = ExtendedAttributeIteratorMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl ExtendedAttributeIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ExtendedAttributeIteratorEventStream {
ExtendedAttributeIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<
ExtendedAttributeIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ExtendedAttributeIteratorProxyInterface::r#get_next(self)
}
}
impl ExtendedAttributeIteratorProxyInterface for ExtendedAttributeIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
ExtendedAttributeIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ExtendedAttributeIteratorGetNextResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ExtendedAttributeIteratorGetNextResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3ba664a1c2e45a7,
>(_buf?)?;
Ok(_response.map(|x| (x.attributes, x.last)))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
ExtendedAttributeIteratorGetNextResult,
>(
(),
0x3ba664a1c2e45a7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ExtendedAttributeIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ExtendedAttributeIteratorEventStream {}
impl futures::stream::FusedStream for ExtendedAttributeIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ExtendedAttributeIteratorEventStream {
type Item = Result<ExtendedAttributeIteratorEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(ExtendedAttributeIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ExtendedAttributeIteratorEvent {}
impl ExtendedAttributeIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ExtendedAttributeIteratorEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ExtendedAttributeIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ExtendedAttributeIteratorRequestStream {}
impl futures::stream::FusedStream for ExtendedAttributeIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ExtendedAttributeIteratorRequestStream {
type Protocol = ExtendedAttributeIteratorMarker;
type ControlHandle = ExtendedAttributeIteratorControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
ExtendedAttributeIteratorControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ExtendedAttributeIteratorRequestStream {
type Item = Result<ExtendedAttributeIteratorRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled ExtendedAttributeIteratorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3ba664a1c2e45a7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ExtendedAttributeIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(ExtendedAttributeIteratorRequest::GetNext {
responder: ExtendedAttributeIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <ExtendedAttributeIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ExtendedAttributeIteratorRequest {
GetNext { responder: ExtendedAttributeIteratorGetNextResponder },
}
impl ExtendedAttributeIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(ExtendedAttributeIteratorGetNextResponder)> {
if let ExtendedAttributeIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ExtendedAttributeIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct ExtendedAttributeIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ExtendedAttributeIteratorControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl ExtendedAttributeIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ExtendedAttributeIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<ExtendedAttributeIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ExtendedAttributeIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ExtendedAttributeIteratorGetNextResponder {
type ControlHandle = ExtendedAttributeIteratorControlHandle;
fn control_handle(&self) -> &ExtendedAttributeIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ExtendedAttributeIteratorGetNextResponder {
pub fn send(self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(&[Vec<u8>], bool), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(&[Vec<u8>], bool), i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ExtendedAttributeIteratorGetNextResponse,
i32,
>>(
result,
self.tx_id,
0x3ba664a1c2e45a7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct FileMarker;
impl fidl::endpoints::ProtocolMarker for FileMarker {
type Proxy = FileProxy;
type RequestStream = FileRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = FileSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.io.File";
}
impl fidl::endpoints::DiscoverableProtocolMarker for FileMarker {}
pub type FileSeekResult = Result<u64, i32>;
pub type FileReadAtResult = Result<Vec<u8>, i32>;
pub type FileWriteAtResult = Result<u64, i32>;
pub type FileResizeResult = Result<(), i32>;
pub type FileGetBackingMemoryResult = Result<fidl::Vmo, i32>;
pub type FileAllocateResult = Result<(), i32>;
pub type FileEnableVerityResult = Result<(), i32>;
pub trait FileProxyInterface: Send + Sync {
type AdvisoryLockResponseFut: std::future::Future<Output = Result<AdvisoryLockingAdvisoryLockResult, fidl::Error>>
+ Send;
fn r#advisory_lock(&self, request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut;
type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
+ Send;
fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
fn r#clone2(
&self,
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error>;
type CloseResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
> + Send;
fn r#close(&self) -> Self::CloseResponseFut;
type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
fn r#query(&self) -> Self::QueryResponseFut;
fn r#clone(
&self,
flags: OpenFlags,
object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error>;
type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
+ Send;
fn r#get_attr(&self) -> Self::GetAttrResponseFut;
type SetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_attr(
&self,
flags: NodeAttributeFlags,
attributes: &NodeAttributes,
) -> Self::SetAttrResponseFut;
type GetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
+ Send;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
type SetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_flags(&self, flags: OpenFlags) -> Self::SetFlagsResponseFut;
type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
+ Send;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
type GetConnectionInfoResponseFut: std::future::Future<Output = Result<ConnectionInfo, fidl::Error>>
+ Send;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut;
type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
+ Send;
fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
+ Send;
fn r#update_attributes(
&self,
payload: &MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut;
type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
fn r#sync(&self) -> Self::SyncResponseFut;
fn r#list_extended_attributes(
&self,
iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error>;
type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#set_extended_attribute(
&self,
name: &[u8],
value: ExtendedAttributeValue,
mode: SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut;
type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
+ Send;
fn r#read(&self, count: u64) -> Self::ReadResponseFut;
type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
+ Send;
fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
type DescribeResponseFut: std::future::Future<Output = Result<FileInfo, fidl::Error>> + Send;
fn r#describe(&self) -> Self::DescribeResponseFut;
type SeekResponseFut: std::future::Future<Output = Result<FileSeekResult, fidl::Error>> + Send;
fn r#seek(&self, origin: SeekOrigin, offset: i64) -> Self::SeekResponseFut;
type ReadAtResponseFut: std::future::Future<Output = Result<FileReadAtResult, fidl::Error>>
+ Send;
fn r#read_at(&self, count: u64, offset: u64) -> Self::ReadAtResponseFut;
type WriteAtResponseFut: std::future::Future<Output = Result<FileWriteAtResult, fidl::Error>>
+ Send;
fn r#write_at(&self, data: &[u8], offset: u64) -> Self::WriteAtResponseFut;
type ResizeResponseFut: std::future::Future<Output = Result<FileResizeResult, fidl::Error>>
+ Send;
fn r#resize(&self, length: u64) -> Self::ResizeResponseFut;
type GetBackingMemoryResponseFut: std::future::Future<Output = Result<FileGetBackingMemoryResult, fidl::Error>>
+ Send;
fn r#get_backing_memory(&self, flags: VmoFlags) -> Self::GetBackingMemoryResponseFut;
type AllocateResponseFut: std::future::Future<Output = Result<FileAllocateResult, fidl::Error>>
+ Send;
fn r#allocate(&self, offset: u64, length: u64, mode: AllocateMode)
-> Self::AllocateResponseFut;
type EnableVerityResponseFut: std::future::Future<Output = Result<FileEnableVerityResult, fidl::Error>>
+ Send;
fn r#enable_verity(&self, options: &VerificationOptions) -> Self::EnableVerityResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct FileSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for FileSynchronousProxy {
type Proxy = FileProxy;
type Protocol = FileMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl FileSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<FileEvent, fidl::Error> {
FileEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#advisory_lock(
&self,
mut request: &AdvisoryLockRequest,
___deadline: zx::MonotonicInstant,
) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
let _response = self.client.send_query::<
AdvisoryLockingAdvisoryLockRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(request,),
0x6ee9c0ad53ec87aa,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#link_into(
&self,
mut dst_parent_token: fidl::Event,
mut dst: &str,
___deadline: zx::MonotonicInstant,
) -> Result<LinkableLinkIntoResult, fidl::Error> {
let _response = self.client.send_query::<
LinkableLinkIntoRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(dst_parent_token, dst,),
0x54f3949246a03e74,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#close(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::QueryableQueryResponse,
>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.protocol)
}
pub fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeCloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_attr(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, NodeAttributes), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.attributes))
}
pub fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<NodeSetAttrRequest, NodeSetAttrResponse>(
(flags, attributes),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#get_flags(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, OpenFlags), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetFlagsResponse>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.flags))
}
pub fn r#set_flags(
&self,
mut flags: OpenFlags,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<NodeSetFlagsRequest, NodeSetFlagsResponse>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#query_filesystem(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.info))
}
pub fn r#get_connection_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ConnectionInfo, fidl::Error> {
let _response = self.client.send_query::<fidl::encoding::EmptyPayload, ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_attributes(
&self,
mut query: NodeAttributesQuery,
___deadline: zx::MonotonicInstant,
) -> Result<NodeGetAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
NodeGetAttributesRequest,
fidl::encoding::ResultType<NodeAttributes2, i32>,
>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
pub fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
___deadline: zx::MonotonicInstant,
) -> Result<NodeUpdateAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
MutableNodeAttributes,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeGetExtendedAttributeRequest,
fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
___deadline: zx::MonotonicInstant,
) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeSetExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeRemoveExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#read(
&self,
mut count: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ReadableReadResult, fidl::Error> {
let _response = self.client.send_query::<
ReadableReadRequest,
fidl::encoding::ResultType<ReadableReadResponse, i32>,
>(
(count,),
0x57e419a298c8ede,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.data))
}
pub fn r#write(
&self,
mut data: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<WritableWriteResult, fidl::Error> {
let _response = self.client.send_query::<
WritableWriteRequest,
fidl::encoding::ResultType<WritableWriteResponse, i32>,
>(
(data,),
0x6a31437832469f82,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.actual_count))
}
pub fn r#describe(&self, ___deadline: zx::MonotonicInstant) -> Result<FileInfo, fidl::Error> {
let _response = self.client.send_query::<fidl::encoding::EmptyPayload, FileInfo>(
(),
0x68b5ac00c62906bc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#seek(
&self,
mut origin: SeekOrigin,
mut offset: i64,
___deadline: zx::MonotonicInstant,
) -> Result<FileSeekResult, fidl::Error> {
let _response = self
.client
.send_query::<FileSeekRequest, fidl::encoding::ResultType<FileSeekResponse, i32>>(
(origin, offset),
0x78079168162c5207,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.offset_from_start))
}
pub fn r#read_at(
&self,
mut count: u64,
mut offset: u64,
___deadline: zx::MonotonicInstant,
) -> Result<FileReadAtResult, fidl::Error> {
let _response = self
.client
.send_query::<FileReadAtRequest, fidl::encoding::ResultType<FileReadAtResponse, i32>>(
(count, offset),
0x1607a293a60d723e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.data))
}
pub fn r#write_at(
&self,
mut data: &[u8],
mut offset: u64,
___deadline: zx::MonotonicInstant,
) -> Result<FileWriteAtResult, fidl::Error> {
let _response = self
.client
.send_query::<FileWriteAtRequest, fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
(data, offset),
0x793eefc0045e792b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.actual_count))
}
pub fn r#resize(
&self,
mut length: u64,
___deadline: zx::MonotonicInstant,
) -> Result<FileResizeResult, fidl::Error> {
let _response = self.client.send_query::<
FileResizeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(length,),
0x2b80825f0535743a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_backing_memory(
&self,
mut flags: VmoFlags,
___deadline: zx::MonotonicInstant,
) -> Result<FileGetBackingMemoryResult, fidl::Error> {
let _response = self.client.send_query::<
FileGetBackingMemoryRequest,
fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
>(
(flags,),
0xa6a9e654cbf62b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.vmo))
}
pub fn r#allocate(
&self,
mut offset: u64,
mut length: u64,
mut mode: AllocateMode,
___deadline: zx::MonotonicInstant,
) -> Result<FileAllocateResult, fidl::Error> {
let _response = self.client.send_query::<
FileAllocateRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
>(
(offset, length, mode,),
0x77fa0c330b57fd2e,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<FileMarker>("allocate")?;
Ok(_response.map(|x| x))
}
pub fn r#enable_verity(
&self,
mut options: &VerificationOptions,
___deadline: zx::MonotonicInstant,
) -> Result<FileEnableVerityResult, fidl::Error> {
let _response = self.client.send_query::<
FileEnableVerityRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
>(
(options,),
0x2c421ec3faaeb8bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<FileMarker>("enable_verity")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct FileProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for FileProxy {
type Protocol = FileMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl FileProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> FileEventStream {
FileEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#advisory_lock(
&self,
mut request: &AdvisoryLockRequest,
) -> fidl::client::QueryResponseFut<
AdvisoryLockingAdvisoryLockResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#advisory_lock(self, request)
}
pub fn r#link_into(
&self,
mut dst_parent_token: fidl::Event,
mut dst: &str,
) -> fidl::client::QueryResponseFut<
LinkableLinkIntoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#link_into(self, dst_parent_token, dst)
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
FileProxyInterface::r#clone2(self, request)
}
pub fn r#close(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#close(self)
}
pub fn r#query(
&self,
) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
FileProxyInterface::r#query(self)
}
pub fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
FileProxyInterface::r#clone(self, flags, object)
}
pub fn r#get_attr(
&self,
) -> fidl::client::QueryResponseFut<
(i32, NodeAttributes),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#get_attr(self)
}
pub fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
FileProxyInterface::r#set_attr(self, flags, attributes)
}
pub fn r#get_flags(
&self,
) -> fidl::client::QueryResponseFut<
(i32, OpenFlags),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#get_flags(self)
}
pub fn r#set_flags(
&self,
mut flags: OpenFlags,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
FileProxyInterface::r#set_flags(self, flags)
}
pub fn r#query_filesystem(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<Box<FilesystemInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#query_filesystem(self)
}
pub fn r#get_connection_info(
&self,
) -> fidl::client::QueryResponseFut<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
{
FileProxyInterface::r#get_connection_info(self)
}
pub fn r#get_attributes(
&self,
mut query: NodeAttributesQuery,
) -> fidl::client::QueryResponseFut<
NodeGetAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#get_attributes(self, query)
}
pub fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
) -> fidl::client::QueryResponseFut<
NodeUpdateAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#update_attributes(self, payload)
}
pub fn r#sync(
&self,
) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
FileProxyInterface::r#sync(self)
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
FileProxyInterface::r#list_extended_attributes(self, iterator)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<
NodeGetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#get_extended_attribute(self, name)
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
) -> fidl::client::QueryResponseFut<
NodeSetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#set_extended_attribute(self, name, value, mode)
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<
NodeRemoveExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#remove_extended_attribute(self, name)
}
pub fn r#read(
&self,
mut count: u64,
) -> fidl::client::QueryResponseFut<
ReadableReadResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#read(self, count)
}
pub fn r#write(
&self,
mut data: &[u8],
) -> fidl::client::QueryResponseFut<
WritableWriteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#write(self, data)
}
pub fn r#describe(
&self,
) -> fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
{
FileProxyInterface::r#describe(self)
}
pub fn r#seek(
&self,
mut origin: SeekOrigin,
mut offset: i64,
) -> fidl::client::QueryResponseFut<FileSeekResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
FileProxyInterface::r#seek(self, origin, offset)
}
pub fn r#read_at(
&self,
mut count: u64,
mut offset: u64,
) -> fidl::client::QueryResponseFut<
FileReadAtResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#read_at(self, count, offset)
}
pub fn r#write_at(
&self,
mut data: &[u8],
mut offset: u64,
) -> fidl::client::QueryResponseFut<
FileWriteAtResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#write_at(self, data, offset)
}
pub fn r#resize(
&self,
mut length: u64,
) -> fidl::client::QueryResponseFut<
FileResizeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#resize(self, length)
}
pub fn r#get_backing_memory(
&self,
mut flags: VmoFlags,
) -> fidl::client::QueryResponseFut<
FileGetBackingMemoryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#get_backing_memory(self, flags)
}
pub fn r#allocate(
&self,
mut offset: u64,
mut length: u64,
mut mode: AllocateMode,
) -> fidl::client::QueryResponseFut<
FileAllocateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#allocate(self, offset, length, mode)
}
pub fn r#enable_verity(
&self,
mut options: &VerificationOptions,
) -> fidl::client::QueryResponseFut<
FileEnableVerityResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FileProxyInterface::r#enable_verity(self, options)
}
}
impl FileProxyInterface for FileProxy {
type AdvisoryLockResponseFut = fidl::client::QueryResponseFut<
AdvisoryLockingAdvisoryLockResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#advisory_lock(&self, mut request: &AdvisoryLockRequest) -> Self::AdvisoryLockResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<AdvisoryLockingAdvisoryLockResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6ee9c0ad53ec87aa,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
AdvisoryLockingAdvisoryLockRequest,
AdvisoryLockingAdvisoryLockResult,
>(
(request,),
0x6ee9c0ad53ec87aa,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type LinkIntoResponseFut = fidl::client::QueryResponseFut<
LinkableLinkIntoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#link_into(
&self,
mut dst_parent_token: fidl::Event,
mut dst: &str,
) -> Self::LinkIntoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LinkableLinkIntoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x54f3949246a03e74,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
(dst_parent_token, dst),
0x54f3949246a03e74,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
type CloseResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#close(&self) -> Self::CloseResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5ac5d459ad7f657e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::CloseableCloseResult,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryResponseFut =
fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#query(&self) -> Self::QueryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_unknown::QueryableQueryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2658edee9decfc06,
>(_buf?)?;
Ok(_response.protocol)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeCloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetAttrResponseFut = fidl::client::QueryResponseFut<
(i32, NodeAttributes),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_attr(&self) -> Self::GetAttrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, NodeAttributes), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeGetAttrResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x78985e216314dafd,
>(_buf?)?;
Ok((_response.s, _response.attributes))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetAttrResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
) -> Self::SetAttrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeSetAttrResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4186c0f40d938f46,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<NodeSetAttrRequest, i32>(
(flags, attributes),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetFlagsResponseFut = fidl::client::QueryResponseFut<
(i32, OpenFlags),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, OpenFlags), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeGetFlagsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5b88fffb8eda3aa1,
>(_buf?)?;
Ok((_response.s, _response.flags))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetFlagsResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_flags(&self, mut flags: OpenFlags) -> Self::SetFlagsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeSetFlagsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5295b76c71fde733,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<NodeSetFlagsRequest, i32>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
(i32, Option<Box<FilesystemInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeQueryFilesystemResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6f344a1c6b0a0610,
>(_buf?)?;
Ok((_response.s, _response.info))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, Option<Box<FilesystemInfo>>),
>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetConnectionInfoResponseFut = fidl::client::QueryResponseFut<
ConnectionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ConnectionInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ConnectionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x584c377c7c0a6d0b,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetAttributesResponseFut = fidl::client::QueryResponseFut<
NodeGetAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeGetAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<NodeAttributes2, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3d4396a638ea053b,
>(_buf?)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
NodeUpdateAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeUpdateAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3308c1da5a89bf08,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SyncResponseFut = fidl::client::QueryResponseFut<
NodeSyncResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#sync(&self) -> Self::SyncResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeSyncResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c5c27ca0ab5dc49,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeGetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x45ffa3ccfdeb76db,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeGetExtendedAttributeRequest,
NodeGetExtendedAttributeResult,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeSetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4a951362f681f23c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeSetExtendedAttributeRequest,
NodeSetExtendedAttributeResult,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeRemoveExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> Self::RemoveExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7a0b9f3a9bf9032d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeRemoveExtendedAttributeRequest,
NodeRemoveExtendedAttributeResult,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ReadResponseFut = fidl::client::QueryResponseFut<
ReadableReadResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ReadableReadResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ReadableReadResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x57e419a298c8ede,
>(_buf?)?;
Ok(_response.map(|x| x.data))
}
self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
(count,),
0x57e419a298c8ede,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteResponseFut = fidl::client::QueryResponseFut<
WritableWriteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WritableWriteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WritableWriteResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6a31437832469f82,
>(_buf?)?;
Ok(_response.map(|x| x.actual_count))
}
self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
(data,),
0x6a31437832469f82,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DescribeResponseFut =
fidl::client::QueryResponseFut<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#describe(&self) -> Self::DescribeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FileInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
FileInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x68b5ac00c62906bc,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, FileInfo>(
(),
0x68b5ac00c62906bc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SeekResponseFut = fidl::client::QueryResponseFut<
FileSeekResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#seek(&self, mut origin: SeekOrigin, mut offset: i64) -> Self::SeekResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FileSeekResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<FileSeekResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x78079168162c5207,
>(_buf?)?;
Ok(_response.map(|x| x.offset_from_start))
}
self.client.send_query_and_decode::<FileSeekRequest, FileSeekResult>(
(origin, offset),
0x78079168162c5207,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ReadAtResponseFut = fidl::client::QueryResponseFut<
FileReadAtResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#read_at(&self, mut count: u64, mut offset: u64) -> Self::ReadAtResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FileReadAtResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<FileReadAtResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1607a293a60d723e,
>(_buf?)?;
Ok(_response.map(|x| x.data))
}
self.client.send_query_and_decode::<FileReadAtRequest, FileReadAtResult>(
(count, offset),
0x1607a293a60d723e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WriteAtResponseFut = fidl::client::QueryResponseFut<
FileWriteAtResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#write_at(&self, mut data: &[u8], mut offset: u64) -> Self::WriteAtResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FileWriteAtResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<FileWriteAtResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x793eefc0045e792b,
>(_buf?)?;
Ok(_response.map(|x| x.actual_count))
}
self.client.send_query_and_decode::<FileWriteAtRequest, FileWriteAtResult>(
(data, offset),
0x793eefc0045e792b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ResizeResponseFut = fidl::client::QueryResponseFut<
FileResizeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#resize(&self, mut length: u64) -> Self::ResizeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FileResizeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2b80825f0535743a,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<FileResizeRequest, FileResizeResult>(
(length,),
0x2b80825f0535743a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetBackingMemoryResponseFut = fidl::client::QueryResponseFut<
FileGetBackingMemoryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_backing_memory(&self, mut flags: VmoFlags) -> Self::GetBackingMemoryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FileGetBackingMemoryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xa6a9e654cbf62b,
>(_buf?)?;
Ok(_response.map(|x| x.vmo))
}
self.client
.send_query_and_decode::<FileGetBackingMemoryRequest, FileGetBackingMemoryResult>(
(flags,),
0xa6a9e654cbf62b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type AllocateResponseFut = fidl::client::QueryResponseFut<
FileAllocateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#allocate(
&self,
mut offset: u64,
mut length: u64,
mut mode: AllocateMode,
) -> Self::AllocateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FileAllocateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x77fa0c330b57fd2e,
>(_buf?)?
.into_result::<FileMarker>("allocate")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<FileAllocateRequest, FileAllocateResult>(
(offset, length, mode),
0x77fa0c330b57fd2e,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type EnableVerityResponseFut = fidl::client::QueryResponseFut<
FileEnableVerityResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#enable_verity(&self, mut options: &VerificationOptions) -> Self::EnableVerityResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<FileEnableVerityResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c421ec3faaeb8bb,
>(_buf?)?
.into_result::<FileMarker>("enable_verity")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<FileEnableVerityRequest, FileEnableVerityResult>(
(options,),
0x2c421ec3faaeb8bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct FileEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for FileEventStream {}
impl futures::stream::FusedStream for FileEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for FileEventStream {
type Item = Result<FileEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(FileEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum FileEvent {
OnOpen_ {
s: i32,
info: Option<Box<NodeInfoDeprecated>>,
},
OnRepresentation {
payload: Representation,
},
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl FileEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
if let FileEvent::OnOpen_ { s, info } = self {
Some((s, info))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_representation(self) -> Option<Representation> {
if let FileEvent::OnRepresentation { payload } = self {
Some((payload))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<FileEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
0x7fc7bbb1dbfd1972 => {
let mut out = fidl::new_empty!(
NodeOnOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((FileEvent::OnOpen_ { s: out.s, info: out.info }))
}
0x5cb40567d80a510c => {
let mut out =
fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((FileEvent::OnRepresentation { payload: out }))
}
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(FileEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct FileRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for FileRequestStream {}
impl futures::stream::FusedStream for FileRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for FileRequestStream {
type Protocol = FileMarker;
type ControlHandle = FileControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
FileControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for FileRequestStream {
type Item = Result<FileRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled FileRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x6ee9c0ad53ec87aa => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
AdvisoryLockingAdvisoryLockRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AdvisoryLockingAdvisoryLockRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::AdvisoryLock {
request: req.request,
responder: FileAdvisoryLockResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x54f3949246a03e74 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LinkableLinkIntoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::LinkInto {
dst_parent_token: req.dst_parent_token,
dst: req.dst,
responder: FileLinkIntoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x20d8a7aba2168a79 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_unknown::CloneableClone2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableClone2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Clone2 { request: req.request, control_handle })
}
0x5ac5d459ad7f657e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Close {
responder: FileCloseResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2658edee9decfc06 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Query {
responder: FileQueryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5a61678f293ce16f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
NodeCloneRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeCloneRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Clone {
flags: req.flags,
object: req.object,
control_handle,
})
}
0x78985e216314dafd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::GetAttr {
responder: FileGetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4186c0f40d938f46 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetAttrRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::SetAttr {
flags: req.flags,
attributes: req.attributes,
responder: FileSetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5b88fffb8eda3aa1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::GetFlags {
responder: FileGetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5295b76c71fde733 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetFlagsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::SetFlags {
flags: req.flags,
responder: FileSetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6f344a1c6b0a0610 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::QueryFilesystem {
responder: FileQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x584c377c7c0a6d0b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::GetConnectionInfo {
responder: FileGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3d4396a638ea053b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeGetAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::GetAttributes {
query: req.query,
responder: FileGetAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3308c1da5a89bf08 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
MutableNodeAttributes,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::UpdateAttributes {
payload: req,
responder: FileUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2c5c27ca0ab5dc49 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Sync {
responder: FileSyncResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4b61033de007fcd0 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
NodeListExtendedAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::ListExtendedAttributes {
iterator: req.iterator,
control_handle,
})
}
0x45ffa3ccfdeb76db => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeGetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::GetExtendedAttribute {
name: req.name,
responder: FileGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4a951362f681f23c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::SetExtendedAttribute {
name: req.name,
value: req.value,
mode: req.mode,
responder: FileSetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a0b9f3a9bf9032d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeRemoveExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::RemoveExtendedAttribute {
name: req.name,
responder: FileRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x57e419a298c8ede => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ReadableReadRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Read {
count: req.count,
responder: FileReadResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6a31437832469f82 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WritableWriteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Write {
data: req.data,
responder: FileWriteResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x68b5ac00c62906bc => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Describe {
responder: FileDescribeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x78079168162c5207 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
FileSeekRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileSeekRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Seek {
origin: req.origin,
offset: req.offset,
responder: FileSeekResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1607a293a60d723e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
FileReadAtRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileReadAtRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::ReadAt {
count: req.count,
offset: req.offset,
responder: FileReadAtResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x793eefc0045e792b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
FileWriteAtRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileWriteAtRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::WriteAt {
data: req.data,
offset: req.offset,
responder: FileWriteAtResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2b80825f0535743a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
FileResizeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileResizeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Resize {
length: req.length,
responder: FileResizeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xa6a9e654cbf62b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
FileGetBackingMemoryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileGetBackingMemoryRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::GetBackingMemory {
flags: req.flags,
responder: FileGetBackingMemoryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x77fa0c330b57fd2e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
FileAllocateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileAllocateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::Allocate {
offset: req.offset,
length: req.length,
mode: req.mode,
responder: FileAllocateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2c421ec3faaeb8bb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
FileEnableVerityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileEnableVerityRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = FileControlHandle { inner: this.inner.clone() };
Ok(FileRequest::EnableVerity {
options: req.options,
responder: FileEnableVerityResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(FileRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: FileControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(FileRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: FileControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <FileMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum FileRequest {
AdvisoryLock {
request: AdvisoryLockRequest,
responder: FileAdvisoryLockResponder,
},
LinkInto {
dst_parent_token: fidl::Event,
dst: String,
responder: FileLinkIntoResponder,
},
Clone2 {
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
control_handle: FileControlHandle,
},
Close {
responder: FileCloseResponder,
},
Query {
responder: FileQueryResponder,
},
Clone {
flags: OpenFlags,
object: fidl::endpoints::ServerEnd<NodeMarker>,
control_handle: FileControlHandle,
},
GetAttr {
responder: FileGetAttrResponder,
},
SetAttr {
flags: NodeAttributeFlags,
attributes: NodeAttributes,
responder: FileSetAttrResponder,
},
GetFlags {
responder: FileGetFlagsResponder,
},
SetFlags {
flags: OpenFlags,
responder: FileSetFlagsResponder,
},
QueryFilesystem {
responder: FileQueryFilesystemResponder,
},
GetConnectionInfo {
responder: FileGetConnectionInfoResponder,
},
GetAttributes {
query: NodeAttributesQuery,
responder: FileGetAttributesResponder,
},
UpdateAttributes {
payload: MutableNodeAttributes,
responder: FileUpdateAttributesResponder,
},
Sync {
responder: FileSyncResponder,
},
ListExtendedAttributes {
iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
control_handle: FileControlHandle,
},
GetExtendedAttribute {
name: Vec<u8>,
responder: FileGetExtendedAttributeResponder,
},
SetExtendedAttribute {
name: Vec<u8>,
value: ExtendedAttributeValue,
mode: SetExtendedAttributeMode,
responder: FileSetExtendedAttributeResponder,
},
RemoveExtendedAttribute {
name: Vec<u8>,
responder: FileRemoveExtendedAttributeResponder,
},
Read {
count: u64,
responder: FileReadResponder,
},
Write {
data: Vec<u8>,
responder: FileWriteResponder,
},
Describe {
responder: FileDescribeResponder,
},
Seek {
origin: SeekOrigin,
offset: i64,
responder: FileSeekResponder,
},
ReadAt {
count: u64,
offset: u64,
responder: FileReadAtResponder,
},
WriteAt {
data: Vec<u8>,
offset: u64,
responder: FileWriteAtResponder,
},
Resize {
length: u64,
responder: FileResizeResponder,
},
GetBackingMemory {
flags: VmoFlags,
responder: FileGetBackingMemoryResponder,
},
Allocate {
offset: u64,
length: u64,
mode: AllocateMode,
responder: FileAllocateResponder,
},
EnableVerity {
options: VerificationOptions,
responder: FileEnableVerityResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: FileControlHandle,
method_type: fidl::MethodType,
},
}
impl FileRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_advisory_lock(self) -> Option<(AdvisoryLockRequest, FileAdvisoryLockResponder)> {
if let FileRequest::AdvisoryLock { request, responder } = self {
Some((request, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_link_into(self) -> Option<(fidl::Event, String, FileLinkIntoResponder)> {
if let FileRequest::LinkInto { dst_parent_token, dst, responder } = self {
Some((dst_parent_token, dst, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone2(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
FileControlHandle,
)> {
if let FileRequest::Clone2 { request, control_handle } = self {
Some((request, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_close(self) -> Option<(FileCloseResponder)> {
if let FileRequest::Close { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query(self) -> Option<(FileQueryResponder)> {
if let FileRequest::Query { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone(
self,
) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, FileControlHandle)> {
if let FileRequest::Clone { flags, object, control_handle } = self {
Some((flags, object, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attr(self) -> Option<(FileGetAttrResponder)> {
if let FileRequest::GetAttr { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_attr(
self,
) -> Option<(NodeAttributeFlags, NodeAttributes, FileSetAttrResponder)> {
if let FileRequest::SetAttr { flags, attributes, responder } = self {
Some((flags, attributes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_flags(self) -> Option<(FileGetFlagsResponder)> {
if let FileRequest::GetFlags { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_flags(self) -> Option<(OpenFlags, FileSetFlagsResponder)> {
if let FileRequest::SetFlags { flags, responder } = self {
Some((flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_filesystem(self) -> Option<(FileQueryFilesystemResponder)> {
if let FileRequest::QueryFilesystem { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_connection_info(self) -> Option<(FileGetConnectionInfoResponder)> {
if let FileRequest::GetConnectionInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, FileGetAttributesResponder)> {
if let FileRequest::GetAttributes { query, responder } = self {
Some((query, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_update_attributes(
self,
) -> Option<(MutableNodeAttributes, FileUpdateAttributesResponder)> {
if let FileRequest::UpdateAttributes { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_sync(self) -> Option<(FileSyncResponder)> {
if let FileRequest::Sync { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_extended_attributes(
self,
) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, FileControlHandle)>
{
if let FileRequest::ListExtendedAttributes { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_extended_attribute(
self,
) -> Option<(Vec<u8>, FileGetExtendedAttributeResponder)> {
if let FileRequest::GetExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_extended_attribute(
self,
) -> Option<(
Vec<u8>,
ExtendedAttributeValue,
SetExtendedAttributeMode,
FileSetExtendedAttributeResponder,
)> {
if let FileRequest::SetExtendedAttribute { name, value, mode, responder } = self {
Some((name, value, mode, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove_extended_attribute(
self,
) -> Option<(Vec<u8>, FileRemoveExtendedAttributeResponder)> {
if let FileRequest::RemoveExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_read(self) -> Option<(u64, FileReadResponder)> {
if let FileRequest::Read { count, responder } = self {
Some((count, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write(self) -> Option<(Vec<u8>, FileWriteResponder)> {
if let FileRequest::Write { data, responder } = self {
Some((data, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_describe(self) -> Option<(FileDescribeResponder)> {
if let FileRequest::Describe { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_seek(self) -> Option<(SeekOrigin, i64, FileSeekResponder)> {
if let FileRequest::Seek { origin, offset, responder } = self {
Some((origin, offset, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_read_at(self) -> Option<(u64, u64, FileReadAtResponder)> {
if let FileRequest::ReadAt { count, offset, responder } = self {
Some((count, offset, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_write_at(self) -> Option<(Vec<u8>, u64, FileWriteAtResponder)> {
if let FileRequest::WriteAt { data, offset, responder } = self {
Some((data, offset, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_resize(self) -> Option<(u64, FileResizeResponder)> {
if let FileRequest::Resize { length, responder } = self {
Some((length, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_backing_memory(self) -> Option<(VmoFlags, FileGetBackingMemoryResponder)> {
if let FileRequest::GetBackingMemory { flags, responder } = self {
Some((flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_allocate(self) -> Option<(u64, u64, AllocateMode, FileAllocateResponder)> {
if let FileRequest::Allocate { offset, length, mode, responder } = self {
Some((offset, length, mode, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_enable_verity(self) -> Option<(VerificationOptions, FileEnableVerityResponder)> {
if let FileRequest::EnableVerity { options, responder } = self {
Some((options, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
FileRequest::AdvisoryLock { .. } => "advisory_lock",
FileRequest::LinkInto { .. } => "link_into",
FileRequest::Clone2 { .. } => "clone2",
FileRequest::Close { .. } => "close",
FileRequest::Query { .. } => "query",
FileRequest::Clone { .. } => "clone",
FileRequest::GetAttr { .. } => "get_attr",
FileRequest::SetAttr { .. } => "set_attr",
FileRequest::GetFlags { .. } => "get_flags",
FileRequest::SetFlags { .. } => "set_flags",
FileRequest::QueryFilesystem { .. } => "query_filesystem",
FileRequest::GetConnectionInfo { .. } => "get_connection_info",
FileRequest::GetAttributes { .. } => "get_attributes",
FileRequest::UpdateAttributes { .. } => "update_attributes",
FileRequest::Sync { .. } => "sync",
FileRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
FileRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
FileRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
FileRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
FileRequest::Read { .. } => "read",
FileRequest::Write { .. } => "write",
FileRequest::Describe { .. } => "describe",
FileRequest::Seek { .. } => "seek",
FileRequest::ReadAt { .. } => "read_at",
FileRequest::WriteAt { .. } => "write_at",
FileRequest::Resize { .. } => "resize",
FileRequest::GetBackingMemory { .. } => "get_backing_memory",
FileRequest::Allocate { .. } => "allocate",
FileRequest::EnableVerity { .. } => "enable_verity",
FileRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
FileRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct FileControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for FileControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl FileControlHandle {
pub fn send_on_open_(
&self,
mut s: i32,
mut info: Option<NodeInfoDeprecated>,
) -> Result<(), fidl::Error> {
self.inner.send::<NodeOnOpenRequest>(
(s, info.as_mut()),
0,
0x7fc7bbb1dbfd1972,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
self.inner.send::<Representation>(
&mut payload,
0,
0x5cb40567d80a510c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileAdvisoryLockResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileAdvisoryLockResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileAdvisoryLockResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileAdvisoryLockResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x6ee9c0ad53ec87aa,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileLinkIntoResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileLinkIntoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileLinkIntoResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileLinkIntoResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x54f3949246a03e74,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileCloseResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileCloseResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileCloseResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileCloseResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileQueryResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileQueryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileQueryResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileQueryResponder {
pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
(protocol,),
self.tx_id,
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileGetAttrResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileGetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileGetAttrResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileGetAttrResponder {
pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut attributes: &NodeAttributes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeGetAttrResponse>(
(s, attributes),
self.tx_id,
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileSetAttrResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileSetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileSetAttrResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileSetAttrResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeSetAttrResponse>(
(s,),
self.tx_id,
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileGetFlagsResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileGetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileGetFlagsResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileGetFlagsResponder {
pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut flags: OpenFlags,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeGetFlagsResponse>(
(s, flags),
self.tx_id,
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileSetFlagsResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileSetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileSetFlagsResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileSetFlagsResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeSetFlagsResponse>(
(s,),
self.tx_id,
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileQueryFilesystemResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileQueryFilesystemResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileQueryFilesystemResponder {
pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut info: Option<&FilesystemInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
(s, info),
self.tx_id,
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileGetConnectionInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileGetConnectionInfoResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileGetConnectionInfoResponder {
pub fn send(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ConnectionInfo>(
&mut payload,
self.tx_id,
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileGetAttributesResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileGetAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileGetAttributesResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileGetAttributesResponder {
pub fn send(
self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
result,
self.tx_id,
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileUpdateAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileUpdateAttributesResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileUpdateAttributesResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileSyncResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileSyncResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileSyncResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileSyncResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileGetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileGetExtendedAttributeResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileGetExtendedAttributeResponder {
pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<ExtendedAttributeValue, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
result.as_mut().map_err(|e| *e),
self.tx_id,
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileSetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileSetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileSetExtendedAttributeResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileSetExtendedAttributeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileRemoveExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileRemoveExtendedAttributeResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileRemoveExtendedAttributeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileReadResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileReadResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileReadResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileReadResponder {
pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[u8], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
result.map(|data| (data,)),
self.tx_id,
0x57e419a298c8ede,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileWriteResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileWriteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileWriteResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileWriteResponder {
pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
result.map(|actual_count| (actual_count,)),
self.tx_id,
0x6a31437832469f82,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileDescribeResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileDescribeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileDescribeResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileDescribeResponder {
pub fn send(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut payload: FileInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: FileInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<FileInfo>(
&mut payload,
self.tx_id,
0x68b5ac00c62906bc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileSeekResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileSeekResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileSeekResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileSeekResponder {
pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<FileSeekResponse, i32>>(
result.map(|offset_from_start| (offset_from_start,)),
self.tx_id,
0x78079168162c5207,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileReadAtResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileReadAtResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileReadAtResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileReadAtResponder {
pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[u8], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<FileReadAtResponse, i32>>(
result.map(|data| (data,)),
self.tx_id,
0x1607a293a60d723e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileWriteAtResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileWriteAtResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileWriteAtResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileWriteAtResponder {
pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<FileWriteAtResponse, i32>>(
result.map(|actual_count| (actual_count,)),
self.tx_id,
0x793eefc0045e792b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileResizeResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileResizeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileResizeResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileResizeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x2b80825f0535743a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileGetBackingMemoryResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileGetBackingMemoryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileGetBackingMemoryResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileGetBackingMemoryResponder {
pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<fidl::Vmo, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<FileGetBackingMemoryResponse, i32>>(
result.map(|vmo| (vmo,)),
self.tx_id,
0xa6a9e654cbf62b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileAllocateResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileAllocateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileAllocateResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileAllocateResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
i32,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x77fa0c330b57fd2e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FileEnableVerityResponder {
control_handle: std::mem::ManuallyDrop<FileControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FileEnableVerityResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FileEnableVerityResponder {
type ControlHandle = FileControlHandle;
fn control_handle(&self) -> &FileControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FileEnableVerityResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
i32,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x2c421ec3faaeb8bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LinkableMarker;
impl fidl::endpoints::ProtocolMarker for LinkableMarker {
type Proxy = LinkableProxy;
type RequestStream = LinkableRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LinkableSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Linkable";
}
pub type LinkableLinkIntoResult = Result<(), i32>;
pub trait LinkableProxyInterface: Send + Sync {
type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
+ Send;
fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LinkableSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LinkableSynchronousProxy {
type Proxy = LinkableProxy;
type Protocol = LinkableMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl LinkableSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<LinkableEvent, fidl::Error> {
LinkableEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#link_into(
&self,
mut dst_parent_token: fidl::Event,
mut dst: &str,
___deadline: zx::MonotonicInstant,
) -> Result<LinkableLinkIntoResult, fidl::Error> {
let _response = self.client.send_query::<
LinkableLinkIntoRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(dst_parent_token, dst,),
0x54f3949246a03e74,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct LinkableProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LinkableProxy {
type Protocol = LinkableMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl LinkableProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LinkableEventStream {
LinkableEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#link_into(
&self,
mut dst_parent_token: fidl::Event,
mut dst: &str,
) -> fidl::client::QueryResponseFut<
LinkableLinkIntoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LinkableProxyInterface::r#link_into(self, dst_parent_token, dst)
}
}
impl LinkableProxyInterface for LinkableProxy {
type LinkIntoResponseFut = fidl::client::QueryResponseFut<
LinkableLinkIntoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#link_into(
&self,
mut dst_parent_token: fidl::Event,
mut dst: &str,
) -> Self::LinkIntoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LinkableLinkIntoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x54f3949246a03e74,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
(dst_parent_token, dst),
0x54f3949246a03e74,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct LinkableEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LinkableEventStream {}
impl futures::stream::FusedStream for LinkableEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LinkableEventStream {
type Item = Result<LinkableEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(LinkableEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LinkableEvent {}
impl LinkableEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LinkableEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LinkableRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LinkableRequestStream {}
impl futures::stream::FusedStream for LinkableRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LinkableRequestStream {
type Protocol = LinkableMarker;
type ControlHandle = LinkableControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
LinkableControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for LinkableRequestStream {
type Item = Result<LinkableRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled LinkableRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x54f3949246a03e74 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LinkableLinkIntoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LinkableControlHandle { inner: this.inner.clone() };
Ok(LinkableRequest::LinkInto {
dst_parent_token: req.dst_parent_token,
dst: req.dst,
responder: LinkableLinkIntoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LinkableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LinkableRequest {
LinkInto { dst_parent_token: fidl::Event, dst: String, responder: LinkableLinkIntoResponder },
}
impl LinkableRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_link_into(self) -> Option<(fidl::Event, String, LinkableLinkIntoResponder)> {
if let LinkableRequest::LinkInto { dst_parent_token, dst, responder } = self {
Some((dst_parent_token, dst, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LinkableRequest::LinkInto { .. } => "link_into",
}
}
}
#[derive(Debug, Clone)]
pub struct LinkableControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LinkableControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl LinkableControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LinkableLinkIntoResponder {
control_handle: std::mem::ManuallyDrop<LinkableControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LinkableLinkIntoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LinkableLinkIntoResponder {
type ControlHandle = LinkableControlHandle;
fn control_handle(&self) -> &LinkableControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LinkableLinkIntoResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x54f3949246a03e74,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct NodeMarker;
impl fidl::endpoints::ProtocolMarker for NodeMarker {
type Proxy = NodeProxy;
type RequestStream = NodeRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = NodeSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.io.Node";
}
impl fidl::endpoints::DiscoverableProtocolMarker for NodeMarker {}
pub type NodeGetAttributesResult = Result<(MutableNodeAttributes, ImmutableNodeAttributes), i32>;
pub type NodeUpdateAttributesResult = Result<(), i32>;
pub type NodeSyncResult = Result<(), i32>;
pub type NodeGetExtendedAttributeResult = Result<ExtendedAttributeValue, i32>;
pub type NodeSetExtendedAttributeResult = Result<(), i32>;
pub type NodeRemoveExtendedAttributeResult = Result<(), i32>;
pub trait NodeProxyInterface: Send + Sync {
fn r#clone2(
&self,
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error>;
type CloseResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
> + Send;
fn r#close(&self) -> Self::CloseResponseFut;
type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
fn r#query(&self) -> Self::QueryResponseFut;
fn r#clone(
&self,
flags: OpenFlags,
object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error>;
type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
+ Send;
fn r#get_attr(&self) -> Self::GetAttrResponseFut;
type SetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_attr(
&self,
flags: NodeAttributeFlags,
attributes: &NodeAttributes,
) -> Self::SetAttrResponseFut;
type GetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
+ Send;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
type SetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_flags(&self, flags: OpenFlags) -> Self::SetFlagsResponseFut;
type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
+ Send;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
type GetConnectionInfoResponseFut: std::future::Future<Output = Result<ConnectionInfo, fidl::Error>>
+ Send;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut;
type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
+ Send;
fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
+ Send;
fn r#update_attributes(
&self,
payload: &MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut;
type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
fn r#sync(&self) -> Self::SyncResponseFut;
fn r#list_extended_attributes(
&self,
iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error>;
type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#set_extended_attribute(
&self,
name: &[u8],
value: ExtendedAttributeValue,
mode: SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut;
type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct NodeSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for NodeSynchronousProxy {
type Proxy = NodeProxy;
type Protocol = NodeMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl NodeSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<NodeEvent, fidl::Error> {
NodeEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#close(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::QueryableQueryResponse,
>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.protocol)
}
pub fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeCloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_attr(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, NodeAttributes), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.attributes))
}
pub fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<NodeSetAttrRequest, NodeSetAttrResponse>(
(flags, attributes),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#get_flags(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, OpenFlags), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetFlagsResponse>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.flags))
}
pub fn r#set_flags(
&self,
mut flags: OpenFlags,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<NodeSetFlagsRequest, NodeSetFlagsResponse>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#query_filesystem(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.info))
}
pub fn r#get_connection_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ConnectionInfo, fidl::Error> {
let _response = self.client.send_query::<fidl::encoding::EmptyPayload, ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_attributes(
&self,
mut query: NodeAttributesQuery,
___deadline: zx::MonotonicInstant,
) -> Result<NodeGetAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
NodeGetAttributesRequest,
fidl::encoding::ResultType<NodeAttributes2, i32>,
>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
pub fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
___deadline: zx::MonotonicInstant,
) -> Result<NodeUpdateAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
MutableNodeAttributes,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeGetExtendedAttributeRequest,
fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
___deadline: zx::MonotonicInstant,
) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeSetExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeRemoveExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct NodeProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for NodeProxy {
type Protocol = NodeMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl NodeProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> NodeEventStream {
NodeEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
NodeProxyInterface::r#clone2(self, request)
}
pub fn r#close(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NodeProxyInterface::r#close(self)
}
pub fn r#query(
&self,
) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
NodeProxyInterface::r#query(self)
}
pub fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
NodeProxyInterface::r#clone(self, flags, object)
}
pub fn r#get_attr(
&self,
) -> fidl::client::QueryResponseFut<
(i32, NodeAttributes),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NodeProxyInterface::r#get_attr(self)
}
pub fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
NodeProxyInterface::r#set_attr(self, flags, attributes)
}
pub fn r#get_flags(
&self,
) -> fidl::client::QueryResponseFut<
(i32, OpenFlags),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NodeProxyInterface::r#get_flags(self)
}
pub fn r#set_flags(
&self,
mut flags: OpenFlags,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
NodeProxyInterface::r#set_flags(self, flags)
}
pub fn r#query_filesystem(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<Box<FilesystemInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NodeProxyInterface::r#query_filesystem(self)
}
pub fn r#get_connection_info(
&self,
) -> fidl::client::QueryResponseFut<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
{
NodeProxyInterface::r#get_connection_info(self)
}
pub fn r#get_attributes(
&self,
mut query: NodeAttributesQuery,
) -> fidl::client::QueryResponseFut<
NodeGetAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NodeProxyInterface::r#get_attributes(self, query)
}
pub fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
) -> fidl::client::QueryResponseFut<
NodeUpdateAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NodeProxyInterface::r#update_attributes(self, payload)
}
pub fn r#sync(
&self,
) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
NodeProxyInterface::r#sync(self)
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
NodeProxyInterface::r#list_extended_attributes(self, iterator)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<
NodeGetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NodeProxyInterface::r#get_extended_attribute(self, name)
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
) -> fidl::client::QueryResponseFut<
NodeSetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NodeProxyInterface::r#set_extended_attribute(self, name, value, mode)
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<
NodeRemoveExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
NodeProxyInterface::r#remove_extended_attribute(self, name)
}
}
impl NodeProxyInterface for NodeProxy {
fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
type CloseResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#close(&self) -> Self::CloseResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5ac5d459ad7f657e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::CloseableCloseResult,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryResponseFut =
fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#query(&self) -> Self::QueryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_unknown::QueryableQueryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2658edee9decfc06,
>(_buf?)?;
Ok(_response.protocol)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeCloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetAttrResponseFut = fidl::client::QueryResponseFut<
(i32, NodeAttributes),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_attr(&self) -> Self::GetAttrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, NodeAttributes), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeGetAttrResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x78985e216314dafd,
>(_buf?)?;
Ok((_response.s, _response.attributes))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetAttrResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
) -> Self::SetAttrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeSetAttrResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4186c0f40d938f46,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<NodeSetAttrRequest, i32>(
(flags, attributes),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetFlagsResponseFut = fidl::client::QueryResponseFut<
(i32, OpenFlags),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, OpenFlags), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeGetFlagsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5b88fffb8eda3aa1,
>(_buf?)?;
Ok((_response.s, _response.flags))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetFlagsResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_flags(&self, mut flags: OpenFlags) -> Self::SetFlagsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeSetFlagsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5295b76c71fde733,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<NodeSetFlagsRequest, i32>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
(i32, Option<Box<FilesystemInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeQueryFilesystemResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6f344a1c6b0a0610,
>(_buf?)?;
Ok((_response.s, _response.info))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, Option<Box<FilesystemInfo>>),
>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetConnectionInfoResponseFut = fidl::client::QueryResponseFut<
ConnectionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ConnectionInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ConnectionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x584c377c7c0a6d0b,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetAttributesResponseFut = fidl::client::QueryResponseFut<
NodeGetAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeGetAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<NodeAttributes2, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3d4396a638ea053b,
>(_buf?)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
NodeUpdateAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeUpdateAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3308c1da5a89bf08,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SyncResponseFut = fidl::client::QueryResponseFut<
NodeSyncResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#sync(&self) -> Self::SyncResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeSyncResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c5c27ca0ab5dc49,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeGetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x45ffa3ccfdeb76db,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeGetExtendedAttributeRequest,
NodeGetExtendedAttributeResult,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeSetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4a951362f681f23c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeSetExtendedAttributeRequest,
NodeSetExtendedAttributeResult,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeRemoveExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> Self::RemoveExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7a0b9f3a9bf9032d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeRemoveExtendedAttributeRequest,
NodeRemoveExtendedAttributeResult,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct NodeEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for NodeEventStream {}
impl futures::stream::FusedStream for NodeEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for NodeEventStream {
type Item = Result<NodeEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(NodeEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum NodeEvent {
OnOpen_ {
s: i32,
info: Option<Box<NodeInfoDeprecated>>,
},
OnRepresentation {
payload: Representation,
},
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl NodeEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
if let NodeEvent::OnOpen_ { s, info } = self {
Some((s, info))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_representation(self) -> Option<Representation> {
if let NodeEvent::OnRepresentation { payload } = self {
Some((payload))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<NodeEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
0x7fc7bbb1dbfd1972 => {
let mut out = fidl::new_empty!(
NodeOnOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((NodeEvent::OnOpen_ { s: out.s, info: out.info }))
}
0x5cb40567d80a510c => {
let mut out =
fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((NodeEvent::OnRepresentation { payload: out }))
}
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(NodeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct NodeRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for NodeRequestStream {}
impl futures::stream::FusedStream for NodeRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for NodeRequestStream {
type Protocol = NodeMarker;
type ControlHandle = NodeControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
NodeControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for NodeRequestStream {
type Item = Result<NodeRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled NodeRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x20d8a7aba2168a79 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_unknown::CloneableClone2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableClone2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::Clone2 { request: req.request, control_handle })
}
0x5ac5d459ad7f657e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::Close {
responder: NodeCloseResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2658edee9decfc06 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::Query {
responder: NodeQueryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5a61678f293ce16f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
NodeCloneRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeCloneRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::Clone {
flags: req.flags,
object: req.object,
control_handle,
})
}
0x78985e216314dafd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::GetAttr {
responder: NodeGetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4186c0f40d938f46 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetAttrRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::SetAttr {
flags: req.flags,
attributes: req.attributes,
responder: NodeSetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5b88fffb8eda3aa1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::GetFlags {
responder: NodeGetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5295b76c71fde733 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetFlagsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::SetFlags {
flags: req.flags,
responder: NodeSetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6f344a1c6b0a0610 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::QueryFilesystem {
responder: NodeQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x584c377c7c0a6d0b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::GetConnectionInfo {
responder: NodeGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3d4396a638ea053b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeGetAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::GetAttributes {
query: req.query,
responder: NodeGetAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3308c1da5a89bf08 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
MutableNodeAttributes,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::UpdateAttributes {
payload: req,
responder: NodeUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2c5c27ca0ab5dc49 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::Sync {
responder: NodeSyncResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4b61033de007fcd0 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
NodeListExtendedAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::ListExtendedAttributes {
iterator: req.iterator,
control_handle,
})
}
0x45ffa3ccfdeb76db => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeGetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::GetExtendedAttribute {
name: req.name,
responder: NodeGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4a951362f681f23c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::SetExtendedAttribute {
name: req.name,
value: req.value,
mode: req.mode,
responder: NodeSetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a0b9f3a9bf9032d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeRemoveExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = NodeControlHandle { inner: this.inner.clone() };
Ok(NodeRequest::RemoveExtendedAttribute {
name: req.name,
responder: NodeRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(NodeRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: NodeControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(NodeRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: NodeControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <NodeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum NodeRequest {
Clone2 {
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
control_handle: NodeControlHandle,
},
Close {
responder: NodeCloseResponder,
},
Query {
responder: NodeQueryResponder,
},
Clone {
flags: OpenFlags,
object: fidl::endpoints::ServerEnd<NodeMarker>,
control_handle: NodeControlHandle,
},
GetAttr {
responder: NodeGetAttrResponder,
},
SetAttr {
flags: NodeAttributeFlags,
attributes: NodeAttributes,
responder: NodeSetAttrResponder,
},
GetFlags {
responder: NodeGetFlagsResponder,
},
SetFlags {
flags: OpenFlags,
responder: NodeSetFlagsResponder,
},
QueryFilesystem {
responder: NodeQueryFilesystemResponder,
},
GetConnectionInfo {
responder: NodeGetConnectionInfoResponder,
},
GetAttributes {
query: NodeAttributesQuery,
responder: NodeGetAttributesResponder,
},
UpdateAttributes {
payload: MutableNodeAttributes,
responder: NodeUpdateAttributesResponder,
},
Sync {
responder: NodeSyncResponder,
},
ListExtendedAttributes {
iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
control_handle: NodeControlHandle,
},
GetExtendedAttribute {
name: Vec<u8>,
responder: NodeGetExtendedAttributeResponder,
},
SetExtendedAttribute {
name: Vec<u8>,
value: ExtendedAttributeValue,
mode: SetExtendedAttributeMode,
responder: NodeSetExtendedAttributeResponder,
},
RemoveExtendedAttribute {
name: Vec<u8>,
responder: NodeRemoveExtendedAttributeResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: NodeControlHandle,
method_type: fidl::MethodType,
},
}
impl NodeRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_clone2(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
NodeControlHandle,
)> {
if let NodeRequest::Clone2 { request, control_handle } = self {
Some((request, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_close(self) -> Option<(NodeCloseResponder)> {
if let NodeRequest::Close { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query(self) -> Option<(NodeQueryResponder)> {
if let NodeRequest::Query { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone(
self,
) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, NodeControlHandle)> {
if let NodeRequest::Clone { flags, object, control_handle } = self {
Some((flags, object, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attr(self) -> Option<(NodeGetAttrResponder)> {
if let NodeRequest::GetAttr { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_attr(
self,
) -> Option<(NodeAttributeFlags, NodeAttributes, NodeSetAttrResponder)> {
if let NodeRequest::SetAttr { flags, attributes, responder } = self {
Some((flags, attributes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_flags(self) -> Option<(NodeGetFlagsResponder)> {
if let NodeRequest::GetFlags { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_flags(self) -> Option<(OpenFlags, NodeSetFlagsResponder)> {
if let NodeRequest::SetFlags { flags, responder } = self {
Some((flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_filesystem(self) -> Option<(NodeQueryFilesystemResponder)> {
if let NodeRequest::QueryFilesystem { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_connection_info(self) -> Option<(NodeGetConnectionInfoResponder)> {
if let NodeRequest::GetConnectionInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attributes(self) -> Option<(NodeAttributesQuery, NodeGetAttributesResponder)> {
if let NodeRequest::GetAttributes { query, responder } = self {
Some((query, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_update_attributes(
self,
) -> Option<(MutableNodeAttributes, NodeUpdateAttributesResponder)> {
if let NodeRequest::UpdateAttributes { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_sync(self) -> Option<(NodeSyncResponder)> {
if let NodeRequest::Sync { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_extended_attributes(
self,
) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, NodeControlHandle)>
{
if let NodeRequest::ListExtendedAttributes { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_extended_attribute(
self,
) -> Option<(Vec<u8>, NodeGetExtendedAttributeResponder)> {
if let NodeRequest::GetExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_extended_attribute(
self,
) -> Option<(
Vec<u8>,
ExtendedAttributeValue,
SetExtendedAttributeMode,
NodeSetExtendedAttributeResponder,
)> {
if let NodeRequest::SetExtendedAttribute { name, value, mode, responder } = self {
Some((name, value, mode, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove_extended_attribute(
self,
) -> Option<(Vec<u8>, NodeRemoveExtendedAttributeResponder)> {
if let NodeRequest::RemoveExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
NodeRequest::Clone2 { .. } => "clone2",
NodeRequest::Close { .. } => "close",
NodeRequest::Query { .. } => "query",
NodeRequest::Clone { .. } => "clone",
NodeRequest::GetAttr { .. } => "get_attr",
NodeRequest::SetAttr { .. } => "set_attr",
NodeRequest::GetFlags { .. } => "get_flags",
NodeRequest::SetFlags { .. } => "set_flags",
NodeRequest::QueryFilesystem { .. } => "query_filesystem",
NodeRequest::GetConnectionInfo { .. } => "get_connection_info",
NodeRequest::GetAttributes { .. } => "get_attributes",
NodeRequest::UpdateAttributes { .. } => "update_attributes",
NodeRequest::Sync { .. } => "sync",
NodeRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
NodeRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
NodeRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
NodeRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
NodeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
NodeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct NodeControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for NodeControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl NodeControlHandle {
pub fn send_on_open_(
&self,
mut s: i32,
mut info: Option<NodeInfoDeprecated>,
) -> Result<(), fidl::Error> {
self.inner.send::<NodeOnOpenRequest>(
(s, info.as_mut()),
0,
0x7fc7bbb1dbfd1972,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
self.inner.send::<Representation>(
&mut payload,
0,
0x5cb40567d80a510c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeCloseResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeCloseResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeCloseResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeCloseResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeQueryResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeQueryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeQueryResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeQueryResponder {
pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
(protocol,),
self.tx_id,
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeGetAttrResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeGetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeGetAttrResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeGetAttrResponder {
pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut attributes: &NodeAttributes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeGetAttrResponse>(
(s, attributes),
self.tx_id,
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeSetAttrResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeSetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeSetAttrResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeSetAttrResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeSetAttrResponse>(
(s,),
self.tx_id,
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeGetFlagsResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeGetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeGetFlagsResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeGetFlagsResponder {
pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut flags: OpenFlags,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeGetFlagsResponse>(
(s, flags),
self.tx_id,
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeSetFlagsResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeSetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeSetFlagsResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeSetFlagsResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeSetFlagsResponse>(
(s,),
self.tx_id,
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeQueryFilesystemResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeQueryFilesystemResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeQueryFilesystemResponder {
pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut info: Option<&FilesystemInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
(s, info),
self.tx_id,
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeGetConnectionInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeGetConnectionInfoResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeGetConnectionInfoResponder {
pub fn send(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ConnectionInfo>(
&mut payload,
self.tx_id,
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeGetAttributesResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeGetAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeGetAttributesResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeGetAttributesResponder {
pub fn send(
self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
result,
self.tx_id,
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeUpdateAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeUpdateAttributesResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeUpdateAttributesResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeSyncResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeSyncResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeSyncResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeSyncResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeGetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeGetExtendedAttributeResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeGetExtendedAttributeResponder {
pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<ExtendedAttributeValue, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
result.as_mut().map_err(|e| *e),
self.tx_id,
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeSetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeSetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeSetExtendedAttributeResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeSetExtendedAttributeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<NodeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeRemoveExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeRemoveExtendedAttributeResponder {
type ControlHandle = NodeControlHandle;
fn control_handle(&self) -> &NodeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeRemoveExtendedAttributeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ReadableMarker;
impl fidl::endpoints::ProtocolMarker for ReadableMarker {
type Proxy = ReadableProxy;
type RequestStream = ReadableRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ReadableSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Readable";
}
pub type ReadableReadResult = Result<Vec<u8>, i32>;
pub trait ReadableProxyInterface: Send + Sync {
type ReadResponseFut: std::future::Future<Output = Result<ReadableReadResult, fidl::Error>>
+ Send;
fn r#read(&self, count: u64) -> Self::ReadResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ReadableSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ReadableSynchronousProxy {
type Proxy = ReadableProxy;
type Protocol = ReadableMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl ReadableSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<ReadableEvent, fidl::Error> {
ReadableEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#read(
&self,
mut count: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ReadableReadResult, fidl::Error> {
let _response = self.client.send_query::<
ReadableReadRequest,
fidl::encoding::ResultType<ReadableReadResponse, i32>,
>(
(count,),
0x57e419a298c8ede,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.data))
}
}
#[derive(Debug, Clone)]
pub struct ReadableProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ReadableProxy {
type Protocol = ReadableMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl ReadableProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ReadableEventStream {
ReadableEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#read(
&self,
mut count: u64,
) -> fidl::client::QueryResponseFut<
ReadableReadResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ReadableProxyInterface::r#read(self, count)
}
}
impl ReadableProxyInterface for ReadableProxy {
type ReadResponseFut = fidl::client::QueryResponseFut<
ReadableReadResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#read(&self, mut count: u64) -> Self::ReadResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ReadableReadResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ReadableReadResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x57e419a298c8ede,
>(_buf?)?;
Ok(_response.map(|x| x.data))
}
self.client.send_query_and_decode::<ReadableReadRequest, ReadableReadResult>(
(count,),
0x57e419a298c8ede,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ReadableEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ReadableEventStream {}
impl futures::stream::FusedStream for ReadableEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ReadableEventStream {
type Item = Result<ReadableEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(ReadableEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ReadableEvent {}
impl ReadableEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ReadableEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ReadableRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ReadableRequestStream {}
impl futures::stream::FusedStream for ReadableRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ReadableRequestStream {
type Protocol = ReadableMarker;
type ControlHandle = ReadableControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
ReadableControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ReadableRequestStream {
type Item = Result<ReadableRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled ReadableRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x57e419a298c8ede => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ReadableReadRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ReadableReadRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ReadableControlHandle { inner: this.inner.clone() };
Ok(ReadableRequest::Read {
count: req.count,
responder: ReadableReadResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ReadableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ReadableRequest {
Read { count: u64, responder: ReadableReadResponder },
}
impl ReadableRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_read(self) -> Option<(u64, ReadableReadResponder)> {
if let ReadableRequest::Read { count, responder } = self {
Some((count, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ReadableRequest::Read { .. } => "read",
}
}
}
#[derive(Debug, Clone)]
pub struct ReadableControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ReadableControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl ReadableControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ReadableReadResponder {
control_handle: std::mem::ManuallyDrop<ReadableControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ReadableReadResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ReadableReadResponder {
type ControlHandle = ReadableControlHandle;
fn control_handle(&self) -> &ReadableControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ReadableReadResponder {
pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[u8], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ReadableReadResponse, i32>>(
result.map(|data| (data,)),
self.tx_id,
0x57e419a298c8ede,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SymlinkMarker;
impl fidl::endpoints::ProtocolMarker for SymlinkMarker {
type Proxy = SymlinkProxy;
type RequestStream = SymlinkRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SymlinkSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.io.Symlink";
}
impl fidl::endpoints::DiscoverableProtocolMarker for SymlinkMarker {}
pub trait SymlinkProxyInterface: Send + Sync {
type LinkIntoResponseFut: std::future::Future<Output = Result<LinkableLinkIntoResult, fidl::Error>>
+ Send;
fn r#link_into(&self, dst_parent_token: fidl::Event, dst: &str) -> Self::LinkIntoResponseFut;
fn r#clone2(
&self,
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error>;
type CloseResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
> + Send;
fn r#close(&self) -> Self::CloseResponseFut;
type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
fn r#query(&self) -> Self::QueryResponseFut;
fn r#clone(
&self,
flags: OpenFlags,
object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error>;
type GetAttrResponseFut: std::future::Future<Output = Result<(i32, NodeAttributes), fidl::Error>>
+ Send;
fn r#get_attr(&self) -> Self::GetAttrResponseFut;
type SetAttrResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_attr(
&self,
flags: NodeAttributeFlags,
attributes: &NodeAttributes,
) -> Self::SetAttrResponseFut;
type GetFlagsResponseFut: std::future::Future<Output = Result<(i32, OpenFlags), fidl::Error>>
+ Send;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut;
type SetFlagsResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_flags(&self, flags: OpenFlags) -> Self::SetFlagsResponseFut;
type QueryFilesystemResponseFut: std::future::Future<Output = Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error>>
+ Send;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut;
type GetConnectionInfoResponseFut: std::future::Future<Output = Result<ConnectionInfo, fidl::Error>>
+ Send;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut;
type GetAttributesResponseFut: std::future::Future<Output = Result<NodeGetAttributesResult, fidl::Error>>
+ Send;
fn r#get_attributes(&self, query: NodeAttributesQuery) -> Self::GetAttributesResponseFut;
type UpdateAttributesResponseFut: std::future::Future<Output = Result<NodeUpdateAttributesResult, fidl::Error>>
+ Send;
fn r#update_attributes(
&self,
payload: &MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut;
type SyncResponseFut: std::future::Future<Output = Result<NodeSyncResult, fidl::Error>> + Send;
fn r#sync(&self) -> Self::SyncResponseFut;
fn r#list_extended_attributes(
&self,
iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error>;
type GetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeGetExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#get_extended_attribute(&self, name: &[u8]) -> Self::GetExtendedAttributeResponseFut;
type SetExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeSetExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#set_extended_attribute(
&self,
name: &[u8],
value: ExtendedAttributeValue,
mode: SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut;
type RemoveExtendedAttributeResponseFut: std::future::Future<Output = Result<NodeRemoveExtendedAttributeResult, fidl::Error>>
+ Send;
fn r#remove_extended_attribute(&self, name: &[u8]) -> Self::RemoveExtendedAttributeResponseFut;
type DescribeResponseFut: std::future::Future<Output = Result<SymlinkInfo, fidl::Error>> + Send;
fn r#describe(&self) -> Self::DescribeResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SymlinkSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SymlinkSynchronousProxy {
type Proxy = SymlinkProxy;
type Protocol = SymlinkMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl SymlinkSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<SymlinkEvent, fidl::Error> {
SymlinkEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#link_into(
&self,
mut dst_parent_token: fidl::Event,
mut dst: &str,
___deadline: zx::MonotonicInstant,
) -> Result<LinkableLinkIntoResult, fidl::Error> {
let _response = self.client.send_query::<
LinkableLinkIntoRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(dst_parent_token, dst,),
0x54f3949246a03e74,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#close(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::QueryableQueryResponse,
>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.protocol)
}
pub fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeCloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_attr(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, NodeAttributes), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetAttrResponse>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.attributes))
}
pub fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<NodeSetAttrRequest, NodeSetAttrResponse>(
(flags, attributes),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#get_flags(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, OpenFlags), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeGetFlagsResponse>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.flags))
}
pub fn r#set_flags(
&self,
mut flags: OpenFlags,
___deadline: zx::MonotonicInstant,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<NodeSetFlagsRequest, NodeSetFlagsResponse>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.s)
}
pub fn r#query_filesystem(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, NodeQueryFilesystemResponse>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.s, _response.info))
}
pub fn r#get_connection_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ConnectionInfo, fidl::Error> {
let _response = self.client.send_query::<fidl::encoding::EmptyPayload, ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_attributes(
&self,
mut query: NodeAttributesQuery,
___deadline: zx::MonotonicInstant,
) -> Result<NodeGetAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
NodeGetAttributesRequest,
fidl::encoding::ResultType<NodeAttributes2, i32>,
>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
pub fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
___deadline: zx::MonotonicInstant,
) -> Result<NodeUpdateAttributesResult, fidl::Error> {
let _response = self.client.send_query::<
MutableNodeAttributes,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#sync(&self, ___deadline: zx::MonotonicInstant) -> Result<NodeSyncResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeGetExtendedAttributeRequest,
fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
___deadline: zx::MonotonicInstant,
) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeSetExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
let _response = self.client.send_query::<
NodeRemoveExtendedAttributeRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#describe(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<SymlinkInfo, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleType<SymlinkInfo>>(
(),
0x742c2ea5e89831f3,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<SymlinkMarker>("describe")?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct SymlinkProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for SymlinkProxy {
type Protocol = SymlinkMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl SymlinkProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SymlinkEventStream {
SymlinkEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#link_into(
&self,
mut dst_parent_token: fidl::Event,
mut dst: &str,
) -> fidl::client::QueryResponseFut<
LinkableLinkIntoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#link_into(self, dst_parent_token, dst)
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
SymlinkProxyInterface::r#clone2(self, request)
}
pub fn r#close(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#close(self)
}
pub fn r#query(
&self,
) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
SymlinkProxyInterface::r#query(self)
}
pub fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
SymlinkProxyInterface::r#clone(self, flags, object)
}
pub fn r#get_attr(
&self,
) -> fidl::client::QueryResponseFut<
(i32, NodeAttributes),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#get_attr(self)
}
pub fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
SymlinkProxyInterface::r#set_attr(self, flags, attributes)
}
pub fn r#get_flags(
&self,
) -> fidl::client::QueryResponseFut<
(i32, OpenFlags),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#get_flags(self)
}
pub fn r#set_flags(
&self,
mut flags: OpenFlags,
) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
SymlinkProxyInterface::r#set_flags(self, flags)
}
pub fn r#query_filesystem(
&self,
) -> fidl::client::QueryResponseFut<
(i32, Option<Box<FilesystemInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#query_filesystem(self)
}
pub fn r#get_connection_info(
&self,
) -> fidl::client::QueryResponseFut<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
{
SymlinkProxyInterface::r#get_connection_info(self)
}
pub fn r#get_attributes(
&self,
mut query: NodeAttributesQuery,
) -> fidl::client::QueryResponseFut<
NodeGetAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#get_attributes(self, query)
}
pub fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
) -> fidl::client::QueryResponseFut<
NodeUpdateAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#update_attributes(self, payload)
}
pub fn r#sync(
&self,
) -> fidl::client::QueryResponseFut<NodeSyncResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
SymlinkProxyInterface::r#sync(self)
}
pub fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
SymlinkProxyInterface::r#list_extended_attributes(self, iterator)
}
pub fn r#get_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<
NodeGetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#get_extended_attribute(self, name)
}
pub fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
) -> fidl::client::QueryResponseFut<
NodeSetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#set_extended_attribute(self, name, value, mode)
}
pub fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> fidl::client::QueryResponseFut<
NodeRemoveExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SymlinkProxyInterface::r#remove_extended_attribute(self, name)
}
pub fn r#describe(
&self,
) -> fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
{
SymlinkProxyInterface::r#describe(self)
}
}
impl SymlinkProxyInterface for SymlinkProxy {
type LinkIntoResponseFut = fidl::client::QueryResponseFut<
LinkableLinkIntoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#link_into(
&self,
mut dst_parent_token: fidl::Event,
mut dst: &str,
) -> Self::LinkIntoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LinkableLinkIntoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x54f3949246a03e74,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<LinkableLinkIntoRequest, LinkableLinkIntoResult>(
(dst_parent_token, dst),
0x54f3949246a03e74,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
type CloseResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#close(&self) -> Self::CloseResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5ac5d459ad7f657e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::CloseableCloseResult,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryResponseFut =
fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#query(&self) -> Self::QueryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_unknown::QueryableQueryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2658edee9decfc06,
>(_buf?)?;
Ok(_response.protocol)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#clone(
&self,
mut flags: OpenFlags,
mut object: fidl::endpoints::ServerEnd<NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeCloneRequest>(
(flags, object),
0x5a61678f293ce16f,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetAttrResponseFut = fidl::client::QueryResponseFut<
(i32, NodeAttributes),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_attr(&self) -> Self::GetAttrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, NodeAttributes), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeGetAttrResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x78985e216314dafd,
>(_buf?)?;
Ok((_response.s, _response.attributes))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, NodeAttributes)>(
(),
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetAttrResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_attr(
&self,
mut flags: NodeAttributeFlags,
mut attributes: &NodeAttributes,
) -> Self::SetAttrResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeSetAttrResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4186c0f40d938f46,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<NodeSetAttrRequest, i32>(
(flags, attributes),
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetFlagsResponseFut = fidl::client::QueryResponseFut<
(i32, OpenFlags),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_flags(&self) -> Self::GetFlagsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, OpenFlags), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeGetFlagsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5b88fffb8eda3aa1,
>(_buf?)?;
Ok((_response.s, _response.flags))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, OpenFlags)>(
(),
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetFlagsResponseFut =
fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_flags(&self, mut flags: OpenFlags) -> Self::SetFlagsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeSetFlagsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5295b76c71fde733,
>(_buf?)?;
Ok(_response.s)
}
self.client.send_query_and_decode::<NodeSetFlagsRequest, i32>(
(flags,),
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryFilesystemResponseFut = fidl::client::QueryResponseFut<
(i32, Option<Box<FilesystemInfo>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#query_filesystem(&self) -> Self::QueryFilesystemResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<FilesystemInfo>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeQueryFilesystemResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6f344a1c6b0a0610,
>(_buf?)?;
Ok((_response.s, _response.info))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
(i32, Option<Box<FilesystemInfo>>),
>(
(),
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetConnectionInfoResponseFut = fidl::client::QueryResponseFut<
ConnectionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_connection_info(&self) -> Self::GetConnectionInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ConnectionInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ConnectionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x584c377c7c0a6d0b,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ConnectionInfo>(
(),
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetAttributesResponseFut = fidl::client::QueryResponseFut<
NodeGetAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_attributes(&self, mut query: NodeAttributesQuery) -> Self::GetAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeGetAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<NodeAttributes2, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3d4396a638ea053b,
>(_buf?)?;
Ok(_response.map(|x| (x.mutable_attributes, x.immutable_attributes)))
}
self.client.send_query_and_decode::<NodeGetAttributesRequest, NodeGetAttributesResult>(
(query,),
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UpdateAttributesResponseFut = fidl::client::QueryResponseFut<
NodeUpdateAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#update_attributes(
&self,
mut payload: &MutableNodeAttributes,
) -> Self::UpdateAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeUpdateAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3308c1da5a89bf08,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<MutableNodeAttributes, NodeUpdateAttributesResult>(
payload,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SyncResponseFut = fidl::client::QueryResponseFut<
NodeSyncResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#sync(&self) -> Self::SyncResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeSyncResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c5c27ca0ab5dc49,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, NodeSyncResult>(
(),
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#list_extended_attributes(
&self,
mut iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<NodeListExtendedAttributesRequest>(
(iterator,),
0x4b61033de007fcd0,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeGetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_extended_attribute(&self, mut name: &[u8]) -> Self::GetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeGetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ExtendedAttributeValue, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x45ffa3ccfdeb76db,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeGetExtendedAttributeRequest,
NodeGetExtendedAttributeResult,
>(
(name,),
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeSetExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_extended_attribute(
&self,
mut name: &[u8],
mut value: ExtendedAttributeValue,
mut mode: SetExtendedAttributeMode,
) -> Self::SetExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeSetExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4a951362f681f23c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeSetExtendedAttributeRequest,
NodeSetExtendedAttributeResult,
>(
(name, &mut value, mode,),
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveExtendedAttributeResponseFut = fidl::client::QueryResponseFut<
NodeRemoveExtendedAttributeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#remove_extended_attribute(
&self,
mut name: &[u8],
) -> Self::RemoveExtendedAttributeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<NodeRemoveExtendedAttributeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7a0b9f3a9bf9032d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
NodeRemoveExtendedAttributeRequest,
NodeRemoveExtendedAttributeResult,
>(
(name,),
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DescribeResponseFut =
fidl::client::QueryResponseFut<SymlinkInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#describe(&self) -> Self::DescribeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SymlinkInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<SymlinkInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x742c2ea5e89831f3,
>(_buf?)?
.into_result::<SymlinkMarker>("describe")?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SymlinkInfo>(
(),
0x742c2ea5e89831f3,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct SymlinkEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for SymlinkEventStream {}
impl futures::stream::FusedStream for SymlinkEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SymlinkEventStream {
type Item = Result<SymlinkEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(SymlinkEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SymlinkEvent {
OnOpen_ {
s: i32,
info: Option<Box<NodeInfoDeprecated>>,
},
OnRepresentation {
payload: Representation,
},
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl SymlinkEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_open_(self) -> Option<(i32, Option<Box<NodeInfoDeprecated>>)> {
if let SymlinkEvent::OnOpen_ { s, info } = self {
Some((s, info))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_representation(self) -> Option<Representation> {
if let SymlinkEvent::OnRepresentation { payload } = self {
Some((payload))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<SymlinkEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
0x7fc7bbb1dbfd1972 => {
let mut out = fidl::new_empty!(
NodeOnOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeOnOpenRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((SymlinkEvent::OnOpen_ { s: out.s, info: out.info }))
}
0x5cb40567d80a510c => {
let mut out =
fidl::new_empty!(Representation, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Representation>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((SymlinkEvent::OnRepresentation { payload: out }))
}
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(SymlinkEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SymlinkRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for SymlinkRequestStream {}
impl futures::stream::FusedStream for SymlinkRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SymlinkRequestStream {
type Protocol = SymlinkMarker;
type ControlHandle = SymlinkControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
SymlinkControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for SymlinkRequestStream {
type Item = Result<SymlinkRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled SymlinkRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x54f3949246a03e74 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LinkableLinkIntoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LinkableLinkIntoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::LinkInto {
dst_parent_token: req.dst_parent_token,
dst: req.dst,
responder: SymlinkLinkIntoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x20d8a7aba2168a79 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_unknown::CloneableClone2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableClone2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::Clone2 { request: req.request, control_handle })
}
0x5ac5d459ad7f657e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::Close {
responder: SymlinkCloseResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2658edee9decfc06 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::Query {
responder: SymlinkQueryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5a61678f293ce16f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
NodeCloneRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeCloneRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::Clone {
flags: req.flags,
object: req.object,
control_handle,
})
}
0x78985e216314dafd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::GetAttr {
responder: SymlinkGetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4186c0f40d938f46 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetAttrRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetAttrRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::SetAttr {
flags: req.flags,
attributes: req.attributes,
responder: SymlinkSetAttrResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5b88fffb8eda3aa1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::GetFlags {
responder: SymlinkGetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5295b76c71fde733 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetFlagsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetFlagsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::SetFlags {
flags: req.flags,
responder: SymlinkSetFlagsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6f344a1c6b0a0610 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::QueryFilesystem {
responder: SymlinkQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x584c377c7c0a6d0b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::GetConnectionInfo {
responder: SymlinkGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3d4396a638ea053b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeGetAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::GetAttributes {
query: req.query,
responder: SymlinkGetAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3308c1da5a89bf08 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
MutableNodeAttributes,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<MutableNodeAttributes>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::UpdateAttributes {
payload: req,
responder: SymlinkUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2c5c27ca0ab5dc49 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::Sync {
responder: SymlinkSyncResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4b61033de007fcd0 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
NodeListExtendedAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeListExtendedAttributesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::ListExtendedAttributes {
iterator: req.iterator,
control_handle,
})
}
0x45ffa3ccfdeb76db => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeGetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeGetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::GetExtendedAttribute {
name: req.name,
responder: SymlinkGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4a951362f681f23c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeSetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeSetExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::SetExtendedAttribute {
name: req.name,
value: req.value,
mode: req.mode,
responder: SymlinkSetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a0b9f3a9bf9032d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
NodeRemoveExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NodeRemoveExtendedAttributeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::RemoveExtendedAttribute {
name: req.name,
responder: SymlinkRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x742c2ea5e89831f3 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SymlinkControlHandle { inner: this.inner.clone() };
Ok(SymlinkRequest::Describe {
responder: SymlinkDescribeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(SymlinkRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: SymlinkControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(SymlinkRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: SymlinkControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<SymlinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum SymlinkRequest {
LinkInto {
dst_parent_token: fidl::Event,
dst: String,
responder: SymlinkLinkIntoResponder,
},
Clone2 {
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
control_handle: SymlinkControlHandle,
},
Close {
responder: SymlinkCloseResponder,
},
Query {
responder: SymlinkQueryResponder,
},
Clone {
flags: OpenFlags,
object: fidl::endpoints::ServerEnd<NodeMarker>,
control_handle: SymlinkControlHandle,
},
GetAttr {
responder: SymlinkGetAttrResponder,
},
SetAttr {
flags: NodeAttributeFlags,
attributes: NodeAttributes,
responder: SymlinkSetAttrResponder,
},
GetFlags {
responder: SymlinkGetFlagsResponder,
},
SetFlags {
flags: OpenFlags,
responder: SymlinkSetFlagsResponder,
},
QueryFilesystem {
responder: SymlinkQueryFilesystemResponder,
},
GetConnectionInfo {
responder: SymlinkGetConnectionInfoResponder,
},
GetAttributes {
query: NodeAttributesQuery,
responder: SymlinkGetAttributesResponder,
},
UpdateAttributes {
payload: MutableNodeAttributes,
responder: SymlinkUpdateAttributesResponder,
},
Sync {
responder: SymlinkSyncResponder,
},
ListExtendedAttributes {
iterator: fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
control_handle: SymlinkControlHandle,
},
GetExtendedAttribute {
name: Vec<u8>,
responder: SymlinkGetExtendedAttributeResponder,
},
SetExtendedAttribute {
name: Vec<u8>,
value: ExtendedAttributeValue,
mode: SetExtendedAttributeMode,
responder: SymlinkSetExtendedAttributeResponder,
},
RemoveExtendedAttribute {
name: Vec<u8>,
responder: SymlinkRemoveExtendedAttributeResponder,
},
Describe {
responder: SymlinkDescribeResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: SymlinkControlHandle,
method_type: fidl::MethodType,
},
}
impl SymlinkRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_link_into(self) -> Option<(fidl::Event, String, SymlinkLinkIntoResponder)> {
if let SymlinkRequest::LinkInto { dst_parent_token, dst, responder } = self {
Some((dst_parent_token, dst, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone2(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
SymlinkControlHandle,
)> {
if let SymlinkRequest::Clone2 { request, control_handle } = self {
Some((request, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_close(self) -> Option<(SymlinkCloseResponder)> {
if let SymlinkRequest::Close { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query(self) -> Option<(SymlinkQueryResponder)> {
if let SymlinkRequest::Query { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone(
self,
) -> Option<(OpenFlags, fidl::endpoints::ServerEnd<NodeMarker>, SymlinkControlHandle)> {
if let SymlinkRequest::Clone { flags, object, control_handle } = self {
Some((flags, object, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attr(self) -> Option<(SymlinkGetAttrResponder)> {
if let SymlinkRequest::GetAttr { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_attr(
self,
) -> Option<(NodeAttributeFlags, NodeAttributes, SymlinkSetAttrResponder)> {
if let SymlinkRequest::SetAttr { flags, attributes, responder } = self {
Some((flags, attributes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_flags(self) -> Option<(SymlinkGetFlagsResponder)> {
if let SymlinkRequest::GetFlags { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_flags(self) -> Option<(OpenFlags, SymlinkSetFlagsResponder)> {
if let SymlinkRequest::SetFlags { flags, responder } = self {
Some((flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query_filesystem(self) -> Option<(SymlinkQueryFilesystemResponder)> {
if let SymlinkRequest::QueryFilesystem { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_connection_info(self) -> Option<(SymlinkGetConnectionInfoResponder)> {
if let SymlinkRequest::GetConnectionInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_attributes(
self,
) -> Option<(NodeAttributesQuery, SymlinkGetAttributesResponder)> {
if let SymlinkRequest::GetAttributes { query, responder } = self {
Some((query, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_update_attributes(
self,
) -> Option<(MutableNodeAttributes, SymlinkUpdateAttributesResponder)> {
if let SymlinkRequest::UpdateAttributes { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_sync(self) -> Option<(SymlinkSyncResponder)> {
if let SymlinkRequest::Sync { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_extended_attributes(
self,
) -> Option<(fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>, SymlinkControlHandle)>
{
if let SymlinkRequest::ListExtendedAttributes { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_extended_attribute(
self,
) -> Option<(Vec<u8>, SymlinkGetExtendedAttributeResponder)> {
if let SymlinkRequest::GetExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_extended_attribute(
self,
) -> Option<(
Vec<u8>,
ExtendedAttributeValue,
SetExtendedAttributeMode,
SymlinkSetExtendedAttributeResponder,
)> {
if let SymlinkRequest::SetExtendedAttribute { name, value, mode, responder } = self {
Some((name, value, mode, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove_extended_attribute(
self,
) -> Option<(Vec<u8>, SymlinkRemoveExtendedAttributeResponder)> {
if let SymlinkRequest::RemoveExtendedAttribute { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_describe(self) -> Option<(SymlinkDescribeResponder)> {
if let SymlinkRequest::Describe { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SymlinkRequest::LinkInto { .. } => "link_into",
SymlinkRequest::Clone2 { .. } => "clone2",
SymlinkRequest::Close { .. } => "close",
SymlinkRequest::Query { .. } => "query",
SymlinkRequest::Clone { .. } => "clone",
SymlinkRequest::GetAttr { .. } => "get_attr",
SymlinkRequest::SetAttr { .. } => "set_attr",
SymlinkRequest::GetFlags { .. } => "get_flags",
SymlinkRequest::SetFlags { .. } => "set_flags",
SymlinkRequest::QueryFilesystem { .. } => "query_filesystem",
SymlinkRequest::GetConnectionInfo { .. } => "get_connection_info",
SymlinkRequest::GetAttributes { .. } => "get_attributes",
SymlinkRequest::UpdateAttributes { .. } => "update_attributes",
SymlinkRequest::Sync { .. } => "sync",
SymlinkRequest::ListExtendedAttributes { .. } => "list_extended_attributes",
SymlinkRequest::GetExtendedAttribute { .. } => "get_extended_attribute",
SymlinkRequest::SetExtendedAttribute { .. } => "set_extended_attribute",
SymlinkRequest::RemoveExtendedAttribute { .. } => "remove_extended_attribute",
SymlinkRequest::Describe { .. } => "describe",
SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
SymlinkRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct SymlinkControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for SymlinkControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl SymlinkControlHandle {
pub fn send_on_open_(
&self,
mut s: i32,
mut info: Option<NodeInfoDeprecated>,
) -> Result<(), fidl::Error> {
self.inner.send::<NodeOnOpenRequest>(
(s, info.as_mut()),
0,
0x7fc7bbb1dbfd1972,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_representation(&self, mut payload: Representation) -> Result<(), fidl::Error> {
self.inner.send::<Representation>(
&mut payload,
0,
0x5cb40567d80a510c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkLinkIntoResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkLinkIntoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkLinkIntoResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkLinkIntoResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x54f3949246a03e74,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkCloseResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkCloseResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkCloseResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkCloseResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkQueryResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkQueryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkQueryResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkQueryResponder {
pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
(protocol,),
self.tx_id,
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkGetAttrResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkGetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkGetAttrResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkGetAttrResponder {
pub fn send(self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut attributes: &NodeAttributes,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, attributes);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut attributes: &NodeAttributes) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeGetAttrResponse>(
(s, attributes),
self.tx_id,
0x78985e216314dafd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkSetAttrResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkSetAttrResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkSetAttrResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkSetAttrResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeSetAttrResponse>(
(s,),
self.tx_id,
0x4186c0f40d938f46,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkGetFlagsResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkGetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkGetFlagsResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkGetFlagsResponder {
pub fn send(self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut flags: OpenFlags,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, flags);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut flags: OpenFlags) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeGetFlagsResponse>(
(s, flags),
self.tx_id,
0x5b88fffb8eda3aa1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkSetFlagsResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkSetFlagsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkSetFlagsResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkSetFlagsResponder {
pub fn send(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut s: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(s);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeSetFlagsResponse>(
(s,),
self.tx_id,
0x5295b76c71fde733,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkQueryFilesystemResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkQueryFilesystemResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkQueryFilesystemResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkQueryFilesystemResponder {
pub fn send(self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut s: i32,
mut info: Option<&FilesystemInfo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(s, info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut s: i32, mut info: Option<&FilesystemInfo>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeQueryFilesystemResponse>(
(s, info),
self.tx_id,
0x6f344a1c6b0a0610,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkGetConnectionInfoResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkGetConnectionInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkGetConnectionInfoResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkGetConnectionInfoResponder {
pub fn send(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: ConnectionInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ConnectionInfo>(
&mut payload,
self.tx_id,
0x584c377c7c0a6d0b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkGetAttributesResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkGetAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkGetAttributesResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkGetAttributesResponder {
pub fn send(
self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(&MutableNodeAttributes, &ImmutableNodeAttributes), i32>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<NodeAttributes2, i32>>(
result,
self.tx_id,
0x3d4396a638ea053b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkUpdateAttributesResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkUpdateAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkUpdateAttributesResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkUpdateAttributesResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3308c1da5a89bf08,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkSyncResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkSyncResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkSyncResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkSyncResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x2c5c27ca0ab5dc49,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkGetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkGetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkGetExtendedAttributeResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkGetExtendedAttributeResponder {
pub fn send(self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<ExtendedAttributeValue, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<ExtendedAttributeValue, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ExtendedAttributeValue, i32>>(
result.as_mut().map_err(|e| *e),
self.tx_id,
0x45ffa3ccfdeb76db,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkSetExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkSetExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkSetExtendedAttributeResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkSetExtendedAttributeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x4a951362f681f23c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkRemoveExtendedAttributeResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkRemoveExtendedAttributeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkRemoveExtendedAttributeResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkRemoveExtendedAttributeResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x7a0b9f3a9bf9032d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SymlinkDescribeResponder {
control_handle: std::mem::ManuallyDrop<SymlinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SymlinkDescribeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SymlinkDescribeResponder {
type ControlHandle = SymlinkControlHandle;
fn control_handle(&self) -> &SymlinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SymlinkDescribeResponder {
pub fn send(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: &SymlinkInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleType<SymlinkInfo>>(
fidl::encoding::Flexible::new(payload),
self.tx_id,
0x742c2ea5e89831f3,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WritableMarker;
impl fidl::endpoints::ProtocolMarker for WritableMarker {
type Proxy = WritableProxy;
type RequestStream = WritableRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WritableSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Writable";
}
pub type WritableWriteResult = Result<u64, i32>;
pub trait WritableProxyInterface: Send + Sync {
type WriteResponseFut: std::future::Future<Output = Result<WritableWriteResult, fidl::Error>>
+ Send;
fn r#write(&self, data: &[u8]) -> Self::WriteResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WritableSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WritableSynchronousProxy {
type Proxy = WritableProxy;
type Protocol = WritableMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl WritableSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<WritableEvent, fidl::Error> {
WritableEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#write(
&self,
mut data: &[u8],
___deadline: zx::MonotonicInstant,
) -> Result<WritableWriteResult, fidl::Error> {
let _response = self.client.send_query::<
WritableWriteRequest,
fidl::encoding::ResultType<WritableWriteResponse, i32>,
>(
(data,),
0x6a31437832469f82,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.actual_count))
}
}
#[derive(Debug, Clone)]
pub struct WritableProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WritableProxy {
type Protocol = WritableMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl WritableProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WritableEventStream {
WritableEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#write(
&self,
mut data: &[u8],
) -> fidl::client::QueryResponseFut<
WritableWriteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
WritableProxyInterface::r#write(self, data)
}
}
impl WritableProxyInterface for WritableProxy {
type WriteResponseFut = fidl::client::QueryResponseFut<
WritableWriteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#write(&self, mut data: &[u8]) -> Self::WriteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<WritableWriteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<WritableWriteResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6a31437832469f82,
>(_buf?)?;
Ok(_response.map(|x| x.actual_count))
}
self.client.send_query_and_decode::<WritableWriteRequest, WritableWriteResult>(
(data,),
0x6a31437832469f82,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct WritableEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WritableEventStream {}
impl futures::stream::FusedStream for WritableEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WritableEventStream {
type Item = Result<WritableEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(WritableEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WritableEvent {}
impl WritableEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WritableEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WritableRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WritableRequestStream {}
impl futures::stream::FusedStream for WritableRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WritableRequestStream {
type Protocol = WritableMarker;
type ControlHandle = WritableControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
WritableControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for WritableRequestStream {
type Item = Result<WritableRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled WritableRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x6a31437832469f82 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
WritableWriteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WritableWriteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = WritableControlHandle { inner: this.inner.clone() };
Ok(WritableRequest::Write {
data: req.data,
responder: WritableWriteResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<WritableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WritableRequest {
Write { data: Vec<u8>, responder: WritableWriteResponder },
}
impl WritableRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_write(self) -> Option<(Vec<u8>, WritableWriteResponder)> {
if let WritableRequest::Write { data, responder } = self {
Some((data, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WritableRequest::Write { .. } => "write",
}
}
}
#[derive(Debug, Clone)]
pub struct WritableControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WritableControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl WritableControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WritableWriteResponder {
control_handle: std::mem::ManuallyDrop<WritableControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WritableWriteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WritableWriteResponder {
type ControlHandle = WritableControlHandle;
fn control_handle(&self) -> &WritableControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WritableWriteResponder {
pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<WritableWriteResponse, i32>>(
result.map(|actual_count| (actual_count,)),
self.tx_id,
0x6a31437832469f82,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for AllocateMode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for AllocateMode {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AllocateMode {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AllocateMode {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ConnectorFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for ConnectorFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ConnectorFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConnectorFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for FileProtocolFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for FileProtocolFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for FileProtocolFlags
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileProtocolFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for FileSignal {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for FileSignal {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FileSignal {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSignal {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Flags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for Flags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Flags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Flags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ModeType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for ModeType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ModeType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ModeType {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for NodeAttributeFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for NodeAttributeFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for NodeAttributeFlags
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributeFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for NodeAttributesQuery {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for NodeAttributesQuery {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for NodeAttributesQuery
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributesQuery {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for NodeFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for NodeFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for NodeFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for NodeProtocolFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for NodeProtocolFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for NodeProtocolFlags
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeProtocolFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for NodeProtocolKinds {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for NodeProtocolKinds {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for NodeProtocolKinds
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeProtocolKinds {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for OpenFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for OpenFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OpenFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpenFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Operations {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for Operations {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Operations {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Operations {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for SymlinkProtocolFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for SymlinkProtocolFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for SymlinkProtocolFlags
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SymlinkProtocolFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for UnlinkFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for UnlinkFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for UnlinkFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnlinkFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for VmoFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for VmoFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for VmoFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VmoFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for WatchMask {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for WatchMask {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WatchMask {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WatchMask {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for AdvisoryLockType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for AdvisoryLockType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for AdvisoryLockType
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AdvisoryLockType {
#[inline(always)]
fn new_empty() -> Self {
Self::Read
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for CreationMode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for CreationMode {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CreationMode {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreationMode {
#[inline(always)]
fn new_empty() -> Self {
Self::Never
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DirentType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for DirentType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DirentType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirentType {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for HashAlgorithm {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for HashAlgorithm {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for HashAlgorithm {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HashAlgorithm {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for SeekOrigin {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for SeekOrigin {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SeekOrigin {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SeekOrigin {
#[inline(always)]
fn new_empty() -> Self {
Self::Start
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for SetExtendedAttributeMode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for SetExtendedAttributeMode {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for SetExtendedAttributeMode
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SetExtendedAttributeMode
{
#[inline(always)]
fn new_empty() -> Self {
Self::Set
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for WatchEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for WatchEvent {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WatchEvent {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WatchEvent {
#[inline(always)]
fn new_empty() -> Self {
Self::Deleted
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AdvisoryLockRange {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AdvisoryLockRange {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AdvisoryLockRange, D>
for &AdvisoryLockRange
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AdvisoryLockRange>(offset);
fidl::encoding::Encode::<AdvisoryLockRange, D>::encode(
(
<SeekOrigin as fidl::encoding::ValueTypeMarker>::borrow(&self.origin),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<SeekOrigin, D>,
T1: fidl::encoding::Encode<i64, D>,
T2: fidl::encoding::Encode<i64, D>,
> fidl::encoding::Encode<AdvisoryLockRange, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AdvisoryLockRange>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AdvisoryLockRange {
#[inline(always)]
fn new_empty() -> Self {
Self {
origin: fidl::new_empty!(SeekOrigin, D),
offset: fidl::new_empty!(i64, D),
length: fidl::new_empty!(i64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(SeekOrigin, D, &mut self.origin, decoder, offset + 0, _depth)?;
fidl::decode!(i64, D, &mut self.offset, decoder, offset + 8, _depth)?;
fidl::decode!(i64, D, &mut self.length, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AdvisoryLockingAdvisoryLockRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AdvisoryLockingAdvisoryLockRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AdvisoryLockingAdvisoryLockRequest, D>
for &AdvisoryLockingAdvisoryLockRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AdvisoryLockingAdvisoryLockRequest>(offset);
fidl::encoding::Encode::<AdvisoryLockingAdvisoryLockRequest, D>::encode(
(<AdvisoryLockRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.request),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<AdvisoryLockRequest, D>,
> fidl::encoding::Encode<AdvisoryLockingAdvisoryLockRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AdvisoryLockingAdvisoryLockRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AdvisoryLockingAdvisoryLockRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { request: fidl::new_empty!(AdvisoryLockRequest, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(AdvisoryLockRequest, D, &mut self.request, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirectoryCreateSymlinkRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryCreateSymlinkRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl
fidl::encoding::Encode<
DirectoryCreateSymlinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DirectoryCreateSymlinkRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
fidl::encoding::Encode::<
DirectoryCreateSymlinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
&self.target,
),
<fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.connection
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Vector<u8, 4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DirectoryCreateSymlinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryCreateSymlinkRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryCreateSymlinkRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect),
connection: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::Vector<u8, 4095>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.target, decoder, offset + 16, _depth)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SymlinkMarker>>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.connection,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirectoryGetTokenResponse {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryGetTokenResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
DirectoryGetTokenResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DirectoryGetTokenResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
fidl::encoding::Encode::<
DirectoryGetTokenResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
<fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.token
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DirectoryGetTokenResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryGetTokenResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryGetTokenResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
token: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
i32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.s,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.token,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirectoryLinkRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryLinkRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl
fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut DirectoryLinkRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
fidl::encoding::Encode::<
DirectoryLinkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.src,
),
<fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.dst_parent_token,
),
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.dst,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<DirectoryLinkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryLinkRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryLinkRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
src: fidl::new_empty!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
dst: fidl::new_empty!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.src,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dst,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DirectoryLinkResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryLinkResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectoryLinkResponse, D>
for &DirectoryLinkResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryLinkResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DirectoryLinkResponse)
.write_unaligned((self as *const DirectoryLinkResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DirectoryLinkResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryLinkResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectoryLinkResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { s: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DirectoryObject {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryObject {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectoryObject, D>
for &DirectoryObject
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryObject>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectoryObject {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ResourceTypeMarker for DirectoryOpen2Request {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryOpen2Request {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl
fidl::encoding::Encode<DirectoryOpen2Request, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut DirectoryOpen2Request
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryOpen2Request>(offset);
fidl::encoding::Encode::<DirectoryOpen2Request, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
<ConnectionProtocols as fidl::encoding::ValueTypeMarker>::borrow(&self.protocols),
<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object_request),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
ConnectionProtocols,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<DirectoryOpen2Request, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryOpen2Request>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryOpen2Request
{
#[inline(always)]
fn new_empty() -> Self {
Self {
path: fidl::new_empty!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
protocols: fidl::new_empty!(
ConnectionProtocols,
fidl::encoding::DefaultFuchsiaResourceDialect
),
object_request: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.path,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
ConnectionProtocols,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.protocols,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object_request, decoder, offset + 32, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirectoryOpen3Request {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryOpen3Request {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl
fidl::encoding::Encode<DirectoryOpen3Request, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut DirectoryOpen3Request
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryOpen3Request>(offset);
fidl::encoding::Encode::<DirectoryOpen3Request, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
<Flags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
<Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<Flags, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
T3: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<DirectoryOpen3Request, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryOpen3Request>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryOpen3Request
{
#[inline(always)]
fn new_empty() -> Self {
Self {
path: fidl::new_empty!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
flags: fidl::new_empty!(Flags, fidl::encoding::DefaultFuchsiaResourceDialect),
options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
object: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.path,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
Flags,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.flags,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
Options,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.object, decoder, offset + 40, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirectoryOpenRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryOpenRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl
fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut DirectoryOpenRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
fidl::encoding::Encode::<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
<ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<ModeType, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<DirectoryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryOpenRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryOpenRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
mode: fidl::new_empty!(ModeType, fidl::encoding::DefaultFuchsiaResourceDialect),
path: fidl::new_empty!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
object: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.flags,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
ModeType,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.mode,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.path,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.object,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DirectoryReadDirentsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryReadDirentsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DirectoryReadDirentsRequest, D> for &DirectoryReadDirentsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryReadDirentsRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DirectoryReadDirentsRequest)
.write_unaligned((self as *const DirectoryReadDirentsRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<DirectoryReadDirentsRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryReadDirentsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DirectoryReadDirentsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { max_bytes: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DirectoryReadDirentsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryReadDirentsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DirectoryReadDirentsResponse, D> for &DirectoryReadDirentsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryReadDirentsResponse>(offset);
fidl::encoding::Encode::<DirectoryReadDirentsResponse, D>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.dirents,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i32, D>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
> fidl::encoding::Encode<DirectoryReadDirentsResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryReadDirentsResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DirectoryReadDirentsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
s: fidl::new_empty!(i32, D),
dirents: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(i32, D, &mut self.s, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.dirents, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirectoryRenameRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryRenameRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl
fidl::encoding::Encode<
DirectoryRenameRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DirectoryRenameRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
fidl::encoding::Encode::<
DirectoryRenameRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.src,
),
<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.dst_parent_token,
),
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.dst,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DirectoryRenameRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryRenameRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryRenameRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
src: fidl::new_empty!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
dst: fidl::new_empty!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.src,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 16, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dst,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DirectoryRewindResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryRewindResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DirectoryRewindResponse, D> for &DirectoryRewindResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryRewindResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DirectoryRewindResponse)
.write_unaligned((self as *const DirectoryRewindResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DirectoryRewindResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryRewindResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DirectoryRewindResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { s: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DirectoryUnlinkRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryUnlinkRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DirectoryUnlinkRequest, D> for &DirectoryUnlinkRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryUnlinkRequest>(offset);
fidl::encoding::Encode::<DirectoryUnlinkRequest, D>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<UnlinkOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
T1: fidl::encoding::Encode<UnlinkOptions, D>,
> fidl::encoding::Encode<DirectoryUnlinkRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryUnlinkRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DirectoryUnlinkRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
options: fidl::new_empty!(UnlinkOptions, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(UnlinkOptions, D, &mut self.options, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirectoryWatchRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryWatchRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl
fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut DirectoryWatchRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
fidl::encoding::Encode::<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<WatchMask as fidl::encoding::ValueTypeMarker>::borrow(&self.mask),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<DirectoryWatchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryWatchRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryWatchRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
mask: fidl::new_empty!(WatchMask, fidl::encoding::DefaultFuchsiaResourceDialect),
options: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
watcher: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
WatchMask,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.mask,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DirectoryWatcherMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.watcher,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DirectoryWatchResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryWatchResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DirectoryWatchResponse, D> for &DirectoryWatchResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryWatchResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DirectoryWatchResponse)
.write_unaligned((self as *const DirectoryWatchResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<DirectoryWatchResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryWatchResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DirectoryWatchResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { s: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for EmptyStruct {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for EmptyStruct {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EmptyStruct, D>
for &EmptyStruct
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<EmptyStruct>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EmptyStruct {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ValueTypeMarker for ExtendedAttributeIteratorGetNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeIteratorGetNextResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ExtendedAttributeIteratorGetNextResponse, D>
for &ExtendedAttributeIteratorGetNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExtendedAttributeIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<ExtendedAttributeIteratorGetNextResponse, D>::encode(
(
<fidl::encoding::Vector<fidl::encoding::Vector<u8, 255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.last),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<fidl::encoding::Vector<u8, 255>, 128>, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<ExtendedAttributeIteratorGetNextResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExtendedAttributeIteratorGetNextResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ExtendedAttributeIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
attributes: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::Vector<u8, 255>, 128>,
D
),
last: fidl::new_empty!(bool, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::Vector<u8, 255>, 128>,
D,
&mut self.attributes,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(bool, D, &mut self.last, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for FileAllocateRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileAllocateRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut FileAllocateRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileAllocateRequest>(offset);
fidl::encoding::Encode::<
FileAllocateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
<AllocateMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<FileAllocateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileAllocateRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for FileAllocateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
offset: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
length: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
mode: fidl::new_empty!(AllocateMode, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.offset,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.length,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
AllocateMode,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.mode,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for FileEnableVerityRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileEnableVerityRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
FileEnableVerityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut FileEnableVerityRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
fidl::encoding::Encode::<
FileEnableVerityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
VerificationOptions,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
FileEnableVerityRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileEnableVerityRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for FileEnableVerityRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
options: fidl::new_empty!(
VerificationOptions,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
VerificationOptions,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FileGetBackingMemoryRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<FileGetBackingMemoryRequest, D> for &FileGetBackingMemoryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileGetBackingMemoryRequest>(offset);
fidl::encoding::Encode::<FileGetBackingMemoryRequest, D>::encode(
(<VmoFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<VmoFlags, D>>
fidl::encoding::Encode<FileGetBackingMemoryRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileGetBackingMemoryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for FileGetBackingMemoryRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { flags: fidl::new_empty!(VmoFlags, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(VmoFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for FileObject {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileObject {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut FileObject
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileObject>(offset);
fidl::encoding::Encode::<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.event),
<fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stream),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Stream,
{ fidl::ObjectType::STREAM.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<FileObject, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileObject>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileObject {
#[inline(always)]
fn new_empty() -> Self {
Self {
event: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
stream: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Stream,
{ fidl::ObjectType::STREAM.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.event,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Stream,
{ fidl::ObjectType::STREAM.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.stream,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FileReadAtRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileReadAtRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileReadAtRequest, D>
for &FileReadAtRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileReadAtRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut FileReadAtRequest)
.write_unaligned((self as *const FileReadAtRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<FileReadAtRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileReadAtRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileReadAtRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { count: fidl::new_empty!(u64, D), offset: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FileResizeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileResizeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileResizeRequest, D>
for &FileResizeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileResizeRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut FileResizeRequest)
.write_unaligned((self as *const FileResizeRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<FileResizeRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileResizeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileResizeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { length: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FileSeekRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileSeekRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileSeekRequest, D>
for &FileSeekRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileSeekRequest>(offset);
fidl::encoding::Encode::<FileSeekRequest, D>::encode(
(
<SeekOrigin as fidl::encoding::ValueTypeMarker>::borrow(&self.origin),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<SeekOrigin, D>,
T1: fidl::encoding::Encode<i64, D>,
> fidl::encoding::Encode<FileSeekRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileSeekRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSeekRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { origin: fidl::new_empty!(SeekOrigin, D), offset: fidl::new_empty!(i64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(SeekOrigin, D, &mut self.origin, decoder, offset + 0, _depth)?;
fidl::decode!(i64, D, &mut self.offset, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FileWriteAtRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileWriteAtRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileWriteAtRequest, D>
for &FileWriteAtRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileWriteAtRequest>(offset);
fidl::encoding::Encode::<FileWriteAtRequest, D>::encode(
(
<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.data,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<FileWriteAtRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileWriteAtRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileWriteAtRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
offset: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.offset, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for FileGetBackingMemoryResponse {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileGetBackingMemoryResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
FileGetBackingMemoryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut FileGetBackingMemoryResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
fidl::encoding::Encode::<
FileGetBackingMemoryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.vmo
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
FileGetBackingMemoryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileGetBackingMemoryResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for FileGetBackingMemoryResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FileReadAtResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileReadAtResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileReadAtResponse, D>
for &FileReadAtResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileReadAtResponse>(offset);
fidl::encoding::Encode::<FileReadAtResponse, D>::encode(
(<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.data,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
> fidl::encoding::Encode<FileReadAtResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileReadAtResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileReadAtResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FileSeekResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileSeekResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileSeekResponse, D>
for &FileSeekResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileSeekResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut FileSeekResponse)
.write_unaligned((self as *const FileSeekResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<FileSeekResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileSeekResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSeekResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { offset_from_start: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FileWriteAtResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileWriteAtResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileWriteAtResponse, D>
for &FileWriteAtResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileWriteAtResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut FileWriteAtResponse)
.write_unaligned((self as *const FileWriteAtResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<FileWriteAtResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileWriteAtResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileWriteAtResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { actual_count: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FilesystemInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FilesystemInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
96
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FilesystemInfo, D>
for &FilesystemInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FilesystemInfo>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut FilesystemInfo)
.write_unaligned((self as *const FilesystemInfo).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<u64, D>,
T3: fidl::encoding::Encode<u64, D>,
T4: fidl::encoding::Encode<u64, D>,
T5: fidl::encoding::Encode<u64, D>,
T6: fidl::encoding::Encode<u32, D>,
T7: fidl::encoding::Encode<u32, D>,
T8: fidl::encoding::Encode<u32, D>,
T9: fidl::encoding::Encode<u32, D>,
T10: fidl::encoding::Encode<fidl::encoding::Array<i8, 32>, D>,
> fidl::encoding::Encode<FilesystemInfo, D>
for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FilesystemInfo>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 32, depth)?;
self.5.encode(encoder, offset + 40, depth)?;
self.6.encode(encoder, offset + 48, depth)?;
self.7.encode(encoder, offset + 52, depth)?;
self.8.encode(encoder, offset + 56, depth)?;
self.9.encode(encoder, offset + 60, depth)?;
self.10.encode(encoder, offset + 64, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FilesystemInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
total_bytes: fidl::new_empty!(u64, D),
used_bytes: fidl::new_empty!(u64, D),
total_nodes: fidl::new_empty!(u64, D),
used_nodes: fidl::new_empty!(u64, D),
free_shared_pool_bytes: fidl::new_empty!(u64, D),
fs_id: fidl::new_empty!(u64, D),
block_size: fidl::new_empty!(u32, D),
max_filename_size: fidl::new_empty!(u32, D),
fs_type: fidl::new_empty!(u32, D),
padding: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::Array<i8, 32>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 96);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LinkableLinkIntoRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LinkableLinkIntoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
LinkableLinkIntoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LinkableLinkIntoRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
fidl::encoding::Encode::<
LinkableLinkIntoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.dst_parent_token,
),
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.dst,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LinkableLinkIntoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LinkableLinkIntoRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LinkableLinkIntoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
dst_parent_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
dst: fidl::new_empty!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dst_parent_token, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dst,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeAttributes {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeAttributes {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeAttributes, D>
for &NodeAttributes
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeAttributes>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut NodeAttributes)
.write_unaligned((self as *const NodeAttributes).read());
let padding_ptr = buf_ptr.offset(0) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<u64, D>,
T3: fidl::encoding::Encode<u64, D>,
T4: fidl::encoding::Encode<u64, D>,
T5: fidl::encoding::Encode<u64, D>,
T6: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<NodeAttributes, D> for (T0, T1, T2, T3, T4, T5, T6)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeAttributes>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 32, depth)?;
self.5.encode(encoder, offset + 40, depth)?;
self.6.encode(encoder, offset + 48, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributes {
#[inline(always)]
fn new_empty() -> Self {
Self {
mode: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u64, D),
content_size: fidl::new_empty!(u64, D),
storage_size: fidl::new_empty!(u64, D),
link_count: fidl::new_empty!(u64, D),
creation_time: fidl::new_empty!(u64, D),
modification_time: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeAttributes2 {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeAttributes2 {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeAttributes2, D>
for &NodeAttributes2
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeAttributes2>(offset);
fidl::encoding::Encode::<NodeAttributes2, D>::encode(
(
<MutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow(
&self.mutable_attributes,
),
<ImmutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow(
&self.immutable_attributes,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<MutableNodeAttributes, D>,
T1: fidl::encoding::Encode<ImmutableNodeAttributes, D>,
> fidl::encoding::Encode<NodeAttributes2, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeAttributes2>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeAttributes2 {
#[inline(always)]
fn new_empty() -> Self {
Self {
mutable_attributes: fidl::new_empty!(MutableNodeAttributes, D),
immutable_attributes: fidl::new_empty!(ImmutableNodeAttributes, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
MutableNodeAttributes,
D,
&mut self.mutable_attributes,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
ImmutableNodeAttributes,
D,
&mut self.immutable_attributes,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for NodeCloneRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeCloneRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<NodeCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut NodeCloneRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeCloneRequest>(offset);
fidl::encoding::Encode::<NodeCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<NodeCloneRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeCloneRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for NodeCloneRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
flags: fidl::new_empty!(OpenFlags, fidl::encoding::DefaultFuchsiaResourceDialect),
object: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.flags,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.object,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeGetAttrResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeGetAttrResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeGetAttrResponse, D>
for &NodeGetAttrResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeGetAttrResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut NodeGetAttrResponse)
.write_unaligned((self as *const NodeGetAttrResponse).read());
let padding_ptr = buf_ptr.offset(0) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
let padding_ptr = buf_ptr.offset(8) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i32, D>,
T1: fidl::encoding::Encode<NodeAttributes, D>,
> fidl::encoding::Encode<NodeGetAttrResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeGetAttrResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeGetAttrResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { s: fidl::new_empty!(i32, D), attributes: fidl::new_empty!(NodeAttributes, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { buf_ptr.offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 64);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeGetAttributesRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeGetAttributesRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<NodeGetAttributesRequest, D> for &NodeGetAttributesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeGetAttributesRequest>(offset);
fidl::encoding::Encode::<NodeGetAttributesRequest, D>::encode(
(<NodeAttributesQuery as fidl::encoding::ValueTypeMarker>::borrow(&self.query),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<NodeAttributesQuery, D>,
> fidl::encoding::Encode<NodeGetAttributesRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeGetAttributesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for NodeGetAttributesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { query: fidl::new_empty!(NodeAttributesQuery, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(NodeAttributesQuery, D, &mut self.query, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeGetExtendedAttributeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeGetExtendedAttributeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<NodeGetExtendedAttributeRequest, D>
for &NodeGetExtendedAttributeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeGetExtendedAttributeRequest>(offset);
fidl::encoding::Encode::<NodeGetExtendedAttributeRequest, D>::encode(
(<fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 255>, D>,
> fidl::encoding::Encode<NodeGetExtendedAttributeRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeGetExtendedAttributeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for NodeGetExtendedAttributeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 255>, D, &mut self.name, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeGetFlagsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeGetFlagsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeGetFlagsResponse, D>
for &NodeGetFlagsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeGetFlagsResponse>(offset);
fidl::encoding::Encode::<NodeGetFlagsResponse, D>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
<OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i32, D>,
T1: fidl::encoding::Encode<OpenFlags, D>,
> fidl::encoding::Encode<NodeGetFlagsResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeGetFlagsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeGetFlagsResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { s: fidl::new_empty!(i32, D), flags: fidl::new_empty!(OpenFlags, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(i32, D, &mut self.s, decoder, offset + 0, _depth)?;
fidl::decode!(OpenFlags, D, &mut self.flags, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for NodeListExtendedAttributesRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeListExtendedAttributesRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
NodeListExtendedAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut NodeListExtendedAttributesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
fidl::encoding::Encode::<
NodeListExtendedAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
NodeListExtendedAttributesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeListExtendedAttributesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for NodeListExtendedAttributesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<ExtendedAttributeIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for NodeOnOpenRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeOnOpenRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut NodeOnOpenRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
fidl::encoding::Encode::<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
<fidl::encoding::OptionalUnion<NodeInfoDeprecated> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<NodeOnOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeOnOpenRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for NodeOnOpenRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
s: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
info: fidl::new_empty!(
fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
i32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.s,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::OptionalUnion<NodeInfoDeprecated>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.info,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeQueryFilesystemResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeQueryFilesystemResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<NodeQueryFilesystemResponse, D> for &NodeQueryFilesystemResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeQueryFilesystemResponse>(offset);
fidl::encoding::Encode::<NodeQueryFilesystemResponse, D>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.s),
<fidl::encoding::Boxed<FilesystemInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i32, D>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<FilesystemInfo>, D>,
> fidl::encoding::Encode<NodeQueryFilesystemResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeQueryFilesystemResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for NodeQueryFilesystemResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
s: fidl::new_empty!(i32, D),
info: fidl::new_empty!(fidl::encoding::Boxed<FilesystemInfo>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(i32, D, &mut self.s, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<FilesystemInfo>,
D,
&mut self.info,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeRemoveExtendedAttributeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeRemoveExtendedAttributeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<NodeRemoveExtendedAttributeRequest, D>
for &NodeRemoveExtendedAttributeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeRemoveExtendedAttributeRequest>(offset);
fidl::encoding::Encode::<NodeRemoveExtendedAttributeRequest, D>::encode(
(<fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 255>, D>,
> fidl::encoding::Encode<NodeRemoveExtendedAttributeRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeRemoveExtendedAttributeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for NodeRemoveExtendedAttributeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 255>, D, &mut self.name, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeSetAttrRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeSetAttrRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeSetAttrRequest, D>
for &NodeSetAttrRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetAttrRequest>(offset);
fidl::encoding::Encode::<NodeSetAttrRequest, D>::encode(
(
<NodeAttributeFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
<NodeAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<NodeAttributeFlags, D>,
T1: fidl::encoding::Encode<NodeAttributes, D>,
> fidl::encoding::Encode<NodeSetAttrRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetAttrRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeSetAttrRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
flags: fidl::new_empty!(NodeAttributeFlags, D),
attributes: fidl::new_empty!(NodeAttributes, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(NodeAttributeFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
fidl::decode!(NodeAttributes, D, &mut self.attributes, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeSetAttrResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeSetAttrResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeSetAttrResponse, D>
for &NodeSetAttrResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetAttrResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut NodeSetAttrResponse)
.write_unaligned((self as *const NodeSetAttrResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<NodeSetAttrResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetAttrResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeSetAttrResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { s: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for NodeSetExtendedAttributeRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeSetExtendedAttributeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl
fidl::encoding::Encode<
NodeSetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut NodeSetExtendedAttributeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
fidl::encoding::Encode::<
NodeSetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<ExtendedAttributeValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.value,
),
<SetExtendedAttributeMode as fidl::encoding::ValueTypeMarker>::borrow(
&self.mode,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Vector<u8, 255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
ExtendedAttributeValue,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
SetExtendedAttributeMode,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
NodeSetExtendedAttributeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetExtendedAttributeRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for NodeSetExtendedAttributeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect),
value: fidl::new_empty!(
ExtendedAttributeValue,
fidl::encoding::DefaultFuchsiaResourceDialect
),
mode: fidl::new_empty!(
SetExtendedAttributeMode,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(fidl::encoding::Vector<u8, 255>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.name, decoder, offset + 0, _depth)?;
fidl::decode!(
ExtendedAttributeValue,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.value,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
SetExtendedAttributeMode,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.mode,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeSetFlagsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeSetFlagsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeSetFlagsRequest, D>
for &NodeSetFlagsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetFlagsRequest>(offset);
fidl::encoding::Encode::<NodeSetFlagsRequest, D>::encode(
(<OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OpenFlags, D>>
fidl::encoding::Encode<NodeSetFlagsRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetFlagsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeSetFlagsRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { flags: fidl::new_empty!(OpenFlags, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(OpenFlags, D, &mut self.flags, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeSetFlagsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeSetFlagsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeSetFlagsResponse, D>
for &NodeSetFlagsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetFlagsResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut NodeSetFlagsResponse)
.write_unaligned((self as *const NodeSetFlagsResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
fidl::encoding::Encode<NodeSetFlagsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeSetFlagsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeSetFlagsResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { s: fidl::new_empty!(i32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ReadableReadRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ReadableReadRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadableReadRequest, D>
for &ReadableReadRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReadableReadRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ReadableReadRequest)
.write_unaligned((self as *const ReadableReadRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<ReadableReadRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReadableReadRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadableReadRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { count: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ReadableReadResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ReadableReadResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ReadableReadResponse, D>
for &ReadableReadResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReadableReadResponse>(offset);
fidl::encoding::Encode::<ReadableReadResponse, D>::encode(
(<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.data,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
> fidl::encoding::Encode<ReadableReadResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ReadableReadResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ReadableReadResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Service {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Service {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Service, D> for &Service {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Service>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Service {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ValueTypeMarker for SymlinkObject {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SymlinkObject {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SymlinkObject, D>
for &SymlinkObject
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SymlinkObject>(offset);
fidl::encoding::Encode::<SymlinkObject, D>::encode(
(<fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow(
&self.target,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 4095>, D>,
> fidl::encoding::Encode<SymlinkObject, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SymlinkObject>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SymlinkObject {
#[inline(always)]
fn new_empty() -> Self {
Self { target: fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 4095>, D, &mut self.target, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WritableWriteRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WritableWriteRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WritableWriteRequest, D>
for &WritableWriteRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WritableWriteRequest>(offset);
fidl::encoding::Encode::<WritableWriteRequest, D>::encode(
(<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.data,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
> fidl::encoding::Encode<WritableWriteRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WritableWriteRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WritableWriteRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for WritableWriteResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WritableWriteResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WritableWriteResponse, D>
for &WritableWriteResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WritableWriteResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut WritableWriteResponse)
.write_unaligned((self as *const WritableWriteResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<WritableWriteResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WritableWriteResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WritableWriteResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { actual_count: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl AdvisoryLockRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.wait {
return 3;
}
if let Some(_) = self.range {
return 2;
}
if let Some(_) = self.type_ {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for AdvisoryLockRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AdvisoryLockRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AdvisoryLockRequest, D>
for &AdvisoryLockRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AdvisoryLockRequest>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<AdvisoryLockType, D>(
self.type_
.as_ref()
.map(<AdvisoryLockType as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<AdvisoryLockRange, D>(
self.range
.as_ref()
.map(<AdvisoryLockRange as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.wait.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AdvisoryLockRequest {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<AdvisoryLockType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.type_.get_or_insert_with(|| fidl::new_empty!(AdvisoryLockType, D));
fidl::decode!(AdvisoryLockType, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<AdvisoryLockRange as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.range.get_or_insert_with(|| fidl::new_empty!(AdvisoryLockRange, D));
fidl::decode!(AdvisoryLockRange, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.wait.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ConnectionInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.rights {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for ConnectionInfo {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ConnectionInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<ConnectionInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ConnectionInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ConnectionInfo>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
Operations,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ConnectionInfo
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.rights.get_or_insert_with(|| {
fidl::new_empty!(Operations, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
Operations,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ConnectorInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.attributes {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ConnectorInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ConnectorInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConnectorInfo, D>
for &ConnectorInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ConnectorInfo>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<NodeAttributes2, D>(
self.attributes
.as_ref()
.map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConnectorInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributes2, D));
fidl::decode!(NodeAttributes2, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl DirectoryInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.attributes {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for DirectoryInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DirectoryInfo, D>
for &DirectoryInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryInfo>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<NodeAttributes2, D>(
self.attributes
.as_ref()
.map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DirectoryInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributes2, D));
fidl::decode!(NodeAttributes2, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl DirectoryProtocolOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.optional_rights {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for DirectoryProtocolOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DirectoryProtocolOptions {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<DirectoryProtocolOptions, D> for &DirectoryProtocolOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DirectoryProtocolOptions>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<Operations, D>(
self.optional_rights
.as_ref()
.map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DirectoryProtocolOptions
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.optional_rights.get_or_insert_with(|| fidl::new_empty!(Operations, D));
fidl::decode!(Operations, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl FileInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.attributes {
return 4;
}
if let Some(_) = self.stream {
return 3;
}
if let Some(_) = self.observer {
return 2;
}
if let Some(_) = self.is_append {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for FileInfo {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl fidl::encoding::Encode<FileInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut FileInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileInfo>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
bool,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.is_append.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.observer.as_mut().map(
<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
fidl::encoding::HandleType<
fidl::Stream,
{ fidl::ObjectType::STREAM.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.stream.as_mut().map(
<fidl::encoding::HandleType<
fidl::Stream,
{ fidl::ObjectType::STREAM.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
NodeAttributes2,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.attributes
.as_ref()
.map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for FileInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.is_append.get_or_insert_with(|| {
fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
bool,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
> as fidl::encoding::TypeMarker>::inline_size(
decoder.context
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.observer.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::HandleType<
fidl::Stream,
{ fidl::ObjectType::STREAM.into_raw() },
2147483648,
> as fidl::encoding::TypeMarker>::inline_size(
decoder.context
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.stream.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
fidl::decode!(fidl::encoding::HandleType<fidl::Stream, { fidl::ObjectType::STREAM.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.attributes.get_or_insert_with(|| {
fidl::new_empty!(NodeAttributes2, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
NodeAttributes2,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ImmutableNodeAttributes {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.verity_enabled {
return 10;
}
if let Some(_) = self.root_hash {
return 9;
}
if let Some(_) = self.options {
return 8;
}
if let Some(_) = self.change_time {
return 7;
}
if let Some(_) = self.id {
return 6;
}
if let Some(_) = self.link_count {
return 5;
}
if let Some(_) = self.storage_size {
return 4;
}
if let Some(_) = self.content_size {
return 3;
}
if let Some(_) = self.abilities {
return 2;
}
if let Some(_) = self.protocols {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ImmutableNodeAttributes {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ImmutableNodeAttributes {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ImmutableNodeAttributes, D> for &ImmutableNodeAttributes
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ImmutableNodeAttributes>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<NodeProtocolKinds, D>(
self.protocols
.as_ref()
.map(<NodeProtocolKinds as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<Operations, D>(
self.abilities
.as_ref()
.map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.content_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.storage_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.link_count.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.change_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<VerificationOptions, D>(
self.options
.as_ref()
.map(<VerificationOptions as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 9 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (9 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 64>, D>(
self.root_hash.as_ref().map(
<fidl::encoding::Vector<u8, 64> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 10 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (10 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.verity_enabled.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ImmutableNodeAttributes
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeProtocolKinds as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.protocols.get_or_insert_with(|| fidl::new_empty!(NodeProtocolKinds, D));
fidl::decode!(NodeProtocolKinds, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.abilities.get_or_insert_with(|| fidl::new_empty!(Operations, D));
fidl::decode!(Operations, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.content_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.storage_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.link_count.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.change_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 8 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<VerificationOptions as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.options.get_or_insert_with(|| fidl::new_empty!(VerificationOptions, D));
fidl::decode!(VerificationOptions, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 9 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 64> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.root_hash
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 64>, D));
fidl::decode!(fidl::encoding::Vector<u8, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 10 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.verity_enabled.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl MutableNodeAttributes {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.wrapping_key_id {
return 10;
}
if let Some(_) = self.selinux_context {
return 9;
}
if let Some(_) = self.casefold {
return 8;
}
if let Some(_) = self.access_time {
return 7;
}
if let Some(_) = self.rdev {
return 6;
}
if let Some(_) = self.gid {
return 5;
}
if let Some(_) = self.uid {
return 4;
}
if let Some(_) = self.mode {
return 3;
}
if let Some(_) = self.modification_time {
return 2;
}
if let Some(_) = self.creation_time {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for MutableNodeAttributes {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MutableNodeAttributes {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MutableNodeAttributes, D>
for &MutableNodeAttributes
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MutableNodeAttributes>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.creation_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.modification_time
.as_ref()
.map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32, D>(
self.mode.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32, D>(
self.uid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32, D>(
self.gid.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.rdev.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.access_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.casefold.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 9 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (9 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<SelinuxContext, D>(
self.selinux_context
.as_ref()
.map(<SelinuxContext as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 10 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (10 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 16>, D>(
self.wrapping_key_id.as_ref().map(
<fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MutableNodeAttributes {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.creation_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.modification_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.mode.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.uid.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.gid.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.rdev.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.access_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 8 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.casefold.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 9 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<SelinuxContext as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.selinux_context.get_or_insert_with(|| fidl::new_empty!(SelinuxContext, D));
fidl::decode!(SelinuxContext, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 10 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.wrapping_key_id
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
fidl::decode!(fidl::encoding::Array<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl NodeOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.create_attributes {
return 6;
}
if let Some(_) = self.attributes {
return 5;
}
if let Some(_) = self.rights {
return 4;
}
if let Some(_) = self.mode {
return 3;
}
if let Some(_) = self.protocols {
return 2;
}
if let Some(_) = self.flags {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for NodeOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeOptions {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeOptions, D>
for &NodeOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeOptions>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<NodeFlags, D>(
self.flags.as_ref().map(<NodeFlags as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<NodeProtocols, D>(
self.protocols
.as_ref()
.map(<NodeProtocols as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<CreationMode, D>(
self.mode.as_ref().map(<CreationMode as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<Operations, D>(
self.rights.as_ref().map(<Operations as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<NodeAttributesQuery, D>(
self.attributes
.as_ref()
.map(<NodeAttributesQuery as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<MutableNodeAttributes, D>(
self.create_attributes
.as_ref()
.map(<MutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeOptions {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.flags.get_or_insert_with(|| fidl::new_empty!(NodeFlags, D));
fidl::decode!(NodeFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeProtocols as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.protocols.get_or_insert_with(|| fidl::new_empty!(NodeProtocols, D));
fidl::decode!(NodeProtocols, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<CreationMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.mode.get_or_insert_with(|| fidl::new_empty!(CreationMode, D));
fidl::decode!(CreationMode, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Operations as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.rights.get_or_insert_with(|| fidl::new_empty!(Operations, D));
fidl::decode!(Operations, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeAttributesQuery as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributesQuery, D));
fidl::decode!(NodeAttributesQuery, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<MutableNodeAttributes as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.create_attributes
.get_or_insert_with(|| fidl::new_empty!(MutableNodeAttributes, D));
fidl::decode!(
MutableNodeAttributes,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl NodeProtocols {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.node {
return 4;
}
if let Some(_) = self.symlink {
return 3;
}
if let Some(_) = self.file {
return 2;
}
if let Some(_) = self.directory {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for NodeProtocols {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeProtocols {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NodeProtocols, D>
for &NodeProtocols
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeProtocols>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<DirectoryProtocolOptions, D>(
self.directory
.as_ref()
.map(<DirectoryProtocolOptions as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<FileProtocolFlags, D>(
self.file
.as_ref()
.map(<FileProtocolFlags as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<SymlinkProtocolFlags, D>(
self.symlink
.as_ref()
.map(<SymlinkProtocolFlags as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<NodeProtocolFlags, D>(
self.node
.as_ref()
.map(<NodeProtocolFlags as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeProtocols {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<DirectoryProtocolOptions as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.directory
.get_or_insert_with(|| fidl::new_empty!(DirectoryProtocolOptions, D));
fidl::decode!(
DirectoryProtocolOptions,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<FileProtocolFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.file.get_or_insert_with(|| fidl::new_empty!(FileProtocolFlags, D));
fidl::decode!(FileProtocolFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<SymlinkProtocolFlags as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.symlink.get_or_insert_with(|| fidl::new_empty!(SymlinkProtocolFlags, D));
fidl::decode!(
SymlinkProtocolFlags,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeProtocolFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.node.get_or_insert_with(|| fidl::new_empty!(NodeProtocolFlags, D));
fidl::decode!(NodeProtocolFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl Options {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.create_attributes {
return 2;
}
if let Some(_) = self.attributes {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Options {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Options {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Options, D> for &Options {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Options>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<NodeAttributesQuery, D>(
self.attributes
.as_ref()
.map(<NodeAttributesQuery as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<MutableNodeAttributes, D>(
self.create_attributes
.as_ref()
.map(<MutableNodeAttributes as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Options {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeAttributesQuery as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributesQuery, D));
fidl::decode!(NodeAttributesQuery, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<MutableNodeAttributes as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.create_attributes
.get_or_insert_with(|| fidl::new_empty!(MutableNodeAttributes, D));
fidl::decode!(
MutableNodeAttributes,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl SymlinkInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.attributes {
return 2;
}
if let Some(_) = self.target {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for SymlinkInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SymlinkInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SymlinkInfo, D>
for &SymlinkInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SymlinkInfo>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 4095>, D>(
self.target.as_ref().map(
<fidl::encoding::Vector<u8, 4095> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<NodeAttributes2, D>(
self.attributes
.as_ref()
.map(<NodeAttributes2 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SymlinkInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 4095> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.target
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 4095>, D));
fidl::decode!(fidl::encoding::Vector<u8, 4095>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NodeAttributes2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.attributes.get_or_insert_with(|| fidl::new_empty!(NodeAttributes2, D));
fidl::decode!(NodeAttributes2, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl UnlinkOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.flags {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for UnlinkOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UnlinkOptions {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UnlinkOptions, D>
for &UnlinkOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UnlinkOptions>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<UnlinkFlags, D>(
self.flags.as_ref().map(<UnlinkFlags as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnlinkOptions {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<UnlinkFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.flags.get_or_insert_with(|| fidl::new_empty!(UnlinkFlags, D));
fidl::decode!(UnlinkFlags, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl VerificationOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.salt {
return 2;
}
if let Some(_) = self.hash_algorithm {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for VerificationOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VerificationOptions {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VerificationOptions, D>
for &VerificationOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VerificationOptions>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<HashAlgorithm, D>(
self.hash_algorithm
.as_ref()
.map(<HashAlgorithm as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
self.salt.as_ref().map(
<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VerificationOptions {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<HashAlgorithm as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.hash_algorithm.get_or_insert_with(|| fidl::new_empty!(HashAlgorithm, D));
fidl::decode!(HashAlgorithm, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.salt
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ConnectionProtocols {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ConnectionProtocols {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConnectionProtocols, D>
for &ConnectionProtocols
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ConnectionProtocols>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ConnectionProtocols::Connector(ref val) => {
fidl::encoding::encode_in_envelope::<ConnectorFlags, D>(
<ConnectorFlags as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ConnectionProtocols::Node(ref val) => {
fidl::encoding::encode_in_envelope::<NodeOptions, D>(
<NodeOptions as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ConnectionProtocols::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConnectionProtocols {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <ConnectorFlags as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <NodeOptions as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ConnectionProtocols::Connector(_) = self {
} else {
*self = ConnectionProtocols::Connector(fidl::new_empty!(ConnectorFlags, D));
}
#[allow(irrefutable_let_patterns)]
if let ConnectionProtocols::Connector(ref mut val) = self {
fidl::decode!(ConnectorFlags, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let ConnectionProtocols::Node(_) = self {
} else {
*self = ConnectionProtocols::Node(fidl::new_empty!(NodeOptions, D));
}
#[allow(irrefutable_let_patterns)]
if let ConnectionProtocols::Node(ref mut val) = self {
fidl::decode!(NodeOptions, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = ConnectionProtocols::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ExtendedAttributeValue {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ExtendedAttributeValue {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
ExtendedAttributeValue,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ExtendedAttributeValue
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExtendedAttributeValue>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ExtendedAttributeValue::Bytes(ref val) => fidl::encoding::encode_in_envelope::<
fidl::encoding::Vector<u8, 32768>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<fidl::encoding::Vector<u8, 32768> as fidl::encoding::ValueTypeMarker>::borrow(
val,
),
encoder,
offset + 8,
_depth,
),
ExtendedAttributeValue::Buffer(ref mut val) => {
fidl::encoding::encode_in_envelope::<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
val
),
encoder,
offset + 8,
_depth,
)
}
ExtendedAttributeValue::__SourceBreaking { .. } => {
Err(fidl::Error::UnknownUnionTag)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ExtendedAttributeValue
{
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => {
<fidl::encoding::Vector<u8, 32768> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
)
}
2 => <fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ExtendedAttributeValue::Bytes(_) = self {
} else {
*self = ExtendedAttributeValue::Bytes(
fidl::new_empty!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect),
);
}
#[allow(irrefutable_let_patterns)]
if let ExtendedAttributeValue::Bytes(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<u8, 32768>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let ExtendedAttributeValue::Buffer(_) = self {
} else {
*self = ExtendedAttributeValue::Buffer(
fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
);
}
#[allow(irrefutable_let_patterns)]
if let ExtendedAttributeValue::Buffer(ref mut val) = self {
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = ExtendedAttributeValue::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for NodeInfoDeprecated {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeInfoDeprecated {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<NodeInfoDeprecated, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut NodeInfoDeprecated
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeInfoDeprecated>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
NodeInfoDeprecated::Service(ref val) => fidl::encoding::encode_in_envelope::<
Service,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Service as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
NodeInfoDeprecated::File(ref mut val) => fidl::encoding::encode_in_envelope::<
FileObject,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<FileObject as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
),
NodeInfoDeprecated::Directory(ref val) => fidl::encoding::encode_in_envelope::<
DirectoryObject,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<DirectoryObject as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
NodeInfoDeprecated::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
SymlinkObject,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<SymlinkObject as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for NodeInfoDeprecated
{
#[inline(always)]
fn new_empty() -> Self {
Self::Service(fidl::new_empty!(Service, fidl::encoding::DefaultFuchsiaResourceDialect))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Service as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <FileObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <DirectoryObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <SymlinkObject as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let NodeInfoDeprecated::Service(_) = self {
} else {
*self = NodeInfoDeprecated::Service(fidl::new_empty!(
Service,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let NodeInfoDeprecated::Service(ref mut val) = self {
fidl::decode!(
Service,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let NodeInfoDeprecated::File(_) = self {
} else {
*self = NodeInfoDeprecated::File(fidl::new_empty!(
FileObject,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let NodeInfoDeprecated::File(ref mut val) = self {
fidl::decode!(
FileObject,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let NodeInfoDeprecated::Directory(_) = self {
} else {
*self = NodeInfoDeprecated::Directory(fidl::new_empty!(
DirectoryObject,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let NodeInfoDeprecated::Directory(ref mut val) = self {
fidl::decode!(
DirectoryObject,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let NodeInfoDeprecated::Symlink(_) = self {
} else {
*self = NodeInfoDeprecated::Symlink(fidl::new_empty!(
SymlinkObject,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let NodeInfoDeprecated::Symlink(ref mut val) = self {
fidl::decode!(
SymlinkObject,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for Representation {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Representation {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<Representation, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Representation
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Representation>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Representation::Connector(ref val) => fidl::encoding::encode_in_envelope::<
ConnectorInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<ConnectorInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Representation::Directory(ref val) => fidl::encoding::encode_in_envelope::<
DirectoryInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<DirectoryInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Representation::File(ref mut val) => fidl::encoding::encode_in_envelope::<
FileInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<FileInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
),
Representation::Symlink(ref val) => fidl::encoding::encode_in_envelope::<
SymlinkInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<SymlinkInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Representation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for Representation
{
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <ConnectorInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <DirectoryInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <FileInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <SymlinkInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let Representation::Connector(_) = self {
} else {
*self = Representation::Connector(fidl::new_empty!(
ConnectorInfo,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Representation::Connector(ref mut val) = self {
fidl::decode!(
ConnectorInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Representation::Directory(_) = self {
} else {
*self = Representation::Directory(fidl::new_empty!(
DirectoryInfo,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Representation::Directory(ref mut val) = self {
fidl::decode!(
DirectoryInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Representation::File(_) = self {
} else {
*self = Representation::File(fidl::new_empty!(
FileInfo,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Representation::File(ref mut val) = self {
fidl::decode!(
FileInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Representation::Symlink(_) = self {
} else {
*self = Representation::Symlink(fidl::new_empty!(
SymlinkInfo,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Representation::Symlink(ref mut val) = self {
fidl::decode!(
SymlinkInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Representation::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SelinuxContext {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SelinuxContext {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SelinuxContext, D>
for &SelinuxContext
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SelinuxContext>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
SelinuxContext::Data(ref val) => fidl::encoding::encode_in_envelope::<
fidl::encoding::Vector<u8, 256>,
D,
>(
<fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow(
val,
),
encoder,
offset + 8,
_depth,
),
SelinuxContext::UseExtendedAttributes(ref val) => {
fidl::encoding::encode_in_envelope::<EmptyStruct, D>(
<EmptyStruct as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
SelinuxContext::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SelinuxContext {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
2 => <EmptyStruct as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let SelinuxContext::Data(_) = self {
} else {
*self = SelinuxContext::Data(
fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let SelinuxContext::Data(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let SelinuxContext::UseExtendedAttributes(_) = self {
} else {
*self =
SelinuxContext::UseExtendedAttributes(fidl::new_empty!(EmptyStruct, D));
}
#[allow(irrefutable_let_patterns)]
if let SelinuxContext::UseExtendedAttributes(ref mut val) = self {
fidl::decode!(EmptyStruct, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = SelinuxContext::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
}