#![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 type LogMessage = String;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum ExitStatus {
Any,
Crash,
Clean,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ExitStatusUnknown {
() => {
_
};
}
impl ExitStatus {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Any),
1 => Some(Self::Crash),
2 => Some(Self::Clean),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
0 => Self::Any,
1 => Self::Crash,
2 => Self::Clean,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Any => 0,
Self::Crash => 1,
Self::Clean => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectPuppetCreateInspectorResponse {
pub writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetCreateInspectorResponse
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectWriterRecordIntRequest {
pub key: String,
pub value: i64,
}
impl fidl::Persistable for InspectWriterRecordIntRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InspectWriterRecordStringRequest {
pub key: String,
pub value: String,
}
impl fidl::Persistable for InspectWriterRecordStringRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct LazyInspectPuppetCommitRequest {
pub options: CommitOptions,
}
impl fidl::Persistable for LazyInspectPuppetCommitRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogPuppetEprintlnRequest {
pub message: String,
}
impl fidl::Persistable for LogPuppetEprintlnRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogPuppetPrintlnRequest {
pub message: String,
}
impl fidl::Persistable for LogPuppetPrintlnRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PuppetCrashRequest {
pub message: String,
}
impl fidl::Persistable for PuppetCrashRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PuppetRecordLazyValuesRequest {
pub key: String,
}
impl fidl::Persistable for PuppetRecordLazyValuesRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PuppetRecordLazyValuesResponse {
pub client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PuppetRecordLazyValuesResponse
{
}
#[derive(Debug, PartialEq)]
pub struct RealmFactoryCreateRealmRequest {
pub options: RealmOptions,
pub realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for RealmFactoryCreateRealmRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StopWatcherWatchComponentRequest {
pub moniker: String,
pub expected_exit: ExitStatus,
}
impl fidl::Persistable for StopWatcherWatchComponentRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StopWatcherWatchComponentResponse {
pub client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StopWatcherWatchComponentResponse
{
}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ArchivistConfig {
pub enable_klog: Option<bool>,
pub logs_max_cached_original_bytes: Option<u64>,
pub pipelines_path: Option<String>,
pub initial_interests: Option<Vec<ComponentInitialInterest>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ArchivistConfig {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CommitOptions {
pub hang: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for CommitOptions {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ComponentInitialInterest {
pub moniker: Option<String>,
pub log_severity: Option<fidl_fuchsia_diagnostics::Severity>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ComponentInitialInterest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct InspectPuppetCreateInspectorRequest {
pub name: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for InspectPuppetCreateInspectorRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct InspectWriterEscrowAndExitRequest {
pub name: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for InspectWriterEscrowAndExitRequest {}
#[derive(Debug, Default, PartialEq)]
pub struct InspectWriterEscrowAndExitResponse {
pub token: Option<fidl_fuchsia_inspect::EscrowToken>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectWriterEscrowAndExitResponse
{
}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct LogPuppetLogRequest {
pub message: Option<String>,
pub severity: Option<fidl_fuchsia_diagnostics::Severity>,
pub time: Option<i64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for LogPuppetLogRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct LogPuppetWaitForInterestChangeResponse {
pub severity: Option<fidl_fuchsia_diagnostics::Severity>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for LogPuppetWaitForInterestChangeResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PuppetDecl {
pub name: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for PuppetDecl {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct RealmOptions {
pub realm_name: Option<String>,
pub puppets: Option<Vec<PuppetDecl>>,
pub archivist_config: Option<ArchivistConfig>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for RealmOptions {}
#[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 = "fuchsia.archivist.test.InspectPuppet";
}
impl fidl::endpoints::DiscoverableProtocolMarker for InspectPuppetMarker {}
pub trait InspectPuppetProxyInterface: Send + Sync {
type CreateInspectorResponseFut: std::future::Future<
Output = Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error>,
> + Send;
fn r#create_inspector(
&self,
payload: &InspectPuppetCreateInspectorRequest,
) -> Self::CreateInspectorResponseFut;
}
#[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#create_inspector(
&self,
mut payload: &InspectPuppetCreateInspectorRequest,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
let _response = self.client.send_query::<
InspectPuppetCreateInspectorRequest,
fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
>(
payload,
0x2c0f807d7d159bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectPuppetMarker>("create_inspector")?;
Ok(_response.writer)
}
}
#[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#create_inspector(
&self,
mut payload: &InspectPuppetCreateInspectorRequest,
) -> fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<InspectWriterMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
InspectPuppetProxyInterface::r#create_inspector(self, payload)
}
}
impl InspectPuppetProxyInterface for InspectPuppetProxy {
type CreateInspectorResponseFut = fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<InspectWriterMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_inspector(
&self,
mut payload: &InspectPuppetCreateInspectorRequest,
) -> Self::CreateInspectorResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c0f807d7d159bb,
>(_buf?)?
.into_result::<InspectPuppetMarker>("create_inspector")?;
Ok(_response.writer)
}
self.client.send_query_and_decode::<
InspectPuppetCreateInspectorRequest,
fidl::endpoints::ClientEnd<InspectWriterMarker>,
>(
payload,
0x2c0f807d7d159bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
_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 {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
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 {
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(InspectPuppetEvent::_UnknownEvent { ordinal: 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 {
0x2c0f807d7d159bb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectPuppetCreateInspectorRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetCreateInspectorRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectPuppetControlHandle { inner: this.inner.clone() };
Ok(InspectPuppetRequest::CreateInspector {
payload: req,
responder: InspectPuppetCreateInspectorResponder {
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(InspectPuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: InspectPuppetControlHandle {
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(InspectPuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: InspectPuppetControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum InspectPuppetRequest {
CreateInspector {
payload: InspectPuppetCreateInspectorRequest,
responder: InspectPuppetCreateInspectorResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: InspectPuppetControlHandle,
method_type: fidl::MethodType,
},
}
impl InspectPuppetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create_inspector(
self,
) -> Option<(InspectPuppetCreateInspectorRequest, InspectPuppetCreateInspectorResponder)> {
if let InspectPuppetRequest::CreateInspector { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
InspectPuppetRequest::CreateInspector { .. } => "create_inspector",
InspectPuppetRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
InspectPuppetRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[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 InspectPuppetCreateInspectorResponder {
control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectPuppetCreateInspectorResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectPuppetCreateInspectorResponder {
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 InspectPuppetCreateInspectorResponder {
pub fn send(
self,
mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(writer);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(writer);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>>(
fidl::encoding::Flexible::new((writer,)),
self.tx_id,
0x2c0f807d7d159bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct InspectWriterMarker;
impl fidl::endpoints::ProtocolMarker for InspectWriterMarker {
type Proxy = InspectWriterProxy;
type RequestStream = InspectWriterRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = InspectWriterSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) InspectWriter";
}
pub trait InspectWriterProxyInterface: Send + Sync {
type SetHealthOkResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut;
type RecordStringResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#record_string(&self, key: &str, value: &str) -> Self::RecordStringResponseFut;
type RecordIntResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#record_int(&self, key: &str, value: i64) -> Self::RecordIntResponseFut;
type EmitExampleInspectDataResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut;
type EscrowAndExitResponseFut: std::future::Future<Output = Result<InspectWriterEscrowAndExitResponse, fidl::Error>>
+ Send;
fn r#escrow_and_exit(
&self,
payload: &InspectWriterEscrowAndExitRequest,
) -> Self::EscrowAndExitResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct InspectWriterSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for InspectWriterSynchronousProxy {
type Proxy = InspectWriterProxy;
type Protocol = InspectWriterMarker;
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 InspectWriterSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <InspectWriterMarker 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<InspectWriterEvent, fidl::Error> {
InspectWriterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_health_ok(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(),
0xe7510549d99075e,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectWriterMarker>("set_health_ok")?;
Ok(_response)
}
pub fn r#record_string(
&self,
mut key: &str,
mut value: &str,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
InspectWriterRecordStringRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(key, value,),
0x195be230721d712b,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectWriterMarker>("record_string")?;
Ok(_response)
}
pub fn r#record_int(
&self,
mut key: &str,
mut value: i64,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
InspectWriterRecordIntRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(key, value,),
0xa2c6cbf0df0949,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectWriterMarker>("record_int")?;
Ok(_response)
}
pub fn r#emit_example_inspect_data(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(),
0x228ae4647773fd94,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectWriterMarker>("emit_example_inspect_data")?;
Ok(_response)
}
pub fn r#escrow_and_exit(
&self,
mut payload: &InspectWriterEscrowAndExitRequest,
___deadline: zx::MonotonicInstant,
) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
let _response = self.client.send_query::<
InspectWriterEscrowAndExitRequest,
fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
>(
payload,
0x60e24adbd0e588ff,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<InspectWriterMarker>("escrow_and_exit")?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct InspectWriterProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for InspectWriterProxy {
type Protocol = InspectWriterMarker;
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 InspectWriterProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> InspectWriterEventStream {
InspectWriterEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_health_ok(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
InspectWriterProxyInterface::r#set_health_ok(self)
}
pub fn r#record_string(
&self,
mut key: &str,
mut value: &str,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
InspectWriterProxyInterface::r#record_string(self, key, value)
}
pub fn r#record_int(
&self,
mut key: &str,
mut value: i64,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
InspectWriterProxyInterface::r#record_int(self, key, value)
}
pub fn r#emit_example_inspect_data(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
InspectWriterProxyInterface::r#emit_example_inspect_data(self)
}
pub fn r#escrow_and_exit(
&self,
mut payload: &InspectWriterEscrowAndExitRequest,
) -> fidl::client::QueryResponseFut<
InspectWriterEscrowAndExitResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
InspectWriterProxyInterface::r#escrow_and_exit(self, payload)
}
}
impl InspectWriterProxyInterface for InspectWriterProxy {
type SetHealthOkResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xe7510549d99075e,
>(_buf?)?
.into_result::<InspectWriterMarker>("set_health_ok")?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0xe7510549d99075e,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type RecordStringResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#record_string(&self, mut key: &str, mut value: &str) -> Self::RecordStringResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x195be230721d712b,
>(_buf?)?
.into_result::<InspectWriterMarker>("record_string")?;
Ok(_response)
}
self.client.send_query_and_decode::<InspectWriterRecordStringRequest, ()>(
(key, value),
0x195be230721d712b,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type RecordIntResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#record_int(&self, mut key: &str, mut value: i64) -> Self::RecordIntResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xa2c6cbf0df0949,
>(_buf?)?
.into_result::<InspectWriterMarker>("record_int")?;
Ok(_response)
}
self.client.send_query_and_decode::<InspectWriterRecordIntRequest, ()>(
(key, value),
0xa2c6cbf0df0949,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type EmitExampleInspectDataResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x228ae4647773fd94,
>(_buf?)?
.into_result::<InspectWriterMarker>("emit_example_inspect_data")?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x228ae4647773fd94,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type EscrowAndExitResponseFut = fidl::client::QueryResponseFut<
InspectWriterEscrowAndExitResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#escrow_and_exit(
&self,
mut payload: &InspectWriterEscrowAndExitRequest,
) -> Self::EscrowAndExitResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x60e24adbd0e588ff,
>(_buf?)?
.into_result::<InspectWriterMarker>("escrow_and_exit")?;
Ok(_response)
}
self.client.send_query_and_decode::<
InspectWriterEscrowAndExitRequest,
InspectWriterEscrowAndExitResponse,
>(
payload,
0x60e24adbd0e588ff,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct InspectWriterEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for InspectWriterEventStream {}
impl futures::stream::FusedStream for InspectWriterEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for InspectWriterEventStream {
type Item = Result<InspectWriterEvent, 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(InspectWriterEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum InspectWriterEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl InspectWriterEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<InspectWriterEvent, 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(InspectWriterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct InspectWriterRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for InspectWriterRequestStream {}
impl futures::stream::FusedStream for InspectWriterRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for InspectWriterRequestStream {
type Protocol = InspectWriterMarker;
type ControlHandle = InspectWriterControlHandle;
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 {
InspectWriterControlHandle { 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 InspectWriterRequestStream {
type Item = Result<InspectWriterRequest, 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 InspectWriterRequestStream 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 {
0xe7510549d99075e => {
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 =
InspectWriterControlHandle { inner: this.inner.clone() };
Ok(InspectWriterRequest::SetHealthOk {
responder: InspectWriterSetHealthOkResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x195be230721d712b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectWriterRecordStringRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordStringRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectWriterControlHandle { inner: this.inner.clone() };
Ok(InspectWriterRequest::RecordString {
key: req.key,
value: req.value,
responder: InspectWriterRecordStringResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xa2c6cbf0df0949 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectWriterRecordIntRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordIntRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectWriterControlHandle { inner: this.inner.clone() };
Ok(InspectWriterRequest::RecordInt {
key: req.key,
value: req.value,
responder: InspectWriterRecordIntResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x228ae4647773fd94 => {
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 =
InspectWriterControlHandle { inner: this.inner.clone() };
Ok(InspectWriterRequest::EmitExampleInspectData {
responder: InspectWriterEmitExampleInspectDataResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x60e24adbd0e588ff => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectWriterEscrowAndExitRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterEscrowAndExitRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
InspectWriterControlHandle { inner: this.inner.clone() };
Ok(InspectWriterRequest::EscrowAndExit {
payload: req,
responder: InspectWriterEscrowAndExitResponder {
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(InspectWriterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: InspectWriterControlHandle {
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(InspectWriterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: InspectWriterControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum InspectWriterRequest {
SetHealthOk { responder: InspectWriterSetHealthOkResponder },
RecordString { key: String, value: String, responder: InspectWriterRecordStringResponder },
RecordInt { key: String, value: i64, responder: InspectWriterRecordIntResponder },
EmitExampleInspectData { responder: InspectWriterEmitExampleInspectDataResponder },
EscrowAndExit {
payload: InspectWriterEscrowAndExitRequest,
responder: InspectWriterEscrowAndExitResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: InspectWriterControlHandle,
method_type: fidl::MethodType,
},
}
impl InspectWriterRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_health_ok(self) -> Option<(InspectWriterSetHealthOkResponder)> {
if let InspectWriterRequest::SetHealthOk { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_record_string(
self,
) -> Option<(String, String, InspectWriterRecordStringResponder)> {
if let InspectWriterRequest::RecordString { key, value, responder } = self {
Some((key, value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_record_int(self) -> Option<(String, i64, InspectWriterRecordIntResponder)> {
if let InspectWriterRequest::RecordInt { key, value, responder } = self {
Some((key, value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_emit_example_inspect_data(
self,
) -> Option<(InspectWriterEmitExampleInspectDataResponder)> {
if let InspectWriterRequest::EmitExampleInspectData { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_escrow_and_exit(
self,
) -> Option<(InspectWriterEscrowAndExitRequest, InspectWriterEscrowAndExitResponder)> {
if let InspectWriterRequest::EscrowAndExit { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
InspectWriterRequest::SetHealthOk { .. } => "set_health_ok",
InspectWriterRequest::RecordString { .. } => "record_string",
InspectWriterRequest::RecordInt { .. } => "record_int",
InspectWriterRequest::EmitExampleInspectData { .. } => "emit_example_inspect_data",
InspectWriterRequest::EscrowAndExit { .. } => "escrow_and_exit",
InspectWriterRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
InspectWriterRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct InspectWriterControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for InspectWriterControlHandle {
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 InspectWriterControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectWriterSetHealthOkResponder {
control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectWriterSetHealthOkResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectWriterSetHealthOkResponder {
type ControlHandle = InspectWriterControlHandle;
fn control_handle(&self) -> &InspectWriterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectWriterSetHealthOkResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0xe7510549d99075e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectWriterRecordStringResponder {
control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectWriterRecordStringResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectWriterRecordStringResponder {
type ControlHandle = InspectWriterControlHandle;
fn control_handle(&self) -> &InspectWriterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectWriterRecordStringResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x195be230721d712b,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectWriterRecordIntResponder {
control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectWriterRecordIntResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectWriterRecordIntResponder {
type ControlHandle = InspectWriterControlHandle;
fn control_handle(&self) -> &InspectWriterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectWriterRecordIntResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0xa2c6cbf0df0949,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectWriterEmitExampleInspectDataResponder {
control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectWriterEmitExampleInspectDataResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectWriterEmitExampleInspectDataResponder {
type ControlHandle = InspectWriterControlHandle;
fn control_handle(&self) -> &InspectWriterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectWriterEmitExampleInspectDataResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x228ae4647773fd94,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct InspectWriterEscrowAndExitResponder {
control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for InspectWriterEscrowAndExitResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for InspectWriterEscrowAndExitResponder {
type ControlHandle = InspectWriterControlHandle;
fn control_handle(&self) -> &InspectWriterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl InspectWriterEscrowAndExitResponder {
pub fn send(self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: InspectWriterEscrowAndExitResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>>(
fidl::encoding::Flexible::new(&mut payload),
self.tx_id,
0x60e24adbd0e588ff,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LazyInspectPuppetMarker;
impl fidl::endpoints::ProtocolMarker for LazyInspectPuppetMarker {
type Proxy = LazyInspectPuppetProxy;
type RequestStream = LazyInspectPuppetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LazyInspectPuppetSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) LazyInspectPuppet";
}
pub trait LazyInspectPuppetProxyInterface: Send + Sync {
type SetHealthOkResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut;
type RecordStringResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#record_string(&self, key: &str, value: &str) -> Self::RecordStringResponseFut;
type RecordIntResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#record_int(&self, key: &str, value: i64) -> Self::RecordIntResponseFut;
type EmitExampleInspectDataResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut;
type EscrowAndExitResponseFut: std::future::Future<Output = Result<InspectWriterEscrowAndExitResponse, fidl::Error>>
+ Send;
fn r#escrow_and_exit(
&self,
payload: &InspectWriterEscrowAndExitRequest,
) -> Self::EscrowAndExitResponseFut;
type CommitResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#commit(&self, options: &CommitOptions) -> Self::CommitResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LazyInspectPuppetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LazyInspectPuppetSynchronousProxy {
type Proxy = LazyInspectPuppetProxy;
type Protocol = LazyInspectPuppetMarker;
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 LazyInspectPuppetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<LazyInspectPuppetMarker 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<LazyInspectPuppetEvent, fidl::Error> {
LazyInspectPuppetEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_health_ok(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(),
0xe7510549d99075e,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LazyInspectPuppetMarker>("set_health_ok")?;
Ok(_response)
}
pub fn r#record_string(
&self,
mut key: &str,
mut value: &str,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
InspectWriterRecordStringRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(key, value,),
0x195be230721d712b,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LazyInspectPuppetMarker>("record_string")?;
Ok(_response)
}
pub fn r#record_int(
&self,
mut key: &str,
mut value: i64,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
InspectWriterRecordIntRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(key, value,),
0xa2c6cbf0df0949,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LazyInspectPuppetMarker>("record_int")?;
Ok(_response)
}
pub fn r#emit_example_inspect_data(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(),
0x228ae4647773fd94,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LazyInspectPuppetMarker>("emit_example_inspect_data")?;
Ok(_response)
}
pub fn r#escrow_and_exit(
&self,
mut payload: &InspectWriterEscrowAndExitRequest,
___deadline: zx::MonotonicInstant,
) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
let _response = self.client.send_query::<
InspectWriterEscrowAndExitRequest,
fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
>(
payload,
0x60e24adbd0e588ff,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LazyInspectPuppetMarker>("escrow_and_exit")?;
Ok(_response)
}
pub fn r#commit(
&self,
mut options: &CommitOptions,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
LazyInspectPuppetCommitRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(options,),
0x79524e5e00cbf03f,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LazyInspectPuppetMarker>("commit")?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct LazyInspectPuppetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LazyInspectPuppetProxy {
type Protocol = LazyInspectPuppetMarker;
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 LazyInspectPuppetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LazyInspectPuppetEventStream {
LazyInspectPuppetEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_health_ok(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LazyInspectPuppetProxyInterface::r#set_health_ok(self)
}
pub fn r#record_string(
&self,
mut key: &str,
mut value: &str,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LazyInspectPuppetProxyInterface::r#record_string(self, key, value)
}
pub fn r#record_int(
&self,
mut key: &str,
mut value: i64,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LazyInspectPuppetProxyInterface::r#record_int(self, key, value)
}
pub fn r#emit_example_inspect_data(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LazyInspectPuppetProxyInterface::r#emit_example_inspect_data(self)
}
pub fn r#escrow_and_exit(
&self,
mut payload: &InspectWriterEscrowAndExitRequest,
) -> fidl::client::QueryResponseFut<
InspectWriterEscrowAndExitResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LazyInspectPuppetProxyInterface::r#escrow_and_exit(self, payload)
}
pub fn r#commit(
&self,
mut options: &CommitOptions,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LazyInspectPuppetProxyInterface::r#commit(self, options)
}
}
impl LazyInspectPuppetProxyInterface for LazyInspectPuppetProxy {
type SetHealthOkResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xe7510549d99075e,
>(_buf?)?
.into_result::<LazyInspectPuppetMarker>("set_health_ok")?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0xe7510549d99075e,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type RecordStringResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#record_string(&self, mut key: &str, mut value: &str) -> Self::RecordStringResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x195be230721d712b,
>(_buf?)?
.into_result::<LazyInspectPuppetMarker>("record_string")?;
Ok(_response)
}
self.client.send_query_and_decode::<InspectWriterRecordStringRequest, ()>(
(key, value),
0x195be230721d712b,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type RecordIntResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#record_int(&self, mut key: &str, mut value: i64) -> Self::RecordIntResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xa2c6cbf0df0949,
>(_buf?)?
.into_result::<LazyInspectPuppetMarker>("record_int")?;
Ok(_response)
}
self.client.send_query_and_decode::<InspectWriterRecordIntRequest, ()>(
(key, value),
0xa2c6cbf0df0949,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type EmitExampleInspectDataResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x228ae4647773fd94,
>(_buf?)?
.into_result::<LazyInspectPuppetMarker>("emit_example_inspect_data")?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x228ae4647773fd94,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type EscrowAndExitResponseFut = fidl::client::QueryResponseFut<
InspectWriterEscrowAndExitResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#escrow_and_exit(
&self,
mut payload: &InspectWriterEscrowAndExitRequest,
) -> Self::EscrowAndExitResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x60e24adbd0e588ff,
>(_buf?)?
.into_result::<LazyInspectPuppetMarker>("escrow_and_exit")?;
Ok(_response)
}
self.client.send_query_and_decode::<
InspectWriterEscrowAndExitRequest,
InspectWriterEscrowAndExitResponse,
>(
payload,
0x60e24adbd0e588ff,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type CommitResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#commit(&self, mut options: &CommitOptions) -> Self::CommitResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x79524e5e00cbf03f,
>(_buf?)?
.into_result::<LazyInspectPuppetMarker>("commit")?;
Ok(_response)
}
self.client.send_query_and_decode::<LazyInspectPuppetCommitRequest, ()>(
(options,),
0x79524e5e00cbf03f,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct LazyInspectPuppetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LazyInspectPuppetEventStream {}
impl futures::stream::FusedStream for LazyInspectPuppetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LazyInspectPuppetEventStream {
type Item = Result<LazyInspectPuppetEvent, 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(LazyInspectPuppetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LazyInspectPuppetEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl LazyInspectPuppetEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LazyInspectPuppetEvent, 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(LazyInspectPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LazyInspectPuppetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LazyInspectPuppetRequestStream {}
impl futures::stream::FusedStream for LazyInspectPuppetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LazyInspectPuppetRequestStream {
type Protocol = LazyInspectPuppetMarker;
type ControlHandle = LazyInspectPuppetControlHandle;
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 {
LazyInspectPuppetControlHandle { 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 LazyInspectPuppetRequestStream {
type Item = Result<LazyInspectPuppetRequest, 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 LazyInspectPuppetRequestStream 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 {
0xe7510549d99075e => {
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 =
LazyInspectPuppetControlHandle { inner: this.inner.clone() };
Ok(LazyInspectPuppetRequest::SetHealthOk {
responder: LazyInspectPuppetSetHealthOkResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x195be230721d712b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectWriterRecordStringRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordStringRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LazyInspectPuppetControlHandle { inner: this.inner.clone() };
Ok(LazyInspectPuppetRequest::RecordString {
key: req.key,
value: req.value,
responder: LazyInspectPuppetRecordStringResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xa2c6cbf0df0949 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectWriterRecordIntRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordIntRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LazyInspectPuppetControlHandle { inner: this.inner.clone() };
Ok(LazyInspectPuppetRequest::RecordInt {
key: req.key,
value: req.value,
responder: LazyInspectPuppetRecordIntResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x228ae4647773fd94 => {
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 =
LazyInspectPuppetControlHandle { inner: this.inner.clone() };
Ok(LazyInspectPuppetRequest::EmitExampleInspectData {
responder: LazyInspectPuppetEmitExampleInspectDataResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x60e24adbd0e588ff => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectWriterEscrowAndExitRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterEscrowAndExitRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LazyInspectPuppetControlHandle { inner: this.inner.clone() };
Ok(LazyInspectPuppetRequest::EscrowAndExit {
payload: req,
responder: LazyInspectPuppetEscrowAndExitResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x79524e5e00cbf03f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LazyInspectPuppetCommitRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LazyInspectPuppetCommitRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LazyInspectPuppetControlHandle { inner: this.inner.clone() };
Ok(LazyInspectPuppetRequest::Commit {
options: req.options,
responder: LazyInspectPuppetCommitResponder {
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(LazyInspectPuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: LazyInspectPuppetControlHandle {
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(LazyInspectPuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: LazyInspectPuppetControlHandle {
inner: this.inner.clone(),
},
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LazyInspectPuppetRequest {
SetHealthOk { responder: LazyInspectPuppetSetHealthOkResponder },
RecordString { key: String, value: String, responder: LazyInspectPuppetRecordStringResponder },
RecordInt { key: String, value: i64, responder: LazyInspectPuppetRecordIntResponder },
EmitExampleInspectData { responder: LazyInspectPuppetEmitExampleInspectDataResponder },
EscrowAndExit {
payload: InspectWriterEscrowAndExitRequest,
responder: LazyInspectPuppetEscrowAndExitResponder,
},
Commit { options: CommitOptions, responder: LazyInspectPuppetCommitResponder },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: LazyInspectPuppetControlHandle,
method_type: fidl::MethodType,
},
}
impl LazyInspectPuppetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_health_ok(self) -> Option<(LazyInspectPuppetSetHealthOkResponder)> {
if let LazyInspectPuppetRequest::SetHealthOk { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_record_string(
self,
) -> Option<(String, String, LazyInspectPuppetRecordStringResponder)> {
if let LazyInspectPuppetRequest::RecordString { key, value, responder } = self {
Some((key, value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_record_int(self) -> Option<(String, i64, LazyInspectPuppetRecordIntResponder)> {
if let LazyInspectPuppetRequest::RecordInt { key, value, responder } = self {
Some((key, value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_emit_example_inspect_data(
self,
) -> Option<(LazyInspectPuppetEmitExampleInspectDataResponder)> {
if let LazyInspectPuppetRequest::EmitExampleInspectData { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_escrow_and_exit(
self,
) -> Option<(InspectWriterEscrowAndExitRequest, LazyInspectPuppetEscrowAndExitResponder)> {
if let LazyInspectPuppetRequest::EscrowAndExit { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_commit(self) -> Option<(CommitOptions, LazyInspectPuppetCommitResponder)> {
if let LazyInspectPuppetRequest::Commit { options, responder } = self {
Some((options, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LazyInspectPuppetRequest::SetHealthOk { .. } => "set_health_ok",
LazyInspectPuppetRequest::RecordString { .. } => "record_string",
LazyInspectPuppetRequest::RecordInt { .. } => "record_int",
LazyInspectPuppetRequest::EmitExampleInspectData { .. } => "emit_example_inspect_data",
LazyInspectPuppetRequest::EscrowAndExit { .. } => "escrow_and_exit",
LazyInspectPuppetRequest::Commit { .. } => "commit",
LazyInspectPuppetRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay,
..
} => "unknown one-way method",
LazyInspectPuppetRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay,
..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct LazyInspectPuppetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LazyInspectPuppetControlHandle {
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 LazyInspectPuppetControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LazyInspectPuppetSetHealthOkResponder {
control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LazyInspectPuppetSetHealthOkResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LazyInspectPuppetSetHealthOkResponder {
type ControlHandle = LazyInspectPuppetControlHandle;
fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LazyInspectPuppetSetHealthOkResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0xe7510549d99075e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LazyInspectPuppetRecordStringResponder {
control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LazyInspectPuppetRecordStringResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LazyInspectPuppetRecordStringResponder {
type ControlHandle = LazyInspectPuppetControlHandle;
fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LazyInspectPuppetRecordStringResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x195be230721d712b,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LazyInspectPuppetRecordIntResponder {
control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LazyInspectPuppetRecordIntResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LazyInspectPuppetRecordIntResponder {
type ControlHandle = LazyInspectPuppetControlHandle;
fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LazyInspectPuppetRecordIntResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0xa2c6cbf0df0949,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LazyInspectPuppetEmitExampleInspectDataResponder {
control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LazyInspectPuppetEmitExampleInspectDataResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LazyInspectPuppetEmitExampleInspectDataResponder {
type ControlHandle = LazyInspectPuppetControlHandle;
fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LazyInspectPuppetEmitExampleInspectDataResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x228ae4647773fd94,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LazyInspectPuppetEscrowAndExitResponder {
control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LazyInspectPuppetEscrowAndExitResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LazyInspectPuppetEscrowAndExitResponder {
type ControlHandle = LazyInspectPuppetControlHandle;
fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LazyInspectPuppetEscrowAndExitResponder {
pub fn send(self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: InspectWriterEscrowAndExitResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>>(
fidl::encoding::Flexible::new(&mut payload),
self.tx_id,
0x60e24adbd0e588ff,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LazyInspectPuppetCommitResponder {
control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LazyInspectPuppetCommitResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LazyInspectPuppetCommitResponder {
type ControlHandle = LazyInspectPuppetControlHandle;
fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LazyInspectPuppetCommitResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x79524e5e00cbf03f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LogPuppetMarker;
impl fidl::endpoints::ProtocolMarker for LogPuppetMarker {
type Proxy = LogPuppetProxy;
type RequestStream = LogPuppetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LogPuppetSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) LogPuppet";
}
pub trait LogPuppetProxyInterface: Send + Sync {
type PrintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#println(&self, message: &str) -> Self::PrintlnResponseFut;
type EprintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#eprintln(&self, message: &str) -> Self::EprintlnResponseFut;
type LogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#log(&self, payload: &LogPuppetLogRequest) -> Self::LogResponseFut;
type WaitForInterestChangeResponseFut: std::future::Future<Output = Result<LogPuppetWaitForInterestChangeResponse, fidl::Error>>
+ Send;
fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LogPuppetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LogPuppetSynchronousProxy {
type Proxy = LogPuppetProxy;
type Protocol = LogPuppetMarker;
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 LogPuppetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <LogPuppetMarker 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<LogPuppetEvent, fidl::Error> {
LogPuppetEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#println(
&self,
mut message: &str,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
LogPuppetPrintlnRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(message,),
0x6584cb93e1978da0,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LogPuppetMarker>("println")?;
Ok(_response)
}
pub fn r#eprintln(
&self,
mut message: &str,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
LogPuppetEprintlnRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(message,),
0x770e4524f6b093ef,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LogPuppetMarker>("eprintln")?;
Ok(_response)
}
pub fn r#log(
&self,
mut payload: &LogPuppetLogRequest,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
LogPuppetLogRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
payload,
0x34d3dd4225e79a8b,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LogPuppetMarker>("log")?;
Ok(_response)
}
pub fn r#wait_for_interest_change(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
>(
(),
0x3645d3ad544bc546,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<LogPuppetMarker>("wait_for_interest_change")?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct LogPuppetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LogPuppetProxy {
type Protocol = LogPuppetMarker;
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 LogPuppetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LogPuppetEventStream {
LogPuppetEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#println(
&self,
mut message: &str,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LogPuppetProxyInterface::r#println(self, message)
}
pub fn r#eprintln(
&self,
mut message: &str,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LogPuppetProxyInterface::r#eprintln(self, message)
}
pub fn r#log(
&self,
mut payload: &LogPuppetLogRequest,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LogPuppetProxyInterface::r#log(self, payload)
}
pub fn r#wait_for_interest_change(
&self,
) -> fidl::client::QueryResponseFut<
LogPuppetWaitForInterestChangeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LogPuppetProxyInterface::r#wait_for_interest_change(self)
}
}
impl LogPuppetProxyInterface for LogPuppetProxy {
type PrintlnResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#println(&self, mut message: &str) -> Self::PrintlnResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6584cb93e1978da0,
>(_buf?)?
.into_result::<LogPuppetMarker>("println")?;
Ok(_response)
}
self.client.send_query_and_decode::<LogPuppetPrintlnRequest, ()>(
(message,),
0x6584cb93e1978da0,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type EprintlnResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#eprintln(&self, mut message: &str) -> Self::EprintlnResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x770e4524f6b093ef,
>(_buf?)?
.into_result::<LogPuppetMarker>("eprintln")?;
Ok(_response)
}
self.client.send_query_and_decode::<LogPuppetEprintlnRequest, ()>(
(message,),
0x770e4524f6b093ef,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type LogResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#log(&self, mut payload: &LogPuppetLogRequest) -> Self::LogResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x34d3dd4225e79a8b,
>(_buf?)?
.into_result::<LogPuppetMarker>("log")?;
Ok(_response)
}
self.client.send_query_and_decode::<LogPuppetLogRequest, ()>(
payload,
0x34d3dd4225e79a8b,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type WaitForInterestChangeResponseFut = fidl::client::QueryResponseFut<
LogPuppetWaitForInterestChangeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3645d3ad544bc546,
>(_buf?)?
.into_result::<LogPuppetMarker>("wait_for_interest_change")?;
Ok(_response)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
LogPuppetWaitForInterestChangeResponse,
>(
(),
0x3645d3ad544bc546,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct LogPuppetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LogPuppetEventStream {}
impl futures::stream::FusedStream for LogPuppetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LogPuppetEventStream {
type Item = Result<LogPuppetEvent, 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(LogPuppetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LogPuppetEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl LogPuppetEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LogPuppetEvent, 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(LogPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LogPuppetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LogPuppetRequestStream {}
impl futures::stream::FusedStream for LogPuppetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LogPuppetRequestStream {
type Protocol = LogPuppetMarker;
type ControlHandle = LogPuppetControlHandle;
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 {
LogPuppetControlHandle { 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 LogPuppetRequestStream {
type Item = Result<LogPuppetRequest, 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 LogPuppetRequestStream 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 {
0x6584cb93e1978da0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LogPuppetPrintlnRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetPrintlnRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
Ok(LogPuppetRequest::Println {
message: req.message,
responder: LogPuppetPrintlnResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x770e4524f6b093ef => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LogPuppetEprintlnRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetEprintlnRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
Ok(LogPuppetRequest::Eprintln {
message: req.message,
responder: LogPuppetEprintlnResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x34d3dd4225e79a8b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LogPuppetLogRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetLogRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
Ok(LogPuppetRequest::Log {
payload: req,
responder: LogPuppetLogResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3645d3ad544bc546 => {
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 = LogPuppetControlHandle { inner: this.inner.clone() };
Ok(LogPuppetRequest::WaitForInterestChange {
responder: LogPuppetWaitForInterestChangeResponder {
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(LogPuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: LogPuppetControlHandle { 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(LogPuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: LogPuppetControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LogPuppetRequest {
Println { message: String, responder: LogPuppetPrintlnResponder },
Eprintln { message: String, responder: LogPuppetEprintlnResponder },
Log { payload: LogPuppetLogRequest, responder: LogPuppetLogResponder },
WaitForInterestChange { responder: LogPuppetWaitForInterestChangeResponder },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: LogPuppetControlHandle,
method_type: fidl::MethodType,
},
}
impl LogPuppetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_println(self) -> Option<(String, LogPuppetPrintlnResponder)> {
if let LogPuppetRequest::Println { message, responder } = self {
Some((message, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_eprintln(self) -> Option<(String, LogPuppetEprintlnResponder)> {
if let LogPuppetRequest::Eprintln { message, responder } = self {
Some((message, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_log(self) -> Option<(LogPuppetLogRequest, LogPuppetLogResponder)> {
if let LogPuppetRequest::Log { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wait_for_interest_change(
self,
) -> Option<(LogPuppetWaitForInterestChangeResponder)> {
if let LogPuppetRequest::WaitForInterestChange { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LogPuppetRequest::Println { .. } => "println",
LogPuppetRequest::Eprintln { .. } => "eprintln",
LogPuppetRequest::Log { .. } => "log",
LogPuppetRequest::WaitForInterestChange { .. } => "wait_for_interest_change",
LogPuppetRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
LogPuppetRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct LogPuppetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LogPuppetControlHandle {
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 LogPuppetControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogPuppetPrintlnResponder {
control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogPuppetPrintlnResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogPuppetPrintlnResponder {
type ControlHandle = LogPuppetControlHandle;
fn control_handle(&self) -> &LogPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogPuppetPrintlnResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x6584cb93e1978da0,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogPuppetEprintlnResponder {
control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogPuppetEprintlnResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogPuppetEprintlnResponder {
type ControlHandle = LogPuppetControlHandle;
fn control_handle(&self) -> &LogPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogPuppetEprintlnResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x770e4524f6b093ef,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogPuppetLogResponder {
control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogPuppetLogResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogPuppetLogResponder {
type ControlHandle = LogPuppetControlHandle;
fn control_handle(&self) -> &LogPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogPuppetLogResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x34d3dd4225e79a8b,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogPuppetWaitForInterestChangeResponder {
control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogPuppetWaitForInterestChangeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogPuppetWaitForInterestChangeResponder {
type ControlHandle = LogPuppetControlHandle;
fn control_handle(&self) -> &LogPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogPuppetWaitForInterestChangeResponder {
pub fn send(
self,
mut payload: &LogPuppetWaitForInterestChangeResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: &LogPuppetWaitForInterestChangeResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut payload: &LogPuppetWaitForInterestChangeResponse,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleType<
LogPuppetWaitForInterestChangeResponse,
>>(
fidl::encoding::Flexible::new(payload),
self.tx_id,
0x3645d3ad544bc546,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PuppetMarker;
impl fidl::endpoints::ProtocolMarker for PuppetMarker {
type Proxy = PuppetProxy;
type RequestStream = PuppetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PuppetSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.archivist.test.Puppet";
}
impl fidl::endpoints::DiscoverableProtocolMarker for PuppetMarker {}
pub trait PuppetProxyInterface: Send + Sync {
type CreateInspectorResponseFut: std::future::Future<
Output = Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error>,
> + Send;
fn r#create_inspector(
&self,
payload: &InspectPuppetCreateInspectorRequest,
) -> Self::CreateInspectorResponseFut;
type PrintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#println(&self, message: &str) -> Self::PrintlnResponseFut;
type EprintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#eprintln(&self, message: &str) -> Self::EprintlnResponseFut;
type LogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#log(&self, payload: &LogPuppetLogRequest) -> Self::LogResponseFut;
type WaitForInterestChangeResponseFut: std::future::Future<Output = Result<LogPuppetWaitForInterestChangeResponse, fidl::Error>>
+ Send;
fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut;
type RecordLazyValuesResponseFut: std::future::Future<
Output = Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error>,
> + Send;
fn r#record_lazy_values(&self, key: &str) -> Self::RecordLazyValuesResponseFut;
fn r#crash(&self, message: &str) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PuppetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PuppetSynchronousProxy {
type Proxy = PuppetProxy;
type Protocol = PuppetMarker;
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 PuppetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <PuppetMarker 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<PuppetEvent, fidl::Error> {
PuppetEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#create_inspector(
&self,
mut payload: &InspectPuppetCreateInspectorRequest,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
let _response = self.client.send_query::<
InspectPuppetCreateInspectorRequest,
fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
>(
payload,
0x2c0f807d7d159bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<PuppetMarker>("create_inspector")?;
Ok(_response.writer)
}
pub fn r#println(
&self,
mut message: &str,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
LogPuppetPrintlnRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(message,),
0x6584cb93e1978da0,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<PuppetMarker>("println")?;
Ok(_response)
}
pub fn r#eprintln(
&self,
mut message: &str,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
LogPuppetEprintlnRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(message,),
0x770e4524f6b093ef,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<PuppetMarker>("eprintln")?;
Ok(_response)
}
pub fn r#log(
&self,
mut payload: &LogPuppetLogRequest,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
LogPuppetLogRequest,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
payload,
0x34d3dd4225e79a8b,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<PuppetMarker>("log")?;
Ok(_response)
}
pub fn r#wait_for_interest_change(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
>(
(),
0x3645d3ad544bc546,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<PuppetMarker>("wait_for_interest_change")?;
Ok(_response)
}
pub fn r#record_lazy_values(
&self,
mut key: &str,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
let _response = self.client.send_query::<
PuppetRecordLazyValuesRequest,
fidl::encoding::FlexibleType<PuppetRecordLazyValuesResponse>,
>(
(key,),
0x339951b623dc9d7d,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<PuppetMarker>("record_lazy_values")?;
Ok(_response.client)
}
pub fn r#crash(&self, mut message: &str) -> Result<(), fidl::Error> {
self.client.send::<PuppetCrashRequest>(
(message,),
0x2aeef488fb79c9db,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Clone)]
pub struct PuppetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for PuppetProxy {
type Protocol = PuppetMarker;
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 PuppetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PuppetEventStream {
PuppetEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#create_inspector(
&self,
mut payload: &InspectPuppetCreateInspectorRequest,
) -> fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<InspectWriterMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PuppetProxyInterface::r#create_inspector(self, payload)
}
pub fn r#println(
&self,
mut message: &str,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
PuppetProxyInterface::r#println(self, message)
}
pub fn r#eprintln(
&self,
mut message: &str,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
PuppetProxyInterface::r#eprintln(self, message)
}
pub fn r#log(
&self,
mut payload: &LogPuppetLogRequest,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
PuppetProxyInterface::r#log(self, payload)
}
pub fn r#wait_for_interest_change(
&self,
) -> fidl::client::QueryResponseFut<
LogPuppetWaitForInterestChangeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PuppetProxyInterface::r#wait_for_interest_change(self)
}
pub fn r#record_lazy_values(
&self,
mut key: &str,
) -> fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PuppetProxyInterface::r#record_lazy_values(self, key)
}
pub fn r#crash(&self, mut message: &str) -> Result<(), fidl::Error> {
PuppetProxyInterface::r#crash(self, message)
}
}
impl PuppetProxyInterface for PuppetProxy {
type CreateInspectorResponseFut = fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<InspectWriterMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_inspector(
&self,
mut payload: &InspectPuppetCreateInspectorRequest,
) -> Self::CreateInspectorResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c0f807d7d159bb,
>(_buf?)?
.into_result::<PuppetMarker>("create_inspector")?;
Ok(_response.writer)
}
self.client.send_query_and_decode::<
InspectPuppetCreateInspectorRequest,
fidl::endpoints::ClientEnd<InspectWriterMarker>,
>(
payload,
0x2c0f807d7d159bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type PrintlnResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#println(&self, mut message: &str) -> Self::PrintlnResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6584cb93e1978da0,
>(_buf?)?
.into_result::<PuppetMarker>("println")?;
Ok(_response)
}
self.client.send_query_and_decode::<LogPuppetPrintlnRequest, ()>(
(message,),
0x6584cb93e1978da0,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type EprintlnResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#eprintln(&self, mut message: &str) -> Self::EprintlnResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x770e4524f6b093ef,
>(_buf?)?
.into_result::<PuppetMarker>("eprintln")?;
Ok(_response)
}
self.client.send_query_and_decode::<LogPuppetEprintlnRequest, ()>(
(message,),
0x770e4524f6b093ef,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type LogResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#log(&self, mut payload: &LogPuppetLogRequest) -> Self::LogResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x34d3dd4225e79a8b,
>(_buf?)?
.into_result::<PuppetMarker>("log")?;
Ok(_response)
}
self.client.send_query_and_decode::<LogPuppetLogRequest, ()>(
payload,
0x34d3dd4225e79a8b,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type WaitForInterestChangeResponseFut = fidl::client::QueryResponseFut<
LogPuppetWaitForInterestChangeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3645d3ad544bc546,
>(_buf?)?
.into_result::<PuppetMarker>("wait_for_interest_change")?;
Ok(_response)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
LogPuppetWaitForInterestChangeResponse,
>(
(),
0x3645d3ad544bc546,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
type RecordLazyValuesResponseFut = fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#record_lazy_values(&self, mut key: &str) -> Self::RecordLazyValuesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<PuppetRecordLazyValuesResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x339951b623dc9d7d,
>(_buf?)?
.into_result::<PuppetMarker>("record_lazy_values")?;
Ok(_response.client)
}
self.client.send_query_and_decode::<
PuppetRecordLazyValuesRequest,
fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
>(
(key,),
0x339951b623dc9d7d,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
fn r#crash(&self, mut message: &str) -> Result<(), fidl::Error> {
self.client.send::<PuppetCrashRequest>(
(message,),
0x2aeef488fb79c9db,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
pub struct PuppetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for PuppetEventStream {}
impl futures::stream::FusedStream for PuppetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PuppetEventStream {
type Item = Result<PuppetEvent, 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(PuppetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PuppetEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl PuppetEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<PuppetEvent, 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(PuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PuppetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for PuppetRequestStream {}
impl futures::stream::FusedStream for PuppetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PuppetRequestStream {
type Protocol = PuppetMarker;
type ControlHandle = PuppetControlHandle;
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 {
PuppetControlHandle { 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 PuppetRequestStream {
type Item = Result<PuppetRequest, 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 PuppetRequestStream 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 {
0x2c0f807d7d159bb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
InspectPuppetCreateInspectorRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetCreateInspectorRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PuppetControlHandle { inner: this.inner.clone() };
Ok(PuppetRequest::CreateInspector {
payload: req,
responder: PuppetCreateInspectorResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6584cb93e1978da0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LogPuppetPrintlnRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetPrintlnRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PuppetControlHandle { inner: this.inner.clone() };
Ok(PuppetRequest::Println {
message: req.message,
responder: PuppetPrintlnResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x770e4524f6b093ef => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LogPuppetEprintlnRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetEprintlnRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PuppetControlHandle { inner: this.inner.clone() };
Ok(PuppetRequest::Eprintln {
message: req.message,
responder: PuppetEprintlnResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x34d3dd4225e79a8b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LogPuppetLogRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetLogRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PuppetControlHandle { inner: this.inner.clone() };
Ok(PuppetRequest::Log {
payload: req,
responder: PuppetLogResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3645d3ad544bc546 => {
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 = PuppetControlHandle { inner: this.inner.clone() };
Ok(PuppetRequest::WaitForInterestChange {
responder: PuppetWaitForInterestChangeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x339951b623dc9d7d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PuppetRecordLazyValuesRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PuppetRecordLazyValuesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PuppetControlHandle { inner: this.inner.clone() };
Ok(PuppetRequest::RecordLazyValues {
key: req.key,
responder: PuppetRecordLazyValuesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2aeef488fb79c9db => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
PuppetCrashRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PuppetCrashRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PuppetControlHandle { inner: this.inner.clone() };
Ok(PuppetRequest::Crash { message: req.message, control_handle })
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(PuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: PuppetControlHandle { 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(PuppetRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: PuppetControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum PuppetRequest {
CreateInspector {
payload: InspectPuppetCreateInspectorRequest,
responder: PuppetCreateInspectorResponder,
},
Println { message: String, responder: PuppetPrintlnResponder },
Eprintln { message: String, responder: PuppetEprintlnResponder },
Log { payload: LogPuppetLogRequest, responder: PuppetLogResponder },
WaitForInterestChange { responder: PuppetWaitForInterestChangeResponder },
RecordLazyValues { key: String, responder: PuppetRecordLazyValuesResponder },
Crash { message: String, control_handle: PuppetControlHandle },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: PuppetControlHandle,
method_type: fidl::MethodType,
},
}
impl PuppetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create_inspector(
self,
) -> Option<(InspectPuppetCreateInspectorRequest, PuppetCreateInspectorResponder)> {
if let PuppetRequest::CreateInspector { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_println(self) -> Option<(String, PuppetPrintlnResponder)> {
if let PuppetRequest::Println { message, responder } = self {
Some((message, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_eprintln(self) -> Option<(String, PuppetEprintlnResponder)> {
if let PuppetRequest::Eprintln { message, responder } = self {
Some((message, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_log(self) -> Option<(LogPuppetLogRequest, PuppetLogResponder)> {
if let PuppetRequest::Log { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wait_for_interest_change(self) -> Option<(PuppetWaitForInterestChangeResponder)> {
if let PuppetRequest::WaitForInterestChange { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_record_lazy_values(self) -> Option<(String, PuppetRecordLazyValuesResponder)> {
if let PuppetRequest::RecordLazyValues { key, responder } = self {
Some((key, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_crash(self) -> Option<(String, PuppetControlHandle)> {
if let PuppetRequest::Crash { message, control_handle } = self {
Some((message, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PuppetRequest::CreateInspector { .. } => "create_inspector",
PuppetRequest::Println { .. } => "println",
PuppetRequest::Eprintln { .. } => "eprintln",
PuppetRequest::Log { .. } => "log",
PuppetRequest::WaitForInterestChange { .. } => "wait_for_interest_change",
PuppetRequest::RecordLazyValues { .. } => "record_lazy_values",
PuppetRequest::Crash { .. } => "crash",
PuppetRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
PuppetRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct PuppetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for PuppetControlHandle {
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 PuppetControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PuppetCreateInspectorResponder {
control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PuppetCreateInspectorResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PuppetCreateInspectorResponder {
type ControlHandle = PuppetControlHandle;
fn control_handle(&self) -> &PuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PuppetCreateInspectorResponder {
pub fn send(
self,
mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(writer);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(writer);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>>(
fidl::encoding::Flexible::new((writer,)),
self.tx_id,
0x2c0f807d7d159bb,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PuppetPrintlnResponder {
control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PuppetPrintlnResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PuppetPrintlnResponder {
type ControlHandle = PuppetControlHandle;
fn control_handle(&self) -> &PuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PuppetPrintlnResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x6584cb93e1978da0,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PuppetEprintlnResponder {
control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PuppetEprintlnResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PuppetEprintlnResponder {
type ControlHandle = PuppetControlHandle;
fn control_handle(&self) -> &PuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PuppetEprintlnResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x770e4524f6b093ef,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PuppetLogResponder {
control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PuppetLogResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PuppetLogResponder {
type ControlHandle = PuppetControlHandle;
fn control_handle(&self) -> &PuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PuppetLogResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x34d3dd4225e79a8b,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PuppetWaitForInterestChangeResponder {
control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PuppetWaitForInterestChangeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PuppetWaitForInterestChangeResponder {
type ControlHandle = PuppetControlHandle;
fn control_handle(&self) -> &PuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PuppetWaitForInterestChangeResponder {
pub fn send(
self,
mut payload: &LogPuppetWaitForInterestChangeResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: &LogPuppetWaitForInterestChangeResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut payload: &LogPuppetWaitForInterestChangeResponse,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleType<
LogPuppetWaitForInterestChangeResponse,
>>(
fidl::encoding::Flexible::new(payload),
self.tx_id,
0x3645d3ad544bc546,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PuppetRecordLazyValuesResponder {
control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PuppetRecordLazyValuesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PuppetRecordLazyValuesResponder {
type ControlHandle = PuppetControlHandle;
fn control_handle(&self) -> &PuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PuppetRecordLazyValuesResponder {
pub fn send(
self,
mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(client);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(client);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<PuppetRecordLazyValuesResponse>>(
fidl::encoding::Flexible::new((client,)),
self.tx_id,
0x339951b623dc9d7d,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RealmFactoryMarker;
impl fidl::endpoints::ProtocolMarker for RealmFactoryMarker {
type Proxy = RealmFactoryProxy;
type RequestStream = RealmFactoryRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RealmFactorySynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.archivist.test.RealmFactory";
}
impl fidl::endpoints::DiscoverableProtocolMarker for RealmFactoryMarker {}
pub type RealmFactoryCreateRealmResult = Result<(), fidl_fuchsia_testing_harness::OperationError>;
pub trait RealmFactoryProxyInterface: Send + Sync {
type CreateRealmResponseFut: std::future::Future<Output = Result<RealmFactoryCreateRealmResult, fidl::Error>>
+ Send;
fn r#create_realm(
&self,
options: &RealmOptions,
realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
) -> Self::CreateRealmResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RealmFactorySynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RealmFactorySynchronousProxy {
type Proxy = RealmFactoryProxy;
type Protocol = RealmFactoryMarker;
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 RealmFactorySynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <RealmFactoryMarker 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<RealmFactoryEvent, fidl::Error> {
RealmFactoryEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#create_realm(
&self,
mut options: &RealmOptions,
mut realm_server: fidl::endpoints::ServerEnd<
fidl_fuchsia_testing_harness::RealmProxy_Marker,
>,
___deadline: zx::MonotonicInstant,
) -> Result<RealmFactoryCreateRealmResult, fidl::Error> {
let _response = self
.client
.send_query::<RealmFactoryCreateRealmRequest, fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_testing_harness::OperationError,
>>(
(options, realm_server),
0x176832ac7263ab99,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<RealmFactoryMarker>("create_realm")?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct RealmFactoryProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for RealmFactoryProxy {
type Protocol = RealmFactoryMarker;
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 RealmFactoryProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RealmFactoryEventStream {
RealmFactoryEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#create_realm(
&self,
mut options: &RealmOptions,
mut realm_server: fidl::endpoints::ServerEnd<
fidl_fuchsia_testing_harness::RealmProxy_Marker,
>,
) -> fidl::client::QueryResponseFut<
RealmFactoryCreateRealmResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RealmFactoryProxyInterface::r#create_realm(self, options, realm_server)
}
}
impl RealmFactoryProxyInterface for RealmFactoryProxy {
type CreateRealmResponseFut = fidl::client::QueryResponseFut<
RealmFactoryCreateRealmResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_realm(
&self,
mut options: &RealmOptions,
mut realm_server: fidl::endpoints::ServerEnd<
fidl_fuchsia_testing_harness::RealmProxy_Marker,
>,
) -> Self::CreateRealmResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RealmFactoryCreateRealmResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_testing_harness::OperationError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x176832ac7263ab99,
>(_buf?)?
.into_result::<RealmFactoryMarker>("create_realm")?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<RealmFactoryCreateRealmRequest, RealmFactoryCreateRealmResult>(
(options, realm_server),
0x176832ac7263ab99,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct RealmFactoryEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for RealmFactoryEventStream {}
impl futures::stream::FusedStream for RealmFactoryEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RealmFactoryEventStream {
type Item = Result<RealmFactoryEvent, 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(RealmFactoryEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RealmFactoryEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl RealmFactoryEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<RealmFactoryEvent, 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(RealmFactoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RealmFactoryRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for RealmFactoryRequestStream {}
impl futures::stream::FusedStream for RealmFactoryRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RealmFactoryRequestStream {
type Protocol = RealmFactoryMarker;
type ControlHandle = RealmFactoryControlHandle;
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 {
RealmFactoryControlHandle { 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 RealmFactoryRequestStream {
type Item = Result<RealmFactoryRequest, 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 RealmFactoryRequestStream 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 {
0x176832ac7263ab99 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RealmFactoryCreateRealmRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmFactoryCreateRealmRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
RealmFactoryControlHandle { inner: this.inner.clone() };
Ok(RealmFactoryRequest::CreateRealm {
options: req.options,
realm_server: req.realm_server,
responder: RealmFactoryCreateRealmResponder {
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(RealmFactoryRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: RealmFactoryControlHandle { 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(RealmFactoryRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: RealmFactoryControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum RealmFactoryRequest {
CreateRealm {
options: RealmOptions,
realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
responder: RealmFactoryCreateRealmResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: RealmFactoryControlHandle,
method_type: fidl::MethodType,
},
}
impl RealmFactoryRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create_realm(
self,
) -> Option<(
RealmOptions,
fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
RealmFactoryCreateRealmResponder,
)> {
if let RealmFactoryRequest::CreateRealm { options, realm_server, responder } = self {
Some((options, realm_server, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RealmFactoryRequest::CreateRealm { .. } => "create_realm",
RealmFactoryRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
RealmFactoryRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct RealmFactoryControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for RealmFactoryControlHandle {
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 RealmFactoryControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RealmFactoryCreateRealmResponder {
control_handle: std::mem::ManuallyDrop<RealmFactoryControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RealmFactoryCreateRealmResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RealmFactoryCreateRealmResponder {
type ControlHandle = RealmFactoryControlHandle;
fn control_handle(&self) -> &RealmFactoryControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RealmFactoryCreateRealmResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_testing_harness::OperationError>,
) -> 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_testing_harness::OperationError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_testing_harness::OperationError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_testing_harness::OperationError,
>>(
fidl::encoding::FlexibleResult::new(result),
self.tx_id,
0x176832ac7263ab99,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct StopWaiterMarker;
impl fidl::endpoints::ProtocolMarker for StopWaiterMarker {
type Proxy = StopWaiterProxy;
type RequestStream = StopWaiterRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = StopWaiterSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) StopWaiter";
}
pub trait StopWaiterProxyInterface: Send + Sync {
type WaitResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#wait(&self) -> Self::WaitResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct StopWaiterSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for StopWaiterSynchronousProxy {
type Proxy = StopWaiterProxy;
type Protocol = StopWaiterMarker;
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 StopWaiterSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <StopWaiterMarker 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<StopWaiterEvent, fidl::Error> {
StopWaiterEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#wait(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
>(
(),
0x12d62812fe8aa263,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<StopWaiterMarker>("wait")?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct StopWaiterProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for StopWaiterProxy {
type Protocol = StopWaiterMarker;
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 StopWaiterProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> StopWaiterEventStream {
StopWaiterEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#wait(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
StopWaiterProxyInterface::r#wait(self)
}
}
impl StopWaiterProxyInterface for StopWaiterProxy {
type WaitResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#wait(&self) -> Self::WaitResponseFut {
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::FlexibleType<fidl::encoding::EmptyStruct>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x12d62812fe8aa263,
>(_buf?)?
.into_result::<StopWaiterMarker>("wait")?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x12d62812fe8aa263,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct StopWaiterEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for StopWaiterEventStream {}
impl futures::stream::FusedStream for StopWaiterEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for StopWaiterEventStream {
type Item = Result<StopWaiterEvent, 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(StopWaiterEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum StopWaiterEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl StopWaiterEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<StopWaiterEvent, 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(StopWaiterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct StopWaiterRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for StopWaiterRequestStream {}
impl futures::stream::FusedStream for StopWaiterRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for StopWaiterRequestStream {
type Protocol = StopWaiterMarker;
type ControlHandle = StopWaiterControlHandle;
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 {
StopWaiterControlHandle { 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 StopWaiterRequestStream {
type Item = Result<StopWaiterRequest, 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 StopWaiterRequestStream 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 {
0x12d62812fe8aa263 => {
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 = StopWaiterControlHandle { inner: this.inner.clone() };
Ok(StopWaiterRequest::Wait {
responder: StopWaiterWaitResponder {
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(StopWaiterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: StopWaiterControlHandle { 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(StopWaiterRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: StopWaiterControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum StopWaiterRequest {
Wait { responder: StopWaiterWaitResponder },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: StopWaiterControlHandle,
method_type: fidl::MethodType,
},
}
impl StopWaiterRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_wait(self) -> Option<(StopWaiterWaitResponder)> {
if let StopWaiterRequest::Wait { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
StopWaiterRequest::Wait { .. } => "wait",
StopWaiterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
StopWaiterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct StopWaiterControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for StopWaiterControlHandle {
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 StopWaiterControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StopWaiterWaitResponder {
control_handle: std::mem::ManuallyDrop<StopWaiterControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StopWaiterWaitResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StopWaiterWaitResponder {
type ControlHandle = StopWaiterControlHandle;
fn control_handle(&self) -> &StopWaiterControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StopWaiterWaitResponder {
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::FlexibleType<fidl::encoding::EmptyStruct>>(
fidl::encoding::Flexible::new(()),
self.tx_id,
0x12d62812fe8aa263,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct StopWatcherMarker;
impl fidl::endpoints::ProtocolMarker for StopWatcherMarker {
type Proxy = StopWatcherProxy;
type RequestStream = StopWatcherRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = StopWatcherSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.archivist.test.StopWatcher";
}
impl fidl::endpoints::DiscoverableProtocolMarker for StopWatcherMarker {}
pub trait StopWatcherProxyInterface: Send + Sync {
type WatchComponentResponseFut: std::future::Future<
Output = Result<fidl::endpoints::ClientEnd<StopWaiterMarker>, fidl::Error>,
> + Send;
fn r#watch_component(
&self,
moniker: &str,
expected_exit: ExitStatus,
) -> Self::WatchComponentResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct StopWatcherSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for StopWatcherSynchronousProxy {
type Proxy = StopWatcherProxy;
type Protocol = StopWatcherMarker;
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 StopWatcherSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <StopWatcherMarker 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<StopWatcherEvent, fidl::Error> {
StopWatcherEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#watch_component(
&self,
mut moniker: &str,
mut expected_exit: ExitStatus,
___deadline: zx::MonotonicInstant,
) -> Result<fidl::endpoints::ClientEnd<StopWaiterMarker>, fidl::Error> {
let _response = self.client.send_query::<
StopWatcherWatchComponentRequest,
fidl::encoding::FlexibleType<StopWatcherWatchComponentResponse>,
>(
(moniker, expected_exit,),
0x844f88ddd954e8e,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<StopWatcherMarker>("watch_component")?;
Ok(_response.client)
}
}
#[derive(Debug, Clone)]
pub struct StopWatcherProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for StopWatcherProxy {
type Protocol = StopWatcherMarker;
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 StopWatcherProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> StopWatcherEventStream {
StopWatcherEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#watch_component(
&self,
mut moniker: &str,
mut expected_exit: ExitStatus,
) -> fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<StopWaiterMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
StopWatcherProxyInterface::r#watch_component(self, moniker, expected_exit)
}
}
impl StopWatcherProxyInterface for StopWatcherProxy {
type WatchComponentResponseFut = fidl::client::QueryResponseFut<
fidl::endpoints::ClientEnd<StopWaiterMarker>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_component(
&self,
mut moniker: &str,
mut expected_exit: ExitStatus,
) -> Self::WatchComponentResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl::endpoints::ClientEnd<StopWaiterMarker>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<StopWatcherWatchComponentResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x844f88ddd954e8e,
>(_buf?)?
.into_result::<StopWatcherMarker>("watch_component")?;
Ok(_response.client)
}
self.client.send_query_and_decode::<
StopWatcherWatchComponentRequest,
fidl::endpoints::ClientEnd<StopWaiterMarker>,
>(
(moniker, expected_exit,),
0x844f88ddd954e8e,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct StopWatcherEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for StopWatcherEventStream {}
impl futures::stream::FusedStream for StopWatcherEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for StopWatcherEventStream {
type Item = Result<StopWatcherEvent, 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(StopWatcherEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum StopWatcherEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl StopWatcherEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<StopWatcherEvent, 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(StopWatcherEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct StopWatcherRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for StopWatcherRequestStream {}
impl futures::stream::FusedStream for StopWatcherRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for StopWatcherRequestStream {
type Protocol = StopWatcherMarker;
type ControlHandle = StopWatcherControlHandle;
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 {
StopWatcherControlHandle { 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 StopWatcherRequestStream {
type Item = Result<StopWatcherRequest, 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 StopWatcherRequestStream 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 {
0x844f88ddd954e8e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
StopWatcherWatchComponentRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StopWatcherWatchComponentRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = StopWatcherControlHandle { inner: this.inner.clone() };
Ok(StopWatcherRequest::WatchComponent {
moniker: req.moniker,
expected_exit: req.expected_exit,
responder: StopWatcherWatchComponentResponder {
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(StopWatcherRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: StopWatcherControlHandle { 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(StopWatcherRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: StopWatcherControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum StopWatcherRequest {
WatchComponent {
moniker: String,
expected_exit: ExitStatus,
responder: StopWatcherWatchComponentResponder,
},
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: StopWatcherControlHandle,
method_type: fidl::MethodType,
},
}
impl StopWatcherRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_watch_component(
self,
) -> Option<(String, ExitStatus, StopWatcherWatchComponentResponder)> {
if let StopWatcherRequest::WatchComponent { moniker, expected_exit, responder } = self {
Some((moniker, expected_exit, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
StopWatcherRequest::WatchComponent { .. } => "watch_component",
StopWatcherRequest::_UnknownMethod {
method_type: fidl::MethodType::OneWay, ..
} => "unknown one-way method",
StopWatcherRequest::_UnknownMethod {
method_type: fidl::MethodType::TwoWay, ..
} => "unknown two-way method",
}
}
}
#[derive(Debug, Clone)]
pub struct StopWatcherControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for StopWatcherControlHandle {
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 StopWatcherControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StopWatcherWatchComponentResponder {
control_handle: std::mem::ManuallyDrop<StopWatcherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StopWatcherWatchComponentResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StopWatcherWatchComponentResponder {
type ControlHandle = StopWatcherControlHandle;
fn control_handle(&self) -> &StopWatcherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StopWatcherWatchComponentResponder {
pub fn send(
self,
mut client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(client);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(client);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<StopWatcherWatchComponentResponse>>(
fidl::encoding::Flexible::new((client,)),
self.tx_id,
0x844f88ddd954e8e,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for ExitStatus {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ExitStatus {
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 ExitStatus {
#[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 ExitStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[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_allow_unknown(prim);
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for InspectPuppetCreateInspectorResponse {
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 InspectPuppetCreateInspectorResponse {
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<
InspectPuppetCreateInspectorResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut InspectPuppetCreateInspectorResponse
{
#[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::<InspectPuppetCreateInspectorResponse>(offset);
fidl::encoding::Encode::<InspectPuppetCreateInspectorResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
InspectPuppetCreateInspectorResponse,
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::<InspectPuppetCreateInspectorResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectPuppetCreateInspectorResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
writer: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.writer,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectWriterRecordIntRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectWriterRecordIntRequest {
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<InspectWriterRecordIntRequest, D>
for &InspectWriterRecordIntRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectWriterRecordIntRequest>(offset);
fidl::encoding::Encode::<InspectWriterRecordIntRequest, D>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T1: fidl::encoding::Encode<i64, D>,
> fidl::encoding::Encode<InspectWriterRecordIntRequest, 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::<InspectWriterRecordIntRequest>(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 InspectWriterRecordIntRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
key: fidl::new_empty!(fidl::encoding::UnboundedString, D),
value: fidl::new_empty!(i64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.key,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(i64, D, &mut self.value, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for InspectWriterRecordStringRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectWriterRecordStringRequest {
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<InspectWriterRecordStringRequest, D>
for &InspectWriterRecordStringRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectWriterRecordStringRequest>(offset);
fidl::encoding::Encode::<InspectWriterRecordStringRequest, D>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.value,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<InspectWriterRecordStringRequest, 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::<InspectWriterRecordStringRequest>(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 InspectWriterRecordStringRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
key: fidl::new_empty!(fidl::encoding::UnboundedString, D),
value: fidl::new_empty!(fidl::encoding::UnboundedString, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.key,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.value,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LazyInspectPuppetCommitRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LazyInspectPuppetCommitRequest {
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<LazyInspectPuppetCommitRequest, D>
for &LazyInspectPuppetCommitRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LazyInspectPuppetCommitRequest>(offset);
fidl::encoding::Encode::<LazyInspectPuppetCommitRequest, D>::encode(
(<CommitOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CommitOptions, D>>
fidl::encoding::Encode<LazyInspectPuppetCommitRequest, 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::<LazyInspectPuppetCommitRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LazyInspectPuppetCommitRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { options: fidl::new_empty!(CommitOptions, 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!(CommitOptions, D, &mut self.options, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LogPuppetEprintlnRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogPuppetEprintlnRequest {
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<LogPuppetEprintlnRequest, D> for &LogPuppetEprintlnRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogPuppetEprintlnRequest>(offset);
fidl::encoding::Encode::<LogPuppetEprintlnRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.message,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<LogPuppetEprintlnRequest, 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::<LogPuppetEprintlnRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LogPuppetEprintlnRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { message: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.message,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LogPuppetPrintlnRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogPuppetPrintlnRequest {
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<LogPuppetPrintlnRequest, D> for &LogPuppetPrintlnRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogPuppetPrintlnRequest>(offset);
fidl::encoding::Encode::<LogPuppetPrintlnRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.message,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<LogPuppetPrintlnRequest, 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::<LogPuppetPrintlnRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LogPuppetPrintlnRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { message: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.message,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PuppetCrashRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PuppetCrashRequest {
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<PuppetCrashRequest, D>
for &PuppetCrashRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PuppetCrashRequest>(offset);
fidl::encoding::Encode::<PuppetCrashRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.message,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<PuppetCrashRequest, 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::<PuppetCrashRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PuppetCrashRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { message: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.message,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PuppetRecordLazyValuesRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PuppetRecordLazyValuesRequest {
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<PuppetRecordLazyValuesRequest, D>
for &PuppetRecordLazyValuesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PuppetRecordLazyValuesRequest>(offset);
fidl::encoding::Encode::<PuppetRecordLazyValuesRequest, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.key,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<PuppetRecordLazyValuesRequest, 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::<PuppetRecordLazyValuesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PuppetRecordLazyValuesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { key: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.key,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PuppetRecordLazyValuesResponse {
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 PuppetRecordLazyValuesResponse {
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<
PuppetRecordLazyValuesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PuppetRecordLazyValuesResponse
{
#[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::<PuppetRecordLazyValuesResponse>(offset);
fidl::encoding::Encode::<PuppetRecordLazyValuesResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PuppetRecordLazyValuesResponse,
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::<PuppetRecordLazyValuesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PuppetRecordLazyValuesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
client: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.client,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for RealmFactoryCreateRealmRequest {
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 RealmFactoryCreateRealmRequest {
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<
RealmFactoryCreateRealmRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RealmFactoryCreateRealmRequest
{
#[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::<RealmFactoryCreateRealmRequest>(offset);
fidl::encoding::Encode::<
RealmFactoryCreateRealmRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<RealmOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.realm_server,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RealmFactoryCreateRealmRequest,
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::<RealmFactoryCreateRealmRequest>(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 RealmFactoryCreateRealmRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
options: fidl::new_empty!(
RealmOptions,
fidl::encoding::DefaultFuchsiaResourceDialect
),
realm_server: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
>,
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!(
RealmOptions,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.realm_server,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StopWatcherWatchComponentRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StopWatcherWatchComponentRequest {
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<StopWatcherWatchComponentRequest, D>
for &StopWatcherWatchComponentRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StopWatcherWatchComponentRequest>(offset);
fidl::encoding::Encode::<StopWatcherWatchComponentRequest, D>::encode(
(
<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
<ExitStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.expected_exit),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
T1: fidl::encoding::Encode<ExitStatus, D>,
> fidl::encoding::Encode<StopWatcherWatchComponentRequest, 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::<StopWatcherWatchComponentRequest>(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 StopWatcherWatchComponentRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
moniker: fidl::new_empty!(fidl::encoding::BoundedString<4096>, D),
expected_exit: fidl::new_empty!(ExitStatus, 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.moniker,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(ExitStatus, D, &mut self.expected_exit, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StopWatcherWatchComponentResponse {
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 StopWatcherWatchComponentResponse {
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<
StopWatcherWatchComponentResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StopWatcherWatchComponentResponse
{
#[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::<StopWatcherWatchComponentResponse>(offset);
fidl::encoding::Encode::<StopWatcherWatchComponentResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StopWatcherWatchComponentResponse,
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::<StopWatcherWatchComponentResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StopWatcherWatchComponentResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
client: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.client,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl ArchivistConfig {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.initial_interests {
return 4;
}
if let Some(_) = self.pipelines_path {
return 3;
}
if let Some(_) = self.logs_max_cached_original_bytes {
return 2;
}
if let Some(_) = self.enable_klog {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ArchivistConfig {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArchivistConfig {
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<ArchivistConfig, D>
for &ArchivistConfig
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArchivistConfig>(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, D>(
self.enable_klog.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::<u64, D>(
self.logs_max_cached_original_bytes
.as_ref()
.map(<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::BoundedString<256>, D>(
self.pipelines_path.as_ref().map(
<fidl::encoding::BoundedString<256> 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::<fidl::encoding::UnboundedVector<ComponentInitialInterest>, D>(
self.initial_interests.as_ref().map(<fidl::encoding::UnboundedVector<ComponentInitialInterest> 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 ArchivistConfig {
#[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 =
<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.enable_klog.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 < 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 =
<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
.logs_max_cached_original_bytes
.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 < 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::BoundedString<256> 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
.pipelines_path
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
fidl::decode!(
fidl::encoding::BoundedString<256>,
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 = <fidl::encoding::UnboundedVector<ComponentInitialInterest> 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.initial_interests.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<ComponentInitialInterest>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<ComponentInitialInterest>,
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 CommitOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.hang {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for CommitOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CommitOptions {
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<CommitOptions, D>
for &CommitOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CommitOptions>(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, D>(
self.hang.as_ref().map(<bool 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 CommitOptions {
#[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 =
<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.hang.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;
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 ComponentInitialInterest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.log_severity {
return 2;
}
if let Some(_) = self.moniker {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ComponentInitialInterest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ComponentInitialInterest {
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<ComponentInitialInterest, D> for &ComponentInitialInterest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ComponentInitialInterest>(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::UnboundedString, D>(
self.moniker.as_ref().map(
<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_fuchsia_diagnostics::Severity, D>(
self.log_severity.as_ref().map(
<fidl_fuchsia_diagnostics::Severity 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 ComponentInitialInterest
{
#[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::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
.moniker
.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 < 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_fuchsia_diagnostics::Severity 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
.log_severity
.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_diagnostics::Severity, D));
fidl::decode!(
fidl_fuchsia_diagnostics::Severity,
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 InspectPuppetCreateInspectorRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.name {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for InspectPuppetCreateInspectorRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectPuppetCreateInspectorRequest {
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<InspectPuppetCreateInspectorRequest, D>
for &InspectPuppetCreateInspectorRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectPuppetCreateInspectorRequest>(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<4096>, D>(
self.name.as_ref().map(<fidl::encoding::BoundedString<4096> 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 InspectPuppetCreateInspectorRequest
{
#[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<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.name.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;
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 InspectWriterEscrowAndExitRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.name {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for InspectWriterEscrowAndExitRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InspectWriterEscrowAndExitRequest {
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<InspectWriterEscrowAndExitRequest, D>
for &InspectWriterEscrowAndExitRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InspectWriterEscrowAndExitRequest>(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<4096>, D>(
self.name.as_ref().map(<fidl::encoding::BoundedString<4096> 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 InspectWriterEscrowAndExitRequest
{
#[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<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.name.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;
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 InspectWriterEscrowAndExitResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.token {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for InspectWriterEscrowAndExitResponse {
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 InspectWriterEscrowAndExitResponse {
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<
InspectWriterEscrowAndExitResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut InspectWriterEscrowAndExitResponse
{
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::<InspectWriterEscrowAndExitResponse>(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_fuchsia_inspect::EscrowToken, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.token.as_mut().map(<fidl_fuchsia_inspect::EscrowToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for InspectWriterEscrowAndExitResponse
{
#[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 =
<fidl_fuchsia_inspect::EscrowToken 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.token.get_or_insert_with(|| {
fidl::new_empty!(
fidl_fuchsia_inspect::EscrowToken,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl_fuchsia_inspect::EscrowToken,
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 LogPuppetLogRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.time {
return 3;
}
if let Some(_) = self.severity {
return 2;
}
if let Some(_) = self.message {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for LogPuppetLogRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogPuppetLogRequest {
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<LogPuppetLogRequest, D>
for &LogPuppetLogRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogPuppetLogRequest>(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::UnboundedString, D>(
self.message.as_ref().map(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 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_fuchsia_diagnostics::Severity, D>(
self.severity.as_ref().map(
<fidl_fuchsia_diagnostics::Severity 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::<i64, D>(
self.time.as_ref().map(<i64 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 LogPuppetLogRequest {
#[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::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.message
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
fidl::decode!(
fidl::encoding::UnboundedString,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 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_fuchsia_diagnostics::Severity 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
.severity
.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_diagnostics::Severity, D));
fidl::decode!(
fidl_fuchsia_diagnostics::Severity,
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 =
<i64 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.time.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, 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 LogPuppetWaitForInterestChangeResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.severity {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for LogPuppetWaitForInterestChangeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogPuppetWaitForInterestChangeResponse {
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<LogPuppetWaitForInterestChangeResponse, D>
for &LogPuppetWaitForInterestChangeResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogPuppetWaitForInterestChangeResponse>(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_fuchsia_diagnostics::Severity, D>(
self.severity.as_ref().map(
<fidl_fuchsia_diagnostics::Severity 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 LogPuppetWaitForInterestChangeResponse
{
#[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_fuchsia_diagnostics::Severity 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
.severity
.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_diagnostics::Severity, D));
fidl::decode!(
fidl_fuchsia_diagnostics::Severity,
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 PuppetDecl {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.name {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for PuppetDecl {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PuppetDecl {
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<PuppetDecl, D>
for &PuppetDecl
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PuppetDecl>(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;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PuppetDecl {
#[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;
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 RealmOptions {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.archivist_config {
return 3;
}
if let Some(_) = self.puppets {
return 2;
}
if let Some(_) = self.realm_name {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for RealmOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RealmOptions {
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<RealmOptions, D>
for &RealmOptions
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RealmOptions>(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<255>, D>(
self.realm_name.as_ref().map(
<fidl::encoding::BoundedString<255> 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<PuppetDecl>, D>(
self.puppets.as_ref().map(<fidl::encoding::UnboundedVector<PuppetDecl> 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::<ArchivistConfig, D>(
self.archivist_config
.as_ref()
.map(<ArchivistConfig 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 RealmOptions {
#[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<255> 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
.realm_name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
fidl::decode!(
fidl::encoding::BoundedString<255>,
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<PuppetDecl> 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.puppets.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::UnboundedVector<PuppetDecl>, D)
});
fidl::decode!(
fidl::encoding::UnboundedVector<PuppetDecl>,
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 =
<ArchivistConfig 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
.archivist_config
.get_or_insert_with(|| fidl::new_empty!(ArchivistConfig, D));
fidl::decode!(ArchivistConfig, 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(())
}
}
}