#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
#[derive(Clone, Debug, PartialEq)]
pub struct BusEnsurePublishRequest {
pub data: Event,
}
impl fidl::Persistable for BusEnsurePublishRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BusGetClientsResponse {
pub clients: Vec<String>,
}
impl fidl::Persistable for BusGetClientsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct BusOnBusDataRequest {
pub data: Event,
}
impl fidl::Persistable for BusOnBusDataRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BusOnClientAttachedRequest {
pub client: String,
}
impl fidl::Persistable for BusOnClientAttachedRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BusOnClientDetachedRequest {
pub client: String,
}
impl fidl::Persistable for BusOnClientDetachedRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct BusPublishRequest {
pub data: Event,
}
impl fidl::Persistable for BusPublishRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BusWaitForClientsRequest {
pub clients: Vec<String>,
pub timeout: i64,
}
impl fidl::Persistable for BusWaitForClientsRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BusWaitForClientsResponse {
pub result: bool,
pub absent: Option<Vec<String>>,
}
impl fidl::Persistable for BusWaitForClientsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct BusWaitForEventRequest {
pub data: Event,
pub timeout: i64,
}
impl fidl::Persistable for BusWaitForEventRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BusWaitForEventResponse {
pub result: bool,
}
impl fidl::Persistable for BusWaitForEventResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SyncManagerBusSubscribeRequest {
pub bus_name: String,
pub client_name: String,
pub bus: fidl::endpoints::ServerEnd<BusMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for SyncManagerBusSubscribeRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SyncManagerWaitForBarrierThresholdRequest {
pub barrier_name: String,
pub threshold: u32,
pub timeout: i64,
}
impl fidl::Persistable for SyncManagerWaitForBarrierThresholdRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SyncManagerWaitForBarrierThresholdResponse {
pub result: bool,
}
impl fidl::Persistable for SyncManagerWaitForBarrierThresholdResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Event {
pub code: Option<i32>,
pub message: Option<String>,
pub arguments: Option<Vec<u8>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Event {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BusMarker;
impl fidl::endpoints::ProtocolMarker for BusMarker {
type Proxy = BusProxy;
type RequestStream = BusRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BusSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Bus";
}
pub trait BusProxyInterface: Send + Sync {
fn r#publish(&self, data: &Event) -> Result<(), fidl::Error>;
type EnsurePublishResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#ensure_publish(&self, data: &Event) -> Self::EnsurePublishResponseFut;
type GetClientsResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>>
+ Send;
fn r#get_clients(&self) -> Self::GetClientsResponseFut;
type WaitForClientsResponseFut: std::future::Future<Output = Result<(bool, Option<Vec<String>>), fidl::Error>>
+ Send;
fn r#wait_for_clients(
&self,
clients: &[String],
timeout: i64,
) -> Self::WaitForClientsResponseFut;
type WaitForEvent_ResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
fn r#wait_for_event_(&self, data: &Event, timeout: i64) -> Self::WaitForEvent_ResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BusSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BusSynchronousProxy {
type Proxy = BusProxy;
type Protocol = BusMarker;
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 BusSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BusMarker 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<BusEvent, fidl::Error> {
BusEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#publish(&self, mut data: &Event) -> Result<(), fidl::Error> {
self.client.send::<BusPublishRequest>(
(data,),
0x331ceb644024c14b,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#ensure_publish(
&self,
mut data: &Event,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<BusEnsurePublishRequest, fidl::encoding::EmptyPayload>(
(data,),
0x2969c5f5de5bb64,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_clients(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<String>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, BusGetClientsResponse>(
(),
0x733c5e2d525a006b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.clients)
}
pub fn r#wait_for_clients(
&self,
mut clients: &[String],
mut timeout: i64,
___deadline: zx::MonotonicInstant,
) -> Result<(bool, Option<Vec<String>>), fidl::Error> {
let _response =
self.client.send_query::<BusWaitForClientsRequest, BusWaitForClientsResponse>(
(clients, timeout),
0x21c89fc6be990b23,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.result, _response.absent))
}
pub fn r#wait_for_event_(
&self,
mut data: &Event,
mut timeout: i64,
___deadline: zx::MonotonicInstant,
) -> Result<bool, fidl::Error> {
let _response = self.client.send_query::<BusWaitForEventRequest, BusWaitForEventResponse>(
(data, timeout),
0x600ca084a42ee5bf,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.result)
}
}
#[derive(Debug, Clone)]
pub struct BusProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BusProxy {
type Protocol = BusMarker;
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 BusProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <BusMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BusEventStream {
BusEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#publish(&self, mut data: &Event) -> Result<(), fidl::Error> {
BusProxyInterface::r#publish(self, data)
}
pub fn r#ensure_publish(
&self,
mut data: &Event,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
BusProxyInterface::r#ensure_publish(self, data)
}
pub fn r#get_clients(
&self,
) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
BusProxyInterface::r#get_clients(self)
}
pub fn r#wait_for_clients(
&self,
mut clients: &[String],
mut timeout: i64,
) -> fidl::client::QueryResponseFut<
(bool, Option<Vec<String>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BusProxyInterface::r#wait_for_clients(self, clients, timeout)
}
pub fn r#wait_for_event_(
&self,
mut data: &Event,
mut timeout: i64,
) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
BusProxyInterface::r#wait_for_event_(self, data, timeout)
}
}
impl BusProxyInterface for BusProxy {
fn r#publish(&self, mut data: &Event) -> Result<(), fidl::Error> {
self.client.send::<BusPublishRequest>(
(data,),
0x331ceb644024c14b,
fidl::encoding::DynamicFlags::empty(),
)
}
type EnsurePublishResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#ensure_publish(&self, mut data: &Event) -> Self::EnsurePublishResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2969c5f5de5bb64,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<BusEnsurePublishRequest, ()>(
(data,),
0x2969c5f5de5bb64,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetClientsResponseFut =
fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_clients(&self) -> Self::GetClientsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<String>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BusGetClientsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x733c5e2d525a006b,
>(_buf?)?;
Ok(_response.clients)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
(),
0x733c5e2d525a006b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WaitForClientsResponseFut = fidl::client::QueryResponseFut<
(bool, Option<Vec<String>>),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#wait_for_clients(
&self,
mut clients: &[String],
mut timeout: i64,
) -> Self::WaitForClientsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(bool, Option<Vec<String>>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BusWaitForClientsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x21c89fc6be990b23,
>(_buf?)?;
Ok((_response.result, _response.absent))
}
self.client.send_query_and_decode::<BusWaitForClientsRequest, (bool, Option<Vec<String>>)>(
(clients, timeout),
0x21c89fc6be990b23,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WaitForEvent_ResponseFut =
fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#wait_for_event_(
&self,
mut data: &Event,
mut timeout: i64,
) -> Self::WaitForEvent_ResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<bool, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
BusWaitForEventResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x600ca084a42ee5bf,
>(_buf?)?;
Ok(_response.result)
}
self.client.send_query_and_decode::<BusWaitForEventRequest, bool>(
(data, timeout),
0x600ca084a42ee5bf,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BusEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BusEventStream {}
impl futures::stream::FusedStream for BusEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BusEventStream {
type Item = Result<BusEvent, 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(BusEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BusEvent {
OnBusData { data: Event },
OnClientAttached { client: String },
OnClientDetached { client: String },
}
impl BusEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_bus_data(self) -> Option<Event> {
if let BusEvent::OnBusData { data } = self {
Some((data))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_client_attached(self) -> Option<String> {
if let BusEvent::OnClientAttached { client } = self {
Some((client))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_client_detached(self) -> Option<String> {
if let BusEvent::OnClientDetached { client } = self {
Some((client))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BusEvent, 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 {
0x26e9b9ffb43f638f => {
let mut out = fidl::new_empty!(
BusOnBusDataRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BusOnBusDataRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((BusEvent::OnBusData { data: out.data }))
}
0x41af94df60bf8ba7 => {
let mut out = fidl::new_empty!(
BusOnClientAttachedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BusOnClientAttachedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((BusEvent::OnClientAttached { client: out.client }))
}
0x31a36387f8ab00d8 => {
let mut out = fidl::new_empty!(
BusOnClientDetachedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BusOnClientDetachedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((BusEvent::OnClientDetached { client: out.client }))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <BusMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BusRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BusRequestStream {}
impl futures::stream::FusedStream for BusRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BusRequestStream {
type Protocol = BusMarker;
type ControlHandle = BusControlHandle;
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 {
BusControlHandle { 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 BusRequestStream {
type Item = Result<BusRequest, 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 BusRequestStream 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 {
0x331ceb644024c14b => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
BusPublishRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BusPublishRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BusControlHandle { inner: this.inner.clone() };
Ok(BusRequest::Publish { data: req.data, control_handle })
}
0x2969c5f5de5bb64 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BusEnsurePublishRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BusEnsurePublishRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BusControlHandle { inner: this.inner.clone() };
Ok(BusRequest::EnsurePublish {
data: req.data,
responder: BusEnsurePublishResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x733c5e2d525a006b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BusControlHandle { inner: this.inner.clone() };
Ok(BusRequest::GetClients {
responder: BusGetClientsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x21c89fc6be990b23 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BusWaitForClientsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BusWaitForClientsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BusControlHandle { inner: this.inner.clone() };
Ok(BusRequest::WaitForClients {
clients: req.clients,
timeout: req.timeout,
responder: BusWaitForClientsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x600ca084a42ee5bf => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BusWaitForEventRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BusWaitForEventRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = BusControlHandle { inner: this.inner.clone() };
Ok(BusRequest::WaitForEvent_ {
data: req.data,
timeout: req.timeout,
responder: BusWaitForEvent_Responder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <BusMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BusRequest {
Publish { data: Event, control_handle: BusControlHandle },
EnsurePublish { data: Event, responder: BusEnsurePublishResponder },
GetClients { responder: BusGetClientsResponder },
WaitForClients { clients: Vec<String>, timeout: i64, responder: BusWaitForClientsResponder },
WaitForEvent_ { data: Event, timeout: i64, responder: BusWaitForEvent_Responder },
}
impl BusRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_publish(self) -> Option<(Event, BusControlHandle)> {
if let BusRequest::Publish { data, control_handle } = self {
Some((data, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_ensure_publish(self) -> Option<(Event, BusEnsurePublishResponder)> {
if let BusRequest::EnsurePublish { data, responder } = self {
Some((data, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_clients(self) -> Option<(BusGetClientsResponder)> {
if let BusRequest::GetClients { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wait_for_clients(self) -> Option<(Vec<String>, i64, BusWaitForClientsResponder)> {
if let BusRequest::WaitForClients { clients, timeout, responder } = self {
Some((clients, timeout, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wait_for_event_(self) -> Option<(Event, i64, BusWaitForEvent_Responder)> {
if let BusRequest::WaitForEvent_ { data, timeout, responder } = self {
Some((data, timeout, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BusRequest::Publish { .. } => "publish",
BusRequest::EnsurePublish { .. } => "ensure_publish",
BusRequest::GetClients { .. } => "get_clients",
BusRequest::WaitForClients { .. } => "wait_for_clients",
BusRequest::WaitForEvent_ { .. } => "wait_for_event_",
}
}
}
#[derive(Debug, Clone)]
pub struct BusControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BusControlHandle {
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 BusControlHandle {
pub fn send_on_bus_data(&self, mut data: &Event) -> Result<(), fidl::Error> {
self.inner.send::<BusOnBusDataRequest>(
(data,),
0,
0x26e9b9ffb43f638f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_client_attached(&self, mut client: &str) -> Result<(), fidl::Error> {
self.inner.send::<BusOnClientAttachedRequest>(
(client,),
0,
0x41af94df60bf8ba7,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_client_detached(&self, mut client: &str) -> Result<(), fidl::Error> {
self.inner.send::<BusOnClientDetachedRequest>(
(client,),
0,
0x31a36387f8ab00d8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BusEnsurePublishResponder {
control_handle: std::mem::ManuallyDrop<BusControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BusEnsurePublishResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BusEnsurePublishResponder {
type ControlHandle = BusControlHandle;
fn control_handle(&self) -> &BusControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BusEnsurePublishResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x2969c5f5de5bb64,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BusGetClientsResponder {
control_handle: std::mem::ManuallyDrop<BusControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BusGetClientsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BusGetClientsResponder {
type ControlHandle = BusControlHandle;
fn control_handle(&self) -> &BusControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BusGetClientsResponder {
pub fn send(self, mut clients: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(clients);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut clients: &[String]) -> Result<(), fidl::Error> {
let _result = self.send_raw(clients);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut clients: &[String]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<BusGetClientsResponse>(
(clients,),
self.tx_id,
0x733c5e2d525a006b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BusWaitForClientsResponder {
control_handle: std::mem::ManuallyDrop<BusControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BusWaitForClientsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BusWaitForClientsResponder {
type ControlHandle = BusControlHandle;
fn control_handle(&self) -> &BusControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BusWaitForClientsResponder {
pub fn send(self, mut result: bool, mut absent: Option<&[String]>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result, absent);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: bool,
mut absent: Option<&[String]>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result, absent);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: bool, mut absent: Option<&[String]>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<BusWaitForClientsResponse>(
(result, absent),
self.tx_id,
0x21c89fc6be990b23,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BusWaitForEvent_Responder {
control_handle: std::mem::ManuallyDrop<BusControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BusWaitForEvent_Responder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BusWaitForEvent_Responder {
type ControlHandle = BusControlHandle;
fn control_handle(&self) -> &BusControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BusWaitForEvent_Responder {
pub fn send(self, mut result: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: bool) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<BusWaitForEventResponse>(
(result,),
self.tx_id,
0x600ca084a42ee5bf,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SyncManagerMarker;
impl fidl::endpoints::ProtocolMarker for SyncManagerMarker {
type Proxy = SyncManagerProxy;
type RequestStream = SyncManagerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SyncManagerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.netemul.sync.SyncManager";
}
impl fidl::endpoints::DiscoverableProtocolMarker for SyncManagerMarker {}
pub trait SyncManagerProxyInterface: Send + Sync {
fn r#bus_subscribe(
&self,
bus_name: &str,
client_name: &str,
bus: fidl::endpoints::ServerEnd<BusMarker>,
) -> Result<(), fidl::Error>;
type WaitForBarrierThresholdResponseFut: std::future::Future<Output = Result<bool, fidl::Error>>
+ Send;
fn r#wait_for_barrier_threshold(
&self,
barrier_name: &str,
threshold: u32,
timeout: i64,
) -> Self::WaitForBarrierThresholdResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SyncManagerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SyncManagerSynchronousProxy {
type Proxy = SyncManagerProxy;
type Protocol = SyncManagerMarker;
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 SyncManagerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SyncManagerMarker 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<SyncManagerEvent, fidl::Error> {
SyncManagerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#bus_subscribe(
&self,
mut bus_name: &str,
mut client_name: &str,
mut bus: fidl::endpoints::ServerEnd<BusMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<SyncManagerBusSubscribeRequest>(
(bus_name, client_name, bus),
0x39c25d810b5e7407,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#wait_for_barrier_threshold(
&self,
mut barrier_name: &str,
mut threshold: u32,
mut timeout: i64,
___deadline: zx::MonotonicInstant,
) -> Result<bool, fidl::Error> {
let _response = self.client.send_query::<
SyncManagerWaitForBarrierThresholdRequest,
SyncManagerWaitForBarrierThresholdResponse,
>(
(barrier_name, threshold, timeout,),
0x592056b5825f4292,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.result)
}
}
#[derive(Debug, Clone)]
pub struct SyncManagerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for SyncManagerProxy {
type Protocol = SyncManagerMarker;
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 SyncManagerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <SyncManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SyncManagerEventStream {
SyncManagerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#bus_subscribe(
&self,
mut bus_name: &str,
mut client_name: &str,
mut bus: fidl::endpoints::ServerEnd<BusMarker>,
) -> Result<(), fidl::Error> {
SyncManagerProxyInterface::r#bus_subscribe(self, bus_name, client_name, bus)
}
pub fn r#wait_for_barrier_threshold(
&self,
mut barrier_name: &str,
mut threshold: u32,
mut timeout: i64,
) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
SyncManagerProxyInterface::r#wait_for_barrier_threshold(
self,
barrier_name,
threshold,
timeout,
)
}
}
impl SyncManagerProxyInterface for SyncManagerProxy {
fn r#bus_subscribe(
&self,
mut bus_name: &str,
mut client_name: &str,
mut bus: fidl::endpoints::ServerEnd<BusMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<SyncManagerBusSubscribeRequest>(
(bus_name, client_name, bus),
0x39c25d810b5e7407,
fidl::encoding::DynamicFlags::empty(),
)
}
type WaitForBarrierThresholdResponseFut =
fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#wait_for_barrier_threshold(
&self,
mut barrier_name: &str,
mut threshold: u32,
mut timeout: i64,
) -> Self::WaitForBarrierThresholdResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<bool, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SyncManagerWaitForBarrierThresholdResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x592056b5825f4292,
>(_buf?)?;
Ok(_response.result)
}
self.client.send_query_and_decode::<SyncManagerWaitForBarrierThresholdRequest, bool>(
(barrier_name, threshold, timeout),
0x592056b5825f4292,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct SyncManagerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for SyncManagerEventStream {}
impl futures::stream::FusedStream for SyncManagerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SyncManagerEventStream {
type Item = Result<SyncManagerEvent, 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(SyncManagerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SyncManagerEvent {}
impl SyncManagerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<SyncManagerEvent, 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: <SyncManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SyncManagerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for SyncManagerRequestStream {}
impl futures::stream::FusedStream for SyncManagerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SyncManagerRequestStream {
type Protocol = SyncManagerMarker;
type ControlHandle = SyncManagerControlHandle;
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 {
SyncManagerControlHandle { 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 SyncManagerRequestStream {
type Item = Result<SyncManagerRequest, 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 SyncManagerRequestStream 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 {
0x39c25d810b5e7407 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
SyncManagerBusSubscribeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SyncManagerBusSubscribeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SyncManagerControlHandle { inner: this.inner.clone() };
Ok(SyncManagerRequest::BusSubscribe {
bus_name: req.bus_name,
client_name: req.client_name,
bus: req.bus,
control_handle,
})
}
0x592056b5825f4292 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
SyncManagerWaitForBarrierThresholdRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SyncManagerWaitForBarrierThresholdRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SyncManagerControlHandle { inner: this.inner.clone() };
Ok(SyncManagerRequest::WaitForBarrierThreshold {
barrier_name: req.barrier_name,
threshold: req.threshold,
timeout: req.timeout,
responder: SyncManagerWaitForBarrierThresholdResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<SyncManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum SyncManagerRequest {
BusSubscribe {
bus_name: String,
client_name: String,
bus: fidl::endpoints::ServerEnd<BusMarker>,
control_handle: SyncManagerControlHandle,
},
WaitForBarrierThreshold {
barrier_name: String,
threshold: u32,
timeout: i64,
responder: SyncManagerWaitForBarrierThresholdResponder,
},
}
impl SyncManagerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_bus_subscribe(
self,
) -> Option<(String, String, fidl::endpoints::ServerEnd<BusMarker>, SyncManagerControlHandle)>
{
if let SyncManagerRequest::BusSubscribe { bus_name, client_name, bus, control_handle } =
self
{
Some((bus_name, client_name, bus, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wait_for_barrier_threshold(
self,
) -> Option<(String, u32, i64, SyncManagerWaitForBarrierThresholdResponder)> {
if let SyncManagerRequest::WaitForBarrierThreshold {
barrier_name,
threshold,
timeout,
responder,
} = self
{
Some((barrier_name, threshold, timeout, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SyncManagerRequest::BusSubscribe { .. } => "bus_subscribe",
SyncManagerRequest::WaitForBarrierThreshold { .. } => "wait_for_barrier_threshold",
}
}
}
#[derive(Debug, Clone)]
pub struct SyncManagerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for SyncManagerControlHandle {
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 SyncManagerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SyncManagerWaitForBarrierThresholdResponder {
control_handle: std::mem::ManuallyDrop<SyncManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SyncManagerWaitForBarrierThresholdResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SyncManagerWaitForBarrierThresholdResponder {
type ControlHandle = SyncManagerControlHandle;
fn control_handle(&self) -> &SyncManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SyncManagerWaitForBarrierThresholdResponder {
pub fn send(self, mut result: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: bool) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<SyncManagerWaitForBarrierThresholdResponse>(
(result,),
self.tx_id,
0x592056b5825f4292,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
impl fidl::encoding::ValueTypeMarker for BusEnsurePublishRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusEnsurePublishRequest {
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<BusEnsurePublishRequest, D> for &BusEnsurePublishRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusEnsurePublishRequest>(offset);
fidl::encoding::Encode::<BusEnsurePublishRequest, D>::encode(
(<Event as fidl::encoding::ValueTypeMarker>::borrow(&self.data),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Event, D>>
fidl::encoding::Encode<BusEnsurePublishRequest, 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::<BusEnsurePublishRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BusEnsurePublishRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { data: fidl::new_empty!(Event, 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!(Event, D, &mut self.data, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BusGetClientsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusGetClientsResponse {
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<BusGetClientsResponse, D>
for &BusGetClientsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusGetClientsResponse>(offset);
fidl::encoding::Encode::<BusGetClientsResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.clients),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
D,
>,
> fidl::encoding::Encode<BusGetClientsResponse, 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::<BusGetClientsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BusGetClientsResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
clients: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
D,
&mut self.clients,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BusOnBusDataRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusOnBusDataRequest {
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<BusOnBusDataRequest, D>
for &BusOnBusDataRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusOnBusDataRequest>(offset);
fidl::encoding::Encode::<BusOnBusDataRequest, D>::encode(
(<Event as fidl::encoding::ValueTypeMarker>::borrow(&self.data),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Event, D>>
fidl::encoding::Encode<BusOnBusDataRequest, 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::<BusOnBusDataRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BusOnBusDataRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { data: fidl::new_empty!(Event, 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!(Event, D, &mut self.data, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BusOnClientAttachedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusOnClientAttachedRequest {
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<BusOnClientAttachedRequest, D> for &BusOnClientAttachedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusOnClientAttachedRequest>(offset);
fidl::encoding::Encode::<BusOnClientAttachedRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.client,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<BusOnClientAttachedRequest, 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::<BusOnClientAttachedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BusOnClientAttachedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { client: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.client,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BusOnClientDetachedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusOnClientDetachedRequest {
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<BusOnClientDetachedRequest, D> for &BusOnClientDetachedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusOnClientDetachedRequest>(offset);
fidl::encoding::Encode::<BusOnClientDetachedRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.client,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<BusOnClientDetachedRequest, 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::<BusOnClientDetachedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BusOnClientDetachedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { client: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.client,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BusPublishRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusPublishRequest {
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<BusPublishRequest, D>
for &BusPublishRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusPublishRequest>(offset);
fidl::encoding::Encode::<BusPublishRequest, D>::encode(
(<Event as fidl::encoding::ValueTypeMarker>::borrow(&self.data),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Event, D>>
fidl::encoding::Encode<BusPublishRequest, 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::<BusPublishRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BusPublishRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { data: fidl::new_empty!(Event, 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!(Event, D, &mut self.data, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BusWaitForClientsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusWaitForClientsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BusWaitForClientsRequest, D> for &BusWaitForClientsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusWaitForClientsRequest>(offset);
fidl::encoding::Encode::<BusWaitForClientsRequest, D>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.clients),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timeout),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
D,
>,
T1: fidl::encoding::Encode<i64, D>,
> fidl::encoding::Encode<BusWaitForClientsRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusWaitForClientsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BusWaitForClientsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
clients: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
D
),
timeout: fidl::new_empty!(i64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
D,
&mut self.clients,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(i64, D, &mut self.timeout, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BusWaitForClientsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusWaitForClientsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BusWaitForClientsResponse, D> for &BusWaitForClientsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusWaitForClientsResponse>(offset);
fidl::encoding::Encode::<BusWaitForClientsResponse, D>::encode(
(
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.result),
<fidl::encoding::Optional<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
> as fidl::encoding::ValueTypeMarker>::borrow(&self.absent),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<bool, D>,
T1: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
>,
D,
>,
> fidl::encoding::Encode<BusWaitForClientsResponse, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusWaitForClientsResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BusWaitForClientsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
result: fidl::new_empty!(bool, D),
absent: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(bool, D, &mut self.result, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Optional<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
>,
D,
&mut self.absent,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BusWaitForEventRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusWaitForEventRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BusWaitForEventRequest, D> for &BusWaitForEventRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusWaitForEventRequest>(offset);
fidl::encoding::Encode::<BusWaitForEventRequest, D>::encode(
(
<Event as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timeout),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Event, D>,
T1: fidl::encoding::Encode<i64, D>,
> fidl::encoding::Encode<BusWaitForEventRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusWaitForEventRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BusWaitForEventRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { data: fidl::new_empty!(Event, D), timeout: fidl::new_empty!(i64, 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!(Event, D, &mut self.data, decoder, offset + 0, _depth)?;
fidl::decode!(i64, D, &mut self.timeout, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BusWaitForEventResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BusWaitForEventResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BusWaitForEventResponse, D> for &BusWaitForEventResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BusWaitForEventResponse>(offset);
fidl::encoding::Encode::<BusWaitForEventResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<BusWaitForEventResponse, 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::<BusWaitForEventResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BusWaitForEventResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(bool, D, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SyncManagerBusSubscribeRequest {
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 SyncManagerBusSubscribeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl
fidl::encoding::Encode<
SyncManagerBusSubscribeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut SyncManagerBusSubscribeRequest
{
#[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::<SyncManagerBusSubscribeRequest>(offset);
fidl::encoding::Encode::<SyncManagerBusSubscribeRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.bus_name),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.client_name),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BusMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.bus),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BusMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
SyncManagerBusSubscribeRequest,
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::<SyncManagerBusSubscribeRequest>(offset);
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 + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SyncManagerBusSubscribeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
bus_name: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
client_name: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
bus: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BusMarker>>,
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(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::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.bus_name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.client_name,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BusMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.bus,
decoder,
offset + 32,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SyncManagerWaitForBarrierThresholdRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SyncManagerWaitForBarrierThresholdRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SyncManagerWaitForBarrierThresholdRequest, D>
for &SyncManagerWaitForBarrierThresholdRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SyncManagerWaitForBarrierThresholdRequest>(offset);
fidl::encoding::Encode::<SyncManagerWaitForBarrierThresholdRequest, D>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.barrier_name,
),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.threshold),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timeout),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<i64, D>,
> fidl::encoding::Encode<SyncManagerWaitForBarrierThresholdRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SyncManagerWaitForBarrierThresholdRequest>(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)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SyncManagerWaitForBarrierThresholdRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
barrier_name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
threshold: fidl::new_empty!(u32, D),
timeout: fidl::new_empty!(i64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 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::UnboundedString,
D,
&mut self.barrier_name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u32, D, &mut self.threshold, decoder, offset + 16, _depth)?;
fidl::decode!(i64, D, &mut self.timeout, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SyncManagerWaitForBarrierThresholdResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SyncManagerWaitForBarrierThresholdResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<SyncManagerWaitForBarrierThresholdResponse, D>
for &SyncManagerWaitForBarrierThresholdResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SyncManagerWaitForBarrierThresholdResponse>(offset);
fidl::encoding::Encode::<SyncManagerWaitForBarrierThresholdResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<SyncManagerWaitForBarrierThresholdResponse, 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::<SyncManagerWaitForBarrierThresholdResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for SyncManagerWaitForBarrierThresholdResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(bool, D, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl Event {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.arguments {
return 3;
}
if let Some(_) = self.message {
return 2;
}
if let Some(_) = self.code {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Event {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Event {
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<Event, D> for &Event {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Event>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<i32, D>(
self.code.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
self.message.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
self.arguments.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Event {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.code.get_or_insert_with(|| fidl::new_empty!(i32, D));
fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.message
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.arguments.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
}