#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum DiffType {
Full = 0,
Diff = 1,
Both = 2,
}
impl DiffType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Full),
1 => Some(Self::Diff),
2 => Some(Self::Both),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum TestResult {
Ok = 0,
Unimplemented = 1,
Failed = 2,
Illegal = 3,
}
impl TestResult {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Ok),
1 => Some(Self::Unimplemented),
2 => Some(Self::Failed),
3 => Some(Self::Illegal),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CreateBytesProperty {
pub parent: u32,
pub id: u32,
pub name: String,
pub value: Vec<u8>,
}
impl fidl::Persistable for CreateBytesProperty {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CreateNode {
pub parent: u32,
pub id: u32,
pub name: String,
}
impl fidl::Persistable for CreateNode {}
#[derive(Clone, Debug, PartialEq)]
pub struct CreateNumericProperty {
pub parent: u32,
pub id: u32,
pub name: String,
pub value: Value,
}
impl fidl::Persistable for CreateNumericProperty {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeleteNode {
pub id: u32,
}
impl fidl::Persistable for DeleteNode {}
#[derive(Clone, Debug, PartialEq)]
pub struct InspectPuppetActRequest {
pub action: Action,
}
impl fidl::Persistable for InspectPuppetActRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectPuppetActResponse {
pub result: TestResult,
}
impl fidl::Persistable for InspectPuppetActResponse {}
#[derive(Debug, PartialEq)]
pub struct InspectPuppetGetConfigResponse {
pub printable_name: String,
pub options: Options,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetGetConfigResponse
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct InspectPuppetInitializeRequest {
pub params: InitializationParams,
}
impl fidl::Persistable for InspectPuppetInitializeRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectPuppetInitializeResponse {
pub vmo: Option<fidl::Handle>,
pub result: TestResult,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetInitializeResponse
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectPuppetPublishResponse {
pub result: TestResult,
}
impl fidl::Persistable for InspectPuppetPublishResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct InitializationParams {
pub vmo_size: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for InitializationParams {}
#[derive(Debug, Default, PartialEq)]
pub struct Options {
pub has_runner_node: Option<bool>,
pub diff_type: Option<DiffType>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Options {}
#[derive(Clone, Debug)]
pub enum Action {
CreateNode(CreateNode),
DeleteNode(DeleteNode),
CreateNumericProperty(CreateNumericProperty),
CreateBytesProperty(CreateBytesProperty),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! ActionUnknown {
() => {
_
};
}
impl PartialEq for Action {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::CreateNode(x), Self::CreateNode(y)) => *x == *y,
(Self::DeleteNode(x), Self::DeleteNode(y)) => *x == *y,
(Self::CreateNumericProperty(x), Self::CreateNumericProperty(y)) => *x == *y,
(Self::CreateBytesProperty(x), Self::CreateBytesProperty(y)) => *x == *y,
_ => false,
}
}
}
impl Action {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::CreateNode(_) => 1,
Self::DeleteNode(_) => 2,
Self::CreateNumericProperty(_) => 3,
Self::CreateBytesProperty(_) => 4,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for Action {}
#[derive(Clone, Debug)]
pub enum Value {
IntT(i64),
UintT(u64),
DoubleT(f64),
StringT(String),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! ValueUnknown {
() => {
_
};
}
impl PartialEq for Value {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::IntT(x), Self::IntT(y)) => *x == *y,
(Self::UintT(x), Self::UintT(y)) => *x == *y,
(Self::DoubleT(x), Self::DoubleT(y)) => *x == *y,
(Self::StringT(x), Self::StringT(y)) => *x == *y,
_ => false,
}
}
}
impl Value {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::IntT(_) => 1,
Self::UintT(_) => 2,
Self::DoubleT(_) => 3,
Self::StringT(_) => 4,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for Value {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct InspectPuppetMarker;
impl fidl::endpoints::ProtocolMarker for InspectPuppetMarker {
type Proxy = InspectPuppetProxy;
type RequestStream = InspectPuppetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = InspectPuppetSynchronousProxy;
const DEBUG_NAME: &'static str = "diagnostics.validate.deprecated.InspectPuppet";
}
impl fidl::endpoints::DiscoverableProtocolMarker for InspectPuppetMarker {}
pub trait InspectPuppetProxyInterface: Send + Sync {
type InitializeResponseFut: std::future::Future<Output = Result<(Option<fidl::Handle>, TestResult), fidl::Error>>
+ Send;
fn r#initialize(&self, params: &InitializationParams) -> Self::InitializeResponseFut;
type GetConfigResponseFut: std::future::Future<Output = Result<(String, Options), fidl::Error>>
+ Send;
fn r#get_config(&self) -> Self::GetConfigResponseFut;
type PublishResponseFut: std::future::Future<Output = Result<TestResult, fidl::Error>> + Send;
fn r#publish(&self) -> Self::PublishResponseFut;
type ActResponseFut: std::future::Future<Output = Result<TestResult, fidl::Error>> + Send;
fn r#act(&self, action: &Action) -> Self::ActResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct InspectPuppetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for InspectPuppetSynchronousProxy {
type Proxy = InspectPuppetProxy;
type Protocol = InspectPuppetMarker;
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 InspectPuppetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <InspectPuppetMarker 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<InspectPuppetEvent, fidl::Error> {
InspectPuppetEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#initialize(
&self,
mut params: &InitializationParams,
___deadline: zx::MonotonicInstant,
) -> Result<(Option<fidl::Handle>, TestResult), fidl::Error> {
let _response = self
.client
.send_query::<InspectPuppetInitializeRequest, InspectPuppetInitializeResponse>(
(params,),
0x48fbff796c4186cb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.vmo, _response.result))
}
pub fn r#get_config(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(String, Options), fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, InspectPuppetGetConfigResponse>(
(),
0x4cf4dcbd7aa20a0d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.printable_name, _response.options))
}
pub fn r#publish(&self, ___deadline: zx::MonotonicInstant) -> Result<TestResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, InspectPuppetPublishResponse>(
(),
0x31e9bddcb93a4985,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.result)
}
pub fn r#act(
&self,
mut action: &Action,
___deadline: zx::MonotonicInstant,
) -> Result<TestResult, fidl::Error> {
let _response =
self.client.send_query::<InspectPuppetActRequest, InspectPuppetActResponse>(
(action,),
0x6ce177c6016605e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.result)
}
}
#[derive(Debug, Clone)]
pub struct InspectPuppetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for InspectPuppetProxy {
type Protocol = InspectPuppetMarker;
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 InspectPuppetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> InspectPuppetEventStream {
InspectPuppetEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#initialize(
&self,
mut params: &InitializationParams,
) -> fidl::client::QueryResponseFut<
(Option<fidl::Handle>, TestResult),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
InspectPuppetProxyInterface::r#initialize(self, params)
}
pub fn r#get_config(
&self,
) -> fidl::client::QueryResponseFut<
(String, Options),
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
InspectPuppetProxyInterface::r#get_config(self)
}
pub fn r#publish(
&self,
) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
InspectPuppetProxyInterface::r#publish(self)
}
pub fn r#act(
&self,
mut action: &Action,
) -> fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>
{
InspectPuppetProxyInterface::r#act(self, action)
}
}
impl InspectPuppetProxyInterface for InspectPuppetProxy {
type InitializeResponseFut = fidl::client::QueryResponseFut<
(Option<fidl::Handle>, TestResult),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#initialize(&self, mut params: &InitializationParams) -> Self::InitializeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(Option<fidl::Handle>, TestResult), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
InspectPuppetInitializeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x48fbff796c4186cb,
>(_buf?)?;
Ok((_response.vmo, _response.result))
}
self.client.send_query_and_decode::<
InspectPuppetInitializeRequest,
(Option<fidl::Handle>, TestResult),
>(
(params,),
0x48fbff796c4186cb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetConfigResponseFut = fidl::client::QueryResponseFut<
(String, Options),
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_config(&self) -> Self::GetConfigResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(String, Options), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
InspectPuppetGetConfigResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4cf4dcbd7aa20a0d,
>(_buf?)?;
Ok((_response.printable_name, _response.options))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (String, Options)>(
(),
0x4cf4dcbd7aa20a0d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type PublishResponseFut =
fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#publish(&self) -> Self::PublishResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TestResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
InspectPuppetPublishResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x31e9bddcb93a4985,
>(_buf?)?;
Ok(_response.result)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, TestResult>(
(),
0x31e9bddcb93a4985,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ActResponseFut =
fidl::client::QueryResponseFut<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#act(&self, mut action: &Action) -> Self::ActResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TestResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
InspectPuppetActResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6ce177c6016605e,
>(_buf?)?;
Ok(_response.result)
}
self.client.send_query_and_decode::<InspectPuppetActRequest, TestResult>(
(action,),
0x6ce177c6016605e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct InspectPuppetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for InspectPuppetEventStream {}
impl futures::stream::FusedStream for InspectPuppetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for InspectPuppetEventStream {
type Item = Result<InspectPuppetEvent, 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(InspectPuppetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum InspectPuppetEvent {}
impl InspectPuppetEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<InspectPuppetEvent, 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: <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct InspectPuppetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for InspectPuppetRequestStream {}
impl futures::stream::FusedStream for InspectPuppetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for InspectPuppetRequestStream {
type Protocol = InspectPuppetMarker;
type ControlHandle = InspectPuppetControlHandle;
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 {
InspectPuppetControlHandle { 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 InspectPuppetRequestStream {
type Item = Result<InspectPuppetRequest, 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 InspectPuppetRequestStream 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 {
0x48fbff796c4186cb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectPuppetInitializeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetInitializeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::Initialize {
params: req.params,
responder: InspectPuppetInitializeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4cf4dcbd7aa20a0d => {
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 =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::GetConfig {
responder: InspectPuppetGetConfigResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x31e9bddcb93a4985 => {
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 =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::Publish {
responder: InspectPuppetPublishResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6ce177c6016605e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectPuppetActRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetActRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::Act {
action: req.action,
responder: InspectPuppetActResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum InspectPuppetRequest {
Initialize { params: InitializationParams, responder: InspectPuppetInitializeResponder },
GetConfig { responder: InspectPuppetGetConfigResponder },
Publish { responder: InspectPuppetPublishResponder },
Act { action: Action, responder: InspectPuppetActResponder },
}
impl InspectPuppetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_initialize(
self,
) -> Option<(InitializationParams, InspectPuppetInitializeResponder)> {
if let InspectPuppetRequest::Initialize { params, responder } = self {
Some((params, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_config(self) -> Option<(InspectPuppetGetConfigResponder)> {
if let InspectPuppetRequest::GetConfig { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_publish(self) -> Option<(InspectPuppetPublishResponder)> {
if let InspectPuppetRequest::Publish { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_act(self) -> Option<(Action, InspectPuppetActResponder)> {
if let InspectPuppetRequest::Act { action, responder } = self {
Some((action, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
InspectPuppetRequest::Initialize { .. } => "initialize",
InspectPuppetRequest::GetConfig { .. } => "get_config",
InspectPuppetRequest::Publish { .. } => "publish",
InspectPuppetRequest::Act { .. } => "act",
}
}
}
#[derive(Debug, Clone)]
pub struct InspectPuppetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for InspectPuppetControlHandle {
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 InspectPuppetControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetInitializeResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetInitializeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetInitializeResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetInitializeResponder {
pub fn send(
self,
mut vmo: Option<fidl::Handle>,
mut result: TestResult,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(vmo, result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut vmo: Option<fidl::Handle>,
mut result: TestResult,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(vmo, result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut vmo: Option<fidl::Handle>,
mut result: TestResult,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<InspectPuppetInitializeResponse>(
(vmo, result),
self.tx_id,
0x48fbff796c4186cb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetGetConfigResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetGetConfigResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetGetConfigResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetGetConfigResponder {
pub fn send(self, mut printable_name: &str, mut options: Options) -> Result<(), fidl::Error> {
let _result = self.send_raw(printable_name, options);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut printable_name: &str,
mut options: Options,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(printable_name, options);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut printable_name: &str, mut options: Options) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<InspectPuppetGetConfigResponse>(
(printable_name, &mut options),
self.tx_id,
0x4cf4dcbd7aa20a0d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetPublishResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetPublishResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetPublishResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetPublishResponder {
pub fn send(self, mut result: TestResult) -> 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: TestResult) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<InspectPuppetPublishResponse>(
(result,),
self.tx_id,
0x31e9bddcb93a4985,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectPuppetActResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetActResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetActResponder {
type ControlHandle = InspectPuppetControlHandle;
fn control_handle(&self) -> &InspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectPuppetActResponder {
pub fn send(self, mut result: TestResult) -> 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: TestResult) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: TestResult) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<InspectPuppetActResponse>(
(result,),
self.tx_id,
0x6ce177c6016605e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for DiffType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for DiffType {
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 DiffType {
#[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.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiffType {
#[inline(always)]
fn new_empty() -> Self {
Self::Full
}
#[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_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for TestResult {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for TestResult {
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 TestResult {
#[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.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TestResult {
#[inline(always)]
fn new_empty() -> Self {
Self::Ok
}
#[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_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateBytesProperty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateBytesProperty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateBytesProperty, D>
for &CreateBytesProperty
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateBytesProperty>(offset);
fidl::encoding::Encode::<CreateBytesProperty, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
> fidl::encoding::Encode<CreateBytesProperty, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateBytesProperty>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateBytesProperty {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
value: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.value,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateNode {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateNode {
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<CreateNode, D>
for &CreateNode
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateNode>(offset);
fidl::encoding::Encode::<CreateNode, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<CreateNode, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateNode>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateNode {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CreateNumericProperty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CreateNumericProperty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CreateNumericProperty, D>
for &CreateNumericProperty
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateNumericProperty>(offset);
fidl::encoding::Encode::<CreateNumericProperty, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.parent),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T3: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<CreateNumericProperty, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CreateNumericProperty>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CreateNumericProperty {
#[inline(always)]
fn new_empty() -> Self {
Self {
parent: fidl::new_empty!(u32, D),
id: fidl::new_empty!(u32, D),
name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
value: fidl::new_empty!(Value, 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!(u32, D, &mut self.parent, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.id, decoder, offset + 4, _depth)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DeleteNode {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeleteNode {
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<DeleteNode, D>
for &DeleteNode
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeleteNode>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeleteNode).write_unaligned((self as *const DeleteNode).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<DeleteNode, 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::<DeleteNode>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeleteNode {
#[inline(always)]
fn new_empty() -> Self {
Self { id: 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 InspectPuppetActRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetActRequest {
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<InspectPuppetActRequest, D> for &InspectPuppetActRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetActRequest>(offset);
fidl::encoding::Encode::<InspectPuppetActRequest, D>::encode(
(<Action as fidl::encoding::ValueTypeMarker>::borrow(&self.action),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Action, D>>
fidl::encoding::Encode<InspectPuppetActRequest, 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::<InspectPuppetActRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetActRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { action: fidl::new_empty!(Action, 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!(Action, D, &mut self.action, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetActResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetActResponse {
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<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<InspectPuppetActResponse, D> for &InspectPuppetActResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetActResponse>(offset);
fidl::encoding::Encode::<InspectPuppetActResponse, D>::encode(
(<TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TestResult, D>>
fidl::encoding::Encode<InspectPuppetActResponse, 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::<InspectPuppetActResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetActResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(TestResult, 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!(TestResult, D, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for InspectPuppetGetConfigResponse {
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 InspectPuppetGetConfigResponse {
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
fidl::encoding::Encode<
InspectPuppetGetConfigResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut InspectPuppetGetConfigResponse
{
#[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::<InspectPuppetGetConfigResponse>(offset);
fidl::encoding::Encode::<
InspectPuppetGetConfigResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.printable_name,
),
<Options as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.options,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
InspectPuppetGetConfigResponse,
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::<InspectPuppetGetConfigResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetGetConfigResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
printable_name: fidl::new_empty!(
fidl::encoding::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect
),
options: fidl::new_empty!(Options, 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::UnboundedString,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.printable_name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
Options,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetInitializeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetInitializeRequest {
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<InspectPuppetInitializeRequest, D>
for &InspectPuppetInitializeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetInitializeRequest>(offset);
fidl::encoding::Encode::<InspectPuppetInitializeRequest, D>::encode(
(<InitializationParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<InitializationParams, D>,
> fidl::encoding::Encode<InspectPuppetInitializeRequest, 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::<InspectPuppetInitializeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetInitializeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { params: fidl::new_empty!(InitializationParams, 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!(InitializationParams, D, &mut self.params, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for InspectPuppetInitializeResponse {
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 InspectPuppetInitializeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl
fidl::encoding::Encode<
InspectPuppetInitializeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut InspectPuppetInitializeResponse
{
#[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::<InspectPuppetInitializeResponse>(offset);
fidl::encoding::Encode::<
InspectPuppetInitializeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.vmo
),
<TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<TestResult, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
InspectPuppetInitializeResponse,
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::<InspectPuppetInitializeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetInitializeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
vmo: fidl::new_empty!(
fidl::encoding::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
result: fidl::new_empty!(TestResult, 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::Optional<
fidl::encoding::HandleType<
fidl::Handle,
{ fidl::ObjectType::NONE.into_raw() },
2147483648,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.vmo,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
TestResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.result,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetPublishResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetPublishResponse {
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<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<InspectPuppetPublishResponse, D> for &InspectPuppetPublishResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetPublishResponse>(offset);
fidl::encoding::Encode::<InspectPuppetPublishResponse, D>::encode(
(<TestResult as fidl::encoding::ValueTypeMarker>::borrow(&self.result),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TestResult, D>>
fidl::encoding::Encode<InspectPuppetPublishResponse, 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::<InspectPuppetPublishResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InspectPuppetPublishResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { result: fidl::new_empty!(TestResult, 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!(TestResult, D, &mut self.result, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl InitializationParams {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.vmo_size {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for InitializationParams {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InitializationParams {
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<InitializationParams, D>
for &InitializationParams
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InitializationParams>(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.vmo_size.as_ref().map(<u64 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 InitializationParams {
#[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.vmo_size.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;
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 Options {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.diff_type {
return 2;
}
if let Some(_) = self.has_runner_node {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for Options {
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 Options {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Options
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Options>(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::<
bool,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.has_runner_node
.as_ref()
.map(<bool 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::<
DiffType,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.diff_type.as_ref().map(<DiffType as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Options {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
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 =
<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.has_runner_node.get_or_insert_with(|| {
fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
bool,
fidl::encoding::DefaultFuchsiaResourceDialect,
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 =
<DiffType 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.diff_type.get_or_insert_with(|| {
fidl::new_empty!(DiffType, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
DiffType,
fidl::encoding::DefaultFuchsiaResourceDialect,
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 Action {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Action {
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<Action, D> for &Action {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Action>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Action::CreateNode(ref val) => fidl::encoding::encode_in_envelope::<CreateNode, D>(
<CreateNode as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::DeleteNode(ref val) => fidl::encoding::encode_in_envelope::<DeleteNode, D>(
<DeleteNode as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Action::CreateNumericProperty(ref val) => {
fidl::encoding::encode_in_envelope::<CreateNumericProperty, D>(
<CreateNumericProperty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::CreateBytesProperty(ref val) => {
fidl::encoding::encode_in_envelope::<CreateBytesProperty, D>(
<CreateBytesProperty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
Action::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Action {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[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 {
1 => <CreateNode as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <DeleteNode as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <CreateNumericProperty as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
4 => <CreateBytesProperty as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
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 {
1 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateNode(_) = self {
} else {
*self = Action::CreateNode(fidl::new_empty!(CreateNode, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateNode(ref mut val) = self {
fidl::decode!(CreateNode, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Action::DeleteNode(_) = self {
} else {
*self = Action::DeleteNode(fidl::new_empty!(DeleteNode, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::DeleteNode(ref mut val) = self {
fidl::decode!(DeleteNode, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateNumericProperty(_) = self {
} else {
*self = Action::CreateNumericProperty(fidl::new_empty!(
CreateNumericProperty,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateNumericProperty(ref mut val) = self {
fidl::decode!(
CreateNumericProperty,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Action::CreateBytesProperty(_) = self {
} else {
*self =
Action::CreateBytesProperty(fidl::new_empty!(CreateBytesProperty, D));
}
#[allow(irrefutable_let_patterns)]
if let Action::CreateBytesProperty(ref mut val) = self {
fidl::decode!(CreateBytesProperty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Action::__SourceBreaking { unknown_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(())
}
}
impl fidl::encoding::ValueTypeMarker for Value {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Value {
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<Value, D> for &Value {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Value>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Value::IntT(ref val) => fidl::encoding::encode_in_envelope::<i64, D>(
<i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::UintT(ref val) => fidl::encoding::encode_in_envelope::<u64, D>(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::DoubleT(ref val) => fidl::encoding::encode_in_envelope::<f64, D>(
<f64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Value::StringT(ref val) => fidl::encoding::encode_in_envelope::<
fidl::encoding::UnboundedString,
D,
>(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
val,
),
encoder,
offset + 8,
_depth,
),
Value::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[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 {
1 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
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 {
1 => {
#[allow(irrefutable_let_patterns)]
if let Value::IntT(_) = self {
} else {
*self = Value::IntT(fidl::new_empty!(i64, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::IntT(ref mut val) = self {
fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Value::UintT(_) = self {
} else {
*self = Value::UintT(fidl::new_empty!(u64, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::UintT(ref mut val) = self {
fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Value::DoubleT(_) = self {
} else {
*self = Value::DoubleT(fidl::new_empty!(f64, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::DoubleT(ref mut val) = self {
fidl::decode!(f64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Value::StringT(_) = self {
} else {
*self =
Value::StringT(fidl::new_empty!(fidl::encoding::UnboundedString, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::StringT(ref mut val) = self {
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Value::__SourceBreaking { unknown_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(())
}
}
}