#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use {
bitflags::bitflags,
fidl::{
client::QueryResponseFut,
endpoints::{ControlHandle as _, Responder as _},
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
pub const MAX_INSTANCE_ID_LENGTH: u32 = 64;
pub const MAX_START_REASON: u32 = 5000;
pub const MAX_STORAGE_ID_LENGTH: u32 = 64;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum ConnectToStorageAdminError {
InstanceNotFound,
BadMoniker,
StorageNotFound,
InstanceNotResolved,
BadCapability,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ConnectToStorageAdminErrorUnknown {
() => {
_
};
}
impl ConnectToStorageAdminError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InstanceNotFound),
2 => Some(Self::BadMoniker),
3 => Some(Self::StorageNotFound),
4 => Some(Self::InstanceNotResolved),
5 => Some(Self::BadCapability),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InstanceNotFound,
2 => Self::BadMoniker,
3 => Self::StorageNotFound,
4 => Self::InstanceNotResolved,
5 => Self::BadCapability,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InstanceNotFound => 1,
Self::BadMoniker => 2,
Self::StorageNotFound => 3,
Self::InstanceNotResolved => 4,
Self::BadCapability => 5,
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 ConstructNamespaceError {
InstanceNotFound,
BadMoniker,
InstanceNotResolved,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ConstructNamespaceErrorUnknown {
() => {
_
};
}
impl ConstructNamespaceError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InstanceNotFound),
2 => Some(Self::BadMoniker),
3 => Some(Self::InstanceNotResolved),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InstanceNotFound,
2 => Self::BadMoniker,
3 => Self::InstanceNotResolved,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InstanceNotFound => 1,
Self::BadMoniker => 2,
Self::InstanceNotResolved => 3,
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 CreateError {
Internal,
InstanceNotFound,
InstanceAlreadyExists,
BadMoniker,
BadChildDecl,
CollectionNotFound,
BadDynamicOffer,
DynamicOffersForbidden,
NumberedHandlesForbidden,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! CreateErrorUnknown {
() => {
_
};
}
impl CreateError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::InstanceNotFound),
3 => Some(Self::InstanceAlreadyExists),
4 => Some(Self::BadMoniker),
5 => Some(Self::BadChildDecl),
6 => Some(Self::CollectionNotFound),
7 => Some(Self::BadDynamicOffer),
8 => Some(Self::DynamicOffersForbidden),
10 => Some(Self::NumberedHandlesForbidden),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Internal,
2 => Self::InstanceNotFound,
3 => Self::InstanceAlreadyExists,
4 => Self::BadMoniker,
5 => Self::BadChildDecl,
6 => Self::CollectionNotFound,
7 => Self::BadDynamicOffer,
8 => Self::DynamicOffersForbidden,
10 => Self::NumberedHandlesForbidden,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Internal => 1,
Self::InstanceNotFound => 2,
Self::InstanceAlreadyExists => 3,
Self::BadMoniker => 4,
Self::BadChildDecl => 5,
Self::CollectionNotFound => 6,
Self::BadDynamicOffer => 7,
Self::DynamicOffersForbidden => 8,
Self::NumberedHandlesForbidden => 10,
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 DeclType {
Use,
Expose,
Any,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! DeclTypeUnknown {
() => {
_
};
}
impl DeclType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Use),
2 => Some(Self::Expose),
3 => Some(Self::Any),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Use,
2 => Self::Expose,
3 => Self::Any,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Use => 1,
Self::Expose => 2,
Self::Any => 3,
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 DeletionError {
Connection = 1,
Protocol = 2,
NoneAvailable = 3,
Unsupported = 4,
}
impl DeletionError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Connection),
2 => Some(Self::Protocol),
3 => Some(Self::NoneAvailable),
4 => Some(Self::Unsupported),
_ => 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 DestroyError {
Internal,
InstanceNotFound,
BadMoniker,
BadChildRef,
InstanceNotResolved,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! DestroyErrorUnknown {
() => {
_
};
}
impl DestroyError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::InstanceNotFound),
3 => Some(Self::BadMoniker),
4 => Some(Self::BadChildRef),
5 => Some(Self::InstanceNotResolved),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Internal,
2 => Self::InstanceNotFound,
3 => Self::BadMoniker,
4 => Self::BadChildRef,
5 => Self::InstanceNotResolved,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Internal => 1,
Self::InstanceNotFound => 2,
Self::BadMoniker => 3,
Self::BadChildRef => 4,
Self::InstanceNotResolved => 5,
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 GetAllInstancesError {
InstanceNotFound,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! GetAllInstancesErrorUnknown {
() => {
_
};
}
impl GetAllInstancesError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InstanceNotFound),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InstanceNotFound,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InstanceNotFound => 1,
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 GetDeclarationError {
InstanceNotFound,
BadMoniker,
InstanceNotResolved,
EncodeFailed,
BadChildLocation,
BadUrl,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! GetDeclarationErrorUnknown {
() => {
_
};
}
impl GetDeclarationError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InstanceNotFound),
2 => Some(Self::BadMoniker),
3 => Some(Self::InstanceNotResolved),
4 => Some(Self::EncodeFailed),
5 => Some(Self::BadChildLocation),
6 => Some(Self::BadUrl),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InstanceNotFound,
2 => Self::BadMoniker,
3 => Self::InstanceNotResolved,
4 => Self::EncodeFailed,
5 => Self::BadChildLocation,
6 => Self::BadUrl,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InstanceNotFound => 1,
Self::BadMoniker => 2,
Self::InstanceNotResolved => 3,
Self::EncodeFailed => 4,
Self::BadChildLocation => 5,
Self::BadUrl => 6,
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 GetInstanceError {
InstanceNotFound,
BadMoniker,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! GetInstanceErrorUnknown {
() => {
_
};
}
impl GetInstanceError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InstanceNotFound),
2 => Some(Self::BadMoniker),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InstanceNotFound,
2 => Self::BadMoniker,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InstanceNotFound => 1,
Self::BadMoniker => 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)]
pub enum GetStructuredConfigError {
InstanceNotFound,
BadMoniker,
InstanceNotResolved,
NoConfig,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! GetStructuredConfigErrorUnknown {
() => {
_
};
}
impl GetStructuredConfigError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InstanceNotFound),
2 => Some(Self::BadMoniker),
3 => Some(Self::InstanceNotResolved),
4 => Some(Self::NoConfig),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InstanceNotFound,
2 => Self::BadMoniker,
3 => Self::InstanceNotResolved,
4 => Self::NoConfig,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InstanceNotFound => 1,
Self::BadMoniker => 2,
Self::InstanceNotResolved => 3,
Self::NoConfig => 4,
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 OpenDirType {
OutgoingDir,
RuntimeDir,
PackageDir,
ExposedDir,
NamespaceDir,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! OpenDirTypeUnknown {
() => {
_
};
}
impl OpenDirType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::OutgoingDir),
2 => Some(Self::RuntimeDir),
3 => Some(Self::PackageDir),
4 => Some(Self::ExposedDir),
5 => Some(Self::NamespaceDir),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::OutgoingDir,
2 => Self::RuntimeDir,
3 => Self::PackageDir,
4 => Self::ExposedDir,
5 => Self::NamespaceDir,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::OutgoingDir => 1,
Self::RuntimeDir => 2,
Self::PackageDir => 3,
Self::ExposedDir => 4,
Self::NamespaceDir => 5,
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 OpenError {
InstanceNotFound,
BadMoniker,
InstanceNotResolved,
InstanceNotRunning,
FidlError,
NoSuchDir,
BadDirType,
BadPath,
InstanceFailedToStart,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! OpenErrorUnknown {
() => {
_
};
}
impl OpenError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InstanceNotFound),
2 => Some(Self::BadMoniker),
3 => Some(Self::InstanceNotResolved),
4 => Some(Self::InstanceNotRunning),
5 => Some(Self::FidlError),
6 => Some(Self::NoSuchDir),
7 => Some(Self::BadDirType),
8 => Some(Self::BadPath),
9 => Some(Self::InstanceFailedToStart),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InstanceNotFound,
2 => Self::BadMoniker,
3 => Self::InstanceNotResolved,
4 => Self::InstanceNotRunning,
5 => Self::FidlError,
6 => Self::NoSuchDir,
7 => Self::BadDirType,
8 => Self::BadPath,
9 => Self::InstanceFailedToStart,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InstanceNotFound => 1,
Self::BadMoniker => 2,
Self::InstanceNotResolved => 3,
Self::InstanceNotRunning => 4,
Self::FidlError => 5,
Self::NoSuchDir => 6,
Self::BadDirType => 7,
Self::BadPath => 8,
Self::InstanceFailedToStart => 9,
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 RealmQueryError {
InstanceNotFound,
BadMoniker,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! RealmQueryErrorUnknown {
() => {
_
};
}
impl RealmQueryError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InstanceNotFound),
2 => Some(Self::BadMoniker),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InstanceNotFound,
2 => Self::BadMoniker,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InstanceNotFound => 1,
Self::BadMoniker => 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)]
pub enum ResolveError {
Internal,
InstanceNotFound,
BadMoniker,
PackageNotFound,
ManifestNotFound,
PolicyError,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! ResolveErrorUnknown {
() => {
_
};
}
impl ResolveError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::InstanceNotFound),
3 => Some(Self::BadMoniker),
4 => Some(Self::PackageNotFound),
5 => Some(Self::ManifestNotFound),
6 => Some(Self::PolicyError),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Internal,
2 => Self::InstanceNotFound,
3 => Self::BadMoniker,
4 => Self::PackageNotFound,
5 => Self::ManifestNotFound,
6 => Self::PolicyError,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Internal => 1,
Self::InstanceNotFound => 2,
Self::BadMoniker => 3,
Self::PackageNotFound => 4,
Self::ManifestNotFound => 5,
Self::PolicyError => 6,
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 RouteValidatorError {
Internal,
InvalidArguments,
InstanceNotFound,
InstanceNotResolved,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! RouteValidatorErrorUnknown {
() => {
_
};
}
impl RouteValidatorError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::InvalidArguments),
3 => Some(Self::InstanceNotFound),
4 => Some(Self::InstanceNotResolved),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Internal,
2 => Self::InvalidArguments,
3 => Self::InstanceNotFound,
4 => Self::InstanceNotResolved,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Internal => 1,
Self::InvalidArguments => 2,
Self::InstanceNotFound => 3,
Self::InstanceNotResolved => 4,
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 StartError {
Internal,
InstanceNotFound,
BadMoniker,
PackageNotFound,
ManifestNotFound,
PolicyError,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! StartErrorUnknown {
() => {
_
};
}
impl StartError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::InstanceNotFound),
3 => Some(Self::BadMoniker),
4 => Some(Self::PackageNotFound),
5 => Some(Self::ManifestNotFound),
6 => Some(Self::PolicyError),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Internal,
2 => Self::InstanceNotFound,
3 => Self::BadMoniker,
4 => Self::PackageNotFound,
5 => Self::ManifestNotFound,
6 => Self::PolicyError,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Internal => 1,
Self::InstanceNotFound => 2,
Self::BadMoniker => 3,
Self::PackageNotFound => 4,
Self::ManifestNotFound => 5,
Self::PolicyError => 6,
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 StatusError {
Provider = 1,
ResponseInvalid = 2,
StatusUnknown = 3,
Unsupported = 4,
}
impl StatusError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Provider),
2 => Some(Self::ResponseInvalid),
3 => Some(Self::StatusUnknown),
4 => Some(Self::Unsupported),
_ => 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 StopError {
Internal,
InstanceNotFound,
BadMoniker,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! StopErrorUnknown {
() => {
_
};
}
impl StopError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::InstanceNotFound),
3 => Some(Self::BadMoniker),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Internal,
2 => Self::InstanceNotFound,
3 => Self::BadMoniker,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Internal => 1,
Self::InstanceNotFound => 2,
Self::BadMoniker => 3,
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 UnresolveError {
Internal,
InstanceNotFound,
BadMoniker,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u32,
},
}
#[macro_export]
macro_rules! UnresolveErrorUnknown {
() => {
_
};
}
impl UnresolveError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::InstanceNotFound),
3 => Some(Self::BadMoniker),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Internal,
2 => Self::InstanceNotFound,
3 => Self::BadMoniker,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Internal => 1,
Self::InstanceNotFound => 2,
Self::BadMoniker => 3,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CrashIntrospectFindComponentByThreadKoidRequest {
pub thread_koid: u64,
}
impl fidl::Standalone for CrashIntrospectFindComponentByThreadKoidRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CrashIntrospectFindComponentByThreadKoidResponse {
pub info: ComponentCrashInfo,
}
impl fidl::Persistable for CrashIntrospectFindComponentByThreadKoidResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct InstanceIteratorNextResponse {
pub infos: Vec<Instance>,
}
impl fidl::Persistable for InstanceIteratorNextResponse {}
#[derive(Debug, PartialEq)]
pub struct LifecycleControllerCreateInstanceRequest {
pub parent_moniker: String,
pub collection: fidl_fuchsia_component_decl::CollectionRef,
pub decl: fidl_fuchsia_component_decl::Child,
pub args: fidl_fuchsia_component::CreateChildArgs,
}
impl fidl::Standalone for LifecycleControllerCreateInstanceRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct LifecycleControllerDestroyInstanceRequest {
pub parent_moniker: String,
pub child: fidl_fuchsia_component_decl::ChildRef,
}
impl fidl::Persistable for LifecycleControllerDestroyInstanceRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LifecycleControllerResolveInstanceRequest {
pub moniker: String,
}
impl fidl::Persistable for LifecycleControllerResolveInstanceRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LifecycleControllerStartInstanceRequest {
pub moniker: String,
pub binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
}
impl fidl::Standalone for LifecycleControllerStartInstanceRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LifecycleControllerStopInstanceRequest {
pub moniker: String,
}
impl fidl::Persistable for LifecycleControllerStopInstanceRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LifecycleControllerUnresolveInstanceRequest {
pub moniker: String,
}
impl fidl::Persistable for LifecycleControllerUnresolveInstanceRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManifestBytesIteratorNextResponse {
pub infos: Vec<u8>,
}
impl fidl::Persistable for ManifestBytesIteratorNextResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryConnectToStorageAdminRequest {
pub moniker: String,
pub storage_name: String,
pub server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
}
impl fidl::Standalone for RealmQueryConnectToStorageAdminRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryConstructNamespaceRequest {
pub moniker: String,
}
impl fidl::Persistable for RealmQueryConstructNamespaceRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryGetInstanceRequest {
pub moniker: String,
}
impl fidl::Persistable for RealmQueryGetInstanceRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryGetManifestRequest {
pub moniker: String,
}
impl fidl::Persistable for RealmQueryGetManifestRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryGetResolvedDeclarationRequest {
pub moniker: String,
}
impl fidl::Persistable for RealmQueryGetResolvedDeclarationRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryGetStructuredConfigRequest {
pub moniker: String,
}
impl fidl::Persistable for RealmQueryGetStructuredConfigRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryOpenRequest {
pub moniker: String,
pub dir_type: OpenDirType,
pub flags: fidl_fuchsia_io::OpenFlags,
pub mode: fidl_fuchsia_io::ModeType,
pub path: String,
pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
}
impl fidl::Standalone for RealmQueryOpenRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct RealmQueryResolveDeclarationRequest {
pub parent: String,
pub child_location: ChildLocation,
pub url: String,
}
impl fidl::Persistable for RealmQueryResolveDeclarationRequest {}
#[derive(Debug, PartialEq)]
pub struct RealmQueryConstructNamespaceResponse {
pub namespace: Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>,
}
impl fidl::Standalone for RealmQueryConstructNamespaceResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryGetAllInstancesResponse {
pub iterator: fidl::endpoints::ClientEnd<InstanceIteratorMarker>,
}
impl fidl::Standalone for RealmQueryGetAllInstancesResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct RealmQueryGetInstanceResponse {
pub instance: Instance,
}
impl fidl::Persistable for RealmQueryGetInstanceResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryGetManifestResponse {
pub iterator: fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
}
impl fidl::Standalone for RealmQueryGetManifestResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryGetResolvedDeclarationResponse {
pub iterator: fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
}
impl fidl::Standalone for RealmQueryGetResolvedDeclarationResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct RealmQueryGetStructuredConfigResponse {
pub config: fidl_fuchsia_component_decl::ResolvedConfig,
}
impl fidl::Persistable for RealmQueryGetStructuredConfigResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryResolveDeclarationResponse {
pub iterator: fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
}
impl fidl::Standalone for RealmQueryResolveDeclarationResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RouteTarget {
pub name: String,
pub decl_type: DeclType,
}
impl fidl::Persistable for RouteTarget {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RouteValidatorRouteRequest {
pub moniker: String,
pub targets: Vec<RouteTarget>,
}
impl fidl::Persistable for RouteValidatorRouteRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RouteValidatorValidateRequest {
pub moniker: String,
}
impl fidl::Persistable for RouteValidatorValidateRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct RouteValidatorRouteResponse {
pub reports: Vec<RouteReport>,
}
impl fidl::Persistable for RouteValidatorRouteResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct RouteValidatorValidateResponse {
pub reports: Vec<RouteReport>,
}
impl fidl::Persistable for RouteValidatorValidateResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StorageAdminDeleteComponentStorageRequest {
pub relative_moniker: String,
}
impl fidl::Persistable for StorageAdminDeleteComponentStorageRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StorageAdminListStorageInRealmRequest {
pub relative_moniker: String,
pub iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
}
impl fidl::Standalone for StorageAdminListStorageInRealmRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StorageAdminOpenComponentStorageByIdRequest {
pub id: String,
pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
}
impl fidl::Standalone for StorageAdminOpenComponentStorageByIdRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StorageAdminOpenComponentStorageRequest {
pub relative_moniker: String,
pub flags: fidl_fuchsia_io::OpenFlags,
pub mode: fidl_fuchsia_io::ModeType,
pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
}
impl fidl::Standalone for StorageAdminOpenComponentStorageRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StorageIteratorNextResponse {
pub relative_monikers: Vec<String>,
}
impl fidl::Persistable for StorageIteratorNextResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ComponentCrashInfo {
pub url: Option<String>,
pub moniker: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ComponentCrashInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ExecutionInfo {
pub start_reason: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ExecutionInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Instance {
pub moniker: Option<String>,
pub url: Option<String>,
pub instance_id: Option<String>,
pub resolved_info: Option<ResolvedInfo>,
pub environment: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Instance {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ResolvedInfo {
pub resolved_url: Option<String>,
pub execution_info: Option<ExecutionInfo>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ResolvedInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct RouteError {
pub summary: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for RouteError {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct RouteReport {
pub capability: Option<String>,
pub decl_type: Option<DeclType>,
pub error: Option<RouteError>,
pub source_moniker: Option<String>,
pub service_instances: Option<Vec<ServiceInstance>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for RouteReport {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ServiceInstance {
pub instance_name: Option<String>,
pub child_name: Option<String>,
pub child_instance_name: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ServiceInstance {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StorageStatus {
pub total_size: Option<u64>,
pub used_size: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for StorageStatus {}
#[derive(Clone, Debug)]
pub enum ChildLocation {
Collection(String),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! ChildLocationUnknown {
() => {
_
};
}
impl PartialEq for ChildLocation {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Collection(x), Self::Collection(y)) => *x == *y,
_ => false,
}
}
}
impl ChildLocation {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Collection(_) => 1,
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 ChildLocation {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CrashIntrospectMarker;
impl fidl::endpoints::ProtocolMarker for CrashIntrospectMarker {
type Proxy = CrashIntrospectProxy;
type RequestStream = CrashIntrospectRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CrashIntrospectSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.sys2.CrashIntrospect";
}
impl fidl::endpoints::DiscoverableProtocolMarker for CrashIntrospectMarker {}
pub type CrashIntrospectFindComponentByThreadKoidResult =
Result<ComponentCrashInfo, fidl_fuchsia_component::Error>;
pub trait CrashIntrospectProxyInterface: Send + Sync {
type FindComponentByThreadKoidResponseFut: std::future::Future<
Output = Result<CrashIntrospectFindComponentByThreadKoidResult, fidl::Error>,
> + Send;
fn r#find_component_by_thread_koid(
&self,
thread_koid: u64,
) -> Self::FindComponentByThreadKoidResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CrashIntrospectSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CrashIntrospectSynchronousProxy {
type Proxy = CrashIntrospectProxy;
type Protocol = CrashIntrospectMarker;
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 CrashIntrospectSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <CrashIntrospectMarker 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::Time) -> Result<CrashIntrospectEvent, fidl::Error> {
CrashIntrospectEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#find_component_by_thread_koid(
&self,
mut thread_koid: u64,
___deadline: zx::Time,
) -> Result<CrashIntrospectFindComponentByThreadKoidResult, fidl::Error> {
let _response = self.client.send_query::<
CrashIntrospectFindComponentByThreadKoidRequest,
fidl::encoding::ResultType<CrashIntrospectFindComponentByThreadKoidResponse, fidl_fuchsia_component::Error>,
>(
(thread_koid,),
0x75d3ff081eca468d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.info))
}
}
#[derive(Debug, Clone)]
pub struct CrashIntrospectProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for CrashIntrospectProxy {
type Protocol = CrashIntrospectMarker;
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 CrashIntrospectProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <CrashIntrospectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CrashIntrospectEventStream {
CrashIntrospectEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#find_component_by_thread_koid(
&self,
mut thread_koid: u64,
) -> fidl::client::QueryResponseFut<CrashIntrospectFindComponentByThreadKoidResult> {
CrashIntrospectProxyInterface::r#find_component_by_thread_koid(self, thread_koid)
}
}
impl CrashIntrospectProxyInterface for CrashIntrospectProxy {
type FindComponentByThreadKoidResponseFut =
fidl::client::QueryResponseFut<CrashIntrospectFindComponentByThreadKoidResult>;
fn r#find_component_by_thread_koid(
&self,
mut thread_koid: u64,
) -> Self::FindComponentByThreadKoidResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<CrashIntrospectFindComponentByThreadKoidResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
CrashIntrospectFindComponentByThreadKoidResponse,
fidl_fuchsia_component::Error,
>,
0x75d3ff081eca468d,
>(_buf?)?;
Ok(_response.map(|x| x.info))
}
self.client.send_query_and_decode::<
CrashIntrospectFindComponentByThreadKoidRequest,
CrashIntrospectFindComponentByThreadKoidResult,
>(
(thread_koid,),
0x75d3ff081eca468d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct CrashIntrospectEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for CrashIntrospectEventStream {}
impl futures::stream::FusedStream for CrashIntrospectEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CrashIntrospectEventStream {
type Item = Result<CrashIntrospectEvent, 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(CrashIntrospectEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CrashIntrospectEvent {}
impl CrashIntrospectEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<CrashIntrospectEvent, 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:
<CrashIntrospectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CrashIntrospectRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for CrashIntrospectRequestStream {}
impl futures::stream::FusedStream for CrashIntrospectRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CrashIntrospectRequestStream {
type Protocol = CrashIntrospectMarker;
type ControlHandle = CrashIntrospectControlHandle;
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 {
CrashIntrospectControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for CrashIntrospectRequestStream {
type Item = Result<CrashIntrospectRequest, 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 CrashIntrospectRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x75d3ff081eca468d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(CrashIntrospectFindComponentByThreadKoidRequest);
fidl::encoding::Decoder::decode_into::<
CrashIntrospectFindComponentByThreadKoidRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CrashIntrospectControlHandle { inner: this.inner.clone() };
Ok(CrashIntrospectRequest::FindComponentByThreadKoid {
thread_koid: req.thread_koid,
responder: CrashIntrospectFindComponentByThreadKoidResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<CrashIntrospectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum CrashIntrospectRequest {
FindComponentByThreadKoid {
thread_koid: u64,
responder: CrashIntrospectFindComponentByThreadKoidResponder,
},
}
impl CrashIntrospectRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_find_component_by_thread_koid(
self,
) -> Option<(u64, CrashIntrospectFindComponentByThreadKoidResponder)> {
if let CrashIntrospectRequest::FindComponentByThreadKoid { thread_koid, responder } = self {
Some((thread_koid, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CrashIntrospectRequest::FindComponentByThreadKoid { .. } => {
"find_component_by_thread_koid"
}
}
}
}
#[derive(Debug, Clone)]
pub struct CrashIntrospectControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for CrashIntrospectControlHandle {
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()
}
}
impl CrashIntrospectControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CrashIntrospectFindComponentByThreadKoidResponder {
control_handle: std::mem::ManuallyDrop<CrashIntrospectControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CrashIntrospectFindComponentByThreadKoidResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CrashIntrospectFindComponentByThreadKoidResponder {
type ControlHandle = CrashIntrospectControlHandle;
fn control_handle(&self) -> &CrashIntrospectControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CrashIntrospectFindComponentByThreadKoidResponder {
pub fn send(
self,
mut result: Result<&ComponentCrashInfo, fidl_fuchsia_component::Error>,
) -> 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<&ComponentCrashInfo, fidl_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&ComponentCrashInfo, fidl_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
CrashIntrospectFindComponentByThreadKoidResponse,
fidl_fuchsia_component::Error,
>>(
result.map(|info| (info,)),
self.tx_id,
0x75d3ff081eca468d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct InstanceIteratorMarker;
impl fidl::endpoints::ProtocolMarker for InstanceIteratorMarker {
type Proxy = InstanceIteratorProxy;
type RequestStream = InstanceIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = InstanceIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) InstanceIterator";
}
pub trait InstanceIteratorProxyInterface: Send + Sync {
type NextResponseFut: std::future::Future<Output = Result<Vec<Instance>, fidl::Error>> + Send;
fn r#next(&self) -> Self::NextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct InstanceIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for InstanceIteratorSynchronousProxy {
type Proxy = InstanceIteratorProxy;
type Protocol = InstanceIteratorMarker;
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 InstanceIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <InstanceIteratorMarker 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::Time) -> Result<InstanceIteratorEvent, fidl::Error> {
InstanceIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(&self, ___deadline: zx::Time) -> Result<Vec<Instance>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, InstanceIteratorNextResponse>(
(),
0x3a4e3d52432a52ee,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.infos)
}
}
#[derive(Debug, Clone)]
pub struct InstanceIteratorProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for InstanceIteratorProxy {
type Protocol = InstanceIteratorMarker;
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 InstanceIteratorProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <InstanceIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> InstanceIteratorEventStream {
InstanceIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#next(&self) -> fidl::client::QueryResponseFut<Vec<Instance>> {
InstanceIteratorProxyInterface::r#next(self)
}
}
impl InstanceIteratorProxyInterface for InstanceIteratorProxy {
type NextResponseFut = fidl::client::QueryResponseFut<Vec<Instance>>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<Vec<Instance>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
InstanceIteratorNextResponse,
0x3a4e3d52432a52ee,
>(_buf?)?;
Ok(_response.infos)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Instance>>(
(),
0x3a4e3d52432a52ee,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct InstanceIteratorEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for InstanceIteratorEventStream {}
impl futures::stream::FusedStream for InstanceIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for InstanceIteratorEventStream {
type Item = Result<InstanceIteratorEvent, 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(InstanceIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum InstanceIteratorEvent {}
impl InstanceIteratorEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<InstanceIteratorEvent, 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:
<InstanceIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct InstanceIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for InstanceIteratorRequestStream {}
impl futures::stream::FusedStream for InstanceIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for InstanceIteratorRequestStream {
type Protocol = InstanceIteratorMarker;
type ControlHandle = InstanceIteratorControlHandle;
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 {
InstanceIteratorControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for InstanceIteratorRequestStream {
type Item = Result<InstanceIteratorRequest, 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 InstanceIteratorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3a4e3d52432a52ee => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle =
InstanceIteratorControlHandle { inner: this.inner.clone() };
Ok(InstanceIteratorRequest::Next {
responder: InstanceIteratorNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<InstanceIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum InstanceIteratorRequest {
Next { responder: InstanceIteratorNextResponder },
}
impl InstanceIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_next(self) -> Option<(InstanceIteratorNextResponder)> {
if let InstanceIteratorRequest::Next { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
InstanceIteratorRequest::Next { .. } => "next",
}
}
}
#[derive(Debug, Clone)]
pub struct InstanceIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for InstanceIteratorControlHandle {
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()
}
}
impl InstanceIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InstanceIteratorNextResponder {
control_handle: std::mem::ManuallyDrop<InstanceIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InstanceIteratorNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InstanceIteratorNextResponder {
type ControlHandle = InstanceIteratorControlHandle;
fn control_handle(&self) -> &InstanceIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InstanceIteratorNextResponder {
pub fn send(self, mut infos: &[Instance]) -> Result<(), fidl::Error> {
let _result = self.send_raw(infos);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut infos: &[Instance]) -> Result<(), fidl::Error> {
let _result = self.send_raw(infos);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut infos: &[Instance]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<InstanceIteratorNextResponse>(
(infos,),
self.tx_id,
0x3a4e3d52432a52ee,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LifecycleControllerMarker;
impl fidl::endpoints::ProtocolMarker for LifecycleControllerMarker {
type Proxy = LifecycleControllerProxy;
type RequestStream = LifecycleControllerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LifecycleControllerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.sys2.LifecycleController";
}
impl fidl::endpoints::DiscoverableProtocolMarker for LifecycleControllerMarker {}
pub type LifecycleControllerStartInstanceResult = Result<(), StartError>;
pub type LifecycleControllerStopInstanceResult = Result<(), StopError>;
pub type LifecycleControllerResolveInstanceResult = Result<(), ResolveError>;
pub type LifecycleControllerUnresolveInstanceResult = Result<(), UnresolveError>;
pub type LifecycleControllerCreateInstanceResult = Result<(), CreateError>;
pub type LifecycleControllerDestroyInstanceResult = Result<(), DestroyError>;
pub trait LifecycleControllerProxyInterface: Send + Sync {
type StartInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerStartInstanceResult, fidl::Error>>
+ Send;
fn r#start_instance(
&self,
moniker: &str,
binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
) -> Self::StartInstanceResponseFut;
type StopInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerStopInstanceResult, fidl::Error>>
+ Send;
fn r#stop_instance(&self, moniker: &str) -> Self::StopInstanceResponseFut;
type ResolveInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerResolveInstanceResult, fidl::Error>>
+ Send;
fn r#resolve_instance(&self, moniker: &str) -> Self::ResolveInstanceResponseFut;
type UnresolveInstanceResponseFut: std::future::Future<
Output = Result<LifecycleControllerUnresolveInstanceResult, fidl::Error>,
> + Send;
fn r#unresolve_instance(&self, moniker: &str) -> Self::UnresolveInstanceResponseFut;
type CreateInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerCreateInstanceResult, fidl::Error>>
+ Send;
fn r#create_instance(
&self,
parent_moniker: &str,
collection: &fidl_fuchsia_component_decl::CollectionRef,
decl: &fidl_fuchsia_component_decl::Child,
args: fidl_fuchsia_component::CreateChildArgs,
) -> Self::CreateInstanceResponseFut;
type DestroyInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerDestroyInstanceResult, fidl::Error>>
+ Send;
fn r#destroy_instance(
&self,
parent_moniker: &str,
child: &fidl_fuchsia_component_decl::ChildRef,
) -> Self::DestroyInstanceResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LifecycleControllerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LifecycleControllerSynchronousProxy {
type Proxy = LifecycleControllerProxy;
type Protocol = LifecycleControllerMarker;
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 LifecycleControllerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<LifecycleControllerMarker 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::Time,
) -> Result<LifecycleControllerEvent, fidl::Error> {
LifecycleControllerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#start_instance(
&self,
mut moniker: &str,
mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
___deadline: zx::Time,
) -> Result<LifecycleControllerStartInstanceResult, fidl::Error> {
let _response = self.client.send_query::<
LifecycleControllerStartInstanceRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
>(
(moniker, binder,),
0x13fcb422876384bf,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#stop_instance(
&self,
mut moniker: &str,
___deadline: zx::Time,
) -> Result<LifecycleControllerStopInstanceResult, fidl::Error> {
let _response = self.client.send_query::<
LifecycleControllerStopInstanceRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StopError>,
>(
(moniker,),
0x1362ba9d0e3caf36,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#resolve_instance(
&self,
mut moniker: &str,
___deadline: zx::Time,
) -> Result<LifecycleControllerResolveInstanceResult, fidl::Error> {
let _response = self.client.send_query::<
LifecycleControllerResolveInstanceRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ResolveError>,
>(
(moniker,),
0x426ab8dd53d8e737,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#unresolve_instance(
&self,
mut moniker: &str,
___deadline: zx::Time,
) -> Result<LifecycleControllerUnresolveInstanceResult, fidl::Error> {
let _response = self.client.send_query::<
LifecycleControllerUnresolveInstanceRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UnresolveError>,
>(
(moniker,),
0x18166a2aa798cb99,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#create_instance(
&self,
mut parent_moniker: &str,
mut collection: &fidl_fuchsia_component_decl::CollectionRef,
mut decl: &fidl_fuchsia_component_decl::Child,
mut args: fidl_fuchsia_component::CreateChildArgs,
___deadline: zx::Time,
) -> Result<LifecycleControllerCreateInstanceResult, fidl::Error> {
let _response = self.client.send_query::<
LifecycleControllerCreateInstanceRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, CreateError>,
>(
(parent_moniker, collection, decl, &mut args,),
0x48d17ae777e4f9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#destroy_instance(
&self,
mut parent_moniker: &str,
mut child: &fidl_fuchsia_component_decl::ChildRef,
___deadline: zx::Time,
) -> Result<LifecycleControllerDestroyInstanceResult, fidl::Error> {
let _response = self.client.send_query::<
LifecycleControllerDestroyInstanceRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DestroyError>,
>(
(parent_moniker, child,),
0x27640ae5889d7443,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct LifecycleControllerProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for LifecycleControllerProxy {
type Protocol = LifecycleControllerMarker;
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 LifecycleControllerProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name =
<LifecycleControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LifecycleControllerEventStream {
LifecycleControllerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#start_instance(
&self,
mut moniker: &str,
mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
) -> fidl::client::QueryResponseFut<LifecycleControllerStartInstanceResult> {
LifecycleControllerProxyInterface::r#start_instance(self, moniker, binder)
}
pub fn r#stop_instance(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<LifecycleControllerStopInstanceResult> {
LifecycleControllerProxyInterface::r#stop_instance(self, moniker)
}
pub fn r#resolve_instance(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<LifecycleControllerResolveInstanceResult> {
LifecycleControllerProxyInterface::r#resolve_instance(self, moniker)
}
pub fn r#unresolve_instance(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<LifecycleControllerUnresolveInstanceResult> {
LifecycleControllerProxyInterface::r#unresolve_instance(self, moniker)
}
pub fn r#create_instance(
&self,
mut parent_moniker: &str,
mut collection: &fidl_fuchsia_component_decl::CollectionRef,
mut decl: &fidl_fuchsia_component_decl::Child,
mut args: fidl_fuchsia_component::CreateChildArgs,
) -> fidl::client::QueryResponseFut<LifecycleControllerCreateInstanceResult> {
LifecycleControllerProxyInterface::r#create_instance(
self,
parent_moniker,
collection,
decl,
args,
)
}
pub fn r#destroy_instance(
&self,
mut parent_moniker: &str,
mut child: &fidl_fuchsia_component_decl::ChildRef,
) -> fidl::client::QueryResponseFut<LifecycleControllerDestroyInstanceResult> {
LifecycleControllerProxyInterface::r#destroy_instance(self, parent_moniker, child)
}
}
impl LifecycleControllerProxyInterface for LifecycleControllerProxy {
type StartInstanceResponseFut =
fidl::client::QueryResponseFut<LifecycleControllerStartInstanceResult>;
fn r#start_instance(
&self,
mut moniker: &str,
mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
) -> Self::StartInstanceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerStartInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
0x13fcb422876384bf,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LifecycleControllerStartInstanceRequest,
LifecycleControllerStartInstanceResult,
>(
(moniker, binder,),
0x13fcb422876384bf,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopInstanceResponseFut =
fidl::client::QueryResponseFut<LifecycleControllerStopInstanceResult>;
fn r#stop_instance(&self, mut moniker: &str) -> Self::StopInstanceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerStopInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StopError>,
0x1362ba9d0e3caf36,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LifecycleControllerStopInstanceRequest,
LifecycleControllerStopInstanceResult,
>(
(moniker,),
0x1362ba9d0e3caf36,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ResolveInstanceResponseFut =
fidl::client::QueryResponseFut<LifecycleControllerResolveInstanceResult>;
fn r#resolve_instance(&self, mut moniker: &str) -> Self::ResolveInstanceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerResolveInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ResolveError>,
0x426ab8dd53d8e737,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LifecycleControllerResolveInstanceRequest,
LifecycleControllerResolveInstanceResult,
>(
(moniker,),
0x426ab8dd53d8e737,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type UnresolveInstanceResponseFut =
fidl::client::QueryResponseFut<LifecycleControllerUnresolveInstanceResult>;
fn r#unresolve_instance(&self, mut moniker: &str) -> Self::UnresolveInstanceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerUnresolveInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UnresolveError>,
0x18166a2aa798cb99,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LifecycleControllerUnresolveInstanceRequest,
LifecycleControllerUnresolveInstanceResult,
>(
(moniker,),
0x18166a2aa798cb99,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CreateInstanceResponseFut =
fidl::client::QueryResponseFut<LifecycleControllerCreateInstanceResult>;
fn r#create_instance(
&self,
mut parent_moniker: &str,
mut collection: &fidl_fuchsia_component_decl::CollectionRef,
mut decl: &fidl_fuchsia_component_decl::Child,
mut args: fidl_fuchsia_component::CreateChildArgs,
) -> Self::CreateInstanceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerCreateInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, CreateError>,
0x48d17ae777e4f9,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LifecycleControllerCreateInstanceRequest,
LifecycleControllerCreateInstanceResult,
>(
(parent_moniker, collection, decl, &mut args,),
0x48d17ae777e4f9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DestroyInstanceResponseFut =
fidl::client::QueryResponseFut<LifecycleControllerDestroyInstanceResult>;
fn r#destroy_instance(
&self,
mut parent_moniker: &str,
mut child: &fidl_fuchsia_component_decl::ChildRef,
) -> Self::DestroyInstanceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerDestroyInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DestroyError>,
0x27640ae5889d7443,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LifecycleControllerDestroyInstanceRequest,
LifecycleControllerDestroyInstanceResult,
>(
(parent_moniker, child,),
0x27640ae5889d7443,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct LifecycleControllerEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for LifecycleControllerEventStream {}
impl futures::stream::FusedStream for LifecycleControllerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LifecycleControllerEventStream {
type Item = Result<LifecycleControllerEvent, 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(LifecycleControllerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LifecycleControllerEvent {}
impl LifecycleControllerEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<LifecycleControllerEvent, 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:
<LifecycleControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LifecycleControllerRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for LifecycleControllerRequestStream {}
impl futures::stream::FusedStream for LifecycleControllerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LifecycleControllerRequestStream {
type Protocol = LifecycleControllerMarker;
type ControlHandle = LifecycleControllerControlHandle;
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 {
LifecycleControllerControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for LifecycleControllerRequestStream {
type Item = Result<LifecycleControllerRequest, 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 LifecycleControllerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x13fcb422876384bf => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(LifecycleControllerStartInstanceRequest);
fidl::encoding::Decoder::decode_into::<LifecycleControllerStartInstanceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle =
LifecycleControllerControlHandle { inner: this.inner.clone() };
Ok(LifecycleControllerRequest::StartInstance {
moniker: req.moniker,
binder: req.binder,
responder: LifecycleControllerStartInstanceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1362ba9d0e3caf36 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(LifecycleControllerStopInstanceRequest);
fidl::encoding::Decoder::decode_into::<LifecycleControllerStopInstanceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle =
LifecycleControllerControlHandle { inner: this.inner.clone() };
Ok(LifecycleControllerRequest::StopInstance {
moniker: req.moniker,
responder: LifecycleControllerStopInstanceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x426ab8dd53d8e737 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(LifecycleControllerResolveInstanceRequest);
fidl::encoding::Decoder::decode_into::<
LifecycleControllerResolveInstanceRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LifecycleControllerControlHandle { inner: this.inner.clone() };
Ok(LifecycleControllerRequest::ResolveInstance {
moniker: req.moniker,
responder: LifecycleControllerResolveInstanceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x18166a2aa798cb99 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(LifecycleControllerUnresolveInstanceRequest);
fidl::encoding::Decoder::decode_into::<
LifecycleControllerUnresolveInstanceRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LifecycleControllerControlHandle { inner: this.inner.clone() };
Ok(LifecycleControllerRequest::UnresolveInstance {
moniker: req.moniker,
responder: LifecycleControllerUnresolveInstanceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x48d17ae777e4f9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(LifecycleControllerCreateInstanceRequest);
fidl::encoding::Decoder::decode_into::<LifecycleControllerCreateInstanceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle =
LifecycleControllerControlHandle { inner: this.inner.clone() };
Ok(LifecycleControllerRequest::CreateInstance {
parent_moniker: req.parent_moniker,
collection: req.collection,
decl: req.decl,
args: req.args,
responder: LifecycleControllerCreateInstanceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x27640ae5889d7443 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(LifecycleControllerDestroyInstanceRequest);
fidl::encoding::Decoder::decode_into::<
LifecycleControllerDestroyInstanceRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LifecycleControllerControlHandle { inner: this.inner.clone() };
Ok(LifecycleControllerRequest::DestroyInstance {
parent_moniker: req.parent_moniker,
child: req.child,
responder: LifecycleControllerDestroyInstanceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LifecycleControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum LifecycleControllerRequest {
StartInstance {
moniker: String,
binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
responder: LifecycleControllerStartInstanceResponder,
},
StopInstance { moniker: String, responder: LifecycleControllerStopInstanceResponder },
ResolveInstance { moniker: String, responder: LifecycleControllerResolveInstanceResponder },
UnresolveInstance { moniker: String, responder: LifecycleControllerUnresolveInstanceResponder },
CreateInstance {
parent_moniker: String,
collection: fidl_fuchsia_component_decl::CollectionRef,
decl: fidl_fuchsia_component_decl::Child,
args: fidl_fuchsia_component::CreateChildArgs,
responder: LifecycleControllerCreateInstanceResponder,
},
DestroyInstance {
parent_moniker: String,
child: fidl_fuchsia_component_decl::ChildRef,
responder: LifecycleControllerDestroyInstanceResponder,
},
}
impl LifecycleControllerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_start_instance(
self,
) -> Option<(
String,
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
LifecycleControllerStartInstanceResponder,
)> {
if let LifecycleControllerRequest::StartInstance { moniker, binder, responder } = self {
Some((moniker, binder, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop_instance(self) -> Option<(String, LifecycleControllerStopInstanceResponder)> {
if let LifecycleControllerRequest::StopInstance { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_resolve_instance(
self,
) -> Option<(String, LifecycleControllerResolveInstanceResponder)> {
if let LifecycleControllerRequest::ResolveInstance { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_unresolve_instance(
self,
) -> Option<(String, LifecycleControllerUnresolveInstanceResponder)> {
if let LifecycleControllerRequest::UnresolveInstance { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_instance(
self,
) -> Option<(
String,
fidl_fuchsia_component_decl::CollectionRef,
fidl_fuchsia_component_decl::Child,
fidl_fuchsia_component::CreateChildArgs,
LifecycleControllerCreateInstanceResponder,
)> {
if let LifecycleControllerRequest::CreateInstance {
parent_moniker,
collection,
decl,
args,
responder,
} = self
{
Some((parent_moniker, collection, decl, args, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_destroy_instance(
self,
) -> Option<(
String,
fidl_fuchsia_component_decl::ChildRef,
LifecycleControllerDestroyInstanceResponder,
)> {
if let LifecycleControllerRequest::DestroyInstance { parent_moniker, child, responder } =
self
{
Some((parent_moniker, child, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LifecycleControllerRequest::StartInstance { .. } => "start_instance",
LifecycleControllerRequest::StopInstance { .. } => "stop_instance",
LifecycleControllerRequest::ResolveInstance { .. } => "resolve_instance",
LifecycleControllerRequest::UnresolveInstance { .. } => "unresolve_instance",
LifecycleControllerRequest::CreateInstance { .. } => "create_instance",
LifecycleControllerRequest::DestroyInstance { .. } => "destroy_instance",
}
}
}
#[derive(Debug, Clone)]
pub struct LifecycleControllerControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for LifecycleControllerControlHandle {
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()
}
}
impl LifecycleControllerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LifecycleControllerStartInstanceResponder {
control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LifecycleControllerStartInstanceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LifecycleControllerStartInstanceResponder {
type ControlHandle = LifecycleControllerControlHandle;
fn control_handle(&self) -> &LifecycleControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LifecycleControllerStartInstanceResponder {
pub fn send(self, mut result: Result<(), StartError>) -> 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<(), StartError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>>(
result,
self.tx_id,
0x13fcb422876384bf,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LifecycleControllerStopInstanceResponder {
control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LifecycleControllerStopInstanceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LifecycleControllerStopInstanceResponder {
type ControlHandle = LifecycleControllerControlHandle;
fn control_handle(&self) -> &LifecycleControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LifecycleControllerStopInstanceResponder {
pub fn send(self, mut result: Result<(), StopError>) -> 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<(), StopError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), StopError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StopError>>(
result,
self.tx_id,
0x1362ba9d0e3caf36,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LifecycleControllerResolveInstanceResponder {
control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LifecycleControllerResolveInstanceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LifecycleControllerResolveInstanceResponder {
type ControlHandle = LifecycleControllerControlHandle;
fn control_handle(&self) -> &LifecycleControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LifecycleControllerResolveInstanceResponder {
pub fn send(self, mut result: Result<(), ResolveError>) -> 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<(), ResolveError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), ResolveError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
ResolveError,
>>(
result,
self.tx_id,
0x426ab8dd53d8e737,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LifecycleControllerUnresolveInstanceResponder {
control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LifecycleControllerUnresolveInstanceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LifecycleControllerUnresolveInstanceResponder {
type ControlHandle = LifecycleControllerControlHandle;
fn control_handle(&self) -> &LifecycleControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LifecycleControllerUnresolveInstanceResponder {
pub fn send(self, mut result: Result<(), UnresolveError>) -> 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<(), UnresolveError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), UnresolveError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
UnresolveError,
>>(
result,
self.tx_id,
0x18166a2aa798cb99,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LifecycleControllerCreateInstanceResponder {
control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LifecycleControllerCreateInstanceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LifecycleControllerCreateInstanceResponder {
type ControlHandle = LifecycleControllerControlHandle;
fn control_handle(&self) -> &LifecycleControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LifecycleControllerCreateInstanceResponder {
pub fn send(self, mut result: Result<(), CreateError>) -> 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<(), CreateError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CreateError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
CreateError,
>>(
result,
self.tx_id,
0x48d17ae777e4f9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LifecycleControllerDestroyInstanceResponder {
control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LifecycleControllerDestroyInstanceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LifecycleControllerDestroyInstanceResponder {
type ControlHandle = LifecycleControllerControlHandle;
fn control_handle(&self) -> &LifecycleControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LifecycleControllerDestroyInstanceResponder {
pub fn send(self, mut result: Result<(), DestroyError>) -> 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<(), DestroyError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), DestroyError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
DestroyError,
>>(
result,
self.tx_id,
0x27640ae5889d7443,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ManifestBytesIteratorMarker;
impl fidl::endpoints::ProtocolMarker for ManifestBytesIteratorMarker {
type Proxy = ManifestBytesIteratorProxy;
type RequestStream = ManifestBytesIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ManifestBytesIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) ManifestBytesIterator";
}
pub trait ManifestBytesIteratorProxyInterface: Send + Sync {
type NextResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
fn r#next(&self) -> Self::NextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ManifestBytesIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ManifestBytesIteratorSynchronousProxy {
type Proxy = ManifestBytesIteratorProxy;
type Protocol = ManifestBytesIteratorMarker;
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 ManifestBytesIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<ManifestBytesIteratorMarker 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::Time,
) -> Result<ManifestBytesIteratorEvent, fidl::Error> {
ManifestBytesIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(&self, ___deadline: zx::Time) -> Result<Vec<u8>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, ManifestBytesIteratorNextResponse>(
(),
0x4be4659549b15500,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.infos)
}
}
#[derive(Debug, Clone)]
pub struct ManifestBytesIteratorProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for ManifestBytesIteratorProxy {
type Protocol = ManifestBytesIteratorMarker;
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 ManifestBytesIteratorProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name =
<ManifestBytesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ManifestBytesIteratorEventStream {
ManifestBytesIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#next(&self) -> fidl::client::QueryResponseFut<Vec<u8>> {
ManifestBytesIteratorProxyInterface::r#next(self)
}
}
impl ManifestBytesIteratorProxyInterface for ManifestBytesIteratorProxy {
type NextResponseFut = fidl::client::QueryResponseFut<Vec<u8>>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ManifestBytesIteratorNextResponse,
0x4be4659549b15500,
>(_buf?)?;
Ok(_response.infos)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
(),
0x4be4659549b15500,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ManifestBytesIteratorEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for ManifestBytesIteratorEventStream {}
impl futures::stream::FusedStream for ManifestBytesIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ManifestBytesIteratorEventStream {
type Item = Result<ManifestBytesIteratorEvent, 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(ManifestBytesIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ManifestBytesIteratorEvent {}
impl ManifestBytesIteratorEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<ManifestBytesIteratorEvent, 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:
<ManifestBytesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ManifestBytesIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for ManifestBytesIteratorRequestStream {}
impl futures::stream::FusedStream for ManifestBytesIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ManifestBytesIteratorRequestStream {
type Protocol = ManifestBytesIteratorMarker;
type ControlHandle = ManifestBytesIteratorControlHandle;
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 {
ManifestBytesIteratorControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ManifestBytesIteratorRequestStream {
type Item = Result<ManifestBytesIteratorRequest, 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 ManifestBytesIteratorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x4be4659549b15500 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle =
ManifestBytesIteratorControlHandle { inner: this.inner.clone() };
Ok(ManifestBytesIteratorRequest::Next {
responder: ManifestBytesIteratorNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ManifestBytesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum ManifestBytesIteratorRequest {
Next { responder: ManifestBytesIteratorNextResponder },
}
impl ManifestBytesIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_next(self) -> Option<(ManifestBytesIteratorNextResponder)> {
if let ManifestBytesIteratorRequest::Next { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ManifestBytesIteratorRequest::Next { .. } => "next",
}
}
}
#[derive(Debug, Clone)]
pub struct ManifestBytesIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for ManifestBytesIteratorControlHandle {
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()
}
}
impl ManifestBytesIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManifestBytesIteratorNextResponder {
control_handle: std::mem::ManuallyDrop<ManifestBytesIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManifestBytesIteratorNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManifestBytesIteratorNextResponder {
type ControlHandle = ManifestBytesIteratorControlHandle;
fn control_handle(&self) -> &ManifestBytesIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManifestBytesIteratorNextResponder {
pub fn send(self, mut infos: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(infos);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut infos: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(infos);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut infos: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ManifestBytesIteratorNextResponse>(
(infos,),
self.tx_id,
0x4be4659549b15500,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RealmExplorerMarker;
impl fidl::endpoints::ProtocolMarker for RealmExplorerMarker {
type Proxy = RealmExplorerProxy;
type RequestStream = RealmExplorerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RealmExplorerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.sys2.RealmExplorer";
}
impl fidl::endpoints::DiscoverableProtocolMarker for RealmExplorerMarker {}
pub trait RealmExplorerProxyInterface: Send + Sync {}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RealmExplorerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RealmExplorerSynchronousProxy {
type Proxy = RealmExplorerProxy;
type Protocol = RealmExplorerMarker;
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 RealmExplorerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <RealmExplorerMarker 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::Time) -> Result<RealmExplorerEvent, fidl::Error> {
RealmExplorerEvent::decode(self.client.wait_for_event(deadline)?)
}
}
#[derive(Debug, Clone)]
pub struct RealmExplorerProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for RealmExplorerProxy {
type Protocol = RealmExplorerMarker;
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 RealmExplorerProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <RealmExplorerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RealmExplorerEventStream {
RealmExplorerEventStream { event_receiver: self.client.take_event_receiver() }
}
}
impl RealmExplorerProxyInterface for RealmExplorerProxy {}
pub struct RealmExplorerEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for RealmExplorerEventStream {}
impl futures::stream::FusedStream for RealmExplorerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RealmExplorerEventStream {
type Item = Result<RealmExplorerEvent, 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(RealmExplorerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RealmExplorerEvent {}
impl RealmExplorerEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<RealmExplorerEvent, 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: <RealmExplorerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RealmExplorerRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for RealmExplorerRequestStream {}
impl futures::stream::FusedStream for RealmExplorerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RealmExplorerRequestStream {
type Protocol = RealmExplorerMarker;
type ControlHandle = RealmExplorerControlHandle;
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 {
RealmExplorerControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for RealmExplorerRequestStream {
type Item = Result<RealmExplorerRequest, 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 RealmExplorerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
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:
<RealmExplorerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum RealmExplorerRequest {}
impl RealmExplorerRequest {
pub fn method_name(&self) -> &'static str {
match *self {}
}
}
#[derive(Debug, Clone)]
pub struct RealmExplorerControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for RealmExplorerControlHandle {
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()
}
}
impl RealmExplorerControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RealmQueryMarker;
impl fidl::endpoints::ProtocolMarker for RealmQueryMarker {
type Proxy = RealmQueryProxy;
type RequestStream = RealmQueryRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RealmQuerySynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.sys2.RealmQuery";
}
impl fidl::endpoints::DiscoverableProtocolMarker for RealmQueryMarker {}
pub type RealmQueryGetInstanceResult = Result<Instance, GetInstanceError>;
pub type RealmQueryGetResolvedDeclarationResult =
Result<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>, GetDeclarationError>;
pub type RealmQueryGetManifestResult =
Result<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>, GetDeclarationError>;
pub type RealmQueryResolveDeclarationResult =
Result<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>, GetDeclarationError>;
pub type RealmQueryGetStructuredConfigResult =
Result<fidl_fuchsia_component_decl::ResolvedConfig, GetStructuredConfigError>;
pub type RealmQueryGetAllInstancesResult =
Result<fidl::endpoints::ClientEnd<InstanceIteratorMarker>, GetAllInstancesError>;
pub type RealmQueryConstructNamespaceResult =
Result<Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>, ConstructNamespaceError>;
pub type RealmQueryOpenResult = Result<(), OpenError>;
pub type RealmQueryConnectToStorageAdminResult = Result<(), ConnectToStorageAdminError>;
pub trait RealmQueryProxyInterface: Send + Sync {
type GetInstanceResponseFut: std::future::Future<Output = Result<RealmQueryGetInstanceResult, fidl::Error>>
+ Send;
fn r#get_instance(&self, moniker: &str) -> Self::GetInstanceResponseFut;
type GetResolvedDeclarationResponseFut: std::future::Future<Output = Result<RealmQueryGetResolvedDeclarationResult, fidl::Error>>
+ Send;
fn r#get_resolved_declaration(&self, moniker: &str) -> Self::GetResolvedDeclarationResponseFut;
type GetManifestResponseFut: std::future::Future<Output = Result<RealmQueryGetManifestResult, fidl::Error>>
+ Send;
fn r#get_manifest(&self, moniker: &str) -> Self::GetManifestResponseFut;
type ResolveDeclarationResponseFut: std::future::Future<Output = Result<RealmQueryResolveDeclarationResult, fidl::Error>>
+ Send;
fn r#resolve_declaration(
&self,
parent: &str,
child_location: &ChildLocation,
url: &str,
) -> Self::ResolveDeclarationResponseFut;
type GetStructuredConfigResponseFut: std::future::Future<Output = Result<RealmQueryGetStructuredConfigResult, fidl::Error>>
+ Send;
fn r#get_structured_config(&self, moniker: &str) -> Self::GetStructuredConfigResponseFut;
type GetAllInstancesResponseFut: std::future::Future<Output = Result<RealmQueryGetAllInstancesResult, fidl::Error>>
+ Send;
fn r#get_all_instances(&self) -> Self::GetAllInstancesResponseFut;
type ConstructNamespaceResponseFut: std::future::Future<Output = Result<RealmQueryConstructNamespaceResult, fidl::Error>>
+ Send;
fn r#construct_namespace(&self, moniker: &str) -> Self::ConstructNamespaceResponseFut;
type OpenResponseFut: std::future::Future<Output = Result<RealmQueryOpenResult, fidl::Error>>
+ Send;
fn r#open(
&self,
moniker: &str,
dir_type: OpenDirType,
flags: fidl_fuchsia_io::OpenFlags,
mode: fidl_fuchsia_io::ModeType,
path: &str,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Self::OpenResponseFut;
type ConnectToStorageAdminResponseFut: std::future::Future<Output = Result<RealmQueryConnectToStorageAdminResult, fidl::Error>>
+ Send;
fn r#connect_to_storage_admin(
&self,
moniker: &str,
storage_name: &str,
server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
) -> Self::ConnectToStorageAdminResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RealmQuerySynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RealmQuerySynchronousProxy {
type Proxy = RealmQueryProxy;
type Protocol = RealmQueryMarker;
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 RealmQuerySynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <RealmQueryMarker 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::Time) -> Result<RealmQueryEvent, fidl::Error> {
RealmQueryEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_instance(
&self,
mut moniker: &str,
___deadline: zx::Time,
) -> Result<RealmQueryGetInstanceResult, fidl::Error> {
let _response =
self.client.send_query::<RealmQueryGetInstanceRequest, fidl::encoding::ResultType<
RealmQueryGetInstanceResponse,
GetInstanceError,
>>(
(moniker,),
0x3496ca1e5a0c13a8,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.instance))
}
pub fn r#get_resolved_declaration(
&self,
mut moniker: &str,
___deadline: zx::Time,
) -> Result<RealmQueryGetResolvedDeclarationResult, fidl::Error> {
let _response = self
.client
.send_query::<RealmQueryGetResolvedDeclarationRequest, fidl::encoding::ResultType<
RealmQueryGetResolvedDeclarationResponse,
GetDeclarationError,
>>(
(moniker,),
0x31a493d284a0bc1f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.iterator))
}
pub fn r#get_manifest(
&self,
mut moniker: &str,
___deadline: zx::Time,
) -> Result<RealmQueryGetManifestResult, fidl::Error> {
let _response =
self.client.send_query::<RealmQueryGetManifestRequest, fidl::encoding::ResultType<
RealmQueryGetManifestResponse,
GetDeclarationError,
>>(
(moniker,),
0x640769a9f88685c7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.iterator))
}
pub fn r#resolve_declaration(
&self,
mut parent: &str,
mut child_location: &ChildLocation,
mut url: &str,
___deadline: zx::Time,
) -> Result<RealmQueryResolveDeclarationResult, fidl::Error> {
let _response =
self.client
.send_query::<RealmQueryResolveDeclarationRequest, fidl::encoding::ResultType<
RealmQueryResolveDeclarationResponse,
GetDeclarationError,
>>(
(parent, child_location, url),
0x1ab1adf2a87d962d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.iterator))
}
pub fn r#get_structured_config(
&self,
mut moniker: &str,
___deadline: zx::Time,
) -> Result<RealmQueryGetStructuredConfigResult, fidl::Error> {
let _response = self
.client
.send_query::<RealmQueryGetStructuredConfigRequest, fidl::encoding::ResultType<
RealmQueryGetStructuredConfigResponse,
GetStructuredConfigError,
>>(
(moniker,), 0x16f88f6735bd204, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.config))
}
pub fn r#get_all_instances(
&self,
___deadline: zx::Time,
) -> Result<RealmQueryGetAllInstancesResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
RealmQueryGetAllInstancesResponse,
GetAllInstancesError,
>>(
(),
0x7b5a8775d30cad47,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.iterator))
}
pub fn r#construct_namespace(
&self,
mut moniker: &str,
___deadline: zx::Time,
) -> Result<RealmQueryConstructNamespaceResult, fidl::Error> {
let _response = self
.client
.send_query::<RealmQueryConstructNamespaceRequest, fidl::encoding::ResultType<
RealmQueryConstructNamespaceResponse,
ConstructNamespaceError,
>>(
(moniker,),
0x5ecb29c02c488eeb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.namespace))
}
pub fn r#open(
&self,
mut moniker: &str,
mut dir_type: OpenDirType,
mut flags: fidl_fuchsia_io::OpenFlags,
mut mode: fidl_fuchsia_io::ModeType,
mut path: &str,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
___deadline: zx::Time,
) -> Result<RealmQueryOpenResult, fidl::Error> {
let _response = self.client.send_query::<
RealmQueryOpenRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
>(
(moniker, dir_type, flags, mode, path, object,),
0x42a5517b78cf410,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#connect_to_storage_admin(
&self,
mut moniker: &str,
mut storage_name: &str,
mut server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
___deadline: zx::Time,
) -> Result<RealmQueryConnectToStorageAdminResult, fidl::Error> {
let _response =
self.client
.send_query::<RealmQueryConnectToStorageAdminRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
ConnectToStorageAdminError,
>>(
(moniker, storage_name, server_end),
0x7807e6b4f623ace,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct RealmQueryProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for RealmQueryProxy {
type Protocol = RealmQueryMarker;
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 RealmQueryProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <RealmQueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RealmQueryEventStream {
RealmQueryEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_instance(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<RealmQueryGetInstanceResult> {
RealmQueryProxyInterface::r#get_instance(self, moniker)
}
pub fn r#get_resolved_declaration(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<RealmQueryGetResolvedDeclarationResult> {
RealmQueryProxyInterface::r#get_resolved_declaration(self, moniker)
}
pub fn r#get_manifest(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<RealmQueryGetManifestResult> {
RealmQueryProxyInterface::r#get_manifest(self, moniker)
}
pub fn r#resolve_declaration(
&self,
mut parent: &str,
mut child_location: &ChildLocation,
mut url: &str,
) -> fidl::client::QueryResponseFut<RealmQueryResolveDeclarationResult> {
RealmQueryProxyInterface::r#resolve_declaration(self, parent, child_location, url)
}
pub fn r#get_structured_config(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<RealmQueryGetStructuredConfigResult> {
RealmQueryProxyInterface::r#get_structured_config(self, moniker)
}
pub fn r#get_all_instances(
&self,
) -> fidl::client::QueryResponseFut<RealmQueryGetAllInstancesResult> {
RealmQueryProxyInterface::r#get_all_instances(self)
}
pub fn r#construct_namespace(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<RealmQueryConstructNamespaceResult> {
RealmQueryProxyInterface::r#construct_namespace(self, moniker)
}
pub fn r#open(
&self,
mut moniker: &str,
mut dir_type: OpenDirType,
mut flags: fidl_fuchsia_io::OpenFlags,
mut mode: fidl_fuchsia_io::ModeType,
mut path: &str,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> fidl::client::QueryResponseFut<RealmQueryOpenResult> {
RealmQueryProxyInterface::r#open(self, moniker, dir_type, flags, mode, path, object)
}
pub fn r#connect_to_storage_admin(
&self,
mut moniker: &str,
mut storage_name: &str,
mut server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
) -> fidl::client::QueryResponseFut<RealmQueryConnectToStorageAdminResult> {
RealmQueryProxyInterface::r#connect_to_storage_admin(
self,
moniker,
storage_name,
server_end,
)
}
}
impl RealmQueryProxyInterface for RealmQueryProxy {
type GetInstanceResponseFut = fidl::client::QueryResponseFut<RealmQueryGetInstanceResult>;
fn r#get_instance(&self, mut moniker: &str) -> Self::GetInstanceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RealmQueryGetInstanceResponse, GetInstanceError>,
0x3496ca1e5a0c13a8,
>(_buf?)?;
Ok(_response.map(|x| x.instance))
}
self.client
.send_query_and_decode::<RealmQueryGetInstanceRequest, RealmQueryGetInstanceResult>(
(moniker,),
0x3496ca1e5a0c13a8,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetResolvedDeclarationResponseFut =
fidl::client::QueryResponseFut<RealmQueryGetResolvedDeclarationResult>;
fn r#get_resolved_declaration(
&self,
mut moniker: &str,
) -> Self::GetResolvedDeclarationResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetResolvedDeclarationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RealmQueryGetResolvedDeclarationResponse,
GetDeclarationError,
>,
0x31a493d284a0bc1f,
>(_buf?)?;
Ok(_response.map(|x| x.iterator))
}
self.client.send_query_and_decode::<
RealmQueryGetResolvedDeclarationRequest,
RealmQueryGetResolvedDeclarationResult,
>(
(moniker,),
0x31a493d284a0bc1f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetManifestResponseFut = fidl::client::QueryResponseFut<RealmQueryGetManifestResult>;
fn r#get_manifest(&self, mut moniker: &str) -> Self::GetManifestResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetManifestResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RealmQueryGetManifestResponse, GetDeclarationError>,
0x640769a9f88685c7,
>(_buf?)?;
Ok(_response.map(|x| x.iterator))
}
self.client
.send_query_and_decode::<RealmQueryGetManifestRequest, RealmQueryGetManifestResult>(
(moniker,),
0x640769a9f88685c7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ResolveDeclarationResponseFut =
fidl::client::QueryResponseFut<RealmQueryResolveDeclarationResult>;
fn r#resolve_declaration(
&self,
mut parent: &str,
mut child_location: &ChildLocation,
mut url: &str,
) -> Self::ResolveDeclarationResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryResolveDeclarationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RealmQueryResolveDeclarationResponse,
GetDeclarationError,
>,
0x1ab1adf2a87d962d,
>(_buf?)?;
Ok(_response.map(|x| x.iterator))
}
self.client.send_query_and_decode::<
RealmQueryResolveDeclarationRequest,
RealmQueryResolveDeclarationResult,
>(
(parent, child_location, url,),
0x1ab1adf2a87d962d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetStructuredConfigResponseFut =
fidl::client::QueryResponseFut<RealmQueryGetStructuredConfigResult>;
fn r#get_structured_config(&self, mut moniker: &str) -> Self::GetStructuredConfigResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetStructuredConfigResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RealmQueryGetStructuredConfigResponse,
GetStructuredConfigError,
>,
0x16f88f6735bd204,
>(_buf?)?;
Ok(_response.map(|x| x.config))
}
self.client.send_query_and_decode::<
RealmQueryGetStructuredConfigRequest,
RealmQueryGetStructuredConfigResult,
>(
(moniker,),
0x16f88f6735bd204,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetAllInstancesResponseFut =
fidl::client::QueryResponseFut<RealmQueryGetAllInstancesResult>;
fn r#get_all_instances(&self) -> Self::GetAllInstancesResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetAllInstancesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RealmQueryGetAllInstancesResponse, GetAllInstancesError>,
0x7b5a8775d30cad47,
>(_buf?)?;
Ok(_response.map(|x| x.iterator))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, RealmQueryGetAllInstancesResult>(
(),
0x7b5a8775d30cad47,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ConstructNamespaceResponseFut =
fidl::client::QueryResponseFut<RealmQueryConstructNamespaceResult>;
fn r#construct_namespace(&self, mut moniker: &str) -> Self::ConstructNamespaceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryConstructNamespaceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RealmQueryConstructNamespaceResponse,
ConstructNamespaceError,
>,
0x5ecb29c02c488eeb,
>(_buf?)?;
Ok(_response.map(|x| x.namespace))
}
self.client.send_query_and_decode::<
RealmQueryConstructNamespaceRequest,
RealmQueryConstructNamespaceResult,
>(
(moniker,),
0x5ecb29c02c488eeb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type OpenResponseFut = fidl::client::QueryResponseFut<RealmQueryOpenResult>;
fn r#open(
&self,
mut moniker: &str,
mut dir_type: OpenDirType,
mut flags: fidl_fuchsia_io::OpenFlags,
mut mode: fidl_fuchsia_io::ModeType,
mut path: &str,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Self::OpenResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryOpenResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
0x42a5517b78cf410,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<RealmQueryOpenRequest, RealmQueryOpenResult>(
(moniker, dir_type, flags, mode, path, object),
0x42a5517b78cf410,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ConnectToStorageAdminResponseFut =
fidl::client::QueryResponseFut<RealmQueryConnectToStorageAdminResult>;
fn r#connect_to_storage_admin(
&self,
mut moniker: &str,
mut storage_name: &str,
mut server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
) -> Self::ConnectToStorageAdminResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryConnectToStorageAdminResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ConnectToStorageAdminError>,
0x7807e6b4f623ace,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
RealmQueryConnectToStorageAdminRequest,
RealmQueryConnectToStorageAdminResult,
>(
(moniker, storage_name, server_end,),
0x7807e6b4f623ace,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct RealmQueryEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for RealmQueryEventStream {}
impl futures::stream::FusedStream for RealmQueryEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RealmQueryEventStream {
type Item = Result<RealmQueryEvent, 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(RealmQueryEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RealmQueryEvent {}
impl RealmQueryEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<RealmQueryEvent, 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: <RealmQueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RealmQueryRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for RealmQueryRequestStream {}
impl futures::stream::FusedStream for RealmQueryRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RealmQueryRequestStream {
type Protocol = RealmQueryMarker;
type ControlHandle = RealmQueryControlHandle;
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 {
RealmQueryControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for RealmQueryRequestStream {
type Item = Result<RealmQueryRequest, 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 RealmQueryRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3496ca1e5a0c13a8 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RealmQueryGetInstanceRequest);
fidl::encoding::Decoder::decode_into::<RealmQueryGetInstanceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::GetInstance {
moniker: req.moniker,
responder: RealmQueryGetInstanceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x31a493d284a0bc1f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RealmQueryGetResolvedDeclarationRequest);
fidl::encoding::Decoder::decode_into::<RealmQueryGetResolvedDeclarationRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::GetResolvedDeclaration {
moniker: req.moniker,
responder: RealmQueryGetResolvedDeclarationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x640769a9f88685c7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RealmQueryGetManifestRequest);
fidl::encoding::Decoder::decode_into::<RealmQueryGetManifestRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::GetManifest {
moniker: req.moniker,
responder: RealmQueryGetManifestResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1ab1adf2a87d962d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RealmQueryResolveDeclarationRequest);
fidl::encoding::Decoder::decode_into::<RealmQueryResolveDeclarationRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::ResolveDeclaration {
parent: req.parent,
child_location: req.child_location,
url: req.url,
responder: RealmQueryResolveDeclarationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x16f88f6735bd204 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RealmQueryGetStructuredConfigRequest);
fidl::encoding::Decoder::decode_into::<RealmQueryGetStructuredConfigRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::GetStructuredConfig {
moniker: req.moniker,
responder: RealmQueryGetStructuredConfigResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7b5a8775d30cad47 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::GetAllInstances {
responder: RealmQueryGetAllInstancesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5ecb29c02c488eeb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RealmQueryConstructNamespaceRequest);
fidl::encoding::Decoder::decode_into::<RealmQueryConstructNamespaceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::ConstructNamespace {
moniker: req.moniker,
responder: RealmQueryConstructNamespaceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x42a5517b78cf410 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RealmQueryOpenRequest);
fidl::encoding::Decoder::decode_into::<RealmQueryOpenRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::Open {
moniker: req.moniker,
dir_type: req.dir_type,
flags: req.flags,
mode: req.mode,
path: req.path,
object: req.object,
responder: RealmQueryOpenResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7807e6b4f623ace => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RealmQueryConnectToStorageAdminRequest);
fidl::encoding::Decoder::decode_into::<RealmQueryConnectToStorageAdminRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::ConnectToStorageAdmin {
moniker: req.moniker,
storage_name: req.storage_name,
server_end: req.server_end,
responder: RealmQueryConnectToStorageAdminResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<RealmQueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum RealmQueryRequest {
GetInstance { moniker: String, responder: RealmQueryGetInstanceResponder },
GetResolvedDeclaration { moniker: String, responder: RealmQueryGetResolvedDeclarationResponder },
GetManifest { moniker: String, responder: RealmQueryGetManifestResponder },
ResolveDeclaration {
parent: String,
child_location: ChildLocation,
url: String,
responder: RealmQueryResolveDeclarationResponder,
},
GetStructuredConfig { moniker: String, responder: RealmQueryGetStructuredConfigResponder },
GetAllInstances { responder: RealmQueryGetAllInstancesResponder },
ConstructNamespace { moniker: String, responder: RealmQueryConstructNamespaceResponder },
Open {
moniker: String,
dir_type: OpenDirType,
flags: fidl_fuchsia_io::OpenFlags,
mode: fidl_fuchsia_io::ModeType,
path: String,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
responder: RealmQueryOpenResponder,
},
ConnectToStorageAdmin {
moniker: String,
storage_name: String,
server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
responder: RealmQueryConnectToStorageAdminResponder,
},
}
impl RealmQueryRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_instance(self) -> Option<(String, RealmQueryGetInstanceResponder)> {
if let RealmQueryRequest::GetInstance { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_resolved_declaration(
self,
) -> Option<(String, RealmQueryGetResolvedDeclarationResponder)> {
if let RealmQueryRequest::GetResolvedDeclaration { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_manifest(self) -> Option<(String, RealmQueryGetManifestResponder)> {
if let RealmQueryRequest::GetManifest { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_resolve_declaration(
self,
) -> Option<(String, ChildLocation, String, RealmQueryResolveDeclarationResponder)> {
if let RealmQueryRequest::ResolveDeclaration { parent, child_location, url, responder } =
self
{
Some((parent, child_location, url, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_structured_config(
self,
) -> Option<(String, RealmQueryGetStructuredConfigResponder)> {
if let RealmQueryRequest::GetStructuredConfig { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_all_instances(self) -> Option<(RealmQueryGetAllInstancesResponder)> {
if let RealmQueryRequest::GetAllInstances { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_construct_namespace(
self,
) -> Option<(String, RealmQueryConstructNamespaceResponder)> {
if let RealmQueryRequest::ConstructNamespace { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_open(
self,
) -> Option<(
String,
OpenDirType,
fidl_fuchsia_io::OpenFlags,
fidl_fuchsia_io::ModeType,
String,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
RealmQueryOpenResponder,
)> {
if let RealmQueryRequest::Open { moniker, dir_type, flags, mode, path, object, responder } =
self
{
Some((moniker, dir_type, flags, mode, path, object, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_connect_to_storage_admin(
self,
) -> Option<(
String,
String,
fidl::endpoints::ServerEnd<StorageAdminMarker>,
RealmQueryConnectToStorageAdminResponder,
)> {
if let RealmQueryRequest::ConnectToStorageAdmin {
moniker,
storage_name,
server_end,
responder,
} = self
{
Some((moniker, storage_name, server_end, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RealmQueryRequest::GetInstance { .. } => "get_instance",
RealmQueryRequest::GetResolvedDeclaration { .. } => "get_resolved_declaration",
RealmQueryRequest::GetManifest { .. } => "get_manifest",
RealmQueryRequest::ResolveDeclaration { .. } => "resolve_declaration",
RealmQueryRequest::GetStructuredConfig { .. } => "get_structured_config",
RealmQueryRequest::GetAllInstances { .. } => "get_all_instances",
RealmQueryRequest::ConstructNamespace { .. } => "construct_namespace",
RealmQueryRequest::Open { .. } => "open",
RealmQueryRequest::ConnectToStorageAdmin { .. } => "connect_to_storage_admin",
}
}
}
#[derive(Debug, Clone)]
pub struct RealmQueryControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for RealmQueryControlHandle {
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()
}
}
impl RealmQueryControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmQueryGetInstanceResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryGetInstanceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryGetInstanceResponder {
type ControlHandle = RealmQueryControlHandle;
fn control_handle(&self) -> &RealmQueryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmQueryGetInstanceResponder {
pub fn send(self, mut result: Result<&Instance, GetInstanceError>) -> 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<&Instance, GetInstanceError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&Instance, GetInstanceError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RealmQueryGetInstanceResponse,
GetInstanceError,
>>(
result.map(|instance| (instance,)),
self.tx_id,
0x3496ca1e5a0c13a8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmQueryGetResolvedDeclarationResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryGetResolvedDeclarationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryGetResolvedDeclarationResponder {
type ControlHandle = RealmQueryControlHandle;
fn control_handle(&self) -> &RealmQueryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmQueryGetResolvedDeclarationResponder {
pub fn send(
self,
mut result: Result<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
GetDeclarationError,
>,
) -> 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::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
GetDeclarationError,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
GetDeclarationError,
>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RealmQueryGetResolvedDeclarationResponse,
GetDeclarationError,
>>(
result.map(|iterator| (iterator,)),
self.tx_id,
0x31a493d284a0bc1f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmQueryGetManifestResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryGetManifestResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryGetManifestResponder {
type ControlHandle = RealmQueryControlHandle;
fn control_handle(&self) -> &RealmQueryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmQueryGetManifestResponder {
pub fn send(
self,
mut result: Result<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
GetDeclarationError,
>,
) -> 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::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
GetDeclarationError,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
GetDeclarationError,
>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RealmQueryGetManifestResponse,
GetDeclarationError,
>>(
result.map(|iterator| (iterator,)),
self.tx_id,
0x640769a9f88685c7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmQueryResolveDeclarationResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryResolveDeclarationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryResolveDeclarationResponder {
type ControlHandle = RealmQueryControlHandle;
fn control_handle(&self) -> &RealmQueryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmQueryResolveDeclarationResponder {
pub fn send(
self,
mut result: Result<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
GetDeclarationError,
>,
) -> 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::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
GetDeclarationError,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
GetDeclarationError,
>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RealmQueryResolveDeclarationResponse,
GetDeclarationError,
>>(
result.map(|iterator| (iterator,)),
self.tx_id,
0x1ab1adf2a87d962d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmQueryGetStructuredConfigResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryGetStructuredConfigResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryGetStructuredConfigResponder {
type ControlHandle = RealmQueryControlHandle;
fn control_handle(&self) -> &RealmQueryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmQueryGetStructuredConfigResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_component_decl::ResolvedConfig, GetStructuredConfigError>,
) -> 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_fuchsia_component_decl::ResolvedConfig, GetStructuredConfigError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_component_decl::ResolvedConfig, GetStructuredConfigError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RealmQueryGetStructuredConfigResponse,
GetStructuredConfigError,
>>(
result.map(|config| (config,)),
self.tx_id,
0x16f88f6735bd204,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmQueryGetAllInstancesResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryGetAllInstancesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryGetAllInstancesResponder {
type ControlHandle = RealmQueryControlHandle;
fn control_handle(&self) -> &RealmQueryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmQueryGetAllInstancesResponder {
pub fn send(
self,
mut result: Result<
fidl::endpoints::ClientEnd<InstanceIteratorMarker>,
GetAllInstancesError,
>,
) -> 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::endpoints::ClientEnd<InstanceIteratorMarker>,
GetAllInstancesError,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
fidl::endpoints::ClientEnd<InstanceIteratorMarker>,
GetAllInstancesError,
>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RealmQueryGetAllInstancesResponse,
GetAllInstancesError,
>>(
result.map(|iterator| (iterator,)),
self.tx_id,
0x7b5a8775d30cad47,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmQueryConstructNamespaceResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryConstructNamespaceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryConstructNamespaceResponder {
type ControlHandle = RealmQueryControlHandle;
fn control_handle(&self) -> &RealmQueryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmQueryConstructNamespaceResponder {
pub fn send(
self,
mut result: Result<
Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>,
ConstructNamespaceError,
>,
) -> 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<fidl_fuchsia_component_runner::ComponentNamespaceEntry>,
ConstructNamespaceError,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>,
ConstructNamespaceError,
>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RealmQueryConstructNamespaceResponse,
ConstructNamespaceError,
>>(
result.as_mut().map_err(|e| *e).map(|namespace| (namespace.as_mut_slice(),)),
self.tx_id,
0x5ecb29c02c488eeb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmQueryOpenResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryOpenResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryOpenResponder {
type ControlHandle = RealmQueryControlHandle;
fn control_handle(&self) -> &RealmQueryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmQueryOpenResponder {
pub fn send(self, mut result: Result<(), OpenError>) -> 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<(), OpenError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), OpenError>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>>(
result,
self.tx_id,
0x42a5517b78cf410,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmQueryConnectToStorageAdminResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryConnectToStorageAdminResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryConnectToStorageAdminResponder {
type ControlHandle = RealmQueryControlHandle;
fn control_handle(&self) -> &RealmQueryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmQueryConnectToStorageAdminResponder {
pub fn send(
self,
mut result: Result<(), ConnectToStorageAdminError>,
) -> 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<(), ConnectToStorageAdminError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), ConnectToStorageAdminError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
ConnectToStorageAdminError,
>>(
result,
self.tx_id,
0x7807e6b4f623ace,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RouteValidatorMarker;
impl fidl::endpoints::ProtocolMarker for RouteValidatorMarker {
type Proxy = RouteValidatorProxy;
type RequestStream = RouteValidatorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RouteValidatorSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.sys2.RouteValidator";
}
impl fidl::endpoints::DiscoverableProtocolMarker for RouteValidatorMarker {}
pub type RouteValidatorValidateResult = Result<Vec<RouteReport>, fidl_fuchsia_component::Error>;
pub type RouteValidatorRouteResult = Result<Vec<RouteReport>, RouteValidatorError>;
pub trait RouteValidatorProxyInterface: Send + Sync {
type ValidateResponseFut: std::future::Future<Output = Result<RouteValidatorValidateResult, fidl::Error>>
+ Send;
fn r#validate(&self, moniker: &str) -> Self::ValidateResponseFut;
type RouteResponseFut: std::future::Future<Output = Result<RouteValidatorRouteResult, fidl::Error>>
+ Send;
fn r#route(&self, moniker: &str, targets: &[RouteTarget]) -> Self::RouteResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RouteValidatorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RouteValidatorSynchronousProxy {
type Proxy = RouteValidatorProxy;
type Protocol = RouteValidatorMarker;
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 RouteValidatorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <RouteValidatorMarker 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::Time) -> Result<RouteValidatorEvent, fidl::Error> {
RouteValidatorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#validate(
&self,
mut moniker: &str,
___deadline: zx::Time,
) -> Result<RouteValidatorValidateResult, fidl::Error> {
let _response =
self.client.send_query::<RouteValidatorValidateRequest, fidl::encoding::ResultType<
RouteValidatorValidateResponse,
fidl_fuchsia_component::Error,
>>(
(moniker,),
0x3360b96d5f86cdf4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.reports))
}
pub fn r#route(
&self,
mut moniker: &str,
mut targets: &[RouteTarget],
___deadline: zx::Time,
) -> Result<RouteValidatorRouteResult, fidl::Error> {
let _response =
self.client.send_query::<RouteValidatorRouteRequest, fidl::encoding::ResultType<
RouteValidatorRouteResponse,
RouteValidatorError,
>>(
(moniker, targets),
0x51c9b268216d8239,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.reports))
}
}
#[derive(Debug, Clone)]
pub struct RouteValidatorProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for RouteValidatorProxy {
type Protocol = RouteValidatorMarker;
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 RouteValidatorProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <RouteValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RouteValidatorEventStream {
RouteValidatorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#validate(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<RouteValidatorValidateResult> {
RouteValidatorProxyInterface::r#validate(self, moniker)
}
pub fn r#route(
&self,
mut moniker: &str,
mut targets: &[RouteTarget],
) -> fidl::client::QueryResponseFut<RouteValidatorRouteResult> {
RouteValidatorProxyInterface::r#route(self, moniker, targets)
}
}
impl RouteValidatorProxyInterface for RouteValidatorProxy {
type ValidateResponseFut = fidl::client::QueryResponseFut<RouteValidatorValidateResult>;
fn r#validate(&self, mut moniker: &str) -> Self::ValidateResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RouteValidatorValidateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RouteValidatorValidateResponse,
fidl_fuchsia_component::Error,
>,
0x3360b96d5f86cdf4,
>(_buf?)?;
Ok(_response.map(|x| x.reports))
}
self.client
.send_query_and_decode::<RouteValidatorValidateRequest, RouteValidatorValidateResult>(
(moniker,),
0x3360b96d5f86cdf4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RouteResponseFut = fidl::client::QueryResponseFut<RouteValidatorRouteResult>;
fn r#route(&self, mut moniker: &str, mut targets: &[RouteTarget]) -> Self::RouteResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<RouteValidatorRouteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RouteValidatorRouteResponse, RouteValidatorError>,
0x51c9b268216d8239,
>(_buf?)?;
Ok(_response.map(|x| x.reports))
}
self.client.send_query_and_decode::<RouteValidatorRouteRequest, RouteValidatorRouteResult>(
(moniker, targets),
0x51c9b268216d8239,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct RouteValidatorEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for RouteValidatorEventStream {}
impl futures::stream::FusedStream for RouteValidatorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RouteValidatorEventStream {
type Item = Result<RouteValidatorEvent, 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(RouteValidatorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RouteValidatorEvent {}
impl RouteValidatorEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<RouteValidatorEvent, 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:
<RouteValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RouteValidatorRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for RouteValidatorRequestStream {}
impl futures::stream::FusedStream for RouteValidatorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RouteValidatorRequestStream {
type Protocol = RouteValidatorMarker;
type ControlHandle = RouteValidatorControlHandle;
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 {
RouteValidatorControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for RouteValidatorRequestStream {
type Item = Result<RouteValidatorRequest, 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 RouteValidatorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3360b96d5f86cdf4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RouteValidatorValidateRequest);
fidl::encoding::Decoder::decode_into::<RouteValidatorValidateRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RouteValidatorControlHandle { inner: this.inner.clone() };
Ok(RouteValidatorRequest::Validate {
moniker: req.moniker,
responder: RouteValidatorValidateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x51c9b268216d8239 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RouteValidatorRouteRequest);
fidl::encoding::Decoder::decode_into::<RouteValidatorRouteRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = RouteValidatorControlHandle { inner: this.inner.clone() };
Ok(RouteValidatorRequest::Route {
moniker: req.moniker,
targets: req.targets,
responder: RouteValidatorRouteResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<RouteValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum RouteValidatorRequest {
Validate { moniker: String, responder: RouteValidatorValidateResponder },
Route { moniker: String, targets: Vec<RouteTarget>, responder: RouteValidatorRouteResponder },
}
impl RouteValidatorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_validate(self) -> Option<(String, RouteValidatorValidateResponder)> {
if let RouteValidatorRequest::Validate { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_route(self) -> Option<(String, Vec<RouteTarget>, RouteValidatorRouteResponder)> {
if let RouteValidatorRequest::Route { moniker, targets, responder } = self {
Some((moniker, targets, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RouteValidatorRequest::Validate { .. } => "validate",
RouteValidatorRequest::Route { .. } => "route",
}
}
}
#[derive(Debug, Clone)]
pub struct RouteValidatorControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for RouteValidatorControlHandle {
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()
}
}
impl RouteValidatorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RouteValidatorValidateResponder {
control_handle: std::mem::ManuallyDrop<RouteValidatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RouteValidatorValidateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RouteValidatorValidateResponder {
type ControlHandle = RouteValidatorControlHandle;
fn control_handle(&self) -> &RouteValidatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RouteValidatorValidateResponder {
pub fn send(
self,
mut result: Result<&[RouteReport], fidl_fuchsia_component::Error>,
) -> 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<&[RouteReport], fidl_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[RouteReport], fidl_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RouteValidatorValidateResponse,
fidl_fuchsia_component::Error,
>>(
result.map(|reports| (reports,)),
self.tx_id,
0x3360b96d5f86cdf4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RouteValidatorRouteResponder {
control_handle: std::mem::ManuallyDrop<RouteValidatorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RouteValidatorRouteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RouteValidatorRouteResponder {
type ControlHandle = RouteValidatorControlHandle;
fn control_handle(&self) -> &RouteValidatorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RouteValidatorRouteResponder {
pub fn send(
self,
mut result: Result<&[RouteReport], RouteValidatorError>,
) -> 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<&[RouteReport], RouteValidatorError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[RouteReport], RouteValidatorError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RouteValidatorRouteResponse,
RouteValidatorError,
>>(
result.map(|reports| (reports,)),
self.tx_id,
0x51c9b268216d8239,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct StorageAdminMarker;
impl fidl::endpoints::ProtocolMarker for StorageAdminMarker {
type Proxy = StorageAdminProxy;
type RequestStream = StorageAdminRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = StorageAdminSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.sys2.StorageAdmin";
}
impl fidl::endpoints::DiscoverableProtocolMarker for StorageAdminMarker {}
pub type StorageAdminListStorageInRealmResult = Result<(), fidl_fuchsia_component::Error>;
pub type StorageAdminOpenComponentStorageByIdResult = Result<(), fidl_fuchsia_component::Error>;
pub type StorageAdminDeleteComponentStorageResult = Result<(), fidl_fuchsia_component::Error>;
pub type StorageAdminGetStatusResult = Result<StorageStatus, StatusError>;
pub type StorageAdminDeleteAllStorageContentsResult = Result<(), DeletionError>;
pub trait StorageAdminProxyInterface: Send + Sync {
fn r#open_component_storage(
&self,
relative_moniker: &str,
flags: fidl_fuchsia_io::OpenFlags,
mode: fidl_fuchsia_io::ModeType,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error>;
type ListStorageInRealmResponseFut: std::future::Future<Output = Result<StorageAdminListStorageInRealmResult, fidl::Error>>
+ Send;
fn r#list_storage_in_realm(
&self,
relative_moniker: &str,
iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
) -> Self::ListStorageInRealmResponseFut;
type OpenComponentStorageByIdResponseFut: std::future::Future<
Output = Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error>,
> + Send;
fn r#open_component_storage_by_id(
&self,
id: &str,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Self::OpenComponentStorageByIdResponseFut;
type DeleteComponentStorageResponseFut: std::future::Future<Output = Result<StorageAdminDeleteComponentStorageResult, fidl::Error>>
+ Send;
fn r#delete_component_storage(
&self,
relative_moniker: &str,
) -> Self::DeleteComponentStorageResponseFut;
type GetStatusResponseFut: std::future::Future<Output = Result<StorageAdminGetStatusResult, fidl::Error>>
+ Send;
fn r#get_status(&self) -> Self::GetStatusResponseFut;
type DeleteAllStorageContentsResponseFut: std::future::Future<
Output = Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error>,
> + Send;
fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct StorageAdminSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for StorageAdminSynchronousProxy {
type Proxy = StorageAdminProxy;
type Protocol = StorageAdminMarker;
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 StorageAdminSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <StorageAdminMarker 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::Time) -> Result<StorageAdminEvent, fidl::Error> {
StorageAdminEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#open_component_storage(
&self,
mut relative_moniker: &str,
mut flags: fidl_fuchsia_io::OpenFlags,
mut mode: fidl_fuchsia_io::ModeType,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<StorageAdminOpenComponentStorageRequest>(
(relative_moniker, flags, mode, object),
0x3e0295bd35836b1d,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#list_storage_in_realm(
&self,
mut relative_moniker: &str,
mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
___deadline: zx::Time,
) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
let _response = self
.client
.send_query::<StorageAdminListStorageInRealmRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>>(
(relative_moniker, iterator),
0x764f6d1f083e8bfb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#open_component_storage_by_id(
&self,
mut id: &str,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
___deadline: zx::Time,
) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
let _response = self
.client
.send_query::<StorageAdminOpenComponentStorageByIdRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>>(
(id, object),
0x4802102cc55d5df1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#delete_component_storage(
&self,
mut relative_moniker: &str,
___deadline: zx::Time,
) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
let _response = self
.client
.send_query::<StorageAdminDeleteComponentStorageRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>>(
(relative_moniker,),
0x1677c1cdfcdbf45a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_status(
&self,
___deadline: zx::Time,
) -> Result<StorageAdminGetStatusResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<StorageStatus, StatusError>,
>(
(),
0x7729e325a6c526c8,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#delete_all_storage_contents(
&self,
___deadline: zx::Time,
) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
>(
(),
0x2ee980b4b2d24adb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct StorageAdminProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for StorageAdminProxy {
type Protocol = StorageAdminMarker;
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 StorageAdminProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> StorageAdminEventStream {
StorageAdminEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#open_component_storage(
&self,
mut relative_moniker: &str,
mut flags: fidl_fuchsia_io::OpenFlags,
mut mode: fidl_fuchsia_io::ModeType,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error> {
StorageAdminProxyInterface::r#open_component_storage(
self,
relative_moniker,
flags,
mode,
object,
)
}
pub fn r#list_storage_in_realm(
&self,
mut relative_moniker: &str,
mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
) -> fidl::client::QueryResponseFut<StorageAdminListStorageInRealmResult> {
StorageAdminProxyInterface::r#list_storage_in_realm(self, relative_moniker, iterator)
}
pub fn r#open_component_storage_by_id(
&self,
mut id: &str,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> fidl::client::QueryResponseFut<StorageAdminOpenComponentStorageByIdResult> {
StorageAdminProxyInterface::r#open_component_storage_by_id(self, id, object)
}
pub fn r#delete_component_storage(
&self,
mut relative_moniker: &str,
) -> fidl::client::QueryResponseFut<StorageAdminDeleteComponentStorageResult> {
StorageAdminProxyInterface::r#delete_component_storage(self, relative_moniker)
}
pub fn r#get_status(&self) -> fidl::client::QueryResponseFut<StorageAdminGetStatusResult> {
StorageAdminProxyInterface::r#get_status(self)
}
pub fn r#delete_all_storage_contents(
&self,
) -> fidl::client::QueryResponseFut<StorageAdminDeleteAllStorageContentsResult> {
StorageAdminProxyInterface::r#delete_all_storage_contents(self)
}
}
impl StorageAdminProxyInterface for StorageAdminProxy {
fn r#open_component_storage(
&self,
mut relative_moniker: &str,
mut flags: fidl_fuchsia_io::OpenFlags,
mut mode: fidl_fuchsia_io::ModeType,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<StorageAdminOpenComponentStorageRequest>(
(relative_moniker, flags, mode, object),
0x3e0295bd35836b1d,
fidl::encoding::DynamicFlags::empty(),
)
}
type ListStorageInRealmResponseFut =
fidl::client::QueryResponseFut<StorageAdminListStorageInRealmResult>;
fn r#list_storage_in_realm(
&self,
mut relative_moniker: &str,
mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
) -> Self::ListStorageInRealmResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>,
0x764f6d1f083e8bfb,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
StorageAdminListStorageInRealmRequest,
StorageAdminListStorageInRealmResult,
>(
(relative_moniker, iterator,),
0x764f6d1f083e8bfb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type OpenComponentStorageByIdResponseFut =
fidl::client::QueryResponseFut<StorageAdminOpenComponentStorageByIdResult>;
fn r#open_component_storage_by_id(
&self,
mut id: &str,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Self::OpenComponentStorageByIdResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>,
0x4802102cc55d5df1,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
StorageAdminOpenComponentStorageByIdRequest,
StorageAdminOpenComponentStorageByIdResult,
>(
(id, object,),
0x4802102cc55d5df1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DeleteComponentStorageResponseFut =
fidl::client::QueryResponseFut<StorageAdminDeleteComponentStorageResult>;
fn r#delete_component_storage(
&self,
mut relative_moniker: &str,
) -> Self::DeleteComponentStorageResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>,
0x1677c1cdfcdbf45a,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
StorageAdminDeleteComponentStorageRequest,
StorageAdminDeleteComponentStorageResult,
>(
(relative_moniker,),
0x1677c1cdfcdbf45a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetStatusResponseFut = fidl::client::QueryResponseFut<StorageAdminGetStatusResult>;
fn r#get_status(&self) -> Self::GetStatusResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminGetStatusResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<StorageStatus, StatusError>,
0x7729e325a6c526c8,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, StorageAdminGetStatusResult>(
(),
0x7729e325a6c526c8,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DeleteAllStorageContentsResponseFut =
fidl::client::QueryResponseFut<StorageAdminDeleteAllStorageContentsResult>;
fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
0x2ee980b4b2d24adb,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
StorageAdminDeleteAllStorageContentsResult,
>(
(),
0x2ee980b4b2d24adb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct StorageAdminEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for StorageAdminEventStream {}
impl futures::stream::FusedStream for StorageAdminEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for StorageAdminEventStream {
type Item = Result<StorageAdminEvent, 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(StorageAdminEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum StorageAdminEvent {}
impl StorageAdminEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<StorageAdminEvent, 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: <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct StorageAdminRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for StorageAdminRequestStream {}
impl futures::stream::FusedStream for StorageAdminRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for StorageAdminRequestStream {
type Protocol = StorageAdminMarker;
type ControlHandle = StorageAdminControlHandle;
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 {
StorageAdminControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for StorageAdminRequestStream {
type Item = Result<StorageAdminRequest, 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 StorageAdminRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3e0295bd35836b1d => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(StorageAdminOpenComponentStorageRequest);
fidl::encoding::Decoder::decode_into::<StorageAdminOpenComponentStorageRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = StorageAdminControlHandle { inner: this.inner.clone() };
Ok(StorageAdminRequest::OpenComponentStorage {
relative_moniker: req.relative_moniker,
flags: req.flags,
mode: req.mode,
object: req.object,
control_handle,
})
}
0x764f6d1f083e8bfb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(StorageAdminListStorageInRealmRequest);
fidl::encoding::Decoder::decode_into::<StorageAdminListStorageInRealmRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = StorageAdminControlHandle { inner: this.inner.clone() };
Ok(StorageAdminRequest::ListStorageInRealm {
relative_moniker: req.relative_moniker,
iterator: req.iterator,
responder: StorageAdminListStorageInRealmResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4802102cc55d5df1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(StorageAdminOpenComponentStorageByIdRequest);
fidl::encoding::Decoder::decode_into::<
StorageAdminOpenComponentStorageByIdRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = StorageAdminControlHandle { inner: this.inner.clone() };
Ok(StorageAdminRequest::OpenComponentStorageById {
id: req.id,
object: req.object,
responder: StorageAdminOpenComponentStorageByIdResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1677c1cdfcdbf45a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(StorageAdminDeleteComponentStorageRequest);
fidl::encoding::Decoder::decode_into::<
StorageAdminDeleteComponentStorageRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = StorageAdminControlHandle { inner: this.inner.clone() };
Ok(StorageAdminRequest::DeleteComponentStorage {
relative_moniker: req.relative_moniker,
responder: StorageAdminDeleteComponentStorageResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7729e325a6c526c8 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = StorageAdminControlHandle { inner: this.inner.clone() };
Ok(StorageAdminRequest::GetStatus {
responder: StorageAdminGetStatusResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2ee980b4b2d24adb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = StorageAdminControlHandle { inner: this.inner.clone() };
Ok(StorageAdminRequest::DeleteAllStorageContents {
responder: StorageAdminDeleteAllStorageContentsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum StorageAdminRequest {
OpenComponentStorage {
relative_moniker: String,
flags: fidl_fuchsia_io::OpenFlags,
mode: fidl_fuchsia_io::ModeType,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
control_handle: StorageAdminControlHandle,
},
ListStorageInRealm {
relative_moniker: String,
iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
responder: StorageAdminListStorageInRealmResponder,
},
OpenComponentStorageById {
id: String,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
responder: StorageAdminOpenComponentStorageByIdResponder,
},
DeleteComponentStorage {
relative_moniker: String,
responder: StorageAdminDeleteComponentStorageResponder,
},
GetStatus { responder: StorageAdminGetStatusResponder },
DeleteAllStorageContents { responder: StorageAdminDeleteAllStorageContentsResponder },
}
impl StorageAdminRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_open_component_storage(
self,
) -> Option<(
String,
fidl_fuchsia_io::OpenFlags,
fidl_fuchsia_io::ModeType,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
StorageAdminControlHandle,
)> {
if let StorageAdminRequest::OpenComponentStorage {
relative_moniker,
flags,
mode,
object,
control_handle,
} = self
{
Some((relative_moniker, flags, mode, object, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_storage_in_realm(
self,
) -> Option<(
String,
fidl::endpoints::ServerEnd<StorageIteratorMarker>,
StorageAdminListStorageInRealmResponder,
)> {
if let StorageAdminRequest::ListStorageInRealm { relative_moniker, iterator, responder } =
self
{
Some((relative_moniker, iterator, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_open_component_storage_by_id(
self,
) -> Option<(
String,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
StorageAdminOpenComponentStorageByIdResponder,
)> {
if let StorageAdminRequest::OpenComponentStorageById { id, object, responder } = self {
Some((id, object, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_delete_component_storage(
self,
) -> Option<(String, StorageAdminDeleteComponentStorageResponder)> {
if let StorageAdminRequest::DeleteComponentStorage { relative_moniker, responder } = self {
Some((relative_moniker, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_status(self) -> Option<(StorageAdminGetStatusResponder)> {
if let StorageAdminRequest::GetStatus { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_delete_all_storage_contents(
self,
) -> Option<(StorageAdminDeleteAllStorageContentsResponder)> {
if let StorageAdminRequest::DeleteAllStorageContents { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
StorageAdminRequest::OpenComponentStorage { .. } => "open_component_storage",
StorageAdminRequest::ListStorageInRealm { .. } => "list_storage_in_realm",
StorageAdminRequest::OpenComponentStorageById { .. } => "open_component_storage_by_id",
StorageAdminRequest::DeleteComponentStorage { .. } => "delete_component_storage",
StorageAdminRequest::GetStatus { .. } => "get_status",
StorageAdminRequest::DeleteAllStorageContents { .. } => "delete_all_storage_contents",
}
}
}
#[derive(Debug, Clone)]
pub struct StorageAdminControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for StorageAdminControlHandle {
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()
}
}
impl StorageAdminControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StorageAdminListStorageInRealmResponder {
control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StorageAdminListStorageInRealmResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StorageAdminListStorageInRealmResponder {
type ControlHandle = StorageAdminControlHandle;
fn control_handle(&self) -> &StorageAdminControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StorageAdminListStorageInRealmResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_component::Error>,
) -> 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_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>>(
result,
self.tx_id,
0x764f6d1f083e8bfb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StorageAdminOpenComponentStorageByIdResponder {
control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StorageAdminOpenComponentStorageByIdResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StorageAdminOpenComponentStorageByIdResponder {
type ControlHandle = StorageAdminControlHandle;
fn control_handle(&self) -> &StorageAdminControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StorageAdminOpenComponentStorageByIdResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_component::Error>,
) -> 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_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>>(
result,
self.tx_id,
0x4802102cc55d5df1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StorageAdminDeleteComponentStorageResponder {
control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StorageAdminDeleteComponentStorageResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StorageAdminDeleteComponentStorageResponder {
type ControlHandle = StorageAdminControlHandle;
fn control_handle(&self) -> &StorageAdminControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StorageAdminDeleteComponentStorageResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_component::Error>,
) -> 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_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_component::Error>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>>(
result,
self.tx_id,
0x1677c1cdfcdbf45a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StorageAdminGetStatusResponder {
control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StorageAdminGetStatusResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StorageAdminGetStatusResponder {
type ControlHandle = StorageAdminControlHandle;
fn control_handle(&self) -> &StorageAdminControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StorageAdminGetStatusResponder {
pub fn send(self, mut result: Result<&StorageStatus, StatusError>) -> 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<&StorageStatus, StatusError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<StorageStatus, StatusError>>(
result,
self.tx_id,
0x7729e325a6c526c8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StorageAdminDeleteAllStorageContentsResponder {
control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StorageAdminDeleteAllStorageContentsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StorageAdminDeleteAllStorageContentsResponder {
type ControlHandle = StorageAdminControlHandle;
fn control_handle(&self) -> &StorageAdminControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StorageAdminDeleteAllStorageContentsResponder {
pub fn send(self, mut result: Result<(), DeletionError>) -> 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<(), DeletionError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
DeletionError,
>>(
result,
self.tx_id,
0x2ee980b4b2d24adb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct StorageIteratorMarker;
impl fidl::endpoints::ProtocolMarker for StorageIteratorMarker {
type Proxy = StorageIteratorProxy;
type RequestStream = StorageIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = StorageIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) StorageIterator";
}
pub trait StorageIteratorProxyInterface: Send + Sync {
type NextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
fn r#next(&self) -> Self::NextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct StorageIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for StorageIteratorSynchronousProxy {
type Proxy = StorageIteratorProxy;
type Protocol = StorageIteratorMarker;
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 StorageIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <StorageIteratorMarker 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::Time) -> Result<StorageIteratorEvent, fidl::Error> {
StorageIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(&self, ___deadline: zx::Time) -> Result<Vec<String>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, StorageIteratorNextResponse>(
(),
0x7a6b21f15fd01b72,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.relative_monikers)
}
}
#[derive(Debug, Clone)]
pub struct StorageIteratorProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for StorageIteratorProxy {
type Protocol = StorageIteratorMarker;
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 StorageIteratorProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> StorageIteratorEventStream {
StorageIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#next(&self) -> fidl::client::QueryResponseFut<Vec<String>> {
StorageIteratorProxyInterface::r#next(self)
}
}
impl StorageIteratorProxyInterface for StorageIteratorProxy {
type NextResponseFut = fidl::client::QueryResponseFut<Vec<String>>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<Vec<String>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StorageIteratorNextResponse,
0x7a6b21f15fd01b72,
>(_buf?)?;
Ok(_response.relative_monikers)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
(),
0x7a6b21f15fd01b72,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct StorageIteratorEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for StorageIteratorEventStream {}
impl futures::stream::FusedStream for StorageIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for StorageIteratorEventStream {
type Item = Result<StorageIteratorEvent, 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(StorageIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum StorageIteratorEvent {}
impl StorageIteratorEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<StorageIteratorEvent, 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:
<StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct StorageIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for StorageIteratorRequestStream {}
impl futures::stream::FusedStream for StorageIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for StorageIteratorRequestStream {
type Protocol = StorageIteratorMarker;
type ControlHandle = StorageIteratorControlHandle;
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 {
StorageIteratorControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for StorageIteratorRequestStream {
type Item = Result<StorageIteratorRequest, 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 StorageIteratorRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x7a6b21f15fd01b72 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = StorageIteratorControlHandle { inner: this.inner.clone() };
Ok(StorageIteratorRequest::Next {
responder: StorageIteratorNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum StorageIteratorRequest {
Next { responder: StorageIteratorNextResponder },
}
impl StorageIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_next(self) -> Option<(StorageIteratorNextResponder)> {
if let StorageIteratorRequest::Next { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
StorageIteratorRequest::Next { .. } => "next",
}
}
}
#[derive(Debug, Clone)]
pub struct StorageIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for StorageIteratorControlHandle {
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()
}
}
impl StorageIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StorageIteratorNextResponder {
control_handle: std::mem::ManuallyDrop<StorageIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StorageIteratorNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StorageIteratorNextResponder {
type ControlHandle = StorageIteratorControlHandle;
fn control_handle(&self) -> &StorageIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StorageIteratorNextResponder {
pub fn send(self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(relative_monikers);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut relative_monikers: &[String],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(relative_monikers);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StorageIteratorNextResponse>(
(relative_monikers,),
self.tx_id,
0x7a6b21f15fd01b72,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SystemControllerMarker;
impl fidl::endpoints::ProtocolMarker for SystemControllerMarker {
type Proxy = SystemControllerProxy;
type RequestStream = SystemControllerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SystemControllerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.sys2.SystemController";
}
impl fidl::endpoints::DiscoverableProtocolMarker for SystemControllerMarker {}
pub trait SystemControllerProxyInterface: Send + Sync {
type ShutdownResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#shutdown(&self) -> Self::ShutdownResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SystemControllerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SystemControllerSynchronousProxy {
type Proxy = SystemControllerProxy;
type Protocol = SystemControllerMarker;
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 SystemControllerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SystemControllerMarker 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::Time) -> Result<SystemControllerEvent, fidl::Error> {
SystemControllerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#shutdown(&self, ___deadline: zx::Time) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x25f56c938344e549,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct SystemControllerProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for SystemControllerProxy {
type Protocol = SystemControllerMarker;
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 SystemControllerProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <SystemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SystemControllerEventStream {
SystemControllerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#shutdown(&self) -> fidl::client::QueryResponseFut<()> {
SystemControllerProxyInterface::r#shutdown(self)
}
}
impl SystemControllerProxyInterface for SystemControllerProxy {
type ShutdownResponseFut = fidl::client::QueryResponseFut<()>;
fn r#shutdown(&self) -> Self::ShutdownResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
0x25f56c938344e549,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x25f56c938344e549,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct SystemControllerEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for SystemControllerEventStream {}
impl futures::stream::FusedStream for SystemControllerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SystemControllerEventStream {
type Item = Result<SystemControllerEvent, 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(SystemControllerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SystemControllerEvent {}
impl SystemControllerEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<SystemControllerEvent, 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:
<SystemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SystemControllerRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for SystemControllerRequestStream {}
impl futures::stream::FusedStream for SystemControllerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SystemControllerRequestStream {
type Protocol = SystemControllerMarker;
type ControlHandle = SystemControllerControlHandle;
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 {
SystemControllerControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for SystemControllerRequestStream {
type Item = Result<SystemControllerRequest, 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 SystemControllerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x25f56c938344e549 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle =
SystemControllerControlHandle { inner: this.inner.clone() };
Ok(SystemControllerRequest::Shutdown {
responder: SystemControllerShutdownResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<SystemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum SystemControllerRequest {
Shutdown { responder: SystemControllerShutdownResponder },
}
impl SystemControllerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_shutdown(self) -> Option<(SystemControllerShutdownResponder)> {
if let SystemControllerRequest::Shutdown { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SystemControllerRequest::Shutdown { .. } => "shutdown",
}
}
}
#[derive(Debug, Clone)]
pub struct SystemControllerControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for SystemControllerControlHandle {
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()
}
}
impl SystemControllerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SystemControllerShutdownResponder {
control_handle: std::mem::ManuallyDrop<SystemControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SystemControllerShutdownResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SystemControllerShutdownResponder {
type ControlHandle = SystemControllerControlHandle;
fn control_handle(&self) -> &SystemControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SystemControllerShutdownResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x25f56c938344e549,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for ConnectToStorageAdminError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ConnectToStorageAdminError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for ConnectToStorageAdminError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ConnectToStorageAdminError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ConstructNamespaceError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ConstructNamespaceError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for ConstructNamespaceError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ConstructNamespaceError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for CreateError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for CreateError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for CreateError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CreateError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeclType {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for DeclType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for DeclType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeclType {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeletionError {
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 DeletionError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for DeletionError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeletionError {
#[inline(always)]
fn new_empty() -> Self {
Self::Connection
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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 DestroyError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for DestroyError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for DestroyError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DestroyError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for GetAllInstancesError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for GetAllInstancesError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for GetAllInstancesError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for GetAllInstancesError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for GetDeclarationError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for GetDeclarationError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for GetDeclarationError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for GetDeclarationError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for GetInstanceError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for GetInstanceError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for GetInstanceError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for GetInstanceError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for GetStructuredConfigError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for GetStructuredConfigError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for GetStructuredConfigError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for GetStructuredConfigError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for OpenDirType {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for OpenDirType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for OpenDirType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for OpenDirType {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for OpenError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for OpenError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for OpenError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for OpenError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for RealmQueryError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ResolveError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ResolveError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for ResolveError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ResolveError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RouteValidatorError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for RouteValidatorError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for RouteValidatorError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RouteValidatorError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StartError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for StartError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for StartError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for StartError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StatusError {
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 StatusError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for StatusError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for StatusError {
#[inline(always)]
fn new_empty() -> Self {
Self::Provider
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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 StopError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for StopError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for StopError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for StopError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for UnresolveError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for UnresolveError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for UnresolveError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for UnresolveError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for CrashIntrospectFindComponentByThreadKoidRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for CrashIntrospectFindComponentByThreadKoidRequest {
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::Encode<CrashIntrospectFindComponentByThreadKoidRequest>
for &mut CrashIntrospectFindComponentByThreadKoidRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CrashIntrospectFindComponentByThreadKoidRequest).write_unaligned(
(self as *const CrashIntrospectFindComponentByThreadKoidRequest).read(),
);
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u64>>
fidl::encoding::Encode<CrashIntrospectFindComponentByThreadKoidRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CrashIntrospectFindComponentByThreadKoidRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { thread_koid: fidl::new_empty!(u64) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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(())
}
}
unsafe impl fidl::encoding::TypeMarker for CrashIntrospectFindComponentByThreadKoidResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for CrashIntrospectFindComponentByThreadKoidResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<CrashIntrospectFindComponentByThreadKoidResponse>
for &CrashIntrospectFindComponentByThreadKoidResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidResponse>(offset);
fidl::encoding::Encode::<CrashIntrospectFindComponentByThreadKoidResponse>::encode(
(<ComponentCrashInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<ComponentCrashInfo>>
fidl::encoding::Encode<CrashIntrospectFindComponentByThreadKoidResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for CrashIntrospectFindComponentByThreadKoidResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { info: fidl::new_empty!(ComponentCrashInfo) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(ComponentCrashInfo, &mut self.info, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InstanceIteratorNextResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for InstanceIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<InstanceIteratorNextResponse> for &InstanceIteratorNextResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InstanceIteratorNextResponse>(offset);
fidl::encoding::Encode::<InstanceIteratorNextResponse>::encode(
(
<fidl::encoding::UnboundedVector<Instance> as fidl::encoding::ValueTypeMarker>::borrow(&self.infos),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Instance>>>
fidl::encoding::Encode<InstanceIteratorNextResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InstanceIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for InstanceIteratorNextResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { infos: fidl::new_empty!(fidl::encoding::UnboundedVector<Instance>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<Instance>,
&mut self.infos,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for LifecycleControllerCreateInstanceRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for LifecycleControllerCreateInstanceRequest {
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::Encode<LifecycleControllerCreateInstanceRequest>
for &mut LifecycleControllerCreateInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerCreateInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerCreateInstanceRequest>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.parent_moniker),
<fidl_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
<fidl_fuchsia_component_decl::Child as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
<fidl_fuchsia_component::CreateChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
T1: fidl::encoding::Encode<fidl_fuchsia_component_decl::CollectionRef>,
T2: fidl::encoding::Encode<fidl_fuchsia_component_decl::Child>,
T3: fidl::encoding::Encode<fidl_fuchsia_component::CreateChildArgs>,
> fidl::encoding::Encode<LifecycleControllerCreateInstanceRequest> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerCreateInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
self.3.encode(encoder, offset + 48, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for LifecycleControllerCreateInstanceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent_moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
collection: fidl::new_empty!(fidl_fuchsia_component_decl::CollectionRef),
decl: fidl::new_empty!(fidl_fuchsia_component_decl::Child),
args: fidl::new_empty!(fidl_fuchsia_component::CreateChildArgs),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.parent_moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_component_decl::CollectionRef,
&mut self.collection,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl_fuchsia_component_decl::Child,
&mut self.decl,
decoder,
offset + 32,
_depth
)?;
fidl::decode!(
fidl_fuchsia_component::CreateChildArgs,
&mut self.args,
decoder,
offset + 48,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for LifecycleControllerDestroyInstanceRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for LifecycleControllerDestroyInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<LifecycleControllerDestroyInstanceRequest>
for &LifecycleControllerDestroyInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerDestroyInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerDestroyInstanceRequest>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.parent_moniker),
<fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
T1: fidl::encoding::Encode<fidl_fuchsia_component_decl::ChildRef>,
> fidl::encoding::Encode<LifecycleControllerDestroyInstanceRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerDestroyInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for LifecycleControllerDestroyInstanceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent_moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
child: fidl::new_empty!(fidl_fuchsia_component_decl::ChildRef),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.parent_moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_component_decl::ChildRef,
&mut self.child,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for LifecycleControllerResolveInstanceRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for LifecycleControllerResolveInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<LifecycleControllerResolveInstanceRequest>
for &LifecycleControllerResolveInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerResolveInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerResolveInstanceRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<LifecycleControllerResolveInstanceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerResolveInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for LifecycleControllerResolveInstanceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for LifecycleControllerStartInstanceRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for LifecycleControllerStartInstanceRequest {
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::Encode<LifecycleControllerStartInstanceRequest>
for &mut LifecycleControllerStartInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerStartInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerStartInstanceRequest>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.binder),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
>,
>,
> fidl::encoding::Encode<LifecycleControllerStartInstanceRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerStartInstanceRequest>(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 fidl::encoding::Decode<Self> for LifecycleControllerStartInstanceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
binder: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
>,
&mut self.binder,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for LifecycleControllerStopInstanceRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for LifecycleControllerStopInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<LifecycleControllerStopInstanceRequest>
for &LifecycleControllerStopInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerStopInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerStopInstanceRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<LifecycleControllerStopInstanceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerStopInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for LifecycleControllerStopInstanceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for LifecycleControllerUnresolveInstanceRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for LifecycleControllerUnresolveInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<LifecycleControllerUnresolveInstanceRequest>
for &LifecycleControllerUnresolveInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerUnresolveInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerUnresolveInstanceRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<LifecycleControllerUnresolveInstanceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerUnresolveInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for LifecycleControllerUnresolveInstanceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ManifestBytesIteratorNextResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for ManifestBytesIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ManifestBytesIteratorNextResponse>
for &ManifestBytesIteratorNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManifestBytesIteratorNextResponse>(offset);
fidl::encoding::Encode::<ManifestBytesIteratorNextResponse>::encode(
(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(
&self.infos,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>>>
fidl::encoding::Encode<ManifestBytesIteratorNextResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManifestBytesIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ManifestBytesIteratorNextResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { infos: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
&mut self.infos,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryConnectToStorageAdminRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for RealmQueryConnectToStorageAdminRequest {
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::Encode<RealmQueryConnectToStorageAdminRequest>
for &mut RealmQueryConnectToStorageAdminRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConnectToStorageAdminRequest>(offset);
fidl::encoding::Encode::<RealmQueryConnectToStorageAdminRequest>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(&self.storage_name),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<100>>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>>,
>,
> fidl::encoding::Encode<RealmQueryConnectToStorageAdminRequest> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConnectToStorageAdminRequest>(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> for RealmQueryConnectToStorageAdminRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
storage_name: fidl::new_empty!(fidl::encoding::BoundedString<100>),
server_end: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<100>,
&mut self.storage_name,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>>,
&mut self.server_end,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryConstructNamespaceRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryConstructNamespaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RealmQueryConstructNamespaceRequest>
for &RealmQueryConstructNamespaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConstructNamespaceRequest>(offset);
fidl::encoding::Encode::<RealmQueryConstructNamespaceRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<RealmQueryConstructNamespaceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConstructNamespaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryConstructNamespaceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryGetInstanceRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RealmQueryGetInstanceRequest> for &RealmQueryGetInstanceRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetInstanceRequest>(offset);
fidl::encoding::Encode::<RealmQueryGetInstanceRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<RealmQueryGetInstanceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryGetInstanceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryGetManifestRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetManifestRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RealmQueryGetManifestRequest> for &RealmQueryGetManifestRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetManifestRequest>(offset);
fidl::encoding::Encode::<RealmQueryGetManifestRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<RealmQueryGetManifestRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetManifestRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryGetManifestRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryGetResolvedDeclarationRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetResolvedDeclarationRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RealmQueryGetResolvedDeclarationRequest>
for &RealmQueryGetResolvedDeclarationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationRequest>(offset);
fidl::encoding::Encode::<RealmQueryGetResolvedDeclarationRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<RealmQueryGetResolvedDeclarationRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryGetResolvedDeclarationRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryGetStructuredConfigRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetStructuredConfigRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RealmQueryGetStructuredConfigRequest>
for &RealmQueryGetStructuredConfigRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetStructuredConfigRequest>(offset);
fidl::encoding::Encode::<RealmQueryGetStructuredConfigRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<RealmQueryGetStructuredConfigRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetStructuredConfigRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryGetStructuredConfigRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryOpenRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for RealmQueryOpenRequest {
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::Encode<RealmQueryOpenRequest> for &mut RealmQueryOpenRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryOpenRequest>(offset);
fidl::encoding::Encode::<RealmQueryOpenRequest>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.dir_type),
<fidl_fuchsia_io::OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
<fidl_fuchsia_io::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<fidl_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
T1: fidl::encoding::Encode<OpenDirType>,
T2: fidl::encoding::Encode<fidl_fuchsia_io::OpenFlags>,
T3: fidl::encoding::Encode<fidl_fuchsia_io::ModeType>,
T4: fidl::encoding::Encode<fidl::encoding::BoundedString<4095>>,
T5: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
>,
> fidl::encoding::Encode<RealmQueryOpenRequest> for (T0, T1, T2, T3, T4, T5)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryOpenRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
(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 + 20, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 32, depth)?;
self.5.encode(encoder, offset + 48, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryOpenRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
dir_type: fidl::new_empty!(OpenDirType),
flags: fidl::new_empty!(fidl_fuchsia_io::OpenFlags),
mode: fidl::new_empty!(fidl_fuchsia_io::ModeType),
path: fidl::new_empty!(fidl::encoding::BoundedString<4095>),
object: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
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 + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(OpenDirType, &mut self.dir_type, decoder, offset + 16, _depth)?;
fidl::decode!(
fidl_fuchsia_io::OpenFlags,
&mut self.flags,
decoder,
offset + 20,
_depth
)?;
fidl::decode!(fidl_fuchsia_io::ModeType, &mut self.mode, decoder, offset + 24, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<4095>,
&mut self.path,
decoder,
offset + 32,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
&mut self.object,
decoder,
offset + 48,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryResolveDeclarationRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryResolveDeclarationRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RealmQueryResolveDeclarationRequest>
for &RealmQueryResolveDeclarationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryResolveDeclarationRequest>(offset);
fidl::encoding::Encode::<RealmQueryResolveDeclarationRequest>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<ChildLocation as fidl::encoding::ValueTypeMarker>::borrow(&self.child_location),
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.url),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
T1: fidl::encoding::Encode<ChildLocation>,
T2: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
> fidl::encoding::Encode<RealmQueryResolveDeclarationRequest> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryResolveDeclarationRequest>(offset);
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> for RealmQueryResolveDeclarationRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
child_location: fidl::new_empty!(ChildLocation),
url: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.parent,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(ChildLocation, &mut self.child_location, decoder, offset + 16, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.url,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryConstructNamespaceResponse {
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
}
}
impl fidl::encoding::ResourceTypeMarker for RealmQueryConstructNamespaceResponse {
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::Encode<RealmQueryConstructNamespaceResponse>
for &mut RealmQueryConstructNamespaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConstructNamespaceResponse>(offset);
fidl::encoding::Encode::<RealmQueryConstructNamespaceResponse>::encode(
(<fidl::encoding::UnboundedVector<
fidl_fuchsia_component_runner::ComponentNamespaceEntry,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.namespace
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<
fidl_fuchsia_component_runner::ComponentNamespaceEntry,
>,
>,
> fidl::encoding::Encode<RealmQueryConstructNamespaceResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConstructNamespaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryConstructNamespaceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
namespace: fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl_fuchsia_component_runner::ComponentNamespaceEntry,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<
fidl_fuchsia_component_runner::ComponentNamespaceEntry,
>,
&mut self.namespace,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryGetAllInstancesResponse {
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::ResourceTypeMarker for RealmQueryGetAllInstancesResponse {
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::Encode<RealmQueryGetAllInstancesResponse>
for &mut RealmQueryGetAllInstancesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetAllInstancesResponse>(offset);
fidl::encoding::Encode::<RealmQueryGetAllInstancesResponse>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>>,
>,
> fidl::encoding::Encode<RealmQueryGetAllInstancesResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetAllInstancesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryGetAllInstancesResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>>,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryGetInstanceResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetInstanceResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RealmQueryGetInstanceResponse>
for &RealmQueryGetInstanceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetInstanceResponse>(offset);
fidl::encoding::Encode::<RealmQueryGetInstanceResponse>::encode(
(<Instance as fidl::encoding::ValueTypeMarker>::borrow(&self.instance),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Instance>>
fidl::encoding::Encode<RealmQueryGetInstanceResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetInstanceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryGetInstanceResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { instance: fidl::new_empty!(Instance) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Instance, &mut self.instance, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryGetManifestResponse {
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::ResourceTypeMarker for RealmQueryGetManifestResponse {
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::Encode<RealmQueryGetManifestResponse>
for &mut RealmQueryGetManifestResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetManifestResponse>(offset);
fidl::encoding::Encode::<RealmQueryGetManifestResponse>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
>,
> fidl::encoding::Encode<RealmQueryGetManifestResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetManifestResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryGetManifestResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryGetResolvedDeclarationResponse {
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::ResourceTypeMarker for RealmQueryGetResolvedDeclarationResponse {
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::Encode<RealmQueryGetResolvedDeclarationResponse>
for &mut RealmQueryGetResolvedDeclarationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationResponse>(offset);
fidl::encoding::Encode::<RealmQueryGetResolvedDeclarationResponse>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
>,
> fidl::encoding::Encode<RealmQueryGetResolvedDeclarationResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryGetResolvedDeclarationResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryGetStructuredConfigResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetStructuredConfigResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RealmQueryGetStructuredConfigResponse>
for &RealmQueryGetStructuredConfigResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetStructuredConfigResponse>(offset);
fidl::encoding::Encode::<RealmQueryGetStructuredConfigResponse>::encode(
(
<fidl_fuchsia_component_decl::ResolvedConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl_fuchsia_component_decl::ResolvedConfig>>
fidl::encoding::Encode<RealmQueryGetStructuredConfigResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetStructuredConfigResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryGetStructuredConfigResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { config: fidl::new_empty!(fidl_fuchsia_component_decl::ResolvedConfig) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_component_decl::ResolvedConfig,
&mut self.config,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryResolveDeclarationResponse {
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::ResourceTypeMarker for RealmQueryResolveDeclarationResponse {
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::Encode<RealmQueryResolveDeclarationResponse>
for &mut RealmQueryResolveDeclarationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryResolveDeclarationResponse>(offset);
fidl::encoding::Encode::<RealmQueryResolveDeclarationResponse>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
>,
> fidl::encoding::Encode<RealmQueryResolveDeclarationResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryResolveDeclarationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RealmQueryResolveDeclarationResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RouteTarget {
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
}
}
impl fidl::encoding::ValueTypeMarker for RouteTarget {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RouteTarget> for &RouteTarget {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteTarget>(offset);
fidl::encoding::Encode::<RouteTarget>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<DeclType as fidl::encoding::ValueTypeMarker>::borrow(&self.decl_type),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>>,
T1: fidl::encoding::Encode<DeclType>,
> fidl::encoding::Encode<RouteTarget> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteTarget>(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 fidl::encoding::Decode<Self> for RouteTarget {
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(fidl::encoding::BoundedString<255>),
decl_type: fidl::new_empty!(DeclType),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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>,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(DeclType, &mut self.decl_type, decoder, offset + 16, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RouteValidatorRouteRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for RouteValidatorRouteRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RouteValidatorRouteRequest> for &RouteValidatorRouteRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorRouteRequest>(offset);
fidl::encoding::Encode::<RouteValidatorRouteRequest>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<fidl::encoding::UnboundedVector<RouteTarget> as fidl::encoding::ValueTypeMarker>::borrow(&self.targets),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<RouteTarget>>,
> fidl::encoding::Encode<RouteValidatorRouteRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorRouteRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RouteValidatorRouteRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
targets: fidl::new_empty!(fidl::encoding::UnboundedVector<RouteTarget>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<RouteTarget>,
&mut self.targets,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RouteValidatorValidateRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for RouteValidatorValidateRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RouteValidatorValidateRequest>
for &RouteValidatorValidateRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorValidateRequest>(offset);
fidl::encoding::Encode::<RouteValidatorValidateRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<RouteValidatorValidateRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorValidateRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RouteValidatorValidateRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RouteValidatorRouteResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for RouteValidatorRouteResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RouteValidatorRouteResponse> for &RouteValidatorRouteResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorRouteResponse>(offset);
fidl::encoding::Encode::<RouteValidatorRouteResponse>::encode(
(
<fidl::encoding::UnboundedVector<RouteReport> as fidl::encoding::ValueTypeMarker>::borrow(&self.reports),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<RouteReport>>>
fidl::encoding::Encode<RouteValidatorRouteResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorRouteResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RouteValidatorRouteResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { reports: fidl::new_empty!(fidl::encoding::UnboundedVector<RouteReport>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<RouteReport>,
&mut self.reports,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RouteValidatorValidateResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for RouteValidatorValidateResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RouteValidatorValidateResponse>
for &RouteValidatorValidateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorValidateResponse>(offset);
fidl::encoding::Encode::<RouteValidatorValidateResponse>::encode(
(
<fidl::encoding::UnboundedVector<RouteReport> as fidl::encoding::ValueTypeMarker>::borrow(&self.reports),
),
encoder, offset, _depth
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<RouteReport>>>
fidl::encoding::Encode<RouteValidatorValidateResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorValidateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RouteValidatorValidateResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { reports: fidl::new_empty!(fidl::encoding::UnboundedVector<RouteReport>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<RouteReport>,
&mut self.reports,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StorageAdminDeleteComponentStorageRequest {
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
}
}
impl fidl::encoding::ValueTypeMarker for StorageAdminDeleteComponentStorageRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<StorageAdminDeleteComponentStorageRequest>
for &StorageAdminDeleteComponentStorageRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminDeleteComponentStorageRequest>(offset);
fidl::encoding::Encode::<StorageAdminDeleteComponentStorageRequest>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.relative_moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>>
fidl::encoding::Encode<StorageAdminDeleteComponentStorageRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminDeleteComponentStorageRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for StorageAdminDeleteComponentStorageRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { relative_moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
&mut self.relative_moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StorageAdminListStorageInRealmRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for StorageAdminListStorageInRealmRequest {
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::Encode<StorageAdminListStorageInRealmRequest>
for &mut StorageAdminListStorageInRealmRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
fidl::encoding::Encode::<StorageAdminListStorageInRealmRequest>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
>,
> fidl::encoding::Encode<StorageAdminListStorageInRealmRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(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 fidl::encoding::Decode<Self> for StorageAdminListStorageInRealmRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
relative_moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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<4096>,
&mut self.relative_moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
&mut self.iterator,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenComponentStorageByIdRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenComponentStorageByIdRequest {
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::Encode<StorageAdminOpenComponentStorageByIdRequest>
for &mut StorageAdminOpenComponentStorageByIdRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
fidl::encoding::Encode::<StorageAdminOpenComponentStorageByIdRequest>::encode(
(
<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
&self.id,
),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.object
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
>,
> fidl::encoding::Encode<StorageAdminOpenComponentStorageByIdRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(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 fidl::encoding::Decode<Self> for StorageAdminOpenComponentStorageByIdRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(fidl::encoding::BoundedString<64>),
object: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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<64>,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
&mut self.object,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenComponentStorageRequest {
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
}
}
impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenComponentStorageRequest {
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::Encode<StorageAdminOpenComponentStorageRequest>
for &mut StorageAdminOpenComponentStorageRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminOpenComponentStorageRequest>(offset);
fidl::encoding::Encode::<StorageAdminOpenComponentStorageRequest>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
<fidl_fuchsia_io::OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
<fidl_fuchsia_io::ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>>,
T1: fidl::encoding::Encode<fidl_fuchsia_io::OpenFlags>,
T2: fidl::encoding::Encode<fidl_fuchsia_io::ModeType>,
T3: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
>,
> fidl::encoding::Encode<StorageAdminOpenComponentStorageRequest> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminOpenComponentStorageRequest>(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 + 16, depth)?;
self.2.encode(encoder, offset + 20, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for StorageAdminOpenComponentStorageRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
relative_moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>),
flags: fidl::new_empty!(fidl_fuchsia_io::OpenFlags),
mode: fidl::new_empty!(fidl_fuchsia_io::ModeType),
object: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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!(
fidl::encoding::BoundedString<4096>,
&mut self.relative_moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_io::OpenFlags,
&mut self.flags,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(fidl_fuchsia_io::ModeType, &mut self.mode, decoder, offset + 20, _depth)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
&mut self.object,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StorageIteratorNextResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for StorageIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<StorageIteratorNextResponse> for &StorageIteratorNextResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageIteratorNextResponse>(offset);
fidl::encoding::Encode::<StorageIteratorNextResponse>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_monikers),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
>,
> fidl::encoding::Encode<StorageIteratorNextResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for StorageIteratorNextResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
relative_monikers: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
&mut self.relative_monikers,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl ComponentCrashInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.moniker {
return 2;
}
if let Some(_) = self.url {
return 1;
}
0
}
}
unsafe impl fidl::encoding::TypeMarker for ComponentCrashInfo {
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
}
}
impl fidl::encoding::ValueTypeMarker for ComponentCrashInfo {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ComponentCrashInfo> for &ComponentCrashInfo {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ComponentCrashInfo>(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::BoundedString<4096>>(
self.url.as_ref().map(<fidl::encoding::BoundedString<4096> 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::BoundedString<4096>>(
self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ComponentCrashInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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::BoundedString<4096> 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
.url
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<4096>));
fidl::decode!(
fidl::encoding::BoundedString<4096>,
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::BoundedString<4096> 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
.moniker
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<4096>));
fidl::decode!(
fidl::encoding::BoundedString<4096>,
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 ExecutionInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.start_reason {
return 1;
}
0
}
}
unsafe impl fidl::encoding::TypeMarker for ExecutionInfo {
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
}
}
impl fidl::encoding::ValueTypeMarker for ExecutionInfo {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ExecutionInfo> for &ExecutionInfo {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ExecutionInfo>(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::BoundedString<5000>>(
self.start_reason.as_ref().map(<fidl::encoding::BoundedString<5000> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ExecutionInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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::BoundedString<5000> 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
.start_reason
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<5000>));
fidl::decode!(
fidl::encoding::BoundedString<5000>,
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 Instance {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.environment {
return 5;
}
if let Some(_) = self.resolved_info {
return 4;
}
if let Some(_) = self.instance_id {
return 3;
}
if let Some(_) = self.url {
return 2;
}
if let Some(_) = self.moniker {
return 1;
}
0
}
}
unsafe impl fidl::encoding::TypeMarker for Instance {
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
}
}
impl fidl::encoding::ValueTypeMarker for Instance {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<Instance> for &Instance {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Instance>(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::BoundedString<4096>>(
self.moniker.as_ref().map(<fidl::encoding::BoundedString<4096> 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::BoundedString<4096>>(
self.url.as_ref().map(<fidl::encoding::BoundedString<4096> 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::<fidl::encoding::BoundedString<64>>(
self.instance_id.as_ref().map(
<fidl::encoding::BoundedString<64> 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::<ResolvedInfo>(
self.resolved_info
.as_ref()
.map(<ResolvedInfo 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::<fidl::encoding::BoundedString<4096>>(
self.environment.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for Instance {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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::BoundedString<4096> 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
.moniker
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<4096>));
fidl::decode!(
fidl::encoding::BoundedString<4096>,
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::BoundedString<4096> 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
.url
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<4096>));
fidl::decode!(
fidl::encoding::BoundedString<4096>,
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::BoundedString<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
.instance_id
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<64>));
fidl::decode!(
fidl::encoding::BoundedString<64>,
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 =
<ResolvedInfo 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.resolved_info.get_or_insert_with(|| fidl::new_empty!(ResolvedInfo));
fidl::decode!(ResolvedInfo, 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 = <fidl::encoding::BoundedString<4096> 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
.environment
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<4096>));
fidl::decode!(
fidl::encoding::BoundedString<4096>,
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 ResolvedInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.execution_info {
return 2;
}
if let Some(_) = self.resolved_url {
return 1;
}
0
}
}
unsafe impl fidl::encoding::TypeMarker for ResolvedInfo {
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
}
}
impl fidl::encoding::ValueTypeMarker for ResolvedInfo {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ResolvedInfo> for &ResolvedInfo {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ResolvedInfo>(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::BoundedString<4096>>(
self.resolved_url.as_ref().map(<fidl::encoding::BoundedString<4096> 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::<ExecutionInfo>(
self.execution_info
.as_ref()
.map(<ExecutionInfo as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ResolvedInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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::BoundedString<4096> 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
.resolved_url
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<4096>));
fidl::decode!(
fidl::encoding::BoundedString<4096>,
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 =
<ExecutionInfo 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.execution_info.get_or_insert_with(|| fidl::new_empty!(ExecutionInfo));
fidl::decode!(ExecutionInfo, 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 RouteError {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.summary {
return 1;
}
0
}
}
unsafe impl fidl::encoding::TypeMarker for RouteError {
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
}
}
impl fidl::encoding::ValueTypeMarker for RouteError {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RouteError> for &RouteError {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteError>(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::UnboundedString>(
self.summary.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RouteError {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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::UnboundedString 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
.summary
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString));
fidl::decode!(
fidl::encoding::UnboundedString,
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 RouteReport {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.service_instances {
return 5;
}
if let Some(_) = self.source_moniker {
return 4;
}
if let Some(_) = self.error {
return 3;
}
if let Some(_) = self.decl_type {
return 2;
}
if let Some(_) = self.capability {
return 1;
}
0
}
}
unsafe impl fidl::encoding::TypeMarker for RouteReport {
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
}
}
impl fidl::encoding::ValueTypeMarker for RouteReport {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<RouteReport> for &RouteReport {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteReport>(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::UnboundedString>(
self.capability.as_ref().map(
<fidl::encoding::UnboundedString 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::<DeclType>(
self.decl_type.as_ref().map(<DeclType 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::<RouteError>(
self.error.as_ref().map(<RouteError 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::<fidl::encoding::UnboundedString>(
self.source_moniker.as_ref().map(
<fidl::encoding::UnboundedString 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::<fidl::encoding::UnboundedVector<ServiceInstance>>(
self.service_instances.as_ref().map(<fidl::encoding::UnboundedVector<ServiceInstance> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RouteReport {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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::UnboundedString 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
.capability
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString));
fidl::decode!(
fidl::encoding::UnboundedString,
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 =
<DeclType 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.decl_type.get_or_insert_with(|| fidl::new_empty!(DeclType));
fidl::decode!(DeclType, 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 =
<RouteError 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.error.get_or_insert_with(|| fidl::new_empty!(RouteError));
fidl::decode!(RouteError, 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 =
<fidl::encoding::UnboundedString 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
.source_moniker
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString));
fidl::decode!(
fidl::encoding::UnboundedString,
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 = <fidl::encoding::UnboundedVector<ServiceInstance> 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.service_instances.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<ServiceInstance>)
});
fidl::decode!(
fidl::encoding::UnboundedVector<ServiceInstance>,
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 ServiceInstance {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.child_instance_name {
return 3;
}
if let Some(_) = self.child_name {
return 2;
}
if let Some(_) = self.instance_name {
return 1;
}
0
}
}
unsafe impl fidl::encoding::TypeMarker for ServiceInstance {
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
}
}
impl fidl::encoding::ValueTypeMarker for ServiceInstance {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ServiceInstance> for &ServiceInstance {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServiceInstance>(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::UnboundedString>(
self.instance_name.as_ref().map(
<fidl::encoding::UnboundedString 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::UnboundedString>(
self.child_name.as_ref().map(
<fidl::encoding::UnboundedString 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::<fidl::encoding::UnboundedString>(
self.child_instance_name.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ServiceInstance {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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::UnboundedString 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
.instance_name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString));
fidl::decode!(
fidl::encoding::UnboundedString,
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::UnboundedString 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
.child_name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString));
fidl::decode!(
fidl::encoding::UnboundedString,
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::UnboundedString 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
.child_instance_name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString));
fidl::decode!(
fidl::encoding::UnboundedString,
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 StorageStatus {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.used_size {
return 2;
}
if let Some(_) = self.total_size {
return 1;
}
0
}
}
unsafe impl fidl::encoding::TypeMarker for StorageStatus {
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
}
}
impl fidl::encoding::ValueTypeMarker for StorageStatus {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<StorageStatus> for &StorageStatus {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageStatus>(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>(
self.total_size.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>(
self.used_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for StorageStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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.total_size.get_or_insert_with(|| fidl::new_empty!(u64));
fidl::decode!(u64, 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.used_size.get_or_insert_with(|| fidl::new_empty!(u64));
fidl::decode!(u64, 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(())
}
}
unsafe impl fidl::encoding::TypeMarker for ChildLocation {
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
}
}
impl fidl::encoding::ValueTypeMarker for ChildLocation {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<ChildLocation> for &ChildLocation {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ChildLocation>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ChildLocation::Collection(ref val) => fidl::encoding::encode_in_envelope::<
fidl::encoding::BoundedString<255>,
>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
val,
),
encoder,
offset + 8,
_depth,
),
ChildLocation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl fidl::encoding::Decode<Self> for ChildLocation {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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::BoundedString<255> 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 ChildLocation::Collection(_) = self {
} else {
*self = ChildLocation::Collection(fidl::new_empty!(
fidl::encoding::BoundedString<255>
));
}
#[allow(irrefutable_let_patterns)]
if let ChildLocation::Collection(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = ChildLocation::__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(())
}
}
}