#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::endpoints::{ControlHandle as _, Responder as _};
use fuchsia_zircon_status as zx_status;
use futures::future::{self, MaybeDone, TryFutureExt};
#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;
pub type BasePortId = u8;
pub const FRAME_FEATURES_RAW: u32 = 1;
pub const MAX_ACCEL_FLAGS: u32 = 16;
pub const MAX_DESCRIPTOR_CHAIN: u8 = 4;
pub const MAX_FRAME_TYPES: u32 = 4;
pub const MAX_PORTS: u8 = 32;
pub const MAX_SESSION_NAME: u32 = 64;
pub const MAX_STATUS_BUFFER: u32 = 50;
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EthernetFeatures: u32 {
const RAW = 1;
const ETHERNET_II = 2;
const E_802_1_Q = 4;
const E_802_1_Q_IN_Q = 8;
const E_802_3_LLC_SNAP = 16;
}
}
impl EthernetFeatures {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct RxFlags: u32 {
const RX_ACCEL_0 = 1;
const RX_ACCEL_1 = 2;
const RX_ACCEL_2 = 4;
const RX_ACCEL_3 = 8;
const RX_ACCEL_4 = 16;
const RX_ACCEL_5 = 32;
const RX_ACCEL_6 = 64;
const RX_ACCEL_7 = 128;
const RX_ACCEL_8 = 256;
const RX_ACCEL_9 = 512;
const RX_ACCEL_10 = 1024;
const RX_ACCEL_11 = 2048;
const RX_ACCEL_12 = 4096;
const RX_ACCEL_13 = 8192;
const RX_ACCEL_14 = 16384;
const RX_ACCEL_15 = 32768;
const RX_OVERRUN = 536870912;
const RX_VALIDATION_ERROR = 1073741824;
const RX_ECHOED_TX = 2147483648;
}
}
impl RxFlags {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SessionFlags: u16 {
const PRIMARY = 1;
const LISTEN_TX = 2;
const REPORT_INVALID_RX = 4;
}
}
impl SessionFlags {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u16 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct StatusFlags: u32 {
const ONLINE = 1;
}
}
impl StatusFlags {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TxFlags: u32 {
const TX_ACCEL_0 = 1;
const TX_ACCEL_1 = 2;
const TX_ACCEL_2 = 4;
const TX_ACCEL_3 = 8;
const TX_ACCEL_4 = 16;
const TX_ACCEL_5 = 32;
const TX_ACCEL_6 = 64;
const TX_ACCEL_7 = 128;
const TX_ACCEL_8 = 256;
const TX_ACCEL_9 = 512;
const TX_ACCEL_10 = 1024;
const TX_ACCEL_11 = 2048;
const TX_ACCEL_12 = 4096;
const TX_ACCEL_13 = 8192;
const TX_ACCEL_14 = 16384;
const TX_ACCEL_15 = 32768;
}
}
impl TxFlags {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TxReturnFlags: u32 {
const TX_RET_NOT_SUPPORTED = 1;
const TX_RET_OUT_OF_RESOURCES = 2;
const TX_RET_NOT_AVAILABLE = 4;
const TX_RET_ERROR = 2147483648;
}
}
impl TxReturnFlags {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u16)]
pub enum DeviceClass {
Virtual = 0,
Ethernet = 1,
Wlan = 2,
Ppp = 3,
Bridge = 4,
WlanAp = 5,
}
impl DeviceClass {
#[inline]
pub fn from_primitive(prim: u16) -> Option<Self> {
match prim {
0 => Some(Self::Virtual),
1 => Some(Self::Ethernet),
2 => Some(Self::Wlan),
3 => Some(Self::Ppp),
4 => Some(Self::Bridge),
5 => Some(Self::WlanAp),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u16 {
self as u16
}
#[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 FrameType {
Ethernet = 1,
Ipv4 = 2,
Ipv6 = 3,
}
impl FrameType {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Ethernet),
2 => Some(Self::Ipv4),
3 => Some(Self::Ipv6),
_ => 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(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum InfoType {
NoInfo = 0,
}
impl InfoType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::NoInfo),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum MacFilterMode {
MulticastFilter = 0,
MulticastPromiscuous = 1,
Promiscuous = 2,
}
impl MacFilterMode {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::MulticastFilter),
1 => Some(Self::MulticastPromiscuous),
2 => Some(Self::Promiscuous),
_ => 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)]
pub enum PortClass {
Ethernet,
WlanClient,
Ppp,
Bridge,
WlanAp,
Virtual,
Lowpan,
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u16,
},
}
#[macro_export]
macro_rules! PortClassUnknown {
() => {
_
};
}
impl PortClass {
#[inline]
pub fn from_primitive(prim: u16) -> Option<Self> {
match prim {
1 => Some(Self::Ethernet),
2 => Some(Self::WlanClient),
3 => Some(Self::Ppp),
4 => Some(Self::Bridge),
5 => Some(Self::WlanAp),
6 => Some(Self::Virtual),
7 => Some(Self::Lowpan),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u16) -> Self {
match prim {
1 => Self::Ethernet,
2 => Self::WlanClient,
3 => Self::Ppp,
4 => Self::Bridge,
5 => Self::WlanAp,
6 => Self::Virtual,
7 => Self::Lowpan,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffff }
}
#[inline]
pub const fn into_primitive(self) -> u16 {
match self {
Self::Ethernet => 1,
Self::WlanClient => 2,
Self::Ppp => 3,
Self::Bridge => 4,
Self::WlanAp => 5,
Self::Virtual => 6,
Self::Lowpan => 7,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum RxAcceleration {
ValidatedEthernetFcs = 0,
ValidatedIpv4Checksum = 1,
ValidatedTcpChecksum = 2,
ValidatedUdpChecksum = 3,
}
impl RxAcceleration {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::ValidatedEthernetFcs),
1 => Some(Self::ValidatedIpv4Checksum),
2 => Some(Self::ValidatedTcpChecksum),
3 => Some(Self::ValidatedUdpChecksum),
_ => 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(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum TxAcceleration {
ComputeEthernetFcs = 0,
ComputeIpv4Checksum = 1,
ComputeTcpChecksum = 2,
ComputeUdpChecksum = 3,
}
impl TxAcceleration {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::ComputeEthernetFcs),
1 => Some(Self::ComputeIpv4Checksum),
2 => Some(Self::ComputeTcpChecksum),
3 => Some(Self::ComputeUdpChecksum),
_ => 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 DeviceCloneRequest {
pub device: fidl::endpoints::ServerEnd<DeviceMarker>,
}
impl fidl::Standalone for DeviceCloneRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct DeviceGetInfoResponse {
pub info: DeviceInfo,
}
impl fidl::Persistable for DeviceGetInfoResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceGetPortRequest {
pub id: PortId,
pub port: fidl::endpoints::ServerEnd<PortMarker>,
}
impl fidl::Standalone for DeviceGetPortRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceGetPortWatcherRequest {
pub watcher: fidl::endpoints::ServerEnd<PortWatcherMarker>,
}
impl fidl::Standalone for DeviceGetPortWatcherRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceInstanceGetDeviceRequest {
pub device: fidl::endpoints::ServerEnd<DeviceMarker>,
}
impl fidl::Standalone for DeviceInstanceGetDeviceRequest {}
#[derive(Debug, PartialEq)]
pub struct DeviceOpenSessionRequest {
pub session_name: String,
pub session_info: SessionInfo,
}
impl fidl::Standalone for DeviceOpenSessionRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DeviceOpenSessionResponse {
pub session: fidl::endpoints::ClientEnd<SessionMarker>,
pub fifos: Fifos,
}
impl fidl::Standalone for DeviceOpenSessionResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Empty;
impl fidl::Persistable for Empty {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Fifos {
pub rx: fidl::Fifo,
pub tx: fidl::Fifo,
}
impl fidl::Standalone for Fifos {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct FrameTypeSupport {
pub type_: FrameType,
pub features: u32,
pub supported_flags: TxFlags,
}
impl fidl::Persistable for FrameTypeSupport {}
#[derive(Clone, Debug, PartialEq)]
pub struct MacAddressingAddMulticastAddressRequest {
pub address: fidl_fuchsia_net::MacAddress,
}
impl fidl::Persistable for MacAddressingAddMulticastAddressRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct MacAddressingAddMulticastAddressResponse {
pub status: i32,
}
impl fidl::Persistable for MacAddressingAddMulticastAddressResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct MacAddressingGetUnicastAddressResponse {
pub address: fidl_fuchsia_net::MacAddress,
}
impl fidl::Persistable for MacAddressingGetUnicastAddressResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct MacAddressingRemoveMulticastAddressRequest {
pub address: fidl_fuchsia_net::MacAddress,
}
impl fidl::Persistable for MacAddressingRemoveMulticastAddressRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct MacAddressingRemoveMulticastAddressResponse {
pub status: i32,
}
impl fidl::Persistable for MacAddressingRemoveMulticastAddressResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct MacAddressingSetModeRequest {
pub mode: MacFilterMode,
}
impl fidl::Persistable for MacAddressingSetModeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct MacAddressingSetModeResponse {
pub status: i32,
}
impl fidl::Persistable for MacAddressingSetModeResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PortCloneRequest {
pub port: fidl::endpoints::ServerEnd<PortMarker>,
}
impl fidl::Standalone for PortCloneRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PortGetDeviceRequest {
pub device: fidl::endpoints::ServerEnd<DeviceMarker>,
}
impl fidl::Standalone for PortGetDeviceRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PortGetDiagnosticsRequest {
pub diagnostics: fidl::endpoints::ServerEnd<DiagnosticsMarker>,
}
impl fidl::Standalone for PortGetDiagnosticsRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct PortGetInfoResponse {
pub info: PortInfo,
}
impl fidl::Persistable for PortGetInfoResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PortGetMacRequest {
pub mac: fidl::endpoints::ServerEnd<MacAddressingMarker>,
}
impl fidl::Standalone for PortGetMacRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct PortGetStatusResponse {
pub status: PortStatus,
}
impl fidl::Persistable for PortGetStatusResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PortGetStatusWatcherRequest {
pub watcher: fidl::endpoints::ServerEnd<StatusWatcherMarker>,
pub buffer: u32,
}
impl fidl::Standalone for PortGetStatusWatcherRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct PortId {
pub base: u8,
pub salt: u8,
}
impl fidl::Persistable for PortId {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PortWatcherWatchResponse {
pub event: DevicePortEvent,
}
impl fidl::Persistable for PortWatcherWatchResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SessionAttachRequest {
pub port: PortId,
pub rx_frames: Vec<FrameType>,
}
impl fidl::Persistable for SessionAttachRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct SessionDetachRequest {
pub port: PortId,
}
impl fidl::Persistable for SessionDetachRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct StatusWatcherWatchStatusResponse {
pub port_status: PortStatus,
}
impl fidl::Persistable for StatusWatcherWatchStatusResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DeviceBaseInfo {
pub rx_depth: Option<u16>,
pub tx_depth: Option<u16>,
pub buffer_alignment: Option<u32>,
pub max_buffer_length: Option<u32>,
pub min_rx_buffer_length: Option<u32>,
pub min_tx_buffer_length: Option<u32>,
pub min_tx_buffer_head: Option<u16>,
pub min_tx_buffer_tail: Option<u16>,
pub max_buffer_parts: Option<u8>,
pub rx_accel: Option<Vec<RxAcceleration>>,
pub tx_accel: Option<Vec<TxAcceleration>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DeviceBaseInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DeviceInfo {
pub min_descriptor_length: Option<u8>,
pub descriptor_version: Option<u8>,
pub base_info: Option<DeviceBaseInfo>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DeviceInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PortBaseInfo {
pub port_class: Option<PortClass>,
pub rx_types: Option<Vec<FrameType>>,
pub tx_types: Option<Vec<FrameTypeSupport>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for PortBaseInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PortGetCountersResponse {
pub rx_frames: Option<u64>,
pub rx_bytes: Option<u64>,
pub tx_frames: Option<u64>,
pub tx_bytes: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for PortGetCountersResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PortInfo {
pub id: Option<PortId>,
pub base_info: Option<PortBaseInfo>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for PortInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PortStatus {
pub flags: Option<StatusFlags>,
pub mtu: Option<u32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for PortStatus {}
#[derive(Debug, Default, PartialEq)]
pub struct SessionInfo {
pub descriptors: Option<fidl::Vmo>,
pub data: Option<fidl::Vmo>,
pub descriptor_version: Option<u8>,
pub descriptor_length: Option<u8>,
pub descriptor_count: Option<u16>,
pub options: Option<SessionFlags>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone for SessionInfo {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum DevicePortEvent {
Existing(PortId),
Added(PortId),
Removed(PortId),
Idle(Empty),
}
impl DevicePortEvent {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Existing(_) => 1,
Self::Added(_) => 2,
Self::Removed(_) => 3,
Self::Idle(_) => 4,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for DevicePortEvent {}
#[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 DeviceOpenSessionResult = Result<(fidl::endpoints::ClientEnd<SessionMarker>, Fifos), i32>;
pub trait DeviceProxyInterface: Send + Sync {
type GetInfoResponseFut: std::future::Future<Output = Result<DeviceInfo, fidl::Error>> + Send;
fn r#get_info(&self) -> Self::GetInfoResponseFut;
type OpenSessionResponseFut: std::future::Future<Output = Result<DeviceOpenSessionResult, fidl::Error>>
+ Send;
fn r#open_session(
&self,
session_name: &str,
session_info: SessionInfo,
) -> Self::OpenSessionResponseFut;
fn r#get_port(
&self,
id: &PortId,
port: fidl::endpoints::ServerEnd<PortMarker>,
) -> Result<(), fidl::Error>;
fn r#get_port_watcher(
&self,
watcher: fidl::endpoints::ServerEnd<PortWatcherMarker>,
) -> Result<(), fidl::Error>;
fn r#clone(&self, device: fidl::endpoints::ServerEnd<DeviceMarker>) -> 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::MonotonicTime) -> Result<DeviceEvent, fidl::Error> {
DeviceEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_info(&self, ___deadline: zx::MonotonicTime) -> Result<DeviceInfo, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DeviceGetInfoResponse>(
(),
0x3c500ca9341e8f56,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.info)
}
pub fn r#open_session(
&self,
mut session_name: &str,
mut session_info: SessionInfo,
___deadline: zx::MonotonicTime,
) -> Result<DeviceOpenSessionResult, fidl::Error> {
let _response = self.client.send_query::<
DeviceOpenSessionRequest,
fidl::encoding::ResultType<DeviceOpenSessionResponse, i32>,
>(
(session_name, &mut session_info,),
0x25940b82146dcf67,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.session, x.fifos)))
}
pub fn r#get_port(
&self,
mut id: &PortId,
mut port: fidl::endpoints::ServerEnd<PortMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceGetPortRequest>(
(id, port),
0x340a852c955ba2a6,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_port_watcher(
&self,
mut watcher: fidl::endpoints::ServerEnd<PortWatcherMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceGetPortWatcherRequest>(
(watcher,),
0x104f43c937c39f0c,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#clone(
&self,
mut device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceCloneRequest>(
(device,),
0x5882ea09b3809af4,
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_info(&self) -> fidl::client::QueryResponseFut<DeviceInfo> {
DeviceProxyInterface::r#get_info(self)
}
pub fn r#open_session(
&self,
mut session_name: &str,
mut session_info: SessionInfo,
) -> fidl::client::QueryResponseFut<DeviceOpenSessionResult> {
DeviceProxyInterface::r#open_session(self, session_name, session_info)
}
pub fn r#get_port(
&self,
mut id: &PortId,
mut port: fidl::endpoints::ServerEnd<PortMarker>,
) -> Result<(), fidl::Error> {
DeviceProxyInterface::r#get_port(self, id, port)
}
pub fn r#get_port_watcher(
&self,
mut watcher: fidl::endpoints::ServerEnd<PortWatcherMarker>,
) -> Result<(), fidl::Error> {
DeviceProxyInterface::r#get_port_watcher(self, watcher)
}
pub fn r#clone(
&self,
mut device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
DeviceProxyInterface::r#clone(self, device)
}
}
impl DeviceProxyInterface for DeviceProxy {
type GetInfoResponseFut = fidl::client::QueryResponseFut<DeviceInfo>;
fn r#get_info(&self) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DeviceInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DeviceGetInfoResponse,
0x3c500ca9341e8f56,
>(_buf?)?;
Ok(_response.info)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DeviceInfo>(
(),
0x3c500ca9341e8f56,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type OpenSessionResponseFut = fidl::client::QueryResponseFut<DeviceOpenSessionResult>;
fn r#open_session(
&self,
mut session_name: &str,
mut session_info: SessionInfo,
) -> Self::OpenSessionResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DeviceOpenSessionResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DeviceOpenSessionResponse, i32>,
0x25940b82146dcf67,
>(_buf?)?;
Ok(_response.map(|x| (x.session, x.fifos)))
}
self.client.send_query_and_decode::<DeviceOpenSessionRequest, DeviceOpenSessionResult>(
(session_name, &mut session_info),
0x25940b82146dcf67,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#get_port(
&self,
mut id: &PortId,
mut port: fidl::endpoints::ServerEnd<PortMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceGetPortRequest>(
(id, port),
0x340a852c955ba2a6,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#get_port_watcher(
&self,
mut watcher: fidl::endpoints::ServerEnd<PortWatcherMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceGetPortWatcherRequest>(
(watcher,),
0x104f43c937c39f0c,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#clone(
&self,
mut device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceCloneRequest>(
(device,),
0x5882ea09b3809af4,
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 {
0x3c500ca9341e8f56 => {
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::GetInfo {
responder: DeviceGetInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x25940b82146dcf67 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(DeviceOpenSessionRequest);
fidl::encoding::Decoder::decode_into::<DeviceOpenSessionRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::OpenSession {
session_name: req.session_name,
session_info: req.session_info,
responder: DeviceOpenSessionResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x340a852c955ba2a6 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(DeviceGetPortRequest);
fidl::encoding::Decoder::decode_into::<DeviceGetPortRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetPort { id: req.id, port: req.port, control_handle })
}
0x104f43c937c39f0c => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(DeviceGetPortWatcherRequest);
fidl::encoding::Decoder::decode_into::<DeviceGetPortWatcherRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::GetPortWatcher { watcher: req.watcher, control_handle })
}
0x5882ea09b3809af4 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(DeviceCloneRequest);
fidl::encoding::Decoder::decode_into::<DeviceCloneRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceControlHandle { inner: this.inner.clone() };
Ok(DeviceRequest::Clone { device: req.device, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DeviceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum DeviceRequest {
GetInfo { responder: DeviceGetInfoResponder },
OpenSession {
session_name: String,
session_info: SessionInfo,
responder: DeviceOpenSessionResponder,
},
GetPort {
id: PortId,
port: fidl::endpoints::ServerEnd<PortMarker>,
control_handle: DeviceControlHandle,
},
GetPortWatcher {
watcher: fidl::endpoints::ServerEnd<PortWatcherMarker>,
control_handle: DeviceControlHandle,
},
Clone { device: fidl::endpoints::ServerEnd<DeviceMarker>, control_handle: DeviceControlHandle },
}
impl DeviceRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_info(self) -> Option<(DeviceGetInfoResponder)> {
if let DeviceRequest::GetInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_open_session(self) -> Option<(String, SessionInfo, DeviceOpenSessionResponder)> {
if let DeviceRequest::OpenSession { session_name, session_info, responder } = self {
Some((session_name, session_info, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_port(
self,
) -> Option<(PortId, fidl::endpoints::ServerEnd<PortMarker>, DeviceControlHandle)> {
if let DeviceRequest::GetPort { id, port, control_handle } = self {
Some((id, port, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_port_watcher(
self,
) -> Option<(fidl::endpoints::ServerEnd<PortWatcherMarker>, DeviceControlHandle)> {
if let DeviceRequest::GetPortWatcher { watcher, control_handle } = self {
Some((watcher, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone(
self,
) -> Option<(fidl::endpoints::ServerEnd<DeviceMarker>, DeviceControlHandle)> {
if let DeviceRequest::Clone { device, control_handle } = self {
Some((device, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DeviceRequest::GetInfo { .. } => "get_info",
DeviceRequest::OpenSession { .. } => "open_session",
DeviceRequest::GetPort { .. } => "get_port",
DeviceRequest::GetPortWatcher { .. } => "get_port_watcher",
DeviceRequest::Clone { .. } => "clone",
}
}
}
#[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 DeviceGetInfoResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceGetInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceGetInfoResponder {
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 DeviceGetInfoResponder {
pub fn send(self, mut info: &DeviceInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut info: &DeviceInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut info: &DeviceInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DeviceGetInfoResponse>(
(info,),
self.tx_id,
0x3c500ca9341e8f56,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DeviceOpenSessionResponder {
control_handle: std::mem::ManuallyDrop<DeviceControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DeviceOpenSessionResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DeviceOpenSessionResponder {
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 DeviceOpenSessionResponder {
pub fn send(
self,
mut result: Result<(fidl::endpoints::ClientEnd<SessionMarker>, Fifos), 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<(fidl::endpoints::ClientEnd<SessionMarker>, Fifos), i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(fidl::endpoints::ClientEnd<SessionMarker>, Fifos), i32>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DeviceOpenSessionResponse, i32>>(
result.as_mut().map_err(|e| *e).map(|(session, fifos)| {
(std::mem::replace(session, fidl::Handle::invalid().into()), fifos)
}),
self.tx_id,
0x25940b82146dcf67,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DeviceInstanceMarker;
impl fidl::endpoints::ProtocolMarker for DeviceInstanceMarker {
type Proxy = DeviceInstanceProxy;
type RequestStream = DeviceInstanceRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DeviceInstanceSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DeviceInstance";
}
pub trait DeviceInstanceProxyInterface: Send + Sync {
fn r#get_device(
&self,
device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DeviceInstanceSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DeviceInstanceSynchronousProxy {
type Proxy = DeviceInstanceProxy;
type Protocol = DeviceInstanceMarker;
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 DeviceInstanceSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DeviceInstanceMarker 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::MonotonicTime,
) -> Result<DeviceInstanceEvent, fidl::Error> {
DeviceInstanceEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_device(
&self,
mut device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceInstanceGetDeviceRequest>(
(device,),
0x775270585575cef7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct DeviceInstanceProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for DeviceInstanceProxy {
type Protocol = DeviceInstanceMarker;
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 DeviceInstanceProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <DeviceInstanceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DeviceInstanceEventStream {
DeviceInstanceEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_device(
&self,
mut device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
DeviceInstanceProxyInterface::r#get_device(self, device)
}
}
impl DeviceInstanceProxyInterface for DeviceInstanceProxy {
fn r#get_device(
&self,
mut device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceInstanceGetDeviceRequest>(
(device,),
0x775270585575cef7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct DeviceInstanceEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for DeviceInstanceEventStream {}
impl futures::stream::FusedStream for DeviceInstanceEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DeviceInstanceEventStream {
type Item = Result<DeviceInstanceEvent, 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(DeviceInstanceEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DeviceInstanceEvent {}
impl DeviceInstanceEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<DeviceInstanceEvent, 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:
<DeviceInstanceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DeviceInstanceRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for DeviceInstanceRequestStream {}
impl futures::stream::FusedStream for DeviceInstanceRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DeviceInstanceRequestStream {
type Protocol = DeviceInstanceMarker;
type ControlHandle = DeviceInstanceControlHandle;
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 {
DeviceInstanceControlHandle { 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 DeviceInstanceRequestStream {
type Item = Result<DeviceInstanceRequest, 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 DeviceInstanceRequestStream 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 {
0x775270585575cef7 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(DeviceInstanceGetDeviceRequest);
fidl::encoding::Decoder::decode_into::<DeviceInstanceGetDeviceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = DeviceInstanceControlHandle { inner: this.inner.clone() };
Ok(DeviceInstanceRequest::GetDevice { device: req.device, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DeviceInstanceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum DeviceInstanceRequest {
GetDevice {
device: fidl::endpoints::ServerEnd<DeviceMarker>,
control_handle: DeviceInstanceControlHandle,
},
}
impl DeviceInstanceRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_device(
self,
) -> Option<(fidl::endpoints::ServerEnd<DeviceMarker>, DeviceInstanceControlHandle)> {
if let DeviceInstanceRequest::GetDevice { device, control_handle } = self {
Some((device, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DeviceInstanceRequest::GetDevice { .. } => "get_device",
}
}
}
#[derive(Debug, Clone)]
pub struct DeviceInstanceControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for DeviceInstanceControlHandle {
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 DeviceInstanceControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DiagnosticsMarker;
impl fidl::endpoints::ProtocolMarker for DiagnosticsMarker {
type Proxy = DiagnosticsProxy;
type RequestStream = DiagnosticsRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DiagnosticsSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Diagnostics";
}
pub trait DiagnosticsProxyInterface: Send + Sync {
type LogDebugInfoToSyslogResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#log_debug_info_to_syslog(&self) -> Self::LogDebugInfoToSyslogResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DiagnosticsSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DiagnosticsSynchronousProxy {
type Proxy = DiagnosticsProxy;
type Protocol = DiagnosticsMarker;
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 DiagnosticsSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DiagnosticsMarker 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::MonotonicTime,
) -> Result<DiagnosticsEvent, fidl::Error> {
DiagnosticsEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#log_debug_info_to_syslog(
&self,
___deadline: zx::MonotonicTime,
) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x4222897dfe1f4b4a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct DiagnosticsProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for DiagnosticsProxy {
type Protocol = DiagnosticsMarker;
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 DiagnosticsProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <DiagnosticsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DiagnosticsEventStream {
DiagnosticsEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#log_debug_info_to_syslog(&self) -> fidl::client::QueryResponseFut<()> {
DiagnosticsProxyInterface::r#log_debug_info_to_syslog(self)
}
}
impl DiagnosticsProxyInterface for DiagnosticsProxy {
type LogDebugInfoToSyslogResponseFut = fidl::client::QueryResponseFut<()>;
fn r#log_debug_info_to_syslog(&self) -> Self::LogDebugInfoToSyslogResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
0x4222897dfe1f4b4a,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x4222897dfe1f4b4a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct DiagnosticsEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for DiagnosticsEventStream {}
impl futures::stream::FusedStream for DiagnosticsEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DiagnosticsEventStream {
type Item = Result<DiagnosticsEvent, 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(DiagnosticsEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DiagnosticsEvent {}
impl DiagnosticsEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<DiagnosticsEvent, 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: <DiagnosticsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DiagnosticsRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for DiagnosticsRequestStream {}
impl futures::stream::FusedStream for DiagnosticsRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DiagnosticsRequestStream {
type Protocol = DiagnosticsMarker;
type ControlHandle = DiagnosticsControlHandle;
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 {
DiagnosticsControlHandle { 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 DiagnosticsRequestStream {
type Item = Result<DiagnosticsRequest, 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 DiagnosticsRequestStream 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 {
0x4222897dfe1f4b4a => {
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 = DiagnosticsControlHandle { inner: this.inner.clone() };
Ok(DiagnosticsRequest::LogDebugInfoToSyslog {
responder: DiagnosticsLogDebugInfoToSyslogResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DiagnosticsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum DiagnosticsRequest {
LogDebugInfoToSyslog { responder: DiagnosticsLogDebugInfoToSyslogResponder },
}
impl DiagnosticsRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_log_debug_info_to_syslog(
self,
) -> Option<(DiagnosticsLogDebugInfoToSyslogResponder)> {
if let DiagnosticsRequest::LogDebugInfoToSyslog { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DiagnosticsRequest::LogDebugInfoToSyslog { .. } => "log_debug_info_to_syslog",
}
}
}
#[derive(Debug, Clone)]
pub struct DiagnosticsControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for DiagnosticsControlHandle {
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 DiagnosticsControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DiagnosticsLogDebugInfoToSyslogResponder {
control_handle: std::mem::ManuallyDrop<DiagnosticsControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DiagnosticsLogDebugInfoToSyslogResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DiagnosticsLogDebugInfoToSyslogResponder {
type ControlHandle = DiagnosticsControlHandle;
fn control_handle(&self) -> &DiagnosticsControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DiagnosticsLogDebugInfoToSyslogResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x4222897dfe1f4b4a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct MacAddressingMarker;
impl fidl::endpoints::ProtocolMarker for MacAddressingMarker {
type Proxy = MacAddressingProxy;
type RequestStream = MacAddressingRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = MacAddressingSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) MacAddressing";
}
pub trait MacAddressingProxyInterface: Send + Sync {
type GetUnicastAddressResponseFut: std::future::Future<Output = Result<fidl_fuchsia_net::MacAddress, fidl::Error>>
+ Send;
fn r#get_unicast_address(&self) -> Self::GetUnicastAddressResponseFut;
type SetModeResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
fn r#set_mode(&self, mode: MacFilterMode) -> Self::SetModeResponseFut;
type AddMulticastAddressResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
+ Send;
fn r#add_multicast_address(
&self,
address: &fidl_fuchsia_net::MacAddress,
) -> Self::AddMulticastAddressResponseFut;
type RemoveMulticastAddressResponseFut: std::future::Future<Output = Result<i32, fidl::Error>>
+ Send;
fn r#remove_multicast_address(
&self,
address: &fidl_fuchsia_net::MacAddress,
) -> Self::RemoveMulticastAddressResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct MacAddressingSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for MacAddressingSynchronousProxy {
type Proxy = MacAddressingProxy;
type Protocol = MacAddressingMarker;
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 MacAddressingSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <MacAddressingMarker 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::MonotonicTime,
) -> Result<MacAddressingEvent, fidl::Error> {
MacAddressingEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_unicast_address(
&self,
___deadline: zx::MonotonicTime,
) -> Result<fidl_fuchsia_net::MacAddress, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, MacAddressingGetUnicastAddressResponse>(
(),
0x2c60b82a4ecfaebe,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.address)
}
pub fn r#set_mode(
&self,
mut mode: MacFilterMode,
___deadline: zx::MonotonicTime,
) -> Result<i32, fidl::Error> {
let _response =
self.client.send_query::<MacAddressingSetModeRequest, MacAddressingSetModeResponse>(
(mode,),
0x6297b8dbf03c58c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#add_multicast_address(
&self,
mut address: &fidl_fuchsia_net::MacAddress,
___deadline: zx::MonotonicTime,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
MacAddressingAddMulticastAddressRequest,
MacAddressingAddMulticastAddressResponse,
>(
(address,),
0xf5637ff11cf0c25,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#remove_multicast_address(
&self,
mut address: &fidl_fuchsia_net::MacAddress,
___deadline: zx::MonotonicTime,
) -> Result<i32, fidl::Error> {
let _response = self.client.send_query::<
MacAddressingRemoveMulticastAddressRequest,
MacAddressingRemoveMulticastAddressResponse,
>(
(address,),
0x5dddf4e3ba4e2560,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
}
#[derive(Debug, Clone)]
pub struct MacAddressingProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for MacAddressingProxy {
type Protocol = MacAddressingMarker;
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 MacAddressingProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <MacAddressingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> MacAddressingEventStream {
MacAddressingEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_unicast_address(
&self,
) -> fidl::client::QueryResponseFut<fidl_fuchsia_net::MacAddress> {
MacAddressingProxyInterface::r#get_unicast_address(self)
}
pub fn r#set_mode(&self, mut mode: MacFilterMode) -> fidl::client::QueryResponseFut<i32> {
MacAddressingProxyInterface::r#set_mode(self, mode)
}
pub fn r#add_multicast_address(
&self,
mut address: &fidl_fuchsia_net::MacAddress,
) -> fidl::client::QueryResponseFut<i32> {
MacAddressingProxyInterface::r#add_multicast_address(self, address)
}
pub fn r#remove_multicast_address(
&self,
mut address: &fidl_fuchsia_net::MacAddress,
) -> fidl::client::QueryResponseFut<i32> {
MacAddressingProxyInterface::r#remove_multicast_address(self, address)
}
}
impl MacAddressingProxyInterface for MacAddressingProxy {
type GetUnicastAddressResponseFut =
fidl::client::QueryResponseFut<fidl_fuchsia_net::MacAddress>;
fn r#get_unicast_address(&self) -> Self::GetUnicastAddressResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_net::MacAddress, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
MacAddressingGetUnicastAddressResponse,
0x2c60b82a4ecfaebe,
>(_buf?)?;
Ok(_response.address)
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl_fuchsia_net::MacAddress>(
(),
0x2c60b82a4ecfaebe,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetModeResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#set_mode(&self, mut mode: MacFilterMode) -> Self::SetModeResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
MacAddressingSetModeResponse,
0x6297b8dbf03c58c,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<MacAddressingSetModeRequest, i32>(
(mode,),
0x6297b8dbf03c58c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type AddMulticastAddressResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#add_multicast_address(
&self,
mut address: &fidl_fuchsia_net::MacAddress,
) -> Self::AddMulticastAddressResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
MacAddressingAddMulticastAddressResponse,
0xf5637ff11cf0c25,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<MacAddressingAddMulticastAddressRequest, i32>(
(address,),
0xf5637ff11cf0c25,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveMulticastAddressResponseFut = fidl::client::QueryResponseFut<i32>;
fn r#remove_multicast_address(
&self,
mut address: &fidl_fuchsia_net::MacAddress,
) -> Self::RemoveMulticastAddressResponseFut {
fn _decode(mut _buf: Result<fidl::MessageBufEtc, fidl::Error>) -> Result<i32, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
MacAddressingRemoveMulticastAddressResponse,
0x5dddf4e3ba4e2560,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<MacAddressingRemoveMulticastAddressRequest, i32>(
(address,),
0x5dddf4e3ba4e2560,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct MacAddressingEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for MacAddressingEventStream {}
impl futures::stream::FusedStream for MacAddressingEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for MacAddressingEventStream {
type Item = Result<MacAddressingEvent, 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(MacAddressingEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum MacAddressingEvent {}
impl MacAddressingEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<MacAddressingEvent, 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: <MacAddressingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct MacAddressingRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for MacAddressingRequestStream {}
impl futures::stream::FusedStream for MacAddressingRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for MacAddressingRequestStream {
type Protocol = MacAddressingMarker;
type ControlHandle = MacAddressingControlHandle;
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 {
MacAddressingControlHandle { 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 MacAddressingRequestStream {
type Item = Result<MacAddressingRequest, 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 MacAddressingRequestStream 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 {
0x2c60b82a4ecfaebe => {
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 = MacAddressingControlHandle { inner: this.inner.clone() };
Ok(MacAddressingRequest::GetUnicastAddress {
responder: MacAddressingGetUnicastAddressResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6297b8dbf03c58c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(MacAddressingSetModeRequest);
fidl::encoding::Decoder::decode_into::<MacAddressingSetModeRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = MacAddressingControlHandle { inner: this.inner.clone() };
Ok(MacAddressingRequest::SetMode {
mode: req.mode,
responder: MacAddressingSetModeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xf5637ff11cf0c25 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(MacAddressingAddMulticastAddressRequest);
fidl::encoding::Decoder::decode_into::<MacAddressingAddMulticastAddressRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = MacAddressingControlHandle { inner: this.inner.clone() };
Ok(MacAddressingRequest::AddMulticastAddress {
address: req.address,
responder: MacAddressingAddMulticastAddressResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5dddf4e3ba4e2560 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(MacAddressingRemoveMulticastAddressRequest);
fidl::encoding::Decoder::decode_into::<
MacAddressingRemoveMulticastAddressRequest,
>(&header, _body_bytes, handles, &mut req)?;
let control_handle = MacAddressingControlHandle { inner: this.inner.clone() };
Ok(MacAddressingRequest::RemoveMulticastAddress {
address: req.address,
responder: MacAddressingRemoveMulticastAddressResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<MacAddressingMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum MacAddressingRequest {
GetUnicastAddress { responder: MacAddressingGetUnicastAddressResponder },
SetMode { mode: MacFilterMode, responder: MacAddressingSetModeResponder },
AddMulticastAddress {
address: fidl_fuchsia_net::MacAddress,
responder: MacAddressingAddMulticastAddressResponder,
},
RemoveMulticastAddress {
address: fidl_fuchsia_net::MacAddress,
responder: MacAddressingRemoveMulticastAddressResponder,
},
}
impl MacAddressingRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_unicast_address(self) -> Option<(MacAddressingGetUnicastAddressResponder)> {
if let MacAddressingRequest::GetUnicastAddress { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_mode(self) -> Option<(MacFilterMode, MacAddressingSetModeResponder)> {
if let MacAddressingRequest::SetMode { mode, responder } = self {
Some((mode, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_add_multicast_address(
self,
) -> Option<(fidl_fuchsia_net::MacAddress, MacAddressingAddMulticastAddressResponder)> {
if let MacAddressingRequest::AddMulticastAddress { address, responder } = self {
Some((address, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove_multicast_address(
self,
) -> Option<(fidl_fuchsia_net::MacAddress, MacAddressingRemoveMulticastAddressResponder)> {
if let MacAddressingRequest::RemoveMulticastAddress { address, responder } = self {
Some((address, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
MacAddressingRequest::GetUnicastAddress { .. } => "get_unicast_address",
MacAddressingRequest::SetMode { .. } => "set_mode",
MacAddressingRequest::AddMulticastAddress { .. } => "add_multicast_address",
MacAddressingRequest::RemoveMulticastAddress { .. } => "remove_multicast_address",
}
}
}
#[derive(Debug, Clone)]
pub struct MacAddressingControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for MacAddressingControlHandle {
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 MacAddressingControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct MacAddressingGetUnicastAddressResponder {
control_handle: std::mem::ManuallyDrop<MacAddressingControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for MacAddressingGetUnicastAddressResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for MacAddressingGetUnicastAddressResponder {
type ControlHandle = MacAddressingControlHandle;
fn control_handle(&self) -> &MacAddressingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl MacAddressingGetUnicastAddressResponder {
pub fn send(self, mut address: &fidl_fuchsia_net::MacAddress) -> Result<(), fidl::Error> {
let _result = self.send_raw(address);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut address: &fidl_fuchsia_net::MacAddress,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(address);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut address: &fidl_fuchsia_net::MacAddress) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<MacAddressingGetUnicastAddressResponse>(
(address,),
self.tx_id,
0x2c60b82a4ecfaebe,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct MacAddressingSetModeResponder {
control_handle: std::mem::ManuallyDrop<MacAddressingControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for MacAddressingSetModeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for MacAddressingSetModeResponder {
type ControlHandle = MacAddressingControlHandle;
fn control_handle(&self) -> &MacAddressingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl MacAddressingSetModeResponder {
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::<MacAddressingSetModeResponse>(
(status,),
self.tx_id,
0x6297b8dbf03c58c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct MacAddressingAddMulticastAddressResponder {
control_handle: std::mem::ManuallyDrop<MacAddressingControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for MacAddressingAddMulticastAddressResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for MacAddressingAddMulticastAddressResponder {
type ControlHandle = MacAddressingControlHandle;
fn control_handle(&self) -> &MacAddressingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl MacAddressingAddMulticastAddressResponder {
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::<MacAddressingAddMulticastAddressResponse>(
(status,),
self.tx_id,
0xf5637ff11cf0c25,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct MacAddressingRemoveMulticastAddressResponder {
control_handle: std::mem::ManuallyDrop<MacAddressingControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for MacAddressingRemoveMulticastAddressResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for MacAddressingRemoveMulticastAddressResponder {
type ControlHandle = MacAddressingControlHandle;
fn control_handle(&self) -> &MacAddressingControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl MacAddressingRemoveMulticastAddressResponder {
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::<MacAddressingRemoveMulticastAddressResponse>(
(status,),
self.tx_id,
0x5dddf4e3ba4e2560,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PortMarker;
impl fidl::endpoints::ProtocolMarker for PortMarker {
type Proxy = PortProxy;
type RequestStream = PortRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PortSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Port";
}
pub trait PortProxyInterface: Send + Sync {
type GetInfoResponseFut: std::future::Future<Output = Result<PortInfo, fidl::Error>> + Send;
fn r#get_info(&self) -> Self::GetInfoResponseFut;
type GetStatusResponseFut: std::future::Future<Output = Result<PortStatus, fidl::Error>> + Send;
fn r#get_status(&self) -> Self::GetStatusResponseFut;
fn r#get_status_watcher(
&self,
watcher: fidl::endpoints::ServerEnd<StatusWatcherMarker>,
buffer: u32,
) -> Result<(), fidl::Error>;
fn r#get_mac(
&self,
mac: fidl::endpoints::ServerEnd<MacAddressingMarker>,
) -> Result<(), fidl::Error>;
fn r#get_device(
&self,
device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error>;
fn r#clone(&self, port: fidl::endpoints::ServerEnd<PortMarker>) -> Result<(), fidl::Error>;
type GetCountersResponseFut: std::future::Future<Output = Result<PortGetCountersResponse, fidl::Error>>
+ Send;
fn r#get_counters(&self) -> Self::GetCountersResponseFut;
fn r#get_diagnostics(
&self,
diagnostics: fidl::endpoints::ServerEnd<DiagnosticsMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PortSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PortSynchronousProxy {
type Proxy = PortProxy;
type Protocol = PortMarker;
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 PortSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <PortMarker 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::MonotonicTime) -> Result<PortEvent, fidl::Error> {
PortEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_info(&self, ___deadline: zx::MonotonicTime) -> Result<PortInfo, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, PortGetInfoResponse>(
(),
0x276cf65feb554ebd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.info)
}
pub fn r#get_status(&self, ___deadline: zx::MonotonicTime) -> Result<PortStatus, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, PortGetStatusResponse>(
(),
0x4235650aacca60b2,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.status)
}
pub fn r#get_status_watcher(
&self,
mut watcher: fidl::endpoints::ServerEnd<StatusWatcherMarker>,
mut buffer: u32,
) -> Result<(), fidl::Error> {
self.client.send::<PortGetStatusWatcherRequest>(
(watcher, buffer),
0x65511ab81c1bd8d4,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_mac(
&self,
mut mac: fidl::endpoints::ServerEnd<MacAddressingMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PortGetMacRequest>(
(mac,),
0x2c6ec2988aefc0f6,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_device(
&self,
mut device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PortGetDeviceRequest>(
(device,),
0x7de34747235d2d80,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#clone(
&self,
mut port: fidl::endpoints::ServerEnd<PortMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PortCloneRequest>(
(port,),
0x4e4764150b4942d3,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_counters(
&self,
___deadline: zx::MonotonicTime,
) -> Result<PortGetCountersResponse, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, PortGetCountersResponse>(
(),
0x6a213b03c4fcbbac,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_diagnostics(
&self,
mut diagnostics: fidl::endpoints::ServerEnd<DiagnosticsMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PortGetDiagnosticsRequest>(
(diagnostics,),
0x381faa4ed75e399c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct PortProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for PortProxy {
type Protocol = PortMarker;
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 PortProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <PortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PortEventStream {
PortEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_info(&self) -> fidl::client::QueryResponseFut<PortInfo> {
PortProxyInterface::r#get_info(self)
}
pub fn r#get_status(&self) -> fidl::client::QueryResponseFut<PortStatus> {
PortProxyInterface::r#get_status(self)
}
pub fn r#get_status_watcher(
&self,
mut watcher: fidl::endpoints::ServerEnd<StatusWatcherMarker>,
mut buffer: u32,
) -> Result<(), fidl::Error> {
PortProxyInterface::r#get_status_watcher(self, watcher, buffer)
}
pub fn r#get_mac(
&self,
mut mac: fidl::endpoints::ServerEnd<MacAddressingMarker>,
) -> Result<(), fidl::Error> {
PortProxyInterface::r#get_mac(self, mac)
}
pub fn r#get_device(
&self,
mut device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
PortProxyInterface::r#get_device(self, device)
}
pub fn r#clone(
&self,
mut port: fidl::endpoints::ServerEnd<PortMarker>,
) -> Result<(), fidl::Error> {
PortProxyInterface::r#clone(self, port)
}
pub fn r#get_counters(&self) -> fidl::client::QueryResponseFut<PortGetCountersResponse> {
PortProxyInterface::r#get_counters(self)
}
pub fn r#get_diagnostics(
&self,
mut diagnostics: fidl::endpoints::ServerEnd<DiagnosticsMarker>,
) -> Result<(), fidl::Error> {
PortProxyInterface::r#get_diagnostics(self, diagnostics)
}
}
impl PortProxyInterface for PortProxy {
type GetInfoResponseFut = fidl::client::QueryResponseFut<PortInfo>;
fn r#get_info(&self) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<PortInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
PortGetInfoResponse,
0x276cf65feb554ebd,
>(_buf?)?;
Ok(_response.info)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PortInfo>(
(),
0x276cf65feb554ebd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetStatusResponseFut = fidl::client::QueryResponseFut<PortStatus>;
fn r#get_status(&self) -> Self::GetStatusResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<PortStatus, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
PortGetStatusResponse,
0x4235650aacca60b2,
>(_buf?)?;
Ok(_response.status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PortStatus>(
(),
0x4235650aacca60b2,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#get_status_watcher(
&self,
mut watcher: fidl::endpoints::ServerEnd<StatusWatcherMarker>,
mut buffer: u32,
) -> Result<(), fidl::Error> {
self.client.send::<PortGetStatusWatcherRequest>(
(watcher, buffer),
0x65511ab81c1bd8d4,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#get_mac(
&self,
mut mac: fidl::endpoints::ServerEnd<MacAddressingMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PortGetMacRequest>(
(mac,),
0x2c6ec2988aefc0f6,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#get_device(
&self,
mut device: fidl::endpoints::ServerEnd<DeviceMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PortGetDeviceRequest>(
(device,),
0x7de34747235d2d80,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#clone(&self, mut port: fidl::endpoints::ServerEnd<PortMarker>) -> Result<(), fidl::Error> {
self.client.send::<PortCloneRequest>(
(port,),
0x4e4764150b4942d3,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetCountersResponseFut = fidl::client::QueryResponseFut<PortGetCountersResponse>;
fn r#get_counters(&self) -> Self::GetCountersResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<PortGetCountersResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
PortGetCountersResponse,
0x6a213b03c4fcbbac,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PortGetCountersResponse>(
(),
0x6a213b03c4fcbbac,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#get_diagnostics(
&self,
mut diagnostics: fidl::endpoints::ServerEnd<DiagnosticsMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<PortGetDiagnosticsRequest>(
(diagnostics,),
0x381faa4ed75e399c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct PortEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for PortEventStream {}
impl futures::stream::FusedStream for PortEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PortEventStream {
type Item = Result<PortEvent, 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(PortEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PortEvent {}
impl PortEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<PortEvent, 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: <PortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PortRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for PortRequestStream {}
impl futures::stream::FusedStream for PortRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PortRequestStream {
type Protocol = PortMarker;
type ControlHandle = PortControlHandle;
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 {
PortControlHandle { 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 PortRequestStream {
type Item = Result<PortRequest, 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 PortRequestStream 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 {
0x276cf65feb554ebd => {
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 = PortControlHandle { inner: this.inner.clone() };
Ok(PortRequest::GetInfo {
responder: PortGetInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4235650aacca60b2 => {
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 = PortControlHandle { inner: this.inner.clone() };
Ok(PortRequest::GetStatus {
responder: PortGetStatusResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x65511ab81c1bd8d4 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(PortGetStatusWatcherRequest);
fidl::encoding::Decoder::decode_into::<PortGetStatusWatcherRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PortControlHandle { inner: this.inner.clone() };
Ok(PortRequest::GetStatusWatcher {
watcher: req.watcher,
buffer: req.buffer,
control_handle,
})
}
0x2c6ec2988aefc0f6 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(PortGetMacRequest);
fidl::encoding::Decoder::decode_into::<PortGetMacRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PortControlHandle { inner: this.inner.clone() };
Ok(PortRequest::GetMac { mac: req.mac, control_handle })
}
0x7de34747235d2d80 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(PortGetDeviceRequest);
fidl::encoding::Decoder::decode_into::<PortGetDeviceRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PortControlHandle { inner: this.inner.clone() };
Ok(PortRequest::GetDevice { device: req.device, control_handle })
}
0x4e4764150b4942d3 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(PortCloneRequest);
fidl::encoding::Decoder::decode_into::<PortCloneRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PortControlHandle { inner: this.inner.clone() };
Ok(PortRequest::Clone { port: req.port, control_handle })
}
0x6a213b03c4fcbbac => {
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 = PortControlHandle { inner: this.inner.clone() };
Ok(PortRequest::GetCounters {
responder: PortGetCountersResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x381faa4ed75e399c => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(PortGetDiagnosticsRequest);
fidl::encoding::Decoder::decode_into::<PortGetDiagnosticsRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = PortControlHandle { inner: this.inner.clone() };
Ok(PortRequest::GetDiagnostics { diagnostics: req.diagnostics, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <PortMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum PortRequest {
GetInfo { responder: PortGetInfoResponder },
GetStatus { responder: PortGetStatusResponder },
GetStatusWatcher {
watcher: fidl::endpoints::ServerEnd<StatusWatcherMarker>,
buffer: u32,
control_handle: PortControlHandle,
},
GetMac {
mac: fidl::endpoints::ServerEnd<MacAddressingMarker>,
control_handle: PortControlHandle,
},
GetDevice {
device: fidl::endpoints::ServerEnd<DeviceMarker>,
control_handle: PortControlHandle,
},
Clone { port: fidl::endpoints::ServerEnd<PortMarker>, control_handle: PortControlHandle },
GetCounters { responder: PortGetCountersResponder },
GetDiagnostics {
diagnostics: fidl::endpoints::ServerEnd<DiagnosticsMarker>,
control_handle: PortControlHandle,
},
}
impl PortRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_info(self) -> Option<(PortGetInfoResponder)> {
if let PortRequest::GetInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_status(self) -> Option<(PortGetStatusResponder)> {
if let PortRequest::GetStatus { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_status_watcher(
self,
) -> Option<(fidl::endpoints::ServerEnd<StatusWatcherMarker>, u32, PortControlHandle)> {
if let PortRequest::GetStatusWatcher { watcher, buffer, control_handle } = self {
Some((watcher, buffer, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_mac(
self,
) -> Option<(fidl::endpoints::ServerEnd<MacAddressingMarker>, PortControlHandle)> {
if let PortRequest::GetMac { mac, control_handle } = self {
Some((mac, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_device(
self,
) -> Option<(fidl::endpoints::ServerEnd<DeviceMarker>, PortControlHandle)> {
if let PortRequest::GetDevice { device, control_handle } = self {
Some((device, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clone(self) -> Option<(fidl::endpoints::ServerEnd<PortMarker>, PortControlHandle)> {
if let PortRequest::Clone { port, control_handle } = self {
Some((port, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_counters(self) -> Option<(PortGetCountersResponder)> {
if let PortRequest::GetCounters { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_diagnostics(
self,
) -> Option<(fidl::endpoints::ServerEnd<DiagnosticsMarker>, PortControlHandle)> {
if let PortRequest::GetDiagnostics { diagnostics, control_handle } = self {
Some((diagnostics, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PortRequest::GetInfo { .. } => "get_info",
PortRequest::GetStatus { .. } => "get_status",
PortRequest::GetStatusWatcher { .. } => "get_status_watcher",
PortRequest::GetMac { .. } => "get_mac",
PortRequest::GetDevice { .. } => "get_device",
PortRequest::Clone { .. } => "clone",
PortRequest::GetCounters { .. } => "get_counters",
PortRequest::GetDiagnostics { .. } => "get_diagnostics",
}
}
}
#[derive(Debug, Clone)]
pub struct PortControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for PortControlHandle {
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 PortControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PortGetInfoResponder {
control_handle: std::mem::ManuallyDrop<PortControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PortGetInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PortGetInfoResponder {
type ControlHandle = PortControlHandle;
fn control_handle(&self) -> &PortControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PortGetInfoResponder {
pub fn send(self, mut info: &PortInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut info: &PortInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut info: &PortInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<PortGetInfoResponse>(
(info,),
self.tx_id,
0x276cf65feb554ebd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PortGetStatusResponder {
control_handle: std::mem::ManuallyDrop<PortControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PortGetStatusResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PortGetStatusResponder {
type ControlHandle = PortControlHandle;
fn control_handle(&self) -> &PortControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PortGetStatusResponder {
pub fn send(self, mut status: &PortStatus) -> 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: &PortStatus) -> Result<(), fidl::Error> {
let _result = self.send_raw(status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut status: &PortStatus) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<PortGetStatusResponse>(
(status,),
self.tx_id,
0x4235650aacca60b2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PortGetCountersResponder {
control_handle: std::mem::ManuallyDrop<PortControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PortGetCountersResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PortGetCountersResponder {
type ControlHandle = PortControlHandle;
fn control_handle(&self) -> &PortControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PortGetCountersResponder {
pub fn send(self, mut payload: &PortGetCountersResponse) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: &PortGetCountersResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: &PortGetCountersResponse) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<PortGetCountersResponse>(
payload,
self.tx_id,
0x6a213b03c4fcbbac,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PortWatcherMarker;
impl fidl::endpoints::ProtocolMarker for PortWatcherMarker {
type Proxy = PortWatcherProxy;
type RequestStream = PortWatcherRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PortWatcherSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) PortWatcher";
}
pub trait PortWatcherProxyInterface: Send + Sync {
type WatchResponseFut: std::future::Future<Output = Result<DevicePortEvent, fidl::Error>> + Send;
fn r#watch(&self) -> Self::WatchResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PortWatcherSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PortWatcherSynchronousProxy {
type Proxy = PortWatcherProxy;
type Protocol = PortWatcherMarker;
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 PortWatcherSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <PortWatcherMarker 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::MonotonicTime,
) -> Result<PortWatcherEvent, fidl::Error> {
PortWatcherEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#watch(&self, ___deadline: zx::MonotonicTime) -> Result<DevicePortEvent, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, PortWatcherWatchResponse>(
(),
0x3e87244b74fff55e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.event)
}
}
#[derive(Debug, Clone)]
pub struct PortWatcherProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for PortWatcherProxy {
type Protocol = PortWatcherMarker;
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 PortWatcherProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <PortWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PortWatcherEventStream {
PortWatcherEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#watch(&self) -> fidl::client::QueryResponseFut<DevicePortEvent> {
PortWatcherProxyInterface::r#watch(self)
}
}
impl PortWatcherProxyInterface for PortWatcherProxy {
type WatchResponseFut = fidl::client::QueryResponseFut<DevicePortEvent>;
fn r#watch(&self) -> Self::WatchResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<DevicePortEvent, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
PortWatcherWatchResponse,
0x3e87244b74fff55e,
>(_buf?)?;
Ok(_response.event)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DevicePortEvent>(
(),
0x3e87244b74fff55e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct PortWatcherEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for PortWatcherEventStream {}
impl futures::stream::FusedStream for PortWatcherEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PortWatcherEventStream {
type Item = Result<PortWatcherEvent, 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(PortWatcherEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PortWatcherEvent {}
impl PortWatcherEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<PortWatcherEvent, 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: <PortWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PortWatcherRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for PortWatcherRequestStream {}
impl futures::stream::FusedStream for PortWatcherRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PortWatcherRequestStream {
type Protocol = PortWatcherMarker;
type ControlHandle = PortWatcherControlHandle;
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 {
PortWatcherControlHandle { 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 PortWatcherRequestStream {
type Item = Result<PortWatcherRequest, 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 PortWatcherRequestStream 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 {
0x3e87244b74fff55e => {
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 = PortWatcherControlHandle { inner: this.inner.clone() };
Ok(PortWatcherRequest::Watch {
responder: PortWatcherWatchResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<PortWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum PortWatcherRequest {
Watch { responder: PortWatcherWatchResponder },
}
impl PortWatcherRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_watch(self) -> Option<(PortWatcherWatchResponder)> {
if let PortWatcherRequest::Watch { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PortWatcherRequest::Watch { .. } => "watch",
}
}
}
#[derive(Debug, Clone)]
pub struct PortWatcherControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for PortWatcherControlHandle {
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 PortWatcherControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PortWatcherWatchResponder {
control_handle: std::mem::ManuallyDrop<PortWatcherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PortWatcherWatchResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PortWatcherWatchResponder {
type ControlHandle = PortWatcherControlHandle;
fn control_handle(&self) -> &PortWatcherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PortWatcherWatchResponder {
pub fn send(self, mut event: &DevicePortEvent) -> Result<(), fidl::Error> {
let _result = self.send_raw(event);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut event: &DevicePortEvent) -> Result<(), fidl::Error> {
let _result = self.send_raw(event);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut event: &DevicePortEvent) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<PortWatcherWatchResponse>(
(event,),
self.tx_id,
0x3e87244b74fff55e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SessionMarker;
impl fidl::endpoints::ProtocolMarker for SessionMarker {
type Proxy = SessionProxy;
type RequestStream = SessionRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SessionSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Session";
}
pub type SessionAttachResult = Result<(), i32>;
pub type SessionDetachResult = Result<(), i32>;
pub trait SessionProxyInterface: Send + Sync {
type AttachResponseFut: std::future::Future<Output = Result<SessionAttachResult, fidl::Error>>
+ Send;
fn r#attach(&self, port: &PortId, rx_frames: &[FrameType]) -> Self::AttachResponseFut;
type DetachResponseFut: std::future::Future<Output = Result<SessionDetachResult, fidl::Error>>
+ Send;
fn r#detach(&self, port: &PortId) -> Self::DetachResponseFut;
fn r#close(&self) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SessionSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SessionSynchronousProxy {
type Proxy = SessionProxy;
type Protocol = SessionMarker;
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 SessionSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SessionMarker 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::MonotonicTime) -> Result<SessionEvent, fidl::Error> {
SessionEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#attach(
&self,
mut port: &PortId,
mut rx_frames: &[FrameType],
___deadline: zx::MonotonicTime,
) -> Result<SessionAttachResult, fidl::Error> {
let _response = self.client.send_query::<
SessionAttachRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(port, rx_frames,),
0x1e89c9013e201379,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#detach(
&self,
mut port: &PortId,
___deadline: zx::MonotonicTime,
) -> Result<SessionDetachResult, fidl::Error> {
let _response = self.client.send_query::<
SessionDetachRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(port,),
0x68c40cf8fb549867,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#close(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x393d5070394a92f6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct SessionProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for SessionProxy {
type Protocol = SessionMarker;
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 SessionProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SessionEventStream {
SessionEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#attach(
&self,
mut port: &PortId,
mut rx_frames: &[FrameType],
) -> fidl::client::QueryResponseFut<SessionAttachResult> {
SessionProxyInterface::r#attach(self, port, rx_frames)
}
pub fn r#detach(
&self,
mut port: &PortId,
) -> fidl::client::QueryResponseFut<SessionDetachResult> {
SessionProxyInterface::r#detach(self, port)
}
pub fn r#close(&self) -> Result<(), fidl::Error> {
SessionProxyInterface::r#close(self)
}
}
impl SessionProxyInterface for SessionProxy {
type AttachResponseFut = fidl::client::QueryResponseFut<SessionAttachResult>;
fn r#attach(&self, mut port: &PortId, mut rx_frames: &[FrameType]) -> Self::AttachResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<SessionAttachResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x1e89c9013e201379,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<SessionAttachRequest, SessionAttachResult>(
(port, rx_frames),
0x1e89c9013e201379,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DetachResponseFut = fidl::client::QueryResponseFut<SessionDetachResult>;
fn r#detach(&self, mut port: &PortId) -> Self::DetachResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<SessionDetachResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
0x68c40cf8fb549867,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<SessionDetachRequest, SessionDetachResult>(
(port,),
0x68c40cf8fb549867,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#close(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x393d5070394a92f6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct SessionEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for SessionEventStream {}
impl futures::stream::FusedStream for SessionEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SessionEventStream {
type Item = Result<SessionEvent, 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(SessionEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SessionEvent {}
impl SessionEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<SessionEvent, 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: <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SessionRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for SessionRequestStream {}
impl futures::stream::FusedStream for SessionRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SessionRequestStream {
type Protocol = SessionMarker;
type ControlHandle = SessionControlHandle;
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 {
SessionControlHandle { 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 SessionRequestStream {
type Item = Result<SessionRequest, 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 SessionRequestStream 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 {
0x1e89c9013e201379 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(SessionAttachRequest);
fidl::encoding::Decoder::decode_into::<SessionAttachRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::Attach {
port: req.port,
rx_frames: req.rx_frames,
responder: SessionAttachResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x68c40cf8fb549867 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(SessionDetachRequest);
fidl::encoding::Decoder::decode_into::<SessionDetachRequest>(
&header,
_body_bytes,
handles,
&mut req,
)?;
let control_handle = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::Detach {
port: req.port,
responder: SessionDetachResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x393d5070394a92f6 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
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 = SessionControlHandle { inner: this.inner.clone() };
Ok(SessionRequest::Close { control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum SessionRequest {
Attach { port: PortId, rx_frames: Vec<FrameType>, responder: SessionAttachResponder },
Detach { port: PortId, responder: SessionDetachResponder },
Close { control_handle: SessionControlHandle },
}
impl SessionRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_attach(self) -> Option<(PortId, Vec<FrameType>, SessionAttachResponder)> {
if let SessionRequest::Attach { port, rx_frames, responder } = self {
Some((port, rx_frames, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_detach(self) -> Option<(PortId, SessionDetachResponder)> {
if let SessionRequest::Detach { port, responder } = self {
Some((port, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_close(self) -> Option<(SessionControlHandle)> {
if let SessionRequest::Close { control_handle } = self {
Some((control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SessionRequest::Attach { .. } => "attach",
SessionRequest::Detach { .. } => "detach",
SessionRequest::Close { .. } => "close",
}
}
}
#[derive(Debug, Clone)]
pub struct SessionControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for SessionControlHandle {
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 SessionControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SessionAttachResponder {
control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SessionAttachResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SessionAttachResponder {
type ControlHandle = SessionControlHandle;
fn control_handle(&self) -> &SessionControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SessionAttachResponder {
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,
0x1e89c9013e201379,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SessionDetachResponder {
control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SessionDetachResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SessionDetachResponder {
type ControlHandle = SessionControlHandle;
fn control_handle(&self) -> &SessionControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SessionDetachResponder {
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,
0x68c40cf8fb549867,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct StatusWatcherMarker;
impl fidl::endpoints::ProtocolMarker for StatusWatcherMarker {
type Proxy = StatusWatcherProxy;
type RequestStream = StatusWatcherRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = StatusWatcherSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) StatusWatcher";
}
pub trait StatusWatcherProxyInterface: Send + Sync {
type WatchStatusResponseFut: std::future::Future<Output = Result<PortStatus, fidl::Error>>
+ Send;
fn r#watch_status(&self) -> Self::WatchStatusResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct StatusWatcherSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for StatusWatcherSynchronousProxy {
type Proxy = StatusWatcherProxy;
type Protocol = StatusWatcherMarker;
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 StatusWatcherSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <StatusWatcherMarker 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::MonotonicTime,
) -> Result<StatusWatcherEvent, fidl::Error> {
StatusWatcherEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#watch_status(
&self,
___deadline: zx::MonotonicTime,
) -> Result<PortStatus, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, StatusWatcherWatchStatusResponse>(
(),
0x1369a8125c0862b9,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.port_status)
}
}
#[derive(Debug, Clone)]
pub struct StatusWatcherProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for StatusWatcherProxy {
type Protocol = StatusWatcherMarker;
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 StatusWatcherProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <StatusWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> StatusWatcherEventStream {
StatusWatcherEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#watch_status(&self) -> fidl::client::QueryResponseFut<PortStatus> {
StatusWatcherProxyInterface::r#watch_status(self)
}
}
impl StatusWatcherProxyInterface for StatusWatcherProxy {
type WatchStatusResponseFut = fidl::client::QueryResponseFut<PortStatus>;
fn r#watch_status(&self) -> Self::WatchStatusResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<PortStatus, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StatusWatcherWatchStatusResponse,
0x1369a8125c0862b9,
>(_buf?)?;
Ok(_response.port_status)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PortStatus>(
(),
0x1369a8125c0862b9,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct StatusWatcherEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for StatusWatcherEventStream {}
impl futures::stream::FusedStream for StatusWatcherEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for StatusWatcherEventStream {
type Item = Result<StatusWatcherEvent, 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(StatusWatcherEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum StatusWatcherEvent {}
impl StatusWatcherEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<StatusWatcherEvent, 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: <StatusWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct StatusWatcherRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for StatusWatcherRequestStream {}
impl futures::stream::FusedStream for StatusWatcherRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for StatusWatcherRequestStream {
type Protocol = StatusWatcherMarker;
type ControlHandle = StatusWatcherControlHandle;
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 {
StatusWatcherControlHandle { 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 StatusWatcherRequestStream {
type Item = Result<StatusWatcherRequest, 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 StatusWatcherRequestStream 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 {
0x1369a8125c0862b9 => {
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 = StatusWatcherControlHandle { inner: this.inner.clone() };
Ok(StatusWatcherRequest::WatchStatus {
responder: StatusWatcherWatchStatusResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<StatusWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum StatusWatcherRequest {
WatchStatus { responder: StatusWatcherWatchStatusResponder },
}
impl StatusWatcherRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_watch_status(self) -> Option<(StatusWatcherWatchStatusResponder)> {
if let StatusWatcherRequest::WatchStatus { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
StatusWatcherRequest::WatchStatus { .. } => "watch_status",
}
}
}
#[derive(Debug, Clone)]
pub struct StatusWatcherControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for StatusWatcherControlHandle {
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 StatusWatcherControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StatusWatcherWatchStatusResponder {
control_handle: std::mem::ManuallyDrop<StatusWatcherControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StatusWatcherWatchStatusResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StatusWatcherWatchStatusResponder {
type ControlHandle = StatusWatcherControlHandle;
fn control_handle(&self) -> &StatusWatcherControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StatusWatcherWatchStatusResponder {
pub fn send(self, mut port_status: &PortStatus) -> Result<(), fidl::Error> {
let _result = self.send_raw(port_status);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut port_status: &PortStatus) -> Result<(), fidl::Error> {
let _result = self.send_raw(port_status);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut port_status: &PortStatus) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StatusWatcherWatchStatusResponse>(
(port_status,),
self.tx_id,
0x1369a8125c0862b9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for EthernetFeatures {
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 EthernetFeatures {
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 EthernetFeatures {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for EthernetFeatures {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[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_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RxFlags {
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 RxFlags {
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 RxFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for RxFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[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_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for SessionFlags {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
}
impl fidl::encoding::ValueTypeMarker for SessionFlags {
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 SessionFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for SessionFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[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::<u16>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StatusFlags {
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 StatusFlags {
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 StatusFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for StatusFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[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_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for TxFlags {
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 TxFlags {
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 TxFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for TxFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[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_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for TxReturnFlags {
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 TxReturnFlags {
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 TxReturnFlags {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for TxReturnFlags {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[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_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceClass {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u16>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u16>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for DeviceClass {
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 DeviceClass {
#[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 DeviceClass {
#[inline(always)]
fn new_empty() -> Self {
Self::Virtual
}
#[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::<u16>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for FrameType {
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 FrameType {
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 FrameType {
#[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 FrameType {
#[inline(always)]
fn new_empty() -> Self {
Self::Ethernet
}
#[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 InfoType {
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 InfoType {
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 InfoType {
#[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 InfoType {
#[inline(always)]
fn new_empty() -> Self {
Self::NoInfo
}
#[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 MacFilterMode {
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 MacFilterMode {
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 MacFilterMode {
#[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 MacFilterMode {
#[inline(always)]
fn new_empty() -> Self {
Self::MulticastFilter
}
#[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 PortClass {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u16>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u16>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for PortClass {
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 PortClass {
#[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 PortClass {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[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::<u16>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RxAcceleration {
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 RxAcceleration {
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 RxAcceleration {
#[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 RxAcceleration {
#[inline(always)]
fn new_empty() -> Self {
Self::ValidatedEthernetFcs
}
#[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 TxAcceleration {
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 TxAcceleration {
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 TxAcceleration {
#[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 TxAcceleration {
#[inline(always)]
fn new_empty() -> Self {
Self::ComputeEthernetFcs
}
#[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 DeviceCloneRequest {
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 DeviceCloneRequest {
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<DeviceCloneRequest> for &mut DeviceCloneRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceCloneRequest>(offset);
fidl::encoding::Encode::<DeviceCloneRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.device),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
>,
> fidl::encoding::Encode<DeviceCloneRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceCloneRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceCloneRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
device: 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.device,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetInfoResponse {
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 DeviceGetInfoResponse {
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<DeviceGetInfoResponse> for &DeviceGetInfoResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetInfoResponse>(offset);
fidl::encoding::Encode::<DeviceGetInfoResponse>::encode(
(<DeviceInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<DeviceInfo>>
fidl::encoding::Encode<DeviceGetInfoResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceGetInfoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { info: fidl::new_empty!(DeviceInfo) }
}
#[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!(DeviceInfo, &mut self.info, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetPortRequest {
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 DeviceGetPortRequest {
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<DeviceGetPortRequest> for &mut DeviceGetPortRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetPortRequest>(offset);
fidl::encoding::Encode::<DeviceGetPortRequest>::encode(
(
<PortId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.port),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<PortId>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortMarker>>,
>,
> fidl::encoding::Encode<DeviceGetPortRequest> 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::<DeviceGetPortRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceGetPortRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(PortId),
port: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortMarker>>
),
}
}
#[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 u32).read_unaligned() };
let mask = 0xffff0000u32;
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!(PortId, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortMarker>>,
&mut self.port,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceGetPortWatcherRequest {
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 DeviceGetPortWatcherRequest {
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<DeviceGetPortWatcherRequest>
for &mut DeviceGetPortWatcherRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetPortWatcherRequest>(offset);
fidl::encoding::Encode::<DeviceGetPortWatcherRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortWatcherMarker>>,
>,
> fidl::encoding::Encode<DeviceGetPortWatcherRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceGetPortWatcherRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceGetPortWatcherRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
watcher: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortWatcherMarker>>
),
}
}
#[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<PortWatcherMarker>>,
&mut self.watcher,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceInstanceGetDeviceRequest {
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 DeviceInstanceGetDeviceRequest {
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<DeviceInstanceGetDeviceRequest>
for &mut DeviceInstanceGetDeviceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceInstanceGetDeviceRequest>(offset);
fidl::encoding::Encode::<DeviceInstanceGetDeviceRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.device),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
>,
> fidl::encoding::Encode<DeviceInstanceGetDeviceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceInstanceGetDeviceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceInstanceGetDeviceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
device: 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.device,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceOpenSessionRequest {
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::ResourceTypeMarker for DeviceOpenSessionRequest {
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<DeviceOpenSessionRequest> for &mut DeviceOpenSessionRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceOpenSessionRequest>(offset);
fidl::encoding::Encode::<DeviceOpenSessionRequest>::encode(
(
<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
&self.session_name,
),
<SessionInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.session_info,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>>,
T1: fidl::encoding::Encode<SessionInfo>,
> fidl::encoding::Encode<DeviceOpenSessionRequest> 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::<DeviceOpenSessionRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceOpenSessionRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
session_name: fidl::new_empty!(fidl::encoding::BoundedString<64>),
session_info: fidl::new_empty!(SessionInfo),
}
}
#[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::BoundedString<64>,
&mut self.session_name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(SessionInfo, &mut self.session_info, decoder, offset + 16, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceOpenSessionResponse {
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
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceOpenSessionResponse {
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<DeviceOpenSessionResponse> for &mut DeviceOpenSessionResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceOpenSessionResponse>(offset);
fidl::encoding::Encode::<DeviceOpenSessionResponse>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.session),
<Fifos as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.fifos),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionMarker>>,
>,
T1: fidl::encoding::Encode<Fifos>,
> fidl::encoding::Encode<DeviceOpenSessionResponse> 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::<DeviceOpenSessionResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceOpenSessionResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
session: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionMarker>>
),
fifos: fidl::new_empty!(Fifos),
}
}
#[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::ClientEnd<SessionMarker>>,
&mut self.session,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(Fifos, &mut self.fifos, decoder, offset + 4, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Empty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
impl fidl::encoding::ValueTypeMarker for Empty {
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<Empty> for &Empty {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Empty>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl fidl::encoding::Decode<Self> for Empty {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[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);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
unsafe impl fidl::encoding::TypeMarker for Fifos {
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 Fifos {
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<Fifos> for &mut Fifos {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Fifos>(offset);
fidl::encoding::Encode::<Fifos>::encode(
(
<fidl::encoding::HandleType<
fidl::Fifo,
{ fidl::ObjectType::FIFO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.rx
),
<fidl::encoding::HandleType<
fidl::Fifo,
{ fidl::ObjectType::FIFO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.tx
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Fifo,
{ fidl::ObjectType::FIFO.into_raw() },
2147483648,
>,
>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Fifo,
{ fidl::ObjectType::FIFO.into_raw() },
2147483648,
>,
>,
> fidl::encoding::Encode<Fifos> 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::<Fifos>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for Fifos {
#[inline(always)]
fn new_empty() -> Self {
Self {
rx: fidl::new_empty!(fidl::encoding::HandleType<fidl::Fifo, { fidl::ObjectType::FIFO.into_raw() }, 2147483648>),
tx: fidl::new_empty!(fidl::encoding::HandleType<fidl::Fifo, { fidl::ObjectType::FIFO.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!(fidl::encoding::HandleType<fidl::Fifo, { fidl::ObjectType::FIFO.into_raw() }, 2147483648>, &mut self.rx, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Fifo, { fidl::ObjectType::FIFO.into_raw() }, 2147483648>, &mut self.tx, decoder, offset + 4, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for FrameTypeSupport {
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
}
}
impl fidl::encoding::ValueTypeMarker for FrameTypeSupport {
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<FrameTypeSupport> for &FrameTypeSupport {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FrameTypeSupport>(offset);
fidl::encoding::Encode::<FrameTypeSupport>::encode(
(
<FrameType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.features),
<TxFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_flags),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<FrameType>,
T1: fidl::encoding::Encode<u32>,
T2: fidl::encoding::Encode<TxFlags>,
> fidl::encoding::Encode<FrameTypeSupport> 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::<FrameTypeSupport>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
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 FrameTypeSupport {
#[inline(always)]
fn new_empty() -> Self {
Self {
type_: fidl::new_empty!(FrameType),
features: fidl::new_empty!(u32),
supported_flags: fidl::new_empty!(TxFlags),
}
}
#[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 u32).read_unaligned() };
let mask = 0xffffff00u32;
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!(FrameType, &mut self.type_, decoder, offset + 0, _depth)?;
fidl::decode!(u32, &mut self.features, decoder, offset + 4, _depth)?;
fidl::decode!(TxFlags, &mut self.supported_flags, decoder, offset + 8, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MacAddressingAddMulticastAddressRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
6
}
}
impl fidl::encoding::ValueTypeMarker for MacAddressingAddMulticastAddressRequest {
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<MacAddressingAddMulticastAddressRequest>
for &MacAddressingAddMulticastAddressRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingAddMulticastAddressRequest>(offset);
fidl::encoding::Encode::<MacAddressingAddMulticastAddressRequest>::encode(
(<fidl_fuchsia_net::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(
&self.address,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl_fuchsia_net::MacAddress>>
fidl::encoding::Encode<MacAddressingAddMulticastAddressRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingAddMulticastAddressRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for MacAddressingAddMulticastAddressRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { address: fidl::new_empty!(fidl_fuchsia_net::MacAddress) }
}
#[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_fuchsia_net::MacAddress,
&mut self.address,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MacAddressingAddMulticastAddressResponse {
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 MacAddressingAddMulticastAddressResponse {
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<MacAddressingAddMulticastAddressResponse>
for &MacAddressingAddMulticastAddressResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingAddMulticastAddressResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut MacAddressingAddMulticastAddressResponse).write_unaligned(
(self as *const MacAddressingAddMulticastAddressResponse).read(),
);
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<MacAddressingAddMulticastAddressResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingAddMulticastAddressResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for MacAddressingAddMulticastAddressResponse {
#[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 MacAddressingGetUnicastAddressResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
6
}
}
impl fidl::encoding::ValueTypeMarker for MacAddressingGetUnicastAddressResponse {
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<MacAddressingGetUnicastAddressResponse>
for &MacAddressingGetUnicastAddressResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingGetUnicastAddressResponse>(offset);
fidl::encoding::Encode::<MacAddressingGetUnicastAddressResponse>::encode(
(<fidl_fuchsia_net::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(
&self.address,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl_fuchsia_net::MacAddress>>
fidl::encoding::Encode<MacAddressingGetUnicastAddressResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingGetUnicastAddressResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for MacAddressingGetUnicastAddressResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { address: fidl::new_empty!(fidl_fuchsia_net::MacAddress) }
}
#[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_fuchsia_net::MacAddress,
&mut self.address,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MacAddressingRemoveMulticastAddressRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
6
}
}
impl fidl::encoding::ValueTypeMarker for MacAddressingRemoveMulticastAddressRequest {
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<MacAddressingRemoveMulticastAddressRequest>
for &MacAddressingRemoveMulticastAddressRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingRemoveMulticastAddressRequest>(offset);
fidl::encoding::Encode::<MacAddressingRemoveMulticastAddressRequest>::encode(
(<fidl_fuchsia_net::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(
&self.address,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<fidl_fuchsia_net::MacAddress>>
fidl::encoding::Encode<MacAddressingRemoveMulticastAddressRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingRemoveMulticastAddressRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for MacAddressingRemoveMulticastAddressRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { address: fidl::new_empty!(fidl_fuchsia_net::MacAddress) }
}
#[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_fuchsia_net::MacAddress,
&mut self.address,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MacAddressingRemoveMulticastAddressResponse {
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 MacAddressingRemoveMulticastAddressResponse {
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<MacAddressingRemoveMulticastAddressResponse>
for &MacAddressingRemoveMulticastAddressResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingRemoveMulticastAddressResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut MacAddressingRemoveMulticastAddressResponse).write_unaligned(
(self as *const MacAddressingRemoveMulticastAddressResponse).read(),
);
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<MacAddressingRemoveMulticastAddressResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingRemoveMulticastAddressResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for MacAddressingRemoveMulticastAddressResponse {
#[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 MacAddressingSetModeRequest {
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 MacAddressingSetModeRequest {
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<MacAddressingSetModeRequest> for &MacAddressingSetModeRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingSetModeRequest>(offset);
fidl::encoding::Encode::<MacAddressingSetModeRequest>::encode(
(<MacFilterMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<MacFilterMode>>
fidl::encoding::Encode<MacAddressingSetModeRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingSetModeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for MacAddressingSetModeRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { mode: fidl::new_empty!(MacFilterMode) }
}
#[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!(MacFilterMode, &mut self.mode, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MacAddressingSetModeResponse {
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 MacAddressingSetModeResponse {
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<MacAddressingSetModeResponse> for &MacAddressingSetModeResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingSetModeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut MacAddressingSetModeResponse)
.write_unaligned((self as *const MacAddressingSetModeResponse).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<i32>>
fidl::encoding::Encode<MacAddressingSetModeResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MacAddressingSetModeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for MacAddressingSetModeResponse {
#[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 PortCloneRequest {
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 PortCloneRequest {
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<PortCloneRequest> for &mut PortCloneRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortCloneRequest>(offset);
fidl::encoding::Encode::<PortCloneRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.port),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortMarker>>,
>,
> fidl::encoding::Encode<PortCloneRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortCloneRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PortCloneRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
port: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PortMarker>>
),
}
}
#[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<PortMarker>>,
&mut self.port,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PortGetDeviceRequest {
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 PortGetDeviceRequest {
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<PortGetDeviceRequest> for &mut PortGetDeviceRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetDeviceRequest>(offset);
fidl::encoding::Encode::<PortGetDeviceRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.device),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceMarker>>,
>,
> fidl::encoding::Encode<PortGetDeviceRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetDeviceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PortGetDeviceRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
device: 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.device,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PortGetDiagnosticsRequest {
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 PortGetDiagnosticsRequest {
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<PortGetDiagnosticsRequest> for &mut PortGetDiagnosticsRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetDiagnosticsRequest>(offset);
fidl::encoding::Encode::<PortGetDiagnosticsRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DiagnosticsMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.diagnostics),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DiagnosticsMarker>>,
>,
> fidl::encoding::Encode<PortGetDiagnosticsRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetDiagnosticsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PortGetDiagnosticsRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
diagnostics: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DiagnosticsMarker>>
),
}
}
#[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<DiagnosticsMarker>>,
&mut self.diagnostics,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PortGetInfoResponse {
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 PortGetInfoResponse {
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<PortGetInfoResponse> for &PortGetInfoResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetInfoResponse>(offset);
fidl::encoding::Encode::<PortGetInfoResponse>::encode(
(<PortInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<PortInfo>> fidl::encoding::Encode<PortGetInfoResponse>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PortGetInfoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { info: fidl::new_empty!(PortInfo) }
}
#[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!(PortInfo, &mut self.info, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PortGetMacRequest {
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 PortGetMacRequest {
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<PortGetMacRequest> for &mut PortGetMacRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetMacRequest>(offset);
fidl::encoding::Encode::<PortGetMacRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MacAddressingMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.mac),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MacAddressingMarker>>,
>,
> fidl::encoding::Encode<PortGetMacRequest> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetMacRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PortGetMacRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
mac: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<MacAddressingMarker>>
),
}
}
#[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<MacAddressingMarker>>,
&mut self.mac,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PortGetStatusResponse {
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 PortGetStatusResponse {
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<PortGetStatusResponse> for &PortGetStatusResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetStatusResponse>(offset);
fidl::encoding::Encode::<PortGetStatusResponse>::encode(
(<PortStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<PortStatus>>
fidl::encoding::Encode<PortGetStatusResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetStatusResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PortGetStatusResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { status: fidl::new_empty!(PortStatus) }
}
#[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!(PortStatus, &mut self.status, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PortGetStatusWatcherRequest {
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 PortGetStatusWatcherRequest {
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<PortGetStatusWatcherRequest>
for &mut PortGetStatusWatcherRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortGetStatusWatcherRequest>(offset);
fidl::encoding::Encode::<PortGetStatusWatcherRequest>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StatusWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StatusWatcherMarker>>,
>,
T1: fidl::encoding::Encode<u32>,
> fidl::encoding::Encode<PortGetStatusWatcherRequest> 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::<PortGetStatusWatcherRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PortGetStatusWatcherRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
watcher: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StatusWatcherMarker>>
),
buffer: 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);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StatusWatcherMarker>>,
&mut self.watcher,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u32, &mut self.buffer, decoder, offset + 4, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PortId {
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
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for PortId {
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<PortId> for &PortId {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortId>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut PortId).write_unaligned((self as *const PortId).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<u8>, T1: fidl::encoding::Encode<u8>>
fidl::encoding::Encode<PortId> 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::<PortId>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PortId {
#[inline(always)]
fn new_empty() -> Self {
Self { base: fidl::new_empty!(u8), salt: 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);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PortWatcherWatchResponse {
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 PortWatcherWatchResponse {
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<PortWatcherWatchResponse> for &PortWatcherWatchResponse {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortWatcherWatchResponse>(offset);
fidl::encoding::Encode::<PortWatcherWatchResponse>::encode(
(<DevicePortEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<DevicePortEvent>>
fidl::encoding::Encode<PortWatcherWatchResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PortWatcherWatchResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for PortWatcherWatchResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { event: fidl::new_empty!(DevicePortEvent) }
}
#[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!(DevicePortEvent, &mut self.event, decoder, offset + 0, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for SessionAttachRequest {
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 SessionAttachRequest {
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<SessionAttachRequest> for &SessionAttachRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionAttachRequest>(offset);
fidl::encoding::Encode::<SessionAttachRequest>::encode(
(
<PortId as fidl::encoding::ValueTypeMarker>::borrow(&self.port),
<fidl::encoding::Vector<FrameType, 4> as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_frames),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<PortId>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<FrameType, 4>>,
> fidl::encoding::Encode<SessionAttachRequest> 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::<SessionAttachRequest>(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 SessionAttachRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
port: fidl::new_empty!(PortId),
rx_frames: fidl::new_empty!(fidl::encoding::Vector<FrameType, 4>),
}
}
#[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!(PortId, &mut self.port, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<FrameType, 4>, &mut self.rx_frames, decoder, offset + 8, _depth)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for SessionDetachRequest {
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
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
impl fidl::encoding::ValueTypeMarker for SessionDetachRequest {
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<SessionDetachRequest> for &SessionDetachRequest {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionDetachRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut SessionDetachRequest)
.write_unaligned((self as *const SessionDetachRequest).read());
}
Ok(())
}
}
unsafe impl<T0: fidl::encoding::Encode<PortId>> fidl::encoding::Encode<SessionDetachRequest>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SessionDetachRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for SessionDetachRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { port: fidl::new_empty!(PortId) }
}
#[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, 2);
}
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for StatusWatcherWatchStatusResponse {
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 StatusWatcherWatchStatusResponse {
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<StatusWatcherWatchStatusResponse>
for &StatusWatcherWatchStatusResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StatusWatcherWatchStatusResponse>(offset);
fidl::encoding::Encode::<StatusWatcherWatchStatusResponse>::encode(
(<PortStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.port_status),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<T0: fidl::encoding::Encode<PortStatus>>
fidl::encoding::Encode<StatusWatcherWatchStatusResponse> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StatusWatcherWatchStatusResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for StatusWatcherWatchStatusResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { port_status: fidl::new_empty!(PortStatus) }
}
#[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!(PortStatus, &mut self.port_status, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl DeviceBaseInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.tx_accel {
return 11;
}
if let Some(_) = self.rx_accel {
return 10;
}
if let Some(_) = self.max_buffer_parts {
return 9;
}
if let Some(_) = self.min_tx_buffer_tail {
return 8;
}
if let Some(_) = self.min_tx_buffer_head {
return 7;
}
if let Some(_) = self.min_tx_buffer_length {
return 6;
}
if let Some(_) = self.min_rx_buffer_length {
return 5;
}
if let Some(_) = self.max_buffer_length {
return 4;
}
if let Some(_) = self.buffer_alignment {
return 3;
}
if let Some(_) = self.tx_depth {
return 2;
}
if let Some(_) = self.rx_depth {
return 1;
}
0
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceBaseInfo {
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 DeviceBaseInfo {
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<DeviceBaseInfo> for &DeviceBaseInfo {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceBaseInfo>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16>(
self.rx_depth.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16>(
self.tx_depth.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32>(
self.buffer_alignment
.as_ref()
.map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32>(
self.max_buffer_length
.as_ref()
.map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32>(
self.min_rx_buffer_length
.as_ref()
.map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32>(
self.min_tx_buffer_length
.as_ref()
.map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16>(
self.min_tx_buffer_head
.as_ref()
.map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16>(
self.min_tx_buffer_tail
.as_ref()
.map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 9 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (9 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8>(
self.max_buffer_parts.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 10 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (10 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<RxAcceleration, 16>>(
self.rx_accel.as_ref().map(<fidl::encoding::Vector<RxAcceleration, 16> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 11 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (11 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<TxAcceleration, 16>>(
self.tx_accel.as_ref().map(<fidl::encoding::Vector<TxAcceleration, 16> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self> for DeviceBaseInfo {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.rx_depth.get_or_insert_with(|| fidl::new_empty!(u16));
fidl::decode!(u16, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}