#![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;
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct EnvVar {
pub key: String,
pub value: String,
}
impl fidl::Persistable for EnvVar {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct UtilDumpNamespaceResponse {
pub contents: String,
}
impl fidl::Persistable for UtilDumpNamespaceResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct UtilGetArgumentCountResponse {
pub count: u64,
}
impl fidl::Persistable for UtilGetArgumentCountResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct UtilGetArgumentsResponse {
pub args: Vec<String>,
}
impl fidl::Persistable for UtilGetArgumentsResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct UtilGetEnvironmentCountResponse {
pub count: u64,
}
impl fidl::Persistable for UtilGetEnvironmentCountResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct UtilGetEnvironmentResponse {
pub vars: Vec<EnvVar>,
}
impl fidl::Persistable for UtilGetEnvironmentResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct UtilGetLifecycleKoidResponse {
pub koid: u64,
}
impl fidl::Persistable for UtilGetLifecycleKoidResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct UtilReadFileRequest {
pub path: String,
}
impl fidl::Persistable for UtilReadFileRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct UtilReadFileResponse {
pub contents: String,
}
impl fidl::Persistable for UtilReadFileResponse {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct UtilMarker;
impl fidl::endpoints::ProtocolMarker for UtilMarker {
type Proxy = UtilProxy;
type RequestStream = UtilRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = UtilSynchronousProxy;
const DEBUG_NAME: &'static str = "test.processbuilder.Util";
}
impl fidl::endpoints::DiscoverableProtocolMarker for UtilMarker {}
pub trait UtilProxyInterface: Send + Sync {
type GetArgumentsResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>>
+ Send;
fn r#get_arguments(&self) -> Self::GetArgumentsResponseFut;
type GetArgumentCountResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
fn r#get_argument_count(&self) -> Self::GetArgumentCountResponseFut;
type GetEnvironmentResponseFut: std::future::Future<Output = Result<Vec<EnvVar>, fidl::Error>>
+ Send;
fn r#get_environment(&self) -> Self::GetEnvironmentResponseFut;
type GetEnvironmentCountResponseFut: std::future::Future<Output = Result<u64, fidl::Error>>
+ Send;
fn r#get_environment_count(&self) -> Self::GetEnvironmentCountResponseFut;
type DumpNamespaceResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
fn r#dump_namespace(&self) -> Self::DumpNamespaceResponseFut;
type ReadFileResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
fn r#read_file(&self, path: &str) -> Self::ReadFileResponseFut;
type GetLifecycleKoidResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
fn r#get_lifecycle_koid(&self) -> Self::GetLifecycleKoidResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct UtilSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for UtilSynchronousProxy {
type Proxy = UtilProxy;
type Protocol = UtilMarker;
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 UtilSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <UtilMarker 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<UtilEvent, fidl::Error> {
UtilEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_arguments(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<String>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, UtilGetArgumentsResponse>(
(),
0x50ff7f790c425519,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.args)
}
pub fn r#get_argument_count(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<u64, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, UtilGetArgumentCountResponse>(
(),
0x41ef27d234ed7098,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.count)
}
pub fn r#get_environment(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<EnvVar>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, UtilGetEnvironmentResponse>(
(),
0x451e633adf04ec23,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.vars)
}
pub fn r#get_environment_count(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<u64, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, UtilGetEnvironmentCountResponse>(
(),
0xe01fe768fb1be1a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.count)
}
pub fn r#dump_namespace(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<String, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, UtilDumpNamespaceResponse>(
(),
0x73826cecc1a7f3a4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.contents)
}
pub fn r#read_file(
&self,
mut path: &str,
___deadline: zx::MonotonicInstant,
) -> Result<String, fidl::Error> {
let _response = self.client.send_query::<UtilReadFileRequest, UtilReadFileResponse>(
(path,),
0x2ea8e2e4b427a391,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.contents)
}
pub fn r#get_lifecycle_koid(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<u64, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, UtilGetLifecycleKoidResponse>(
(),
0xdaecfc0fe4c8f60,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.koid)
}
}
#[derive(Debug, Clone)]
pub struct UtilProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for UtilProxy {
type Protocol = UtilMarker;
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 UtilProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <UtilMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> UtilEventStream {
UtilEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_arguments(
&self,
) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
UtilProxyInterface::r#get_arguments(self)
}
pub fn r#get_argument_count(
&self,
) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
UtilProxyInterface::r#get_argument_count(self)
}
pub fn r#get_environment(
&self,
) -> fidl::client::QueryResponseFut<Vec<EnvVar>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
UtilProxyInterface::r#get_environment(self)
}
pub fn r#get_environment_count(
&self,
) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
UtilProxyInterface::r#get_environment_count(self)
}
pub fn r#dump_namespace(
&self,
) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
UtilProxyInterface::r#dump_namespace(self)
}
pub fn r#read_file(
&self,
mut path: &str,
) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
UtilProxyInterface::r#read_file(self, path)
}
pub fn r#get_lifecycle_koid(
&self,
) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
UtilProxyInterface::r#get_lifecycle_koid(self)
}
}
impl UtilProxyInterface for UtilProxy {
type GetArgumentsResponseFut =
fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_arguments(&self) -> Self::GetArgumentsResponseFut {
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::<
UtilGetArgumentsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x50ff7f790c425519,
>(_buf?)?;
Ok(_response.args)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
(),
0x50ff7f790c425519,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetArgumentCountResponseFut =
fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_argument_count(&self) -> Self::GetArgumentCountResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u64, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
UtilGetArgumentCountResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x41ef27d234ed7098,
>(_buf?)?;
Ok(_response.count)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
(),
0x41ef27d234ed7098,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetEnvironmentResponseFut =
fidl::client::QueryResponseFut<Vec<EnvVar>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_environment(&self) -> Self::GetEnvironmentResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<EnvVar>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
UtilGetEnvironmentResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x451e633adf04ec23,
>(_buf?)?;
Ok(_response.vars)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<EnvVar>>(
(),
0x451e633adf04ec23,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetEnvironmentCountResponseFut =
fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_environment_count(&self) -> Self::GetEnvironmentCountResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u64, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
UtilGetEnvironmentCountResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xe01fe768fb1be1a,
>(_buf?)?;
Ok(_response.count)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
(),
0xe01fe768fb1be1a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DumpNamespaceResponseFut =
fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#dump_namespace(&self) -> Self::DumpNamespaceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<String, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
UtilDumpNamespaceResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x73826cecc1a7f3a4,
>(_buf?)?;
Ok(_response.contents)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, String>(
(),
0x73826cecc1a7f3a4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ReadFileResponseFut =
fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#read_file(&self, mut path: &str) -> Self::ReadFileResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<String, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
UtilReadFileResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2ea8e2e4b427a391,
>(_buf?)?;
Ok(_response.contents)
}
self.client.send_query_and_decode::<UtilReadFileRequest, String>(
(path,),
0x2ea8e2e4b427a391,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetLifecycleKoidResponseFut =
fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_lifecycle_koid(&self) -> Self::GetLifecycleKoidResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u64, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
UtilGetLifecycleKoidResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xdaecfc0fe4c8f60,
>(_buf?)?;
Ok(_response.koid)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
(),
0xdaecfc0fe4c8f60,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct UtilEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for UtilEventStream {}
impl futures::stream::FusedStream for UtilEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for UtilEventStream {
type Item = Result<UtilEvent, 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(UtilEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum UtilEvent {}
impl UtilEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<UtilEvent, 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: <UtilMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct UtilRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for UtilRequestStream {}
impl futures::stream::FusedStream for UtilRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for UtilRequestStream {
type Protocol = UtilMarker;
type ControlHandle = UtilControlHandle;
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 {
UtilControlHandle { 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 UtilRequestStream {
type Item = Result<UtilRequest, 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 UtilRequestStream 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 {
0x50ff7f790c425519 => {
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 = UtilControlHandle { inner: this.inner.clone() };
Ok(UtilRequest::GetArguments {
responder: UtilGetArgumentsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x41ef27d234ed7098 => {
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 = UtilControlHandle { inner: this.inner.clone() };
Ok(UtilRequest::GetArgumentCount {
responder: UtilGetArgumentCountResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x451e633adf04ec23 => {
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 = UtilControlHandle { inner: this.inner.clone() };
Ok(UtilRequest::GetEnvironment {
responder: UtilGetEnvironmentResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xe01fe768fb1be1a => {
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 = UtilControlHandle { inner: this.inner.clone() };
Ok(UtilRequest::GetEnvironmentCount {
responder: UtilGetEnvironmentCountResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x73826cecc1a7f3a4 => {
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 = UtilControlHandle { inner: this.inner.clone() };
Ok(UtilRequest::DumpNamespace {
responder: UtilDumpNamespaceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2ea8e2e4b427a391 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
UtilReadFileRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UtilReadFileRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = UtilControlHandle { inner: this.inner.clone() };
Ok(UtilRequest::ReadFile {
path: req.path,
responder: UtilReadFileResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xdaecfc0fe4c8f60 => {
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 = UtilControlHandle { inner: this.inner.clone() };
Ok(UtilRequest::GetLifecycleKoid {
responder: UtilGetLifecycleKoidResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <UtilMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum UtilRequest {
GetArguments { responder: UtilGetArgumentsResponder },
GetArgumentCount { responder: UtilGetArgumentCountResponder },
GetEnvironment { responder: UtilGetEnvironmentResponder },
GetEnvironmentCount { responder: UtilGetEnvironmentCountResponder },
DumpNamespace { responder: UtilDumpNamespaceResponder },
ReadFile { path: String, responder: UtilReadFileResponder },
GetLifecycleKoid { responder: UtilGetLifecycleKoidResponder },
}
impl UtilRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_arguments(self) -> Option<(UtilGetArgumentsResponder)> {
if let UtilRequest::GetArguments { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_argument_count(self) -> Option<(UtilGetArgumentCountResponder)> {
if let UtilRequest::GetArgumentCount { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_environment(self) -> Option<(UtilGetEnvironmentResponder)> {
if let UtilRequest::GetEnvironment { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_environment_count(self) -> Option<(UtilGetEnvironmentCountResponder)> {
if let UtilRequest::GetEnvironmentCount { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dump_namespace(self) -> Option<(UtilDumpNamespaceResponder)> {
if let UtilRequest::DumpNamespace { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_read_file(self) -> Option<(String, UtilReadFileResponder)> {
if let UtilRequest::ReadFile { path, responder } = self {
Some((path, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_lifecycle_koid(self) -> Option<(UtilGetLifecycleKoidResponder)> {
if let UtilRequest::GetLifecycleKoid { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
UtilRequest::GetArguments { .. } => "get_arguments",
UtilRequest::GetArgumentCount { .. } => "get_argument_count",
UtilRequest::GetEnvironment { .. } => "get_environment",
UtilRequest::GetEnvironmentCount { .. } => "get_environment_count",
UtilRequest::DumpNamespace { .. } => "dump_namespace",
UtilRequest::ReadFile { .. } => "read_file",
UtilRequest::GetLifecycleKoid { .. } => "get_lifecycle_koid",
}
}
}
#[derive(Debug, Clone)]
pub struct UtilControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for UtilControlHandle {
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 UtilControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct UtilGetArgumentsResponder {
control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for UtilGetArgumentsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for UtilGetArgumentsResponder {
type ControlHandle = UtilControlHandle;
fn control_handle(&self) -> &UtilControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl UtilGetArgumentsResponder {
pub fn send(self, mut args: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(args);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut args: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(args);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut args: &[String]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<UtilGetArgumentsResponse>(
(args,),
self.tx_id,
0x50ff7f790c425519,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct UtilGetArgumentCountResponder {
control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for UtilGetArgumentCountResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for UtilGetArgumentCountResponder {
type ControlHandle = UtilControlHandle;
fn control_handle(&self) -> &UtilControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl UtilGetArgumentCountResponder {
pub fn send(self, mut count: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(count);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut count: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(count);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut count: u64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<UtilGetArgumentCountResponse>(
(count,),
self.tx_id,
0x41ef27d234ed7098,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct UtilGetEnvironmentResponder {
control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for UtilGetEnvironmentResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for UtilGetEnvironmentResponder {
type ControlHandle = UtilControlHandle;
fn control_handle(&self) -> &UtilControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl UtilGetEnvironmentResponder {
pub fn send(self, mut vars: &[EnvVar]) -> Result<(), fidl::Error> {
let _result = self.send_raw(vars);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut vars: &[EnvVar]) -> Result<(), fidl::Error> {
let _result = self.send_raw(vars);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut vars: &[EnvVar]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<UtilGetEnvironmentResponse>(
(vars,),
self.tx_id,
0x451e633adf04ec23,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct UtilGetEnvironmentCountResponder {
control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for UtilGetEnvironmentCountResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for UtilGetEnvironmentCountResponder {
type ControlHandle = UtilControlHandle;
fn control_handle(&self) -> &UtilControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl UtilGetEnvironmentCountResponder {
pub fn send(self, mut count: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(count);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut count: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(count);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut count: u64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<UtilGetEnvironmentCountResponse>(
(count,),
self.tx_id,
0xe01fe768fb1be1a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct UtilDumpNamespaceResponder {
control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for UtilDumpNamespaceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for UtilDumpNamespaceResponder {
type ControlHandle = UtilControlHandle;
fn control_handle(&self) -> &UtilControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl UtilDumpNamespaceResponder {
pub fn send(self, mut contents: &str) -> Result<(), fidl::Error> {
let _result = self.send_raw(contents);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut contents: &str) -> Result<(), fidl::Error> {
let _result = self.send_raw(contents);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut contents: &str) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<UtilDumpNamespaceResponse>(
(contents,),
self.tx_id,
0x73826cecc1a7f3a4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct UtilReadFileResponder {
control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for UtilReadFileResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for UtilReadFileResponder {
type ControlHandle = UtilControlHandle;
fn control_handle(&self) -> &UtilControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl UtilReadFileResponder {
pub fn send(self, mut contents: &str) -> Result<(), fidl::Error> {
let _result = self.send_raw(contents);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut contents: &str) -> Result<(), fidl::Error> {
let _result = self.send_raw(contents);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut contents: &str) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<UtilReadFileResponse>(
(contents,),
self.tx_id,
0x2ea8e2e4b427a391,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct UtilGetLifecycleKoidResponder {
control_handle: std::mem::ManuallyDrop<UtilControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for UtilGetLifecycleKoidResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for UtilGetLifecycleKoidResponder {
type ControlHandle = UtilControlHandle;
fn control_handle(&self) -> &UtilControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl UtilGetLifecycleKoidResponder {
pub fn send(self, mut koid: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(koid);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut koid: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(koid);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut koid: u64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<UtilGetLifecycleKoidResponse>(
(koid,),
self.tx_id,
0xdaecfc0fe4c8f60,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
impl fidl::encoding::ValueTypeMarker for EnvVar {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for EnvVar {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EnvVar, D> for &EnvVar {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<EnvVar>(offset);
fidl::encoding::Encode::<EnvVar, D>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.value,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<EnvVar, 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::<EnvVar>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EnvVar {
#[inline(always)]
fn new_empty() -> Self {
Self {
key: fidl::new_empty!(fidl::encoding::UnboundedString, D),
value: fidl::new_empty!(fidl::encoding::UnboundedString, 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::UnboundedString,
D,
&mut self.key,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.value,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for UtilDumpNamespaceResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UtilDumpNamespaceResponse {
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<UtilDumpNamespaceResponse, D> for &UtilDumpNamespaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UtilDumpNamespaceResponse>(offset);
fidl::encoding::Encode::<UtilDumpNamespaceResponse, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.contents,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<UtilDumpNamespaceResponse, 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::<UtilDumpNamespaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for UtilDumpNamespaceResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { contents: fidl::new_empty!(fidl::encoding::UnboundedString, 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::UnboundedString,
D,
&mut self.contents,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for UtilGetArgumentCountResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UtilGetArgumentCountResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<UtilGetArgumentCountResponse, D> for &UtilGetArgumentCountResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UtilGetArgumentCountResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut UtilGetArgumentCountResponse)
.write_unaligned((self as *const UtilGetArgumentCountResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<UtilGetArgumentCountResponse, 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::<UtilGetArgumentCountResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for UtilGetArgumentCountResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { count: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for UtilGetArgumentsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UtilGetArgumentsResponse {
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<UtilGetArgumentsResponse, D> for &UtilGetArgumentsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UtilGetArgumentsResponse>(offset);
fidl::encoding::Encode::<UtilGetArgumentsResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.args),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
D,
>,
> fidl::encoding::Encode<UtilGetArgumentsResponse, 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::<UtilGetArgumentsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for UtilGetArgumentsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
args: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
D,
&mut self.args,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for UtilGetEnvironmentCountResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UtilGetEnvironmentCountResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<UtilGetEnvironmentCountResponse, D>
for &UtilGetEnvironmentCountResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UtilGetEnvironmentCountResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut UtilGetEnvironmentCountResponse)
.write_unaligned((self as *const UtilGetEnvironmentCountResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<UtilGetEnvironmentCountResponse, 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::<UtilGetEnvironmentCountResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for UtilGetEnvironmentCountResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { count: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for UtilGetEnvironmentResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UtilGetEnvironmentResponse {
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<UtilGetEnvironmentResponse, D> for &UtilGetEnvironmentResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UtilGetEnvironmentResponse>(offset);
fidl::encoding::Encode::<UtilGetEnvironmentResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<EnvVar> as fidl::encoding::ValueTypeMarker>::borrow(&self.vars),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<EnvVar>, D>,
> fidl::encoding::Encode<UtilGetEnvironmentResponse, 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::<UtilGetEnvironmentResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for UtilGetEnvironmentResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { vars: fidl::new_empty!(fidl::encoding::UnboundedVector<EnvVar>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<EnvVar>,
D,
&mut self.vars,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for UtilGetLifecycleKoidResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UtilGetLifecycleKoidResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<UtilGetLifecycleKoidResponse, D> for &UtilGetLifecycleKoidResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UtilGetLifecycleKoidResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut UtilGetLifecycleKoidResponse)
.write_unaligned((self as *const UtilGetLifecycleKoidResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<UtilGetLifecycleKoidResponse, 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::<UtilGetLifecycleKoidResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for UtilGetLifecycleKoidResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { koid: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for UtilReadFileRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UtilReadFileRequest {
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<UtilReadFileRequest, D>
for &UtilReadFileRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UtilReadFileRequest>(offset);
fidl::encoding::Encode::<UtilReadFileRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.path,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<UtilReadFileRequest, 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::<UtilReadFileRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UtilReadFileRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { path: fidl::new_empty!(fidl::encoding::UnboundedString, 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::UnboundedString,
D,
&mut self.path,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for UtilReadFileResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for UtilReadFileResponse {
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<UtilReadFileResponse, D>
for &UtilReadFileResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<UtilReadFileResponse>(offset);
fidl::encoding::Encode::<UtilReadFileResponse, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.contents,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<UtilReadFileResponse, 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::<UtilReadFileResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UtilReadFileResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { contents: fidl::new_empty!(fidl::encoding::UnboundedString, 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::UnboundedString,
D,
&mut self.contents,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
}