#![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 LOG_LEVEL_DEFAULT: LogLevelFilter = LogLevelFilter::Info;
pub const LOG_SEVERITY_MAX_STEP: u8 = 6;
pub const LOG_SEVERITY_STEP_SIZE: u8 = 16;
pub const LOG_VERBOSITY_STEP_SIZE: u8 = 1;
pub const MAX_DATAGRAM_LEN_BYTES: u32 = 32768;
pub const MAX_LOG_MANY_SIZE_BYTES: u64 = 16384;
pub const MAX_TAGS: u8 = 16;
pub const MAX_TAGS_PER_LOG_MESSAGE: u8 = 5;
pub const MAX_TAG_LEN_BYTES: u8 = 63;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum InterestChangeError {
CalledTwice = 1,
}
impl InterestChangeError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::CalledTwice),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(i8)]
pub enum LogLevelFilter {
Trace = 16,
Debug = 32,
Info = 48,
Warn = 64,
Error = 80,
Fatal = 96,
None = 127,
}
impl LogLevelFilter {
#[inline]
pub fn from_primitive(prim: i8) -> Option<Self> {
match prim {
16 => Some(Self::Trace),
32 => Some(Self::Debug),
48 => Some(Self::Info),
64 => Some(Self::Warn),
80 => Some(Self::Error),
96 => Some(Self::Fatal),
127 => Some(Self::None),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> i8 {
self as i8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogDumpLogsSafeRequest {
pub log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
pub options: Option<Box<LogFilterOptions>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LogDumpLogsSafeRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogFilterOptions {
pub filter_by_pid: bool,
pub pid: u64,
pub filter_by_tid: bool,
pub tid: u64,
pub verbosity: u8,
pub min_severity: LogLevelFilter,
pub tags: Vec<String>,
}
impl fidl::Persistable for LogFilterOptions {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogListenSafeRequest {
pub log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
pub options: Option<Box<LogFilterOptions>>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LogListenSafeRequest {}
#[derive(Debug, PartialEq)]
pub struct LogListenSafeWithSelectorsRequest {
pub log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
pub options: Option<Box<LogFilterOptions>>,
pub selectors: Vec<fidl_fuchsia_diagnostics::LogInterestSelector>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LogListenSafeWithSelectorsRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogListenerSafeLogManyRequest {
pub log: Vec<LogMessage>,
}
impl fidl::Persistable for LogListenerSafeLogManyRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogListenerSafeLogRequest {
pub log: LogMessage,
}
impl fidl::Persistable for LogListenerSafeLogRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogMessage {
pub pid: u64,
pub tid: u64,
pub time: fidl::BootInstant,
pub severity: i32,
pub dropped_logs: u32,
pub tags: Vec<String>,
pub msg: String,
}
impl fidl::Persistable for LogMessage {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogSinkConnectRequest {
pub socket: fidl::Socket,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LogSinkConnectRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct LogSinkConnectStructuredRequest {
pub socket: fidl::Socket,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for LogSinkConnectStructuredRequest
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct LogSinkWaitForInterestChangeResponse {
pub data: fidl_fuchsia_diagnostics::Interest,
}
impl fidl::Persistable for LogSinkWaitForInterestChangeResponse {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LogMarker;
impl fidl::endpoints::ProtocolMarker for LogMarker {
type Proxy = LogProxy;
type RequestStream = LogRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LogSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.logger.Log";
}
impl fidl::endpoints::DiscoverableProtocolMarker for LogMarker {}
pub trait LogProxyInterface: Send + Sync {
fn r#listen_safe(
&self,
log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
options: Option<&LogFilterOptions>,
) -> Result<(), fidl::Error>;
fn r#dump_logs_safe(
&self,
log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
options: Option<&LogFilterOptions>,
) -> Result<(), fidl::Error>;
fn r#listen_safe_with_selectors(
&self,
log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
options: Option<&LogFilterOptions>,
selectors: &[fidl_fuchsia_diagnostics::LogInterestSelector],
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LogSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LogSynchronousProxy {
type Proxy = LogProxy;
type Protocol = LogMarker;
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 LogSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <LogMarker 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<LogEvent, fidl::Error> {
LogEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#listen_safe(
&self,
mut log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
mut options: Option<&LogFilterOptions>,
) -> Result<(), fidl::Error> {
self.client.send::<LogListenSafeRequest>(
(log_listener, options),
0x4e523b04952a61b1,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#dump_logs_safe(
&self,
mut log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
mut options: Option<&LogFilterOptions>,
) -> Result<(), fidl::Error> {
self.client.send::<LogDumpLogsSafeRequest>(
(log_listener, options),
0x14e39f9cada72519,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#listen_safe_with_selectors(
&self,
mut log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
mut options: Option<&LogFilterOptions>,
mut selectors: &[fidl_fuchsia_diagnostics::LogInterestSelector],
) -> Result<(), fidl::Error> {
self.client.send::<LogListenSafeWithSelectorsRequest>(
(log_listener, options, selectors),
0x1b365178771a007e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct LogProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LogProxy {
type Protocol = LogMarker;
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 LogProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <LogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LogEventStream {
LogEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#listen_safe(
&self,
mut log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
mut options: Option<&LogFilterOptions>,
) -> Result<(), fidl::Error> {
LogProxyInterface::r#listen_safe(self, log_listener, options)
}
pub fn r#dump_logs_safe(
&self,
mut log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
mut options: Option<&LogFilterOptions>,
) -> Result<(), fidl::Error> {
LogProxyInterface::r#dump_logs_safe(self, log_listener, options)
}
pub fn r#listen_safe_with_selectors(
&self,
mut log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
mut options: Option<&LogFilterOptions>,
mut selectors: &[fidl_fuchsia_diagnostics::LogInterestSelector],
) -> Result<(), fidl::Error> {
LogProxyInterface::r#listen_safe_with_selectors(self, log_listener, options, selectors)
}
}
impl LogProxyInterface for LogProxy {
fn r#listen_safe(
&self,
mut log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
mut options: Option<&LogFilterOptions>,
) -> Result<(), fidl::Error> {
self.client.send::<LogListenSafeRequest>(
(log_listener, options),
0x4e523b04952a61b1,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#dump_logs_safe(
&self,
mut log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
mut options: Option<&LogFilterOptions>,
) -> Result<(), fidl::Error> {
self.client.send::<LogDumpLogsSafeRequest>(
(log_listener, options),
0x14e39f9cada72519,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#listen_safe_with_selectors(
&self,
mut log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
mut options: Option<&LogFilterOptions>,
mut selectors: &[fidl_fuchsia_diagnostics::LogInterestSelector],
) -> Result<(), fidl::Error> {
self.client.send::<LogListenSafeWithSelectorsRequest>(
(log_listener, options, selectors),
0x1b365178771a007e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct LogEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LogEventStream {}
impl futures::stream::FusedStream for LogEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LogEventStream {
type Item = Result<LogEvent, 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(LogEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LogEvent {}
impl LogEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LogEvent, 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: <LogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LogRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LogRequestStream {}
impl futures::stream::FusedStream for LogRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LogRequestStream {
type Protocol = LogMarker;
type ControlHandle = LogControlHandle;
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 {
LogControlHandle { 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 LogRequestStream {
type Item = Result<LogRequest, 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 LogRequestStream 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 {
0x4e523b04952a61b1 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LogListenSafeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogListenSafeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LogControlHandle { inner: this.inner.clone() };
Ok(LogRequest::ListenSafe {
log_listener: req.log_listener,
options: req.options,
control_handle,
})
}
0x14e39f9cada72519 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LogDumpLogsSafeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogDumpLogsSafeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LogControlHandle { inner: this.inner.clone() };
Ok(LogRequest::DumpLogsSafe {
log_listener: req.log_listener,
options: req.options,
control_handle,
})
}
0x1b365178771a007e => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LogListenSafeWithSelectorsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogListenSafeWithSelectorsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LogControlHandle { inner: this.inner.clone() };
Ok(LogRequest::ListenSafeWithSelectors {
log_listener: req.log_listener,
options: req.options,
selectors: req.selectors,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <LogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LogRequest {
ListenSafe {
log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
options: Option<Box<LogFilterOptions>>,
control_handle: LogControlHandle,
},
DumpLogsSafe {
log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
options: Option<Box<LogFilterOptions>>,
control_handle: LogControlHandle,
},
ListenSafeWithSelectors {
log_listener: fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
options: Option<Box<LogFilterOptions>>,
selectors: Vec<fidl_fuchsia_diagnostics::LogInterestSelector>,
control_handle: LogControlHandle,
},
}
impl LogRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_listen_safe(
self,
) -> Option<(
fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
Option<Box<LogFilterOptions>>,
LogControlHandle,
)> {
if let LogRequest::ListenSafe { log_listener, options, control_handle } = self {
Some((log_listener, options, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_dump_logs_safe(
self,
) -> Option<(
fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
Option<Box<LogFilterOptions>>,
LogControlHandle,
)> {
if let LogRequest::DumpLogsSafe { log_listener, options, control_handle } = self {
Some((log_listener, options, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_listen_safe_with_selectors(
self,
) -> Option<(
fidl::endpoints::ClientEnd<LogListenerSafeMarker>,
Option<Box<LogFilterOptions>>,
Vec<fidl_fuchsia_diagnostics::LogInterestSelector>,
LogControlHandle,
)> {
if let LogRequest::ListenSafeWithSelectors {
log_listener,
options,
selectors,
control_handle,
} = self
{
Some((log_listener, options, selectors, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LogRequest::ListenSafe { .. } => "listen_safe",
LogRequest::DumpLogsSafe { .. } => "dump_logs_safe",
LogRequest::ListenSafeWithSelectors { .. } => "listen_safe_with_selectors",
}
}
}
#[derive(Debug, Clone)]
pub struct LogControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LogControlHandle {
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 LogControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LogListenerSafeMarker;
impl fidl::endpoints::ProtocolMarker for LogListenerSafeMarker {
type Proxy = LogListenerSafeProxy;
type RequestStream = LogListenerSafeRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LogListenerSafeSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) LogListenerSafe";
}
pub trait LogListenerSafeProxyInterface: Send + Sync {
type LogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#log(&self, log: &LogMessage) -> Self::LogResponseFut;
type LogManyResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#log_many(&self, log: &[LogMessage]) -> Self::LogManyResponseFut;
fn r#done(&self) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LogListenerSafeSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LogListenerSafeSynchronousProxy {
type Proxy = LogListenerSafeProxy;
type Protocol = LogListenerSafeMarker;
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 LogListenerSafeSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <LogListenerSafeMarker 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<LogListenerSafeEvent, fidl::Error> {
LogListenerSafeEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#log(
&self,
mut log: &LogMessage,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<LogListenerSafeLogRequest, fidl::encoding::EmptyPayload>(
(log,),
0x51a39de355d5bd0a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#log_many(
&self,
mut log: &[LogMessage],
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<LogListenerSafeLogManyRequest, fidl::encoding::EmptyPayload>(
(log,),
0x1f056431bcd626a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#done(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x34986151fcb584b8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct LogListenerSafeProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LogListenerSafeProxy {
type Protocol = LogListenerSafeMarker;
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 LogListenerSafeProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <LogListenerSafeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LogListenerSafeEventStream {
LogListenerSafeEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#log(
&self,
mut log: &LogMessage,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LogListenerSafeProxyInterface::r#log(self, log)
}
pub fn r#log_many(
&self,
mut log: &[LogMessage],
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
LogListenerSafeProxyInterface::r#log_many(self, log)
}
pub fn r#done(&self) -> Result<(), fidl::Error> {
LogListenerSafeProxyInterface::r#done(self)
}
}
impl LogListenerSafeProxyInterface for LogListenerSafeProxy {
type LogResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#log(&self, mut log: &LogMessage) -> Self::LogResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x51a39de355d5bd0a,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<LogListenerSafeLogRequest, ()>(
(log,),
0x51a39de355d5bd0a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type LogManyResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#log_many(&self, mut log: &[LogMessage]) -> Self::LogManyResponseFut {
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,
0x1f056431bcd626a,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<LogListenerSafeLogManyRequest, ()>(
(log,),
0x1f056431bcd626a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#done(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x34986151fcb584b8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct LogListenerSafeEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LogListenerSafeEventStream {}
impl futures::stream::FusedStream for LogListenerSafeEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LogListenerSafeEventStream {
type Item = Result<LogListenerSafeEvent, 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(LogListenerSafeEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LogListenerSafeEvent {}
impl LogListenerSafeEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LogListenerSafeEvent, 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:
<LogListenerSafeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LogListenerSafeRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LogListenerSafeRequestStream {}
impl futures::stream::FusedStream for LogListenerSafeRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LogListenerSafeRequestStream {
type Protocol = LogListenerSafeMarker;
type ControlHandle = LogListenerSafeControlHandle;
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 {
LogListenerSafeControlHandle { 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 LogListenerSafeRequestStream {
type Item = Result<LogListenerSafeRequest, 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 LogListenerSafeRequestStream 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 {
0x51a39de355d5bd0a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LogListenerSafeLogRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogListenerSafeLogRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LogListenerSafeControlHandle { inner: this.inner.clone() };
Ok(LogListenerSafeRequest::Log {
log: req.log,
responder: LogListenerSafeLogResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1f056431bcd626a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
LogListenerSafeLogManyRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogListenerSafeLogManyRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
LogListenerSafeControlHandle { inner: this.inner.clone() };
Ok(LogListenerSafeRequest::LogMany {
log: req.log,
responder: LogListenerSafeLogManyResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x34986151fcb584b8 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
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 =
LogListenerSafeControlHandle { inner: this.inner.clone() };
Ok(LogListenerSafeRequest::Done { control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LogListenerSafeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LogListenerSafeRequest {
Log { log: LogMessage, responder: LogListenerSafeLogResponder },
LogMany { log: Vec<LogMessage>, responder: LogListenerSafeLogManyResponder },
Done { control_handle: LogListenerSafeControlHandle },
}
impl LogListenerSafeRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_log(self) -> Option<(LogMessage, LogListenerSafeLogResponder)> {
if let LogListenerSafeRequest::Log { log, responder } = self {
Some((log, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_log_many(self) -> Option<(Vec<LogMessage>, LogListenerSafeLogManyResponder)> {
if let LogListenerSafeRequest::LogMany { log, responder } = self {
Some((log, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_done(self) -> Option<(LogListenerSafeControlHandle)> {
if let LogListenerSafeRequest::Done { control_handle } = self {
Some((control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LogListenerSafeRequest::Log { .. } => "log",
LogListenerSafeRequest::LogMany { .. } => "log_many",
LogListenerSafeRequest::Done { .. } => "done",
}
}
}
#[derive(Debug, Clone)]
pub struct LogListenerSafeControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LogListenerSafeControlHandle {
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 LogListenerSafeControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogListenerSafeLogResponder {
control_handle: std::mem::ManuallyDrop<LogListenerSafeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogListenerSafeLogResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogListenerSafeLogResponder {
type ControlHandle = LogListenerSafeControlHandle;
fn control_handle(&self) -> &LogListenerSafeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogListenerSafeLogResponder {
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,
0x51a39de355d5bd0a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogListenerSafeLogManyResponder {
control_handle: std::mem::ManuallyDrop<LogListenerSafeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogListenerSafeLogManyResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogListenerSafeLogManyResponder {
type ControlHandle = LogListenerSafeControlHandle;
fn control_handle(&self) -> &LogListenerSafeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogListenerSafeLogManyResponder {
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,
0x1f056431bcd626a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct LogSinkMarker;
impl fidl::endpoints::ProtocolMarker for LogSinkMarker {
type Proxy = LogSinkProxy;
type RequestStream = LogSinkRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = LogSinkSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.logger.LogSink";
}
impl fidl::endpoints::DiscoverableProtocolMarker for LogSinkMarker {}
pub type LogSinkWaitForInterestChangeResult =
Result<fidl_fuchsia_diagnostics::Interest, InterestChangeError>;
pub trait LogSinkProxyInterface: Send + Sync {
fn r#connect(&self, socket: fidl::Socket) -> Result<(), fidl::Error>;
type WaitForInterestChangeResponseFut: std::future::Future<Output = Result<LogSinkWaitForInterestChangeResult, fidl::Error>>
+ Send;
fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut;
fn r#connect_structured(&self, socket: fidl::Socket) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct LogSinkSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for LogSinkSynchronousProxy {
type Proxy = LogSinkProxy;
type Protocol = LogSinkMarker;
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 LogSinkSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <LogSinkMarker 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<LogSinkEvent, fidl::Error> {
LogSinkEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#connect(&self, mut socket: fidl::Socket) -> Result<(), fidl::Error> {
self.client.send::<LogSinkConnectRequest>(
(socket,),
0x64cc4b58ae95c61b,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#wait_for_interest_change(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<LogSinkWaitForInterestChangeResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
LogSinkWaitForInterestChangeResponse,
InterestChangeError,
>>(
(),
0x1dad20560c197242,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.data))
}
pub fn r#connect_structured(&self, mut socket: fidl::Socket) -> Result<(), fidl::Error> {
self.client.send::<LogSinkConnectStructuredRequest>(
(socket,),
0x635424b504b2a74c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct LogSinkProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for LogSinkProxy {
type Protocol = LogSinkMarker;
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 LogSinkProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <LogSinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> LogSinkEventStream {
LogSinkEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#connect(&self, mut socket: fidl::Socket) -> Result<(), fidl::Error> {
LogSinkProxyInterface::r#connect(self, socket)
}
pub fn r#wait_for_interest_change(
&self,
) -> fidl::client::QueryResponseFut<
LogSinkWaitForInterestChangeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
LogSinkProxyInterface::r#wait_for_interest_change(self)
}
pub fn r#connect_structured(&self, mut socket: fidl::Socket) -> Result<(), fidl::Error> {
LogSinkProxyInterface::r#connect_structured(self, socket)
}
}
impl LogSinkProxyInterface for LogSinkProxy {
fn r#connect(&self, mut socket: fidl::Socket) -> Result<(), fidl::Error> {
self.client.send::<LogSinkConnectRequest>(
(socket,),
0x64cc4b58ae95c61b,
fidl::encoding::DynamicFlags::empty(),
)
}
type WaitForInterestChangeResponseFut = fidl::client::QueryResponseFut<
LogSinkWaitForInterestChangeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<LogSinkWaitForInterestChangeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
LogSinkWaitForInterestChangeResponse,
InterestChangeError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1dad20560c197242,
>(_buf?)?;
Ok(_response.map(|x| x.data))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
LogSinkWaitForInterestChangeResult,
>(
(),
0x1dad20560c197242,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#connect_structured(&self, mut socket: fidl::Socket) -> Result<(), fidl::Error> {
self.client.send::<LogSinkConnectStructuredRequest>(
(socket,),
0x635424b504b2a74c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct LogSinkEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for LogSinkEventStream {}
impl futures::stream::FusedStream for LogSinkEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for LogSinkEventStream {
type Item = Result<LogSinkEvent, 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(LogSinkEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum LogSinkEvent {}
impl LogSinkEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<LogSinkEvent, 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: <LogSinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct LogSinkRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for LogSinkRequestStream {}
impl futures::stream::FusedStream for LogSinkRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for LogSinkRequestStream {
type Protocol = LogSinkMarker;
type ControlHandle = LogSinkControlHandle;
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 {
LogSinkControlHandle { 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 LogSinkRequestStream {
type Item = Result<LogSinkRequest, 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 LogSinkRequestStream 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 {
0x64cc4b58ae95c61b => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LogSinkConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogSinkConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LogSinkControlHandle { inner: this.inner.clone() };
Ok(LogSinkRequest::Connect { socket: req.socket, control_handle })
}
0x1dad20560c197242 => {
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 = LogSinkControlHandle { inner: this.inner.clone() };
Ok(LogSinkRequest::WaitForInterestChange {
responder: LogSinkWaitForInterestChangeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x635424b504b2a74c => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
LogSinkConnectStructuredRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogSinkConnectStructuredRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = LogSinkControlHandle { inner: this.inner.clone() };
Ok(LogSinkRequest::ConnectStructured { socket: req.socket, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<LogSinkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum LogSinkRequest {
Connect { socket: fidl::Socket, control_handle: LogSinkControlHandle },
WaitForInterestChange { responder: LogSinkWaitForInterestChangeResponder },
ConnectStructured { socket: fidl::Socket, control_handle: LogSinkControlHandle },
}
impl LogSinkRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_connect(self) -> Option<(fidl::Socket, LogSinkControlHandle)> {
if let LogSinkRequest::Connect { socket, control_handle } = self {
Some((socket, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_wait_for_interest_change(self) -> Option<(LogSinkWaitForInterestChangeResponder)> {
if let LogSinkRequest::WaitForInterestChange { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_connect_structured(self) -> Option<(fidl::Socket, LogSinkControlHandle)> {
if let LogSinkRequest::ConnectStructured { socket, control_handle } = self {
Some((socket, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
LogSinkRequest::Connect { .. } => "connect",
LogSinkRequest::WaitForInterestChange { .. } => "wait_for_interest_change",
LogSinkRequest::ConnectStructured { .. } => "connect_structured",
}
}
}
#[derive(Debug, Clone)]
pub struct LogSinkControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for LogSinkControlHandle {
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 LogSinkControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct LogSinkWaitForInterestChangeResponder {
control_handle: std::mem::ManuallyDrop<LogSinkControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for LogSinkWaitForInterestChangeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for LogSinkWaitForInterestChangeResponder {
type ControlHandle = LogSinkControlHandle;
fn control_handle(&self) -> &LogSinkControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl LogSinkWaitForInterestChangeResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_diagnostics::Interest, InterestChangeError>,
) -> 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_diagnostics::Interest, InterestChangeError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_diagnostics::Interest, InterestChangeError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
LogSinkWaitForInterestChangeResponse,
InterestChangeError,
>>(
result.map(|data| (data,)),
self.tx_id,
0x1dad20560c197242,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for InterestChangeError {
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 InterestChangeError {
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 InterestChangeError
{
#[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 InterestChangeError {
#[inline(always)]
fn new_empty() -> Self {
Self::CalledTwice
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for LogLevelFilter {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<i8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<i8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for LogLevelFilter {
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 LogLevelFilter {
#[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 LogLevelFilter {
#[inline(always)]
fn new_empty() -> Self {
Self::Trace
}
#[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::<i8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LogDumpLogsSafeRequest {
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 LogDumpLogsSafeRequest {
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<
LogDumpLogsSafeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LogDumpLogsSafeRequest
{
#[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::<LogDumpLogsSafeRequest>(offset);
fidl::encoding::Encode::<LogDumpLogsSafeRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.log_listener),
<fidl::encoding::Boxed<LogFilterOptions> as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Boxed<LogFilterOptions>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LogDumpLogsSafeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogDumpLogsSafeRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LogDumpLogsSafeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
log_listener: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
options: fidl::new_empty!(
fidl::encoding::Boxed<LogFilterOptions>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
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 + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.log_listener,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<LogFilterOptions>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LogFilterOptions {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogFilterOptions {
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<LogFilterOptions, D>
for &LogFilterOptions
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogFilterOptions>(offset);
fidl::encoding::Encode::<LogFilterOptions, D>::encode(
(
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.filter_by_pid),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.filter_by_tid),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.verbosity),
<LogLevelFilter as fidl::encoding::ValueTypeMarker>::borrow(&self.min_severity),
<fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.tags),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<bool, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<bool, D>,
T3: fidl::encoding::Encode<u64, D>,
T4: fidl::encoding::Encode<u8, D>,
T5: fidl::encoding::Encode<LogLevelFilter, D>,
T6: fidl::encoding::Encode<
fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
D,
>,
> fidl::encoding::Encode<LogFilterOptions, D> for (T0, T1, T2, T3, T4, T5, T6)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogFilterOptions>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 32, depth)?;
self.5.encode(encoder, offset + 33, depth)?;
self.6.encode(encoder, offset + 40, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogFilterOptions {
#[inline(always)]
fn new_empty() -> Self {
Self {
filter_by_pid: fidl::new_empty!(bool, D),
pid: fidl::new_empty!(u64, D),
filter_by_tid: fidl::new_empty!(bool, D),
tid: fidl::new_empty!(u64, D),
verbosity: fidl::new_empty!(u8, D),
min_severity: fidl::new_empty!(LogLevelFilter, D),
tags: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
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 + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(bool, D, &mut self.filter_by_pid, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.pid, decoder, offset + 8, _depth)?;
fidl::decode!(bool, D, &mut self.filter_by_tid, decoder, offset + 16, _depth)?;
fidl::decode!(u64, D, &mut self.tid, decoder, offset + 24, _depth)?;
fidl::decode!(u8, D, &mut self.verbosity, decoder, offset + 32, _depth)?;
fidl::decode!(LogLevelFilter, D, &mut self.min_severity, decoder, offset + 33, _depth)?;
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 16>,
D,
&mut self.tags,
decoder,
offset + 40,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LogListenSafeRequest {
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 LogListenSafeRequest {
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<LogListenSafeRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut LogListenSafeRequest
{
#[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::<LogListenSafeRequest>(offset);
fidl::encoding::Encode::<LogListenSafeRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.log_listener),
<fidl::encoding::Boxed<LogFilterOptions> as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Boxed<LogFilterOptions>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<LogListenSafeRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogListenSafeRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LogListenSafeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
log_listener: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
options: fidl::new_empty!(
fidl::encoding::Boxed<LogFilterOptions>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
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 + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.log_listener,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<LogFilterOptions>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LogListenSafeWithSelectorsRequest {
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 LogListenSafeWithSelectorsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl
fidl::encoding::Encode<
LogListenSafeWithSelectorsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LogListenSafeWithSelectorsRequest
{
#[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::<LogListenSafeWithSelectorsRequest>(offset);
fidl::encoding::Encode::<LogListenSafeWithSelectorsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.log_listener),
<fidl::encoding::Boxed<LogFilterOptions> as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
<fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.selectors),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Boxed<LogFilterOptions>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LogListenSafeWithSelectorsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogListenSafeWithSelectorsRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LogListenSafeWithSelectorsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
log_listener: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
options: fidl::new_empty!(
fidl::encoding::Boxed<LogFilterOptions>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
selectors: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
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 + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LogListenerSafeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.log_listener,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Boxed<LogFilterOptions>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_diagnostics::LogInterestSelector, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.selectors, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LogListenerSafeLogManyRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogListenerSafeLogManyRequest {
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<LogListenerSafeLogManyRequest, D>
for &LogListenerSafeLogManyRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogListenerSafeLogManyRequest>(offset);
fidl::encoding::Encode::<LogListenerSafeLogManyRequest, D>::encode(
(
<fidl::encoding::UnboundedVector<LogMessage> as fidl::encoding::ValueTypeMarker>::borrow(&self.log),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LogMessage>, D>,
> fidl::encoding::Encode<LogListenerSafeLogManyRequest, 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::<LogListenerSafeLogManyRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LogListenerSafeLogManyRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { log: fidl::new_empty!(fidl::encoding::UnboundedVector<LogMessage>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::UnboundedVector<LogMessage>,
D,
&mut self.log,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LogListenerSafeLogRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogListenerSafeLogRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<LogListenerSafeLogRequest, D> for &LogListenerSafeLogRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogListenerSafeLogRequest>(offset);
fidl::encoding::Encode::<LogListenerSafeLogRequest, D>::encode(
(<LogMessage as fidl::encoding::ValueTypeMarker>::borrow(&self.log),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LogMessage, D>>
fidl::encoding::Encode<LogListenerSafeLogRequest, 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::<LogListenerSafeLogRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LogListenerSafeLogRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { log: fidl::new_empty!(LogMessage, 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!(LogMessage, D, &mut self.log, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LogMessage {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogMessage {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
64
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LogMessage, D>
for &LogMessage
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogMessage>(offset);
fidl::encoding::Encode::<LogMessage, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.pid),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.tid),
<fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.time),
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.severity),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.dropped_logs),
<fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5> as fidl::encoding::ValueTypeMarker>::borrow(&self.tags),
<fidl::encoding::BoundedString<32768> as fidl::encoding::ValueTypeMarker>::borrow(&self.msg),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<fidl::BootInstant, D>,
T3: fidl::encoding::Encode<i32, D>,
T4: fidl::encoding::Encode<u32, D>,
T5: fidl::encoding::Encode<fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>, D>,
T6: fidl::encoding::Encode<fidl::encoding::BoundedString<32768>, D>,
> fidl::encoding::Encode<LogMessage, D> for (T0, T1, T2, T3, T4, T5, T6)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogMessage>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 28, depth)?;
self.5.encode(encoder, offset + 32, depth)?;
self.6.encode(encoder, offset + 48, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LogMessage {
#[inline(always)]
fn new_empty() -> Self {
Self {
pid: fidl::new_empty!(u64, D),
tid: fidl::new_empty!(u64, D),
time: fidl::new_empty!(fidl::BootInstant, D),
severity: fidl::new_empty!(i32, D),
dropped_logs: fidl::new_empty!(u32, D),
tags: fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>,
D
),
msg: fidl::new_empty!(fidl::encoding::BoundedString<32768>, 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!(u64, D, &mut self.pid, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.tid, decoder, offset + 8, _depth)?;
fidl::decode!(fidl::BootInstant, D, &mut self.time, decoder, offset + 16, _depth)?;
fidl::decode!(i32, D, &mut self.severity, decoder, offset + 24, _depth)?;
fidl::decode!(u32, D, &mut self.dropped_logs, decoder, offset + 28, _depth)?;
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::BoundedString<63>, 5>,
D,
&mut self.tags,
decoder,
offset + 32,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<32768>,
D,
&mut self.msg,
decoder,
offset + 48,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LogSinkConnectRequest {
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 LogSinkConnectRequest {
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<LogSinkConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut LogSinkConnectRequest
{
#[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::<LogSinkConnectRequest>(offset);
fidl::encoding::Encode::<
LogSinkConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Socket,
{ fidl::ObjectType::SOCKET.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.socket
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Socket,
{ fidl::ObjectType::SOCKET.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<LogSinkConnectRequest, 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::<LogSinkConnectRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LogSinkConnectRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, 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::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for LogSinkConnectStructuredRequest {
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 LogSinkConnectStructuredRequest {
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<
LogSinkConnectStructuredRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut LogSinkConnectStructuredRequest
{
#[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::<LogSinkConnectStructuredRequest>(offset);
fidl::encoding::Encode::<
LogSinkConnectStructuredRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::HandleType<
fidl::Socket,
{ fidl::ObjectType::SOCKET.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.socket
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Socket,
{ fidl::ObjectType::SOCKET.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
LogSinkConnectStructuredRequest,
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::<LogSinkConnectStructuredRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for LogSinkConnectStructuredRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
socket: fidl::new_empty!(fidl::encoding::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, 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::HandleType<fidl::Socket, { fidl::ObjectType::SOCKET.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.socket, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for LogSinkWaitForInterestChangeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LogSinkWaitForInterestChangeResponse {
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<LogSinkWaitForInterestChangeResponse, D>
for &LogSinkWaitForInterestChangeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LogSinkWaitForInterestChangeResponse>(offset);
fidl::encoding::Encode::<LogSinkWaitForInterestChangeResponse, D>::encode(
(<fidl_fuchsia_diagnostics::Interest as fidl::encoding::ValueTypeMarker>::borrow(
&self.data,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_diagnostics::Interest, D>,
> fidl::encoding::Encode<LogSinkWaitForInterestChangeResponse, 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::<LogSinkWaitForInterestChangeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for LogSinkWaitForInterestChangeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { data: fidl::new_empty!(fidl_fuchsia_diagnostics::Interest, 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_fuchsia_diagnostics::Interest,
D,
&mut self.data,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
}