#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const MAX_ARGS: u32 = 15;
pub const MAX_ARG_NAME_LENGTH: u32 = 256;
pub const MAX_TEXT_ARG_LENGTH: u32 = 32768;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum PuppetError {
UnsupportedRecord = 1,
}
impl PuppetError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::UnsupportedRecord),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct Argument {
pub name: String,
pub value: Value,
}
impl fidl::Persistable for Argument {}
#[derive(Clone, Debug, PartialEq)]
pub struct EncodingPuppetEncodeRequest {
pub record: Record,
}
impl fidl::Persistable for EncodingPuppetEncodeRequest {}
#[derive(Debug, PartialEq)]
pub struct EncodingPuppetEncodeResponse {
pub result: fidl_fuchsia_mem::Buffer,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for EncodingPuppetEncodeResponse
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct EncodingValidatorValidateRequest {
pub results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for EncodingValidatorValidateRequest
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct LogSinkPuppetEmitLogRequest {
pub spec: RecordSpec,
}
impl fidl::Persistable for LogSinkPuppetEmitLogRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogSinkPuppetGetInfoResponse {
pub info: PuppetInfo,
}
impl fidl::Persistable for LogSinkPuppetGetInfoResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PuppetInfo {
pub tag: Option<String>,
pub pid: u64,
pub tid: u64,
}
impl fidl::Persistable for PuppetInfo {}
#[derive(Clone, Debug, PartialEq)]
pub struct Record {
pub timestamp: fidl::BootInstant,
pub severity: fidl_fuchsia_diagnostics::Severity,
pub arguments: Vec<Argument>,
}
impl fidl::Persistable for Record {}
#[derive(Clone, Debug, PartialEq)]
pub struct RecordSpec {
pub file: String,
pub line: u32,
pub record: Record,
}
impl fidl::Persistable for RecordSpec {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TestFailure {
pub test_name: String,
pub reason: String,
}
impl fidl::Persistable for TestFailure {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TestSuccess {
pub test_name: String,
}
impl fidl::Persistable for TestSuccess {}
#[derive(Debug, Default, PartialEq)]
pub struct ValidateResultsIteratorGetNextResponse {
pub result: Option<ValidateResult>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ValidateResultsIteratorGetNextResponse
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum ValidateResult {
Success(TestSuccess),
Failure(TestFailure),
}
impl ValidateResult {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Success(_) => 1,
Self::Failure(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for ValidateResult {}
#[derive(Clone, Debug)]
pub enum Value {
SignedInt(i64),
UnsignedInt(u64),
Floating(f64),
Text(String),
Boolean(bool),
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u64 },
}
#[macro_export]
macro_rules! ValueUnknown {
() => {
_
};
}
impl PartialEq for Value {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::SignedInt(x), Self::SignedInt(y)) => *x == *y,
(Self::UnsignedInt(x), Self::UnsignedInt(y)) => *x == *y,
(Self::Floating(x), Self::Floating(y)) => *x == *y,
(Self::Text(x), Self::Text(y)) => *x == *y,
(Self::Boolean(x), Self::Boolean(y)) => *x == *y,
_ => false,
}
}
}
impl Value {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::SignedInt(_) => 1,
Self::UnsignedInt(_) => 2,
Self::Floating(_) => 3,
Self::Text(_) => 4,
Self::Boolean(_) => 5,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for Value {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct EncodingPuppetMarker;
impl fidl::endpoints::ProtocolMarker for EncodingPuppetMarker {
type Proxy = EncodingPuppetProxy;
type RequestStream = EncodingPuppetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = EncodingPuppetSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.validate.logs.EncodingPuppet";
}
impl fidl::endpoints::DiscoverableProtocolMarker for EncodingPuppetMarker {}
pub type EncodingPuppetEncodeResult = Result<fidl_fuchsia_mem::Buffer, PuppetError>;
pub trait EncodingPuppetProxyInterface: Send + Sync {
type EncodeResponseFut: std::future::Future<Output = Result<EncodingPuppetEncodeResult, fidl::Error>>
+ Send;
fn r#encode(&self, record: &Record) -> Self::EncodeResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct EncodingPuppetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for EncodingPuppetSynchronousProxy {
type Proxy = EncodingPuppetProxy;
type Protocol = EncodingPuppetMarker;
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 EncodingPuppetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <EncodingPuppetMarker 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<EncodingPuppetEvent, fidl::Error> {
EncodingPuppetEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#encode(
&self,
mut record: &Record,
___deadline: zx::MonotonicInstant,
) -> Result<EncodingPuppetEncodeResult, fidl::Error> {
let _response = self.client.send_query::<
EncodingPuppetEncodeRequest,
fidl::encoding::ResultType<EncodingPuppetEncodeResponse, PuppetError>,
>(
(record,),
0x4486ab9d1bb462f8,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.result))
}
}
#[derive(Debug, Clone)]
pub struct EncodingPuppetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for EncodingPuppetProxy {
type Protocol = EncodingPuppetMarker;
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 EncodingPuppetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> EncodingPuppetEventStream {
EncodingPuppetEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#encode(
&self,
mut record: &Record,
) -> fidl::client::QueryResponseFut<
EncodingPuppetEncodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
EncodingPuppetProxyInterface::r#encode(self, record)
}
}
impl EncodingPuppetProxyInterface for EncodingPuppetProxy {
type EncodeResponseFut = fidl::client::QueryResponseFut<
EncodingPuppetEncodeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#encode(&self, mut record: &Record) -> Self::EncodeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<EncodingPuppetEncodeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<EncodingPuppetEncodeResponse, PuppetError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4486ab9d1bb462f8,
>(_buf?)?;
Ok(_response.map(|x| x.result))
}
self.client
.send_query_and_decode::<EncodingPuppetEncodeRequest, EncodingPuppetEncodeResult>(
(record,),
0x4486ab9d1bb462f8,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct EncodingPuppetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for EncodingPuppetEventStream {}
impl futures::stream::FusedStream for EncodingPuppetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for EncodingPuppetEventStream {
type Item = Result<EncodingPuppetEvent, 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(EncodingPuppetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum EncodingPuppetEvent {}
impl EncodingPuppetEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<EncodingPuppetEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct EncodingPuppetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for EncodingPuppetRequestStream {}
impl futures::stream::FusedStream for EncodingPuppetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for EncodingPuppetRequestStream {
type Protocol = EncodingPuppetMarker;
type ControlHandle = EncodingPuppetControlHandle;
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 {
EncodingPuppetControlHandle { 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 EncodingPuppetRequestStream {
type Item = Result<EncodingPuppetRequest, 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 EncodingPuppetRequestStream 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 {
0x4486ab9d1bb462f8 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
EncodingPuppetEncodeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EncodingPuppetEncodeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
EncodingPuppetControlHandle { inner: this.inner.clone() };
Ok(EncodingPuppetRequest::Encode {
record: req.record,
responder: EncodingPuppetEncodeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum EncodingPuppetRequest {
Encode { record: Record, responder: EncodingPuppetEncodeResponder },
}
impl EncodingPuppetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_encode(self) -> Option<(Record, EncodingPuppetEncodeResponder)> {
if let EncodingPuppetRequest::Encode { record, responder } = self {
Some((record, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
EncodingPuppetRequest::Encode { .. } => "encode",
}
}
}
#[derive(Debug, Clone)]
pub struct EncodingPuppetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for EncodingPuppetControlHandle {
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 EncodingPuppetControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct EncodingPuppetEncodeResponder {
control_handle: std::mem::ManuallyDrop<EncodingPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for EncodingPuppetEncodeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for EncodingPuppetEncodeResponder {
type ControlHandle = EncodingPuppetControlHandle;
fn control_handle(&self) -> &EncodingPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl EncodingPuppetEncodeResponder {
pub fn send(
self,
mut result: Result<fidl_fuchsia_mem::Buffer, PuppetError>,
) -> 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_mem::Buffer, PuppetError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl_fuchsia_mem::Buffer, PuppetError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
EncodingPuppetEncodeResponse,
PuppetError,
>>(
result.as_mut().map_err(|e| *e).map(|result| (result,)),
self.tx_id,
0x4486ab9d1bb462f8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct EncodingValidatorMarker;
impl fidl::endpoints::ProtocolMarker for EncodingValidatorMarker {
type Proxy = EncodingValidatorProxy;
type RequestStream = EncodingValidatorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = EncodingValidatorSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.validate.logs.EncodingValidator";
}
impl fidl::endpoints::DiscoverableProtocolMarker for EncodingValidatorMarker {}
pub trait EncodingValidatorProxyInterface: Send + Sync {
fn r#validate(
&self,
results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct EncodingValidatorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for EncodingValidatorSynchronousProxy {
type Proxy = EncodingValidatorProxy;
type Protocol = EncodingValidatorMarker;
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 EncodingValidatorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<EncodingValidatorMarker 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<EncodingValidatorEvent, fidl::Error> {
EncodingValidatorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#validate(
&self,
mut results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<EncodingValidatorValidateRequest>(
(results,),
0x1ac204a62465f23c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct EncodingValidatorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for EncodingValidatorProxy {
type Protocol = EncodingValidatorMarker;
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 EncodingValidatorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> EncodingValidatorEventStream {
EncodingValidatorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#validate(
&self,
mut results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
) -> Result<(), fidl::Error> {
EncodingValidatorProxyInterface::r#validate(self, results)
}
}
impl EncodingValidatorProxyInterface for EncodingValidatorProxy {
fn r#validate(
&self,
mut results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<EncodingValidatorValidateRequest>(
(results,),
0x1ac204a62465f23c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct EncodingValidatorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for EncodingValidatorEventStream {}
impl futures::stream::FusedStream for EncodingValidatorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for EncodingValidatorEventStream {
type Item = Result<EncodingValidatorEvent, 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(EncodingValidatorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum EncodingValidatorEvent {}
impl EncodingValidatorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<EncodingValidatorEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct EncodingValidatorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for EncodingValidatorRequestStream {}
impl futures::stream::FusedStream for EncodingValidatorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for EncodingValidatorRequestStream {
type Protocol = EncodingValidatorMarker;
type ControlHandle = EncodingValidatorControlHandle;
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 {
EncodingValidatorControlHandle { 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 EncodingValidatorRequestStream {
type Item = Result<EncodingValidatorRequest, 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 EncodingValidatorRequestStream 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 {
0x1ac204a62465f23c => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
EncodingValidatorValidateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EncodingValidatorValidateRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
EncodingValidatorControlHandle { inner: this.inner.clone() };
Ok(EncodingValidatorRequest::Validate {
results: req.results,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum EncodingValidatorRequest {
Validate {
results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
control_handle: EncodingValidatorControlHandle,
},
}
impl EncodingValidatorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_validate(
self,
) -> Option<(
fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
EncodingValidatorControlHandle,
)> {
if let EncodingValidatorRequest::Validate { results, control_handle } = self {
Some((results, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
EncodingValidatorRequest::Validate { .. } => "validate",
}
}
}
#[derive(Debug, Clone)]
pub struct EncodingValidatorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for EncodingValidatorControlHandle {
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 EncodingValidatorControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LogSinkPuppetMarker;
impl fidl::endpoints::ProtocolMarker for LogSinkPuppetMarker {
type Proxy = LogSinkPuppetProxy;
type RequestStream = LogSinkPuppetRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LogSinkPuppetSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.validate.logs.LogSinkPuppet";
}
impl fidl::endpoints::DiscoverableProtocolMarker for LogSinkPuppetMarker {}
pub trait LogSinkPuppetProxyInterface: Send + Sync {
type GetInfoResponseFut: std::future::Future<Output = Result<PuppetInfo, fidl::Error>> + Send;
fn r#get_info(&self) -> Self::GetInfoResponseFut;
type EmitLogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#emit_log(&self, spec: &RecordSpec) -> Self::EmitLogResponseFut;
type StopInterestListenerResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#stop_interest_listener(&self) -> Self::StopInterestListenerResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LogSinkPuppetSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LogSinkPuppetSynchronousProxy {
type Proxy = LogSinkPuppetProxy;
type Protocol = LogSinkPuppetMarker;
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 LogSinkPuppetSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <LogSinkPuppetMarker 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<LogSinkPuppetEvent, fidl::Error> {
LogSinkPuppetEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_info(&self, ___deadline: zx::MonotonicInstant) -> Result<PuppetInfo, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, LogSinkPuppetGetInfoResponse>(
(),
0x5b1c3dac76c26425,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.info)
}
pub fn r#emit_log(
&self,
mut spec: &RecordSpec,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<LogSinkPuppetEmitLogRequest, fidl::encoding::EmptyPayload>(
(spec,),
0x58b64b6672ed66de,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#stop_interest_listener(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x4c69520a50828cbd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct LogSinkPuppetProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LogSinkPuppetProxy {
type Protocol = LogSinkPuppetMarker;
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 LogSinkPuppetProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LogSinkPuppetEventStream {
LogSinkPuppetEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_info(
&self,
) -> fidl::client::QueryResponseFut<PuppetInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
{
LogSinkPuppetProxyInterface::r#get_info(self)
}
pub fn r#emit_log(
&self,
mut spec: &RecordSpec,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LogSinkPuppetProxyInterface::r#emit_log(self, spec)
}
pub fn r#stop_interest_listener(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LogSinkPuppetProxyInterface::r#stop_interest_listener(self)
}
}
impl LogSinkPuppetProxyInterface for LogSinkPuppetProxy {
type GetInfoResponseFut =
fidl::client::QueryResponseFut<PuppetInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_info(&self) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PuppetInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
LogSinkPuppetGetInfoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5b1c3dac76c26425,
>(_buf?)?;
Ok(_response.info)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PuppetInfo>(
(),
0x5b1c3dac76c26425,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type EmitLogResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#emit_log(&self, mut spec: &RecordSpec) -> Self::EmitLogResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x58b64b6672ed66de,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<LogSinkPuppetEmitLogRequest, ()>(
(spec,),
0x58b64b6672ed66de,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopInterestListenerResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#stop_interest_listener(&self) -> Self::StopInterestListenerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4c69520a50828cbd,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x4c69520a50828cbd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct LogSinkPuppetEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LogSinkPuppetEventStream {}
impl futures::stream::FusedStream for LogSinkPuppetEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LogSinkPuppetEventStream {
type Item = Result<LogSinkPuppetEvent, 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(LogSinkPuppetEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LogSinkPuppetEvent {}
impl LogSinkPuppetEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LogSinkPuppetEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LogSinkPuppetRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LogSinkPuppetRequestStream {}
impl futures::stream::FusedStream for LogSinkPuppetRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LogSinkPuppetRequestStream {
type Protocol = LogSinkPuppetMarker;
type ControlHandle = LogSinkPuppetControlHandle;
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 {
LogSinkPuppetControlHandle { 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 LogSinkPuppetRequestStream {
type Item = Result<LogSinkPuppetRequest, 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 LogSinkPuppetRequestStream 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 {
0x5b1c3dac76c26425 => {
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 =
LogSinkPuppetControlHandle { inner: this.inner.clone() };
Ok(LogSinkPuppetRequest::GetInfo {
responder: LogSinkPuppetGetInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x58b64b6672ed66de => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LogSinkPuppetEmitLogRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogSinkPuppetEmitLogRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LogSinkPuppetControlHandle { inner: this.inner.clone() };
Ok(LogSinkPuppetRequest::EmitLog {
spec: req.spec,
responder: LogSinkPuppetEmitLogResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4c69520a50828cbd => {
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 =
LogSinkPuppetControlHandle { inner: this.inner.clone() };
Ok(LogSinkPuppetRequest::StopInterestListener {
responder: LogSinkPuppetStopInterestListenerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LogSinkPuppetRequest {
GetInfo { responder: LogSinkPuppetGetInfoResponder },
EmitLog { spec: RecordSpec, responder: LogSinkPuppetEmitLogResponder },
StopInterestListener { responder: LogSinkPuppetStopInterestListenerResponder },
}
impl LogSinkPuppetRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_info(self) -> Option<(LogSinkPuppetGetInfoResponder)> {
if let LogSinkPuppetRequest::GetInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_emit_log(self) -> Option<(RecordSpec, LogSinkPuppetEmitLogResponder)> {
if let LogSinkPuppetRequest::EmitLog { spec, responder } = self {
Some((spec, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop_interest_listener(
self,
) -> Option<(LogSinkPuppetStopInterestListenerResponder)> {
if let LogSinkPuppetRequest::StopInterestListener { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LogSinkPuppetRequest::GetInfo { .. } => "get_info",
LogSinkPuppetRequest::EmitLog { .. } => "emit_log",
LogSinkPuppetRequest::StopInterestListener { .. } => "stop_interest_listener",
}
}
}
#[derive(Debug, Clone)]
pub struct LogSinkPuppetControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LogSinkPuppetControlHandle {
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 LogSinkPuppetControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogSinkPuppetGetInfoResponder {
control_handle: std::mem::ManuallyDrop<LogSinkPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogSinkPuppetGetInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogSinkPuppetGetInfoResponder {
type ControlHandle = LogSinkPuppetControlHandle;
fn control_handle(&self) -> &LogSinkPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogSinkPuppetGetInfoResponder {
pub fn send(self, mut info: &PuppetInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut info: &PuppetInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut info: &PuppetInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<LogSinkPuppetGetInfoResponse>(
(info,),
self.tx_id,
0x5b1c3dac76c26425,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogSinkPuppetEmitLogResponder {
control_handle: std::mem::ManuallyDrop<LogSinkPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogSinkPuppetEmitLogResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogSinkPuppetEmitLogResponder {
type ControlHandle = LogSinkPuppetControlHandle;
fn control_handle(&self) -> &LogSinkPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogSinkPuppetEmitLogResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x58b64b6672ed66de,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogSinkPuppetStopInterestListenerResponder {
control_handle: std::mem::ManuallyDrop<LogSinkPuppetControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogSinkPuppetStopInterestListenerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogSinkPuppetStopInterestListenerResponder {
type ControlHandle = LogSinkPuppetControlHandle;
fn control_handle(&self) -> &LogSinkPuppetControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogSinkPuppetStopInterestListenerResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x4c69520a50828cbd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ValidateResultsIteratorMarker;
impl fidl::endpoints::ProtocolMarker for ValidateResultsIteratorMarker {
type Proxy = ValidateResultsIteratorProxy;
type RequestStream = ValidateResultsIteratorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ValidateResultsIteratorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) ValidateResultsIterator";
}
pub trait ValidateResultsIteratorProxyInterface: Send + Sync {
type GetNextResponseFut: std::future::Future<Output = Result<ValidateResultsIteratorGetNextResponse, fidl::Error>>
+ Send;
fn r#get_next(&self) -> Self::GetNextResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ValidateResultsIteratorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ValidateResultsIteratorSynchronousProxy {
type Proxy = ValidateResultsIteratorProxy;
type Protocol = ValidateResultsIteratorMarker;
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 ValidateResultsIteratorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<ValidateResultsIteratorMarker 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<ValidateResultsIteratorEvent, fidl::Error> {
ValidateResultsIteratorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_next(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ValidateResultsIteratorGetNextResponse, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, ValidateResultsIteratorGetNextResponse>(
(),
0x1b1573e93311e8b7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct ValidateResultsIteratorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ValidateResultsIteratorProxy {
type Protocol = ValidateResultsIteratorMarker;
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 ValidateResultsIteratorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ValidateResultsIteratorEventStream {
ValidateResultsIteratorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_next(
&self,
) -> fidl::client::QueryResponseFut<
ValidateResultsIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ValidateResultsIteratorProxyInterface::r#get_next(self)
}
}
impl ValidateResultsIteratorProxyInterface for ValidateResultsIteratorProxy {
type GetNextResponseFut = fidl::client::QueryResponseFut<
ValidateResultsIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_next(&self) -> Self::GetNextResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ValidateResultsIteratorGetNextResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ValidateResultsIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1b1573e93311e8b7,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
ValidateResultsIteratorGetNextResponse,
>(
(),
0x1b1573e93311e8b7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ValidateResultsIteratorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ValidateResultsIteratorEventStream {}
impl futures::stream::FusedStream for ValidateResultsIteratorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ValidateResultsIteratorEventStream {
type Item = Result<ValidateResultsIteratorEvent, 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(ValidateResultsIteratorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ValidateResultsIteratorEvent {}
impl ValidateResultsIteratorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ValidateResultsIteratorEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ValidateResultsIteratorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ValidateResultsIteratorRequestStream {}
impl futures::stream::FusedStream for ValidateResultsIteratorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ValidateResultsIteratorRequestStream {
type Protocol = ValidateResultsIteratorMarker;
type ControlHandle = ValidateResultsIteratorControlHandle;
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 {
ValidateResultsIteratorControlHandle { 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 ValidateResultsIteratorRequestStream {
type Item = Result<ValidateResultsIteratorRequest, 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 ValidateResultsIteratorRequestStream 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 {
0x1b1573e93311e8b7 => {
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 = ValidateResultsIteratorControlHandle {
inner: this.inner.clone(),
};
Ok(ValidateResultsIteratorRequest::GetNext {
responder: ValidateResultsIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ValidateResultsIteratorRequest {
GetNext { responder: ValidateResultsIteratorGetNextResponder },
}
impl ValidateResultsIteratorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_next(self) -> Option<(ValidateResultsIteratorGetNextResponder)> {
if let ValidateResultsIteratorRequest::GetNext { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ValidateResultsIteratorRequest::GetNext { .. } => "get_next",
}
}
}
#[derive(Debug, Clone)]
pub struct ValidateResultsIteratorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ValidateResultsIteratorControlHandle {
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 ValidateResultsIteratorControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ValidateResultsIteratorGetNextResponder {
control_handle: std::mem::ManuallyDrop<ValidateResultsIteratorControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ValidateResultsIteratorGetNextResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ValidateResultsIteratorGetNextResponder {
type ControlHandle = ValidateResultsIteratorControlHandle;
fn control_handle(&self) -> &ValidateResultsIteratorControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ValidateResultsIteratorGetNextResponder {
pub fn send(
self,
mut payload: ValidateResultsIteratorGetNextResponse,
) -> 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: ValidateResultsIteratorGetNextResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut payload: ValidateResultsIteratorGetNextResponse,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ValidateResultsIteratorGetNextResponse>(
&mut payload,
self.tx_id,
0x1b1573e93311e8b7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for PuppetError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for PuppetError {
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 PuppetError {
#[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 PuppetError {
#[inline(always)]
fn new_empty() -> Self {
Self::UnsupportedRecord
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Argument {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Argument {
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<Argument, D> for &Argument {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Argument>(offset);
fidl::encoding::Encode::<Argument, D>::encode(
(
<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
T1: fidl::encoding::Encode<Value, D>,
> fidl::encoding::Encode<Argument, 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::<Argument>(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 Argument {
#[inline(always)]
fn new_empty() -> Self {
Self {
name: fidl::new_empty!(fidl::encoding::BoundedString<256>, D),
value: fidl::new_empty!(Value, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::BoundedString<256>,
D,
&mut self.name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(Value, D, &mut self.value, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for EncodingPuppetEncodeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for EncodingPuppetEncodeRequest {
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<EncodingPuppetEncodeRequest, D> for &EncodingPuppetEncodeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<EncodingPuppetEncodeRequest>(offset);
fidl::encoding::Encode::<EncodingPuppetEncodeRequest, D>::encode(
(<Record as fidl::encoding::ValueTypeMarker>::borrow(&self.record),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Record, D>>
fidl::encoding::Encode<EncodingPuppetEncodeRequest, 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::<EncodingPuppetEncodeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for EncodingPuppetEncodeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { record: fidl::new_empty!(Record, 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!(Record, D, &mut self.record, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for EncodingPuppetEncodeResponse {
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 EncodingPuppetEncodeResponse {
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<
EncodingPuppetEncodeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut EncodingPuppetEncodeResponse
{
#[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::<EncodingPuppetEncodeResponse>(offset);
fidl::encoding::Encode::<
EncodingPuppetEncodeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.result,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
EncodingPuppetEncodeResponse,
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::<EncodingPuppetEncodeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for EncodingPuppetEncodeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
result: fidl::new_empty!(
fidl_fuchsia_mem::Buffer,
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_fuchsia_mem::Buffer,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.result,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for EncodingValidatorValidateRequest {
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 EncodingValidatorValidateRequest {
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<
EncodingValidatorValidateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut EncodingValidatorValidateRequest
{
#[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::<EncodingValidatorValidateRequest>(offset);
fidl::encoding::Encode::<
EncodingValidatorValidateRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.results
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
EncodingValidatorValidateRequest,
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::<EncodingValidatorValidateRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for EncodingValidatorValidateRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
results: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.results,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LogSinkPuppetEmitLogRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogSinkPuppetEmitLogRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LogSinkPuppetEmitLogRequest, D> for &LogSinkPuppetEmitLogRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogSinkPuppetEmitLogRequest>(offset);
fidl::encoding::Encode::<LogSinkPuppetEmitLogRequest, D>::encode(
(<RecordSpec as fidl::encoding::ValueTypeMarker>::borrow(&self.spec),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<RecordSpec, D>>
fidl::encoding::Encode<LogSinkPuppetEmitLogRequest, 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::<LogSinkPuppetEmitLogRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LogSinkPuppetEmitLogRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { spec: fidl::new_empty!(RecordSpec, 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!(RecordSpec, D, &mut self.spec, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LogSinkPuppetGetInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogSinkPuppetGetInfoResponse {
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<LogSinkPuppetGetInfoResponse, D> for &LogSinkPuppetGetInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogSinkPuppetGetInfoResponse>(offset);
fidl::encoding::Encode::<LogSinkPuppetGetInfoResponse, D>::encode(
(<PuppetInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PuppetInfo, D>>
fidl::encoding::Encode<LogSinkPuppetGetInfoResponse, 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::<LogSinkPuppetGetInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LogSinkPuppetGetInfoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { info: fidl::new_empty!(PuppetInfo, 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!(PuppetInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PuppetInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PuppetInfo {
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<PuppetInfo, D>
for &PuppetInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PuppetInfo>(offset);
fidl::encoding::Encode::<PuppetInfo, D>::encode(
(
<fidl::encoding::Optional<fidl::encoding::UnboundedString> as fidl::encoding::ValueTypeMarker>::borrow(&self.tag),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedString>, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<PuppetInfo, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PuppetInfo>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PuppetInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
tag: fidl::new_empty!(fidl::encoding::Optional<fidl::encoding::UnboundedString>, D),
pid: fidl::new_empty!(u64, D),
tid: fidl::new_empty!(u64, 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::Optional<fidl::encoding::UnboundedString>,
D,
&mut self.tag,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u64, D, &mut self.pid, decoder, offset + 16, _depth)?;
fidl::decode!(u64, D, &mut self.tid, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Record {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Record {
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<Record, D> for &Record {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Record>(offset);
fidl::encoding::Encode::<Record, D>::encode(
(
<fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
<fidl_fuchsia_diagnostics::Severity as fidl::encoding::ValueTypeMarker>::borrow(&self.severity),
<fidl::encoding::Vector<Argument, 15> as fidl::encoding::ValueTypeMarker>::borrow(&self.arguments),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::BootInstant, D>,
T1: fidl::encoding::Encode<fidl_fuchsia_diagnostics::Severity, D>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<Argument, 15>, D>,
> fidl::encoding::Encode<Record, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Record>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Record {
#[inline(always)]
fn new_empty() -> Self {
Self {
timestamp: fidl::new_empty!(fidl::BootInstant, D),
severity: fidl::new_empty!(fidl_fuchsia_diagnostics::Severity, D),
arguments: fidl::new_empty!(fidl::encoding::Vector<Argument, 15>, 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(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(fidl::BootInstant, D, &mut self.timestamp, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl_fuchsia_diagnostics::Severity,
D,
&mut self.severity,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(fidl::encoding::Vector<Argument, 15>, D, &mut self.arguments, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RecordSpec {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RecordSpec {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RecordSpec, D>
for &RecordSpec
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RecordSpec>(offset);
fidl::encoding::Encode::<RecordSpec, D>::encode(
(
<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
&self.file,
),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.line),
<Record as fidl::encoding::ValueTypeMarker>::borrow(&self.record),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<Record, D>,
> fidl::encoding::Encode<RecordSpec, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RecordSpec>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecordSpec {
#[inline(always)]
fn new_empty() -> Self {
Self {
file: fidl::new_empty!(fidl::encoding::BoundedString<256>, D),
line: fidl::new_empty!(u32, D),
record: fidl::new_empty!(Record, 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<256>,
D,
&mut self.file,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u32, D, &mut self.line, decoder, offset + 16, _depth)?;
fidl::decode!(Record, D, &mut self.record, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TestFailure {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TestFailure {
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<TestFailure, D>
for &TestFailure
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TestFailure>(offset);
fidl::encoding::Encode::<TestFailure, D>::encode(
(
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.test_name,
),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.reason,
),
),
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<TestFailure, 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::<TestFailure>(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 TestFailure {
#[inline(always)]
fn new_empty() -> Self {
Self {
test_name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
reason: 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.test_name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.reason,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TestSuccess {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TestSuccess {
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<TestSuccess, D>
for &TestSuccess
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TestSuccess>(offset);
fidl::encoding::Encode::<TestSuccess, D>::encode(
(<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.test_name,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<TestSuccess, 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::<TestSuccess>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TestSuccess {
#[inline(always)]
fn new_empty() -> Self {
Self { test_name: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.test_name,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl ValidateResultsIteratorGetNextResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.result {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for ValidateResultsIteratorGetNextResponse {
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 ValidateResultsIteratorGetNextResponse {
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<
ValidateResultsIteratorGetNextResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ValidateResultsIteratorGetNextResponse
{
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::<ValidateResultsIteratorGetNextResponse>(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::<
ValidateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.result
.as_ref()
.map(<ValidateResult as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ValidateResultsIteratorGetNextResponse
{
#[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 =
<ValidateResult 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.result.get_or_insert_with(|| {
fidl::new_empty!(ValidateResult, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
ValidateResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ValidateResult {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ValidateResult {
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<ValidateResult, D>
for &ValidateResult
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ValidateResult>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ValidateResult::Success(ref val) => {
fidl::encoding::encode_in_envelope::<TestSuccess, D>(
<TestSuccess as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ValidateResult::Failure(ref val) => {
fidl::encoding::encode_in_envelope::<TestFailure, D>(
<TestFailure as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ValidateResult {
#[inline(always)]
fn new_empty() -> Self {
Self::Success(fidl::new_empty!(TestSuccess, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <TestSuccess as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <TestFailure as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ValidateResult::Success(_) = self {
} else {
*self = ValidateResult::Success(fidl::new_empty!(TestSuccess, D));
}
#[allow(irrefutable_let_patterns)]
if let ValidateResult::Success(ref mut val) = self {
fidl::decode!(TestSuccess, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let ValidateResult::Failure(_) = self {
} else {
*self = ValidateResult::Failure(fidl::new_empty!(TestFailure, D));
}
#[allow(irrefutable_let_patterns)]
if let ValidateResult::Failure(ref mut val) = self {
fidl::decode!(TestFailure, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Value {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Value {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Value, D> for &Value {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Value>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Value::SignedInt(ref val) => {
fidl::encoding::encode_in_envelope::<i64, D>(
<i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Value::UnsignedInt(ref val) => {
fidl::encoding::encode_in_envelope::<u64, D>(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Value::Floating(ref val) => {
fidl::encoding::encode_in_envelope::<f64, D>(
<f64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Value::Text(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<32768>, D>(
<fidl::encoding::BoundedString<32768> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Value::Boolean(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Value::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <fidl::encoding::BoundedString<32768> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let Value::SignedInt(_) = self {
} else {
*self = Value::SignedInt(fidl::new_empty!(i64, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::SignedInt(ref mut val) = self {
fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Value::UnsignedInt(_) = self {
} else {
*self = Value::UnsignedInt(fidl::new_empty!(u64, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::UnsignedInt(ref mut val) = self {
fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Value::Floating(_) = self {
} else {
*self = Value::Floating(fidl::new_empty!(f64, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Floating(ref mut val) = self {
fidl::decode!(f64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Value::Text(_) = self {
} else {
*self =
Value::Text(fidl::new_empty!(fidl::encoding::BoundedString<32768>, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Text(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<32768>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let Value::Boolean(_) = self {
} else {
*self = Value::Boolean(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Value::Boolean(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Value::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
}