#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const MAX_ARGS_COLLECT_LENGTH: u8 = 193;
pub const MAX_ARGS_NAME_LENGTH: u8 = 64;
pub const MAX_ARGS_VALUE_LENGTH: u8 = 128;
pub const MAX_ARGS_VECTOR_LENGTH: u8 = 255;
pub const MAX_FILE_NAME_LENGTH: u8 = 255;
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsCollectRequest {
pub prefix: String,
}
impl fidl::Persistable for ArgumentsCollectRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsCollectResponse {
pub results: Vec<String>,
}
impl fidl::Persistable for ArgumentsCollectResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsGetBoolRequest {
pub key: String,
pub defaultval: bool,
}
impl fidl::Persistable for ArgumentsGetBoolRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsGetBoolResponse {
pub value: bool,
}
impl fidl::Persistable for ArgumentsGetBoolResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsGetBoolsRequest {
pub keys: Vec<BoolPair>,
}
impl fidl::Persistable for ArgumentsGetBoolsRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsGetBoolsResponse {
pub values: Vec<bool>,
}
impl fidl::Persistable for ArgumentsGetBoolsResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsGetStringRequest {
pub key: String,
}
impl fidl::Persistable for ArgumentsGetStringRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsGetStringResponse {
pub value: Option<String>,
}
impl fidl::Persistable for ArgumentsGetStringResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsGetStringsRequest {
pub keys: Vec<String>,
}
impl fidl::Persistable for ArgumentsGetStringsRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ArgumentsGetStringsResponse {
pub values: Vec<Option<String>>,
}
impl fidl::Persistable for ArgumentsGetStringsResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BoolPair {
pub key: String,
pub defaultval: bool,
}
impl fidl::Persistable for BoolPair {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BootfsFileVmo {
pub offset: u32,
pub contents: fidl::Vmo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BootfsFileVmo {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct Extra {
pub n: u32,
}
impl fidl::Persistable for Extra {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct FactoryItemsGetRequest {
pub extra: u32,
}
impl fidl::Persistable for FactoryItemsGetRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FactoryItemsGetResponse {
pub payload: Option<fidl::Vmo>,
pub length: u32,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FactoryItemsGetResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ItemsGet2Request {
pub type_: u32,
pub extra: Option<Box<Extra>>,
}
impl fidl::Persistable for ItemsGet2Request {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ItemsGetBootloaderFileRequest {
pub filename: String,
}
impl fidl::Persistable for ItemsGetBootloaderFileRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ItemsGetBootloaderFileResponse {
pub payload: Option<fidl::Vmo>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ItemsGetBootloaderFileResponse
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ItemsGetRequest {
pub type_: u32,
pub extra: u32,
}
impl fidl::Persistable for ItemsGetRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ItemsGetResponse {
pub payload: Option<fidl::Vmo>,
pub length: u32,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ItemsGetResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ItemsGet2Response {
pub retrieved_items: Vec<RetrievedItems>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ItemsGet2Response {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ReadOnlyLogGetResponse {
pub log: fidl::DebugLog,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ReadOnlyLogGetResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RetrievedItems {
pub payload: fidl::Vmo,
pub length: u32,
pub extra: u32,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RetrievedItems {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SvcStashProviderGetResponse {
pub resource: fidl::endpoints::ServerEnd<SvcStashMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for SvcStashProviderGetResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SvcStashStoreRequest {
pub svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SvcStashStoreRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct UserbootPostBootfsFilesRequest {
pub files: Vec<BootfsFileVmo>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for UserbootPostBootfsFilesRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct UserbootPostStashSvcRequest {
pub stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for UserbootPostStashSvcRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct WriteOnlyLogGetResponse {
pub log: fidl::DebugLog,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WriteOnlyLogGetResponse {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ArgumentsMarker;
impl fidl::endpoints::ProtocolMarker for ArgumentsMarker {
type Proxy = ArgumentsProxy;
type RequestStream = ArgumentsRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ArgumentsSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.boot.Arguments";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ArgumentsMarker {}
pub trait ArgumentsProxyInterface: Send + Sync {
type GetStringResponseFut: std::future::Future<Output = Result<Option<String>, fidl::Error>>
+ Send;
fn r#get_string(&self, key: &str) -> Self::GetStringResponseFut;
type GetStringsResponseFut: std::future::Future<Output = Result<Vec<Option<String>>, fidl::Error>>
+ Send;
fn r#get_strings(&self, keys: &[String]) -> Self::GetStringsResponseFut;
type GetBoolResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
fn r#get_bool(&self, key: &str, defaultval: bool) -> Self::GetBoolResponseFut;
type GetBoolsResponseFut: std::future::Future<Output = Result<Vec<bool>, fidl::Error>> + Send;
fn r#get_bools(&self, keys: &[BoolPair]) -> Self::GetBoolsResponseFut;
type CollectResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
fn r#collect(&self, prefix: &str) -> Self::CollectResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ArgumentsSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ArgumentsSynchronousProxy {
type Proxy = ArgumentsProxy;
type Protocol = ArgumentsMarker;
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 ArgumentsSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ArgumentsMarker 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<ArgumentsEvent, fidl::Error> {
ArgumentsEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_string(
&self,
mut key: &str,
___deadline: zx::MonotonicInstant,
) -> Result<Option<String>, fidl::Error> {
let _response =
self.client.send_query::<ArgumentsGetStringRequest, ArgumentsGetStringResponse>(
(key,),
0x426c026d966f8fe,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.value)
}
pub fn r#get_strings(
&self,
mut keys: &[String],
___deadline: zx::MonotonicInstant,
) -> Result<Vec<Option<String>>, fidl::Error> {
let _response =
self.client.send_query::<ArgumentsGetStringsRequest, ArgumentsGetStringsResponse>(
(keys,),
0x328fb6b545aa96f7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.values)
}
pub fn r#get_bool(
&self,
mut key: &str,
mut defaultval: bool,
___deadline: zx::MonotonicInstant,
) -> Result<bool, fidl::Error> {
let _response =
self.client.send_query::<ArgumentsGetBoolRequest, ArgumentsGetBoolResponse>(
(key, defaultval),
0x4c5dd3149815cccd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.value)
}
pub fn r#get_bools(
&self,
mut keys: &[BoolPair],
___deadline: zx::MonotonicInstant,
) -> Result<Vec<bool>, fidl::Error> {
let _response =
self.client.send_query::<ArgumentsGetBoolsRequest, ArgumentsGetBoolsResponse>(
(keys,),
0xfcc9fc9a0f22615,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.values)
}
pub fn r#collect(
&self,
mut prefix: &str,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<String>, fidl::Error> {
let _response =
self.client.send_query::<ArgumentsCollectRequest, ArgumentsCollectResponse>(
(prefix,),
0x24e5acd864546e30,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.results)
}
}
#[derive(Debug, Clone)]
pub struct ArgumentsProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ArgumentsProxy {
type Protocol = ArgumentsMarker;
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 ArgumentsProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ArgumentsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ArgumentsEventStream {
ArgumentsEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_string(
&self,
mut key: &str,
) -> fidl::client::QueryResponseFut<Option<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ArgumentsProxyInterface::r#get_string(self, key)
}
pub fn r#get_strings(
&self,
mut keys: &[String],
) -> fidl::client::QueryResponseFut<
Vec<Option<String>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ArgumentsProxyInterface::r#get_strings(self, keys)
}
pub fn r#get_bool(
&self,
mut key: &str,
mut defaultval: bool,
) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
ArgumentsProxyInterface::r#get_bool(self, key, defaultval)
}
pub fn r#get_bools(
&self,
mut keys: &[BoolPair],
) -> fidl::client::QueryResponseFut<Vec<bool>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ArgumentsProxyInterface::r#get_bools(self, keys)
}
pub fn r#collect(
&self,
mut prefix: &str,
) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ArgumentsProxyInterface::r#collect(self, prefix)
}
}
impl ArgumentsProxyInterface for ArgumentsProxy {
type GetStringResponseFut = fidl::client::QueryResponseFut<
Option<String>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_string(&self, mut key: &str) -> Self::GetStringResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Option<String>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ArgumentsGetStringResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x426c026d966f8fe,
>(_buf?)?;
Ok(_response.value)
}
self.client.send_query_and_decode::<ArgumentsGetStringRequest, Option<String>>(
(key,),
0x426c026d966f8fe,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetStringsResponseFut = fidl::client::QueryResponseFut<
Vec<Option<String>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_strings(&self, mut keys: &[String]) -> Self::GetStringsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<Option<String>>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ArgumentsGetStringsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x328fb6b545aa96f7,
>(_buf?)?;
Ok(_response.values)
}
self.client.send_query_and_decode::<ArgumentsGetStringsRequest, Vec<Option<String>>>(
(keys,),
0x328fb6b545aa96f7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetBoolResponseFut =
fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_bool(&self, mut key: &str, mut defaultval: bool) -> Self::GetBoolResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<bool, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ArgumentsGetBoolResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4c5dd3149815cccd,
>(_buf?)?;
Ok(_response.value)
}
self.client.send_query_and_decode::<ArgumentsGetBoolRequest, bool>(
(key, defaultval),
0x4c5dd3149815cccd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetBoolsResponseFut =
fidl::client::QueryResponseFut<Vec<bool>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_bools(&self, mut keys: &[BoolPair]) -> Self::GetBoolsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<bool>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ArgumentsGetBoolsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xfcc9fc9a0f22615,
>(_buf?)?;
Ok(_response.values)
}
self.client.send_query_and_decode::<ArgumentsGetBoolsRequest, Vec<bool>>(
(keys,),
0xfcc9fc9a0f22615,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CollectResponseFut =
fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#collect(&self, mut prefix: &str) -> Self::CollectResponseFut {
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::<
ArgumentsCollectResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x24e5acd864546e30,
>(_buf?)?;
Ok(_response.results)
}
self.client.send_query_and_decode::<ArgumentsCollectRequest, Vec<String>>(
(prefix,),
0x24e5acd864546e30,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ArgumentsEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ArgumentsEventStream {}
impl futures::stream::FusedStream for ArgumentsEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ArgumentsEventStream {
type Item = Result<ArgumentsEvent, 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(ArgumentsEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ArgumentsEvent {}
impl ArgumentsEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ArgumentsEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ArgumentsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ArgumentsRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ArgumentsRequestStream {}
impl futures::stream::FusedStream for ArgumentsRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ArgumentsRequestStream {
type Protocol = ArgumentsMarker;
type ControlHandle = ArgumentsControlHandle;
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 {
ArgumentsControlHandle { 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 ArgumentsRequestStream {
type Item = Result<ArgumentsRequest, 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 ArgumentsRequestStream 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 {
0x426c026d966f8fe => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ArgumentsGetStringRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsGetStringRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
Ok(ArgumentsRequest::GetString {
key: req.key,
responder: ArgumentsGetStringResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x328fb6b545aa96f7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ArgumentsGetStringsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsGetStringsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
Ok(ArgumentsRequest::GetStrings {
keys: req.keys,
responder: ArgumentsGetStringsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4c5dd3149815cccd => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ArgumentsGetBoolRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsGetBoolRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
Ok(ArgumentsRequest::GetBool {
key: req.key,
defaultval: req.defaultval,
responder: ArgumentsGetBoolResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xfcc9fc9a0f22615 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ArgumentsGetBoolsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsGetBoolsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
Ok(ArgumentsRequest::GetBools {
keys: req.keys,
responder: ArgumentsGetBoolsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x24e5acd864546e30 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ArgumentsCollectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsCollectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
Ok(ArgumentsRequest::Collect {
prefix: req.prefix,
responder: ArgumentsCollectResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ArgumentsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ArgumentsRequest {
GetString { key: String, responder: ArgumentsGetStringResponder },
GetStrings { keys: Vec<String>, responder: ArgumentsGetStringsResponder },
GetBool { key: String, defaultval: bool, responder: ArgumentsGetBoolResponder },
GetBools { keys: Vec<BoolPair>, responder: ArgumentsGetBoolsResponder },
Collect { prefix: String, responder: ArgumentsCollectResponder },
}
impl ArgumentsRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_string(self) -> Option<(String, ArgumentsGetStringResponder)> {
if let ArgumentsRequest::GetString { key, responder } = self {
Some((key, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_strings(self) -> Option<(Vec<String>, ArgumentsGetStringsResponder)> {
if let ArgumentsRequest::GetStrings { keys, responder } = self {
Some((keys, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_bool(self) -> Option<(String, bool, ArgumentsGetBoolResponder)> {
if let ArgumentsRequest::GetBool { key, defaultval, responder } = self {
Some((key, defaultval, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_bools(self) -> Option<(Vec<BoolPair>, ArgumentsGetBoolsResponder)> {
if let ArgumentsRequest::GetBools { keys, responder } = self {
Some((keys, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_collect(self) -> Option<(String, ArgumentsCollectResponder)> {
if let ArgumentsRequest::Collect { prefix, responder } = self {
Some((prefix, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ArgumentsRequest::GetString { .. } => "get_string",
ArgumentsRequest::GetStrings { .. } => "get_strings",
ArgumentsRequest::GetBool { .. } => "get_bool",
ArgumentsRequest::GetBools { .. } => "get_bools",
ArgumentsRequest::Collect { .. } => "collect",
}
}
}
#[derive(Debug, Clone)]
pub struct ArgumentsControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ArgumentsControlHandle {
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 ArgumentsControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ArgumentsGetStringResponder {
control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ArgumentsGetStringResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ArgumentsGetStringResponder {
type ControlHandle = ArgumentsControlHandle;
fn control_handle(&self) -> &ArgumentsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ArgumentsGetStringResponder {
pub fn send(self, mut value: Option<&str>) -> Result<(), fidl::Error> {
let _result = self.send_raw(value);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut value: Option<&str>) -> Result<(), fidl::Error> {
let _result = self.send_raw(value);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut value: Option<&str>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ArgumentsGetStringResponse>(
(value,),
self.tx_id,
0x426c026d966f8fe,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ArgumentsGetStringsResponder {
control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ArgumentsGetStringsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ArgumentsGetStringsResponder {
type ControlHandle = ArgumentsControlHandle;
fn control_handle(&self) -> &ArgumentsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ArgumentsGetStringsResponder {
pub fn send(self, mut values: &[Option<String>]) -> Result<(), fidl::Error> {
let _result = self.send_raw(values);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut values: &[Option<String>]) -> Result<(), fidl::Error> {
let _result = self.send_raw(values);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut values: &[Option<String>]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ArgumentsGetStringsResponse>(
(values,),
self.tx_id,
0x328fb6b545aa96f7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ArgumentsGetBoolResponder {
control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ArgumentsGetBoolResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ArgumentsGetBoolResponder {
type ControlHandle = ArgumentsControlHandle;
fn control_handle(&self) -> &ArgumentsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ArgumentsGetBoolResponder {
pub fn send(self, mut value: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(value);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut value: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(value);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut value: bool) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ArgumentsGetBoolResponse>(
(value,),
self.tx_id,
0x4c5dd3149815cccd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ArgumentsGetBoolsResponder {
control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ArgumentsGetBoolsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ArgumentsGetBoolsResponder {
type ControlHandle = ArgumentsControlHandle;
fn control_handle(&self) -> &ArgumentsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ArgumentsGetBoolsResponder {
pub fn send(self, mut values: &[bool]) -> Result<(), fidl::Error> {
let _result = self.send_raw(values);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut values: &[bool]) -> Result<(), fidl::Error> {
let _result = self.send_raw(values);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut values: &[bool]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ArgumentsGetBoolsResponse>(
(values,),
self.tx_id,
0xfcc9fc9a0f22615,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ArgumentsCollectResponder {
control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ArgumentsCollectResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ArgumentsCollectResponder {
type ControlHandle = ArgumentsControlHandle;
fn control_handle(&self) -> &ArgumentsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ArgumentsCollectResponder {
pub fn send(self, mut results: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(results);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut results: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(results);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut results: &[String]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ArgumentsCollectResponse>(
(results,),
self.tx_id,
0x24e5acd864546e30,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct FactoryItemsMarker;
impl fidl::endpoints::ProtocolMarker for FactoryItemsMarker {
type Proxy = FactoryItemsProxy;
type RequestStream = FactoryItemsRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = FactoryItemsSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.boot.FactoryItems";
}
impl fidl::endpoints::DiscoverableProtocolMarker for FactoryItemsMarker {}
pub trait FactoryItemsProxyInterface: Send + Sync {
type GetResponseFut: std::future::Future<Output = Result<(Option<fidl::Vmo>, u32), fidl::Error>>
+ Send;
fn r#get(&self, extra: u32) -> Self::GetResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct FactoryItemsSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for FactoryItemsSynchronousProxy {
type Proxy = FactoryItemsProxy;
type Protocol = FactoryItemsMarker;
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 FactoryItemsSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <FactoryItemsMarker 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<FactoryItemsEvent, fidl::Error> {
FactoryItemsEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get(
&self,
mut extra: u32,
___deadline: zx::MonotonicInstant,
) -> Result<(Option<fidl::Vmo>, u32), fidl::Error> {
let _response = self.client.send_query::<FactoryItemsGetRequest, FactoryItemsGetResponse>(
(extra,),
0x2f0dcb1aba41b6d9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.payload, _response.length))
}
}
#[derive(Debug, Clone)]
pub struct FactoryItemsProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for FactoryItemsProxy {
type Protocol = FactoryItemsMarker;
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 FactoryItemsProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <FactoryItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> FactoryItemsEventStream {
FactoryItemsEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get(
&self,
mut extra: u32,
) -> fidl::client::QueryResponseFut<
(Option<fidl::Vmo>, u32),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
FactoryItemsProxyInterface::r#get(self, extra)
}
}
impl FactoryItemsProxyInterface for FactoryItemsProxy {
type GetResponseFut = fidl::client::QueryResponseFut<
(Option<fidl::Vmo>, u32),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get(&self, mut extra: u32) -> Self::GetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(Option<fidl::Vmo>, u32), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
FactoryItemsGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2f0dcb1aba41b6d9,
>(_buf?)?;
Ok((_response.payload, _response.length))
}
self.client.send_query_and_decode::<FactoryItemsGetRequest, (Option<fidl::Vmo>, u32)>(
(extra,),
0x2f0dcb1aba41b6d9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct FactoryItemsEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for FactoryItemsEventStream {}
impl futures::stream::FusedStream for FactoryItemsEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for FactoryItemsEventStream {
type Item = Result<FactoryItemsEvent, 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(FactoryItemsEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum FactoryItemsEvent {}
impl FactoryItemsEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<FactoryItemsEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <FactoryItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct FactoryItemsRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for FactoryItemsRequestStream {}
impl futures::stream::FusedStream for FactoryItemsRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for FactoryItemsRequestStream {
type Protocol = FactoryItemsMarker;
type ControlHandle = FactoryItemsControlHandle;
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 {
FactoryItemsControlHandle { 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 FactoryItemsRequestStream {
type Item = Result<FactoryItemsRequest, 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 FactoryItemsRequestStream 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 {
0x2f0dcb1aba41b6d9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
FactoryItemsGetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FactoryItemsGetRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
FactoryItemsControlHandle { inner: this.inner.clone() };
Ok(FactoryItemsRequest::Get {
extra: req.extra,
responder: FactoryItemsGetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<FactoryItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum FactoryItemsRequest {
Get { extra: u32, responder: FactoryItemsGetResponder },
}
impl FactoryItemsRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get(self) -> Option<(u32, FactoryItemsGetResponder)> {
if let FactoryItemsRequest::Get { extra, responder } = self {
Some((extra, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
FactoryItemsRequest::Get { .. } => "get",
}
}
}
#[derive(Debug, Clone)]
pub struct FactoryItemsControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for FactoryItemsControlHandle {
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 FactoryItemsControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct FactoryItemsGetResponder {
control_handle: std::mem::ManuallyDrop<FactoryItemsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for FactoryItemsGetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for FactoryItemsGetResponder {
type ControlHandle = FactoryItemsControlHandle;
fn control_handle(&self) -> &FactoryItemsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl FactoryItemsGetResponder {
pub fn send(self, mut payload: Option<fidl::Vmo>, mut length: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload, length);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: Option<fidl::Vmo>,
mut length: u32,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload, length);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: Option<fidl::Vmo>, mut length: u32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<FactoryItemsGetResponse>(
(payload, length),
self.tx_id,
0x2f0dcb1aba41b6d9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ItemsMarker;
impl fidl::endpoints::ProtocolMarker for ItemsMarker {
type Proxy = ItemsProxy;
type RequestStream = ItemsRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ItemsSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.boot.Items";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ItemsMarker {}
pub type ItemsGet2Result = Result<Vec<RetrievedItems>, i32>;
pub trait ItemsProxyInterface: Send + Sync {
type GetResponseFut: std::future::Future<Output = Result<(Option<fidl::Vmo>, u32), fidl::Error>>
+ Send;
fn r#get(&self, type_: u32, extra: u32) -> Self::GetResponseFut;
type Get2ResponseFut: std::future::Future<Output = Result<ItemsGet2Result, fidl::Error>> + Send;
fn r#get2(&self, type_: u32, extra: Option<&Extra>) -> Self::Get2ResponseFut;
type GetBootloaderFileResponseFut: std::future::Future<Output = Result<Option<fidl::Vmo>, fidl::Error>>
+ Send;
fn r#get_bootloader_file(&self, filename: &str) -> Self::GetBootloaderFileResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ItemsSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ItemsSynchronousProxy {
type Proxy = ItemsProxy;
type Protocol = ItemsMarker;
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 ItemsSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ItemsMarker 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<ItemsEvent, fidl::Error> {
ItemsEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get(
&self,
mut type_: u32,
mut extra: u32,
___deadline: zx::MonotonicInstant,
) -> Result<(Option<fidl::Vmo>, u32), fidl::Error> {
let _response = self.client.send_query::<ItemsGetRequest, ItemsGetResponse>(
(type_, extra),
0x542db3f176641edc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.payload, _response.length))
}
pub fn r#get2(
&self,
mut type_: u32,
mut extra: Option<&Extra>,
___deadline: zx::MonotonicInstant,
) -> Result<ItemsGet2Result, fidl::Error> {
let _response = self
.client
.send_query::<ItemsGet2Request, fidl::encoding::ResultType<ItemsGet2Response, i32>>(
(type_, extra),
0x2a64bd32f9ba3f2e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.retrieved_items))
}
pub fn r#get_bootloader_file(
&self,
mut filename: &str,
___deadline: zx::MonotonicInstant,
) -> Result<Option<fidl::Vmo>, fidl::Error> {
let _response = self
.client
.send_query::<ItemsGetBootloaderFileRequest, ItemsGetBootloaderFileResponse>(
(filename,),
0x5a004db3c9378e8c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.payload)
}
}
#[derive(Debug, Clone)]
pub struct ItemsProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ItemsProxy {
type Protocol = ItemsMarker;
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 ItemsProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ItemsEventStream {
ItemsEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get(
&self,
mut type_: u32,
mut extra: u32,
) -> fidl::client::QueryResponseFut<
(Option<fidl::Vmo>, u32),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ItemsProxyInterface::r#get(self, type_, extra)
}
pub fn r#get2(
&self,
mut type_: u32,
mut extra: Option<&Extra>,
) -> fidl::client::QueryResponseFut<
ItemsGet2Result,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ItemsProxyInterface::r#get2(self, type_, extra)
}
pub fn r#get_bootloader_file(
&self,
mut filename: &str,
) -> fidl::client::QueryResponseFut<
Option<fidl::Vmo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ItemsProxyInterface::r#get_bootloader_file(self, filename)
}
}
impl ItemsProxyInterface for ItemsProxy {
type GetResponseFut = fidl::client::QueryResponseFut<
(Option<fidl::Vmo>, u32),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get(&self, mut type_: u32, mut extra: u32) -> Self::GetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(Option<fidl::Vmo>, u32), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ItemsGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x542db3f176641edc,
>(_buf?)?;
Ok((_response.payload, _response.length))
}
self.client.send_query_and_decode::<ItemsGetRequest, (Option<fidl::Vmo>, u32)>(
(type_, extra),
0x542db3f176641edc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type Get2ResponseFut = fidl::client::QueryResponseFut<
ItemsGet2Result,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get2(&self, mut type_: u32, mut extra: Option<&Extra>) -> Self::Get2ResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ItemsGet2Result, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ItemsGet2Response, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2a64bd32f9ba3f2e,
>(_buf?)?;
Ok(_response.map(|x| x.retrieved_items))
}
self.client.send_query_and_decode::<ItemsGet2Request, ItemsGet2Result>(
(type_, extra),
0x2a64bd32f9ba3f2e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetBootloaderFileResponseFut = fidl::client::QueryResponseFut<
Option<fidl::Vmo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_bootloader_file(&self, mut filename: &str) -> Self::GetBootloaderFileResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Option<fidl::Vmo>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ItemsGetBootloaderFileResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5a004db3c9378e8c,
>(_buf?)?;
Ok(_response.payload)
}
self.client.send_query_and_decode::<ItemsGetBootloaderFileRequest, Option<fidl::Vmo>>(
(filename,),
0x5a004db3c9378e8c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ItemsEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ItemsEventStream {}
impl futures::stream::FusedStream for ItemsEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ItemsEventStream {
type Item = Result<ItemsEvent, 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(ItemsEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ItemsEvent {}
impl ItemsEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ItemsEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ItemsRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ItemsRequestStream {}
impl futures::stream::FusedStream for ItemsRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ItemsRequestStream {
type Protocol = ItemsMarker;
type ControlHandle = ItemsControlHandle;
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 {
ItemsControlHandle { 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 ItemsRequestStream {
type Item = Result<ItemsRequest, 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 ItemsRequestStream 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 {
0x542db3f176641edc => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ItemsGetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ItemsGetRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ItemsControlHandle { inner: this.inner.clone() };
Ok(ItemsRequest::Get {
type_: req.type_,
extra: req.extra,
responder: ItemsGetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2a64bd32f9ba3f2e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ItemsGet2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ItemsGet2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ItemsControlHandle { inner: this.inner.clone() };
Ok(ItemsRequest::Get2 {
type_: req.type_,
extra: req.extra,
responder: ItemsGet2Responder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5a004db3c9378e8c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ItemsGetBootloaderFileRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ItemsGetBootloaderFileRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ItemsControlHandle { inner: this.inner.clone() };
Ok(ItemsRequest::GetBootloaderFile {
filename: req.filename,
responder: ItemsGetBootloaderFileResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <ItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ItemsRequest {
Get { type_: u32, extra: u32, responder: ItemsGetResponder },
Get2 { type_: u32, extra: Option<Box<Extra>>, responder: ItemsGet2Responder },
GetBootloaderFile { filename: String, responder: ItemsGetBootloaderFileResponder },
}
impl ItemsRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get(self) -> Option<(u32, u32, ItemsGetResponder)> {
if let ItemsRequest::Get { type_, extra, responder } = self {
Some((type_, extra, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get2(self) -> Option<(u32, Option<Box<Extra>>, ItemsGet2Responder)> {
if let ItemsRequest::Get2 { type_, extra, responder } = self {
Some((type_, extra, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_bootloader_file(self) -> Option<(String, ItemsGetBootloaderFileResponder)> {
if let ItemsRequest::GetBootloaderFile { filename, responder } = self {
Some((filename, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ItemsRequest::Get { .. } => "get",
ItemsRequest::Get2 { .. } => "get2",
ItemsRequest::GetBootloaderFile { .. } => "get_bootloader_file",
}
}
}
#[derive(Debug, Clone)]
pub struct ItemsControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ItemsControlHandle {
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 ItemsControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ItemsGetResponder {
control_handle: std::mem::ManuallyDrop<ItemsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ItemsGetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ItemsGetResponder {
type ControlHandle = ItemsControlHandle;
fn control_handle(&self) -> &ItemsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ItemsGetResponder {
pub fn send(self, mut payload: Option<fidl::Vmo>, mut length: u32) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload, length);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: Option<fidl::Vmo>,
mut length: u32,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload, length);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: Option<fidl::Vmo>, mut length: u32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ItemsGetResponse>(
(payload, length),
self.tx_id,
0x542db3f176641edc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ItemsGet2Responder {
control_handle: std::mem::ManuallyDrop<ItemsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ItemsGet2Responder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ItemsGet2Responder {
type ControlHandle = ItemsControlHandle;
fn control_handle(&self) -> &ItemsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ItemsGet2Responder {
pub fn send(self, mut result: Result<Vec<RetrievedItems>, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<Vec<RetrievedItems>, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<Vec<RetrievedItems>, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ItemsGet2Response, i32>>(
result
.as_mut()
.map_err(|e| *e)
.map(|retrieved_items| (retrieved_items.as_mut_slice(),)),
self.tx_id,
0x2a64bd32f9ba3f2e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ItemsGetBootloaderFileResponder {
control_handle: std::mem::ManuallyDrop<ItemsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ItemsGetBootloaderFileResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ItemsGetBootloaderFileResponder {
type ControlHandle = ItemsControlHandle;
fn control_handle(&self) -> &ItemsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ItemsGetBootloaderFileResponder {
pub fn send(self, mut payload: Option<fidl::Vmo>) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: Option<fidl::Vmo>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: Option<fidl::Vmo>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ItemsGetBootloaderFileResponse>(
(payload,),
self.tx_id,
0x5a004db3c9378e8c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ReadOnlyLogMarker;
impl fidl::endpoints::ProtocolMarker for ReadOnlyLogMarker {
type Proxy = ReadOnlyLogProxy;
type RequestStream = ReadOnlyLogRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ReadOnlyLogSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.boot.ReadOnlyLog";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ReadOnlyLogMarker {}
pub trait ReadOnlyLogProxyInterface: Send + Sync {
type GetResponseFut: std::future::Future<Output = Result<fidl::DebugLog, fidl::Error>> + Send;
fn r#get(&self) -> Self::GetResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ReadOnlyLogSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ReadOnlyLogSynchronousProxy {
type Proxy = ReadOnlyLogProxy;
type Protocol = ReadOnlyLogMarker;
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 ReadOnlyLogSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ReadOnlyLogMarker 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<ReadOnlyLogEvent, fidl::Error> {
ReadOnlyLogEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::DebugLog, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, ReadOnlyLogGetResponse>(
(),
0x6f3ceba5eca871ff,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.log)
}
}
#[derive(Debug, Clone)]
pub struct ReadOnlyLogProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ReadOnlyLogProxy {
type Protocol = ReadOnlyLogMarker;
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 ReadOnlyLogProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ReadOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ReadOnlyLogEventStream {
ReadOnlyLogEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get(
&self,
) -> fidl::client::QueryResponseFut<fidl::DebugLog, fidl::encoding::DefaultFuchsiaResourceDialect>
{
ReadOnlyLogProxyInterface::r#get(self)
}
}
impl ReadOnlyLogProxyInterface for ReadOnlyLogProxy {
type GetResponseFut = fidl::client::QueryResponseFut<
fidl::DebugLog,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get(&self) -> Self::GetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::DebugLog, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ReadOnlyLogGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6f3ceba5eca871ff,
>(_buf?)?;
Ok(_response.log)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::DebugLog>(
(),
0x6f3ceba5eca871ff,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ReadOnlyLogEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ReadOnlyLogEventStream {}
impl futures::stream::FusedStream for ReadOnlyLogEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ReadOnlyLogEventStream {
type Item = Result<ReadOnlyLogEvent, 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(ReadOnlyLogEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ReadOnlyLogEvent {}
impl ReadOnlyLogEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ReadOnlyLogEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ReadOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ReadOnlyLogRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ReadOnlyLogRequestStream {}
impl futures::stream::FusedStream for ReadOnlyLogRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ReadOnlyLogRequestStream {
type Protocol = ReadOnlyLogMarker;
type ControlHandle = ReadOnlyLogControlHandle;
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 {
ReadOnlyLogControlHandle { 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 ReadOnlyLogRequestStream {
type Item = Result<ReadOnlyLogRequest, 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 ReadOnlyLogRequestStream 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 {
0x6f3ceba5eca871ff => {
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 = ReadOnlyLogControlHandle { inner: this.inner.clone() };
Ok(ReadOnlyLogRequest::Get {
responder: ReadOnlyLogGetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ReadOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ReadOnlyLogRequest {
Get { responder: ReadOnlyLogGetResponder },
}
impl ReadOnlyLogRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get(self) -> Option<(ReadOnlyLogGetResponder)> {
if let ReadOnlyLogRequest::Get { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ReadOnlyLogRequest::Get { .. } => "get",
}
}
}
#[derive(Debug, Clone)]
pub struct ReadOnlyLogControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ReadOnlyLogControlHandle {
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 ReadOnlyLogControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ReadOnlyLogGetResponder {
control_handle: std::mem::ManuallyDrop<ReadOnlyLogControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ReadOnlyLogGetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ReadOnlyLogGetResponder {
type ControlHandle = ReadOnlyLogControlHandle;
fn control_handle(&self) -> &ReadOnlyLogControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ReadOnlyLogGetResponder {
pub fn send(self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
let _result = self.send_raw(log);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
let _result = self.send_raw(log);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ReadOnlyLogGetResponse>(
(log,),
self.tx_id,
0x6f3ceba5eca871ff,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SvcStashMarker;
impl fidl::endpoints::ProtocolMarker for SvcStashMarker {
type Proxy = SvcStashProxy;
type RequestStream = SvcStashRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SvcStashSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) SvcStash";
}
pub trait SvcStashProxyInterface: Send + Sync {
fn r#store(
&self,
svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SvcStashSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SvcStashSynchronousProxy {
type Proxy = SvcStashProxy;
type Protocol = SvcStashMarker;
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 SvcStashSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SvcStashMarker 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<SvcStashEvent, fidl::Error> {
SvcStashEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#store(
&self,
mut svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<SvcStashStoreRequest>(
(svc_endpoint,),
0xc2648e356ca2870,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct SvcStashProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for SvcStashProxy {
type Protocol = SvcStashMarker;
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 SvcStashProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <SvcStashMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SvcStashEventStream {
SvcStashEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#store(
&self,
mut svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Result<(), fidl::Error> {
SvcStashProxyInterface::r#store(self, svc_endpoint)
}
}
impl SvcStashProxyInterface for SvcStashProxy {
fn r#store(
&self,
mut svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<SvcStashStoreRequest>(
(svc_endpoint,),
0xc2648e356ca2870,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct SvcStashEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for SvcStashEventStream {}
impl futures::stream::FusedStream for SvcStashEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SvcStashEventStream {
type Item = Result<SvcStashEvent, 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(SvcStashEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SvcStashEvent {}
impl SvcStashEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<SvcStashEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <SvcStashMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SvcStashRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for SvcStashRequestStream {}
impl futures::stream::FusedStream for SvcStashRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SvcStashRequestStream {
type Protocol = SvcStashMarker;
type ControlHandle = SvcStashControlHandle;
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 {
SvcStashControlHandle { 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 SvcStashRequestStream {
type Item = Result<SvcStashRequest, 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 SvcStashRequestStream 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 {
0xc2648e356ca2870 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
SvcStashStoreRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SvcStashStoreRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SvcStashControlHandle { inner: this.inner.clone() };
Ok(SvcStashRequest::Store {
svc_endpoint: req.svc_endpoint,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<SvcStashMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum SvcStashRequest {
Store {
svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
control_handle: SvcStashControlHandle,
},
}
impl SvcStashRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_store(
self,
) -> Option<(fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>, SvcStashControlHandle)>
{
if let SvcStashRequest::Store { svc_endpoint, control_handle } = self {
Some((svc_endpoint, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SvcStashRequest::Store { .. } => "store",
}
}
}
#[derive(Debug, Clone)]
pub struct SvcStashControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for SvcStashControlHandle {
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 SvcStashControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SvcStashProviderMarker;
impl fidl::endpoints::ProtocolMarker for SvcStashProviderMarker {
type Proxy = SvcStashProviderProxy;
type RequestStream = SvcStashProviderRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SvcStashProviderSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.boot.SvcStashProvider";
}
impl fidl::endpoints::DiscoverableProtocolMarker for SvcStashProviderMarker {}
pub type SvcStashProviderGetResult = Result<fidl::endpoints::ServerEnd<SvcStashMarker>, i32>;
pub trait SvcStashProviderProxyInterface: Send + Sync {
type GetResponseFut: std::future::Future<Output = Result<SvcStashProviderGetResult, fidl::Error>>
+ Send;
fn r#get(&self) -> Self::GetResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SvcStashProviderSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SvcStashProviderSynchronousProxy {
type Proxy = SvcStashProviderProxy;
type Protocol = SvcStashProviderMarker;
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 SvcStashProviderSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SvcStashProviderMarker 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<SvcStashProviderEvent, fidl::Error> {
SvcStashProviderEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<SvcStashProviderGetResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<SvcStashProviderGetResponse, i32>,
>(
(),
0x3885bad5b734f883,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.resource))
}
}
#[derive(Debug, Clone)]
pub struct SvcStashProviderProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for SvcStashProviderProxy {
type Protocol = SvcStashProviderMarker;
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 SvcStashProviderProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <SvcStashProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SvcStashProviderEventStream {
SvcStashProviderEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get(
&self,
) -> fidl::client::QueryResponseFut<
SvcStashProviderGetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SvcStashProviderProxyInterface::r#get(self)
}
}
impl SvcStashProviderProxyInterface for SvcStashProviderProxy {
type GetResponseFut = fidl::client::QueryResponseFut<
SvcStashProviderGetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get(&self) -> Self::GetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SvcStashProviderGetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<SvcStashProviderGetResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3885bad5b734f883,
>(_buf?)?;
Ok(_response.map(|x| x.resource))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, SvcStashProviderGetResult>(
(),
0x3885bad5b734f883,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct SvcStashProviderEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for SvcStashProviderEventStream {}
impl futures::stream::FusedStream for SvcStashProviderEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SvcStashProviderEventStream {
type Item = Result<SvcStashProviderEvent, 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(SvcStashProviderEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SvcStashProviderEvent {}
impl SvcStashProviderEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<SvcStashProviderEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<SvcStashProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SvcStashProviderRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for SvcStashProviderRequestStream {}
impl futures::stream::FusedStream for SvcStashProviderRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SvcStashProviderRequestStream {
type Protocol = SvcStashProviderMarker;
type ControlHandle = SvcStashProviderControlHandle;
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 {
SvcStashProviderControlHandle { 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 SvcStashProviderRequestStream {
type Item = Result<SvcStashProviderRequest, 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 SvcStashProviderRequestStream 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 {
0x3885bad5b734f883 => {
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 =
SvcStashProviderControlHandle { inner: this.inner.clone() };
Ok(SvcStashProviderRequest::Get {
responder: SvcStashProviderGetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<SvcStashProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum SvcStashProviderRequest {
Get { responder: SvcStashProviderGetResponder },
}
impl SvcStashProviderRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get(self) -> Option<(SvcStashProviderGetResponder)> {
if let SvcStashProviderRequest::Get { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SvcStashProviderRequest::Get { .. } => "get",
}
}
}
#[derive(Debug, Clone)]
pub struct SvcStashProviderControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for SvcStashProviderControlHandle {
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 SvcStashProviderControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SvcStashProviderGetResponder {
control_handle: std::mem::ManuallyDrop<SvcStashProviderControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SvcStashProviderGetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SvcStashProviderGetResponder {
type ControlHandle = SvcStashProviderControlHandle;
fn control_handle(&self) -> &SvcStashProviderControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SvcStashProviderGetResponder {
pub fn send(
self,
mut result: Result<fidl::endpoints::ServerEnd<SvcStashMarker>, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<fidl::endpoints::ServerEnd<SvcStashMarker>, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl::endpoints::ServerEnd<SvcStashMarker>, i32>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<SvcStashProviderGetResponse, i32>>(
result.map(|resource| (resource,)),
self.tx_id,
0x3885bad5b734f883,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct UserbootMarker;
impl fidl::endpoints::ProtocolMarker for UserbootMarker {
type Proxy = UserbootProxy;
type RequestStream = UserbootRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = UserbootSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Userboot";
}
pub trait UserbootProxyInterface: Send + Sync {
fn r#post_bootfs_files(&self, files: Vec<BootfsFileVmo>) -> Result<(), fidl::Error>;
fn r#post_stash_svc(
&self,
stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct UserbootSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for UserbootSynchronousProxy {
type Proxy = UserbootProxy;
type Protocol = UserbootMarker;
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 UserbootSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <UserbootMarker 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<UserbootEvent, fidl::Error> {
UserbootEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#post_bootfs_files(&self, mut files: Vec<BootfsFileVmo>) -> Result<(), fidl::Error> {
self.client.send::<UserbootPostBootfsFilesRequest>(
(files.as_mut(),),
0x296d4420db7cc694,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#post_stash_svc(
&self,
mut stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<UserbootPostStashSvcRequest>(
(stash_svc_endpoint,),
0x506ecf7db01adeac,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct UserbootProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for UserbootProxy {
type Protocol = UserbootMarker;
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 UserbootProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <UserbootMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> UserbootEventStream {
UserbootEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#post_bootfs_files(&self, mut files: Vec<BootfsFileVmo>) -> Result<(), fidl::Error> {
UserbootProxyInterface::r#post_bootfs_files(self, files)
}
pub fn r#post_stash_svc(
&self,
mut stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
) -> Result<(), fidl::Error> {
UserbootProxyInterface::r#post_stash_svc(self, stash_svc_endpoint)
}
}
impl UserbootProxyInterface for UserbootProxy {
fn r#post_bootfs_files(&self, mut files: Vec<BootfsFileVmo>) -> Result<(), fidl::Error> {
self.client.send::<UserbootPostBootfsFilesRequest>(
(files.as_mut(),),
0x296d4420db7cc694,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#post_stash_svc(
&self,
mut stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<UserbootPostStashSvcRequest>(
(stash_svc_endpoint,),
0x506ecf7db01adeac,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct UserbootEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for UserbootEventStream {}
impl futures::stream::FusedStream for UserbootEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for UserbootEventStream {
type Item = Result<UserbootEvent, 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(UserbootEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum UserbootEvent {}
impl UserbootEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<UserbootEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <UserbootMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct UserbootRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for UserbootRequestStream {}
impl futures::stream::FusedStream for UserbootRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for UserbootRequestStream {
type Protocol = UserbootMarker;
type ControlHandle = UserbootControlHandle;
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 {
UserbootControlHandle { 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 UserbootRequestStream {
type Item = Result<UserbootRequest, 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 UserbootRequestStream 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 {
0x296d4420db7cc694 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
UserbootPostBootfsFilesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UserbootPostBootfsFilesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = UserbootControlHandle { inner: this.inner.clone() };
Ok(UserbootRequest::PostBootfsFiles { files: req.files, control_handle })
}
0x506ecf7db01adeac => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
UserbootPostStashSvcRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UserbootPostStashSvcRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = UserbootControlHandle { inner: this.inner.clone() };
Ok(UserbootRequest::PostStashSvc {
stash_svc_endpoint: req.stash_svc_endpoint,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<UserbootMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum UserbootRequest {
PostBootfsFiles { files: Vec<BootfsFileVmo>, control_handle: UserbootControlHandle },
PostStashSvc {
stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
control_handle: UserbootControlHandle,
},
}
impl UserbootRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_post_bootfs_files(self) -> Option<(Vec<BootfsFileVmo>, UserbootControlHandle)> {
if let UserbootRequest::PostBootfsFiles { files, control_handle } = self {
Some((files, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_post_stash_svc(
self,
) -> Option<(fidl::endpoints::ServerEnd<SvcStashMarker>, UserbootControlHandle)> {
if let UserbootRequest::PostStashSvc { stash_svc_endpoint, control_handle } = self {
Some((stash_svc_endpoint, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
UserbootRequest::PostBootfsFiles { .. } => "post_bootfs_files",
UserbootRequest::PostStashSvc { .. } => "post_stash_svc",
}
}
}
#[derive(Debug, Clone)]
pub struct UserbootControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for UserbootControlHandle {
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 UserbootControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WriteOnlyLogMarker;
impl fidl::endpoints::ProtocolMarker for WriteOnlyLogMarker {
type Proxy = WriteOnlyLogProxy;
type RequestStream = WriteOnlyLogRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = WriteOnlyLogSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.boot.WriteOnlyLog";
}
impl fidl::endpoints::DiscoverableProtocolMarker for WriteOnlyLogMarker {}
pub trait WriteOnlyLogProxyInterface: Send + Sync {
type GetResponseFut: std::future::Future<Output = Result<fidl::DebugLog, fidl::Error>> + Send;
fn r#get(&self) -> Self::GetResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct WriteOnlyLogSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for WriteOnlyLogSynchronousProxy {
type Proxy = WriteOnlyLogProxy;
type Protocol = WriteOnlyLogMarker;
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 WriteOnlyLogSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <WriteOnlyLogMarker 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<WriteOnlyLogEvent, fidl::Error> {
WriteOnlyLogEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::DebugLog, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, WriteOnlyLogGetResponse>(
(),
0x4579dac289d3007,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.log)
}
}
#[derive(Debug, Clone)]
pub struct WriteOnlyLogProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for WriteOnlyLogProxy {
type Protocol = WriteOnlyLogMarker;
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 WriteOnlyLogProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <WriteOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> WriteOnlyLogEventStream {
WriteOnlyLogEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get(
&self,
) -> fidl::client::QueryResponseFut<fidl::DebugLog, fidl::encoding::DefaultFuchsiaResourceDialect>
{
WriteOnlyLogProxyInterface::r#get(self)
}
}
impl WriteOnlyLogProxyInterface for WriteOnlyLogProxy {
type GetResponseFut = fidl::client::QueryResponseFut<
fidl::DebugLog,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get(&self) -> Self::GetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::DebugLog, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
WriteOnlyLogGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4579dac289d3007,
>(_buf?)?;
Ok(_response.log)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::DebugLog>(
(),
0x4579dac289d3007,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct WriteOnlyLogEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for WriteOnlyLogEventStream {}
impl futures::stream::FusedStream for WriteOnlyLogEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for WriteOnlyLogEventStream {
type Item = Result<WriteOnlyLogEvent, 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(WriteOnlyLogEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum WriteOnlyLogEvent {}
impl WriteOnlyLogEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<WriteOnlyLogEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <WriteOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct WriteOnlyLogRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for WriteOnlyLogRequestStream {}
impl futures::stream::FusedStream for WriteOnlyLogRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for WriteOnlyLogRequestStream {
type Protocol = WriteOnlyLogMarker;
type ControlHandle = WriteOnlyLogControlHandle;
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 {
WriteOnlyLogControlHandle { 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 WriteOnlyLogRequestStream {
type Item = Result<WriteOnlyLogRequest, 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 WriteOnlyLogRequestStream 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 {
0x4579dac289d3007 => {
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 =
WriteOnlyLogControlHandle { inner: this.inner.clone() };
Ok(WriteOnlyLogRequest::Get {
responder: WriteOnlyLogGetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<WriteOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum WriteOnlyLogRequest {
Get { responder: WriteOnlyLogGetResponder },
}
impl WriteOnlyLogRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get(self) -> Option<(WriteOnlyLogGetResponder)> {
if let WriteOnlyLogRequest::Get { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
WriteOnlyLogRequest::Get { .. } => "get",
}
}
}
#[derive(Debug, Clone)]
pub struct WriteOnlyLogControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for WriteOnlyLogControlHandle {
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 WriteOnlyLogControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct WriteOnlyLogGetResponder {
control_handle: std::mem::ManuallyDrop<WriteOnlyLogControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for WriteOnlyLogGetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for WriteOnlyLogGetResponder {
type ControlHandle = WriteOnlyLogControlHandle;
fn control_handle(&self) -> &WriteOnlyLogControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl WriteOnlyLogGetResponder {
pub fn send(self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
let _result = self.send_raw(log);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
let _result = self.send_raw(log);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<WriteOnlyLogGetResponse>(
(log,),
self.tx_id,
0x4579dac289d3007,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
impl fidl::encoding::ValueTypeMarker for ArgumentsCollectRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsCollectRequest {
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<ArgumentsCollectRequest, D> for &ArgumentsCollectRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsCollectRequest>(offset);
fidl::encoding::Encode::<ArgumentsCollectRequest, D>::encode(
(<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
&self.prefix,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
> fidl::encoding::Encode<ArgumentsCollectRequest, 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::<ArgumentsCollectRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsCollectRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { prefix: fidl::new_empty!(fidl::encoding::BoundedString<64>, 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<64>,
D,
&mut self.prefix,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArgumentsCollectResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsCollectResponse {
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<ArgumentsCollectResponse, D> for &ArgumentsCollectResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsCollectResponse>(offset);
fidl::encoding::Encode::<ArgumentsCollectResponse, D>::encode(
(
<fidl::encoding::Vector<fidl::encoding::BoundedString<193>, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.results),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Vector<fidl::encoding::BoundedString<193>, 255>,
D,
>,
> fidl::encoding::Encode<ArgumentsCollectResponse, 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::<ArgumentsCollectResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsCollectResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
results: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<193>, 255>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::BoundedString<193>, 255>,
D,
&mut self.results,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArgumentsGetBoolRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsGetBoolRequest {
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<ArgumentsGetBoolRequest, D> for &ArgumentsGetBoolRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsGetBoolRequest>(offset);
fidl::encoding::Encode::<ArgumentsGetBoolRequest, D>::encode(
(
<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.defaultval),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<ArgumentsGetBoolRequest, 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::<ArgumentsGetBoolRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsGetBoolRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
key: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
defaultval: fidl::new_empty!(bool, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<64>,
D,
&mut self.key,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(bool, D, &mut self.defaultval, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArgumentsGetBoolResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsGetBoolResponse {
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<ArgumentsGetBoolResponse, D> for &ArgumentsGetBoolResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsGetBoolResponse>(offset);
fidl::encoding::Encode::<ArgumentsGetBoolResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<ArgumentsGetBoolResponse, 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::<ArgumentsGetBoolResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsGetBoolResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArgumentsGetBoolsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsGetBoolsRequest {
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<ArgumentsGetBoolsRequest, D> for &ArgumentsGetBoolsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsGetBoolsRequest>(offset);
fidl::encoding::Encode::<ArgumentsGetBoolsRequest, D>::encode(
(
<fidl::encoding::Vector<BoolPair, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<BoolPair, 255>, D>,
> fidl::encoding::Encode<ArgumentsGetBoolsRequest, 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::<ArgumentsGetBoolsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsGetBoolsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { keys: fidl::new_empty!(fidl::encoding::Vector<BoolPair, 255>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<BoolPair, 255>, D, &mut self.keys, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArgumentsGetBoolsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsGetBoolsResponse {
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<ArgumentsGetBoolsResponse, D> for &ArgumentsGetBoolsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsGetBoolsResponse>(offset);
fidl::encoding::Encode::<ArgumentsGetBoolsResponse, D>::encode(
(<fidl::encoding::Vector<bool, 255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.values,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<bool, 255>, D>,
> fidl::encoding::Encode<ArgumentsGetBoolsResponse, 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::<ArgumentsGetBoolsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsGetBoolsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { values: fidl::new_empty!(fidl::encoding::Vector<bool, 255>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<bool, 255>, D, &mut self.values, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArgumentsGetStringRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsGetStringRequest {
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<ArgumentsGetStringRequest, D> for &ArgumentsGetStringRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsGetStringRequest>(offset);
fidl::encoding::Encode::<ArgumentsGetStringRequest, D>::encode(
(<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
> fidl::encoding::Encode<ArgumentsGetStringRequest, 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::<ArgumentsGetStringRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsGetStringRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { key: fidl::new_empty!(fidl::encoding::BoundedString<64>, 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<64>,
D,
&mut self.key,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArgumentsGetStringResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsGetStringResponse {
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<ArgumentsGetStringResponse, D> for &ArgumentsGetStringResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsGetStringResponse>(offset);
fidl::encoding::Encode::<ArgumentsGetStringResponse, D>::encode(
(
<fidl::encoding::Optional<fidl::encoding::BoundedString<128>> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<128>>, D>,
> fidl::encoding::Encode<ArgumentsGetStringResponse, 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::<ArgumentsGetStringResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsGetStringResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
value: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
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::Optional<fidl::encoding::BoundedString<128>>,
D,
&mut self.value,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArgumentsGetStringsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsGetStringsRequest {
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<ArgumentsGetStringsRequest, D> for &ArgumentsGetStringsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsGetStringsRequest>(offset);
fidl::encoding::Encode::<ArgumentsGetStringsRequest, D>::encode(
(
<fidl::encoding::Vector<fidl::encoding::BoundedString<64>, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Vector<fidl::encoding::BoundedString<64>, 255>,
D,
>,
> fidl::encoding::Encode<ArgumentsGetStringsRequest, 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::<ArgumentsGetStringsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsGetStringsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
keys: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<64>, 255>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::BoundedString<64>, 255>,
D,
&mut self.keys,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ArgumentsGetStringsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArgumentsGetStringsResponse {
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<ArgumentsGetStringsResponse, D> for &ArgumentsGetStringsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArgumentsGetStringsResponse>(offset);
fidl::encoding::Encode::<ArgumentsGetStringsResponse, D>::encode(
(<fidl::encoding::Vector<
fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
255,
> as fidl::encoding::ValueTypeMarker>::borrow(&self.values),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Vector<
fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
255,
>,
D,
>,
> fidl::encoding::Encode<ArgumentsGetStringsResponse, 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::<ArgumentsGetStringsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ArgumentsGetStringsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
values: fidl::new_empty!(
fidl::encoding::Vector<
fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
255,
>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Vector<
fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
255,
>,
D,
&mut self.values,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BoolPair {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BoolPair {
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<BoolPair, D> for &BoolPair {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BoolPair>(offset);
fidl::encoding::Encode::<BoolPair, D>::encode(
(
<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.defaultval),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<BoolPair, 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::<BoolPair>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BoolPair {
#[inline(always)]
fn new_empty() -> Self {
Self {
key: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
defaultval: fidl::new_empty!(bool, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<64>,
D,
&mut self.key,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(bool, D, &mut self.defaultval, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for BootfsFileVmo {
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 BootfsFileVmo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl fidl::encoding::Encode<BootfsFileVmo, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut BootfsFileVmo
{
#[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::<BootfsFileVmo>(offset);
fidl::encoding::Encode::<BootfsFileVmo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
<fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.contents),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<BootfsFileVmo, 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::<BootfsFileVmo>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for BootfsFileVmo {
#[inline(always)]
fn new_empty() -> Self {
Self {
offset: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
contents: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.offset,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.contents, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Extra {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Extra {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Extra, D> for &Extra {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Extra>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut Extra).write_unaligned((self as *const Extra).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<Extra, 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::<Extra>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Extra {
#[inline(always)]
fn new_empty() -> Self {
Self { n: 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) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FactoryItemsGetRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FactoryItemsGetRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<FactoryItemsGetRequest, D> for &FactoryItemsGetRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FactoryItemsGetRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut FactoryItemsGetRequest)
.write_unaligned((self as *const FactoryItemsGetRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<FactoryItemsGetRequest, 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::<FactoryItemsGetRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for FactoryItemsGetRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { extra: 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) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for FactoryItemsGetResponse {
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 FactoryItemsGetResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
FactoryItemsGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut FactoryItemsGetResponse
{
#[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::<FactoryItemsGetResponse>(offset);
fidl::encoding::Encode::<
FactoryItemsGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.payload
),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
FactoryItemsGetResponse,
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::<FactoryItemsGetResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for FactoryItemsGetResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
payload: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
length: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.length,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ItemsGet2Request {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ItemsGet2Request {
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<ItemsGet2Request, D>
for &ItemsGet2Request
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ItemsGet2Request>(offset);
fidl::encoding::Encode::<ItemsGet2Request, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
<fidl::encoding::Boxed<Extra> as fidl::encoding::ValueTypeMarker>::borrow(
&self.extra,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<fidl::encoding::Boxed<Extra>, D>,
> fidl::encoding::Encode<ItemsGet2Request, 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::<ItemsGet2Request>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ItemsGet2Request {
#[inline(always)]
fn new_empty() -> Self {
Self {
type_: fidl::new_empty!(u32, D),
extra: fidl::new_empty!(fidl::encoding::Boxed<Extra>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.type_, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Boxed<Extra>,
D,
&mut self.extra,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ItemsGetBootloaderFileRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ItemsGetBootloaderFileRequest {
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<ItemsGetBootloaderFileRequest, D>
for &ItemsGetBootloaderFileRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ItemsGetBootloaderFileRequest>(offset);
fidl::encoding::Encode::<ItemsGetBootloaderFileRequest, D>::encode(
(<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.filename,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
> fidl::encoding::Encode<ItemsGetBootloaderFileRequest, 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::<ItemsGetBootloaderFileRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ItemsGetBootloaderFileRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { filename: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.filename,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ItemsGetBootloaderFileResponse {
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 ItemsGetBootloaderFileResponse {
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<
ItemsGetBootloaderFileResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ItemsGetBootloaderFileResponse
{
#[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::<ItemsGetBootloaderFileResponse>(offset);
fidl::encoding::Encode::<
ItemsGetBootloaderFileResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.payload
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ItemsGetBootloaderFileResponse,
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::<ItemsGetBootloaderFileResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ItemsGetBootloaderFileResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
payload: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ItemsGetRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ItemsGetRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[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<ItemsGetRequest, D>
for &ItemsGetRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ItemsGetRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ItemsGetRequest)
.write_unaligned((self as *const ItemsGetRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<ItemsGetRequest, 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::<ItemsGetRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ItemsGetRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { type_: fidl::new_empty!(u32, D), extra: 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) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ItemsGetResponse {
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 ItemsGetResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<ItemsGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ItemsGetResponse
{
#[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::<ItemsGetResponse>(offset);
fidl::encoding::Encode::<ItemsGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.payload),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<ItemsGetResponse, 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::<ItemsGetResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ItemsGetResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
payload: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
length: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.payload,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.length,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ItemsGet2Response {
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 ItemsGet2Response {
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<ItemsGet2Response, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ItemsGet2Response
{
#[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::<ItemsGet2Response>(offset);
fidl::encoding::Encode::<ItemsGet2Response, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedVector<RetrievedItems> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.retrieved_items),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<RetrievedItems>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<ItemsGet2Response, 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::<ItemsGet2Response>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ItemsGet2Response
{
#[inline(always)]
fn new_empty() -> Self {
Self {
retrieved_items: fidl::new_empty!(
fidl::encoding::UnboundedVector<RetrievedItems>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<RetrievedItems>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.retrieved_items,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ReadOnlyLogGetResponse {
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 ReadOnlyLogGetResponse {
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<
ReadOnlyLogGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ReadOnlyLogGetResponse
{
#[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::<ReadOnlyLogGetResponse>(offset);
fidl::encoding::Encode::<
ReadOnlyLogGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::DebugLog,
{ fidl::ObjectType::DEBUGLOG.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.log
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::DebugLog,
{ fidl::ObjectType::DEBUGLOG.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ReadOnlyLogGetResponse,
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::<ReadOnlyLogGetResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ReadOnlyLogGetResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
log: fidl::new_empty!(fidl::encoding::HandleType<fidl::DebugLog, { fidl::ObjectType::DEBUGLOG.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::DebugLog, { fidl::ObjectType::DEBUGLOG.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.log, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for RetrievedItems {
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 RetrievedItems {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl
fidl::encoding::Encode<RetrievedItems, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut RetrievedItems
{
#[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::<RetrievedItems>(offset);
fidl::encoding::Encode::<RetrievedItems, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.payload),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.extra),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
> fidl::encoding::Encode<RetrievedItems, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RetrievedItems>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RetrievedItems
{
#[inline(always)]
fn new_empty() -> Self {
Self {
payload: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
length: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
extra: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.payload, decoder, offset + 0, _depth)?;
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.length,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.extra,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SvcStashProviderGetResponse {
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 SvcStashProviderGetResponse {
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<
SvcStashProviderGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut SvcStashProviderGetResponse
{
#[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::<SvcStashProviderGetResponse>(offset);
fidl::encoding::Encode::<SvcStashProviderGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.resource),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
SvcStashProviderGetResponse,
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::<SvcStashProviderGetResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SvcStashProviderGetResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
resource: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
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<SvcStashMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.resource,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SvcStashStoreRequest {
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 SvcStashStoreRequest {
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<SvcStashStoreRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut SvcStashStoreRequest
{
#[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::<SvcStashStoreRequest>(offset);
fidl::encoding::Encode::<
SvcStashStoreRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.svc_endpoint
),),
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<SvcStashStoreRequest, 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::<SvcStashStoreRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SvcStashStoreRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
svc_endpoint: 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.svc_endpoint,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for UserbootPostBootfsFilesRequest {
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 UserbootPostBootfsFilesRequest {
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<
UserbootPostBootfsFilesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut UserbootPostBootfsFilesRequest
{
#[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::<UserbootPostBootfsFilesRequest>(offset);
fidl::encoding::Encode::<UserbootPostBootfsFilesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Vector<BootfsFileVmo, 64> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.files),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Vector<BootfsFileVmo, 64>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
UserbootPostBootfsFilesRequest,
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::<UserbootPostBootfsFilesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for UserbootPostBootfsFilesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
files: fidl::new_empty!(fidl::encoding::Vector<BootfsFileVmo, 64>, 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<BootfsFileVmo, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.files, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for UserbootPostStashSvcRequest {
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 UserbootPostStashSvcRequest {
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<
UserbootPostStashSvcRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut UserbootPostStashSvcRequest
{
#[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::<UserbootPostStashSvcRequest>(offset);
fidl::encoding::Encode::<UserbootPostStashSvcRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stash_svc_endpoint),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
UserbootPostStashSvcRequest,
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::<UserbootPostStashSvcRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for UserbootPostStashSvcRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
stash_svc_endpoint: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
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<SvcStashMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.stash_svc_endpoint,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for WriteOnlyLogGetResponse {
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 WriteOnlyLogGetResponse {
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<
WriteOnlyLogGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut WriteOnlyLogGetResponse
{
#[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::<WriteOnlyLogGetResponse>(offset);
fidl::encoding::Encode::<
WriteOnlyLogGetResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::DebugLog,
{ fidl::ObjectType::DEBUGLOG.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.log
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::DebugLog,
{ fidl::ObjectType::DEBUGLOG.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
WriteOnlyLogGetResponse,
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::<WriteOnlyLogGetResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for WriteOnlyLogGetResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
log: fidl::new_empty!(fidl::encoding::HandleType<fidl::DebugLog, { fidl::ObjectType::DEBUGLOG.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::DebugLog, { fidl::ObjectType::DEBUGLOG.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.log, decoder, offset + 0, _depth)?;
Ok(())
}
}
}