#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub 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 ConfigOverrideError {
InstanceNotFound,
BadMoniker,
InstanceNotResolved,
NoConfig,
KeyNotFound,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ConfigOverrideErrorUnknown {
() => {
_
};
}
impl ConfigOverrideError {
#[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),
5 => Some(Self::KeyNotFound),
_ => 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,
5 => Self::KeyNotFound,
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::KeyNotFound => 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 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,
EagerStartupForbidden,
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),
9 => Some(Self::EagerStartupForbidden),
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,
9 => Self::EagerStartupForbidden,
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::EagerStartupForbidden => 9,
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,
InstanceDestroyed,
#[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),
10 => Some(Self::InstanceDestroyed),
_ => 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,
10 => Self::InstanceDestroyed,
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::InstanceDestroyed => 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 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 RouteOutcome {
Success,
Void,
Failed,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! RouteOutcomeUnknown {
() => {
_
};
}
impl RouteOutcome {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Success),
2 => Some(Self::Void),
3 => Some(Self::Failed),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Success,
2 => Self::Void,
3 => Self::Failed,
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::Success => 1,
Self::Void => 2,
Self::Failed => 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 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,
InvalidArguments,
#[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),
7 => Some(Self::InvalidArguments),
_ => 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,
7 => Self::InvalidArguments,
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::InvalidArguments => 7,
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(Clone, Debug, PartialEq)]
pub struct ConfigOverrideSetStructuredConfigRequest {
pub moniker: String,
pub fields: Vec<fidl_fuchsia_component_decl::ConfigOverride>,
}
impl fidl::Persistable for ConfigOverrideSetStructuredConfigRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ConfigOverrideUnsetStructuredConfigRequest {
pub moniker: String,
}
impl fidl::Persistable for ConfigOverrideUnsetStructuredConfigRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CrashIntrospectFindComponentByThreadKoidRequest {
pub thread_koid: u64,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect>
for LifecycleControllerStartInstanceRequest
{
}
#[derive(Debug, PartialEq)]
pub struct LifecycleControllerStartInstanceWithArgsRequest {
pub moniker: String,
pub binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
pub args: fidl_fuchsia_component::StartChildArgs,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LifecycleControllerStartInstanceWithArgsRequest
{
}
#[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<fidl::encoding::DefaultFuchsiaResourceDialect>
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 RealmQueryOpenDirectoryRequest {
pub moniker: String,
pub dir_type: OpenDirType,
pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryOpenDirectoryRequest
{
}
#[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<fidl::encoding::DefaultFuchsiaResourceDialect> 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<fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryConstructNamespaceResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryGetAllInstancesResponse {
pub iterator: fidl::endpoints::ClientEnd<InstanceIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryGetManifestResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RealmQueryGetResolvedDeclarationResponse {
pub iterator: fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect>
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<fidl::encoding::DefaultFuchsiaResourceDialect>
for StorageAdminOpenComponentStorageRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StorageAdminOpenStorageRequest {
pub relative_moniker: String,
pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StorageAdminOpenStorageRequest
{
}
#[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>>,
pub availability: Option<fidl_fuchsia_component_decl::Availability>,
pub outcome: Option<RouteOutcome>,
#[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 ConfigOverrideMarker;
impl fidl::endpoints::ProtocolMarker for ConfigOverrideMarker {
type Proxy = ConfigOverrideProxy;
type RequestStream = ConfigOverrideRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ConfigOverrideSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.sys2.ConfigOverride";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ConfigOverrideMarker {}
pub type ConfigOverrideSetStructuredConfigResult = Result<(), ConfigOverrideError>;
pub type ConfigOverrideUnsetStructuredConfigResult = Result<(), ConfigOverrideError>;
pub trait ConfigOverrideProxyInterface: Send + Sync {
type SetStructuredConfigResponseFut: std::future::Future<Output = Result<ConfigOverrideSetStructuredConfigResult, fidl::Error>>
+ Send;
fn r#set_structured_config(
&self,
moniker: &str,
fields: &[fidl_fuchsia_component_decl::ConfigOverride],
) -> Self::SetStructuredConfigResponseFut;
type UnsetStructuredConfigResponseFut: std::future::Future<Output = Result<ConfigOverrideUnsetStructuredConfigResult, fidl::Error>>
+ Send;
fn r#unset_structured_config(&self, moniker: &str) -> Self::UnsetStructuredConfigResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ConfigOverrideSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ConfigOverrideSynchronousProxy {
type Proxy = ConfigOverrideProxy;
type Protocol = ConfigOverrideMarker;
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 ConfigOverrideSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ConfigOverrideMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<ConfigOverrideEvent, fidl::Error> {
ConfigOverrideEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_structured_config(
&self,
mut moniker: &str,
mut fields: &[fidl_fuchsia_component_decl::ConfigOverride],
___deadline: zx::MonotonicInstant,
) -> Result<ConfigOverrideSetStructuredConfigResult, fidl::Error> {
let _response = self.client.send_query::<
ConfigOverrideSetStructuredConfigRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, ConfigOverrideError>,
>(
(moniker, fields,),
0x2c6a138832d2e0ee,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<ConfigOverrideMarker>("set_structured_config")?;
Ok(_response.map(|x| x))
}
pub fn r#unset_structured_config(
&self,
mut moniker: &str,
___deadline: zx::MonotonicInstant,
) -> Result<ConfigOverrideUnsetStructuredConfigResult, fidl::Error> {
let _response = self.client.send_query::<
ConfigOverrideUnsetStructuredConfigRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, ConfigOverrideError>,
>(
(moniker,),
0x342ec7d2bef05552,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<ConfigOverrideMarker>("unset_structured_config")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct ConfigOverrideProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ConfigOverrideProxy {
type Protocol = ConfigOverrideMarker;
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 ConfigOverrideProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ConfigOverrideMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ConfigOverrideEventStream {
ConfigOverrideEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_structured_config(
&self,
mut moniker: &str,
mut fields: &[fidl_fuchsia_component_decl::ConfigOverride],
) -> fidl::client::QueryResponseFut<
ConfigOverrideSetStructuredConfigResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ConfigOverrideProxyInterface::r#set_structured_config(self, moniker, fields)
}
pub fn r#unset_structured_config(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<
ConfigOverrideUnsetStructuredConfigResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ConfigOverrideProxyInterface::r#unset_structured_config(self, moniker)
}
}
impl ConfigOverrideProxyInterface for ConfigOverrideProxy {
type SetStructuredConfigResponseFut = fidl::client::QueryResponseFut<
ConfigOverrideSetStructuredConfigResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_structured_config(
&self,
mut moniker: &str,
mut fields: &[fidl_fuchsia_component_decl::ConfigOverride],
) -> Self::SetStructuredConfigResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ConfigOverrideSetStructuredConfigResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
ConfigOverrideError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c6a138832d2e0ee,
>(_buf?)?
.into_result::<ConfigOverrideMarker>("set_structured_config")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ConfigOverrideSetStructuredConfigRequest,
ConfigOverrideSetStructuredConfigResult,
>(
(moniker, fields,),
0x2c6a138832d2e0ee,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type UnsetStructuredConfigResponseFut = fidl::client::QueryResponseFut<
ConfigOverrideUnsetStructuredConfigResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#unset_structured_config(
&self,
mut moniker: &str,
) -> Self::UnsetStructuredConfigResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ConfigOverrideUnsetStructuredConfigResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
ConfigOverrideError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x342ec7d2bef05552,
>(_buf?)?
.into_result::<ConfigOverrideMarker>("unset_structured_config")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ConfigOverrideUnsetStructuredConfigRequest,
ConfigOverrideUnsetStructuredConfigResult,
>(
(moniker,),
0x342ec7d2bef05552,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct ConfigOverrideEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ConfigOverrideEventStream {}
impl futures::stream::FusedStream for ConfigOverrideEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ConfigOverrideEventStream {
type Item = Result<ConfigOverrideEvent, 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(ConfigOverrideEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ConfigOverrideEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl ConfigOverrideEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ConfigOverrideEvent, 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 {
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(ConfigOverrideEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<ConfigOverrideMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ConfigOverrideRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ConfigOverrideRequestStream {}
impl futures::stream::FusedStream for ConfigOverrideRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ConfigOverrideRequestStream {
type Protocol = ConfigOverrideMarker;
type ControlHandle = ConfigOverrideControlHandle;
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 {
ConfigOverrideControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ConfigOverrideRequestStream {
type Item = Result<ConfigOverrideRequest, 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 ConfigOverrideRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x2c6a138832d2e0ee => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ConfigOverrideSetStructuredConfigRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConfigOverrideSetStructuredConfigRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ConfigOverrideControlHandle { inner: this.inner.clone() };
Ok(ConfigOverrideRequest::SetStructuredConfig {
moniker: req.moniker,
fields: req.fields,
responder: ConfigOverrideSetStructuredConfigResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x342ec7d2bef05552 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ConfigOverrideUnsetStructuredConfigRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConfigOverrideUnsetStructuredConfigRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ConfigOverrideControlHandle { inner: this.inner.clone() };
Ok(ConfigOverrideRequest::UnsetStructuredConfig {
moniker: req.moniker,
responder: ConfigOverrideUnsetStructuredConfigResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(ConfigOverrideRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: ConfigOverrideControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(ConfigOverrideRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: ConfigOverrideControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ConfigOverrideMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ConfigOverrideRequest {
SetStructuredConfig {
moniker: String,
fields: Vec<fidl_fuchsia_component_decl::ConfigOverride>,
responder: ConfigOverrideSetStructuredConfigResponder,
},
UnsetStructuredConfig {
moniker: String,
responder: ConfigOverrideUnsetStructuredConfigResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: ConfigOverrideControlHandle,
method_type: fidl::MethodType,
},
}
impl ConfigOverrideRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_structured_config(
self,
) -> Option<(
String,
Vec<fidl_fuchsia_component_decl::ConfigOverride>,
ConfigOverrideSetStructuredConfigResponder,
)> {
if let ConfigOverrideRequest::SetStructuredConfig { moniker, fields, responder } = self {
Some((moniker, fields, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_unset_structured_config(
self,
) -> Option<(String, ConfigOverrideUnsetStructuredConfigResponder)> {
if let ConfigOverrideRequest::UnsetStructuredConfig { moniker, responder } = self {
Some((moniker, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ConfigOverrideRequest::SetStructuredConfig { .. } => "set_structured_config",
ConfigOverrideRequest::UnsetStructuredConfig { .. } => "unset_structured_config",
ConfigOverrideRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
ConfigOverrideRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct ConfigOverrideControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ConfigOverrideControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl ConfigOverrideControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ConfigOverrideSetStructuredConfigResponder {
control_handle: std::mem::ManuallyDrop<ConfigOverrideControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ConfigOverrideSetStructuredConfigResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ConfigOverrideSetStructuredConfigResponder {
type ControlHandle = ConfigOverrideControlHandle;
fn control_handle(&self) -> &ConfigOverrideControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ConfigOverrideSetStructuredConfigResponder {
pub fn send(self, mut result: Result<(), ConfigOverrideError>) -> 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<(), ConfigOverrideError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
ConfigOverrideError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x2c6a138832d2e0ee,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ConfigOverrideUnsetStructuredConfigResponder {
control_handle: std::mem::ManuallyDrop<ConfigOverrideControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ConfigOverrideUnsetStructuredConfigResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ConfigOverrideUnsetStructuredConfigResponder {
type ControlHandle = ConfigOverrideControlHandle;
fn control_handle(&self) -> &ConfigOverrideControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ConfigOverrideUnsetStructuredConfigResponder {
pub fn send(self, mut result: Result<(), ConfigOverrideError>) -> 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<(), ConfigOverrideError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
ConfigOverrideError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x342ec7d2bef05552,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CrashIntrospectProxyInterface::r#find_component_by_thread_koid(self, thread_koid)
}
}
impl CrashIntrospectProxyInterface for CrashIntrospectProxy {
type FindComponentByThreadKoidResponseFut = fidl::client::QueryResponseFut<
CrashIntrospectFindComponentByThreadKoidResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#find_component_by_thread_koid(
&self,
mut thread_koid: u64,
) -> Self::FindComponentByThreadKoidResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CrashIntrospectFindComponentByThreadKoidResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
CrashIntrospectFindComponentByThreadKoidResponse,
fidl_fuchsia_component::Error,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x75d3ff081eca468d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CrashIntrospectFindComponentByThreadKoidRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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::MonotonicInstant,
) -> Result<InstanceIteratorEvent, fidl::Error> {
InstanceIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
InstanceIteratorProxyInterface::r#next(self)
}
}
impl InstanceIteratorProxyInterface for InstanceIteratorProxy {
type NextResponseFut = fidl::client::QueryResponseFut<
Vec<Instance>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<Instance>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
InstanceIteratorNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3a4e3d52432a52ee => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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 LifecycleControllerStartInstanceWithArgsResult = 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 StartInstanceWithArgsResponseFut: std::future::Future<
Output = Result<LifecycleControllerStartInstanceWithArgsResult, fidl::Error>,
> + Send;
fn r#start_instance_with_args(
&self,
moniker: &str,
binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
args: fidl_fuchsia_component::StartChildArgs,
) -> Self::StartInstanceWithArgsResponseFut;
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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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#start_instance_with_args(
&self,
mut moniker: &str,
mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
mut args: fidl_fuchsia_component::StartChildArgs,
___deadline: zx::MonotonicInstant,
) -> Result<LifecycleControllerStartInstanceWithArgsResult, fidl::Error> {
let _response = self.client.send_query::<
LifecycleControllerStartInstanceWithArgsRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
>(
(moniker, binder, &mut args,),
0xd3b467436223e9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#stop_instance(
&self,
mut moniker: &str,
___deadline: zx::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LifecycleControllerProxyInterface::r#start_instance(self, moniker, binder)
}
pub fn r#start_instance_with_args(
&self,
mut moniker: &str,
mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
mut args: fidl_fuchsia_component::StartChildArgs,
) -> fidl::client::QueryResponseFut<
LifecycleControllerStartInstanceWithArgsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LifecycleControllerProxyInterface::r#start_instance_with_args(self, moniker, binder, args)
}
pub fn r#stop_instance(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<
LifecycleControllerStopInstanceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LifecycleControllerProxyInterface::r#stop_instance(self, moniker)
}
pub fn r#resolve_instance(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<
LifecycleControllerResolveInstanceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LifecycleControllerProxyInterface::r#resolve_instance(self, moniker)
}
pub fn r#unresolve_instance(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<
LifecycleControllerUnresolveInstanceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LifecycleControllerProxyInterface::r#destroy_instance(self, parent_moniker, child)
}
}
impl LifecycleControllerProxyInterface for LifecycleControllerProxy {
type StartInstanceResponseFut = fidl::client::QueryResponseFut<
LifecycleControllerStartInstanceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerStartInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x13fcb422876384bf,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LifecycleControllerStartInstanceRequest,
LifecycleControllerStartInstanceResult,
>(
(moniker, binder,),
0x13fcb422876384bf,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartInstanceWithArgsResponseFut = fidl::client::QueryResponseFut<
LifecycleControllerStartInstanceWithArgsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#start_instance_with_args(
&self,
mut moniker: &str,
mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
mut args: fidl_fuchsia_component::StartChildArgs,
) -> Self::StartInstanceWithArgsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerStartInstanceWithArgsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xd3b467436223e9,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
LifecycleControllerStartInstanceWithArgsRequest,
LifecycleControllerStartInstanceWithArgsResult,
>(
(moniker, binder, &mut args,),
0xd3b467436223e9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopInstanceResponseFut = fidl::client::QueryResponseFut<
LifecycleControllerStopInstanceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#stop_instance(&self, mut moniker: &str) -> Self::StopInstanceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerStopInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StopError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#resolve_instance(&self, mut moniker: &str) -> Self::ResolveInstanceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerResolveInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ResolveError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#unresolve_instance(&self, mut moniker: &str) -> Self::UnresolveInstanceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerUnresolveInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UnresolveError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerCreateInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, CreateError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#destroy_instance(
&self,
mut parent_moniker: &str,
mut child: &fidl_fuchsia_component_decl::ChildRef,
) -> Self::DestroyInstanceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LifecycleControllerDestroyInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DestroyError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x13fcb422876384bf => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(LifecycleControllerStartInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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,
},
})
}
0xd3b467436223e9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(LifecycleControllerStartInstanceWithArgsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LifecycleControllerStartInstanceWithArgsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LifecycleControllerControlHandle {
inner: this.inner.clone(),
};
Ok(LifecycleControllerRequest::StartInstanceWithArgs {moniker: req.moniker,
binder: req.binder,
args: req.args,
responder: LifecycleControllerStartInstanceWithArgsResponder {
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::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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,
},
StartInstanceWithArgs {
moniker: String,
binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
args: fidl_fuchsia_component::StartChildArgs,
responder: LifecycleControllerStartInstanceWithArgsResponder,
},
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_start_instance_with_args(
self,
) -> Option<(
String,
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
fidl_fuchsia_component::StartChildArgs,
LifecycleControllerStartInstanceWithArgsResponder,
)> {
if let LifecycleControllerRequest::StartInstanceWithArgs {
moniker,
binder,
args,
responder,
} = self
{
Some((moniker, binder, args, 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::StartInstanceWithArgs { .. } => "start_instance_with_args",
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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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 LifecycleControllerStartInstanceWithArgsResponder {
control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LifecycleControllerStartInstanceWithArgsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LifecycleControllerStartInstanceWithArgsResponder {
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 LifecycleControllerStartInstanceWithArgsResponder {
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,
0xd3b467436223e9,
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::MonotonicInstant,
) -> Result<ManifestBytesIteratorEvent, fidl::Error> {
ManifestBytesIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ManifestBytesIteratorProxyInterface::r#next(self)
}
}
impl ManifestBytesIteratorProxyInterface for ManifestBytesIteratorProxy {
type NextResponseFut =
fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ManifestBytesIteratorNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x4be4659549b15500 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = 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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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::MonotonicInstant,
) -> Result<RealmExplorerEvent, fidl::Error> {
RealmExplorerEvent::decode(self.client.wait_for_event(deadline)?)
}
}
#[derive(Debug, Clone)]
pub struct RealmExplorerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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 RealmQueryOpenDirectoryResult = 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 OpenDirectoryResponseFut: std::future::Future<Output = Result<RealmQueryOpenDirectoryResult, fidl::Error>>
+ Send;
fn r#open_directory(
&self,
moniker: &str,
dir_type: OpenDirType,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::OpenDirectoryResponseFut;
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::MonotonicInstant,
) -> Result<RealmQueryEvent, fidl::Error> {
RealmQueryEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_instance(
&self,
mut moniker: &str,
___deadline: zx::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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#open_directory(
&self,
mut moniker: &str,
mut dir_type: OpenDirType,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<RealmQueryOpenDirectoryResult, fidl::Error> {
let _response = self.client.send_query::<
RealmQueryOpenDirectoryRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
>(
(moniker, dir_type, object,),
0x333d68f1deecec85,
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::MonotonicInstant,
) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RealmQueryProxyInterface::r#get_instance(self, moniker)
}
pub fn r#get_resolved_declaration(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<
RealmQueryGetResolvedDeclarationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RealmQueryProxyInterface::r#get_resolved_declaration(self, moniker)
}
pub fn r#get_manifest(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<
RealmQueryGetManifestResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RealmQueryProxyInterface::r#resolve_declaration(self, parent, child_location, url)
}
pub fn r#get_structured_config(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<
RealmQueryGetStructuredConfigResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RealmQueryProxyInterface::r#get_structured_config(self, moniker)
}
pub fn r#get_all_instances(
&self,
) -> fidl::client::QueryResponseFut<
RealmQueryGetAllInstancesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RealmQueryProxyInterface::r#get_all_instances(self)
}
pub fn r#construct_namespace(
&self,
mut moniker: &str,
) -> fidl::client::QueryResponseFut<
RealmQueryConstructNamespaceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RealmQueryProxyInterface::r#open(self, moniker, dir_type, flags, mode, path, object)
}
pub fn r#open_directory(
&self,
mut moniker: &str,
mut dir_type: OpenDirType,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> fidl::client::QueryResponseFut<
RealmQueryOpenDirectoryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RealmQueryProxyInterface::r#open_directory(self, moniker, dir_type, 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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RealmQueryProxyInterface::r#connect_to_storage_admin(
self,
moniker,
storage_name,
server_end,
)
}
}
impl RealmQueryProxyInterface for RealmQueryProxy {
type GetInstanceResponseFut = fidl::client::QueryResponseFut<
RealmQueryGetInstanceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_instance(&self, mut moniker: &str) -> Self::GetInstanceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetInstanceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RealmQueryGetInstanceResponse, GetInstanceError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_resolved_declaration(
&self,
mut moniker: &str,
) -> Self::GetResolvedDeclarationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetResolvedDeclarationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RealmQueryGetResolvedDeclarationResponse,
GetDeclarationError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_manifest(&self, mut moniker: &str) -> Self::GetManifestResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetManifestResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RealmQueryGetManifestResponse, GetDeclarationError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#resolve_declaration(
&self,
mut parent: &str,
mut child_location: &ChildLocation,
mut url: &str,
) -> Self::ResolveDeclarationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryResolveDeclarationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RealmQueryResolveDeclarationResponse,
GetDeclarationError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_structured_config(&self, mut moniker: &str) -> Self::GetStructuredConfigResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetStructuredConfigResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RealmQueryGetStructuredConfigResponse,
GetStructuredConfigError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_all_instances(&self) -> Self::GetAllInstancesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryGetAllInstancesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RealmQueryGetAllInstancesResponse, GetAllInstancesError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#construct_namespace(&self, mut moniker: &str) -> Self::ConstructNamespaceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryConstructNamespaceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RealmQueryConstructNamespaceResponse,
ConstructNamespaceError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryOpenResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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 OpenDirectoryResponseFut = fidl::client::QueryResponseFut<
RealmQueryOpenDirectoryResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#open_directory(
&self,
mut moniker: &str,
mut dir_type: OpenDirType,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::OpenDirectoryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryOpenDirectoryResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x333d68f1deecec85,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<RealmQueryOpenDirectoryRequest, RealmQueryOpenDirectoryResult>(
(moniker, dir_type, object),
0x333d68f1deecec85,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ConnectToStorageAdminResponseFut = fidl::client::QueryResponseFut<
RealmQueryConnectToStorageAdminResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmQueryConnectToStorageAdminResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ConnectToStorageAdminError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3496ca1e5a0c13a8 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RealmQueryGetInstanceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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,
},
})
}
0x333d68f1deecec85 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RealmQueryOpenDirectoryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryOpenDirectoryRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
Ok(RealmQueryRequest::OpenDirectory {
moniker: req.moniker,
dir_type: req.dir_type,
object: req.object,
responder: RealmQueryOpenDirectoryResponder {
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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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,
},
OpenDirectory {
moniker: String,
dir_type: OpenDirType,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
responder: RealmQueryOpenDirectoryResponder,
},
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_open_directory(
self,
) -> Option<(
String,
OpenDirType,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
RealmQueryOpenDirectoryResponder,
)> {
if let RealmQueryRequest::OpenDirectory { moniker, dir_type, object, responder } = self {
Some((moniker, dir_type, 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::OpenDirectory { .. } => "open_directory",
RealmQueryRequest::ConnectToStorageAdmin { .. } => "connect_to_storage_admin",
}
}
}
#[derive(Debug, Clone)]
pub struct RealmQueryControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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 RealmQueryOpenDirectoryResponder {
control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmQueryOpenDirectoryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmQueryOpenDirectoryResponder {
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 RealmQueryOpenDirectoryResponder {
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,
0x333d68f1deecec85,
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::MonotonicInstant,
) -> Result<RouteValidatorEvent, fidl::Error> {
RouteValidatorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#validate(
&self,
mut moniker: &str,
___deadline: zx::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RouteValidatorProxyInterface::r#validate(self, moniker)
}
pub fn r#route(
&self,
mut moniker: &str,
mut targets: &[RouteTarget],
) -> fidl::client::QueryResponseFut<
RouteValidatorRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RouteValidatorProxyInterface::r#route(self, moniker, targets)
}
}
impl RouteValidatorProxyInterface for RouteValidatorProxy {
type ValidateResponseFut = fidl::client::QueryResponseFut<
RouteValidatorValidateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#validate(&self, mut moniker: &str) -> Self::ValidateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RouteValidatorValidateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
RouteValidatorValidateResponse,
fidl_fuchsia_component::Error,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#route(&self, mut moniker: &str, mut targets: &[RouteTarget]) -> Self::RouteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RouteValidatorRouteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RouteValidatorRouteResponse, RouteValidatorError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3360b96d5f86cdf4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RouteValidatorValidateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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 StorageAdminOpenStorageResult = Result<(), fidl_fuchsia_component::Error>;
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 OpenStorageResponseFut: std::future::Future<Output = Result<StorageAdminOpenStorageResult, fidl::Error>>
+ Send;
fn r#open_storage(
&self,
relative_moniker: &str,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Self::OpenStorageResponseFut;
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::MonotonicInstant,
) -> 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#open_storage(
&self,
mut relative_moniker: &str,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
let _response =
self.client.send_query::<StorageAdminOpenStorageRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>>(
(relative_moniker, object),
0x6ceaa5904cfe4377,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list_storage_in_realm(
&self,
mut relative_moniker: &str,
mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
___deadline: zx::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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::MonotonicInstant,
) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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#open_storage(
&self,
mut relative_moniker: &str,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> fidl::client::QueryResponseFut<
StorageAdminOpenStorageResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
StorageAdminProxyInterface::r#open_storage(self, relative_moniker, object)
}
pub fn r#list_storage_in_realm(
&self,
mut relative_moniker: &str,
mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
) -> fidl::client::QueryResponseFut<
StorageAdminListStorageInRealmResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
StorageAdminProxyInterface::r#delete_component_storage(self, relative_moniker)
}
pub fn r#get_status(
&self,
) -> fidl::client::QueryResponseFut<
StorageAdminGetStatusResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
StorageAdminProxyInterface::r#get_status(self)
}
pub fn r#delete_all_storage_contents(
&self,
) -> fidl::client::QueryResponseFut<
StorageAdminDeleteAllStorageContentsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
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 OpenStorageResponseFut = fidl::client::QueryResponseFut<
StorageAdminOpenStorageResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#open_storage(
&self,
mut relative_moniker: &str,
mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
) -> Self::OpenStorageResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6ceaa5904cfe4377,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<StorageAdminOpenStorageRequest, StorageAdminOpenStorageResult>(
(relative_moniker, object),
0x6ceaa5904cfe4377,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ListStorageInRealmResponseFut = fidl::client::QueryResponseFut<
StorageAdminListStorageInRealmResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#delete_component_storage(
&self,
mut relative_moniker: &str,
) -> Self::DeleteComponentStorageResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_component::Error,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_status(&self) -> Self::GetStatusResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminGetStatusResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<StorageStatus, StatusError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3e0295bd35836b1d => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
StorageAdminOpenComponentStorageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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,
})
}
0x6ceaa5904cfe4377 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
StorageAdminOpenStorageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminOpenStorageRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
StorageAdminControlHandle { inner: this.inner.clone() };
Ok(StorageAdminRequest::OpenStorage {
relative_moniker: req.relative_moniker,
object: req.object,
responder: StorageAdminOpenStorageResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x764f6d1f083e8bfb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
StorageAdminListStorageInRealmRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::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,
},
OpenStorage {
relative_moniker: String,
object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
responder: StorageAdminOpenStorageResponder,
},
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_open_storage(
self,
) -> Option<(
String,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
StorageAdminOpenStorageResponder,
)> {
if let StorageAdminRequest::OpenStorage { relative_moniker, object, responder } = self {
Some((relative_moniker, object, responder))
} 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::OpenStorage { .. } => "open_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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl StorageAdminControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StorageAdminOpenStorageResponder {
control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StorageAdminOpenStorageResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StorageAdminOpenStorageResponder {
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 StorageAdminOpenStorageResponder {
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,
0x6ceaa5904cfe4377,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[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::MonotonicInstant,
) -> Result<StorageIteratorEvent, fidl::Error> {
StorageIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
StorageIteratorProxyInterface::r#next(self)
}
}
impl StorageIteratorProxyInterface for StorageIteratorProxy {
type NextResponseFut =
fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#next(&self) -> Self::NextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<String>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StorageIteratorNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x7a6b21f15fd01b72 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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::MonotonicInstant,
) -> Result<SystemControllerEvent, fidl::Error> {
SystemControllerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#shutdown(&self, ___deadline: zx::MonotonicInstant) -> 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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
SystemControllerProxyInterface::r#shutdown(self)
}
}
impl SystemControllerProxyInterface for SystemControllerProxy {
type ShutdownResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#shutdown(&self) -> Self::ShutdownResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
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<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
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::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
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<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for 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::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x25f56c938344e549 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
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<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
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()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl 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 ConfigOverrideError {
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 ConfigOverrideError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ConfigOverrideError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigOverrideError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ConnectToStorageAdminError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ConnectToStorageAdminError
{
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ConstructNamespaceError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ConstructNamespaceError
{
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CreateError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DeclType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeclType {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DeletionError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeletionError {
#[inline(always)]
fn new_empty() -> Self {
Self::Connection
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for 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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DestroyError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DestroyError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for GetAllInstancesError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetAllInstancesError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for GetDeclarationError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetDeclarationError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for GetInstanceError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetInstanceError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for GetStructuredConfigError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for GetStructuredConfigError
{
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OpenDirType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpenDirType {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for OpenError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OpenError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for RealmQueryError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RealmQueryError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ResolveError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolveError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RouteOutcome {
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 RouteOutcome {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for RouteOutcome {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteOutcome {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for RouteValidatorError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteValidatorError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StartError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StatusError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StatusError {
#[inline(always)]
fn new_empty() -> Self {
Self::Provider
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for 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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StopError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StopError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<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(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for UnresolveError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UnresolveError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ConfigOverrideSetStructuredConfigRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ConfigOverrideSetStructuredConfigRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ConfigOverrideSetStructuredConfigRequest, D>
for &ConfigOverrideSetStructuredConfigRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ConfigOverrideSetStructuredConfigRequest>(offset);
fidl::encoding::Encode::<ConfigOverrideSetStructuredConfigRequest, D>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::ConfigOverride> as fidl::encoding::ValueTypeMarker>::borrow(&self.fields),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T1: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::ConfigOverride>,
D,
>,
> fidl::encoding::Encode<ConfigOverrideSetStructuredConfigRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ConfigOverrideSetStructuredConfigRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ConfigOverrideSetStructuredConfigRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
fields: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::ConfigOverride>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::ConfigOverride>,
D,
&mut self.fields,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ConfigOverrideUnsetStructuredConfigRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ConfigOverrideUnsetStructuredConfigRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ConfigOverrideUnsetStructuredConfigRequest, D>
for &ConfigOverrideUnsetStructuredConfigRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ConfigOverrideUnsetStructuredConfigRequest>(offset);
fidl::encoding::Encode::<ConfigOverrideUnsetStructuredConfigRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<ConfigOverrideUnsetStructuredConfigRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ConfigOverrideUnsetStructuredConfigRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ConfigOverrideUnsetStructuredConfigRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
CrashIntrospectFindComponentByThreadKoidRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CrashIntrospectFindComponentByThreadKoidRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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::DefaultFuchsiaResourceDialect>>
fidl::encoding::Encode<
CrashIntrospectFindComponentByThreadKoidRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CrashIntrospectFindComponentByThreadKoidRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
thread_koid: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CrashIntrospectFindComponentByThreadKoidResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CrashIntrospectFindComponentByThreadKoidResponse, D>
for &CrashIntrospectFindComponentByThreadKoidResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidResponse>(offset);
fidl::encoding::Encode::<CrashIntrospectFindComponentByThreadKoidResponse, D>::encode(
(<ComponentCrashInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ComponentCrashInfo, D>>
fidl::encoding::Encode<CrashIntrospectFindComponentByThreadKoidResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CrashIntrospectFindComponentByThreadKoidResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { info: fidl::new_empty!(ComponentCrashInfo, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(ComponentCrashInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InstanceIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<InstanceIteratorNextResponse, D> for &InstanceIteratorNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InstanceIteratorNextResponse>(offset);
fidl::encoding::Encode::<InstanceIteratorNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<Instance> as fidl::encoding::ValueTypeMarker>::borrow(&self.infos),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Instance>, D>,
> fidl::encoding::Encode<InstanceIteratorNextResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InstanceIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InstanceIteratorNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { infos: fidl::new_empty!(fidl::encoding::UnboundedVector<Instance>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<Instance>,
D,
&mut self.infos,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
LifecycleControllerCreateInstanceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LifecycleControllerCreateInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerCreateInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerCreateInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl_fuchsia_component_decl::CollectionRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl_fuchsia_component_decl::Child,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl_fuchsia_component::CreateChildArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LifecycleControllerCreateInstanceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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, fidl::encoding::DefaultFuchsiaResourceDialect>
for LifecycleControllerCreateInstanceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
parent_moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
collection: fidl::new_empty!(
fidl_fuchsia_component_decl::CollectionRef,
fidl::encoding::DefaultFuchsiaResourceDialect
),
decl: fidl::new_empty!(
fidl_fuchsia_component_decl::Child,
fidl::encoding::DefaultFuchsiaResourceDialect
),
args: fidl::new_empty!(
fidl_fuchsia_component::CreateChildArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.parent_moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_component_decl::CollectionRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.collection,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl_fuchsia_component_decl::Child,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.decl,
decoder,
offset + 32,
_depth
)?;
fidl::decode!(
fidl_fuchsia_component::CreateChildArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.args,
decoder,
offset + 48,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LifecycleControllerDestroyInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LifecycleControllerDestroyInstanceRequest, D>
for &LifecycleControllerDestroyInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerDestroyInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerDestroyInstanceRequest, D>::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<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_component_decl::ChildRef, D>,
> fidl::encoding::Encode<LifecycleControllerDestroyInstanceRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerDestroyInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LifecycleControllerDestroyInstanceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
parent_moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
child: fidl::new_empty!(fidl_fuchsia_component_decl::ChildRef, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.parent_moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_component_decl::ChildRef,
D,
&mut self.child,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LifecycleControllerResolveInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LifecycleControllerResolveInstanceRequest, D>
for &LifecycleControllerResolveInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerResolveInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerResolveInstanceRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<LifecycleControllerResolveInstanceRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerResolveInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LifecycleControllerResolveInstanceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
LifecycleControllerStartInstanceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LifecycleControllerStartInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerStartInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerStartInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LifecycleControllerStartInstanceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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, fidl::encoding::DefaultFuchsiaResourceDialect>
for LifecycleControllerStartInstanceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
binder: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.binder,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LifecycleControllerStartInstanceWithArgsRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LifecycleControllerStartInstanceWithArgsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl
fidl::encoding::Encode<
LifecycleControllerStartInstanceWithArgsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LifecycleControllerStartInstanceWithArgsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerStartInstanceWithArgsRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerStartInstanceWithArgsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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),
<fidl_fuchsia_component::StartChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl_fuchsia_component::StartChildArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LifecycleControllerStartInstanceWithArgsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerStartInstanceWithArgsRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LifecycleControllerStartInstanceWithArgsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
binder: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
args: fidl::new_empty!(
fidl_fuchsia_component::StartChildArgs,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.binder,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl_fuchsia_component::StartChildArgs,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.args,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LifecycleControllerStopInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LifecycleControllerStopInstanceRequest, D>
for &LifecycleControllerStopInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerStopInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerStopInstanceRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<LifecycleControllerStopInstanceRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerStopInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LifecycleControllerStopInstanceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LifecycleControllerUnresolveInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LifecycleControllerUnresolveInstanceRequest, D>
for &LifecycleControllerUnresolveInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerUnresolveInstanceRequest>(offset);
fidl::encoding::Encode::<LifecycleControllerUnresolveInstanceRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<LifecycleControllerUnresolveInstanceRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LifecycleControllerUnresolveInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LifecycleControllerUnresolveInstanceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ManifestBytesIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ManifestBytesIteratorNextResponse, D>
for &ManifestBytesIteratorNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManifestBytesIteratorNextResponse>(offset);
fidl::encoding::Encode::<ManifestBytesIteratorNextResponse, D>::encode(
(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(
&self.infos,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<ManifestBytesIteratorNextResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManifestBytesIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ManifestBytesIteratorNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { infos: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.infos,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
RealmQueryConnectToStorageAdminRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RealmQueryConnectToStorageAdminRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConnectToStorageAdminRequest>(offset);
fidl::encoding::Encode::<RealmQueryConnectToStorageAdminRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::BoundedString<100>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RealmQueryConnectToStorageAdminRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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, fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryConnectToStorageAdminRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
storage_name: fidl::new_empty!(
fidl::encoding::BoundedString<100>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
server_end: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<100>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.storage_name,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.server_end,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryConstructNamespaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RealmQueryConstructNamespaceRequest, D>
for &RealmQueryConstructNamespaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConstructNamespaceRequest>(offset);
fidl::encoding::Encode::<RealmQueryConstructNamespaceRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<RealmQueryConstructNamespaceRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConstructNamespaceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RealmQueryConstructNamespaceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetInstanceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RealmQueryGetInstanceRequest, D> for &RealmQueryGetInstanceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetInstanceRequest>(offset);
fidl::encoding::Encode::<RealmQueryGetInstanceRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<RealmQueryGetInstanceRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetInstanceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RealmQueryGetInstanceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetManifestRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RealmQueryGetManifestRequest, D> for &RealmQueryGetManifestRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetManifestRequest>(offset);
fidl::encoding::Encode::<RealmQueryGetManifestRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<RealmQueryGetManifestRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetManifestRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RealmQueryGetManifestRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetResolvedDeclarationRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RealmQueryGetResolvedDeclarationRequest, D>
for &RealmQueryGetResolvedDeclarationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationRequest>(offset);
fidl::encoding::Encode::<RealmQueryGetResolvedDeclarationRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<RealmQueryGetResolvedDeclarationRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RealmQueryGetResolvedDeclarationRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetStructuredConfigRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RealmQueryGetStructuredConfigRequest, D>
for &RealmQueryGetStructuredConfigRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetStructuredConfigRequest>(offset);
fidl::encoding::Encode::<RealmQueryGetStructuredConfigRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<RealmQueryGetStructuredConfigRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetStructuredConfigRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RealmQueryGetStructuredConfigRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for RealmQueryOpenDirectoryRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RealmQueryOpenDirectoryRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
RealmQueryOpenDirectoryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RealmQueryOpenDirectoryRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryOpenDirectoryRequest>(offset);
fidl::encoding::Encode::<RealmQueryOpenDirectoryRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.dir_type),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<OpenDirType, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RealmQueryOpenDirectoryRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryOpenDirectoryRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 20, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryOpenDirectoryRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
dir_type: fidl::new_empty!(
OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect
),
object: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dir_type,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.object,
decoder,
offset + 20,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<RealmQueryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut RealmQueryOpenRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryOpenRequest>(offset);
fidl::encoding::Encode::<RealmQueryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<OpenDirType, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl_fuchsia_io::OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl_fuchsia_io::ModeType,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T4: fidl::encoding::Encode<
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T5: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<RealmQueryOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2, T3, T4, T5)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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, fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryOpenRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
dir_type: fidl::new_empty!(
OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect
),
flags: fidl::new_empty!(
fidl_fuchsia_io::OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect
),
mode: fidl::new_empty!(
fidl_fuchsia_io::ModeType,
fidl::encoding::DefaultFuchsiaResourceDialect
),
path: fidl::new_empty!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
object: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
OpenDirType,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dir_type,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl_fuchsia_io::OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.flags,
decoder,
offset + 20,
_depth
)?;
fidl::decode!(
fidl_fuchsia_io::ModeType,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.mode,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.path,
decoder,
offset + 32,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.object,
decoder,
offset + 48,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryResolveDeclarationRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RealmQueryResolveDeclarationRequest, D>
for &RealmQueryResolveDeclarationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryResolveDeclarationRequest>(offset);
fidl::encoding::Encode::<RealmQueryResolveDeclarationRequest, D>::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<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T1: fidl::encoding::Encode<ChildLocation, D>,
T2: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<RealmQueryResolveDeclarationRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RealmQueryResolveDeclarationRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
child_location: fidl::new_empty!(ChildLocation, D),
url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.parent,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
ChildLocation,
D,
&mut self.child_location,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.url,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
RealmQueryConstructNamespaceResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RealmQueryConstructNamespaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConstructNamespaceResponse>(offset);
fidl::encoding::Encode::<
RealmQueryConstructNamespaceResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::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::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RealmQueryConstructNamespaceResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryConstructNamespaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryConstructNamespaceResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
namespace: fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl_fuchsia_component_runner::ComponentNamespaceEntry,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<
fidl_fuchsia_component_runner::ComponentNamespaceEntry,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.namespace,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
RealmQueryGetAllInstancesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RealmQueryGetAllInstancesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetAllInstancesResponse>(offset);
fidl::encoding::Encode::<RealmQueryGetAllInstancesResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::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::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RealmQueryGetAllInstancesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetAllInstancesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryGetAllInstancesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetInstanceResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RealmQueryGetInstanceResponse, D>
for &RealmQueryGetInstanceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetInstanceResponse>(offset);
fidl::encoding::Encode::<RealmQueryGetInstanceResponse, D>::encode(
(<Instance as fidl::encoding::ValueTypeMarker>::borrow(&self.instance),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Instance, D>>
fidl::encoding::Encode<RealmQueryGetInstanceResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetInstanceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RealmQueryGetInstanceResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { instance: fidl::new_empty!(Instance, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Instance, D, &mut self.instance, decoder, offset + 0, _depth)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
RealmQueryGetManifestResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RealmQueryGetManifestResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetManifestResponse>(offset);
fidl::encoding::Encode::<
RealmQueryGetManifestResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::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::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RealmQueryGetManifestResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetManifestResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryGetManifestResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
RealmQueryGetResolvedDeclarationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RealmQueryGetResolvedDeclarationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationResponse>(offset);
fidl::encoding::Encode::<
RealmQueryGetResolvedDeclarationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::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::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RealmQueryGetResolvedDeclarationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryGetResolvedDeclarationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RealmQueryGetStructuredConfigResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RealmQueryGetStructuredConfigResponse, D>
for &RealmQueryGetStructuredConfigResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetStructuredConfigResponse>(offset);
fidl::encoding::Encode::<RealmQueryGetStructuredConfigResponse, D>::encode(
(
<fidl_fuchsia_component_decl::ResolvedConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_component_decl::ResolvedConfig, D>,
> fidl::encoding::Encode<RealmQueryGetStructuredConfigResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryGetStructuredConfigResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RealmQueryGetStructuredConfigResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { config: fidl::new_empty!(fidl_fuchsia_component_decl::ResolvedConfig, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_component_decl::ResolvedConfig,
D,
&mut self.config,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
RealmQueryResolveDeclarationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RealmQueryResolveDeclarationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryResolveDeclarationResponse>(offset);
fidl::encoding::Encode::<
RealmQueryResolveDeclarationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::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::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RealmQueryResolveDeclarationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmQueryResolveDeclarationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmQueryResolveDeclarationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RouteTarget {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteTarget, D>
for &RouteTarget
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteTarget>(offset);
fidl::encoding::Encode::<RouteTarget, D>::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<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
T1: fidl::encoding::Encode<DeclType, D>,
> fidl::encoding::Encode<RouteTarget, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteTarget {
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
decl_type: fidl::new_empty!(DeclType, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 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>,
D,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(DeclType, D, &mut self.decl_type, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RouteValidatorRouteRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RouteValidatorRouteRequest, D> for &RouteValidatorRouteRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorRouteRequest>(offset);
fidl::encoding::Encode::<RouteValidatorRouteRequest, D>::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<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<RouteTarget>, D>,
> fidl::encoding::Encode<RouteValidatorRouteRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorRouteRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RouteValidatorRouteRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
targets: fidl::new_empty!(fidl::encoding::UnboundedVector<RouteTarget>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<RouteTarget>,
D,
&mut self.targets,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RouteValidatorValidateRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RouteValidatorValidateRequest, D>
for &RouteValidatorValidateRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorValidateRequest>(offset);
fidl::encoding::Encode::<RouteValidatorValidateRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<RouteValidatorValidateRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorValidateRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RouteValidatorValidateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RouteValidatorRouteResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RouteValidatorRouteResponse, D> for &RouteValidatorRouteResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorRouteResponse>(offset);
fidl::encoding::Encode::<RouteValidatorRouteResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<RouteReport> as fidl::encoding::ValueTypeMarker>::borrow(&self.reports),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<RouteReport>, D>,
> fidl::encoding::Encode<RouteValidatorRouteResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorRouteResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RouteValidatorRouteResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { reports: fidl::new_empty!(fidl::encoding::UnboundedVector<RouteReport>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<RouteReport>,
D,
&mut self.reports,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RouteValidatorValidateResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<RouteValidatorValidateResponse, D>
for &RouteValidatorValidateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorValidateResponse>(offset);
fidl::encoding::Encode::<RouteValidatorValidateResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<RouteReport> as fidl::encoding::ValueTypeMarker>::borrow(&self.reports),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<RouteReport>, D>,
> fidl::encoding::Encode<RouteValidatorValidateResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteValidatorValidateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RouteValidatorValidateResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { reports: fidl::new_empty!(fidl::encoding::UnboundedVector<RouteReport>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<RouteReport>,
D,
&mut self.reports,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StorageAdminDeleteComponentStorageRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<StorageAdminDeleteComponentStorageRequest, D>
for &StorageAdminDeleteComponentStorageRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminDeleteComponentStorageRequest>(offset);
fidl::encoding::Encode::<StorageAdminDeleteComponentStorageRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.relative_moniker,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<StorageAdminDeleteComponentStorageRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminDeleteComponentStorageRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StorageAdminDeleteComponentStorageRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { relative_moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.relative_moniker,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
StorageAdminListStorageInRealmRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StorageAdminListStorageInRealmRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
fidl::encoding::Encode::<StorageAdminListStorageInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StorageAdminListStorageInRealmRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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, fidl::encoding::DefaultFuchsiaResourceDialect>
for StorageAdminListStorageInRealmRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
relative_moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.relative_moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
StorageAdminOpenComponentStorageByIdRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StorageAdminOpenComponentStorageByIdRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
fidl::encoding::Encode::<
StorageAdminOpenComponentStorageByIdRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StorageAdminOpenComponentStorageByIdRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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, fidl::encoding::DefaultFuchsiaResourceDialect>
for StorageAdminOpenComponentStorageByIdRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(
fidl::encoding::BoundedString<64>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
object: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.object,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
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::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
}
}
unsafe impl
fidl::encoding::Encode<
StorageAdminOpenComponentStorageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StorageAdminOpenComponentStorageRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminOpenComponentStorageRequest>(offset);
fidl::encoding::Encode::<StorageAdminOpenComponentStorageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl_fuchsia_io::OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl_fuchsia_io::ModeType,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StorageAdminOpenComponentStorageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<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, fidl::encoding::DefaultFuchsiaResourceDialect>
for StorageAdminOpenComponentStorageRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
relative_moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
flags: fidl::new_empty!(
fidl_fuchsia_io::OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect
),
mode: fidl::new_empty!(
fidl_fuchsia_io::ModeType,
fidl::encoding::DefaultFuchsiaResourceDialect
),
object: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.relative_moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl_fuchsia_io::OpenFlags,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.flags,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl_fuchsia_io::ModeType,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.mode,
decoder,
offset + 20,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.object,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenStorageRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenStorageRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
StorageAdminOpenStorageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StorageAdminOpenStorageRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
fidl::encoding::Encode::<StorageAdminOpenStorageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
<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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StorageAdminOpenStorageRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(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, fidl::encoding::DefaultFuchsiaResourceDialect>
for StorageAdminOpenStorageRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
relative_moniker: fidl::new_empty!(
fidl::encoding::BoundedString<4096>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
object: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(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>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.relative_moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.object,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StorageIteratorNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<StorageIteratorNextResponse, D> for &StorageIteratorNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageIteratorNextResponse>(offset);
fidl::encoding::Encode::<StorageIteratorNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_monikers),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
D,
>,
> fidl::encoding::Encode<StorageIteratorNextResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StorageIteratorNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StorageIteratorNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
relative_monikers: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::BoundedString<4096>>,
D,
&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
}
}
impl fidl::encoding::ValueTypeMarker for ComponentCrashInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ComponentCrashInfo, D>
for &ComponentCrashInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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>, D>(
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>, D>(
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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ComponentCrashInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::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>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::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>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ExecutionInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.start_reason {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ExecutionInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ExecutionInfo, D>
for &ExecutionInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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>, D>(
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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExecutionInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::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>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<5000>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl 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
}
}
impl fidl::encoding::ValueTypeMarker for Instance {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Instance, D> for &Instance {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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>, D>(
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>, D>(
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>, D>(
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, D>(
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>, D>(
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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Instance {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::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>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::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>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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>, D));
fidl::decode!(
fidl::encoding::BoundedString<64>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 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, D));
fidl::decode!(ResolvedInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <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>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl 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
}
}
impl fidl::encoding::ValueTypeMarker for ResolvedInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ResolvedInfo, D>
for &ResolvedInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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>, D>(
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, D>(
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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ResolvedInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::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>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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, D));
fidl::decode!(ExecutionInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl RouteError {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.summary {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for RouteError {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteError, D>
for &RouteError
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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, D>(
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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteError {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::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, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl RouteReport {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.outcome {
return 7;
}
if let Some(_) = self.availability {
return 6;
}
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
}
}
impl fidl::encoding::ValueTypeMarker for RouteReport {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RouteReport, D>
for &RouteReport
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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, D>(
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, D>(
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, D>(
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, D>(
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>, D>(
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;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_decl::Availability, D>(
self.availability.as_ref().map(<fidl_fuchsia_component_decl::Availability as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<RouteOutcome, D>(
self.outcome
.as_ref()
.map(<RouteOutcome as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RouteReport {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::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, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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, D));
fidl::decode!(DeclType, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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, D));
fidl::decode!(RouteError, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <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>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<ServiceInstance>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_component_decl::Availability 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.availability.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_component_decl::Availability, D)
});
fidl::decode!(
fidl_fuchsia_component_decl::Availability,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<RouteOutcome 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.outcome.get_or_insert_with(|| fidl::new_empty!(RouteOutcome, D));
fidl::decode!(RouteOutcome, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl 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
}
}
impl fidl::encoding::ValueTypeMarker for ServiceInstance {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ServiceInstance, D>
for &ServiceInstance
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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, D>(
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, D>(
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, D>(
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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ServiceInstance {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::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, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::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, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl 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
}
}
impl fidl::encoding::ValueTypeMarker for StorageStatus {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StorageStatus, D>
for &StorageStatus
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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, D>(
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, D>(
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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StorageStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.total_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 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, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ChildLocation {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChildLocation, D>
for &ChildLocation
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
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>,
D,
>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
val,
),
encoder,
offset + 8,
_depth,
),
ChildLocation::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChildLocation {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => {
<fidl::encoding::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>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let ChildLocation::Collection(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
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(())
}
}
}