#![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_RESOLVE_NAME_SIZE: u32 = 2048;
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct HandleInfo {
pub handle: fidl::Handle,
pub id: u32,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for HandleInfo {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LaunchInfo {
pub executable: fidl::Vmo,
pub job: fidl::Job,
pub name: String,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LaunchInfo {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherAddArgsRequest {
pub args: Vec<Vec<u8>>,
}
impl fidl::Persistable for LauncherAddArgsRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherAddEnvironsRequest {
pub environ: Vec<Vec<u8>>,
}
impl fidl::Persistable for LauncherAddEnvironsRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherAddHandlesRequest {
pub handles: Vec<HandleInfo>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LauncherAddHandlesRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherAddNamesRequest {
pub names: Vec<NameInfo>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LauncherAddNamesRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherCreateWithoutStartingRequest {
pub info: LaunchInfo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherCreateWithoutStartingRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherCreateWithoutStartingResponse {
pub status: i32,
pub data: Option<Box<ProcessStartData>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherCreateWithoutStartingResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherLaunchRequest {
pub info: LaunchInfo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LauncherLaunchRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LauncherLaunchResponse {
pub status: i32,
pub process: Option<fidl::Process>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LauncherLaunchResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct LauncherSetOptionsRequest {
pub options: u32,
}
impl fidl::Persistable for LauncherSetOptionsRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct NameInfo {
pub path: String,
pub directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NameInfo {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ProcessStartData {
pub process: fidl::Process,
pub root_vmar: fidl::Vmar,
pub thread: fidl::Thread,
pub entry: u64,
pub stack: u64,
pub bootstrap: fidl::Channel,
pub vdso_base: u64,
pub base: u64,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ProcessStartData {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ResolverResolveRequest {
pub name: String,
}
impl fidl::Persistable for ResolverResolveRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ResolverResolveResponse {
pub status: i32,
pub executable: Option<fidl::Vmo>,
pub ldsvc: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ResolverResolveResponse {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LauncherMarker;
impl fidl::endpoints::ProtocolMarker for LauncherMarker {
type Proxy = LauncherProxy;
type RequestStream = LauncherRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LauncherSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.process.Launcher";
}
impl fidl::endpoints::DiscoverableProtocolMarker for LauncherMarker {}
pub trait LauncherProxyInterface: Send + Sync {
type LaunchResponseFut: std::future::Future<Output = Result<(i32, Option<fidl::Process>), fidl::Error>>
+ Send;
fn r#launch(&self, info: LaunchInfo) -> Self::LaunchResponseFut;
type CreateWithoutStartingResponseFut: std::future::Future<Output = Result<(i32, Option<Box<ProcessStartData>>), fidl::Error>>
+ Send;
fn r#create_without_starting(&self, info: LaunchInfo)
-> Self::CreateWithoutStartingResponseFut;
fn r#add_args(&self, args: &[Vec<u8>]) -> Result<(), fidl::Error>;
fn r#add_environs(&self, environ: &[Vec<u8>]) -> Result<(), fidl::Error>;
fn r#add_names(&self, names: Vec<NameInfo>) -> Result<(), fidl::Error>;
fn r#add_handles(&self, handles: Vec<HandleInfo>) -> Result<(), fidl::Error>;
fn r#set_options(&self, options: u32) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LauncherSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LauncherSynchronousProxy {
type Proxy = LauncherProxy;
type Protocol = LauncherMarker;
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 LauncherSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <LauncherMarker 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<LauncherEvent, fidl::Error> {
LauncherEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#launch(
&self,
mut info: LaunchInfo,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<fidl::Process>), fidl::Error> {
let _response = self.client.send_query::<LauncherLaunchRequest, LauncherLaunchResponse>(
(&mut info,),
0x11335a9928afbfa4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.process))
}
pub fn r#create_without_starting(
&self,
mut info: LaunchInfo,
___deadline: zx::MonotonicInstant,
) -> Result<(i32, Option<Box<ProcessStartData>>), fidl::Error> {
let _response = self.client.send_query::<
LauncherCreateWithoutStartingRequest,
LauncherCreateWithoutStartingResponse,
>(
(&mut info,),
0x755f8263fe51cb61,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.data))
}
pub fn r#add_args(&self, mut args: &[Vec<u8>]) -> Result<(), fidl::Error> {
self.client.send::<LauncherAddArgsRequest>(
(args,),
0x3be445d3e4fd6512,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#add_environs(&self, mut environ: &[Vec<u8>]) -> Result<(), fidl::Error> {
self.client.send::<LauncherAddEnvironsRequest>(
(environ,),
0x73a3c97fa7fe1779,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#add_names(&self, mut names: Vec<NameInfo>) -> Result<(), fidl::Error> {
self.client.send::<LauncherAddNamesRequest>(
(names.as_mut(),),
0x2579ee2c7be28662,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#add_handles(&self, mut handles: Vec<HandleInfo>) -> Result<(), fidl::Error> {
self.client.send::<LauncherAddHandlesRequest>(
(handles.as_mut(),),
0x51025267a537a615,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_options(&self, mut options: u32) -> Result<(), fidl::Error> {
self.client.send::<LauncherSetOptionsRequest>(
(options,),
0x5b92576147ebfd87,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct LauncherProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LauncherProxy {
type Protocol = LauncherMarker;
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 LauncherProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LauncherEventStream {
LauncherEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#launch(
&self,
mut info: LaunchInfo,
) -> fidl::client::QueryResponseFut<
(i32, Option<fidl::Process>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LauncherProxyInterface::r#launch(self, info)
}
pub fn r#create_without_starting(
&self,
mut info: LaunchInfo,
) -> fidl::client::QueryResponseFut<
(i32, Option<Box<ProcessStartData>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LauncherProxyInterface::r#create_without_starting(self, info)
}
pub fn r#add_args(&self, mut args: &[Vec<u8>]) -> Result<(), fidl::Error> {
LauncherProxyInterface::r#add_args(self, args)
}
pub fn r#add_environs(&self, mut environ: &[Vec<u8>]) -> Result<(), fidl::Error> {
LauncherProxyInterface::r#add_environs(self, environ)
}
pub fn r#add_names(&self, mut names: Vec<NameInfo>) -> Result<(), fidl::Error> {
LauncherProxyInterface::r#add_names(self, names)
}
pub fn r#add_handles(&self, mut handles: Vec<HandleInfo>) -> Result<(), fidl::Error> {
LauncherProxyInterface::r#add_handles(self, handles)
}
pub fn r#set_options(&self, mut options: u32) -> Result<(), fidl::Error> {
LauncherProxyInterface::r#set_options(self, options)
}
}
impl LauncherProxyInterface for LauncherProxy {
type LaunchResponseFut = fidl::client::QueryResponseFut<
(i32, Option<fidl::Process>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#launch(&self, mut info: LaunchInfo) -> Self::LaunchResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<fidl::Process>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
LauncherLaunchResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x11335a9928afbfa4,
>(_buf?)?;
Ok((_response.status, _response.process))
}
self.client.send_query_and_decode::<LauncherLaunchRequest, (i32, Option<fidl::Process>)>(
(&mut info,),
0x11335a9928afbfa4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CreateWithoutStartingResponseFut = fidl::client::QueryResponseFut<
(i32, Option<Box<ProcessStartData>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_without_starting(
&self,
mut info: LaunchInfo,
) -> Self::CreateWithoutStartingResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Option<Box<ProcessStartData>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
LauncherCreateWithoutStartingResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x755f8263fe51cb61,
>(_buf?)?;
Ok((_response.status, _response.data))
}
self.client.send_query_and_decode::<
LauncherCreateWithoutStartingRequest,
(i32, Option<Box<ProcessStartData>>),
>(
(&mut info,),
0x755f8263fe51cb61,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#add_args(&self, mut args: &[Vec<u8>]) -> Result<(), fidl::Error> {
self.client.send::<LauncherAddArgsRequest>(
(args,),
0x3be445d3e4fd6512,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#add_environs(&self, mut environ: &[Vec<u8>]) -> Result<(), fidl::Error> {
self.client.send::<LauncherAddEnvironsRequest>(
(environ,),
0x73a3c97fa7fe1779,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#add_names(&self, mut names: Vec<NameInfo>) -> Result<(), fidl::Error> {
self.client.send::<LauncherAddNamesRequest>(
(names.as_mut(),),
0x2579ee2c7be28662,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#add_handles(&self, mut handles: Vec<HandleInfo>) -> Result<(), fidl::Error> {
self.client.send::<LauncherAddHandlesRequest>(
(handles.as_mut(),),
0x51025267a537a615,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_options(&self, mut options: u32) -> Result<(), fidl::Error> {
self.client.send::<LauncherSetOptionsRequest>(
(options,),
0x5b92576147ebfd87,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct LauncherEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LauncherEventStream {}
impl futures::stream::FusedStream for LauncherEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LauncherEventStream {
type Item = Result<LauncherEvent, 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(LauncherEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LauncherEvent {}
impl LauncherEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LauncherEvent, 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: <LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LauncherRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LauncherRequestStream {}
impl futures::stream::FusedStream for LauncherRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LauncherRequestStream {
type Protocol = LauncherMarker;
type ControlHandle = LauncherControlHandle;
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 {
LauncherControlHandle { 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 LauncherRequestStream {
type Item = Result<LauncherRequest, 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 LauncherRequestStream 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 {
0x11335a9928afbfa4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LauncherLaunchRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherLaunchRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::Launch {
info: req.info,
responder: LauncherLaunchResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x755f8263fe51cb61 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LauncherCreateWithoutStartingRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherCreateWithoutStartingRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::CreateWithoutStarting {
info: req.info,
responder: LauncherCreateWithoutStartingResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3be445d3e4fd6512 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LauncherAddArgsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherAddArgsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::AddArgs { args: req.args, control_handle })
}
0x73a3c97fa7fe1779 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LauncherAddEnvironsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherAddEnvironsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::AddEnvirons { environ: req.environ, control_handle })
}
0x2579ee2c7be28662 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LauncherAddNamesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherAddNamesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::AddNames { names: req.names, control_handle })
}
0x51025267a537a615 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LauncherAddHandlesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherAddHandlesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::AddHandles { handles: req.handles, control_handle })
}
0x5b92576147ebfd87 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LauncherSetOptionsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LauncherSetOptionsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LauncherControlHandle { inner: this.inner.clone() };
Ok(LauncherRequest::SetOptions { options: req.options, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LauncherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LauncherRequest {
Launch { info: LaunchInfo, responder: LauncherLaunchResponder },
CreateWithoutStarting { info: LaunchInfo, responder: LauncherCreateWithoutStartingResponder },
AddArgs { args: Vec<Vec<u8>>, control_handle: LauncherControlHandle },
AddEnvirons { environ: Vec<Vec<u8>>, control_handle: LauncherControlHandle },
AddNames { names: Vec<NameInfo>, control_handle: LauncherControlHandle },
AddHandles { handles: Vec<HandleInfo>, control_handle: LauncherControlHandle },
SetOptions { options: u32, control_handle: LauncherControlHandle },
}
impl LauncherRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_launch(self) -> Option<(LaunchInfo, LauncherLaunchResponder)> {
if let LauncherRequest::Launch { info, responder } = self {
Some((info, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_without_starting(
self,
) -> Option<(LaunchInfo, LauncherCreateWithoutStartingResponder)> {
if let LauncherRequest::CreateWithoutStarting { info, responder } = self {
Some((info, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_add_args(self) -> Option<(Vec<Vec<u8>>, LauncherControlHandle)> {
if let LauncherRequest::AddArgs { args, control_handle } = self {
Some((args, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_add_environs(self) -> Option<(Vec<Vec<u8>>, LauncherControlHandle)> {
if let LauncherRequest::AddEnvirons { environ, control_handle } = self {
Some((environ, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_add_names(self) -> Option<(Vec<NameInfo>, LauncherControlHandle)> {
if let LauncherRequest::AddNames { names, control_handle } = self {
Some((names, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_add_handles(self) -> Option<(Vec<HandleInfo>, LauncherControlHandle)> {
if let LauncherRequest::AddHandles { handles, control_handle } = self {
Some((handles, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_options(self) -> Option<(u32, LauncherControlHandle)> {
if let LauncherRequest::SetOptions { options, control_handle } = self {
Some((options, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LauncherRequest::Launch { .. } => "launch",
LauncherRequest::CreateWithoutStarting { .. } => "create_without_starting",
LauncherRequest::AddArgs { .. } => "add_args",
LauncherRequest::AddEnvirons { .. } => "add_environs",
LauncherRequest::AddNames { .. } => "add_names",
LauncherRequest::AddHandles { .. } => "add_handles",
LauncherRequest::SetOptions { .. } => "set_options",
}
}
}
#[derive(Debug, Clone)]
pub struct LauncherControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LauncherControlHandle {
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 LauncherControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LauncherLaunchResponder {
control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LauncherLaunchResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LauncherLaunchResponder {
type ControlHandle = LauncherControlHandle;
fn control_handle(&self) -> &LauncherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LauncherLaunchResponder {
pub fn send(
self,
mut status: i32,
mut process: Option<fidl::Process>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, process);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut process: Option<fidl::Process>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, process);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut process: Option<fidl::Process>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<LauncherLaunchResponse>(
(status, process),
self.tx_id,
0x11335a9928afbfa4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LauncherCreateWithoutStartingResponder {
control_handle: std::mem::ManuallyDrop<LauncherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LauncherCreateWithoutStartingResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LauncherCreateWithoutStartingResponder {
type ControlHandle = LauncherControlHandle;
fn control_handle(&self) -> &LauncherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LauncherCreateWithoutStartingResponder {
pub fn send(
self,
mut status: i32,
mut data: Option<ProcessStartData>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, data);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut data: Option<ProcessStartData>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, data);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut data: Option<ProcessStartData>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<LauncherCreateWithoutStartingResponse>(
(status, data.as_mut()),
self.tx_id,
0x755f8263fe51cb61,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ResolverMarker;
impl fidl::endpoints::ProtocolMarker for ResolverMarker {
type Proxy = ResolverProxy;
type RequestStream = ResolverRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ResolverSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.process.Resolver";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ResolverMarker {}
pub trait ResolverProxyInterface: Send + Sync {
type ResolveResponseFut: std::future::Future<
Output = Result<
(
i32,
Option<fidl::Vmo>,
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
),
fidl::Error,
>,
> + Send;
fn r#resolve(&self, name: &str) -> Self::ResolveResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ResolverSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ResolverSynchronousProxy {
type Proxy = ResolverProxy;
type Protocol = ResolverMarker;
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 ResolverSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ResolverMarker 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<ResolverEvent, fidl::Error> {
ResolverEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#resolve(
&self,
mut name: &str,
___deadline: zx::MonotonicInstant,
) -> Result<
(
i32,
Option<fidl::Vmo>,
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
),
fidl::Error,
> {
let _response = self.client.send_query::<ResolverResolveRequest, ResolverResolveResponse>(
(name,),
0x3c15951efde89c90,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.executable, _response.ldsvc))
}
}
#[derive(Debug, Clone)]
pub struct ResolverProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ResolverProxy {
type Protocol = ResolverMarker;
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 ResolverProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ResolverEventStream {
ResolverEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#resolve(
&self,
mut name: &str,
) -> fidl::client::QueryResponseFut<
(
i32,
Option<fidl::Vmo>,
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ResolverProxyInterface::r#resolve(self, name)
}
}
impl ResolverProxyInterface for ResolverProxy {
type ResolveResponseFut = fidl::client::QueryResponseFut<
(
i32,
Option<fidl::Vmo>,
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#resolve(&self, mut name: &str) -> Self::ResolveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<
(
i32,
Option<fidl::Vmo>,
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
),
fidl::Error,
> {
let _response = fidl::client::decode_transaction_body::<
ResolverResolveResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3c15951efde89c90,
>(_buf?)?;
Ok((_response.status, _response.executable, _response.ldsvc))
}
self.client.send_query_and_decode::<ResolverResolveRequest, (
i32,
Option<fidl::Vmo>,
Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
)>(
(name,), 0x3c15951efde89c90, fidl::encoding::DynamicFlags::empty(), _decode
)
}
}
pub struct ResolverEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ResolverEventStream {}
impl futures::stream::FusedStream for ResolverEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ResolverEventStream {
type Item = Result<ResolverEvent, 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(ResolverEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ResolverEvent {}
impl ResolverEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ResolverEvent, 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: <ResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ResolverRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ResolverRequestStream {}
impl futures::stream::FusedStream for ResolverRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ResolverRequestStream {
type Protocol = ResolverMarker;
type ControlHandle = ResolverControlHandle;
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 {
ResolverControlHandle { 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 ResolverRequestStream {
type Item = Result<ResolverRequest, 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 ResolverRequestStream 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 {
0x3c15951efde89c90 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ResolverResolveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ResolverResolveRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ResolverControlHandle { inner: this.inner.clone() };
Ok(ResolverRequest::Resolve {
name: req.name,
responder: ResolverResolveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ResolverRequest {
Resolve { name: String, responder: ResolverResolveResponder },
}
impl ResolverRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_resolve(self) -> Option<(String, ResolverResolveResponder)> {
if let ResolverRequest::Resolve { name, responder } = self {
Some((name, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ResolverRequest::Resolve { .. } => "resolve",
}
}
}
#[derive(Debug, Clone)]
pub struct ResolverControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ResolverControlHandle {
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 ResolverControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ResolverResolveResponder {
control_handle: std::mem::ManuallyDrop<ResolverControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ResolverResolveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ResolverResolveResponder {
type ControlHandle = ResolverControlHandle;
fn control_handle(&self) -> &ResolverControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ResolverResolveResponder {
pub fn send(
self,
mut status: i32,
mut executable: Option<fidl::Vmo>,
mut ldsvc: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, executable, ldsvc);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut executable: Option<fidl::Vmo>,
mut ldsvc: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, executable, ldsvc);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut status: i32,
mut executable: Option<fidl::Vmo>,
mut ldsvc: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ResolverResolveResponse>(
(status, executable, ldsvc),
self.tx_id,
0x3c15951efde89c90,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
impl fidl::encoding::ResourceTypeMarker for HandleInfo {
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 HandleInfo {
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<HandleInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut HandleInfo
{
#[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::<HandleInfo>(offset);
fidl::encoding::Encode::<HandleInfo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.handle),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
> fidl::encoding::Encode<HandleInfo, 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::<HandleInfo>(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 HandleInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
handle: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
id: 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::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.handle, decoder, offset + 0, _depth)?;
fidl::decode!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.id,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LaunchInfo {
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 LaunchInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl fidl::encoding::Encode<LaunchInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut LaunchInfo
{
#[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::<LaunchInfo>(offset);
fidl::encoding::Encode::<LaunchInfo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.executable),
<fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.job),
<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
),
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<
fidl::encoding::HandleType<
fidl::Job,
{ fidl::ObjectType::JOB.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::BoundedString<32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<LaunchInfo, 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::<LaunchInfo>(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 LaunchInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
executable: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
job: fidl::new_empty!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
name: fidl::new_empty!(
fidl::encoding::BoundedString<32>,
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.executable, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Job, { fidl::ObjectType::JOB.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.job, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::BoundedString<32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LauncherAddArgsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LauncherAddArgsRequest {
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<LauncherAddArgsRequest, D> for &LauncherAddArgsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LauncherAddArgsRequest>(offset);
fidl::encoding::Encode::<LauncherAddArgsRequest, D>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>> 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::UnboundedVector<u8>>,
D,
>,
> fidl::encoding::Encode<LauncherAddArgsRequest, 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::<LauncherAddArgsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LauncherAddArgsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
args: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>,
D,
&mut self.args,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LauncherAddEnvironsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LauncherAddEnvironsRequest {
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<LauncherAddEnvironsRequest, D> for &LauncherAddEnvironsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LauncherAddEnvironsRequest>(offset);
fidl::encoding::Encode::<LauncherAddEnvironsRequest, D>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>> as fidl::encoding::ValueTypeMarker>::borrow(&self.environ),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>,
D,
>,
> fidl::encoding::Encode<LauncherAddEnvironsRequest, 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::<LauncherAddEnvironsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LauncherAddEnvironsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
environ: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedVector<u8>>,
D,
&mut self.environ,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherAddHandlesRequest {
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 LauncherAddHandlesRequest {
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<
LauncherAddHandlesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherAddHandlesRequest
{
#[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::<LauncherAddHandlesRequest>(offset);
fidl::encoding::Encode::<LauncherAddHandlesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedVector<HandleInfo> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.handles),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<HandleInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LauncherAddHandlesRequest,
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::<LauncherAddHandlesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherAddHandlesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
handles: fidl::new_empty!(
fidl::encoding::UnboundedVector<HandleInfo>,
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<HandleInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.handles,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherAddNamesRequest {
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 LauncherAddNamesRequest {
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<
LauncherAddNamesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherAddNamesRequest
{
#[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::<LauncherAddNamesRequest>(offset);
fidl::encoding::Encode::<LauncherAddNamesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedVector<NameInfo> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.names),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<NameInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LauncherAddNamesRequest,
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::<LauncherAddNamesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherAddNamesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
names: fidl::new_empty!(
fidl::encoding::UnboundedVector<NameInfo>,
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<NameInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.names,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherCreateWithoutStartingRequest {
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 LauncherCreateWithoutStartingRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
LauncherCreateWithoutStartingRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherCreateWithoutStartingRequest
{
#[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::<LauncherCreateWithoutStartingRequest>(offset);
fidl::encoding::Encode::<
LauncherCreateWithoutStartingRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<LaunchInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.info,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<LaunchInfo, fidl::encoding::DefaultFuchsiaResourceDialect>>
fidl::encoding::Encode<
LauncherCreateWithoutStartingRequest,
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::<LauncherCreateWithoutStartingRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherCreateWithoutStartingRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
info: fidl::new_empty!(LaunchInfo, 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!(
LaunchInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherCreateWithoutStartingResponse {
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 LauncherCreateWithoutStartingResponse {
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<
LauncherCreateWithoutStartingResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherCreateWithoutStartingResponse
{
#[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::<LauncherCreateWithoutStartingResponse>(offset);
fidl::encoding::Encode::<LauncherCreateWithoutStartingResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Boxed<ProcessStartData> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Boxed<ProcessStartData>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LauncherCreateWithoutStartingResponse,
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::<LauncherCreateWithoutStartingResponse>(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 fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherCreateWithoutStartingResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
data: fidl::new_empty!(
fidl::encoding::Boxed<ProcessStartData>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(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!(
i32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.status,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<ProcessStartData>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.data,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherLaunchRequest {
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 LauncherLaunchRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<LauncherLaunchRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut LauncherLaunchRequest
{
#[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::<LauncherLaunchRequest>(offset);
fidl::encoding::Encode::<
LauncherLaunchRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<LaunchInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.info,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<LaunchInfo, fidl::encoding::DefaultFuchsiaResourceDialect>>
fidl::encoding::Encode<LauncherLaunchRequest, 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::<LauncherLaunchRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LauncherLaunchRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
info: fidl::new_empty!(LaunchInfo, 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!(
LaunchInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.info,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LauncherLaunchResponse {
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 LauncherLaunchResponse {
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<
LauncherLaunchResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LauncherLaunchResponse
{
#[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::<LauncherLaunchResponse>(offset);
fidl::encoding::Encode::<
LauncherLaunchResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Process,
{ fidl::ObjectType::PROCESS.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.process
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Process,
{ fidl::ObjectType::PROCESS.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LauncherLaunchResponse,
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::<LauncherLaunchResponse>(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 LauncherLaunchResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
process: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Process,
{ fidl::ObjectType::PROCESS.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!(
i32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.status,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Process,
{ fidl::ObjectType::PROCESS.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.process,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LauncherSetOptionsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LauncherSetOptionsRequest {
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<LauncherSetOptionsRequest, D> for &LauncherSetOptionsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LauncherSetOptionsRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut LauncherSetOptionsRequest)
.write_unaligned((self as *const LauncherSetOptionsRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<LauncherSetOptionsRequest, 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::<LauncherSetOptionsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LauncherSetOptionsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { options: 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 NameInfo {
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 NameInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl fidl::encoding::Encode<NameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut NameInfo
{
#[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::<NameInfo>(offset);
fidl::encoding::Encode::<NameInfo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.directory),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
> fidl::encoding::Encode<NameInfo, 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::<NameInfo>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for NameInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
path: fidl::new_empty!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
directory: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<4095>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.path,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.directory,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ProcessStartData {
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 ProcessStartData {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl
fidl::encoding::Encode<ProcessStartData, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut ProcessStartData
{
#[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::<ProcessStartData>(offset);
fidl::encoding::Encode::<ProcessStartData, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.process),
<fidl::encoding::HandleType<fidl::Vmar, { fidl::ObjectType::VMAR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.root_vmar),
<fidl::encoding::HandleType<fidl::Thread, { fidl::ObjectType::THREAD.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.thread),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.entry),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.stack),
<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.bootstrap),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.vdso_base),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.base),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Process,
{ fidl::ObjectType::PROCESS.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmar,
{ fidl::ObjectType::VMAR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Thread,
{ fidl::ObjectType::THREAD.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T3: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T4: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T5: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Channel,
{ fidl::ObjectType::CHANNEL.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T6: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T7: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<ProcessStartData, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1, T2, T3, T4, T5, T6, T7)
{
#[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::<ProcessStartData>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 16, depth)?;
self.4.encode(encoder, offset + 24, depth)?;
self.5.encode(encoder, offset + 32, depth)?;
self.6.encode(encoder, offset + 40, depth)?;
self.7.encode(encoder, offset + 48, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ProcessStartData
{
#[inline(always)]
fn new_empty() -> Self {
Self {
process: fidl::new_empty!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
root_vmar: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmar, { fidl::ObjectType::VMAR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
thread: fidl::new_empty!(fidl::encoding::HandleType<fidl::Thread, { fidl::ObjectType::THREAD.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
entry: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
stack: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
bootstrap: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
vdso_base: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
base: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(fidl::encoding::HandleType<fidl::Process, { fidl::ObjectType::PROCESS.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.process, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Vmar, { fidl::ObjectType::VMAR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.root_vmar, decoder, offset + 4, _depth)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Thread, { fidl::ObjectType::THREAD.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.thread, decoder, offset + 8, _depth)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.entry,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.stack,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.bootstrap, decoder, offset + 32, _depth)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.vdso_base,
decoder,
offset + 40,
_depth
)?;
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.base,
decoder,
offset + 48,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ResolverResolveRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ResolverResolveRequest {
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<ResolverResolveRequest, D> for &ResolverResolveRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ResolverResolveRequest>(offset);
fidl::encoding::Encode::<ResolverResolveRequest, D>::encode(
(<fidl::encoding::BoundedString<2048> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<2048>, D>,
> fidl::encoding::Encode<ResolverResolveRequest, 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::<ResolverResolveRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ResolverResolveRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { name: fidl::new_empty!(fidl::encoding::BoundedString<2048>, 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<2048>,
D,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ResolverResolveResponse {
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 ResolverResolveResponse {
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<
ResolverResolveResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ResolverResolveResponse
{
#[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::<ResolverResolveResponse>(offset);
fidl::encoding::Encode::<
ResolverResolveResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.executable
),
<fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.ldsvc
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ResolverResolveResponse,
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::<ResolverResolveResponse>(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 ResolverResolveResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32, fidl::encoding::DefaultFuchsiaResourceDialect),
executable: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
ldsvc: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
>,
>,
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!(
i32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.status,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.executable,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.ldsvc,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
}