#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const BINDING_RESULT_MAX: u8 = 10;
pub const HASH_LENGTH: u8 = 64;
pub const MAX_SEGMENTS: u32 = 20;
pub const NODE_MONIKER_MAX: u32 = 1024;
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct RestartRematchFlags: u32 {
const REQUESTED = 1;
const NON_REQUESTED = 2;
const COMPOSITE_SPEC = 8;
}
}
impl RestartRematchFlags {
#[inline(always)]
pub fn from_bits_allow_unknown(bits: u32) -> Self {
Self::from_bits_retain(bits)
}
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
self.get_unknown_bits() != 0
}
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
self.bits() & !Self::all().bits()
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct CompositeInfoIteratorGetNextResponse {
pub composites: Vec<CompositeNodeInfo>,
}
impl fidl::Persistable for CompositeInfoIteratorGetNextResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct CompositeNodeSpecIteratorGetNextResponse {
pub specs: Vec<fidl_fuchsia_driver_framework::CompositeInfo>,
}
impl fidl::Persistable for CompositeNodeSpecIteratorGetNextResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct DriverInfoIteratorGetNextResponse {
pub drivers: Vec<fidl_fuchsia_driver_framework::DriverInfo>,
}
impl fidl::Persistable for DriverInfoIteratorGetNextResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ManagerAddTestNodeRequest {
pub args: TestNodeAddArgs,
}
impl fidl::Persistable for ManagerAddTestNodeRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManagerDisableDriverRequest {
pub driver_url: String,
pub package_hash: Option<String>,
}
impl fidl::Persistable for ManagerDisableDriverRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManagerEnableDriverRequest {
pub driver_url: String,
pub package_hash: Option<String>,
}
impl fidl::Persistable for ManagerEnableDriverRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManagerGetCompositeInfoRequest {
pub iterator: fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerGetCompositeInfoRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManagerGetCompositeNodeSpecsRequest {
pub name_filter: Option<String>,
pub iterator: fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerGetCompositeNodeSpecsRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManagerGetDriverInfoRequest {
pub driver_filter: Vec<String>,
pub iterator: fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerGetDriverInfoRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManagerGetNodeInfoRequest {
pub node_filter: Vec<String>,
pub iterator: fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>,
pub exact_match: bool,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ManagerGetNodeInfoRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManagerRemoveTestNodeRequest {
pub name: String,
}
impl fidl::Persistable for ManagerRemoveTestNodeRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ManagerRestartDriverHostsRequest {
pub driver_url: String,
pub rematch_flags: RestartRematchFlags,
}
impl fidl::Persistable for ManagerRestartDriverHostsRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ManagerBindAllUnboundNodesResponse {
pub binding_result: Vec<NodeBindingInfo>,
}
impl fidl::Persistable for ManagerBindAllUnboundNodesResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ManagerRestartDriverHostsResponse {
pub count: u32,
}
impl fidl::Persistable for ManagerRestartDriverHostsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct NodeInfoIteratorGetNextResponse {
pub nodes: Vec<NodeInfo>,
}
impl fidl::Persistable for NodeInfoIteratorGetNextResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CompositeNodeInfo {
pub parent_topological_paths: Option<Vec<Option<String>>>,
pub topological_path: Option<String>,
pub composite: Option<CompositeInfo>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for CompositeNodeInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct NodeBindingInfo {
pub node_name: Option<String>,
pub driver_url: Option<String>,
pub composite_parents: Option<Vec<fidl_fuchsia_driver_framework::CompositeParent>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for NodeBindingInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct NodeInfo {
pub id: Option<u64>,
pub parent_ids: Option<Vec<u64>>,
pub child_ids: Option<Vec<u64>>,
pub driver_host_koid: Option<u64>,
pub bound_driver_url: Option<String>,
pub moniker: Option<String>,
pub node_property_list: Option<Vec<fidl_fuchsia_driver_framework::NodeProperty>>,
pub offer_list: Option<Vec<fidl_fuchsia_component_decl::Offer>>,
pub quarantined: Option<bool>,
pub bus_topology: Option<Vec<fidl_fuchsia_driver_framework::BusInfo>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for NodeInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct TestNodeAddArgs {
pub name: Option<String>,
pub properties: Option<Vec<fidl_fuchsia_driver_framework::NodeProperty>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for TestNodeAddArgs {}
#[derive(Clone, Debug, PartialEq)]
pub enum CompositeInfo {
Composite(fidl_fuchsia_driver_framework::CompositeInfo),
}
impl CompositeInfo {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Composite(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for CompositeInfo {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BootupWatcherMarker;
impl fidl::endpoints::ProtocolMarker for BootupWatcherMarker {
type Proxy = BootupWatcherProxy;
type RequestStream = BootupWatcherRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BootupWatcherSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.driver.development.BootupWatcher";
}
impl fidl::endpoints::DiscoverableProtocolMarker for BootupWatcherMarker {}
pub trait BootupWatcherProxyInterface: Send + Sync {
type WaitForBootupResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#wait_for_bootup(&self) -> Self::WaitForBootupResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BootupWatcherSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BootupWatcherSynchronousProxy {
type Proxy = BootupWatcherProxy;
type Protocol = BootupWatcherMarker;
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 BootupWatcherSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BootupWatcherMarker 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<BootupWatcherEvent, fidl::Error> {
BootupWatcherEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#wait_for_bootup(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x3bd1c5fbb14bb179,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct BootupWatcherProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BootupWatcherProxy {
type Protocol = BootupWatcherMarker;
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 BootupWatcherProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <BootupWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BootupWatcherEventStream {
BootupWatcherEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#wait_for_bootup(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
BootupWatcherProxyInterface::r#wait_for_bootup(self)
}
}
impl BootupWatcherProxyInterface for BootupWatcherProxy {
type WaitForBootupResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#wait_for_bootup(&self) -> Self::WaitForBootupResponseFut {
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,
0x3bd1c5fbb14bb179,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x3bd1c5fbb14bb179,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BootupWatcherEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BootupWatcherEventStream {}
impl futures::stream::FusedStream for BootupWatcherEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BootupWatcherEventStream {
type Item = Result<BootupWatcherEvent, 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(BootupWatcherEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BootupWatcherEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl BootupWatcherEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BootupWatcherEvent, 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 {
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(BootupWatcherEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <BootupWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BootupWatcherRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BootupWatcherRequestStream {}
impl futures::stream::FusedStream for BootupWatcherRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BootupWatcherRequestStream {
type Protocol = BootupWatcherMarker;
type ControlHandle = BootupWatcherControlHandle;
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 {
BootupWatcherControlHandle { 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 BootupWatcherRequestStream {
type Item = Result<BootupWatcherRequest, 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 BootupWatcherRequestStream 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 {
0x3bd1c5fbb14bb179 => {
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 =
BootupWatcherControlHandle { inner: this.inner.clone() };
Ok(BootupWatcherRequest::WaitForBootup {
responder: BootupWatcherWaitForBootupResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(BootupWatcherRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: BootupWatcherControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(BootupWatcherRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: BootupWatcherControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<BootupWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BootupWatcherRequest {
WaitForBootup {
responder: BootupWatcherWaitForBootupResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: BootupWatcherControlHandle,
method_type: fidl::MethodType,
},
}
impl BootupWatcherRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_wait_for_bootup(self) -> Option<(BootupWatcherWaitForBootupResponder)> {
if let BootupWatcherRequest::WaitForBootup { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BootupWatcherRequest::WaitForBootup { .. } => "wait_for_bootup",
BootupWatcherRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
BootupWatcherRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct BootupWatcherControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BootupWatcherControlHandle {
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 BootupWatcherControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BootupWatcherWaitForBootupResponder {
control_handle: std::mem::ManuallyDrop<BootupWatcherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BootupWatcherWaitForBootupResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BootupWatcherWaitForBootupResponder {
type ControlHandle = BootupWatcherControlHandle;
fn control_handle(&self) -> &BootupWatcherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BootupWatcherWaitForBootupResponder {
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,
0x3bd1c5fbb14bb179,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CompositeInfoIteratorMarker;
impl fidl::endpoints::ProtocolMarker for CompositeInfoIteratorMarker {
type Proxy = CompositeInfoIteratorProxy;
type RequestStream = CompositeInfoIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CompositeInfoIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) CompositeInfoIterator";
}
pub trait CompositeInfoIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<Vec<CompositeNodeInfo>, fidl::Error>>
+ Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CompositeInfoIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CompositeInfoIteratorSynchronousProxy {
type Proxy = CompositeInfoIteratorProxy;
type Protocol = CompositeInfoIteratorMarker;
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 CompositeInfoIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<CompositeInfoIteratorMarker 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<CompositeInfoIteratorEvent, fidl::Error> {
CompositeInfoIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<CompositeNodeInfo>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, CompositeInfoIteratorGetNextResponse>(
(),
0x50af808a6e34bb96,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.composites)
}
}
#[derive(Debug, Clone)]
pub struct CompositeInfoIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CompositeInfoIteratorProxy {
type Protocol = CompositeInfoIteratorMarker;
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 CompositeInfoIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<CompositeInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CompositeInfoIteratorEventStream {
CompositeInfoIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<
Vec<CompositeNodeInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CompositeInfoIteratorProxyInterface::r#get_next(self)
}
}
impl CompositeInfoIteratorProxyInterface for CompositeInfoIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
Vec<CompositeNodeInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<CompositeNodeInfo>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
CompositeInfoIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x50af808a6e34bb96,
>(_buf?)?;
Ok(_response.composites)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<CompositeNodeInfo>>(
(),
0x50af808a6e34bb96,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct CompositeInfoIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CompositeInfoIteratorEventStream {}
impl futures::stream::FusedStream for CompositeInfoIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CompositeInfoIteratorEventStream {
type Item = Result<CompositeInfoIteratorEvent, 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(CompositeInfoIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CompositeInfoIteratorEvent {}
impl CompositeInfoIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CompositeInfoIteratorEvent, 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:
<CompositeInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CompositeInfoIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CompositeInfoIteratorRequestStream {}
impl futures::stream::FusedStream for CompositeInfoIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CompositeInfoIteratorRequestStream {
type Protocol = CompositeInfoIteratorMarker;
type ControlHandle = CompositeInfoIteratorControlHandle;
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 {
CompositeInfoIteratorControlHandle { 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 CompositeInfoIteratorRequestStream {
type Item = Result<CompositeInfoIteratorRequest, 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 CompositeInfoIteratorRequestStream 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 {
0x50af808a6e34bb96 => {
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 = CompositeInfoIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(CompositeInfoIteratorRequest::GetNext {
responder: CompositeInfoIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <CompositeInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CompositeInfoIteratorRequest {
GetNext { responder: CompositeInfoIteratorGetNextResponder },
}
impl CompositeInfoIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(CompositeInfoIteratorGetNextResponder)> {
if let CompositeInfoIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CompositeInfoIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct CompositeInfoIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CompositeInfoIteratorControlHandle {
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 CompositeInfoIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CompositeInfoIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<CompositeInfoIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CompositeInfoIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CompositeInfoIteratorGetNextResponder {
type ControlHandle = CompositeInfoIteratorControlHandle;
fn control_handle(&self) -> &CompositeInfoIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CompositeInfoIteratorGetNextResponder {
pub fn send(self, mut composites: &[CompositeNodeInfo]) -> Result<(), fidl::Error> {
let _result = self.send_raw(composites);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut composites: &[CompositeNodeInfo],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(composites);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut composites: &[CompositeNodeInfo]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CompositeInfoIteratorGetNextResponse>(
(composites,),
self.tx_id,
0x50af808a6e34bb96,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CompositeNodeSpecIteratorMarker;
impl fidl::endpoints::ProtocolMarker for CompositeNodeSpecIteratorMarker {
type Proxy = CompositeNodeSpecIteratorProxy;
type RequestStream = CompositeNodeSpecIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CompositeNodeSpecIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) CompositeNodeSpecIterator";
}
pub trait CompositeNodeSpecIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<
Output = Result<Vec<fidl_fuchsia_driver_framework::CompositeInfo>, fidl::Error>,
> + Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CompositeNodeSpecIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CompositeNodeSpecIteratorSynchronousProxy {
type Proxy = CompositeNodeSpecIteratorProxy;
type Protocol = CompositeNodeSpecIteratorMarker;
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 CompositeNodeSpecIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<CompositeNodeSpecIteratorMarker 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<CompositeNodeSpecIteratorEvent, fidl::Error> {
CompositeNodeSpecIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<fidl_fuchsia_driver_framework::CompositeInfo>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, CompositeNodeSpecIteratorGetNextResponse>(
(),
0x32fd110355479f71,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.specs)
}
}
#[derive(Debug, Clone)]
pub struct CompositeNodeSpecIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CompositeNodeSpecIteratorProxy {
type Protocol = CompositeNodeSpecIteratorMarker;
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 CompositeNodeSpecIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<CompositeNodeSpecIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CompositeNodeSpecIteratorEventStream {
CompositeNodeSpecIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<
Vec<fidl_fuchsia_driver_framework::CompositeInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CompositeNodeSpecIteratorProxyInterface::r#get_next(self)
}
}
impl CompositeNodeSpecIteratorProxyInterface for CompositeNodeSpecIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
Vec<fidl_fuchsia_driver_framework::CompositeInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<fidl_fuchsia_driver_framework::CompositeInfo>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
CompositeNodeSpecIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x32fd110355479f71,
>(_buf?)?;
Ok(_response.specs)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
Vec<fidl_fuchsia_driver_framework::CompositeInfo>,
>(
(),
0x32fd110355479f71,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct CompositeNodeSpecIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CompositeNodeSpecIteratorEventStream {}
impl futures::stream::FusedStream for CompositeNodeSpecIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CompositeNodeSpecIteratorEventStream {
type Item = Result<CompositeNodeSpecIteratorEvent, 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(CompositeNodeSpecIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CompositeNodeSpecIteratorEvent {}
impl CompositeNodeSpecIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CompositeNodeSpecIteratorEvent, 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:
<CompositeNodeSpecIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CompositeNodeSpecIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CompositeNodeSpecIteratorRequestStream {}
impl futures::stream::FusedStream for CompositeNodeSpecIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CompositeNodeSpecIteratorRequestStream {
type Protocol = CompositeNodeSpecIteratorMarker;
type ControlHandle = CompositeNodeSpecIteratorControlHandle;
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 {
CompositeNodeSpecIteratorControlHandle { 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 CompositeNodeSpecIteratorRequestStream {
type Item = Result<CompositeNodeSpecIteratorRequest, 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 CompositeNodeSpecIteratorRequestStream 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 {
0x32fd110355479f71 => {
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 = CompositeNodeSpecIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(CompositeNodeSpecIteratorRequest::GetNext {
responder: CompositeNodeSpecIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <CompositeNodeSpecIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CompositeNodeSpecIteratorRequest {
GetNext { responder: CompositeNodeSpecIteratorGetNextResponder },
}
impl CompositeNodeSpecIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(CompositeNodeSpecIteratorGetNextResponder)> {
if let CompositeNodeSpecIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CompositeNodeSpecIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct CompositeNodeSpecIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CompositeNodeSpecIteratorControlHandle {
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 CompositeNodeSpecIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CompositeNodeSpecIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<CompositeNodeSpecIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CompositeNodeSpecIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CompositeNodeSpecIteratorGetNextResponder {
type ControlHandle = CompositeNodeSpecIteratorControlHandle;
fn control_handle(&self) -> &CompositeNodeSpecIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CompositeNodeSpecIteratorGetNextResponder {
pub fn send(
self,
mut specs: &[fidl_fuchsia_driver_framework::CompositeInfo],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(specs);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut specs: &[fidl_fuchsia_driver_framework::CompositeInfo],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(specs);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut specs: &[fidl_fuchsia_driver_framework::CompositeInfo],
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CompositeNodeSpecIteratorGetNextResponse>(
(specs,),
self.tx_id,
0x32fd110355479f71,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DriverInfoIteratorMarker;
impl fidl::endpoints::ProtocolMarker for DriverInfoIteratorMarker {
type Proxy = DriverInfoIteratorProxy;
type RequestStream = DriverInfoIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DriverInfoIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DriverInfoIterator";
}
pub trait DriverInfoIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<
Output = Result<Vec<fidl_fuchsia_driver_framework::DriverInfo>, fidl::Error>,
> + Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DriverInfoIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DriverInfoIteratorSynchronousProxy {
type Proxy = DriverInfoIteratorProxy;
type Protocol = DriverInfoIteratorMarker;
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 DriverInfoIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<DriverInfoIteratorMarker 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<DriverInfoIteratorEvent, fidl::Error> {
DriverInfoIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<fidl_fuchsia_driver_framework::DriverInfo>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, DriverInfoIteratorGetNextResponse>(
(),
0x2c394711c6784952,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.drivers)
}
}
#[derive(Debug, Clone)]
pub struct DriverInfoIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DriverInfoIteratorProxy {
type Protocol = DriverInfoIteratorMarker;
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 DriverInfoIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<DriverInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DriverInfoIteratorEventStream {
DriverInfoIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<
Vec<fidl_fuchsia_driver_framework::DriverInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DriverInfoIteratorProxyInterface::r#get_next(self)
}
}
impl DriverInfoIteratorProxyInterface for DriverInfoIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
Vec<fidl_fuchsia_driver_framework::DriverInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<fidl_fuchsia_driver_framework::DriverInfo>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DriverInfoIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c394711c6784952,
>(_buf?)?;
Ok(_response.drivers)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
Vec<fidl_fuchsia_driver_framework::DriverInfo>,
>(
(),
0x2c394711c6784952,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DriverInfoIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DriverInfoIteratorEventStream {}
impl futures::stream::FusedStream for DriverInfoIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DriverInfoIteratorEventStream {
type Item = Result<DriverInfoIteratorEvent, 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(DriverInfoIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DriverInfoIteratorEvent {}
impl DriverInfoIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DriverInfoIteratorEvent, 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:
<DriverInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DriverInfoIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DriverInfoIteratorRequestStream {}
impl futures::stream::FusedStream for DriverInfoIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DriverInfoIteratorRequestStream {
type Protocol = DriverInfoIteratorMarker;
type ControlHandle = DriverInfoIteratorControlHandle;
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 {
DriverInfoIteratorControlHandle { 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 DriverInfoIteratorRequestStream {
type Item = Result<DriverInfoIteratorRequest, 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 DriverInfoIteratorRequestStream 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 {
0x2c394711c6784952 => {
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 = DriverInfoIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(DriverInfoIteratorRequest::GetNext {
responder: DriverInfoIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DriverInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DriverInfoIteratorRequest {
GetNext { responder: DriverInfoIteratorGetNextResponder },
}
impl DriverInfoIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(DriverInfoIteratorGetNextResponder)> {
if let DriverInfoIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DriverInfoIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct DriverInfoIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DriverInfoIteratorControlHandle {
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 DriverInfoIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DriverInfoIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<DriverInfoIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DriverInfoIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DriverInfoIteratorGetNextResponder {
type ControlHandle = DriverInfoIteratorControlHandle;
fn control_handle(&self) -> &DriverInfoIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DriverInfoIteratorGetNextResponder {
pub fn send(
self,
mut drivers: &[fidl_fuchsia_driver_framework::DriverInfo],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(drivers);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut drivers: &[fidl_fuchsia_driver_framework::DriverInfo],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(drivers);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut drivers: &[fidl_fuchsia_driver_framework::DriverInfo],
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DriverInfoIteratorGetNextResponse>(
(drivers,),
self.tx_id,
0x2c394711c6784952,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ManagerMarker;
impl fidl::endpoints::ProtocolMarker for ManagerMarker {
type Proxy = ManagerProxy;
type RequestStream = ManagerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ManagerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.driver.development.Manager";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ManagerMarker {}
pub type ManagerRestartDriverHostsResult = Result<u32, i32>;
pub type ManagerDisableDriverResult = Result<(), i32>;
pub type ManagerEnableDriverResult = Result<(), i32>;
pub type ManagerBindAllUnboundNodesResult = Result<Vec<NodeBindingInfo>, i32>;
pub type ManagerAddTestNodeResult = Result<(), fidl_fuchsia_driver_framework::NodeError>;
pub type ManagerRemoveTestNodeResult = Result<(), i32>;
pub trait ManagerProxyInterface: Send + Sync {
fn r#get_driver_info(
&self,
driver_filter: &[String],
iterator: fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>,
) -> Result<(), fidl::Error>;
fn r#get_composite_node_specs(
&self,
name_filter: Option<&str>,
iterator: fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
) -> Result<(), fidl::Error>;
fn r#get_node_info(
&self,
node_filter: &[String],
iterator: fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>,
exact_match: bool,
) -> Result<(), fidl::Error>;
fn r#get_composite_info(
&self,
iterator: fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>,
) -> Result<(), fidl::Error>;
type RestartDriverHostsResponseFut: std::future::Future<Output = Result<ManagerRestartDriverHostsResult, fidl::Error>>
+ Send;
fn r#restart_driver_hosts(
&self,
driver_url: &str,
rematch_flags: RestartRematchFlags,
) -> Self::RestartDriverHostsResponseFut;
type DisableDriverResponseFut: std::future::Future<Output = Result<ManagerDisableDriverResult, fidl::Error>>
+ Send;
fn r#disable_driver(
&self,
driver_url: &str,
package_hash: Option<&str>,
) -> Self::DisableDriverResponseFut;
type EnableDriverResponseFut: std::future::Future<Output = Result<ManagerEnableDriverResult, fidl::Error>>
+ Send;
fn r#enable_driver(
&self,
driver_url: &str,
package_hash: Option<&str>,
) -> Self::EnableDriverResponseFut;
type BindAllUnboundNodesResponseFut: std::future::Future<Output = Result<ManagerBindAllUnboundNodesResult, fidl::Error>>
+ Send;
fn r#bind_all_unbound_nodes(&self) -> Self::BindAllUnboundNodesResponseFut;
type AddTestNodeResponseFut: std::future::Future<Output = Result<ManagerAddTestNodeResult, fidl::Error>>
+ Send;
fn r#add_test_node(&self, args: &TestNodeAddArgs) -> Self::AddTestNodeResponseFut;
type RemoveTestNodeResponseFut: std::future::Future<Output = Result<ManagerRemoveTestNodeResult, fidl::Error>>
+ Send;
fn r#remove_test_node(&self, name: &str) -> Self::RemoveTestNodeResponseFut;
type WaitForBootupResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#wait_for_bootup(&self) -> Self::WaitForBootupResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ManagerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ManagerSynchronousProxy {
type Proxy = ManagerProxy;
type Protocol = ManagerMarker;
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 ManagerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ManagerMarker 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<ManagerEvent, fidl::Error> {
ManagerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_driver_info(
&self,
mut driver_filter: &[String],
mut iterator: fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ManagerGetDriverInfoRequest>(
(driver_filter, iterator),
0x34b1541e24e5d587,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
pub fn r#get_composite_node_specs(
&self,
mut name_filter: Option<&str>,
mut iterator: fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ManagerGetCompositeNodeSpecsRequest>(
(name_filter, iterator),
0x258540c7ff37328f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
pub fn r#get_node_info(
&self,
mut node_filter: &[String],
mut iterator: fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>,
mut exact_match: bool,
) -> Result<(), fidl::Error> {
self.client.send::<ManagerGetNodeInfoRequest>(
(node_filter, iterator, exact_match),
0x7c272c6b7bcb4f9e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
pub fn r#get_composite_info(
&self,
mut iterator: fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ManagerGetCompositeInfoRequest>(
(iterator,),
0x4456da4372a49a36,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
pub fn r#restart_driver_hosts(
&self,
mut driver_url: &str,
mut rematch_flags: RestartRematchFlags,
___deadline: zx::MonotonicInstant,
) -> Result<ManagerRestartDriverHostsResult, fidl::Error> {
let _response = self.client.send_query::<
ManagerRestartDriverHostsRequest,
fidl::encoding::FlexibleResultType<ManagerRestartDriverHostsResponse, i32>,
>(
(driver_url, rematch_flags,),
0x64fb09a17a4dd8c7,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<ManagerMarker>("restart_driver_hosts")?;
Ok(_response.map(|x| x.count))
}
pub fn r#disable_driver(
&self,
mut driver_url: &str,
mut package_hash: Option<&str>,
___deadline: zx::MonotonicInstant,
) -> Result<ManagerDisableDriverResult, fidl::Error> {
let _response = self.client.send_query::<
ManagerDisableDriverRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
>(
(driver_url, package_hash,),
0x3cabde92ba1ac967,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<ManagerMarker>("disable_driver")?;
Ok(_response.map(|x| x))
}
pub fn r#enable_driver(
&self,
mut driver_url: &str,
mut package_hash: Option<&str>,
___deadline: zx::MonotonicInstant,
) -> Result<ManagerEnableDriverResult, fidl::Error> {
let _response = self.client.send_query::<
ManagerEnableDriverRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
>(
(driver_url, package_hash,),
0x76a7518712965faf,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<ManagerMarker>("enable_driver")?;
Ok(_response.map(|x| x))
}
pub fn r#bind_all_unbound_nodes(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ManagerBindAllUnboundNodesResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleResultType<ManagerBindAllUnboundNodesResponse, i32>,
>(
(),
0x2b4343fe1cfb9f21,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<ManagerMarker>("bind_all_unbound_nodes")?;
Ok(_response.map(|x| x.binding_result))
}
pub fn r#add_test_node(
&self,
mut args: &TestNodeAddArgs,
___deadline: zx::MonotonicInstant,
) -> Result<ManagerAddTestNodeResult, fidl::Error> {
let _response = self
.client
.send_query::<ManagerAddTestNodeRequest, fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_driver_framework::NodeError,
>>(
(args,), 0x774836bbb7fbc5b9, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
)?
.into_result::<ManagerMarker>("add_test_node")?;
Ok(_response.map(|x| x))
}
pub fn r#remove_test_node(
&self,
mut name: &str,
___deadline: zx::MonotonicInstant,
) -> Result<ManagerRemoveTestNodeResult, fidl::Error> {
let _response = self.client.send_query::<
ManagerRemoveTestNodeRequest,
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
>(
(name,),
0x1618ec4e5fc4010e,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<ManagerMarker>("remove_test_node")?;
Ok(_response.map(|x| x))
}
pub fn r#wait_for_bootup(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x52077de068225cdc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct ManagerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ManagerProxy {
type Protocol = ManagerMarker;
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 ManagerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ManagerEventStream {
ManagerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_driver_info(
&self,
mut driver_filter: &[String],
mut iterator: fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>,
) -> Result<(), fidl::Error> {
ManagerProxyInterface::r#get_driver_info(self, driver_filter, iterator)
}
pub fn r#get_composite_node_specs(
&self,
mut name_filter: Option<&str>,
mut iterator: fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
) -> Result<(), fidl::Error> {
ManagerProxyInterface::r#get_composite_node_specs(self, name_filter, iterator)
}
pub fn r#get_node_info(
&self,
mut node_filter: &[String],
mut iterator: fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>,
mut exact_match: bool,
) -> Result<(), fidl::Error> {
ManagerProxyInterface::r#get_node_info(self, node_filter, iterator, exact_match)
}
pub fn r#get_composite_info(
&self,
mut iterator: fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>,
) -> Result<(), fidl::Error> {
ManagerProxyInterface::r#get_composite_info(self, iterator)
}
pub fn r#restart_driver_hosts(
&self,
mut driver_url: &str,
mut rematch_flags: RestartRematchFlags,
) -> fidl::client::QueryResponseFut<
ManagerRestartDriverHostsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ManagerProxyInterface::r#restart_driver_hosts(self, driver_url, rematch_flags)
}
pub fn r#disable_driver(
&self,
mut driver_url: &str,
mut package_hash: Option<&str>,
) -> fidl::client::QueryResponseFut<
ManagerDisableDriverResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ManagerProxyInterface::r#disable_driver(self, driver_url, package_hash)
}
pub fn r#enable_driver(
&self,
mut driver_url: &str,
mut package_hash: Option<&str>,
) -> fidl::client::QueryResponseFut<
ManagerEnableDriverResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ManagerProxyInterface::r#enable_driver(self, driver_url, package_hash)
}
pub fn r#bind_all_unbound_nodes(
&self,
) -> fidl::client::QueryResponseFut<
ManagerBindAllUnboundNodesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ManagerProxyInterface::r#bind_all_unbound_nodes(self)
}
pub fn r#add_test_node(
&self,
mut args: &TestNodeAddArgs,
) -> fidl::client::QueryResponseFut<
ManagerAddTestNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ManagerProxyInterface::r#add_test_node(self, args)
}
pub fn r#remove_test_node(
&self,
mut name: &str,
) -> fidl::client::QueryResponseFut<
ManagerRemoveTestNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ManagerProxyInterface::r#remove_test_node(self, name)
}
pub fn r#wait_for_bootup(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
ManagerProxyInterface::r#wait_for_bootup(self)
}
}
impl ManagerProxyInterface for ManagerProxy {
fn r#get_driver_info(
&self,
mut driver_filter: &[String],
mut iterator: fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ManagerGetDriverInfoRequest>(
(driver_filter, iterator),
0x34b1541e24e5d587,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
fn r#get_composite_node_specs(
&self,
mut name_filter: Option<&str>,
mut iterator: fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ManagerGetCompositeNodeSpecsRequest>(
(name_filter, iterator),
0x258540c7ff37328f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
fn r#get_node_info(
&self,
mut node_filter: &[String],
mut iterator: fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>,
mut exact_match: bool,
) -> Result<(), fidl::Error> {
self.client.send::<ManagerGetNodeInfoRequest>(
(node_filter, iterator, exact_match),
0x7c272c6b7bcb4f9e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
fn r#get_composite_info(
&self,
mut iterator: fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ManagerGetCompositeInfoRequest>(
(iterator,),
0x4456da4372a49a36,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
type RestartDriverHostsResponseFut = fidl::client::QueryResponseFut<
ManagerRestartDriverHostsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#restart_driver_hosts(
&self,
mut driver_url: &str,
mut rematch_flags: RestartRematchFlags,
) -> Self::RestartDriverHostsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ManagerRestartDriverHostsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<ManagerRestartDriverHostsResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x64fb09a17a4dd8c7,
>(_buf?)?
.into_result::<ManagerMarker>("restart_driver_hosts")?;
Ok(_response.map(|x| x.count))
}
self.client.send_query_and_decode::<
ManagerRestartDriverHostsRequest,
ManagerRestartDriverHostsResult,
>(
(driver_url, rematch_flags,),
0x64fb09a17a4dd8c7,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type DisableDriverResponseFut = fidl::client::QueryResponseFut<
ManagerDisableDriverResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#disable_driver(
&self,
mut driver_url: &str,
mut package_hash: Option<&str>,
) -> Self::DisableDriverResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ManagerDisableDriverResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3cabde92ba1ac967,
>(_buf?)?
.into_result::<ManagerMarker>("disable_driver")?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<ManagerDisableDriverRequest, ManagerDisableDriverResult>(
(driver_url, package_hash),
0x3cabde92ba1ac967,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type EnableDriverResponseFut = fidl::client::QueryResponseFut<
ManagerEnableDriverResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#enable_driver(
&self,
mut driver_url: &str,
mut package_hash: Option<&str>,
) -> Self::EnableDriverResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ManagerEnableDriverResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x76a7518712965faf,
>(_buf?)?
.into_result::<ManagerMarker>("enable_driver")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<ManagerEnableDriverRequest, ManagerEnableDriverResult>(
(driver_url, package_hash),
0x76a7518712965faf,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type BindAllUnboundNodesResponseFut = fidl::client::QueryResponseFut<
ManagerBindAllUnboundNodesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#bind_all_unbound_nodes(&self) -> Self::BindAllUnboundNodesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ManagerBindAllUnboundNodesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<ManagerBindAllUnboundNodesResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2b4343fe1cfb9f21,
>(_buf?)?
.into_result::<ManagerMarker>("bind_all_unbound_nodes")?;
Ok(_response.map(|x| x.binding_result))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
ManagerBindAllUnboundNodesResult,
>(
(),
0x2b4343fe1cfb9f21,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type AddTestNodeResponseFut = fidl::client::QueryResponseFut<
ManagerAddTestNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#add_test_node(&self, mut args: &TestNodeAddArgs) -> Self::AddTestNodeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ManagerAddTestNodeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_driver_framework::NodeError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x774836bbb7fbc5b9,
>(_buf?)?
.into_result::<ManagerMarker>("add_test_node")?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<ManagerAddTestNodeRequest, ManagerAddTestNodeResult>(
(args,),
0x774836bbb7fbc5b9,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type RemoveTestNodeResponseFut = fidl::client::QueryResponseFut<
ManagerRemoveTestNodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#remove_test_node(&self, mut name: &str) -> Self::RemoveTestNodeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ManagerRemoveTestNodeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1618ec4e5fc4010e,
>(_buf?)?
.into_result::<ManagerMarker>("remove_test_node")?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<ManagerRemoveTestNodeRequest, ManagerRemoveTestNodeResult>(
(name,),
0x1618ec4e5fc4010e,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type WaitForBootupResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#wait_for_bootup(&self) -> Self::WaitForBootupResponseFut {
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,
0x52077de068225cdc,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x52077de068225cdc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ManagerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ManagerEventStream {}
impl futures::stream::FusedStream for ManagerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ManagerEventStream {
type Item = Result<ManagerEvent, 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(ManagerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ManagerEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl ManagerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ManagerEvent, 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 {
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(ManagerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ManagerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ManagerRequestStream {}
impl futures::stream::FusedStream for ManagerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ManagerRequestStream {
type Protocol = ManagerMarker;
type ControlHandle = ManagerControlHandle;
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 {
ManagerControlHandle { 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 ManagerRequestStream {
type Item = Result<ManagerRequest, 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 ManagerRequestStream 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 {
0x34b1541e24e5d587 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ManagerGetDriverInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerGetDriverInfoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::GetDriverInfo {
driver_filter: req.driver_filter,
iterator: req.iterator,
control_handle,
})
}
0x258540c7ff37328f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ManagerGetCompositeNodeSpecsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerGetCompositeNodeSpecsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::GetCompositeNodeSpecs {
name_filter: req.name_filter,
iterator: req.iterator,
control_handle,
})
}
0x7c272c6b7bcb4f9e => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ManagerGetNodeInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerGetNodeInfoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::GetNodeInfo {
node_filter: req.node_filter,
iterator: req.iterator,
exact_match: req.exact_match,
control_handle,
})
}
0x4456da4372a49a36 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ManagerGetCompositeInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerGetCompositeInfoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::GetCompositeInfo {
iterator: req.iterator,
control_handle,
})
}
0x64fb09a17a4dd8c7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ManagerRestartDriverHostsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerRestartDriverHostsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::RestartDriverHosts {
driver_url: req.driver_url,
rematch_flags: req.rematch_flags,
responder: ManagerRestartDriverHostsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3cabde92ba1ac967 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ManagerDisableDriverRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerDisableDriverRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::DisableDriver {
driver_url: req.driver_url,
package_hash: req.package_hash,
responder: ManagerDisableDriverResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x76a7518712965faf => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ManagerEnableDriverRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerEnableDriverRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::EnableDriver {
driver_url: req.driver_url,
package_hash: req.package_hash,
responder: ManagerEnableDriverResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2b4343fe1cfb9f21 => {
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 = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::BindAllUnboundNodes {
responder: ManagerBindAllUnboundNodesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x774836bbb7fbc5b9 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ManagerAddTestNodeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerAddTestNodeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::AddTestNode {
args: req.args,
responder: ManagerAddTestNodeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1618ec4e5fc4010e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ManagerRemoveTestNodeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerRemoveTestNodeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::RemoveTestNode {
name: req.name,
responder: ManagerRemoveTestNodeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x52077de068225cdc => {
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 = ManagerControlHandle { inner: this.inner.clone() };
Ok(ManagerRequest::WaitForBootup {
responder: ManagerWaitForBootupResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(ManagerRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: ManagerControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(ManagerRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: ManagerControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ManagerRequest {
GetDriverInfo {
driver_filter: Vec<String>,
iterator: fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>,
control_handle: ManagerControlHandle,
},
GetCompositeNodeSpecs {
name_filter: Option<String>,
iterator: fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
control_handle: ManagerControlHandle,
},
GetNodeInfo {
node_filter: Vec<String>,
iterator: fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>,
exact_match: bool,
control_handle: ManagerControlHandle,
},
GetCompositeInfo {
iterator: fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>,
control_handle: ManagerControlHandle,
},
RestartDriverHosts {
driver_url: String,
rematch_flags: RestartRematchFlags,
responder: ManagerRestartDriverHostsResponder,
},
DisableDriver {
driver_url: String,
package_hash: Option<String>,
responder: ManagerDisableDriverResponder,
},
EnableDriver {
driver_url: String,
package_hash: Option<String>,
responder: ManagerEnableDriverResponder,
},
BindAllUnboundNodes { responder: ManagerBindAllUnboundNodesResponder },
AddTestNode { args: TestNodeAddArgs, responder: ManagerAddTestNodeResponder },
RemoveTestNode { name: String, responder: ManagerRemoveTestNodeResponder },
WaitForBootup { responder: ManagerWaitForBootupResponder },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: ManagerControlHandle,
method_type: fidl::MethodType,
},
}
impl ManagerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_driver_info(
self,
) -> Option<(
Vec<String>,
fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>,
ManagerControlHandle,
)> {
if let ManagerRequest::GetDriverInfo { driver_filter, iterator, control_handle } = self {
Some((driver_filter, iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_composite_node_specs(
self,
) -> Option<(
Option<String>,
fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
ManagerControlHandle,
)> {
if let ManagerRequest::GetCompositeNodeSpecs { name_filter, iterator, control_handle } =
self
{
Some((name_filter, iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_node_info(
self,
) -> Option<(
Vec<String>,
fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>,
bool,
ManagerControlHandle,
)> {
if let ManagerRequest::GetNodeInfo { node_filter, iterator, exact_match, control_handle } =
self
{
Some((node_filter, iterator, exact_match, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_composite_info(
self,
) -> Option<(fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>, ManagerControlHandle)>
{
if let ManagerRequest::GetCompositeInfo { iterator, control_handle } = self {
Some((iterator, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_restart_driver_hosts(
self,
) -> Option<(String, RestartRematchFlags, ManagerRestartDriverHostsResponder)> {
if let ManagerRequest::RestartDriverHosts { driver_url, rematch_flags, responder } = self {
Some((driver_url, rematch_flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_disable_driver(
self,
) -> Option<(String, Option<String>, ManagerDisableDriverResponder)> {
if let ManagerRequest::DisableDriver { driver_url, package_hash, responder } = self {
Some((driver_url, package_hash, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_enable_driver(
self,
) -> Option<(String, Option<String>, ManagerEnableDriverResponder)> {
if let ManagerRequest::EnableDriver { driver_url, package_hash, responder } = self {
Some((driver_url, package_hash, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_bind_all_unbound_nodes(self) -> Option<(ManagerBindAllUnboundNodesResponder)> {
if let ManagerRequest::BindAllUnboundNodes { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_add_test_node(self) -> Option<(TestNodeAddArgs, ManagerAddTestNodeResponder)> {
if let ManagerRequest::AddTestNode { args, responder } = self {
Some((args, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove_test_node(self) -> Option<(String, ManagerRemoveTestNodeResponder)> {
if let ManagerRequest::RemoveTestNode { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wait_for_bootup(self) -> Option<(ManagerWaitForBootupResponder)> {
if let ManagerRequest::WaitForBootup { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ManagerRequest::GetDriverInfo { .. } => "get_driver_info",
ManagerRequest::GetCompositeNodeSpecs { .. } => "get_composite_node_specs",
ManagerRequest::GetNodeInfo { .. } => "get_node_info",
ManagerRequest::GetCompositeInfo { .. } => "get_composite_info",
ManagerRequest::RestartDriverHosts { .. } => "restart_driver_hosts",
ManagerRequest::DisableDriver { .. } => "disable_driver",
ManagerRequest::EnableDriver { .. } => "enable_driver",
ManagerRequest::BindAllUnboundNodes { .. } => "bind_all_unbound_nodes",
ManagerRequest::AddTestNode { .. } => "add_test_node",
ManagerRequest::RemoveTestNode { .. } => "remove_test_node",
ManagerRequest::WaitForBootup { .. } => "wait_for_bootup",
ManagerRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
ManagerRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct ManagerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ManagerControlHandle {
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 ManagerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerRestartDriverHostsResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerRestartDriverHostsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerRestartDriverHostsResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerRestartDriverHostsResponder {
pub fn send(self, mut result: Result<u32, i32>) -> 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: Result<u32, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u32, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
ManagerRestartDriverHostsResponse,
i32,
>>(
fidl::encoding::FlexibleResult::new(result.map(|count| (count,))),
self.tx_id,
0x64fb09a17a4dd8c7,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerDisableDriverResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerDisableDriverResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerDisableDriverResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerDisableDriverResponder {
pub fn send(self, mut result: Result<(), i32>) -> 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: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
i32,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x3cabde92ba1ac967,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerEnableDriverResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerEnableDriverResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerEnableDriverResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerEnableDriverResponder {
pub fn send(self, mut result: Result<(), i32>) -> 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: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
i32,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x76a7518712965faf,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerBindAllUnboundNodesResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerBindAllUnboundNodesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerBindAllUnboundNodesResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerBindAllUnboundNodesResponder {
pub fn send(self, mut result: Result<&[NodeBindingInfo], i32>) -> 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: Result<&[NodeBindingInfo], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[NodeBindingInfo], i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
ManagerBindAllUnboundNodesResponse,
i32,
>>(
fidl::encoding::FlexibleResult::new(result.map(|binding_result| (binding_result,))),
self.tx_id,
0x2b4343fe1cfb9f21,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerAddTestNodeResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerAddTestNodeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerAddTestNodeResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerAddTestNodeResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_driver_framework::NodeError>,
) -> 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: Result<(), fidl_fuchsia_driver_framework::NodeError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_driver_framework::NodeError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_driver_framework::NodeError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x774836bbb7fbc5b9,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerRemoveTestNodeResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerRemoveTestNodeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerRemoveTestNodeResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerRemoveTestNodeResponder {
pub fn send(self, mut result: Result<(), i32>) -> 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: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
i32,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x1618ec4e5fc4010e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ManagerWaitForBootupResponder {
control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ManagerWaitForBootupResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ManagerWaitForBootupResponder {
type ControlHandle = ManagerControlHandle;
fn control_handle(&self) -> &ManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ManagerWaitForBootupResponder {
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,
0x52077de068225cdc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct NodeInfoIteratorMarker;
impl fidl::endpoints::ProtocolMarker for NodeInfoIteratorMarker {
type Proxy = NodeInfoIteratorProxy;
type RequestStream = NodeInfoIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = NodeInfoIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) NodeInfoIterator";
}
pub trait NodeInfoIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<Vec<NodeInfo>, fidl::Error>> + Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct NodeInfoIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for NodeInfoIteratorSynchronousProxy {
type Proxy = NodeInfoIteratorProxy;
type Protocol = NodeInfoIteratorMarker;
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 NodeInfoIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <NodeInfoIteratorMarker 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<NodeInfoIteratorEvent, fidl::Error> {
NodeInfoIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<NodeInfo>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, NodeInfoIteratorGetNextResponse>(
(),
0x33c7c070412f889f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.nodes)
}
}
#[derive(Debug, Clone)]
pub struct NodeInfoIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for NodeInfoIteratorProxy {
type Protocol = NodeInfoIteratorMarker;
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 NodeInfoIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <NodeInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> NodeInfoIteratorEventStream {
NodeInfoIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<Vec<NodeInfo>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
NodeInfoIteratorProxyInterface::r#get_next(self)
}
}
impl NodeInfoIteratorProxyInterface for NodeInfoIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
Vec<NodeInfo>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<NodeInfo>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
NodeInfoIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x33c7c070412f889f,
>(_buf?)?;
Ok(_response.nodes)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<NodeInfo>>(
(),
0x33c7c070412f889f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct NodeInfoIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for NodeInfoIteratorEventStream {}
impl futures::stream::FusedStream for NodeInfoIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for NodeInfoIteratorEventStream {
type Item = Result<NodeInfoIteratorEvent, 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(NodeInfoIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum NodeInfoIteratorEvent {}
impl NodeInfoIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<NodeInfoIteratorEvent, 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:
<NodeInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct NodeInfoIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for NodeInfoIteratorRequestStream {}
impl futures::stream::FusedStream for NodeInfoIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for NodeInfoIteratorRequestStream {
type Protocol = NodeInfoIteratorMarker;
type ControlHandle = NodeInfoIteratorControlHandle;
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 {
NodeInfoIteratorControlHandle { 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 NodeInfoIteratorRequestStream {
type Item = Result<NodeInfoIteratorRequest, 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 NodeInfoIteratorRequestStream 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 {
0x33c7c070412f889f => {
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 =
NodeInfoIteratorControlHandle { inner: this.inner.clone() };
Ok(NodeInfoIteratorRequest::GetNext {
responder: NodeInfoIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<NodeInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum NodeInfoIteratorRequest {
GetNext { responder: NodeInfoIteratorGetNextResponder },
}
impl NodeInfoIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(NodeInfoIteratorGetNextResponder)> {
if let NodeInfoIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
NodeInfoIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct NodeInfoIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for NodeInfoIteratorControlHandle {
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 NodeInfoIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct NodeInfoIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<NodeInfoIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for NodeInfoIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for NodeInfoIteratorGetNextResponder {
type ControlHandle = NodeInfoIteratorControlHandle;
fn control_handle(&self) -> &NodeInfoIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl NodeInfoIteratorGetNextResponder {
pub fn send(self, mut nodes: &[NodeInfo]) -> Result<(), fidl::Error> {
let _result = self.send_raw(nodes);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut nodes: &[NodeInfo]) -> Result<(), fidl::Error> {
let _result = self.send_raw(nodes);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut nodes: &[NodeInfo]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<NodeInfoIteratorGetNextResponse>(
(nodes,),
self.tx_id,
0x33c7c070412f889f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for RestartRematchFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for RestartRematchFlags {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for RestartRematchFlags
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RestartRematchFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[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 prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits_allow_unknown(prim);
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CompositeInfoIteratorGetNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeInfoIteratorGetNextResponse {
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<CompositeInfoIteratorGetNextResponse, D>
for &CompositeInfoIteratorGetNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeInfoIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<CompositeInfoIteratorGetNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<CompositeNodeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.composites),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<CompositeNodeInfo>, D>,
> fidl::encoding::Encode<CompositeInfoIteratorGetNextResponse, 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::<CompositeInfoIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CompositeInfoIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
composites: fidl::new_empty!(fidl::encoding::UnboundedVector<CompositeNodeInfo>, 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<CompositeNodeInfo>,
D,
&mut self.composites,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CompositeNodeSpecIteratorGetNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeNodeSpecIteratorGetNextResponse {
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<CompositeNodeSpecIteratorGetNextResponse, D>
for &CompositeNodeSpecIteratorGetNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeNodeSpecIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<CompositeNodeSpecIteratorGetNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.specs),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeInfo>,
D,
>,
> fidl::encoding::Encode<CompositeNodeSpecIteratorGetNextResponse, 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::<CompositeNodeSpecIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CompositeNodeSpecIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
specs: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeInfo>,
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_fuchsia_driver_framework::CompositeInfo>,
D,
&mut self.specs,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DriverInfoIteratorGetNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DriverInfoIteratorGetNextResponse {
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<DriverInfoIteratorGetNextResponse, D>
for &DriverInfoIteratorGetNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DriverInfoIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<DriverInfoIteratorGetNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::DriverInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.drivers),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::DriverInfo>,
D,
>,
> fidl::encoding::Encode<DriverInfoIteratorGetNextResponse, 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::<DriverInfoIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DriverInfoIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
drivers: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::DriverInfo>,
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_fuchsia_driver_framework::DriverInfo>,
D,
&mut self.drivers,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ManagerAddTestNodeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ManagerAddTestNodeRequest {
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<ManagerAddTestNodeRequest, D> for &ManagerAddTestNodeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerAddTestNodeRequest>(offset);
fidl::encoding::Encode::<ManagerAddTestNodeRequest, D>::encode(
(<TestNodeAddArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TestNodeAddArgs, D>>
fidl::encoding::Encode<ManagerAddTestNodeRequest, 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::<ManagerAddTestNodeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ManagerAddTestNodeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { args: fidl::new_empty!(TestNodeAddArgs, 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!(TestNodeAddArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ManagerDisableDriverRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ManagerDisableDriverRequest {
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<ManagerDisableDriverRequest, D> for &ManagerDisableDriverRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerDisableDriverRequest>(offset);
fidl::encoding::Encode::<ManagerDisableDriverRequest, D>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.driver_url),
<fidl::encoding::Optional<fidl::encoding::BoundedString<64>> as fidl::encoding::ValueTypeMarker>::borrow(&self.package_hash),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<64>>, D>,
> fidl::encoding::Encode<ManagerDisableDriverRequest, 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::<ManagerDisableDriverRequest>(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 ManagerDisableDriverRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
driver_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
package_hash: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::BoundedString<64>>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.driver_url,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::BoundedString<64>>,
D,
&mut self.package_hash,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ManagerEnableDriverRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ManagerEnableDriverRequest {
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<ManagerEnableDriverRequest, D> for &ManagerEnableDriverRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerEnableDriverRequest>(offset);
fidl::encoding::Encode::<ManagerEnableDriverRequest, D>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.driver_url),
<fidl::encoding::Optional<fidl::encoding::BoundedString<64>> as fidl::encoding::ValueTypeMarker>::borrow(&self.package_hash),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<64>>, D>,
> fidl::encoding::Encode<ManagerEnableDriverRequest, 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::<ManagerEnableDriverRequest>(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 ManagerEnableDriverRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
driver_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
package_hash: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::BoundedString<64>>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<4096>,
D,
&mut self.driver_url,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::BoundedString<64>>,
D,
&mut self.package_hash,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ManagerGetCompositeInfoRequest {
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 ManagerGetCompositeInfoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
ManagerGetCompositeInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ManagerGetCompositeInfoRequest
{
#[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::<ManagerGetCompositeInfoRequest>(offset);
fidl::encoding::Encode::<
ManagerGetCompositeInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.iterator
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ManagerGetCompositeInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerGetCompositeInfoRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerGetCompositeInfoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ManagerGetCompositeNodeSpecsRequest {
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 ManagerGetCompositeNodeSpecsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
ManagerGetCompositeNodeSpecsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ManagerGetCompositeNodeSpecsRequest
{
#[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::<ManagerGetCompositeNodeSpecsRequest>(offset);
fidl::encoding::Encode::<ManagerGetCompositeNodeSpecsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.name_filter),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ManagerGetCompositeNodeSpecsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerGetCompositeNodeSpecsRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerGetCompositeNodeSpecsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
name_filter: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.name_filter,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<CompositeNodeSpecIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ManagerGetDriverInfoRequest {
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 ManagerGetDriverInfoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
ManagerGetDriverInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ManagerGetDriverInfoRequest
{
#[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::<ManagerGetDriverInfoRequest>(offset);
fidl::encoding::Encode::<ManagerGetDriverInfoRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.driver_filter),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ManagerGetDriverInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerGetDriverInfoRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerGetDriverInfoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
driver_filter: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.driver_filter,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DriverInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ManagerGetNodeInfoRequest {
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 ManagerGetNodeInfoRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
ManagerGetNodeInfoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ManagerGetNodeInfoRequest
{
#[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::<ManagerGetNodeInfoRequest>(offset);
fidl::encoding::Encode::<ManagerGetNodeInfoRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.node_filter),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.exact_match),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
ManagerGetNodeInfoRequest,
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::<ManagerGetNodeInfoRequest>(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 + 20, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ManagerGetNodeInfoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
node_filter: fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
iterator: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
exact_match: fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffff0000000000u64;
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::UnboundedVector<fidl::encoding::UnboundedString>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.node_filter,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NodeInfoIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.iterator,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(
bool,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.exact_match,
decoder,
offset + 20,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ManagerRemoveTestNodeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ManagerRemoveTestNodeRequest {
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<ManagerRemoveTestNodeRequest, D> for &ManagerRemoveTestNodeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerRemoveTestNodeRequest>(offset);
fidl::encoding::Encode::<ManagerRemoveTestNodeRequest, D>::encode(
(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
> fidl::encoding::Encode<ManagerRemoveTestNodeRequest, 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::<ManagerRemoveTestNodeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ManagerRemoveTestNodeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { name: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<1024>,
D,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ManagerRestartDriverHostsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ManagerRestartDriverHostsRequest {
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<ManagerRestartDriverHostsRequest, D>
for &ManagerRestartDriverHostsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerRestartDriverHostsRequest>(offset);
fidl::encoding::Encode::<ManagerRestartDriverHostsRequest, D>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.driver_url),
<RestartRematchFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.rematch_flags),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T1: fidl::encoding::Encode<RestartRematchFlags, D>,
> fidl::encoding::Encode<ManagerRestartDriverHostsRequest, 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::<ManagerRestartDriverHostsRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ManagerRestartDriverHostsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
driver_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
rematch_flags: fidl::new_empty!(RestartRematchFlags, 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::BoundedString<4096>,
D,
&mut self.driver_url,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
RestartRematchFlags,
D,
&mut self.rematch_flags,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ManagerBindAllUnboundNodesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ManagerBindAllUnboundNodesResponse {
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<ManagerBindAllUnboundNodesResponse, D>
for &ManagerBindAllUnboundNodesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerBindAllUnboundNodesResponse>(offset);
fidl::encoding::Encode::<ManagerBindAllUnboundNodesResponse, D>::encode(
(
<fidl::encoding::Vector<NodeBindingInfo, 10> as fidl::encoding::ValueTypeMarker>::borrow(&self.binding_result),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<NodeBindingInfo, 10>, D>,
> fidl::encoding::Encode<ManagerBindAllUnboundNodesResponse, 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::<ManagerBindAllUnboundNodesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ManagerBindAllUnboundNodesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
binding_result: fidl::new_empty!(fidl::encoding::Vector<NodeBindingInfo, 10>, 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::Vector<NodeBindingInfo, 10>, D, &mut self.binding_result, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ManagerRestartDriverHostsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ManagerRestartDriverHostsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ManagerRestartDriverHostsResponse, D>
for &ManagerRestartDriverHostsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ManagerRestartDriverHostsResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ManagerRestartDriverHostsResponse)
.write_unaligned((self as *const ManagerRestartDriverHostsResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<ManagerRestartDriverHostsResponse, 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::<ManagerRestartDriverHostsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ManagerRestartDriverHostsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { count: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for NodeInfoIteratorGetNextResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeInfoIteratorGetNextResponse {
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<NodeInfoIteratorGetNextResponse, D>
for &NodeInfoIteratorGetNextResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeInfoIteratorGetNextResponse>(offset);
fidl::encoding::Encode::<NodeInfoIteratorGetNextResponse, D>::encode(
(
<fidl::encoding::UnboundedVector<NodeInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.nodes),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<NodeInfo>, D>,
> fidl::encoding::Encode<NodeInfoIteratorGetNextResponse, 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::<NodeInfoIteratorGetNextResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for NodeInfoIteratorGetNextResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { nodes: fidl::new_empty!(fidl::encoding::UnboundedVector<NodeInfo>, 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<NodeInfo>,
D,
&mut self.nodes,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl CompositeNodeInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.composite {
return 3;
}
if let Some(_) = self.topological_path {
return 2;
}
if let Some(_) = self.parent_topological_paths {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for CompositeNodeInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeNodeInfo {
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<CompositeNodeInfo, D>
for &CompositeNodeInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeNodeInfo>(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::<
fidl::encoding::UnboundedVector<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
>,
D,
>(
self.parent_topological_paths.as_ref().map(
<fidl::encoding::UnboundedVector<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
> 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.topological_path.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::<CompositeInfo, D>(
self.composite
.as_ref()
.map(<CompositeInfo 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 CompositeNodeInfo {
#[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 = <fidl::encoding::UnboundedVector<
fidl::encoding::Optional<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.parent_topological_paths.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl::encoding::Optional<fidl::encoding::UnboundedString>,
>,
D
)
});
fidl::decode!(
fidl::encoding::UnboundedVector<
fidl::encoding::Optional<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 < 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
.topological_path
.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 =
<CompositeInfo 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.composite.get_or_insert_with(|| fidl::new_empty!(CompositeInfo, D));
fidl::decode!(CompositeInfo, 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(())
}
}
impl NodeBindingInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.composite_parents {
return 3;
}
if let Some(_) = self.driver_url {
return 2;
}
if let Some(_) = self.node_name {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for NodeBindingInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeBindingInfo {
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<NodeBindingInfo, D>
for &NodeBindingInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeBindingInfo>(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::<fidl::encoding::BoundedString<1024>, D>(
self.node_name.as_ref().map(<fidl::encoding::BoundedString<1024> 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::BoundedString<4096>, D>(
self.driver_url.as_ref().map(<fidl::encoding::BoundedString<4096> 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<fidl_fuchsia_driver_framework::CompositeParent>, D>(
self.composite_parents.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeParent> 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 NodeBindingInfo {
#[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 = <fidl::encoding::BoundedString<1024> 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.node_name.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<1024>,
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::BoundedString<4096> 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.driver_url.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<4096>,
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<
fidl_fuchsia_driver_framework::CompositeParent,
> 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.composite_parents.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::UnboundedVector<
fidl_fuchsia_driver_framework::CompositeParent,
>,
D
)
});
fidl::decode!(
fidl::encoding::UnboundedVector<fidl_fuchsia_driver_framework::CompositeParent>,
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(())
}
}
impl NodeInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.bus_topology {
return 11;
}
if let Some(_) = self.quarantined {
return 10;
}
if let Some(_) = self.offer_list {
return 9;
}
if let Some(_) = self.node_property_list {
return 8;
}
if let Some(_) = self.moniker {
return 7;
}
if let Some(_) = self.bound_driver_url {
return 5;
}
if let Some(_) = self.driver_host_koid {
return 4;
}
if let Some(_) = self.child_ids {
return 3;
}
if let Some(_) = self.parent_ids {
return 2;
}
if let Some(_) = self.id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for NodeInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NodeInfo {
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<NodeInfo, D> for &NodeInfo {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NodeInfo>(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::<u64, D>(
self.id.as_ref().map(<u64 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::UnboundedVector<u64>, D>(
self.parent_ids.as_ref().map(<fidl::encoding::UnboundedVector<u64> 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<u64>, D>(
self.child_ids.as_ref().map(<fidl::encoding::UnboundedVector<u64> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.driver_host_koid
.as_ref()
.map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, D>(
self.bound_driver_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
self.moniker.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D>(
self.node_property_list.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 9 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (9 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>, D>(
self.offer_list.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 10 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (10 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.quarantined.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 11 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (11 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_driver_framework::BusInfo, 20>, D>(
self.bus_topology.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_driver_framework::BusInfo, 20> 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 NodeInfo {
#[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 =
<u64 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.id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, 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::UnboundedVector<u64> 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.parent_ids.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<u64>,
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<u64> 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.child_ids.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<u64>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<u64>,
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 < 4 {
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 =
<u64 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.driver_host_koid.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, 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 < 5 {
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::BoundedString<4096> 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.bound_driver_url.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<4096>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<4096>,
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 < 7 {
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::BoundedString<1024> 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.moniker.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<1024>,
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 < 8 {
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::Vector<
fidl_fuchsia_driver_framework::NodeProperty,
64,
> 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.node_property_list.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D));
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, 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 < 9 {
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<
fidl_fuchsia_component_decl::Offer,
> 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.offer_list.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
D
)
});
fidl::decode!(
fidl::encoding::UnboundedVector<fidl_fuchsia_component_decl::Offer>,
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 < 10 {
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 =
<bool 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.quarantined.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, 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 < 11 {
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::Vector<
fidl_fuchsia_driver_framework::BusInfo,
20,
> 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.bus_topology.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::BusInfo, 20>, D));
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::BusInfo, 20>, 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(())
}
}
impl TestNodeAddArgs {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.properties {
return 2;
}
if let Some(_) = self.name {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for TestNodeAddArgs {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TestNodeAddArgs {
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<TestNodeAddArgs, D>
for &TestNodeAddArgs
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TestNodeAddArgs>(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::<fidl::encoding::BoundedString<1024>, D>(
self.name.as_ref().map(<fidl::encoding::BoundedString<1024> 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::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D>(
self.properties.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64> 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 TestNodeAddArgs {
#[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 = <fidl::encoding::BoundedString<1024> 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.name.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<1024>,
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::Vector<
fidl_fuchsia_driver_framework::NodeProperty,
64,
> 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.properties.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, D));
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_driver_framework::NodeProperty, 64>, 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(())
}
}
impl fidl::encoding::ValueTypeMarker for CompositeInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeInfo {
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<CompositeInfo, D>
for &CompositeInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeInfo>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
CompositeInfo::Composite(ref val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_driver_framework::CompositeInfo, D>(
<fidl_fuchsia_driver_framework::CompositeInfo as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompositeInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::Composite(fidl::new_empty!(fidl_fuchsia_driver_framework::CompositeInfo, D))
}
#[inline]
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);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
2 => <fidl_fuchsia_driver_framework::CompositeInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
2 => {
#[allow(irrefutable_let_patterns)]
if let CompositeInfo::Composite(_) = self {
} else {
*self = CompositeInfo::Composite(fidl::new_empty!(
fidl_fuchsia_driver_framework::CompositeInfo,
D
));
}
#[allow(irrefutable_let_patterns)]
if let CompositeInfo::Composite(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_driver_framework::CompositeInfo,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
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);
}
Ok(())
}
}
}