blob: 5d783b0fdc6bd1c77288720fd39af047b1703351 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
// fidl_experiment = output_index_json
#![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 _};
pub use fidl_test_bindingsdenylist__common::*;
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct AllowedMarker;
impl fidl::endpoints::ProtocolMarker for AllowedMarker {
type Proxy = AllowedProxy;
type RequestStream = AllowedRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = AllowedSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Allowed";
}
pub trait AllowedProxyInterface: Send + Sync {}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct AllowedSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for AllowedSynchronousProxy {
type Proxy = AllowedProxy;
type Protocol = AllowedMarker;
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 AllowedSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <AllowedMarker 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()
}
/// Waits until an event arrives and returns it. It is safe for other
/// threads to make concurrent requests while waiting for an event.
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<AllowedEvent, fidl::Error> {
AllowedEvent::decode(self.client.wait_for_event(deadline)?)
}
}
#[cfg(target_os = "fuchsia")]
impl From<AllowedSynchronousProxy> for zx::Handle {
fn from(value: AllowedSynchronousProxy) -> Self {
value.into_channel().into()
}
}
#[cfg(target_os = "fuchsia")]
impl From<fidl::Channel> for AllowedSynchronousProxy {
fn from(value: fidl::Channel) -> Self {
Self::new(value)
}
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::FromClient for AllowedSynchronousProxy {
type Protocol = AllowedMarker;
fn from_client(value: fidl::endpoints::ClientEnd<AllowedMarker>) -> Self {
Self::new(value.into_channel())
}
}
#[derive(Debug, Clone)]
pub struct AllowedProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for AllowedProxy {
type Protocol = AllowedMarker;
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 AllowedProxy {
/// Create a new Proxy for test.bindingsdenylist/Allowed.
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <AllowedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
/// Get a Stream of events from the remote end of the protocol.
///
/// # Panics
///
/// Panics if the event stream was already taken.
pub fn take_event_stream(&self) -> AllowedEventStream {
AllowedEventStream { event_receiver: self.client.take_event_receiver() }
}
}
impl AllowedProxyInterface for AllowedProxy {}
pub struct AllowedEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for AllowedEventStream {}
impl futures::stream::FusedStream for AllowedEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for AllowedEventStream {
type Item = Result<AllowedEvent, 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(AllowedEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum AllowedEvent {}
impl AllowedEvent {
/// Decodes a message buffer as a [`AllowedEvent`].
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<AllowedEvent, 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: <AllowedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
/// A Stream of incoming requests for test.bindingsdenylist/Allowed.
pub struct AllowedRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for AllowedRequestStream {}
impl futures::stream::FusedStream for AllowedRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for AllowedRequestStream {
type Protocol = AllowedMarker;
type ControlHandle = AllowedControlHandle;
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 {
AllowedControlHandle { 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 AllowedRequestStream {
type Item = Result<AllowedRequest, 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 AllowedRequestStream 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(),
))));
}
}
// A message has been received from the channel
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<AllowedMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum AllowedRequest {}
impl AllowedRequest {
/// Name of the method defined in FIDL
pub fn method_name(&self) -> &'static str {
match *self {}
}
}
#[derive(Debug, Clone)]
pub struct AllowedControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for AllowedControlHandle {
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 AllowedControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DenyEachBindingMarker;
impl fidl::endpoints::ProtocolMarker for DenyEachBindingMarker {
type Proxy = DenyEachBindingProxy;
type RequestStream = DenyEachBindingRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DenyEachBindingSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DenyEachBinding";
}
pub type DenyEachBindingOnlyDenyCppResult = Result<i32, u32>;
pub type DenyEachBindingOnlyDenyDartResult = Result<i32, u32>;
pub type DenyEachBindingOnlyDenyGoResult = Result<i32, u32>;
pub type DenyEachBindingOnlyDenyPythonResult = Result<i32, u32>;
pub type DenyEachBindingOnlyDenySyzkallerResult = Result<i32, u32>;
pub trait DenyEachBindingProxyInterface: Send + Sync {
type OnlyDenyCppResponseFut: std::future::Future<Output = Result<DenyEachBindingOnlyDenyCppResult, fidl::Error>>
+ Send;
fn r#only_deny_cpp(&self, a: bool) -> Self::OnlyDenyCppResponseFut;
type OnlyDenyDartResponseFut: std::future::Future<Output = Result<DenyEachBindingOnlyDenyDartResult, fidl::Error>>
+ Send;
fn r#only_deny_dart(&self, a: bool) -> Self::OnlyDenyDartResponseFut;
type OnlyDenyGoResponseFut: std::future::Future<Output = Result<DenyEachBindingOnlyDenyGoResult, fidl::Error>>
+ Send;
fn r#only_deny_go(&self, a: bool) -> Self::OnlyDenyGoResponseFut;
type OnlyDenyPythonResponseFut: std::future::Future<Output = Result<DenyEachBindingOnlyDenyPythonResult, fidl::Error>>
+ Send;
fn r#only_deny_python(&self, a: bool) -> Self::OnlyDenyPythonResponseFut;
type OnlyDenySyzkallerResponseFut: std::future::Future<Output = Result<DenyEachBindingOnlyDenySyzkallerResult, fidl::Error>>
+ Send;
fn r#only_deny_syzkaller(&self, a: bool) -> Self::OnlyDenySyzkallerResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DenyEachBindingSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DenyEachBindingSynchronousProxy {
type Proxy = DenyEachBindingProxy;
type Protocol = DenyEachBindingMarker;
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 DenyEachBindingSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DenyEachBindingMarker 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()
}
/// Waits until an event arrives and returns it. It is safe for other
/// threads to make concurrent requests while waiting for an event.
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<DenyEachBindingEvent, fidl::Error> {
DenyEachBindingEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#only_deny_cpp(
&self,
mut a: bool,
___deadline: zx::MonotonicInstant,
) -> Result<DenyEachBindingOnlyDenyCppResult, fidl::Error> {
let _response = self.client.send_query::<
DenyEachBindingOnlyDenyCppRequest,
fidl::encoding::ResultType<DenyEachBindingOnlyDenyCppResponse, u32>,
>(
(a,),
0x290bad96051b1b92,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.b))
}
pub fn r#only_deny_dart(
&self,
mut a: bool,
___deadline: zx::MonotonicInstant,
) -> Result<DenyEachBindingOnlyDenyDartResult, fidl::Error> {
let _response = self.client.send_query::<
DenyEachBindingOnlyDenyDartRequest,
fidl::encoding::ResultType<DenyEachBindingOnlyDenyDartResponse, u32>,
>(
(a,),
0x75384066a26d87d7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.b))
}
pub fn r#only_deny_go(
&self,
mut a: bool,
___deadline: zx::MonotonicInstant,
) -> Result<DenyEachBindingOnlyDenyGoResult, fidl::Error> {
let _response = self.client.send_query::<
DenyEachBindingOnlyDenyGoRequest,
fidl::encoding::ResultType<DenyEachBindingOnlyDenyGoResponse, u32>,
>(
(a,),
0x657655b981478d99,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.b))
}
pub fn r#only_deny_python(
&self,
mut a: bool,
___deadline: zx::MonotonicInstant,
) -> Result<DenyEachBindingOnlyDenyPythonResult, fidl::Error> {
let _response = self.client.send_query::<
DenyEachBindingOnlyDenyPythonRequest,
fidl::encoding::ResultType<DenyEachBindingOnlyDenyPythonResponse, u32>,
>(
(a,),
0x29c852a00c5a1982,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.b))
}
pub fn r#only_deny_syzkaller(
&self,
mut a: bool,
___deadline: zx::MonotonicInstant,
) -> Result<DenyEachBindingOnlyDenySyzkallerResult, fidl::Error> {
let _response = self.client.send_query::<
DenyEachBindingOnlyDenySyzkallerRequest,
fidl::encoding::ResultType<DenyEachBindingOnlyDenySyzkallerResponse, u32>,
>(
(a,),
0x202ee614a749e98a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.b))
}
}
#[cfg(target_os = "fuchsia")]
impl From<DenyEachBindingSynchronousProxy> for zx::Handle {
fn from(value: DenyEachBindingSynchronousProxy) -> Self {
value.into_channel().into()
}
}
#[cfg(target_os = "fuchsia")]
impl From<fidl::Channel> for DenyEachBindingSynchronousProxy {
fn from(value: fidl::Channel) -> Self {
Self::new(value)
}
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::FromClient for DenyEachBindingSynchronousProxy {
type Protocol = DenyEachBindingMarker;
fn from_client(value: fidl::endpoints::ClientEnd<DenyEachBindingMarker>) -> Self {
Self::new(value.into_channel())
}
}
#[derive(Debug, Clone)]
pub struct DenyEachBindingProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DenyEachBindingProxy {
type Protocol = DenyEachBindingMarker;
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 DenyEachBindingProxy {
/// Create a new Proxy for test.bindingsdenylist/DenyEachBinding.
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DenyEachBindingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
/// Get a Stream of events from the remote end of the protocol.
///
/// # Panics
///
/// Panics if the event stream was already taken.
pub fn take_event_stream(&self) -> DenyEachBindingEventStream {
DenyEachBindingEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#only_deny_cpp(
&self,
mut a: bool,
) -> fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenyCppResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DenyEachBindingProxyInterface::r#only_deny_cpp(self, a)
}
pub fn r#only_deny_dart(
&self,
mut a: bool,
) -> fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenyDartResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DenyEachBindingProxyInterface::r#only_deny_dart(self, a)
}
pub fn r#only_deny_go(
&self,
mut a: bool,
) -> fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenyGoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DenyEachBindingProxyInterface::r#only_deny_go(self, a)
}
pub fn r#only_deny_python(
&self,
mut a: bool,
) -> fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenyPythonResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DenyEachBindingProxyInterface::r#only_deny_python(self, a)
}
pub fn r#only_deny_syzkaller(
&self,
mut a: bool,
) -> fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenySyzkallerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DenyEachBindingProxyInterface::r#only_deny_syzkaller(self, a)
}
}
impl DenyEachBindingProxyInterface for DenyEachBindingProxy {
type OnlyDenyCppResponseFut = fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenyCppResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#only_deny_cpp(&self, mut a: bool) -> Self::OnlyDenyCppResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DenyEachBindingOnlyDenyCppResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DenyEachBindingOnlyDenyCppResponse, u32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x290bad96051b1b92,
>(_buf?)?;
Ok(_response.map(|x| x.b))
}
self.client.send_query_and_decode::<
DenyEachBindingOnlyDenyCppRequest,
DenyEachBindingOnlyDenyCppResult,
>(
(a,),
0x290bad96051b1b92,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type OnlyDenyDartResponseFut = fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenyDartResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#only_deny_dart(&self, mut a: bool) -> Self::OnlyDenyDartResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DenyEachBindingOnlyDenyDartResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DenyEachBindingOnlyDenyDartResponse, u32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x75384066a26d87d7,
>(_buf?)?;
Ok(_response.map(|x| x.b))
}
self.client.send_query_and_decode::<
DenyEachBindingOnlyDenyDartRequest,
DenyEachBindingOnlyDenyDartResult,
>(
(a,),
0x75384066a26d87d7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type OnlyDenyGoResponseFut = fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenyGoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#only_deny_go(&self, mut a: bool) -> Self::OnlyDenyGoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DenyEachBindingOnlyDenyGoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DenyEachBindingOnlyDenyGoResponse, u32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x657655b981478d99,
>(_buf?)?;
Ok(_response.map(|x| x.b))
}
self.client.send_query_and_decode::<
DenyEachBindingOnlyDenyGoRequest,
DenyEachBindingOnlyDenyGoResult,
>(
(a,),
0x657655b981478d99,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type OnlyDenyPythonResponseFut = fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenyPythonResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#only_deny_python(&self, mut a: bool) -> Self::OnlyDenyPythonResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DenyEachBindingOnlyDenyPythonResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DenyEachBindingOnlyDenyPythonResponse, u32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x29c852a00c5a1982,
>(_buf?)?;
Ok(_response.map(|x| x.b))
}
self.client.send_query_and_decode::<
DenyEachBindingOnlyDenyPythonRequest,
DenyEachBindingOnlyDenyPythonResult,
>(
(a,),
0x29c852a00c5a1982,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type OnlyDenySyzkallerResponseFut = fidl::client::QueryResponseFut<
DenyEachBindingOnlyDenySyzkallerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#only_deny_syzkaller(&self, mut a: bool) -> Self::OnlyDenySyzkallerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DenyEachBindingOnlyDenySyzkallerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DenyEachBindingOnlyDenySyzkallerResponse, u32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x202ee614a749e98a,
>(_buf?)?;
Ok(_response.map(|x| x.b))
}
self.client.send_query_and_decode::<
DenyEachBindingOnlyDenySyzkallerRequest,
DenyEachBindingOnlyDenySyzkallerResult,
>(
(a,),
0x202ee614a749e98a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DenyEachBindingEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DenyEachBindingEventStream {}
impl futures::stream::FusedStream for DenyEachBindingEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DenyEachBindingEventStream {
type Item = Result<DenyEachBindingEvent, 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(DenyEachBindingEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DenyEachBindingEvent {}
impl DenyEachBindingEvent {
/// Decodes a message buffer as a [`DenyEachBindingEvent`].
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DenyEachBindingEvent, 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:
<DenyEachBindingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
/// A Stream of incoming requests for test.bindingsdenylist/DenyEachBinding.
pub struct DenyEachBindingRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DenyEachBindingRequestStream {}
impl futures::stream::FusedStream for DenyEachBindingRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DenyEachBindingRequestStream {
type Protocol = DenyEachBindingMarker;
type ControlHandle = DenyEachBindingControlHandle;
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 {
DenyEachBindingControlHandle { 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 DenyEachBindingRequestStream {
type Item = Result<DenyEachBindingRequest, 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 DenyEachBindingRequestStream 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(),
))));
}
}
// A message has been received from the channel
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x290bad96051b1b92 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DenyEachBindingOnlyDenyCppRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DenyEachBindingOnlyDenyCppRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DenyEachBindingControlHandle { inner: this.inner.clone() };
Ok(DenyEachBindingRequest::OnlyDenyCpp {
a: req.a,
responder: DenyEachBindingOnlyDenyCppResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x75384066a26d87d7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DenyEachBindingOnlyDenyDartRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DenyEachBindingOnlyDenyDartRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DenyEachBindingControlHandle { inner: this.inner.clone() };
Ok(DenyEachBindingRequest::OnlyDenyDart {
a: req.a,
responder: DenyEachBindingOnlyDenyDartResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x657655b981478d99 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DenyEachBindingOnlyDenyGoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DenyEachBindingOnlyDenyGoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DenyEachBindingControlHandle { inner: this.inner.clone() };
Ok(DenyEachBindingRequest::OnlyDenyGo {
a: req.a,
responder: DenyEachBindingOnlyDenyGoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x29c852a00c5a1982 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DenyEachBindingOnlyDenyPythonRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DenyEachBindingOnlyDenyPythonRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DenyEachBindingControlHandle { inner: this.inner.clone() };
Ok(DenyEachBindingRequest::OnlyDenyPython {
a: req.a,
responder: DenyEachBindingOnlyDenyPythonResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x202ee614a749e98a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
DenyEachBindingOnlyDenySyzkallerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DenyEachBindingOnlyDenySyzkallerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DenyEachBindingControlHandle { inner: this.inner.clone() };
Ok(DenyEachBindingRequest::OnlyDenySyzkaller {
a: req.a,
responder: DenyEachBindingOnlyDenySyzkallerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DenyEachBindingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DenyEachBindingRequest {
OnlyDenyCpp { a: bool, responder: DenyEachBindingOnlyDenyCppResponder },
OnlyDenyDart { a: bool, responder: DenyEachBindingOnlyDenyDartResponder },
OnlyDenyGo { a: bool, responder: DenyEachBindingOnlyDenyGoResponder },
OnlyDenyPython { a: bool, responder: DenyEachBindingOnlyDenyPythonResponder },
OnlyDenySyzkaller { a: bool, responder: DenyEachBindingOnlyDenySyzkallerResponder },
}
impl DenyEachBindingRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_only_deny_cpp(self) -> Option<(bool, DenyEachBindingOnlyDenyCppResponder)> {
if let DenyEachBindingRequest::OnlyDenyCpp { a, responder } = self {
Some((a, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_only_deny_dart(self) -> Option<(bool, DenyEachBindingOnlyDenyDartResponder)> {
if let DenyEachBindingRequest::OnlyDenyDart { a, responder } = self {
Some((a, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_only_deny_go(self) -> Option<(bool, DenyEachBindingOnlyDenyGoResponder)> {
if let DenyEachBindingRequest::OnlyDenyGo { a, responder } = self {
Some((a, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_only_deny_python(self) -> Option<(bool, DenyEachBindingOnlyDenyPythonResponder)> {
if let DenyEachBindingRequest::OnlyDenyPython { a, responder } = self {
Some((a, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_only_deny_syzkaller(
self,
) -> Option<(bool, DenyEachBindingOnlyDenySyzkallerResponder)> {
if let DenyEachBindingRequest::OnlyDenySyzkaller { a, responder } = self {
Some((a, responder))
} else {
None
}
}
/// Name of the method defined in FIDL
pub fn method_name(&self) -> &'static str {
match *self {
DenyEachBindingRequest::OnlyDenyCpp { .. } => "only_deny_cpp",
DenyEachBindingRequest::OnlyDenyDart { .. } => "only_deny_dart",
DenyEachBindingRequest::OnlyDenyGo { .. } => "only_deny_go",
DenyEachBindingRequest::OnlyDenyPython { .. } => "only_deny_python",
DenyEachBindingRequest::OnlyDenySyzkaller { .. } => "only_deny_syzkaller",
}
}
}
#[derive(Debug, Clone)]
pub struct DenyEachBindingControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DenyEachBindingControlHandle {
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 DenyEachBindingControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DenyEachBindingOnlyDenyCppResponder {
control_handle: std::mem::ManuallyDrop<DenyEachBindingControlHandle>,
tx_id: u32,
}
/// Set the the channel to be shutdown (see [`DenyEachBindingControlHandle::shutdown`])
/// if the responder is dropped without sending a response, so that the client
/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
impl std::ops::Drop for DenyEachBindingOnlyDenyCppResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
// Safety: drops once, never accessed again
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DenyEachBindingOnlyDenyCppResponder {
type ControlHandle = DenyEachBindingControlHandle;
fn control_handle(&self) -> &DenyEachBindingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
// Safety: drops once, never accessed again due to mem::forget
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
// Prevent Drop from running (which would shut down the channel)
std::mem::forget(self);
}
}
impl DenyEachBindingOnlyDenyCppResponder {
/// Sends a response to the FIDL transaction.
///
/// Sets the channel to shutdown if an error occurs.
pub fn send(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
/// Similar to "send" but does not shutdown the channel if an error occurs.
pub fn send_no_shutdown_on_err(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DenyEachBindingOnlyDenyCppResponse, u32>>(
result.map(|b| (b,)),
self.tx_id,
0x290bad96051b1b92,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DenyEachBindingOnlyDenyDartResponder {
control_handle: std::mem::ManuallyDrop<DenyEachBindingControlHandle>,
tx_id: u32,
}
/// Set the the channel to be shutdown (see [`DenyEachBindingControlHandle::shutdown`])
/// if the responder is dropped without sending a response, so that the client
/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
impl std::ops::Drop for DenyEachBindingOnlyDenyDartResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
// Safety: drops once, never accessed again
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DenyEachBindingOnlyDenyDartResponder {
type ControlHandle = DenyEachBindingControlHandle;
fn control_handle(&self) -> &DenyEachBindingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
// Safety: drops once, never accessed again due to mem::forget
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
// Prevent Drop from running (which would shut down the channel)
std::mem::forget(self);
}
}
impl DenyEachBindingOnlyDenyDartResponder {
/// Sends a response to the FIDL transaction.
///
/// Sets the channel to shutdown if an error occurs.
pub fn send(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
/// Similar to "send" but does not shutdown the channel if an error occurs.
pub fn send_no_shutdown_on_err(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
DenyEachBindingOnlyDenyDartResponse,
u32,
>>(
result.map(|b| (b,)),
self.tx_id,
0x75384066a26d87d7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DenyEachBindingOnlyDenyGoResponder {
control_handle: std::mem::ManuallyDrop<DenyEachBindingControlHandle>,
tx_id: u32,
}
/// Set the the channel to be shutdown (see [`DenyEachBindingControlHandle::shutdown`])
/// if the responder is dropped without sending a response, so that the client
/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
impl std::ops::Drop for DenyEachBindingOnlyDenyGoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
// Safety: drops once, never accessed again
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DenyEachBindingOnlyDenyGoResponder {
type ControlHandle = DenyEachBindingControlHandle;
fn control_handle(&self) -> &DenyEachBindingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
// Safety: drops once, never accessed again due to mem::forget
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
// Prevent Drop from running (which would shut down the channel)
std::mem::forget(self);
}
}
impl DenyEachBindingOnlyDenyGoResponder {
/// Sends a response to the FIDL transaction.
///
/// Sets the channel to shutdown if an error occurs.
pub fn send(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
/// Similar to "send" but does not shutdown the channel if an error occurs.
pub fn send_no_shutdown_on_err(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DenyEachBindingOnlyDenyGoResponse, u32>>(
result.map(|b| (b,)),
self.tx_id,
0x657655b981478d99,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DenyEachBindingOnlyDenyPythonResponder {
control_handle: std::mem::ManuallyDrop<DenyEachBindingControlHandle>,
tx_id: u32,
}
/// Set the the channel to be shutdown (see [`DenyEachBindingControlHandle::shutdown`])
/// if the responder is dropped without sending a response, so that the client
/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
impl std::ops::Drop for DenyEachBindingOnlyDenyPythonResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
// Safety: drops once, never accessed again
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DenyEachBindingOnlyDenyPythonResponder {
type ControlHandle = DenyEachBindingControlHandle;
fn control_handle(&self) -> &DenyEachBindingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
// Safety: drops once, never accessed again due to mem::forget
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
// Prevent Drop from running (which would shut down the channel)
std::mem::forget(self);
}
}
impl DenyEachBindingOnlyDenyPythonResponder {
/// Sends a response to the FIDL transaction.
///
/// Sets the channel to shutdown if an error occurs.
pub fn send(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
/// Similar to "send" but does not shutdown the channel if an error occurs.
pub fn send_no_shutdown_on_err(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
DenyEachBindingOnlyDenyPythonResponse,
u32,
>>(
result.map(|b| (b,)),
self.tx_id,
0x29c852a00c5a1982,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DenyEachBindingOnlyDenySyzkallerResponder {
control_handle: std::mem::ManuallyDrop<DenyEachBindingControlHandle>,
tx_id: u32,
}
/// Set the the channel to be shutdown (see [`DenyEachBindingControlHandle::shutdown`])
/// if the responder is dropped without sending a response, so that the client
/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
impl std::ops::Drop for DenyEachBindingOnlyDenySyzkallerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
// Safety: drops once, never accessed again
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DenyEachBindingOnlyDenySyzkallerResponder {
type ControlHandle = DenyEachBindingControlHandle;
fn control_handle(&self) -> &DenyEachBindingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
// Safety: drops once, never accessed again due to mem::forget
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
// Prevent Drop from running (which would shut down the channel)
std::mem::forget(self);
}
}
impl DenyEachBindingOnlyDenySyzkallerResponder {
/// Sends a response to the FIDL transaction.
///
/// Sets the channel to shutdown if an error occurs.
pub fn send(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
/// Similar to "send" but does not shutdown the channel if an error occurs.
pub fn send_no_shutdown_on_err(self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<i32, u32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
DenyEachBindingOnlyDenySyzkallerResponse,
u32,
>>(
result.map(|b| (b,)),
self.tx_id,
0x202ee614a749e98a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ImportsSameNameContextMarker;
impl fidl::endpoints::ProtocolMarker for ImportsSameNameContextMarker {
type Proxy = ImportsSameNameContextProxy;
type RequestStream = ImportsSameNameContextRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ImportsSameNameContextSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) ImportsSameNameContext";
}
pub trait ImportsSameNameContextProxyInterface: Send + Sync {
fn r#unattributed(&self) -> Result<(), fidl::Error>;
fn r#always_appears_in_importing_library(&self) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ImportsSameNameContextSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ImportsSameNameContextSynchronousProxy {
type Proxy = ImportsSameNameContextProxy;
type Protocol = ImportsSameNameContextMarker;
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 ImportsSameNameContextSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<ImportsSameNameContextMarker 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()
}
/// Waits until an event arrives and returns it. It is safe for other
/// threads to make concurrent requests while waiting for an event.
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<ImportsSameNameContextEvent, fidl::Error> {
ImportsSameNameContextEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#unattributed(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x698380acfd29e8f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#always_appears_in_importing_library(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x2874096c521236f8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[cfg(target_os = "fuchsia")]
impl From<ImportsSameNameContextSynchronousProxy> for zx::Handle {
fn from(value: ImportsSameNameContextSynchronousProxy) -> Self {
value.into_channel().into()
}
}
#[cfg(target_os = "fuchsia")]
impl From<fidl::Channel> for ImportsSameNameContextSynchronousProxy {
fn from(value: fidl::Channel) -> Self {
Self::new(value)
}
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::FromClient for ImportsSameNameContextSynchronousProxy {
type Protocol = ImportsSameNameContextMarker;
fn from_client(value: fidl::endpoints::ClientEnd<ImportsSameNameContextMarker>) -> Self {
Self::new(value.into_channel())
}
}
#[derive(Debug, Clone)]
pub struct ImportsSameNameContextProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ImportsSameNameContextProxy {
type Protocol = ImportsSameNameContextMarker;
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 ImportsSameNameContextProxy {
/// Create a new Proxy for test.bindingsdenylist/ImportsSameNameContext.
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<ImportsSameNameContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
/// Get a Stream of events from the remote end of the protocol.
///
/// # Panics
///
/// Panics if the event stream was already taken.
pub fn take_event_stream(&self) -> ImportsSameNameContextEventStream {
ImportsSameNameContextEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#unattributed(&self) -> Result<(), fidl::Error> {
ImportsSameNameContextProxyInterface::r#unattributed(self)
}
pub fn r#always_appears_in_importing_library(&self) -> Result<(), fidl::Error> {
ImportsSameNameContextProxyInterface::r#always_appears_in_importing_library(self)
}
}
impl ImportsSameNameContextProxyInterface for ImportsSameNameContextProxy {
fn r#unattributed(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x698380acfd29e8f,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#always_appears_in_importing_library(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x2874096c521236f8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct ImportsSameNameContextEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ImportsSameNameContextEventStream {}
impl futures::stream::FusedStream for ImportsSameNameContextEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ImportsSameNameContextEventStream {
type Item = Result<ImportsSameNameContextEvent, 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(ImportsSameNameContextEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ImportsSameNameContextEvent {}
impl ImportsSameNameContextEvent {
/// Decodes a message buffer as a [`ImportsSameNameContextEvent`].
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ImportsSameNameContextEvent, 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:
<ImportsSameNameContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
/// A Stream of incoming requests for test.bindingsdenylist/ImportsSameNameContext.
pub struct ImportsSameNameContextRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ImportsSameNameContextRequestStream {}
impl futures::stream::FusedStream for ImportsSameNameContextRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ImportsSameNameContextRequestStream {
type Protocol = ImportsSameNameContextMarker;
type ControlHandle = ImportsSameNameContextControlHandle;
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 {
ImportsSameNameContextControlHandle { 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 ImportsSameNameContextRequestStream {
type Item = Result<ImportsSameNameContextRequest, 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 ImportsSameNameContextRequestStream 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(),
))));
}
}
// A message has been received from the channel
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x698380acfd29e8f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ImportsSameNameContextControlHandle {
inner: this.inner.clone(),
};
Ok(ImportsSameNameContextRequest::Unattributed {
control_handle,
})
}
0x2874096c521236f8 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ImportsSameNameContextControlHandle {
inner: this.inner.clone(),
};
Ok(ImportsSameNameContextRequest::AlwaysAppearsInImportingLibrary {
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <ImportsSameNameContextMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ImportsSameNameContextRequest {
Unattributed { control_handle: ImportsSameNameContextControlHandle },
AlwaysAppearsInImportingLibrary { control_handle: ImportsSameNameContextControlHandle },
}
impl ImportsSameNameContextRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_unattributed(self) -> Option<(ImportsSameNameContextControlHandle)> {
if let ImportsSameNameContextRequest::Unattributed { control_handle } = self {
Some((control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_always_appears_in_importing_library(
self,
) -> Option<(ImportsSameNameContextControlHandle)> {
if let ImportsSameNameContextRequest::AlwaysAppearsInImportingLibrary { control_handle } =
self
{
Some((control_handle))
} else {
None
}
}
/// Name of the method defined in FIDL
pub fn method_name(&self) -> &'static str {
match *self {
ImportsSameNameContextRequest::Unattributed { .. } => "unattributed",
ImportsSameNameContextRequest::AlwaysAppearsInImportingLibrary { .. } => {
"always_appears_in_importing_library"
}
}
}
}
#[derive(Debug, Clone)]
pub struct ImportsSameNameContextControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ImportsSameNameContextControlHandle {
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 ImportsSameNameContextControlHandle {}
mod internal {
use super::*;
}