#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub type CapabilityId = u64;
pub type DictionaryKey = String;
pub type NewCapabilityId = u64;
pub type Token = fidl::EventPair;
pub type WrappedNewCapabilityId = WrappedCapabilityId;
pub const MAX_DATA_LENGTH: u32 = 8192;
pub const MAX_DICTIONARY_ITERATOR_CHUNK: u32 = 128;
pub const MAX_NAME_LENGTH: u64 = fidl_fuchsia_io::MAX_NAME_LENGTH as u64;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum Availability {
Required = 1,
Optional = 2,
SameAsTarget = 3,
Transitional = 4,
}
impl Availability {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Required),
2 => Some(Self::Optional),
3 => Some(Self::SameAsTarget),
4 => Some(Self::Transitional),
_ => 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 CapabilityStoreError {
IdNotFound,
IdAlreadyExists,
BadCapability,
WrongType,
NotDuplicatable,
ItemNotFound,
ItemAlreadyExists,
InvalidKey,
InvalidArgs,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! CapabilityStoreErrorUnknown {
() => {
_
};
}
impl CapabilityStoreError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::IdNotFound),
2 => Some(Self::IdAlreadyExists),
3 => Some(Self::BadCapability),
4 => Some(Self::WrongType),
5 => Some(Self::NotDuplicatable),
6 => Some(Self::ItemNotFound),
7 => Some(Self::ItemAlreadyExists),
8 => Some(Self::InvalidKey),
9 => Some(Self::InvalidArgs),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::IdNotFound,
2 => Self::IdAlreadyExists,
3 => Self::BadCapability,
4 => Self::WrongType,
5 => Self::NotDuplicatable,
6 => Self::ItemNotFound,
7 => Self::ItemAlreadyExists,
8 => Self::InvalidKey,
9 => Self::InvalidArgs,
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::IdNotFound => 1,
Self::IdAlreadyExists => 2,
Self::BadCapability => 3,
Self::WrongType => 4,
Self::NotDuplicatable => 5,
Self::ItemNotFound => 6,
Self::ItemAlreadyExists => 7,
Self::InvalidKey => 8,
Self::InvalidArgs => 9,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum DictionaryError {
NotFound,
AlreadyExists,
BadCapability,
InvalidKey,
NotCloneable,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! DictionaryErrorUnknown {
() => {
_
};
}
impl DictionaryError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::NotFound),
2 => Some(Self::AlreadyExists),
3 => Some(Self::BadCapability),
4 => Some(Self::InvalidKey),
5 => Some(Self::NotCloneable),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::NotFound,
2 => Self::AlreadyExists,
3 => Self::BadCapability,
4 => Self::InvalidKey,
5 => Self::NotCloneable,
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::NotFound => 1,
Self::AlreadyExists => 2,
Self::BadCapability => 3,
Self::InvalidKey => 4,
Self::NotCloneable => 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 RouterError {
NotFound,
InvalidArgs,
NotSupported,
Internal,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! RouterErrorUnknown {
() => {
_
};
}
impl RouterError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::NotFound),
2 => Some(Self::InvalidArgs),
3 => Some(Self::NotSupported),
4 => Some(Self::Internal),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::NotFound,
2 => Self::InvalidArgs,
3 => Self::NotSupported,
4 => Self::Internal,
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::NotFound => 1,
Self::InvalidArgs => 2,
Self::NotSupported => 3,
Self::Internal => 4,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreConnectorCreateRequest {
pub id: u64,
pub receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreConnectorCreateRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreConnectorOpenRequest {
pub id: u64,
pub server_end: fidl::Channel,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreConnectorOpenRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CapabilityStoreDictionaryCopyRequest {
pub id: u64,
pub dest_id: u64,
}
impl fidl::Persistable for CapabilityStoreDictionaryCopyRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CapabilityStoreDictionaryCreateRequest {
pub id: u64,
}
impl fidl::Persistable for CapabilityStoreDictionaryCreateRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDictionaryDrainRequest {
pub id: u64,
pub iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryDrainRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDictionaryEnumerateRequest {
pub id: u64,
pub iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryEnumerateRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDictionaryGetRequest {
pub id: u64,
pub key: String,
pub dest_id: u64,
}
impl fidl::Persistable for CapabilityStoreDictionaryGetRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDictionaryInsertRequest {
pub id: u64,
pub item: DictionaryItem,
}
impl fidl::Persistable for CapabilityStoreDictionaryInsertRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDictionaryKeysRequest {
pub id: u64,
pub iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryKeysRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDictionaryLegacyExportRequest {
pub id: u64,
pub server_end: fidl::Channel,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryLegacyExportRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDictionaryLegacyImportRequest {
pub id: u64,
pub client_end: fidl::Channel,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryLegacyImportRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDictionaryRemoveRequest {
pub id: u64,
pub key: String,
pub dest_id: Option<Box<WrappedCapabilityId>>,
}
impl fidl::Persistable for CapabilityStoreDictionaryRemoveRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDirConnectorCreateRequest {
pub id: u64,
pub receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDirConnectorCreateRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CapabilityStoreDirConnectorOpenRequest {
pub id: u64,
pub server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDirConnectorOpenRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CapabilityStoreDropRequest {
pub id: u64,
}
impl fidl::Persistable for CapabilityStoreDropRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CapabilityStoreDuplicateRequest {
pub id: u64,
pub dest_id: u64,
}
impl fidl::Persistable for CapabilityStoreDuplicateRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CapabilityStoreExportRequest {
pub id: u64,
}
impl fidl::Persistable for CapabilityStoreExportRequest {}
#[derive(Debug, PartialEq)]
pub struct CapabilityStoreImportRequest {
pub id: u64,
pub capability: Capability,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreImportRequest
{
}
#[derive(Debug, PartialEq)]
pub struct CapabilityStoreExportResponse {
pub capability: Capability,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreExportResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Connector {
pub token: fidl::EventPair,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DictionaryDrainIteratorGetNextRequest {
pub start_id: u64,
pub limit: u32,
}
impl fidl::Persistable for DictionaryDrainIteratorGetNextRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DictionaryDrainIteratorGetNextResponse {
pub items: Vec<DictionaryItem>,
pub end_id: u64,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DictionaryDrainIteratorGetNextResponse
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DictionaryEnumerateIteratorGetNextRequest {
pub start_id: u64,
pub limit: u32,
}
impl fidl::Persistable for DictionaryEnumerateIteratorGetNextRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DictionaryEnumerateIteratorGetNextResponse {
pub items: Vec<DictionaryOptionalItem>,
pub end_id: u64,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DictionaryEnumerateIteratorGetNextResponse
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DictionaryItem {
pub key: String,
pub value: u64,
}
impl fidl::Persistable for DictionaryItem {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DictionaryKeysIteratorGetNextResponse {
pub keys: Vec<String>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DictionaryKeysIteratorGetNextResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DictionaryOptionalItem {
pub key: String,
pub value: Option<Box<WrappedCapabilityId>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryOptionalItem {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DictionaryRef {
pub token: fidl::EventPair,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirConnector {
pub token: fidl::EventPair,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirEntry {
pub token: fidl::EventPair,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DirReceiverReceiveRequest {
pub channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirReceiverReceiveRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InstanceToken {
pub token: fidl::EventPair,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ProtocolPayload {
pub channel: fidl::Channel,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ProtocolPayload {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Unavailable;
impl fidl::Persistable for Unavailable {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Unit;
impl fidl::Persistable for Unit {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct WrappedCapabilityId {
pub id: u64,
}
impl fidl::Persistable for WrappedCapabilityId {}
#[derive(Debug, Default, PartialEq)]
pub struct RouteRequest {
pub requesting: Option<InstanceToken>,
pub metadata: Option<DictionaryRef>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {}
#[derive(Debug)]
pub enum Capability {
Unit(Unit),
Handle(fidl::Handle),
Data(Data),
Dictionary(DictionaryRef),
Connector(Connector),
DirConnector(DirConnector),
Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
DirEntry(DirEntry),
ConnectorRouter(fidl::endpoints::ClientEnd<ConnectorRouterMarker>),
DictionaryRouter(fidl::endpoints::ClientEnd<DictionaryRouterMarker>),
DirEntryRouter(fidl::endpoints::ClientEnd<DirEntryRouterMarker>),
DataRouter(fidl::endpoints::ClientEnd<DataRouterMarker>),
DirConnectorRouter(fidl::endpoints::ClientEnd<DirConnectorRouterMarker>),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! CapabilityUnknown {
() => {
_
};
}
impl PartialEq for Capability {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Unit(x), Self::Unit(y)) => *x == *y,
(Self::Handle(x), Self::Handle(y)) => *x == *y,
(Self::Data(x), Self::Data(y)) => *x == *y,
(Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
(Self::Connector(x), Self::Connector(y)) => *x == *y,
(Self::DirConnector(x), Self::DirConnector(y)) => *x == *y,
(Self::Directory(x), Self::Directory(y)) => *x == *y,
(Self::DirEntry(x), Self::DirEntry(y)) => *x == *y,
(Self::ConnectorRouter(x), Self::ConnectorRouter(y)) => *x == *y,
(Self::DictionaryRouter(x), Self::DictionaryRouter(y)) => *x == *y,
(Self::DirEntryRouter(x), Self::DirEntryRouter(y)) => *x == *y,
(Self::DataRouter(x), Self::DataRouter(y)) => *x == *y,
(Self::DirConnectorRouter(x), Self::DirConnectorRouter(y)) => *x == *y,
_ => false,
}
}
}
impl Capability {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Unit(_) => 1,
Self::Handle(_) => 2,
Self::Data(_) => 3,
Self::Dictionary(_) => 4,
Self::Connector(_) => 5,
Self::DirConnector(_) => 6,
Self::Directory(_) => 7,
Self::DirEntry(_) => 8,
Self::ConnectorRouter(_) => 9,
Self::DictionaryRouter(_) => 10,
Self::DirEntryRouter(_) => 11,
Self::DataRouter(_) => 12,
Self::DirConnectorRouter(_) => 13,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum ConnectorRouterRouteResponse {
Connector(Connector),
Unavailable(Unit),
}
impl ConnectorRouterRouteResponse {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Connector(_) => 1,
Self::Unavailable(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ConnectorRouterRouteResponse
{
}
#[derive(Clone, Debug)]
pub enum Data {
Bytes(Vec<u8>),
String(String),
Int64(i64),
Uint64(u64),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! DataUnknown {
() => {
_
};
}
impl PartialEq for Data {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Bytes(x), Self::Bytes(y)) => *x == *y,
(Self::String(x), Self::String(y)) => *x == *y,
(Self::Int64(x), Self::Int64(y)) => *x == *y,
(Self::Uint64(x), Self::Uint64(y)) => *x == *y,
_ => false,
}
}
}
impl Data {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Bytes(_) => 1,
Self::String(_) => 2,
Self::Int64(_) => 3,
Self::Uint64(_) => 4,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for Data {}
#[derive(Debug, PartialEq)]
pub enum DataRouterRouteResponse {
Data(Data),
Unavailable(Unit),
}
impl DataRouterRouteResponse {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Data(_) => 1,
Self::Unavailable(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum DictionaryRouterRouteResponse {
Dictionary(DictionaryRef),
Unavailable(Unit),
}
impl DictionaryRouterRouteResponse {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Dictionary(_) => 1,
Self::Unavailable(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DictionaryRouterRouteResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum DirConnectorRouterRouteResponse {
DirConnector(DirConnector),
Unavailable(Unit),
}
impl DirConnectorRouterRouteResponse {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::DirConnector(_) => 1,
Self::Unavailable(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DirConnectorRouterRouteResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum DirEntryRouterRouteResponse {
DirEntry(DirEntry),
Unavailable(Unit),
}
impl DirEntryRouterRouteResponse {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::DirEntry(_) => 1,
Self::Unavailable(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DirEntryRouterRouteResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum DirectoryRouterRouteResponse {
Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
Unavailable(Unit),
}
impl DirectoryRouterRouteResponse {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Directory(_) => 1,
Self::Unavailable(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryRouterRouteResponse
{
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CapabilityStoreMarker;
impl fidl::endpoints::ProtocolMarker for CapabilityStoreMarker {
type Proxy = CapabilityStoreProxy;
type RequestStream = CapabilityStoreRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CapabilityStoreSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
}
impl fidl::endpoints::DiscoverableProtocolMarker for CapabilityStoreMarker {}
pub type CapabilityStoreDuplicateResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDropResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreExportResult = Result<Capability, CapabilityStoreError>;
pub type CapabilityStoreImportResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreConnectorCreateResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreConnectorOpenResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDirConnectorCreateResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDirConnectorOpenResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryCreateResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryLegacyImportResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryLegacyExportResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryInsertResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryGetResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryRemoveResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryCopyResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryKeysResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryEnumerateResult = Result<(), CapabilityStoreError>;
pub type CapabilityStoreDictionaryDrainResult = Result<(), CapabilityStoreError>;
pub trait CapabilityStoreProxyInterface: Send + Sync {
type DuplicateResponseFut: std::future::Future<Output = Result<CapabilityStoreDuplicateResult, fidl::Error>>
+ Send;
fn r#duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut;
type DropResponseFut: std::future::Future<Output = Result<CapabilityStoreDropResult, fidl::Error>>
+ Send;
fn r#drop(&self, id: u64) -> Self::DropResponseFut;
type ExportResponseFut: std::future::Future<Output = Result<CapabilityStoreExportResult, fidl::Error>>
+ Send;
fn r#export(&self, id: u64) -> Self::ExportResponseFut;
type ImportResponseFut: std::future::Future<Output = Result<CapabilityStoreImportResult, fidl::Error>>
+ Send;
fn r#import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut;
type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorCreateResult, fidl::Error>>
+ Send;
fn r#connector_create(
&self,
id: u64,
receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
) -> Self::ConnectorCreateResponseFut;
type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorOpenResult, fidl::Error>>
+ Send;
fn r#connector_open(
&self,
id: u64,
server_end: fidl::Channel,
) -> Self::ConnectorOpenResponseFut;
type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorCreateResult, fidl::Error>>
+ Send;
fn r#dir_connector_create(
&self,
id: u64,
receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
) -> Self::DirConnectorCreateResponseFut;
type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorOpenResult, fidl::Error>>
+ Send;
fn r#dir_connector_open(
&self,
id: u64,
server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::DirConnectorOpenResponseFut;
type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCreateResult, fidl::Error>>
+ Send;
fn r#dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut;
type DictionaryLegacyImportResponseFut: std::future::Future<
Output = Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error>,
> + Send;
fn r#dictionary_legacy_import(
&self,
id: u64,
client_end: fidl::Channel,
) -> Self::DictionaryLegacyImportResponseFut;
type DictionaryLegacyExportResponseFut: std::future::Future<
Output = Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error>,
> + Send;
fn r#dictionary_legacy_export(
&self,
id: u64,
server_end: fidl::Channel,
) -> Self::DictionaryLegacyExportResponseFut;
type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryInsertResult, fidl::Error>>
+ Send;
fn r#dictionary_insert(
&self,
id: u64,
item: &DictionaryItem,
) -> Self::DictionaryInsertResponseFut;
type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryGetResult, fidl::Error>>
+ Send;
fn r#dictionary_get(&self, id: u64, key: &str, dest_id: u64) -> Self::DictionaryGetResponseFut;
type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryRemoveResult, fidl::Error>>
+ Send;
fn r#dictionary_remove(
&self,
id: u64,
key: &str,
dest_id: Option<&WrappedCapabilityId>,
) -> Self::DictionaryRemoveResponseFut;
type DictionaryCopyResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCopyResult, fidl::Error>>
+ Send;
fn r#dictionary_copy(&self, id: u64, dest_id: u64) -> Self::DictionaryCopyResponseFut;
type DictionaryKeysResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryKeysResult, fidl::Error>>
+ Send;
fn r#dictionary_keys(
&self,
id: u64,
iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
) -> Self::DictionaryKeysResponseFut;
type DictionaryEnumerateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error>>
+ Send;
fn r#dictionary_enumerate(
&self,
id: u64,
iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
) -> Self::DictionaryEnumerateResponseFut;
type DictionaryDrainResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryDrainResult, fidl::Error>>
+ Send;
fn r#dictionary_drain(
&self,
id: u64,
iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
) -> Self::DictionaryDrainResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CapabilityStoreSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CapabilityStoreSynchronousProxy {
type Proxy = CapabilityStoreProxy;
type Protocol = CapabilityStoreMarker;
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 CapabilityStoreSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <CapabilityStoreMarker 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<CapabilityStoreEvent, fidl::Error> {
CapabilityStoreEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#duplicate(
&self,
mut id: u64,
mut dest_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
let _response =
self.client
.send_query::<CapabilityStoreDuplicateRequest, fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
(id, dest_id),
0x5d5d35d9c20a2184,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("duplicate")?;
Ok(_response.map(|x| x))
}
pub fn r#drop(
&self,
mut id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDropResult, fidl::Error> {
let _response =
self.client
.send_query::<CapabilityStoreDropRequest, fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
(id,), 0xa745c0990fc2559, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
)?
.into_result::<CapabilityStoreMarker>("drop")?;
Ok(_response.map(|x| x))
}
pub fn r#export(
&self,
mut id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreExportResult, fidl::Error> {
let _response =
self.client
.send_query::<CapabilityStoreExportRequest, fidl::encoding::FlexibleResultType<
CapabilityStoreExportResponse,
CapabilityStoreError,
>>(
(id,), 0x3237a8f4748faff, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
)?
.into_result::<CapabilityStoreMarker>("export")?;
Ok(_response.map(|x| x.capability))
}
pub fn r#import(
&self,
mut id: u64,
mut capability: Capability,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreImportResult, fidl::Error> {
let _response =
self.client
.send_query::<CapabilityStoreImportRequest, fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
(id, &mut capability),
0x1f96157a29f4539b,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("import")?;
Ok(_response.map(|x| x))
}
pub fn r#connector_create(
&self,
mut id: u64,
mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreConnectorCreateRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, receiver,),
0x29592c5d63e91c25,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("connector_create")?;
Ok(_response.map(|x| x))
}
pub fn r#connector_open(
&self,
mut id: u64,
mut server_end: fidl::Channel,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreConnectorOpenRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, server_end,),
0x537e69ab40563b9f,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("connector_open")?;
Ok(_response.map(|x| x))
}
pub fn r#dir_connector_create(
&self,
mut id: u64,
mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDirConnectorCreateRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, receiver,),
0x186138a11ccf19bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dir_connector_create")?;
Ok(_response.map(|x| x))
}
pub fn r#dir_connector_open(
&self,
mut id: u64,
mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDirConnectorOpenRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, server_end,),
0x5650d3d6a3a13901,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dir_connector_open")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_create(
&self,
mut id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryCreateRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id,),
0x6997c8dfc63de093,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_create")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_legacy_import(
&self,
mut id: u64,
mut client_end: fidl::Channel,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryLegacyImportRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, client_end,),
0x72fd686c37b6025f,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_legacy_export(
&self,
mut id: u64,
mut server_end: fidl::Channel,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryLegacyExportRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, server_end,),
0x407e15cc4bde5dcd,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_insert(
&self,
mut id: u64,
mut item: &DictionaryItem,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryInsertRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, item,),
0x7702183689d44c27,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_insert")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_get(
&self,
mut id: u64,
mut key: &str,
mut dest_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryGetRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, key, dest_id,),
0x4d9e27538284add2,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_get")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_remove(
&self,
mut id: u64,
mut key: &str,
mut dest_id: Option<&WrappedCapabilityId>,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryRemoveRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, key, dest_id,),
0x4c5c025ab05d4f3,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_remove")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_copy(
&self,
mut id: u64,
mut dest_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryCopyRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, dest_id,),
0x3733ecdf4ea1b44f,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_copy")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_keys(
&self,
mut id: u64,
mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryKeysRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, iterator,),
0x84b05577ceaec9e,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_keys")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_enumerate(
&self,
mut id: u64,
mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryEnumerateRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, iterator,),
0xd6279b6ced04641,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
Ok(_response.map(|x| x))
}
pub fn r#dictionary_drain(
&self,
mut id: u64,
mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
___deadline: zx::MonotonicInstant,
) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
let _response = self.client.send_query::<
CapabilityStoreDictionaryDrainRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
>(
(id, iterator,),
0x28a3a3f84d928cd8,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<CapabilityStoreMarker>("dictionary_drain")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct CapabilityStoreProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CapabilityStoreProxy {
type Protocol = CapabilityStoreMarker;
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 CapabilityStoreProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#duplicate(
&self,
mut id: u64,
mut dest_id: u64,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDuplicateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
}
pub fn r#drop(
&self,
mut id: u64,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDropResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#drop(self, id)
}
pub fn r#export(
&self,
mut id: u64,
) -> fidl::client::QueryResponseFut<
CapabilityStoreExportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#export(self, id)
}
pub fn r#import(
&self,
mut id: u64,
mut capability: Capability,
) -> fidl::client::QueryResponseFut<
CapabilityStoreImportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#import(self, id, capability)
}
pub fn r#connector_create(
&self,
mut id: u64,
mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
) -> fidl::client::QueryResponseFut<
CapabilityStoreConnectorCreateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
}
pub fn r#connector_open(
&self,
mut id: u64,
mut server_end: fidl::Channel,
) -> fidl::client::QueryResponseFut<
CapabilityStoreConnectorOpenResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
}
pub fn r#dir_connector_create(
&self,
mut id: u64,
mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDirConnectorCreateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
}
pub fn r#dir_connector_open(
&self,
mut id: u64,
mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDirConnectorOpenResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dir_connector_open(self, id, server_end)
}
pub fn r#dictionary_create(
&self,
mut id: u64,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryCreateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_create(self, id)
}
pub fn r#dictionary_legacy_import(
&self,
mut id: u64,
mut client_end: fidl::Channel,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryLegacyImportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
}
pub fn r#dictionary_legacy_export(
&self,
mut id: u64,
mut server_end: fidl::Channel,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryLegacyExportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
}
pub fn r#dictionary_insert(
&self,
mut id: u64,
mut item: &DictionaryItem,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryInsertResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
}
pub fn r#dictionary_get(
&self,
mut id: u64,
mut key: &str,
mut dest_id: u64,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryGetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
}
pub fn r#dictionary_remove(
&self,
mut id: u64,
mut key: &str,
mut dest_id: Option<&WrappedCapabilityId>,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryRemoveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
}
pub fn r#dictionary_copy(
&self,
mut id: u64,
mut dest_id: u64,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryCopyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
}
pub fn r#dictionary_keys(
&self,
mut id: u64,
mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryKeysResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
}
pub fn r#dictionary_enumerate(
&self,
mut id: u64,
mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryEnumerateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
}
pub fn r#dictionary_drain(
&self,
mut id: u64,
mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
) -> fidl::client::QueryResponseFut<
CapabilityStoreDictionaryDrainResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
}
}
impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
type DuplicateResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDuplicateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5d5d35d9c20a2184,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("duplicate")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDuplicateRequest,
CapabilityStoreDuplicateResult,
>(
(id, dest_id,),
0x5d5d35d9c20a2184,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DropResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDropResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDropResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xa745c0990fc2559,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("drop")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
(id,),
0xa745c0990fc2559,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type ExportResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreExportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreExportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
CapabilityStoreExportResponse,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3237a8f4748faff,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("export")?;
Ok(_response.map(|x| x.capability))
}
self.client
.send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
(id,),
0x3237a8f4748faff,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type ImportResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreImportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreImportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1f96157a29f4539b,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("import")?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
(id, &mut capability),
0x1f96157a29f4539b,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreConnectorCreateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#connector_create(
&self,
mut id: u64,
mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
) -> Self::ConnectorCreateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x29592c5d63e91c25,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("connector_create")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreConnectorCreateRequest,
CapabilityStoreConnectorCreateResult,
>(
(id, receiver,),
0x29592c5d63e91c25,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreConnectorOpenResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#connector_open(
&self,
mut id: u64,
mut server_end: fidl::Channel,
) -> Self::ConnectorOpenResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x537e69ab40563b9f,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("connector_open")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreConnectorOpenRequest,
CapabilityStoreConnectorOpenResult,
>(
(id, server_end,),
0x537e69ab40563b9f,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDirConnectorCreateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dir_connector_create(
&self,
mut id: u64,
mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
) -> Self::DirConnectorCreateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x186138a11ccf19bb,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dir_connector_create")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDirConnectorCreateRequest,
CapabilityStoreDirConnectorCreateResult,
>(
(id, receiver,),
0x186138a11ccf19bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDirConnectorOpenResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dir_connector_open(
&self,
mut id: u64,
mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Self::DirConnectorOpenResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5650d3d6a3a13901,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dir_connector_open")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDirConnectorOpenRequest,
CapabilityStoreDirConnectorOpenResult,
>(
(id, server_end,),
0x5650d3d6a3a13901,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryCreateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6997c8dfc63de093,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_create")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryCreateRequest,
CapabilityStoreDictionaryCreateResult,
>(
(id,),
0x6997c8dfc63de093,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryLegacyImportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_legacy_import(
&self,
mut id: u64,
mut client_end: fidl::Channel,
) -> Self::DictionaryLegacyImportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x72fd686c37b6025f,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryLegacyImportRequest,
CapabilityStoreDictionaryLegacyImportResult,
>(
(id, client_end,),
0x72fd686c37b6025f,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryLegacyExportResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_legacy_export(
&self,
mut id: u64,
mut server_end: fidl::Channel,
) -> Self::DictionaryLegacyExportResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x407e15cc4bde5dcd,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryLegacyExportRequest,
CapabilityStoreDictionaryLegacyExportResult,
>(
(id, server_end,),
0x407e15cc4bde5dcd,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryInsertResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_insert(
&self,
mut id: u64,
mut item: &DictionaryItem,
) -> Self::DictionaryInsertResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7702183689d44c27,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_insert")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryInsertRequest,
CapabilityStoreDictionaryInsertResult,
>(
(id, item,),
0x7702183689d44c27,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryGetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_get(
&self,
mut id: u64,
mut key: &str,
mut dest_id: u64,
) -> Self::DictionaryGetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4d9e27538284add2,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_get")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryGetRequest,
CapabilityStoreDictionaryGetResult,
>(
(id, key, dest_id,),
0x4d9e27538284add2,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryRemoveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_remove(
&self,
mut id: u64,
mut key: &str,
mut dest_id: Option<&WrappedCapabilityId>,
) -> Self::DictionaryRemoveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4c5c025ab05d4f3,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_remove")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryRemoveRequest,
CapabilityStoreDictionaryRemoveResult,
>(
(id, key, dest_id,),
0x4c5c025ab05d4f3,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryCopyResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3733ecdf4ea1b44f,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_copy")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryCopyRequest,
CapabilityStoreDictionaryCopyResult,
>(
(id, dest_id,),
0x3733ecdf4ea1b44f,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryKeysResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_keys(
&self,
mut id: u64,
mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
) -> Self::DictionaryKeysResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x84b05577ceaec9e,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_keys")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryKeysRequest,
CapabilityStoreDictionaryKeysResult,
>(
(id, iterator,),
0x84b05577ceaec9e,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryEnumerateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_enumerate(
&self,
mut id: u64,
mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
) -> Self::DictionaryEnumerateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xd6279b6ced04641,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryEnumerateRequest,
CapabilityStoreDictionaryEnumerateResult,
>(
(id, iterator,),
0xd6279b6ced04641,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
CapabilityStoreDictionaryDrainResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#dictionary_drain(
&self,
mut id: u64,
mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
) -> Self::DictionaryDrainResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x28a3a3f84d928cd8,
>(_buf?)?
.into_result::<CapabilityStoreMarker>("dictionary_drain")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CapabilityStoreDictionaryDrainRequest,
CapabilityStoreDictionaryDrainResult,
>(
(id, iterator,),
0x28a3a3f84d928cd8,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct CapabilityStoreEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CapabilityStoreEventStream {}
impl futures::stream::FusedStream for CapabilityStoreEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CapabilityStoreEventStream {
type Item = Result<CapabilityStoreEvent, 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(CapabilityStoreEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CapabilityStoreEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl CapabilityStoreEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CapabilityStoreEvent, 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(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CapabilityStoreRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CapabilityStoreRequestStream {}
impl futures::stream::FusedStream for CapabilityStoreRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CapabilityStoreRequestStream {
type Protocol = CapabilityStoreMarker;
type ControlHandle = CapabilityStoreControlHandle;
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 {
CapabilityStoreControlHandle { 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 CapabilityStoreRequestStream {
type Item = Result<CapabilityStoreRequest, 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 CapabilityStoreRequestStream 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 {
0x5d5d35d9c20a2184 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDuplicateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::Duplicate {
id: req.id,
dest_id: req.dest_id,
responder: CapabilityStoreDuplicateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xa745c0990fc2559 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDropRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::Drop {
id: req.id,
responder: CapabilityStoreDropResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3237a8f4748faff => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreExportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::Export {
id: req.id,
responder: CapabilityStoreExportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1f96157a29f4539b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreImportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::Import {
id: req.id,
capability: req.capability,
responder: CapabilityStoreImportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x29592c5d63e91c25 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreConnectorCreateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::ConnectorCreate {
id: req.id,
receiver: req.receiver,
responder: CapabilityStoreConnectorCreateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x537e69ab40563b9f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreConnectorOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::ConnectorOpen {
id: req.id,
server_end: req.server_end,
responder: CapabilityStoreConnectorOpenResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x186138a11ccf19bb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDirConnectorCreateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DirConnectorCreate {
id: req.id,
receiver: req.receiver,
responder: CapabilityStoreDirConnectorCreateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5650d3d6a3a13901 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDirConnectorOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DirConnectorOpen {
id: req.id,
server_end: req.server_end,
responder: CapabilityStoreDirConnectorOpenResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6997c8dfc63de093 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryCreateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryCreate {
id: req.id,
responder: CapabilityStoreDictionaryCreateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x72fd686c37b6025f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryLegacyImportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryLegacyImport {
id: req.id,
client_end: req.client_end,
responder: CapabilityStoreDictionaryLegacyImportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x407e15cc4bde5dcd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryLegacyExportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryLegacyExport {
id: req.id,
server_end: req.server_end,
responder: CapabilityStoreDictionaryLegacyExportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7702183689d44c27 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryInsertRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryInsert {
id: req.id,
item: req.item,
responder: CapabilityStoreDictionaryInsertResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4d9e27538284add2 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryGetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryGet {
id: req.id,
key: req.key,
dest_id: req.dest_id,
responder: CapabilityStoreDictionaryGetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4c5c025ab05d4f3 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryRemoveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryRemove {
id: req.id,
key: req.key,
dest_id: req.dest_id,
responder: CapabilityStoreDictionaryRemoveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3733ecdf4ea1b44f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryCopyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryCopy {
id: req.id,
dest_id: req.dest_id,
responder: CapabilityStoreDictionaryCopyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x84b05577ceaec9e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryKeysRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryKeys {
id: req.id,
iterator: req.iterator,
responder: CapabilityStoreDictionaryKeysResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xd6279b6ced04641 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryEnumerateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryEnumerate {
id: req.id,
iterator: req.iterator,
responder: CapabilityStoreDictionaryEnumerateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x28a3a3f84d928cd8 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CapabilityStoreDictionaryDrainRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CapabilityStoreControlHandle { inner: this.inner.clone() };
Ok(CapabilityStoreRequest::DictionaryDrain {
id: req.id,
iterator: req.iterator,
responder: CapabilityStoreDictionaryDrainResponder {
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(CapabilityStoreRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: CapabilityStoreControlHandle {
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(CapabilityStoreRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: CapabilityStoreControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CapabilityStoreRequest {
Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
Drop { id: u64, responder: CapabilityStoreDropResponder },
Export { id: u64, responder: CapabilityStoreExportResponder },
Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
ConnectorCreate {
id: u64,
receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
responder: CapabilityStoreConnectorCreateResponder,
},
ConnectorOpen {
id: u64,
server_end: fidl::Channel,
responder: CapabilityStoreConnectorOpenResponder,
},
DirConnectorCreate {
id: u64,
receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
responder: CapabilityStoreDirConnectorCreateResponder,
},
DirConnectorOpen {
id: u64,
server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
responder: CapabilityStoreDirConnectorOpenResponder,
},
DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
DictionaryLegacyImport {
id: u64,
client_end: fidl::Channel,
responder: CapabilityStoreDictionaryLegacyImportResponder,
},
DictionaryLegacyExport {
id: u64,
server_end: fidl::Channel,
responder: CapabilityStoreDictionaryLegacyExportResponder,
},
DictionaryInsert {
id: u64,
item: DictionaryItem,
responder: CapabilityStoreDictionaryInsertResponder,
},
DictionaryGet {
id: u64,
key: String,
dest_id: u64,
responder: CapabilityStoreDictionaryGetResponder,
},
DictionaryRemove {
id: u64,
key: String,
dest_id: Option<Box<WrappedCapabilityId>>,
responder: CapabilityStoreDictionaryRemoveResponder,
},
DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
DictionaryKeys {
id: u64,
iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
responder: CapabilityStoreDictionaryKeysResponder,
},
DictionaryEnumerate {
id: u64,
iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
responder: CapabilityStoreDictionaryEnumerateResponder,
},
DictionaryDrain {
id: u64,
iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
responder: CapabilityStoreDictionaryDrainResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: CapabilityStoreControlHandle,
method_type: fidl::MethodType,
},
}
impl CapabilityStoreRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
Some((id, dest_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
if let CapabilityStoreRequest::Drop { id, responder } = self {
Some((id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
if let CapabilityStoreRequest::Export { id, responder } = self {
Some((id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
if let CapabilityStoreRequest::Import { id, capability, responder } = self {
Some((id, capability, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_connector_create(
self,
) -> Option<(
u64,
fidl::endpoints::ClientEnd<ReceiverMarker>,
CapabilityStoreConnectorCreateResponder,
)> {
if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
Some((id, receiver, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_connector_open(
self,
) -> Option<(u64, fidl::Channel, CapabilityStoreConnectorOpenResponder)> {
if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
Some((id, server_end, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dir_connector_create(
self,
) -> Option<(
u64,
fidl::endpoints::ClientEnd<DirReceiverMarker>,
CapabilityStoreDirConnectorCreateResponder,
)> {
if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
Some((id, receiver, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dir_connector_open(
self,
) -> Option<(
u64,
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
CapabilityStoreDirConnectorOpenResponder,
)> {
if let CapabilityStoreRequest::DirConnectorOpen { id, server_end, responder } = self {
Some((id, server_end, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
Some((id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_legacy_import(
self,
) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyImportResponder)> {
if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
Some((id, client_end, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_legacy_export(
self,
) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyExportResponder)> {
if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
Some((id, server_end, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_insert(
self,
) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
Some((id, item, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_get(
self,
) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
Some((id, key, dest_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_remove(
self,
) -> Option<(
u64,
String,
Option<Box<WrappedCapabilityId>>,
CapabilityStoreDictionaryRemoveResponder,
)> {
if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
Some((id, key, dest_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_copy(
self,
) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
Some((id, dest_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_keys(
self,
) -> Option<(
u64,
fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
CapabilityStoreDictionaryKeysResponder,
)> {
if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
Some((id, iterator, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_enumerate(
self,
) -> Option<(
u64,
fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
CapabilityStoreDictionaryEnumerateResponder,
)> {
if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
Some((id, iterator, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dictionary_drain(
self,
) -> Option<(
u64,
Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
CapabilityStoreDictionaryDrainResponder,
)> {
if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
Some((id, iterator, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CapabilityStoreRequest::Duplicate { .. } => "duplicate",
CapabilityStoreRequest::Drop { .. } => "drop",
CapabilityStoreRequest::Export { .. } => "export",
CapabilityStoreRequest::Import { .. } => "import",
CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
CapabilityStoreRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
CapabilityStoreRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct CapabilityStoreControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CapabilityStoreControlHandle {
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 CapabilityStoreControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDuplicateResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDuplicateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDuplicateResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDuplicateResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x5d5d35d9c20a2184,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDropResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDropResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDropResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDropResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0xa745c0990fc2559,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreExportResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreExportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreExportResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreExportResponder {
pub fn send(
self,
mut result: Result<Capability, CapabilityStoreError>,
) -> 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<Capability, CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<Capability, CapabilityStoreError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
CapabilityStoreExportResponse,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(
result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
),
self.tx_id,
0x3237a8f4748faff,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreImportResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreImportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreImportResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreImportResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x1f96157a29f4539b,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreConnectorCreateResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreConnectorCreateResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreConnectorCreateResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x29592c5d63e91c25,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreConnectorOpenResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreConnectorOpenResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreConnectorOpenResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x537e69ab40563b9f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDirConnectorCreateResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDirConnectorCreateResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDirConnectorCreateResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x186138a11ccf19bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDirConnectorOpenResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDirConnectorOpenResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDirConnectorOpenResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x5650d3d6a3a13901,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryCreateResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryCreateResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryCreateResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x6997c8dfc63de093,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryLegacyImportResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyImportResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryLegacyImportResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x72fd686c37b6025f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryLegacyExportResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyExportResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryLegacyExportResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x407e15cc4bde5dcd,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryInsertResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryInsertResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryInsertResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x7702183689d44c27,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryGetResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryGetResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryGetResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x4d9e27538284add2,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryRemoveResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryRemoveResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryRemoveResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x4c5c025ab05d4f3,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryCopyResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryCopyResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryCopyResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x3733ecdf4ea1b44f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryKeysResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryKeysResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryKeysResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x84b05577ceaec9e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryEnumerateResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryEnumerateResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryEnumerateResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0xd6279b6ced04641,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CapabilityStoreDictionaryDrainResponder {
control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CapabilityStoreDictionaryDrainResponder {
type ControlHandle = CapabilityStoreControlHandle;
fn control_handle(&self) -> &CapabilityStoreControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CapabilityStoreDictionaryDrainResponder {
pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> 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<(), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x28a3a3f84d928cd8,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ConnectorRouterMarker;
impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
type Proxy = ConnectorRouterProxy;
type RequestStream = ConnectorRouterRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ConnectorRouterSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ConnectorRouterMarker {}
pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
pub trait ConnectorRouterProxyInterface: Send + Sync {
type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
+ Send;
fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ConnectorRouterSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
type Proxy = ConnectorRouterProxy;
type Protocol = ConnectorRouterMarker;
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 ConnectorRouterSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ConnectorRouterMarker 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<ConnectorRouterEvent, fidl::Error> {
ConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#route(
&self,
mut payload: RouteRequest,
___deadline: zx::MonotonicInstant,
) -> Result<ConnectorRouterRouteResult, fidl::Error> {
let _response = self.client.send_query::<
RouteRequest,
fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
>(
&mut payload,
0x74dbb8bc13730766,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<ConnectorRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct ConnectorRouterProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ConnectorRouterProxy {
type Protocol = ConnectorRouterMarker;
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 ConnectorRouterProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#route(
&self,
mut payload: RouteRequest,
) -> fidl::client::QueryResponseFut<
ConnectorRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ConnectorRouterProxyInterface::r#route(self, payload)
}
}
impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
type RouteResponseFut = fidl::client::QueryResponseFut<
ConnectorRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ConnectorRouterRouteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x74dbb8bc13730766,
>(_buf?)?
.into_result::<ConnectorRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
&mut payload,
0x74dbb8bc13730766,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct ConnectorRouterEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ConnectorRouterEventStream {}
impl futures::stream::FusedStream for ConnectorRouterEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ConnectorRouterEventStream {
type Item = Result<ConnectorRouterEvent, 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(ConnectorRouterEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ConnectorRouterEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl ConnectorRouterEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ConnectorRouterEvent, 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(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ConnectorRouterRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ConnectorRouterRequestStream {}
impl futures::stream::FusedStream for ConnectorRouterRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
type Protocol = ConnectorRouterMarker;
type ControlHandle = ConnectorRouterControlHandle;
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 {
ConnectorRouterControlHandle { 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 ConnectorRouterRequestStream {
type Item = Result<ConnectorRouterRequest, 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 ConnectorRouterRequestStream 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 {
0x74dbb8bc13730766 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RouteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ConnectorRouterControlHandle { inner: this.inner.clone() };
Ok(ConnectorRouterRequest::Route {
payload: req,
responder: ConnectorRouterRouteResponder {
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(ConnectorRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: ConnectorRouterControlHandle {
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(ConnectorRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: ConnectorRouterControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ConnectorRouterRequest {
Route {
payload: RouteRequest,
responder: ConnectorRouterRouteResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: ConnectorRouterControlHandle,
method_type: fidl::MethodType,
},
}
impl ConnectorRouterRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
if let ConnectorRouterRequest::Route { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ConnectorRouterRequest::Route { .. } => "route",
ConnectorRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
ConnectorRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct ConnectorRouterControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
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 ConnectorRouterControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ConnectorRouterRouteResponder {
control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ConnectorRouterRouteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
type ControlHandle = ConnectorRouterControlHandle;
fn control_handle(&self) -> &ConnectorRouterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ConnectorRouterRouteResponder {
pub fn send(
self,
mut result: Result<ConnectorRouterRouteResponse, RouterError>,
) -> 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<ConnectorRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<ConnectorRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
ConnectorRouterRouteResponse,
RouterError,
>>(
fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
self.tx_id,
0x74dbb8bc13730766,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DataRouterMarker;
impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
type Proxy = DataRouterProxy;
type RequestStream = DataRouterRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DataRouterSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DataRouterMarker {}
pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
pub trait DataRouterProxyInterface: Send + Sync {
type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
+ Send;
fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DataRouterSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
type Proxy = DataRouterProxy;
type Protocol = DataRouterMarker;
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 DataRouterSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DataRouterMarker 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<DataRouterEvent, fidl::Error> {
DataRouterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#route(
&self,
mut payload: RouteRequest,
___deadline: zx::MonotonicInstant,
) -> Result<DataRouterRouteResult, fidl::Error> {
let _response = self.client.send_query::<
RouteRequest,
fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
>(
&mut payload,
0x2e87dc44dfc53804,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DataRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct DataRouterProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DataRouterProxy {
type Protocol = DataRouterMarker;
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 DataRouterProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DataRouterEventStream {
DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#route(
&self,
mut payload: RouteRequest,
) -> fidl::client::QueryResponseFut<
DataRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DataRouterProxyInterface::r#route(self, payload)
}
}
impl DataRouterProxyInterface for DataRouterProxy {
type RouteResponseFut = fidl::client::QueryResponseFut<
DataRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DataRouterRouteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2e87dc44dfc53804,
>(_buf?)?
.into_result::<DataRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
&mut payload,
0x2e87dc44dfc53804,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct DataRouterEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DataRouterEventStream {}
impl futures::stream::FusedStream for DataRouterEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DataRouterEventStream {
type Item = Result<DataRouterEvent, 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(DataRouterEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DataRouterEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DataRouterEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DataRouterEvent, 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(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DataRouterRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DataRouterRequestStream {}
impl futures::stream::FusedStream for DataRouterRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DataRouterRequestStream {
type Protocol = DataRouterMarker;
type ControlHandle = DataRouterControlHandle;
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 {
DataRouterControlHandle { 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 DataRouterRequestStream {
type Item = Result<DataRouterRequest, 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 DataRouterRequestStream 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 {
0x2e87dc44dfc53804 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RouteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
Ok(DataRouterRequest::Route {
payload: req,
responder: DataRouterRouteResponder {
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(DataRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DataRouterControlHandle { 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(DataRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DataRouterControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DataRouterRequest {
Route {
payload: RouteRequest,
responder: DataRouterRouteResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DataRouterControlHandle,
method_type: fidl::MethodType,
},
}
impl DataRouterRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
if let DataRouterRequest::Route { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DataRouterRequest::Route { .. } => "route",
DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct DataRouterControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
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 DataRouterControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DataRouterRouteResponder {
control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DataRouterRouteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DataRouterRouteResponder {
type ControlHandle = DataRouterControlHandle;
fn control_handle(&self) -> &DataRouterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DataRouterRouteResponder {
pub fn send(
self,
mut result: Result<DataRouterRouteResponse, RouterError>,
) -> 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<DataRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<DataRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
DataRouterRouteResponse,
RouterError,
>>(
fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
self.tx_id,
0x2e87dc44dfc53804,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DictionaryMarker;
impl fidl::endpoints::ProtocolMarker for DictionaryMarker {
type Proxy = DictionaryProxy;
type RequestStream = DictionaryRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DictionarySynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryMarker {}
pub trait DictionaryProxyInterface: Send + Sync {}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DictionarySynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DictionarySynchronousProxy {
type Proxy = DictionaryProxy;
type Protocol = DictionaryMarker;
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 DictionarySynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DictionaryMarker 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<DictionaryEvent, fidl::Error> {
DictionaryEvent::decode(self.client.wait_for_event(deadline)?)
}
}
#[derive(Debug, Clone)]
pub struct DictionaryProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DictionaryProxy {
type Protocol = DictionaryMarker;
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 DictionaryProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DictionaryEventStream {
DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
}
}
impl DictionaryProxyInterface for DictionaryProxy {}
pub struct DictionaryEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DictionaryEventStream {}
impl futures::stream::FusedStream for DictionaryEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DictionaryEventStream {
type Item = Result<DictionaryEvent, 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(DictionaryEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DictionaryEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DictionaryEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DictionaryEvent, 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(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DictionaryRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DictionaryRequestStream {}
impl futures::stream::FusedStream for DictionaryRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DictionaryRequestStream {
type Protocol = DictionaryMarker;
type ControlHandle = DictionaryControlHandle;
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 {
DictionaryControlHandle { 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 DictionaryRequestStream {
type Item = Result<DictionaryRequest, 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 DictionaryRequestStream 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 {
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(DictionaryRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryControlHandle { 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(DictionaryRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DictionaryRequest {
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DictionaryControlHandle,
method_type: fidl::MethodType,
},
}
impl DictionaryRequest {
pub fn method_name(&self) -> &'static str {
match *self {
DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct DictionaryControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DictionaryControlHandle {
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 DictionaryControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DictionaryDrainIteratorMarker;
impl fidl::endpoints::ProtocolMarker for DictionaryDrainIteratorMarker {
type Proxy = DictionaryDrainIteratorProxy;
type RequestStream = DictionaryDrainIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DictionaryDrainIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
}
pub type DictionaryDrainIteratorGetNextResult =
Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
+ Send;
fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DictionaryDrainIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DictionaryDrainIteratorSynchronousProxy {
type Proxy = DictionaryDrainIteratorProxy;
type Protocol = DictionaryDrainIteratorMarker;
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 DictionaryDrainIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<DictionaryDrainIteratorMarker 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<DictionaryDrainIteratorEvent, fidl::Error> {
DictionaryDrainIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
mut start_id: u64,
mut limit: u32,
___deadline: zx::MonotonicInstant,
) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
let _response = self
.client
.send_query::<DictionaryDrainIteratorGetNextRequest, fidl::encoding::FlexibleResultType<
DictionaryDrainIteratorGetNextResponse,
CapabilityStoreError,
>>(
(start_id, limit),
0x4f8082ca1ee26061,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DictionaryDrainIteratorMarker>("get_next")?;
Ok(_response.map(|x| (x.items, x.end_id)))
}
}
#[derive(Debug, Clone)]
pub struct DictionaryDrainIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DictionaryDrainIteratorProxy {
type Protocol = DictionaryDrainIteratorMarker;
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 DictionaryDrainIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
mut start_id: u64,
mut limit: u32,
) -> fidl::client::QueryResponseFut<
DictionaryDrainIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
}
}
impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
DictionaryDrainIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
DictionaryDrainIteratorGetNextResponse,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4f8082ca1ee26061,
>(_buf?)?
.into_result::<DictionaryDrainIteratorMarker>("get_next")?;
Ok(_response.map(|x| (x.items, x.end_id)))
}
self.client.send_query_and_decode::<
DictionaryDrainIteratorGetNextRequest,
DictionaryDrainIteratorGetNextResult,
>(
(start_id, limit,),
0x4f8082ca1ee26061,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct DictionaryDrainIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DictionaryDrainIteratorEventStream {
type Item = Result<DictionaryDrainIteratorEvent, 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(DictionaryDrainIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DictionaryDrainIteratorEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DictionaryDrainIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DictionaryDrainIteratorEvent, 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(DictionaryDrainIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DictionaryDrainIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DictionaryDrainIteratorRequestStream {
type Protocol = DictionaryDrainIteratorMarker;
type ControlHandle = DictionaryDrainIteratorControlHandle;
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 {
DictionaryDrainIteratorControlHandle { 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 DictionaryDrainIteratorRequestStream {
type Item = Result<DictionaryDrainIteratorRequest, 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 DictionaryDrainIteratorRequestStream 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 {
0x4f8082ca1ee26061 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DictionaryDrainIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
limit: req.limit,
responder: DictionaryDrainIteratorGetNextResponder {
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(DictionaryDrainIteratorRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryDrainIteratorControlHandle { 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(DictionaryDrainIteratorRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DictionaryDrainIteratorRequest {
GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DictionaryDrainIteratorControlHandle,
method_type: fidl::MethodType,
},
}
impl DictionaryDrainIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
Some((start_id, limit, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
DictionaryDrainIteratorRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
DictionaryDrainIteratorRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct DictionaryDrainIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DictionaryDrainIteratorControlHandle {
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 DictionaryDrainIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DictionaryDrainIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DictionaryDrainIteratorGetNextResponder {
type ControlHandle = DictionaryDrainIteratorControlHandle;
fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DictionaryDrainIteratorGetNextResponder {
pub fn send(
self,
mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
) -> 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<(&[DictionaryItem], u64), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
DictionaryDrainIteratorGetNextResponse,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x4f8082ca1ee26061,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DictionaryEnumerateIteratorMarker;
impl fidl::endpoints::ProtocolMarker for DictionaryEnumerateIteratorMarker {
type Proxy = DictionaryEnumerateIteratorProxy;
type RequestStream = DictionaryEnumerateIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DictionaryEnumerateIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
}
pub type DictionaryEnumerateIteratorGetNextResult =
Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
+ Send;
fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DictionaryEnumerateIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DictionaryEnumerateIteratorSynchronousProxy {
type Proxy = DictionaryEnumerateIteratorProxy;
type Protocol = DictionaryEnumerateIteratorMarker;
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 DictionaryEnumerateIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<DictionaryEnumerateIteratorMarker 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<DictionaryEnumerateIteratorEvent, fidl::Error> {
DictionaryEnumerateIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
mut start_id: u64,
mut limit: u32,
___deadline: zx::MonotonicInstant,
) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
let _response = self.client.send_query::<
DictionaryEnumerateIteratorGetNextRequest,
fidl::encoding::FlexibleResultType<DictionaryEnumerateIteratorGetNextResponse, CapabilityStoreError>,
>(
(start_id, limit,),
0x14f8bc286512f5cf,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
Ok(_response.map(|x| (x.items, x.end_id)))
}
}
#[derive(Debug, Clone)]
pub struct DictionaryEnumerateIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DictionaryEnumerateIteratorProxy {
type Protocol = DictionaryEnumerateIteratorMarker;
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 DictionaryEnumerateIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
mut start_id: u64,
mut limit: u32,
) -> fidl::client::QueryResponseFut<
DictionaryEnumerateIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
}
}
impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
DictionaryEnumerateIteratorGetNextResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
DictionaryEnumerateIteratorGetNextResponse,
CapabilityStoreError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x14f8bc286512f5cf,
>(_buf?)?
.into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
Ok(_response.map(|x| (x.items, x.end_id)))
}
self.client.send_query_and_decode::<
DictionaryEnumerateIteratorGetNextRequest,
DictionaryEnumerateIteratorGetNextResult,
>(
(start_id, limit,),
0x14f8bc286512f5cf,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct DictionaryEnumerateIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DictionaryEnumerateIteratorEventStream {
type Item = Result<DictionaryEnumerateIteratorEvent, 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(DictionaryEnumerateIteratorEvent::decode(buf)))
}
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DictionaryEnumerateIteratorEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DictionaryEnumerateIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DictionaryEnumerateIteratorEvent, 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(DictionaryEnumerateIteratorEvent::_UnknownEvent {
ordinal: tx_header.ordinal,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
})
}
}
}
pub struct DictionaryEnumerateIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DictionaryEnumerateIteratorRequestStream {
type Protocol = DictionaryEnumerateIteratorMarker;
type ControlHandle = DictionaryEnumerateIteratorControlHandle;
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 {
DictionaryEnumerateIteratorControlHandle { 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 DictionaryEnumerateIteratorRequestStream {
type Item = Result<DictionaryEnumerateIteratorRequest, 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 DictionaryEnumerateIteratorRequestStream 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 {
0x14f8bc286512f5cf => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DictionaryEnumerateIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
limit: req.limit,
responder: DictionaryEnumerateIteratorGetNextResponder {
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(DictionaryEnumerateIteratorRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryEnumerateIteratorControlHandle { 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(DictionaryEnumerateIteratorRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DictionaryEnumerateIteratorRequest {
GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DictionaryEnumerateIteratorControlHandle,
method_type: fidl::MethodType,
},
}
impl DictionaryEnumerateIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
Some((start_id, limit, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
DictionaryEnumerateIteratorRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
DictionaryEnumerateIteratorRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct DictionaryEnumerateIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DictionaryEnumerateIteratorControlHandle {
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 DictionaryEnumerateIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DictionaryEnumerateIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DictionaryEnumerateIteratorGetNextResponder {
type ControlHandle = DictionaryEnumerateIteratorControlHandle;
fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DictionaryEnumerateIteratorGetNextResponder {
pub fn send(
self,
mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
) -> 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<DictionaryOptionalItem>, u64), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
DictionaryEnumerateIteratorGetNextResponse,
CapabilityStoreError,
>>(
fidl::encoding::FlexibleResult::new(
result
.as_mut()
.map_err(|e| *e)
.map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
),
self.tx_id,
0x14f8bc286512f5cf,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DictionaryKeysIteratorMarker;
impl fidl::endpoints::ProtocolMarker for DictionaryKeysIteratorMarker {
type Proxy = DictionaryKeysIteratorProxy;
type RequestStream = DictionaryKeysIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DictionaryKeysIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
}
pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DictionaryKeysIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DictionaryKeysIteratorSynchronousProxy {
type Proxy = DictionaryKeysIteratorProxy;
type Protocol = DictionaryKeysIteratorMarker;
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 DictionaryKeysIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<DictionaryKeysIteratorMarker 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<DictionaryKeysIteratorEvent, fidl::Error> {
DictionaryKeysIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<String>, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
>(
(),
0x453828cbacca7d53,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DictionaryKeysIteratorMarker>("get_next")?;
Ok(_response.keys)
}
}
#[derive(Debug, Clone)]
pub struct DictionaryKeysIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DictionaryKeysIteratorProxy {
type Protocol = DictionaryKeysIteratorMarker;
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 DictionaryKeysIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DictionaryKeysIteratorProxyInterface::r#get_next(self)
}
}
impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
type GetNextResponseFut =
fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<String>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x453828cbacca7d53,
>(_buf?)?
.into_result::<DictionaryKeysIteratorMarker>("get_next")?;
Ok(_response.keys)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
(),
0x453828cbacca7d53,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct DictionaryKeysIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DictionaryKeysIteratorEventStream {
type Item = Result<DictionaryKeysIteratorEvent, 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(DictionaryKeysIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DictionaryKeysIteratorEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DictionaryKeysIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DictionaryKeysIteratorEvent, 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(DictionaryKeysIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DictionaryKeysIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DictionaryKeysIteratorRequestStream {
type Protocol = DictionaryKeysIteratorMarker;
type ControlHandle = DictionaryKeysIteratorControlHandle;
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 {
DictionaryKeysIteratorControlHandle { 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 DictionaryKeysIteratorRequestStream {
type Item = Result<DictionaryKeysIteratorRequest, 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 DictionaryKeysIteratorRequestStream 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 {
0x453828cbacca7d53 => {
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 = DictionaryKeysIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(DictionaryKeysIteratorRequest::GetNext {
responder: DictionaryKeysIteratorGetNextResponder {
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(DictionaryKeysIteratorRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryKeysIteratorControlHandle { 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(DictionaryKeysIteratorRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DictionaryKeysIteratorRequest {
GetNext {
responder: DictionaryKeysIteratorGetNextResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DictionaryKeysIteratorControlHandle,
method_type: fidl::MethodType,
},
}
impl DictionaryKeysIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
DictionaryKeysIteratorRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
DictionaryKeysIteratorRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct DictionaryKeysIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DictionaryKeysIteratorControlHandle {
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 DictionaryKeysIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DictionaryKeysIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DictionaryKeysIteratorGetNextResponder {
type ControlHandle = DictionaryKeysIteratorControlHandle;
fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DictionaryKeysIteratorGetNextResponder {
pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(keys);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(keys);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
fidl::encoding::Flexible::new((keys,)),
self.tx_id,
0x453828cbacca7d53,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DictionaryRouterMarker;
impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
type Proxy = DictionaryRouterProxy;
type RequestStream = DictionaryRouterRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DictionaryRouterSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
pub trait DictionaryRouterProxyInterface: Send + Sync {
type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
+ Send;
fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DictionaryRouterSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
type Proxy = DictionaryRouterProxy;
type Protocol = DictionaryRouterMarker;
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 DictionaryRouterSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DictionaryRouterMarker 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<DictionaryRouterEvent, fidl::Error> {
DictionaryRouterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#route(
&self,
mut payload: RouteRequest,
___deadline: zx::MonotonicInstant,
) -> Result<DictionaryRouterRouteResult, fidl::Error> {
let _response = self.client.send_query::<
RouteRequest,
fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
>(
&mut payload,
0x714c65bfe54bd79f,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DictionaryRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct DictionaryRouterProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DictionaryRouterProxy {
type Protocol = DictionaryRouterMarker;
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 DictionaryRouterProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#route(
&self,
mut payload: RouteRequest,
) -> fidl::client::QueryResponseFut<
DictionaryRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DictionaryRouterProxyInterface::r#route(self, payload)
}
}
impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
type RouteResponseFut = fidl::client::QueryResponseFut<
DictionaryRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DictionaryRouterRouteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x714c65bfe54bd79f,
>(_buf?)?
.into_result::<DictionaryRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
&mut payload,
0x714c65bfe54bd79f,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct DictionaryRouterEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DictionaryRouterEventStream {}
impl futures::stream::FusedStream for DictionaryRouterEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DictionaryRouterEventStream {
type Item = Result<DictionaryRouterEvent, 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(DictionaryRouterEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DictionaryRouterEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DictionaryRouterEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DictionaryRouterEvent, 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(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DictionaryRouterRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DictionaryRouterRequestStream {}
impl futures::stream::FusedStream for DictionaryRouterRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
type Protocol = DictionaryRouterMarker;
type ControlHandle = DictionaryRouterControlHandle;
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 {
DictionaryRouterControlHandle { 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 DictionaryRouterRequestStream {
type Item = Result<DictionaryRouterRequest, 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 DictionaryRouterRequestStream 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 {
0x714c65bfe54bd79f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RouteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DictionaryRouterControlHandle { inner: this.inner.clone() };
Ok(DictionaryRouterRequest::Route {
payload: req,
responder: DictionaryRouterRouteResponder {
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(DictionaryRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryRouterControlHandle {
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(DictionaryRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DictionaryRouterControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DictionaryRouterRequest {
Route {
payload: RouteRequest,
responder: DictionaryRouterRouteResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DictionaryRouterControlHandle,
method_type: fidl::MethodType,
},
}
impl DictionaryRouterRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
if let DictionaryRouterRequest::Route { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DictionaryRouterRequest::Route { .. } => "route",
DictionaryRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
DictionaryRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct DictionaryRouterControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
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 DictionaryRouterControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DictionaryRouterRouteResponder {
control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DictionaryRouterRouteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
type ControlHandle = DictionaryRouterControlHandle;
fn control_handle(&self) -> &DictionaryRouterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DictionaryRouterRouteResponder {
pub fn send(
self,
mut result: Result<DictionaryRouterRouteResponse, RouterError>,
) -> 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<DictionaryRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<DictionaryRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
DictionaryRouterRouteResponse,
RouterError,
>>(
fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
self.tx_id,
0x714c65bfe54bd79f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DirConnectorRouterMarker;
impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
type Proxy = DirConnectorRouterProxy;
type RequestStream = DirConnectorRouterRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DirConnectorRouterSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
pub trait DirConnectorRouterProxyInterface: Send + Sync {
type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
+ Send;
fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DirConnectorRouterSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
type Proxy = DirConnectorRouterProxy;
type Protocol = DirConnectorRouterMarker;
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 DirConnectorRouterSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<DirConnectorRouterMarker 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<DirConnectorRouterEvent, fidl::Error> {
DirConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#route(
&self,
mut payload: RouteRequest,
___deadline: zx::MonotonicInstant,
) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
let _response = self.client.send_query::<
RouteRequest,
fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
>(
&mut payload,
0xd7e0f01da2c8e40,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DirConnectorRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct DirConnectorRouterProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
type Protocol = DirConnectorRouterMarker;
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 DirConnectorRouterProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#route(
&self,
mut payload: RouteRequest,
) -> fidl::client::QueryResponseFut<
DirConnectorRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirConnectorRouterProxyInterface::r#route(self, payload)
}
}
impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
type RouteResponseFut = fidl::client::QueryResponseFut<
DirConnectorRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xd7e0f01da2c8e40,
>(_buf?)?
.into_result::<DirConnectorRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
&mut payload,
0xd7e0f01da2c8e40,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct DirConnectorRouterEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DirConnectorRouterEventStream {}
impl futures::stream::FusedStream for DirConnectorRouterEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DirConnectorRouterEventStream {
type Item = Result<DirConnectorRouterEvent, 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(DirConnectorRouterEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DirConnectorRouterEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DirConnectorRouterEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DirConnectorRouterEvent, 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(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DirConnectorRouterRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DirConnectorRouterRequestStream {}
impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
type Protocol = DirConnectorRouterMarker;
type ControlHandle = DirConnectorRouterControlHandle;
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 {
DirConnectorRouterControlHandle { 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 DirConnectorRouterRequestStream {
type Item = Result<DirConnectorRouterRequest, 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 DirConnectorRouterRequestStream 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 {
0xd7e0f01da2c8e40 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirConnectorRouterControlHandle {
inner: this.inner.clone(),
};
Ok(DirConnectorRouterRequest::Route {payload: req,
responder: DirConnectorRouterRouteResponder {
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(DirConnectorRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirConnectorRouterControlHandle { 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(DirConnectorRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DirConnectorRouterRequest {
Route {
payload: RouteRequest,
responder: DirConnectorRouterRouteResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DirConnectorRouterControlHandle,
method_type: fidl::MethodType,
},
}
impl DirConnectorRouterRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
if let DirConnectorRouterRequest::Route { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DirConnectorRouterRequest::Route { .. } => "route",
DirConnectorRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
DirConnectorRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct DirConnectorRouterControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
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 DirConnectorRouterControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirConnectorRouterRouteResponder {
control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirConnectorRouterRouteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
type ControlHandle = DirConnectorRouterControlHandle;
fn control_handle(&self) -> &DirConnectorRouterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirConnectorRouterRouteResponder {
pub fn send(
self,
mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
) -> 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<DirConnectorRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
DirConnectorRouterRouteResponse,
RouterError,
>>(
fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
self.tx_id,
0xd7e0f01da2c8e40,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DirEntryRouterMarker;
impl fidl::endpoints::ProtocolMarker for DirEntryRouterMarker {
type Proxy = DirEntryRouterProxy;
type RequestStream = DirEntryRouterRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DirEntryRouterSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DirEntryRouterMarker {}
pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
pub trait DirEntryRouterProxyInterface: Send + Sync {
type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
+ Send;
fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DirEntryRouterSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DirEntryRouterSynchronousProxy {
type Proxy = DirEntryRouterProxy;
type Protocol = DirEntryRouterMarker;
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 DirEntryRouterSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DirEntryRouterMarker 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<DirEntryRouterEvent, fidl::Error> {
DirEntryRouterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#route(
&self,
mut payload: RouteRequest,
___deadline: zx::MonotonicInstant,
) -> Result<DirEntryRouterRouteResult, fidl::Error> {
let _response = self.client.send_query::<
RouteRequest,
fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
>(
&mut payload,
0x1ac694001c208bd2,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DirEntryRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct DirEntryRouterProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DirEntryRouterProxy {
type Protocol = DirEntryRouterMarker;
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 DirEntryRouterProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#route(
&self,
mut payload: RouteRequest,
) -> fidl::client::QueryResponseFut<
DirEntryRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirEntryRouterProxyInterface::r#route(self, payload)
}
}
impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
type RouteResponseFut = fidl::client::QueryResponseFut<
DirEntryRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DirEntryRouterRouteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1ac694001c208bd2,
>(_buf?)?
.into_result::<DirEntryRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
&mut payload,
0x1ac694001c208bd2,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct DirEntryRouterEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DirEntryRouterEventStream {}
impl futures::stream::FusedStream for DirEntryRouterEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DirEntryRouterEventStream {
type Item = Result<DirEntryRouterEvent, 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(DirEntryRouterEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DirEntryRouterEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DirEntryRouterEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DirEntryRouterEvent, 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(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DirEntryRouterRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DirEntryRouterRequestStream {}
impl futures::stream::FusedStream for DirEntryRouterRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DirEntryRouterRequestStream {
type Protocol = DirEntryRouterMarker;
type ControlHandle = DirEntryRouterControlHandle;
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 {
DirEntryRouterControlHandle { 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 DirEntryRouterRequestStream {
type Item = Result<DirEntryRouterRequest, 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 DirEntryRouterRequestStream 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 {
0x1ac694001c208bd2 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RouteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DirEntryRouterControlHandle { inner: this.inner.clone() };
Ok(DirEntryRouterRequest::Route {
payload: req,
responder: DirEntryRouterRouteResponder {
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(DirEntryRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirEntryRouterControlHandle {
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(DirEntryRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirEntryRouterControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DirEntryRouterRequest {
Route {
payload: RouteRequest,
responder: DirEntryRouterRouteResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DirEntryRouterControlHandle,
method_type: fidl::MethodType,
},
}
impl DirEntryRouterRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
if let DirEntryRouterRequest::Route { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DirEntryRouterRequest::Route { .. } => "route",
DirEntryRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
DirEntryRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct DirEntryRouterControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DirEntryRouterControlHandle {
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 DirEntryRouterControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirEntryRouterRouteResponder {
control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirEntryRouterRouteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirEntryRouterRouteResponder {
type ControlHandle = DirEntryRouterControlHandle;
fn control_handle(&self) -> &DirEntryRouterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirEntryRouterRouteResponder {
pub fn send(
self,
mut result: Result<DirEntryRouterRouteResponse, RouterError>,
) -> 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<DirEntryRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<DirEntryRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
DirEntryRouterRouteResponse,
RouterError,
>>(
fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
self.tx_id,
0x1ac694001c208bd2,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DirReceiverMarker;
impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
type Proxy = DirReceiverProxy;
type RequestStream = DirReceiverRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DirReceiverSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
pub trait DirReceiverProxyInterface: Send + Sync {
fn r#receive(
&self,
channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DirReceiverSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
type Proxy = DirReceiverProxy;
type Protocol = DirReceiverMarker;
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 DirReceiverSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DirReceiverMarker 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<DirReceiverEvent, fidl::Error> {
DirReceiverEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#receive(
&self,
mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DirReceiverReceiveRequest>(
(channel,),
0xcdc3e9b89fe7bb4,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Clone)]
pub struct DirReceiverProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DirReceiverProxy {
type Protocol = DirReceiverMarker;
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 DirReceiverProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DirReceiverEventStream {
DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#receive(
&self,
mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Result<(), fidl::Error> {
DirReceiverProxyInterface::r#receive(self, channel)
}
}
impl DirReceiverProxyInterface for DirReceiverProxy {
fn r#receive(
&self,
mut channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DirReceiverReceiveRequest>(
(channel,),
0xcdc3e9b89fe7bb4,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
pub struct DirReceiverEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DirReceiverEventStream {}
impl futures::stream::FusedStream for DirReceiverEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DirReceiverEventStream {
type Item = Result<DirReceiverEvent, 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(DirReceiverEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DirReceiverEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DirReceiverEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DirReceiverEvent, 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(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DirReceiverRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DirReceiverRequestStream {}
impl futures::stream::FusedStream for DirReceiverRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
type Protocol = DirReceiverMarker;
type ControlHandle = DirReceiverControlHandle;
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 {
DirReceiverControlHandle { 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 DirReceiverRequestStream {
type Item = Result<DirReceiverRequest, 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 DirReceiverRequestStream 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 {
0xcdc3e9b89fe7bb4 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DirReceiverReceiveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
Ok(DirReceiverRequest::Receive { channel: req.channel, control_handle })
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(DirReceiverRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirReceiverControlHandle { 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(DirReceiverRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DirReceiverRequest {
Receive {
channel: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
control_handle: DirReceiverControlHandle,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DirReceiverControlHandle,
method_type: fidl::MethodType,
},
}
impl DirReceiverRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_receive(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
DirReceiverControlHandle,
)> {
if let DirReceiverRequest::Receive { channel, control_handle } = self {
Some((channel, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DirReceiverRequest::Receive { .. } => "receive",
DirReceiverRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
DirReceiverRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct DirReceiverControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
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 DirReceiverControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DirectoryRouterMarker;
impl fidl::endpoints::ProtocolMarker for DirectoryRouterMarker {
type Proxy = DirectoryRouterProxy;
type RequestStream = DirectoryRouterRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DirectoryRouterSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
}
impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryRouterMarker {}
pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
pub trait DirectoryRouterProxyInterface: Send + Sync {
type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
+ Send;
fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DirectoryRouterSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DirectoryRouterSynchronousProxy {
type Proxy = DirectoryRouterProxy;
type Protocol = DirectoryRouterMarker;
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 DirectoryRouterSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DirectoryRouterMarker 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<DirectoryRouterEvent, fidl::Error> {
DirectoryRouterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#route(
&self,
mut payload: RouteRequest,
___deadline: zx::MonotonicInstant,
) -> Result<DirectoryRouterRouteResult, fidl::Error> {
let _response = self.client.send_query::<
RouteRequest,
fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
>(
&mut payload,
0x683b6c6be21b0f21,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<DirectoryRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct DirectoryRouterProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DirectoryRouterProxy {
type Protocol = DirectoryRouterMarker;
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 DirectoryRouterProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#route(
&self,
mut payload: RouteRequest,
) -> fidl::client::QueryResponseFut<
DirectoryRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DirectoryRouterProxyInterface::r#route(self, payload)
}
}
impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
type RouteResponseFut = fidl::client::QueryResponseFut<
DirectoryRouterRouteResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DirectoryRouterRouteResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x683b6c6be21b0f21,
>(_buf?)?
.into_result::<DirectoryRouterMarker>("route")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
&mut payload,
0x683b6c6be21b0f21,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct DirectoryRouterEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DirectoryRouterEventStream {}
impl futures::stream::FusedStream for DirectoryRouterEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DirectoryRouterEventStream {
type Item = Result<DirectoryRouterEvent, 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(DirectoryRouterEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DirectoryRouterEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl DirectoryRouterEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DirectoryRouterEvent, 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(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DirectoryRouterRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DirectoryRouterRequestStream {}
impl futures::stream::FusedStream for DirectoryRouterRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DirectoryRouterRequestStream {
type Protocol = DirectoryRouterMarker;
type ControlHandle = DirectoryRouterControlHandle;
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 {
DirectoryRouterControlHandle { 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 DirectoryRouterRequestStream {
type Item = Result<DirectoryRouterRequest, 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 DirectoryRouterRequestStream 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 {
0x683b6c6be21b0f21 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RouteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DirectoryRouterControlHandle { inner: this.inner.clone() };
Ok(DirectoryRouterRequest::Route {
payload: req,
responder: DirectoryRouterRouteResponder {
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(DirectoryRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirectoryRouterControlHandle {
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(DirectoryRouterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: DirectoryRouterControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DirectoryRouterRequest {
Route {
payload: RouteRequest,
responder: DirectoryRouterRouteResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: DirectoryRouterControlHandle,
method_type: fidl::MethodType,
},
}
impl DirectoryRouterRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
if let DirectoryRouterRequest::Route { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DirectoryRouterRequest::Route { .. } => "route",
DirectoryRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
DirectoryRouterRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct DirectoryRouterControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DirectoryRouterControlHandle {
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 DirectoryRouterControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DirectoryRouterRouteResponder {
control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DirectoryRouterRouteResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DirectoryRouterRouteResponder {
type ControlHandle = DirectoryRouterControlHandle;
fn control_handle(&self) -> &DirectoryRouterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DirectoryRouterRouteResponder {
pub fn send(
self,
mut result: Result<DirectoryRouterRouteResponse, RouterError>,
) -> 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<DirectoryRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<DirectoryRouterRouteResponse, RouterError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
DirectoryRouterRouteResponse,
RouterError,
>>(
fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
self.tx_id,
0x683b6c6be21b0f21,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ReceiverMarker;
impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
type Proxy = ReceiverProxy;
type RequestStream = ReceiverRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ReceiverSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
pub trait ReceiverProxyInterface: Send + Sync {
fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ReceiverSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
type Proxy = ReceiverProxy;
type Protocol = ReceiverMarker;
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 ReceiverSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ReceiverMarker 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<ReceiverEvent, fidl::Error> {
ReceiverEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
self.client.send::<ProtocolPayload>(
(channel,),
0x4bae18ab7aa1a94,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Clone)]
pub struct ReceiverProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ReceiverProxy {
type Protocol = ReceiverMarker;
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 ReceiverProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ReceiverEventStream {
ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
ReceiverProxyInterface::r#receive(self, channel)
}
}
impl ReceiverProxyInterface for ReceiverProxy {
fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
self.client.send::<ProtocolPayload>(
(channel,),
0x4bae18ab7aa1a94,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
pub struct ReceiverEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ReceiverEventStream {}
impl futures::stream::FusedStream for ReceiverEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ReceiverEventStream {
type Item = Result<ReceiverEvent, 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(ReceiverEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ReceiverEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl ReceiverEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ReceiverEvent, 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(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ReceiverRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ReceiverRequestStream {}
impl futures::stream::FusedStream for ReceiverRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ReceiverRequestStream {
type Protocol = ReceiverMarker;
type ControlHandle = ReceiverControlHandle;
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 {
ReceiverControlHandle { 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 ReceiverRequestStream {
type Item = Result<ReceiverRequest, 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 ReceiverRequestStream 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 {
0x4bae18ab7aa1a94 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ProtocolPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(ReceiverRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: ReceiverControlHandle { 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(ReceiverRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: ReceiverControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ReceiverRequest {
Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: ReceiverControlHandle,
method_type: fidl::MethodType,
},
}
impl ReceiverRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
if let ReceiverRequest::Receive { channel, control_handle } = self {
Some((channel, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ReceiverRequest::Receive { .. } => "receive",
ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct ReceiverControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
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 ReceiverControlHandle {}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for Availability {
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 Availability {
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 Availability {
#[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 Availability {
#[inline(always)]
fn new_empty() -> Self {
Self::Required
}
#[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 CapabilityStoreError {
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 CapabilityStoreError {
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 CapabilityStoreError
{
#[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 CapabilityStoreError {
#[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 DictionaryError {
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 DictionaryError {
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 DictionaryError
{
#[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 DictionaryError {
#[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 RouterError {
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 RouterError {
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 RouterError {
#[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 RouterError {
#[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::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
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 CapabilityStoreConnectorCreateRequest {
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<
CapabilityStoreConnectorCreateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreConnectorCreateRequest
{
#[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::<CapabilityStoreConnectorCreateRequest>(offset);
fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CapabilityStoreConnectorCreateRequest,
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::<CapabilityStoreConnectorCreateRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreConnectorCreateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
receiver: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
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(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.receiver,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
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 CapabilityStoreConnectorOpenRequest {
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<
CapabilityStoreConnectorOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreConnectorOpenRequest
{
#[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::<CapabilityStoreConnectorOpenRequest>(offset);
fidl::encoding::Encode::<
CapabilityStoreConnectorOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.server_end
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CapabilityStoreConnectorOpenRequest,
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::<CapabilityStoreConnectorOpenRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreConnectorOpenRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CapabilityStoreDictionaryCopyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryCopyRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CapabilityStoreDictionaryCopyRequest, D>
for &CapabilityStoreDictionaryCopyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CapabilityStoreDictionaryCopyRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CapabilityStoreDictionaryCopyRequest)
.write_unaligned((self as *const CapabilityStoreDictionaryCopyRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<CapabilityStoreDictionaryCopyRequest, 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::<CapabilityStoreDictionaryCopyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CapabilityStoreDictionaryCopyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u64, D), dest_id: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CapabilityStoreDictionaryCreateRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryCreateRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CapabilityStoreDictionaryCreateRequest, D>
for &CapabilityStoreDictionaryCreateRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CapabilityStoreDictionaryCreateRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CapabilityStoreDictionaryCreateRequest).write_unaligned(
(self as *const CapabilityStoreDictionaryCreateRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<CapabilityStoreDictionaryCreateRequest, 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::<CapabilityStoreDictionaryCreateRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CapabilityStoreDictionaryCreateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
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 CapabilityStoreDictionaryDrainRequest {
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<
CapabilityStoreDictionaryDrainRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreDictionaryDrainRequest
{
#[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::<CapabilityStoreDictionaryDrainRequest>(offset);
fidl::encoding::Encode::<
CapabilityStoreDictionaryDrainRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CapabilityStoreDictionaryDrainRequest,
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::<CapabilityStoreDictionaryDrainRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryDrainRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
iterator: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
>,
>,
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(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
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 CapabilityStoreDictionaryEnumerateRequest {
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<
CapabilityStoreDictionaryEnumerateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreDictionaryEnumerateRequest
{
#[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::<CapabilityStoreDictionaryEnumerateRequest>(offset);
fidl::encoding::Encode::<
CapabilityStoreDictionaryEnumerateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CapabilityStoreDictionaryEnumerateRequest,
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::<CapabilityStoreDictionaryEnumerateRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryEnumerateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
>,
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(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CapabilityStoreDictionaryGetRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryGetRequest {
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<CapabilityStoreDictionaryGetRequest, D>
for &CapabilityStoreDictionaryGetRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CapabilityStoreDictionaryGetRequest>(offset);
fidl::encoding::Encode::<CapabilityStoreDictionaryGetRequest, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.dest_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
T2: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<CapabilityStoreDictionaryGetRequest, 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::<CapabilityStoreDictionaryGetRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CapabilityStoreDictionaryGetRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, D),
key: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
dest_id: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.key,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(u64, D, &mut self.dest_id, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CapabilityStoreDictionaryInsertRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryInsertRequest {
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<CapabilityStoreDictionaryInsertRequest, D>
for &CapabilityStoreDictionaryInsertRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CapabilityStoreDictionaryInsertRequest>(offset);
fidl::encoding::Encode::<CapabilityStoreDictionaryInsertRequest, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<DictionaryItem as fidl::encoding::ValueTypeMarker>::borrow(&self.item),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<DictionaryItem, D>,
> fidl::encoding::Encode<CapabilityStoreDictionaryInsertRequest, 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::<CapabilityStoreDictionaryInsertRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CapabilityStoreDictionaryInsertRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u64, D), item: fidl::new_empty!(DictionaryItem, 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!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(DictionaryItem, D, &mut self.item, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
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 CapabilityStoreDictionaryKeysRequest {
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<
CapabilityStoreDictionaryKeysRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreDictionaryKeysRequest
{
#[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::<CapabilityStoreDictionaryKeysRequest>(offset);
fidl::encoding::Encode::<
CapabilityStoreDictionaryKeysRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CapabilityStoreDictionaryKeysRequest,
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::<CapabilityStoreDictionaryKeysRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryKeysRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
>,
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(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
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 CapabilityStoreDictionaryLegacyExportRequest {
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<
CapabilityStoreDictionaryLegacyExportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreDictionaryLegacyExportRequest
{
#[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::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
fidl::encoding::Encode::<
CapabilityStoreDictionaryLegacyExportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.server_end
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CapabilityStoreDictionaryLegacyExportRequest,
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::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryLegacyExportRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
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 CapabilityStoreDictionaryLegacyImportRequest {
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<
CapabilityStoreDictionaryLegacyImportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreDictionaryLegacyImportRequest
{
#[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::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
fidl::encoding::Encode::<
CapabilityStoreDictionaryLegacyImportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.client_end
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CapabilityStoreDictionaryLegacyImportRequest,
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::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDictionaryLegacyImportRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
client_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.client_end, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CapabilityStoreDictionaryRemoveRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryRemoveRequest {
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<CapabilityStoreDictionaryRemoveRequest, D>
for &CapabilityStoreDictionaryRemoveRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CapabilityStoreDictionaryRemoveRequest>(offset);
fidl::encoding::Encode::<CapabilityStoreDictionaryRemoveRequest, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
<fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.dest_id),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Boxed<WrappedCapabilityId>, D>,
> fidl::encoding::Encode<CapabilityStoreDictionaryRemoveRequest, 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::<CapabilityStoreDictionaryRemoveRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CapabilityStoreDictionaryRemoveRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, D),
key: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
dest_id: fidl::new_empty!(fidl::encoding::Boxed<WrappedCapabilityId>, 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!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.key,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<WrappedCapabilityId>,
D,
&mut self.dest_id,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
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 CapabilityStoreDirConnectorCreateRequest {
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<
CapabilityStoreDirConnectorCreateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreDirConnectorCreateRequest
{
#[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::<CapabilityStoreDirConnectorCreateRequest>(offset);
fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CapabilityStoreDirConnectorCreateRequest,
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::<CapabilityStoreDirConnectorCreateRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDirConnectorCreateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
receiver: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
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(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.receiver,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
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 CapabilityStoreDirConnectorOpenRequest {
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<
CapabilityStoreDirConnectorOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreDirConnectorOpenRequest
{
#[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::<CapabilityStoreDirConnectorOpenRequest>(offset);
fidl::encoding::Encode::<
CapabilityStoreDirConnectorOpenRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.server_end
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CapabilityStoreDirConnectorOpenRequest,
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::<CapabilityStoreDirConnectorOpenRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreDirConnectorOpenRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
server_end: 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.server_end,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CapabilityStoreDropRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDropRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CapabilityStoreDropRequest, D> for &CapabilityStoreDropRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CapabilityStoreDropRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CapabilityStoreDropRequest)
.write_unaligned((self as *const CapabilityStoreDropRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<CapabilityStoreDropRequest, 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::<CapabilityStoreDropRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CapabilityStoreDropRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CapabilityStoreDuplicateRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDuplicateRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CapabilityStoreDuplicateRequest, D>
for &CapabilityStoreDuplicateRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CapabilityStoreDuplicateRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CapabilityStoreDuplicateRequest)
.write_unaligned((self as *const CapabilityStoreDuplicateRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<CapabilityStoreDuplicateRequest, 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::<CapabilityStoreDuplicateRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CapabilityStoreDuplicateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u64, D), dest_id: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CapabilityStoreExportRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CapabilityStoreExportRequest, D> for &CapabilityStoreExportRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CapabilityStoreExportRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CapabilityStoreExportRequest)
.write_unaligned((self as *const CapabilityStoreExportRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<CapabilityStoreExportRequest, 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::<CapabilityStoreExportRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CapabilityStoreExportRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
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 CapabilityStoreImportRequest {
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<
CapabilityStoreImportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreImportRequest
{
#[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::<CapabilityStoreImportRequest>(offset);
fidl::encoding::Encode::<
CapabilityStoreImportRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.capability,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
CapabilityStoreImportRequest,
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::<CapabilityStoreImportRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreImportRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
capability: fidl::new_empty!(
Capability,
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!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
Capability,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.capability,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
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 CapabilityStoreExportResponse {
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<
CapabilityStoreExportResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CapabilityStoreExportResponse
{
#[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::<CapabilityStoreExportResponse>(offset);
fidl::encoding::Encode::<
CapabilityStoreExportResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.capability,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>>
fidl::encoding::Encode<
CapabilityStoreExportResponse,
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::<CapabilityStoreExportResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CapabilityStoreExportResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
capability: fidl::new_empty!(
Capability,
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!(
Capability,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.capability,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for Connector {
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 Connector {
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<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Connector
{
#[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::<Connector>(offset);
fidl::encoding::Encode::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<Connector, 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::<Connector>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DictionaryDrainIteratorGetNextRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextRequest {
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<DictionaryDrainIteratorGetNextRequest, D>
for &DictionaryDrainIteratorGetNextRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DictionaryDrainIteratorGetNextRequest)
.write_unaligned((self as *const DictionaryDrainIteratorGetNextRequest).read());
let padding_ptr = buf_ptr.offset(8) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<DictionaryDrainIteratorGetNextRequest, 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::<DictionaryDrainIteratorGetNextRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DictionaryDrainIteratorGetNextRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { start_id: fidl::new_empty!(u64, D), limit: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
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 DictionaryDrainIteratorGetNextResponse {
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<
DictionaryDrainIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DictionaryDrainIteratorGetNextResponse
{
#[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::<DictionaryDrainIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Vector<DictionaryItem, 128>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
DictionaryDrainIteratorGetNextResponse,
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::<DictionaryDrainIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DictionaryDrainIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
end_id: 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);
fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.end_id,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DictionaryEnumerateIteratorGetNextRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextRequest {
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<DictionaryEnumerateIteratorGetNextRequest, D>
for &DictionaryEnumerateIteratorGetNextRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DictionaryEnumerateIteratorGetNextRequest).write_unaligned(
(self as *const DictionaryEnumerateIteratorGetNextRequest).read(),
);
let padding_ptr = buf_ptr.offset(8) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<DictionaryEnumerateIteratorGetNextRequest, 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::<DictionaryEnumerateIteratorGetNextRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DictionaryEnumerateIteratorGetNextRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { start_id: fidl::new_empty!(u64, D), limit: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
let ptr = unsafe { buf_ptr.offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
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 DictionaryEnumerateIteratorGetNextResponse {
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<
DictionaryEnumerateIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DictionaryEnumerateIteratorGetNextResponse
{
#[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::<DictionaryEnumerateIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Vector<DictionaryOptionalItem, 128>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
DictionaryEnumerateIteratorGetNextResponse,
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::<DictionaryEnumerateIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DictionaryEnumerateIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
end_id: 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);
fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.end_id,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DictionaryItem {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DictionaryItem {
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<DictionaryItem, D>
for &DictionaryItem
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DictionaryItem>(offset);
fidl::encoding::Encode::<DictionaryItem, D>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<DictionaryItem, 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::<DictionaryItem>(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 DictionaryItem {
#[inline(always)]
fn new_empty() -> Self {
Self {
key: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
value: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.key,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u64, D, &mut self.value, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
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 DictionaryKeysIteratorGetNextResponse {
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<
DictionaryKeysIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DictionaryKeysIteratorGetNextResponse
{
#[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::<DictionaryKeysIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DictionaryKeysIteratorGetNextResponse,
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::<DictionaryKeysIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DictionaryKeysIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
keys: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
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::Vector<fidl::encoding::BoundedString<255>, 128>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.keys,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
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 DictionaryOptionalItem {
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<
DictionaryOptionalItem,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DictionaryOptionalItem
{
#[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::<DictionaryOptionalItem>(offset);
fidl::encoding::Encode::<DictionaryOptionalItem, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
<fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Boxed<WrappedCapabilityId>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DictionaryOptionalItem,
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::<DictionaryOptionalItem>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DictionaryOptionalItem
{
#[inline(always)]
fn new_empty() -> Self {
Self {
key: fidl::new_empty!(
fidl::encoding::BoundedString<255>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
value: fidl::new_empty!(
fidl::encoding::Boxed<WrappedCapabilityId>,
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<255>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.key,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<WrappedCapabilityId>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.value,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
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 DictionaryRef {
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<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut DictionaryRef
{
#[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::<DictionaryRef>(offset);
fidl::encoding::Encode::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<DictionaryRef, 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::<DictionaryRef>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirConnector {
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 DirConnector {
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<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut DirConnector
{
#[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::<DirConnector>(offset);
fidl::encoding::Encode::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<DirConnector, 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::<DirConnector>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirEntry {
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 DirEntry {
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<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut DirEntry
{
#[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::<DirEntry>(offset);
fidl::encoding::Encode::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<DirEntry, 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::<DirEntry>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
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 DirReceiverReceiveRequest {
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<
DirReceiverReceiveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DirReceiverReceiveRequest
{
#[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::<DirReceiverReceiveRequest>(offset);
fidl::encoding::Encode::<
DirReceiverReceiveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.channel
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DirReceiverReceiveRequest,
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::<DirReceiverReceiveRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirReceiverReceiveRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
channel: 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::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.channel,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for InstanceToken {
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 InstanceToken {
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<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut InstanceToken
{
#[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::<InstanceToken>(offset);
fidl::encoding::Encode::<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<InstanceToken, 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::<InstanceToken>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {
#[inline(always)]
fn new_empty() -> Self {
Self {
token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
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 ProtocolPayload {
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<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ProtocolPayload
{
#[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::<ProtocolPayload>(offset);
fidl::encoding::Encode::<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<ProtocolPayload, 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::<ProtocolPayload>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ProtocolPayload
{
#[inline(always)]
fn new_empty() -> Self {
Self {
channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Unavailable {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Unavailable {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unavailable, D>
for &Unavailable
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Unavailable>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unavailable {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ValueTypeMarker for Unit {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Unit {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Unit, D> for &Unit {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Unit>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Unit {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ValueTypeMarker for WrappedCapabilityId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for WrappedCapabilityId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WrappedCapabilityId, D>
for &WrappedCapabilityId
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<WrappedCapabilityId>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut WrappedCapabilityId)
.write_unaligned((self as *const WrappedCapabilityId).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<WrappedCapabilityId, 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::<WrappedCapabilityId>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WrappedCapabilityId {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl RouteRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.metadata {
return 2;
}
if let Some(_) = self.requesting {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for RouteRequest {
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 RouteRequest {
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<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut RouteRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RouteRequest>(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::<
InstanceToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.requesting
.as_mut()
.map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_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::<
DictionaryRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.metadata
.as_mut()
.map(<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<InstanceToken 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.requesting.get_or_insert_with(|| {
fidl::new_empty!(InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
InstanceToken,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<DictionaryRef 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.metadata.get_or_insert_with(|| {
fidl::new_empty!(DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
DictionaryRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for Capability {
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 Capability {
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<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Capability
{
#[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::<Capability>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Capability::Unit(ref val) => {
fidl::encoding::encode_in_envelope::<Unit, fidl::encoding::DefaultFuchsiaResourceDialect>(
<Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Capability::Handle(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::Data(ref val) => {
fidl::encoding::encode_in_envelope::<Data, fidl::encoding::DefaultFuchsiaResourceDialect>(
<Data as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Capability::Dictionary(ref mut val) => {
fidl::encoding::encode_in_envelope::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::Connector(ref mut val) => {
fidl::encoding::encode_in_envelope::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>(
<Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::DirConnector(ref mut val) => {
fidl::encoding::encode_in_envelope::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>(
<DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::Directory(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::DirEntry(ref mut val) => {
fidl::encoding::encode_in_envelope::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>(
<DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::ConnectorRouter(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::DictionaryRouter(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::DirEntryRouter(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::DataRouter(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::DirConnectorRouter(ref mut val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder, offset + 8, _depth
)
}
Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> 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 Capability::Unit(_) = self {
} else {
*self = Capability::Unit(fidl::new_empty!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::Unit(ref mut val) = self {
fidl::decode!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Capability::Handle(_) = self {
} else {
*self = Capability::Handle(
fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
);
}
#[allow(irrefutable_let_patterns)]
if let Capability::Handle(ref mut val) = self {
fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Capability::Data(_) = self {
} else {
*self = Capability::Data(fidl::new_empty!(
Data,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::Data(ref mut val) = self {
fidl::decode!(
Data,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Capability::Dictionary(_) = self {
} else {
*self = Capability::Dictionary(fidl::new_empty!(
DictionaryRef,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::Dictionary(ref mut val) = self {
fidl::decode!(
DictionaryRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let Capability::Connector(_) = self {
} else {
*self = Capability::Connector(fidl::new_empty!(
Connector,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::Connector(ref mut val) = self {
fidl::decode!(
Connector,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
6 => {
#[allow(irrefutable_let_patterns)]
if let Capability::DirConnector(_) = self {
} else {
*self = Capability::DirConnector(fidl::new_empty!(
DirConnector,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::DirConnector(ref mut val) = self {
fidl::decode!(
DirConnector,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
7 => {
#[allow(irrefutable_let_patterns)]
if let Capability::Directory(_) = self {
} else {
*self = Capability::Directory(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::Directory(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
8 => {
#[allow(irrefutable_let_patterns)]
if let Capability::DirEntry(_) = self {
} else {
*self = Capability::DirEntry(fidl::new_empty!(
DirEntry,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::DirEntry(ref mut val) = self {
fidl::decode!(
DirEntry,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
9 => {
#[allow(irrefutable_let_patterns)]
if let Capability::ConnectorRouter(_) = self {
} else {
*self = Capability::ConnectorRouter(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::ConnectorRouter(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
10 => {
#[allow(irrefutable_let_patterns)]
if let Capability::DictionaryRouter(_) = self {
} else {
*self = Capability::DictionaryRouter(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::DictionaryRouter(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
11 => {
#[allow(irrefutable_let_patterns)]
if let Capability::DirEntryRouter(_) = self {
} else {
*self = Capability::DirEntryRouter(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::DirEntryRouter(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
12 => {
#[allow(irrefutable_let_patterns)]
if let Capability::DataRouter(_) = self {
} else {
*self = Capability::DataRouter(fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::DataRouter(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
13 => {
#[allow(irrefutable_let_patterns)]
if let Capability::DirConnectorRouter(_) = self {
} else {
*self = Capability::DirConnectorRouter(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let Capability::DirConnectorRouter(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
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 ConnectorRouterRouteResponse {
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<
ConnectorRouterRouteResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ConnectorRouterRouteResponse
{
#[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::<ConnectorRouterRouteResponse>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ConnectorRouterRouteResponse::Connector(ref mut val) => {
fidl::encoding::encode_in_envelope::<
Connector,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
)
}
ConnectorRouterRouteResponse::Unavailable(ref val) => {
fidl::encoding::encode_in_envelope::<
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ConnectorRouterRouteResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::Connector(fidl::new_empty!(
Connector,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ConnectorRouterRouteResponse::Connector(_) = self {
} else {
*self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
Connector,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
fidl::decode!(
Connector,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let ConnectorRouterRouteResponse::Unavailable(_) = self {
} else {
*self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
fidl::decode!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Data {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Data {
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<Data, D> for &Data {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Data>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Data::Bytes(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<u8, 8192>, D>(
<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Data::String(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<8192>, D>(
<fidl::encoding::BoundedString<8192> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Data::Int64(ref val) => {
fidl::encoding::encode_in_envelope::<i64, D>(
<i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Data::Uint64(ref val) => {
fidl::encoding::encode_in_envelope::<u64, D>(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Data::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Data {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl::encoding::Vector<u8, 8192> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
2 => {
<fidl::encoding::BoundedString<8192> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
)
}
3 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <u64 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 Data::Bytes(_) = self {
} else {
*self = Data::Bytes(fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D));
}
#[allow(irrefutable_let_patterns)]
if let Data::Bytes(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Data::String(_) = self {
} else {
*self =
Data::String(fidl::new_empty!(fidl::encoding::BoundedString<8192>, D));
}
#[allow(irrefutable_let_patterns)]
if let Data::String(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<8192>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Data::Int64(_) = self {
} else {
*self = Data::Int64(fidl::new_empty!(i64, D));
}
#[allow(irrefutable_let_patterns)]
if let Data::Int64(ref mut val) = self {
fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Data::Uint64(_) = self {
} else {
*self = Data::Uint64(fidl::new_empty!(u64, D));
}
#[allow(irrefutable_let_patterns)]
if let Data::Uint64(ref mut val) = self {
fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Data::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
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 DataRouterRouteResponse {
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<
DataRouterRouteResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DataRouterRouteResponse
{
#[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::<DataRouterRouteResponse>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
Data,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Data as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
DataRouterRouteResponse::Unavailable(ref val) => {
fidl::encoding::encode_in_envelope::<
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DataRouterRouteResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::Data(fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let DataRouterRouteResponse::Data(_) = self {
} else {
*self = DataRouterRouteResponse::Data(fidl::new_empty!(
Data,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DataRouterRouteResponse::Data(ref mut val) = self {
fidl::decode!(
Data,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let DataRouterRouteResponse::Unavailable(_) = self {
} else {
*self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
fidl::decode!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
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 DictionaryRouterRouteResponse {
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<
DictionaryRouterRouteResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DictionaryRouterRouteResponse
{
#[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::<DictionaryRouterRouteResponse>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
fidl::encoding::encode_in_envelope::<
DictionaryRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
)
}
DictionaryRouterRouteResponse::Unavailable(ref val) => {
fidl::encoding::encode_in_envelope::<
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DictionaryRouterRouteResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::Dictionary(fidl::new_empty!(
DictionaryRef,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let DictionaryRouterRouteResponse::Dictionary(_) = self {
} else {
*self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
DictionaryRef,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
fidl::decode!(
DictionaryRef,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let DictionaryRouterRouteResponse::Unavailable(_) = self {
} else {
*self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
fidl::decode!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
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 DirConnectorRouterRouteResponse {
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<
DirConnectorRouterRouteResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DirConnectorRouterRouteResponse
{
#[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::<DirConnectorRouterRouteResponse>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
fidl::encoding::encode_in_envelope::<
DirConnector,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
)
}
DirConnectorRouterRouteResponse::Unavailable(ref val) => {
fidl::encoding::encode_in_envelope::<
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirConnectorRouterRouteResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::DirConnector(fidl::new_empty!(
DirConnector,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
} else {
*self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
DirConnector,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
fidl::decode!(
DirConnector,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
} else {
*self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
fidl::decode!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
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 DirEntryRouterRouteResponse {
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<
DirEntryRouterRouteResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DirEntryRouterRouteResponse
{
#[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::<DirEntryRouterRouteResponse>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
fidl::encoding::encode_in_envelope::<
DirEntry,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
encoder,
offset + 8,
_depth,
)
}
DirEntryRouterRouteResponse::Unavailable(ref val) => {
fidl::encoding::encode_in_envelope::<
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirEntryRouterRouteResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::DirEntry(fidl::new_empty!(
DirEntry,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let DirEntryRouterRouteResponse::DirEntry(_) = self {
} else {
*self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
DirEntry,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
fidl::decode!(
DirEntry,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let DirEntryRouterRouteResponse::Unavailable(_) = self {
} else {
*self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
fidl::decode!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
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 DirectoryRouterRouteResponse {
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<
DirectoryRouterRouteResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DirectoryRouterRouteResponse
{
#[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::<DirectoryRouterRouteResponse>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
DirectoryRouterRouteResponse::Directory(ref mut val) => {
fidl::encoding::encode_in_envelope::<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
val
),
encoder,
offset + 8,
_depth,
)
}
DirectoryRouterRouteResponse::Unavailable(ref val) => {
fidl::encoding::encode_in_envelope::<
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
<Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DirectoryRouterRouteResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::Directory(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let DirectoryRouterRouteResponse::Directory(_) = self {
} else {
*self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let DirectoryRouterRouteResponse::Unavailable(_) = self {
} else {
*self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect
));
}
#[allow(irrefutable_let_patterns)]
if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
fidl::decode!(
Unit,
fidl::encoding::DefaultFuchsiaResourceDialect,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
}