#![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(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LibraryLoaderCacheBuilderCreateRequest {
pub lib_directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
pub cache: fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LibraryLoaderCacheBuilderCreateRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LibraryLoaderCacheServeRequest {
pub loader: fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LibraryLoaderCacheServeRequest
{
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LibraryLoaderCacheMarker;
impl fidl::endpoints::ProtocolMarker for LibraryLoaderCacheMarker {
type Proxy = LibraryLoaderCacheProxy;
type RequestStream = LibraryLoaderCacheRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LibraryLoaderCacheSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) LibraryLoaderCache";
}
pub trait LibraryLoaderCacheProxyInterface: Send + Sync {
fn r#serve(
&self,
loader: fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LibraryLoaderCacheSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LibraryLoaderCacheSynchronousProxy {
type Proxy = LibraryLoaderCacheProxy;
type Protocol = LibraryLoaderCacheMarker;
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 LibraryLoaderCacheSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<LibraryLoaderCacheMarker 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<LibraryLoaderCacheEvent, fidl::Error> {
LibraryLoaderCacheEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#serve(
&self,
mut loader: fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<LibraryLoaderCacheServeRequest>(
(loader,),
0x1940439126b02e8f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct LibraryLoaderCacheProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LibraryLoaderCacheProxy {
type Protocol = LibraryLoaderCacheMarker;
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 LibraryLoaderCacheProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<LibraryLoaderCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LibraryLoaderCacheEventStream {
LibraryLoaderCacheEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#serve(
&self,
mut loader: fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
) -> Result<(), fidl::Error> {
LibraryLoaderCacheProxyInterface::r#serve(self, loader)
}
}
impl LibraryLoaderCacheProxyInterface for LibraryLoaderCacheProxy {
fn r#serve(
&self,
mut loader: fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<LibraryLoaderCacheServeRequest>(
(loader,),
0x1940439126b02e8f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct LibraryLoaderCacheEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LibraryLoaderCacheEventStream {}
impl futures::stream::FusedStream for LibraryLoaderCacheEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LibraryLoaderCacheEventStream {
type Item = Result<LibraryLoaderCacheEvent, 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(LibraryLoaderCacheEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LibraryLoaderCacheEvent {}
impl LibraryLoaderCacheEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LibraryLoaderCacheEvent, 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:
<LibraryLoaderCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LibraryLoaderCacheRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LibraryLoaderCacheRequestStream {}
impl futures::stream::FusedStream for LibraryLoaderCacheRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LibraryLoaderCacheRequestStream {
type Protocol = LibraryLoaderCacheMarker;
type ControlHandle = LibraryLoaderCacheControlHandle;
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 {
LibraryLoaderCacheControlHandle { 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 LibraryLoaderCacheRequestStream {
type Item = Result<LibraryLoaderCacheRequest, 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 LibraryLoaderCacheRequestStream 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 {
0x1940439126b02e8f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(LibraryLoaderCacheServeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LibraryLoaderCacheServeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LibraryLoaderCacheControlHandle {
inner: this.inner.clone(),
};
Ok(LibraryLoaderCacheRequest::Serve {loader: req.loader,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <LibraryLoaderCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LibraryLoaderCacheRequest {
Serve {
loader: fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
control_handle: LibraryLoaderCacheControlHandle,
},
}
impl LibraryLoaderCacheRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_serve(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
LibraryLoaderCacheControlHandle,
)> {
if let LibraryLoaderCacheRequest::Serve { loader, control_handle } = self {
Some((loader, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LibraryLoaderCacheRequest::Serve { .. } => "serve",
}
}
}
#[derive(Debug, Clone)]
pub struct LibraryLoaderCacheControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LibraryLoaderCacheControlHandle {
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 LibraryLoaderCacheControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LibraryLoaderCacheBuilderMarker;
impl fidl::endpoints::ProtocolMarker for LibraryLoaderCacheBuilderMarker {
type Proxy = LibraryLoaderCacheBuilderProxy;
type RequestStream = LibraryLoaderCacheBuilderRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LibraryLoaderCacheBuilderSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.test.runner.LibraryLoaderCacheBuilder";
}
impl fidl::endpoints::DiscoverableProtocolMarker for LibraryLoaderCacheBuilderMarker {}
pub trait LibraryLoaderCacheBuilderProxyInterface: Send + Sync {
fn r#create(
&self,
lib_directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
cache: fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LibraryLoaderCacheBuilderSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LibraryLoaderCacheBuilderSynchronousProxy {
type Proxy = LibraryLoaderCacheBuilderProxy;
type Protocol = LibraryLoaderCacheBuilderMarker;
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 LibraryLoaderCacheBuilderSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<LibraryLoaderCacheBuilderMarker 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<LibraryLoaderCacheBuilderEvent, fidl::Error> {
LibraryLoaderCacheBuilderEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#create(
&self,
mut lib_directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
mut cache: fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<LibraryLoaderCacheBuilderCreateRequest>(
(lib_directory, cache),
0x5f1be6b603264b0c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct LibraryLoaderCacheBuilderProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LibraryLoaderCacheBuilderProxy {
type Protocol = LibraryLoaderCacheBuilderMarker;
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 LibraryLoaderCacheBuilderProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<LibraryLoaderCacheBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LibraryLoaderCacheBuilderEventStream {
LibraryLoaderCacheBuilderEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#create(
&self,
mut lib_directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
mut cache: fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>,
) -> Result<(), fidl::Error> {
LibraryLoaderCacheBuilderProxyInterface::r#create(self, lib_directory, cache)
}
}
impl LibraryLoaderCacheBuilderProxyInterface for LibraryLoaderCacheBuilderProxy {
fn r#create(
&self,
mut lib_directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
mut cache: fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<LibraryLoaderCacheBuilderCreateRequest>(
(lib_directory, cache),
0x5f1be6b603264b0c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct LibraryLoaderCacheBuilderEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LibraryLoaderCacheBuilderEventStream {}
impl futures::stream::FusedStream for LibraryLoaderCacheBuilderEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LibraryLoaderCacheBuilderEventStream {
type Item = Result<LibraryLoaderCacheBuilderEvent, 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(LibraryLoaderCacheBuilderEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LibraryLoaderCacheBuilderEvent {}
impl LibraryLoaderCacheBuilderEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LibraryLoaderCacheBuilderEvent, 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:
<LibraryLoaderCacheBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LibraryLoaderCacheBuilderRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LibraryLoaderCacheBuilderRequestStream {}
impl futures::stream::FusedStream for LibraryLoaderCacheBuilderRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LibraryLoaderCacheBuilderRequestStream {
type Protocol = LibraryLoaderCacheBuilderMarker;
type ControlHandle = LibraryLoaderCacheBuilderControlHandle;
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 {
LibraryLoaderCacheBuilderControlHandle { 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 LibraryLoaderCacheBuilderRequestStream {
type Item = Result<LibraryLoaderCacheBuilderRequest, 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 LibraryLoaderCacheBuilderRequestStream 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 {
0x5f1be6b603264b0c => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(LibraryLoaderCacheBuilderCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LibraryLoaderCacheBuilderCreateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LibraryLoaderCacheBuilderControlHandle {
inner: this.inner.clone(),
};
Ok(LibraryLoaderCacheBuilderRequest::Create {lib_directory: req.lib_directory,
cache: req.cache,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <LibraryLoaderCacheBuilderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LibraryLoaderCacheBuilderRequest {
Create {
lib_directory: fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
cache: fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>,
control_handle: LibraryLoaderCacheBuilderControlHandle,
},
}
impl LibraryLoaderCacheBuilderRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create(
self,
) -> Option<(
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>,
LibraryLoaderCacheBuilderControlHandle,
)> {
if let LibraryLoaderCacheBuilderRequest::Create { lib_directory, cache, control_handle } =
self
{
Some((lib_directory, cache, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LibraryLoaderCacheBuilderRequest::Create { .. } => "create",
}
}
}
#[derive(Debug, Clone)]
pub struct LibraryLoaderCacheBuilderControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LibraryLoaderCacheBuilderControlHandle {
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 LibraryLoaderCacheBuilderControlHandle {}
mod internal {
use super::*;
impl fidl::encoding::ResourceTypeMarker for LibraryLoaderCacheBuilderCreateRequest {
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 LibraryLoaderCacheBuilderCreateRequest {
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<
LibraryLoaderCacheBuilderCreateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LibraryLoaderCacheBuilderCreateRequest
{
#[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::<LibraryLoaderCacheBuilderCreateRequest>(offset);
fidl::encoding::Encode::<LibraryLoaderCacheBuilderCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.lib_directory),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.cache),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LibraryLoaderCacheBuilderCreateRequest,
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::<LibraryLoaderCacheBuilderCreateRequest>(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 LibraryLoaderCacheBuilderCreateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
lib_directory: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
cache: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.lib_directory,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<LibraryLoaderCacheMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.cache,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LibraryLoaderCacheServeRequest {
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 LibraryLoaderCacheServeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
LibraryLoaderCacheServeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LibraryLoaderCacheServeRequest
{
#[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::<LibraryLoaderCacheServeRequest>(offset);
fidl::encoding::Encode::<
LibraryLoaderCacheServeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.loader
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LibraryLoaderCacheServeRequest,
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::<LibraryLoaderCacheServeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LibraryLoaderCacheServeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
loader: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<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!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_ldsvc::LoaderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.loader,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
}