#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use {
bitflags::bitflags,
fidl::{
client::QueryResponseFut,
endpoints::{ControlHandle as _, Responder as _},
},
fuchsia_zircon_status as zx_status,
futures::future::{self, MaybeDone, TryFutureExt},
};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
pub type ReportId = u8;
pub const MAX_DESC_LEN: u16 = 8192;
pub const MAX_REPORTS_COUNT: u32 = 50;
pub const MAX_REPORT_DATA: u16 = 8192;
pub const MAX_REPORT_LEN: u16 = 8192;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum BootProtocol {
None = 0,
Kbd = 1,
Mouse = 2,
}
impl BootProtocol {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::None),
1 => Some(Self::Kbd),
2 => Some(Self::Mouse),
_ => 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(u8)]
pub enum ReportType {
Input = 1,
Output = 2,
Feature = 3,
}
impl ReportType {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Input),
2 => Some(Self::Output),
3 => Some(Self::Feature),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[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 ControllerOpenSessionRequest {
pub session: fidl::endpoints::ServerEnd<DeviceMarker>,
}
impl fidl::Standalone for ControllerOpenSessionRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceGetBootProtocolResponse {
pub protocol: BootProtocol,
}
impl fidl::Persistable for DeviceGetBootProtocolResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceGetDeviceIdsResponse {
pub ids: DeviceIds,
}
impl fidl::Persistable for DeviceGetDeviceIdsResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceGetDeviceReportsReaderRequest {
pub reader: fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>,
}
impl fidl::Standalone for DeviceGetDeviceReportsReaderRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceGetReportDescResponse {
pub desc: Vec<u8>,
}
impl fidl::Persistable for DeviceGetReportDescResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceGetReportRequest {
pub type_: ReportType,
pub id: u8,
}
impl fidl::Persistable for DeviceGetReportRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceGetReportResponse {
pub status: i32,
pub report: Vec<u8>,
}
impl fidl::Persistable for DeviceGetReportResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceGetReportsEventResponse {
pub status: i32,
pub event: fidl::Event,
}
impl fidl::Standalone for DeviceGetReportsEventResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceIds {
pub vendor_id: u32,
pub product_id: u32,
pub version: u32,
}
impl fidl::Persistable for DeviceIds {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceReadReportResponse {
pub status: i32,
pub data: Vec<u8>,
pub time: i64,
}
impl fidl::Persistable for DeviceReadReportResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceReadReportsResponse {
pub status: i32,
pub data: Vec<u8>,
}
impl fidl::Persistable for DeviceReadReportsResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceReportsReaderReadReportsResponse {
pub reports: Vec<Report>,
}
impl fidl::Persistable for DeviceReportsReaderReadReportsResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceSetReportRequest {
pub type_: ReportType,
pub id: u8,
pub report: Vec<u8>,
}
impl fidl::Persistable for DeviceSetReportRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceSetReportResponse {
pub status: i32,
}
impl fidl::Persistable for DeviceSetReportResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct DeviceSetTraceIdRequest {
pub id: u32,
}
impl fidl::Persistable for DeviceSetTraceIdRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Report {
pub time: i64,
pub data: Vec<u8>,
}
impl fidl::Persistable for Report {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ControllerMarker;
impl fidl::endpoints::ProtocolMarker for ControllerMarker {
type Proxy = ControllerProxy;
type RequestStream = ControllerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ControllerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Controller";
}
pub trait ControllerProxyInterface: Send + Sync {
fn r#open_session(
&self,
session: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ControllerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
type Proxy = ControllerProxy;
type Protocol = ControllerMarker;
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 ControllerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ControllerMarker 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::Time) -> Result<ControllerEvent, fidl::Error> {
ControllerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#open_session(
&self,
mut session: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ControllerOpenSessionRequest>(
(session,),
0x404db87008999427,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct ControllerProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for ControllerProxy {
type Protocol = ControllerMarker;
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 ControllerProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ControllerEventStream {
ControllerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#open_session(
&self,
mut session: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
ControllerProxyInterface::r#open_session(self, session)
}
}
impl ControllerProxyInterface for ControllerProxy {
fn r#open_session(
&self,
mut session: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ControllerOpenSessionRequest>(
(session,),
0x404db87008999427,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct ControllerEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for ControllerEventStream {}
impl futures::stream::FusedStream for ControllerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ControllerEventStream {
type Item = Result<ControllerEvent, 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(ControllerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ControllerEvent {}
impl ControllerEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<ControllerEvent, 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: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ControllerRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for ControllerRequestStream {}
impl futures::stream::FusedStream for ControllerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ControllerRequestStream {
type Protocol = ControllerMarker;
type ControlHandle = ControllerControlHandle;
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 {
ControllerControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ControllerRequestStream {
type Item = Result<ControllerRequest, 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 ControllerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x404db87008999427 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(ControllerOpenSessionRequest);
fidl::encoding::Decoder::decode_into::<ControllerOpenSessionRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::OpenSession { session: req.session, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum ControllerRequest {
OpenSession {
session: fidl::endpoints::ServerEnd<DeviceMarker>,
control_handle: ControllerControlHandle,
},
}
impl ControllerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_open_session(
self,
) -> Option<(fidl::endpoints::ServerEnd<DeviceMarker>, ControllerControlHandle)> {
if let ControllerRequest::OpenSession { session, control_handle } = self {
Some((session, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ControllerRequest::OpenSession { .. } => "open_session",
}
}
}
#[derive(Debug, Clone)]
pub struct ControllerControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for ControllerControlHandle {
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()
}
}
impl ControllerControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DeviceMarker;
impl fidl::endpoints::ProtocolMarker for DeviceMarker {
type Proxy = DeviceProxy;
type RequestStream = DeviceRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DeviceSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Device";
}
pub type DeviceGetDeviceReportsReaderResult = Result<(), i32>;
pub trait DeviceProxyInterface: Send + Sync {
type GetBootProtocolResponseFut: std::future::Future<Output = Result<BootProtocol, fidl::Error>>
+ Send;
fn r#get_boot_protocol(&self) -> Self::GetBootProtocolResponseFut;
type GetDeviceIdsResponseFut: std::future::Future<Output = Result<DeviceIds, fidl::Error>>
+ Send;
fn r#get_device_ids(&self) -> Self::GetDeviceIdsResponseFut;
type GetReportDescResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
fn r#get_report_desc(&self) -> Self::GetReportDescResponseFut;
type GetDeviceReportsReaderResponseFut: std::future::Future<Output = Result<DeviceGetDeviceReportsReaderResult, fidl::Error>>
+ Send;
fn r#get_device_reports_reader(
&self,
reader: fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>,
) -> Self::GetDeviceReportsReaderResponseFut;
type ReadReportResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>, i64), fidl::Error>>
+ Send;
fn r#read_report(&self) -> Self::ReadReportResponseFut;
type ReadReportsResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
+ Send;
fn r#read_reports(&self) -> Self::ReadReportsResponseFut;
type GetReportsEventResponseFut: std::future::Future<Output = Result<(i32, fidl::Event), fidl::Error>>
+ Send;
fn r#get_reports_event(&self) -> Self::GetReportsEventResponseFut;
type GetReportResponseFut: std::future::Future<Output = Result<(i32, Vec<u8>), fidl::Error>>
+ Send;
fn r#get_report(&self, type_: ReportType, id: u8) -> Self::GetReportResponseFut;
type SetReportResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_report(&self, type_: ReportType, id: u8, report: &[u8]) -> Self::SetReportResponseFut;
fn r#set_trace_id(&self, id: u32) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DeviceSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DeviceSynchronousProxy {
type Proxy = DeviceProxy;
type Protocol = DeviceMarker;
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 DeviceSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DeviceMarker 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::Time) -> Result<DeviceEvent, fidl::Error> {
DeviceEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_boot_protocol(&self, ___deadline: zx::Time) -> Result<BootProtocol, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceGetBootProtocolResponse>(
(),
0x54f14ad662c6899f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.protocol)
}
pub fn r#get_device_ids(&self, ___deadline: zx::Time) -> Result<DeviceIds, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceGetDeviceIdsResponse>(
(),
0x3b2d696caef3c3e0,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.ids)
}
pub fn r#get_report_desc(&self, ___deadline: zx::Time) -> Result<Vec<u8>, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceGetReportDescResponse>(
(),
0x7fe4aff57d9019f8,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.desc)
}
pub fn r#get_device_reports_reader(
&self,
mut reader: fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>,
___deadline: zx::Time,
) -> Result<DeviceGetDeviceReportsReaderResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceGetDeviceReportsReaderRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(reader,),
0x67aee4993bb823ee,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#read_report(&self, ___deadline: zx::Time) -> Result<(i32, Vec<u8>, i64), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceReadReportResponse>(
(),
0x69871e1e2b75e46f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.data, _response.time))
}
pub fn r#read_reports(&self, ___deadline: zx::Time) -> Result<(i32, Vec<u8>), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceReadReportsResponse>(
(),
0x6e20cf64707a4ee4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.data))
}
pub fn r#get_reports_event(
&self,
___deadline: zx::Time,
) -> Result<(i32, fidl::Event), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceGetReportsEventResponse>(
(),
0x6198970f9308041c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.event))
}
pub fn r#get_report(
&self,
mut type_: ReportType,
mut id: u8,
___deadline: zx::Time,
) -> Result<(i32, Vec<u8>), fidl::Error> {
let _response = self.client.send_query::<DeviceGetReportRequest, DeviceGetReportResponse>(
(type_, id),
0x5b2a44555defd970,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok((_response.status, _response.report))
}
pub fn r#set_report(
&self,
mut type_: ReportType,
mut id: u8,
mut report: &[u8],
___deadline: zx::Time,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<DeviceSetReportRequest, DeviceSetReportResponse>(
(type_, id, report),
0x51cc85eb4e769ee,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#set_trace_id(&self, mut id: u32) -> Result<(), fidl::Error> {
self.client.send::<DeviceSetTraceIdRequest>(
(id,),
0x7fe8815219c66700,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct DeviceProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for DeviceProxy {
type Protocol = DeviceMarker;
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 DeviceProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DeviceEventStream {
DeviceEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_boot_protocol(&self) -> fidl::client::QueryResponseFut<BootProtocol> {
DeviceProxyInterface::r#get_boot_protocol(self)
}
pub fn r#get_device_ids(&self) -> fidl::client::QueryResponseFut<DeviceIds> {
DeviceProxyInterface::r#get_device_ids(self)
}
pub fn r#get_report_desc(&self) -> fidl::client::QueryResponseFut<Vec<u8>> {
DeviceProxyInterface::r#get_report_desc(self)
}
pub fn r#get_device_reports_reader(
&self,
mut reader: fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>,
) -> fidl::client::QueryResponseFut<DeviceGetDeviceReportsReaderResult> {
DeviceProxyInterface::r#get_device_reports_reader(self, reader)
}
pub fn r#read_report(&self) -> fidl::client::QueryResponseFut<(i32, Vec<u8>, i64)> {
DeviceProxyInterface::r#read_report(self)
}
pub fn r#read_reports(&self) -> fidl::client::QueryResponseFut<(i32, Vec<u8>)> {
DeviceProxyInterface::r#read_reports(self)
}
pub fn r#get_reports_event(&self) -> fidl::client::QueryResponseFut<(i32, fidl::Event)> {
DeviceProxyInterface::r#get_reports_event(self)
}
pub fn r#get_report(
&self,
mut type_: ReportType,
mut id: u8,
) -> fidl::client::QueryResponseFut<(i32, Vec<u8>)> {
DeviceProxyInterface::r#get_report(self, type_, id)
}
pub fn r#set_report(
&self,
mut type_: ReportType,
mut id: u8,
mut report: &[u8],
) -> fidl::client::QueryResponseFut<i32> {
DeviceProxyInterface::r#set_report(self, type_, id, report)
}
pub fn r#set_trace_id(&self, mut id: u32) -> Result<(), fidl::Error> {
DeviceProxyInterface::r#set_trace_id(self, id)
}
}
impl DeviceProxyInterface for DeviceProxy {
type GetBootProtocolResponseFut = fidl::client::QueryResponseFut<BootProtocol>;
fn r#get_boot_protocol(&self) -> Self::GetBootProtocolResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<BootProtocol, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceGetBootProtocolResponse,
0x54f14ad662c6899f,
>(_buf?)?;
Ok(_response.protocol)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, BootProtocol>(
(),
0x54f14ad662c6899f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetDeviceIdsResponseFut = fidl::client::QueryResponseFut<DeviceIds>;
fn r#get_device_ids(&self) -> Self::GetDeviceIdsResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DeviceIds, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceGetDeviceIdsResponse,
0x3b2d696caef3c3e0,
>(_buf?)?;
Ok(_response.ids)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DeviceIds>(
(),
0x3b2d696caef3c3e0,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetReportDescResponseFut = fidl::client::QueryResponseFut<Vec<u8>>;
fn r#get_report_desc(&self) -> Self::GetReportDescResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceGetReportDescResponse,
0x7fe4aff57d9019f8,
>(_buf?)?;
Ok(_response.desc)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
(),
0x7fe4aff57d9019f8,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetDeviceReportsReaderResponseFut =
fidl::client::QueryResponseFut<DeviceGetDeviceReportsReaderResult>;
fn r#get_device_reports_reader(
&self,
mut reader: fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>,
) -> Self::GetDeviceReportsReaderResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DeviceGetDeviceReportsReaderResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x67aee4993bb823ee,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
DeviceGetDeviceReportsReaderRequest,
DeviceGetDeviceReportsReaderResult,
>(
(reader,),
0x67aee4993bb823ee,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ReadReportResponseFut = fidl::client::QueryResponseFut<(i32, Vec<u8>, i64)>;
fn r#read_report(&self) -> Self::ReadReportResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Vec<u8>, i64), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceReadReportResponse,
0x69871e1e2b75e46f,
>(_buf?)?;
Ok((_response.status, _response.data, _response.time))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Vec<u8>, i64)>(
(),
0x69871e1e2b75e46f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ReadReportsResponseFut = fidl::client::QueryResponseFut<(i32, Vec<u8>)>;
fn r#read_reports(&self) -> Self::ReadReportsResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Vec<u8>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceReadReportsResponse,
0x6e20cf64707a4ee4,
>(_buf?)?;
Ok((_response.status, _response.data))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, Vec<u8>)>(
(),
0x6e20cf64707a4ee4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetReportsEventResponseFut = fidl::client::QueryResponseFut<(i32, fidl::Event)>;
fn r#get_reports_event(&self) -> Self::GetReportsEventResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, fidl::Event), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceGetReportsEventResponse,
0x6198970f9308041c,
>(_buf?)?;
Ok((_response.status, _response.event))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (i32, fidl::Event)>(
(),
0x6198970f9308041c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetReportResponseFut = fidl::client::QueryResponseFut<(i32, Vec<u8>)>;
fn r#get_report(&self, mut type_: ReportType, mut id: u8) -> Self::GetReportResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<(i32, Vec<u8>), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceGetReportResponse,
0x5b2a44555defd970,
>(_buf?)?;
Ok((_response.status, _response.report))
}
self.client.send_query_and_decode::<DeviceGetReportRequest, (i32, Vec<u8>)>(
(type_, id),
0x5b2a44555defd970,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetReportResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#set_report(
&self,
mut type_: ReportType,
mut id: u8,
mut report: &[u8],
) -> Self::SetReportResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceSetReportResponse,
0x51cc85eb4e769ee,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<DeviceSetReportRequest, i32>(
(type_, id, report),
0x51cc85eb4e769ee,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#set_trace_id(&self, mut id: u32) -> Result<(), fidl::Error> {
self.client.send::<DeviceSetTraceIdRequest>(
(id,),
0x7fe8815219c66700,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct DeviceEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for DeviceEventStream {}
impl futures::stream::FusedStream for DeviceEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DeviceEventStream {
type Item = Result<DeviceEvent, 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(DeviceEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DeviceEvent {}
impl DeviceEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<DeviceEvent, 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: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DeviceRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for DeviceRequestStream {}
impl futures::stream::FusedStream for DeviceRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DeviceRequestStream {
type Protocol = DeviceMarker;
type ControlHandle = DeviceControlHandle;
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 {
DeviceControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for DeviceRequestStream {
type Item = Result<DeviceRequest, 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 DeviceRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x54f14ad662c6899f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetBootProtocol {
responder: DeviceGetBootProtocolResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3b2d696caef3c3e0 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetDeviceIds {
responder: DeviceGetDeviceIdsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7fe4aff57d9019f8 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetReportDesc {
responder: DeviceGetReportDescResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x67aee4993bb823ee => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DeviceGetDeviceReportsReaderRequest);
fidl::encoding::Decoder::decode_into::<DeviceGetDeviceReportsReaderRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetDeviceReportsReader {
reader: req.reader,
responder: DeviceGetDeviceReportsReaderResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x69871e1e2b75e46f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::ReadReport {
responder: DeviceReadReportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6e20cf64707a4ee4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::ReadReports {
responder: DeviceReadReportsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6198970f9308041c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetReportsEvent {
responder: DeviceGetReportsEventResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5b2a44555defd970 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DeviceGetReportRequest);
fidl::encoding::Decoder::decode_into::<DeviceGetReportRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetReport {
type_: req.type_,
id: req.id,
responder: DeviceGetReportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x51cc85eb4e769ee => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DeviceSetReportRequest);
fidl::encoding::Decoder::decode_into::<DeviceSetReportRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::SetReport {
type_: req.type_,
id: req.id,
report: req.report,
responder: DeviceSetReportResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7fe8815219c66700 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(DeviceSetTraceIdRequest);
fidl::encoding::Decoder::decode_into::<DeviceSetTraceIdRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::SetTraceId { id: req.id, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum DeviceRequest {
GetBootProtocol { responder: DeviceGetBootProtocolResponder },
GetDeviceIds { responder: DeviceGetDeviceIdsResponder },
GetReportDesc { responder: DeviceGetReportDescResponder },
GetDeviceReportsReader {
reader: fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>,
responder: DeviceGetDeviceReportsReaderResponder,
},
ReadReport { responder: DeviceReadReportResponder },
ReadReports { responder: DeviceReadReportsResponder },
GetReportsEvent { responder: DeviceGetReportsEventResponder },
GetReport { type_: ReportType, id: u8, responder: DeviceGetReportResponder },
SetReport { type_: ReportType, id: u8, report: Vec<u8>, responder: DeviceSetReportResponder },
SetTraceId { id: u32, control_handle: DeviceControlHandle },
}
impl DeviceRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_boot_protocol(self) -> Option<(DeviceGetBootProtocolResponder)> {
if let DeviceRequest::GetBootProtocol { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_device_ids(self) -> Option<(DeviceGetDeviceIdsResponder)> {
if let DeviceRequest::GetDeviceIds { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_report_desc(self) -> Option<(DeviceGetReportDescResponder)> {
if let DeviceRequest::GetReportDesc { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_device_reports_reader(
self,
) -> Option<(
fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>,
DeviceGetDeviceReportsReaderResponder,
)> {
if let DeviceRequest::GetDeviceReportsReader { reader, responder } = self {
Some((reader, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_read_report(self) -> Option<(DeviceReadReportResponder)> {
if let DeviceRequest::ReadReport { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_read_reports(self) -> Option<(DeviceReadReportsResponder)> {
if let DeviceRequest::ReadReports { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_reports_event(self) -> Option<(DeviceGetReportsEventResponder)> {
if let DeviceRequest::GetReportsEvent { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_report(self) -> Option<(ReportType, u8, DeviceGetReportResponder)> {
if let DeviceRequest::GetReport { type_, id, responder } = self {
Some((type_, id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_report(self) -> Option<(ReportType, u8, Vec<u8>, DeviceSetReportResponder)> {
if let DeviceRequest::SetReport { type_, id, report, responder } = self {
Some((type_, id, report, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_trace_id(self) -> Option<(u32, DeviceControlHandle)> {
if let DeviceRequest::SetTraceId { id, control_handle } = self {
Some((id, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DeviceRequest::GetBootProtocol { .. } => "get_boot_protocol",
DeviceRequest::GetDeviceIds { .. } => "get_device_ids",
DeviceRequest::GetReportDesc { .. } => "get_report_desc",
DeviceRequest::GetDeviceReportsReader { .. } => "get_device_reports_reader",
DeviceRequest::ReadReport { .. } => "read_report",
DeviceRequest::ReadReports { .. } => "read_reports",
DeviceRequest::GetReportsEvent { .. } => "get_reports_event",
DeviceRequest::GetReport { .. } => "get_report",
DeviceRequest::SetReport { .. } => "set_report",
DeviceRequest::SetTraceId { .. } => "set_trace_id",
}
}
}
#[derive(Debug, Clone)]
pub struct DeviceControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for DeviceControlHandle {
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()
}
}
impl DeviceControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceGetBootProtocolResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetBootProtocolResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetBootProtocolResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceGetBootProtocolResponder {
pub fn send(self, mut protocol: BootProtocol) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut protocol: BootProtocol) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut protocol: BootProtocol) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceGetBootProtocolResponse>(
(protocol,),
self.tx_id,
0x54f14ad662c6899f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceGetDeviceIdsResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetDeviceIdsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetDeviceIdsResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceGetDeviceIdsResponder {
pub fn send(self, mut ids: &DeviceIds) -> Result<(), fidl::Error> {
let _result = self.send_raw(ids);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut ids: &DeviceIds) -> Result<(), fidl::Error> {
let _result = self.send_raw(ids);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut ids: &DeviceIds) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceGetDeviceIdsResponse>(
(ids,),
self.tx_id,
0x3b2d696caef3c3e0,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceGetReportDescResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetReportDescResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetReportDescResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceGetReportDescResponder {
pub fn send(self, mut desc: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(desc);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut desc: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(desc);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut desc: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceGetReportDescResponse>(
(desc,),
self.tx_id,
0x7fe4aff57d9019f8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceGetDeviceReportsReaderResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetDeviceReportsReaderResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetDeviceReportsReaderResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceGetDeviceReportsReaderResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x67aee4993bb823ee,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceReadReportResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceReadReportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceReadReportResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceReadReportResponder {
pub fn send(self, mut status: i32, mut data: &[u8], mut time: i64) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, data, time);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut data: &[u8],
mut time: i64,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, data, time);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32, mut data: &[u8], mut time: i64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceReadReportResponse>(
(status, data, time),
self.tx_id,
0x69871e1e2b75e46f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceReadReportsResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceReadReportsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceReadReportsResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceReadReportsResponder {
pub fn send(self, mut status: i32, mut data: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, data);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut data: &[u8],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, data);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32, mut data: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceReadReportsResponse>(
(status, data),
self.tx_id,
0x6e20cf64707a4ee4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceGetReportsEventResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetReportsEventResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetReportsEventResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceGetReportsEventResponder {
pub fn send(self, mut status: i32, mut event: fidl::Event) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, event);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut event: fidl::Event,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, event);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32, mut event: fidl::Event) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceGetReportsEventResponse>(
(status, event),
self.tx_id,
0x6198970f9308041c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceGetReportResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetReportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetReportResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceGetReportResponder {
pub fn send(self, mut status: i32, mut report: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, report);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut status: i32,
mut report: &[u8],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(status, report);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32, mut report: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceGetReportResponse>(
(status, report),
self.tx_id,
0x5b2a44555defd970,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceSetReportResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceSetReportResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceSetReportResponder {
type ControlHandle = DeviceControlHandle;
fn control_handle(&self) -> &DeviceControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceSetReportResponder {
pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceSetReportResponse>(
(status,),
self.tx_id,
0x51cc85eb4e769ee,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DeviceReportsReaderMarker;
impl fidl::endpoints::ProtocolMarker for DeviceReportsReaderMarker {
type Proxy = DeviceReportsReaderProxy;
type RequestStream = DeviceReportsReaderRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DeviceReportsReaderSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DeviceReportsReader";
}
pub type DeviceReportsReaderReadReportsResult = Result<Vec<Report>, i32>;
pub trait DeviceReportsReaderProxyInterface: Send + Sync {
type ReadReportsResponseFut: std::future::Future<Output = Result<DeviceReportsReaderReadReportsResult, fidl::Error>>
+ Send;
fn r#read_reports(&self) -> Self::ReadReportsResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DeviceReportsReaderSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DeviceReportsReaderSynchronousProxy {
type Proxy = DeviceReportsReaderProxy;
type Protocol = DeviceReportsReaderMarker;
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 DeviceReportsReaderSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<DeviceReportsReaderMarker 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::Time,
) -> Result<DeviceReportsReaderEvent, fidl::Error> {
DeviceReportsReaderEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#read_reports(
&self,
___deadline: zx::Time,
) -> Result<DeviceReportsReaderReadReportsResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<DeviceReportsReaderReadReportsResponse, i32>,
>(
(),
0x36077c1b177d4291,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.reports))
}
}
#[derive(Debug, Clone)]
pub struct DeviceReportsReaderProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for DeviceReportsReaderProxy {
type Protocol = DeviceReportsReaderMarker;
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 DeviceReportsReaderProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name =
<DeviceReportsReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DeviceReportsReaderEventStream {
DeviceReportsReaderEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#read_reports(
&self,
) -> fidl::client::QueryResponseFut<DeviceReportsReaderReadReportsResult> {
DeviceReportsReaderProxyInterface::r#read_reports(self)
}
}
impl DeviceReportsReaderProxyInterface for DeviceReportsReaderProxy {
type ReadReportsResponseFut =
fidl::client::QueryResponseFut<DeviceReportsReaderReadReportsResult>;
fn r#read_reports(&self) -> Self::ReadReportsResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DeviceReportsReaderReadReportsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceReportsReaderReadReportsResponse, i32>,
0x36077c1b177d4291,
>(_buf?)?;
Ok(_response.map(|x| x.reports))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
DeviceReportsReaderReadReportsResult,
>(
(),
0x36077c1b177d4291,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DeviceReportsReaderEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for DeviceReportsReaderEventStream {}
impl futures::stream::FusedStream for DeviceReportsReaderEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DeviceReportsReaderEventStream {
type Item = Result<DeviceReportsReaderEvent, 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(DeviceReportsReaderEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DeviceReportsReaderEvent {}
impl DeviceReportsReaderEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<DeviceReportsReaderEvent, 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:
<DeviceReportsReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DeviceReportsReaderRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for DeviceReportsReaderRequestStream {}
impl futures::stream::FusedStream for DeviceReportsReaderRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DeviceReportsReaderRequestStream {
type Protocol = DeviceReportsReaderMarker;
type ControlHandle = DeviceReportsReaderControlHandle;
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 {
DeviceReportsReaderControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for DeviceReportsReaderRequestStream {
type Item = Result<DeviceReportsReaderRequest, 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 DeviceReportsReaderRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|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))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x36077c1b177d4291 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload);
fidl::encoding::Decoder::decode_into::<fidl::encoding::EmptyPayload>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle =
DeviceReportsReaderControlHandle { inner: this.inner.clone() };
Ok(DeviceReportsReaderRequest::ReadReports {
responder: DeviceReportsReaderReadReportsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DeviceReportsReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum DeviceReportsReaderRequest {
ReadReports { responder: DeviceReportsReaderReadReportsResponder },
}
impl DeviceReportsReaderRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_read_reports(self) -> Option<(DeviceReportsReaderReadReportsResponder)> {
if let DeviceReportsReaderRequest::ReadReports { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DeviceReportsReaderRequest::ReadReports { .. } => "read_reports",
}
}
}
#[derive(Debug, Clone)]
pub struct DeviceReportsReaderControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for DeviceReportsReaderControlHandle {
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()
}
}
impl DeviceReportsReaderControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceReportsReaderReadReportsResponder {
control_handle: std::mem::ManuallyDrop<DeviceReportsReaderControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceReportsReaderReadReportsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceReportsReaderReadReportsResponder {
type ControlHandle = DeviceReportsReaderControlHandle;
fn control_handle(&self) -> &DeviceReportsReaderControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DeviceReportsReaderReadReportsResponder {
pub fn send(self, mut result: Result<&[Report], i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[Report], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[Report], i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
DeviceReportsReaderReadReportsResponse,
i32,
>>(
result.map(|reports| (reports,)),
self.tx_id,
0x36077c1b177d4291,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for BootProtocol {
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 BootProtocol {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for BootProtocol {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for BootProtocol {
#[inline(always)]
fn new_empty() -> Self {
Self::None
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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 ReportType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ReportType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
*value
}
}
unsafe impl fidl::encoding::Encode<Self> for ReportType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ReportType {
#[inline(always)]
fn new_empty() -> Self {
Self::Input
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerOpenSessionRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ResourceTypeMarker for ControllerOpenSessionRequest {
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::Encode<ControllerOpenSessionRequest>
for &mut ControllerOpenSessionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerOpenSessionRequest>(offset);
fidl::encoding::Encode::<ControllerOpenSessionRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.session),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
>,
> fidl::encoding::Encode<ControllerOpenSessionRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerOpenSessionRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for ControllerOpenSessionRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
session: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
&mut self.session,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetBootProtocolResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for DeviceGetBootProtocolResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceGetBootProtocolResponse>
for &DeviceGetBootProtocolResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetBootProtocolResponse>(offset);
fidl::encoding::Encode::<DeviceGetBootProtocolResponse>::encode(
(<BootProtocol as fidl::encoding::ValueTypeMarker>::borrow(&self.protocol),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<BootProtocol>>
fidl::encoding::Encode<DeviceGetBootProtocolResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetBootProtocolResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceGetBootProtocolResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { protocol: fidl::new_empty!(BootProtocol) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(BootProtocol, &mut self.protocol, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetDeviceIdsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for DeviceGetDeviceIdsResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceGetDeviceIdsResponse> for &DeviceGetDeviceIdsResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetDeviceIdsResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceGetDeviceIdsResponse)
.write_unaligned((self as *const DeviceGetDeviceIdsResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<DeviceIds>>
fidl::encoding::Encode<DeviceGetDeviceIdsResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetDeviceIdsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceGetDeviceIdsResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { ids: fidl::new_empty!(DeviceIds) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetDeviceReportsReaderRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceGetDeviceReportsReaderRequest {
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::Encode<DeviceGetDeviceReportsReaderRequest>
for &mut DeviceGetDeviceReportsReaderRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetDeviceReportsReaderRequest>(offset);
fidl::encoding::Encode::<DeviceGetDeviceReportsReaderRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.reader),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>>,
>,
> fidl::encoding::Encode<DeviceGetDeviceReportsReaderRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetDeviceReportsReaderRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceGetDeviceReportsReaderRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
reader: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>>
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceReportsReaderMarker>>,
&mut self.reader,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetReportDescResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceGetReportDescResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceGetReportDescResponse> for &DeviceGetReportDescResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetReportDescResponse>(offset);
fidl::encoding::Encode::<DeviceGetReportDescResponse>::encode(
(<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.desc,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>>>
fidl::encoding::Encode<DeviceGetReportDescResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetReportDescResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceGetReportDescResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { desc: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u8, 8192>, &mut self.desc, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetReportRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
}
impl fidl::encoding::ValueTypeMarker for DeviceGetReportRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceGetReportRequest> for &DeviceGetReportRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetReportRequest>(offset);
fidl::encoding::Encode::<DeviceGetReportRequest>::encode(
(
<ReportType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<ReportType>, T1: fidl::encoding::Encode<u8>>
fidl::encoding::Encode<DeviceGetReportRequest> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetReportRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceGetReportRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { type_: fidl::new_empty!(ReportType), id: fidl::new_empty!(u8) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(ReportType, &mut self.type_, decoder, offset + 0, _depth)?;
fidl::decode!(u8, &mut self.id, decoder, offset + 1, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetReportResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
impl fidl::encoding::ValueTypeMarker for DeviceGetReportResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceGetReportResponse> for &DeviceGetReportResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetReportResponse>(offset);
fidl::encoding::Encode::<DeviceGetReportResponse>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.report,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>>,
> fidl::encoding::Encode<DeviceGetReportResponse> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetReportResponse>(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> for DeviceGetReportResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32),
report: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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!(i32, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 8192>, &mut self.report, decoder, offset + 8, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetReportsEventResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceGetReportsEventResponse {
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::Encode<DeviceGetReportsEventResponse>
for &mut DeviceGetReportsEventResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetReportsEventResponse>(offset);
fidl::encoding::Encode::<DeviceGetReportsEventResponse>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.event
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
2147483648,
>,
>,
> fidl::encoding::Encode<DeviceGetReportsEventResponse> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetReportsEventResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceGetReportsEventResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32),
event: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(i32, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, &mut self.event, decoder, offset + 4, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceIds {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for DeviceIds {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceIds> for &DeviceIds {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceIds>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceIds).write_unaligned((self as *const DeviceIds).read());
}
Ok(())
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32>,
T1: fidl::encoding::Encode<u32>,
T2: fidl::encoding::Encode<u32>,
> fidl::encoding::Encode<DeviceIds> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceIds>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceIds {
#[inline(always)]
fn new_empty() -> Self {
Self {
vendor_id: fidl::new_empty!(u32),
product_id: fidl::new_empty!(u32),
version: fidl::new_empty!(u32),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceReadReportResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceReadReportResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceReadReportResponse> for &DeviceReadReportResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceReadReportResponse>(offset);
fidl::encoding::Encode::<DeviceReadReportResponse>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.data,
),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.time),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>>,
T2: fidl::encoding::Encode<i64>,
> fidl::encoding::Encode<DeviceReadReportResponse> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceReadReportResponse>(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 + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceReadReportResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32),
data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>),
time: fidl::new_empty!(i64),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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!(i32, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 8192>, &mut self.data, decoder, offset + 8, _depth)?;
fidl::decode!(i64, &mut self.time, decoder, offset + 24, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceReadReportsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
impl fidl::encoding::ValueTypeMarker for DeviceReadReportsResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceReadReportsResponse> for &DeviceReadReportsResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceReadReportsResponse>(offset);
fidl::encoding::Encode::<DeviceReadReportsResponse>::encode(
(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.data,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i32>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>>,
> fidl::encoding::Encode<DeviceReadReportsResponse> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceReadReportsResponse>(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> for DeviceReadReportsResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
status: fidl::new_empty!(i32),
data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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!(i32, &mut self.status, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 8192>, &mut self.data, decoder, offset + 8, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceReportsReaderReadReportsResponse {
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
}
}
impl fidl::encoding::ValueTypeMarker for DeviceReportsReaderReadReportsResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceReportsReaderReadReportsResponse>
for &DeviceReportsReaderReadReportsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceReportsReaderReadReportsResponse>(offset);
fidl::encoding::Encode::<DeviceReportsReaderReadReportsResponse>::encode(
(<fidl::encoding::Vector<Report, 50> as fidl::encoding::ValueTypeMarker>::borrow(
&self.reports,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl::encoding::Vector<Report, 50>>>
fidl::encoding::Encode<DeviceReportsReaderReadReportsResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceReportsReaderReadReportsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceReportsReaderReadReportsResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { reports: fidl::new_empty!(fidl::encoding::Vector<Report, 50>) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<Report, 50>, &mut self.reports, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceSetReportRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
impl fidl::encoding::ValueTypeMarker for DeviceSetReportRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceSetReportRequest> for &DeviceSetReportRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceSetReportRequest>(offset);
fidl::encoding::Encode::<DeviceSetReportRequest>::encode(
(
<ReportType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.report,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<ReportType>,
T1: fidl::encoding::Encode<u8>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>>,
> fidl::encoding::Encode<DeviceSetReportRequest> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceSetReportRequest>(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 + 1, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceSetReportRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
type_: fidl::new_empty!(ReportType),
id: fidl::new_empty!(u8),
report: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
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 = 0xffffffffffff0000u64;
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!(ReportType, &mut self.type_, decoder, offset + 0, _depth)?;
fidl::decode!(u8, &mut self.id, decoder, offset + 1, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 8192>, &mut self.report, decoder, offset + 8, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceSetReportResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for DeviceSetReportResponse {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceSetReportResponse> for &DeviceSetReportResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceSetReportResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceSetReportResponse)
.write_unaligned((self as *const DeviceSetReportResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>> fidl::encoding::Encode<DeviceSetReportResponse>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceSetReportResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceSetReportResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(i32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceSetTraceIdRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for DeviceSetTraceIdRequest {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<DeviceSetTraceIdRequest> for &DeviceSetTraceIdRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceSetTraceIdRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut DeviceSetTraceIdRequest)
.write_unaligned((self as *const DeviceSetTraceIdRequest).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u32>> fidl::encoding::Encode<DeviceSetTraceIdRequest>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceSetTraceIdRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceSetTraceIdRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u32) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Report {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
impl fidl::encoding::ValueTypeMarker for Report {
type Borrowed<'a> = &'a Self;
fn borrow<'a>(
value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::Encode<Report> for &Report {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Report>(offset);
fidl::encoding::Encode::<Report>::encode(
(
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.time),
<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
&self.data,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<i64>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>>,
> fidl::encoding::Encode<Report> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Report>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for Report {
#[inline(always)]
fn new_empty() -> Self {
Self {
time: fidl::new_empty!(i64),
data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(i64, &mut self.time, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 8192>, &mut self.data, decoder, offset + 8, _depth)?;
Ok(())
}
}
}