#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum AddressRemovalReason {
Invalid = 1,
AlreadyAssigned = 2,
DadFailed = 3,
InterfaceRemoved = 4,
UserRemoved = 5,
InvalidProperties = 6,
}
impl AddressRemovalReason {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Invalid),
2 => Some(Self::AlreadyAssigned),
3 => Some(Self::DadFailed),
4 => Some(Self::InterfaceRemoved),
5 => Some(Self::UserRemoved),
6 => Some(Self::InvalidProperties),
_ => 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 ControlDisableError {
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ControlDisableErrorUnknown {
() => {
_
};
}
impl ControlDisableError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum ControlEnableError {
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ControlEnableErrorUnknown {
() => {
_
};
}
impl ControlEnableError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum ControlGetConfigurationError {
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ControlGetConfigurationErrorUnknown {
() => {
_
};
}
impl ControlGetConfigurationError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum ControlRemoveAddressError {
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ControlRemoveAddressErrorUnknown {
() => {
_
};
}
impl ControlRemoveAddressError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum ControlRemoveError {
NotAllowed,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ControlRemoveErrorUnknown {
() => {
_
};
}
impl ControlRemoveError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::NotAllowed),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::NotAllowed,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::NotAllowed => 1,
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)]
pub enum ControlSetConfigurationError {
Ipv4ForwardingUnsupported,
Ipv4MulticastForwardingUnsupported,
Ipv4IgmpVersionUnsupported,
Ipv6ForwardingUnsupported,
Ipv6MulticastForwardingUnsupported,
Ipv6MldVersionUnsupported,
IllegalZeroValue,
ArpNotSupported,
NdpNotSupported,
IllegalNegativeValue,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! ControlSetConfigurationErrorUnknown {
() => {
_
};
}
impl ControlSetConfigurationError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Ipv4ForwardingUnsupported),
2 => Some(Self::Ipv4MulticastForwardingUnsupported),
3 => Some(Self::Ipv4IgmpVersionUnsupported),
4 => Some(Self::Ipv6ForwardingUnsupported),
5 => Some(Self::Ipv6MulticastForwardingUnsupported),
6 => Some(Self::Ipv6MldVersionUnsupported),
7 => Some(Self::IllegalZeroValue),
8 => Some(Self::ArpNotSupported),
9 => Some(Self::NdpNotSupported),
10 => Some(Self::IllegalNegativeValue),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::Ipv4ForwardingUnsupported,
2 => Self::Ipv4MulticastForwardingUnsupported,
3 => Self::Ipv4IgmpVersionUnsupported,
4 => Self::Ipv6ForwardingUnsupported,
5 => Self::Ipv6MulticastForwardingUnsupported,
6 => Self::Ipv6MldVersionUnsupported,
7 => Self::IllegalZeroValue,
8 => Self::ArpNotSupported,
9 => Self::NdpNotSupported,
10 => Self::IllegalNegativeValue,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::Ipv4ForwardingUnsupported => 1,
Self::Ipv4MulticastForwardingUnsupported => 2,
Self::Ipv4IgmpVersionUnsupported => 3,
Self::Ipv6ForwardingUnsupported => 4,
Self::Ipv6MulticastForwardingUnsupported => 5,
Self::Ipv6MldVersionUnsupported => 6,
Self::IllegalZeroValue => 7,
Self::ArpNotSupported => 8,
Self::NdpNotSupported => 9,
Self::IllegalNegativeValue => 10,
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)]
pub enum IgmpVersion {
V1,
V2,
V3,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u8 },
}
#[macro_export]
macro_rules! IgmpVersionUnknown {
() => {
_
};
}
impl IgmpVersion {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::V1),
2 => Some(Self::V2),
3 => Some(Self::V3),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u8) -> Self {
match prim {
1 => Self::V1,
2 => Self::V2,
3 => Self::V3,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xff }
}
#[inline]
pub const fn into_primitive(self) -> u8 {
match self {
Self::V1 => 1,
Self::V2 => 2,
Self::V3 => 3,
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)]
pub enum InterfaceRemovedReason {
DuplicateName,
PortAlreadyBound,
BadPort,
PortClosed,
User,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! InterfaceRemovedReasonUnknown {
() => {
_
};
}
impl InterfaceRemovedReason {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::DuplicateName),
2 => Some(Self::PortAlreadyBound),
3 => Some(Self::BadPort),
4 => Some(Self::PortClosed),
5 => Some(Self::User),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::DuplicateName,
2 => Self::PortAlreadyBound,
3 => Self::BadPort,
4 => Self::PortClosed,
5 => Self::User,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::DuplicateName => 1,
Self::PortAlreadyBound => 2,
Self::BadPort => 3,
Self::PortClosed => 4,
Self::User => 5,
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)]
pub enum MldVersion {
V1,
V2,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u8 },
}
#[macro_export]
macro_rules! MldVersionUnknown {
() => {
_
};
}
impl MldVersion {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::V1),
2 => Some(Self::V2),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u8) -> Self {
match prim {
1 => Self::V1,
2 => Self::V2,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xff }
}
#[inline]
pub const fn into_primitive(self) -> u8 {
match self {
Self::V1 => 1,
Self::V2 => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct AddressStateProviderOnAddressRemovedRequest {
pub error: AddressRemovalReason,
}
impl fidl::Persistable for AddressStateProviderOnAddressRemovedRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct AddressStateProviderUpdateAddressPropertiesRequest {
pub address_properties: AddressProperties,
}
impl fidl::Persistable for AddressStateProviderUpdateAddressPropertiesRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct AddressStateProviderWatchAddressAssignmentStateResponse {
pub assignment_state: fidl_fuchsia_net_interfaces::AddressAssignmentState,
}
impl fidl::Persistable for AddressStateProviderWatchAddressAssignmentStateResponse {}
#[derive(Debug, PartialEq)]
pub struct ControlAddAddressRequest {
pub address: fidl_fuchsia_net::Subnet,
pub parameters: AddressParameters,
pub address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ControlAddAddressRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControlGetAuthorizationForInterfaceResponse {
pub credential: GrantForInterfaceAuthorization,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ControlGetAuthorizationForInterfaceResponse
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ControlGetIdResponse {
pub id: u64,
}
impl fidl::Persistable for ControlGetIdResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControlOnInterfaceRemovedRequest {
pub reason: InterfaceRemovedReason,
}
impl fidl::Persistable for ControlOnInterfaceRemovedRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControlRemoveAddressRequest {
pub address: fidl_fuchsia_net::Subnet,
}
impl fidl::Persistable for ControlRemoveAddressRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControlSetConfigurationRequest {
pub config: Configuration,
}
impl fidl::Persistable for ControlSetConfigurationRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControlDisableResponse {
pub did_disable: bool,
}
impl fidl::Persistable for ControlDisableResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControlEnableResponse {
pub did_enable: bool,
}
impl fidl::Persistable for ControlEnableResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControlGetConfigurationResponse {
pub config: Configuration,
}
impl fidl::Persistable for ControlGetConfigurationResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControlRemoveAddressResponse {
pub did_remove: bool,
}
impl fidl::Persistable for ControlRemoveAddressResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControlSetConfigurationResponse {
pub previous_config: Configuration,
}
impl fidl::Persistable for ControlSetConfigurationResponse {}
#[derive(Debug, PartialEq)]
pub struct DeviceControlCreateInterfaceRequest {
pub port: fidl_fuchsia_hardware_network::PortId,
pub control: fidl::endpoints::ServerEnd<ControlMarker>,
pub options: Options,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceControlCreateInterfaceRequest
{
}
#[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 GrantForInterfaceAuthorization {
pub interface_id: u64,
pub token: fidl::Event,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for GrantForInterfaceAuthorization
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct InstallerInstallDeviceRequest {
pub device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
pub device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for InstallerInstallDeviceRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ProofOfInterfaceAuthorization {
pub interface_id: u64,
pub token: fidl::Event,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ProofOfInterfaceAuthorization
{
}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct AddressParameters {
pub initial_properties: Option<AddressProperties>,
pub temporary: Option<bool>,
pub add_subnet_route: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for AddressParameters {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct AddressProperties {
pub preferred_lifetime_info: Option<fidl_fuchsia_net_interfaces::PreferredLifetimeInfo>,
pub valid_lifetime_end: Option<i64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for AddressProperties {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ArpConfiguration {
pub nud: Option<NudConfiguration>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ArpConfiguration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Configuration {
pub ipv4: Option<Ipv4Configuration>,
pub ipv6: Option<Ipv6Configuration>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Configuration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DadConfiguration {
pub transmits: Option<u16>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DadConfiguration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct IgmpConfiguration {
pub version: Option<IgmpVersion>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for IgmpConfiguration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Ipv4Configuration {
pub unicast_forwarding: Option<bool>,
pub multicast_forwarding: Option<bool>,
pub igmp: Option<IgmpConfiguration>,
pub arp: Option<ArpConfiguration>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Ipv4Configuration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Ipv6Configuration {
pub unicast_forwarding: Option<bool>,
pub multicast_forwarding: Option<bool>,
pub mld: Option<MldConfiguration>,
pub ndp: Option<NdpConfiguration>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Ipv6Configuration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct MldConfiguration {
pub version: Option<MldVersion>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for MldConfiguration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct NdpConfiguration {
pub nud: Option<NudConfiguration>,
pub dad: Option<DadConfiguration>,
pub slaac: Option<SlaacConfiguration>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for NdpConfiguration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct NudConfiguration {
pub max_multicast_solicitations: Option<u16>,
pub max_unicast_solicitations: Option<u16>,
pub base_reachable_time: Option<i64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for NudConfiguration {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Options {
pub name: Option<String>,
pub metric: Option<u32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Options {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct SlaacConfiguration {
pub temporary_address: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for SlaacConfiguration {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct AddressStateProviderMarker;
impl fidl::endpoints::ProtocolMarker for AddressStateProviderMarker {
type Proxy = AddressStateProviderProxy;
type RequestStream = AddressStateProviderRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = AddressStateProviderSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) AddressStateProvider";
}
pub trait AddressStateProviderProxyInterface: Send + Sync {
type UpdateAddressPropertiesResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
+ Send;
fn r#update_address_properties(
&self,
address_properties: &AddressProperties,
) -> Self::UpdateAddressPropertiesResponseFut;
type WatchAddressAssignmentStateResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_net_interfaces::AddressAssignmentState, fidl::Error>,
> + Send;
fn r#watch_address_assignment_state(&self) -> Self::WatchAddressAssignmentStateResponseFut;
fn r#detach(&self) -> Result<(), fidl::Error>;
fn r#remove(&self) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct AddressStateProviderSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for AddressStateProviderSynchronousProxy {
type Proxy = AddressStateProviderProxy;
type Protocol = AddressStateProviderMarker;
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 AddressStateProviderSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<AddressStateProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<AddressStateProviderEvent, fidl::Error> {
AddressStateProviderEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#update_address_properties(
&self,
mut address_properties: &AddressProperties,
___deadline: zx::MonotonicInstant,
) -> Result<(), fidl::Error> {
let _response = self.client.send_query::<
AddressStateProviderUpdateAddressPropertiesRequest,
fidl::encoding::EmptyPayload,
>(
(address_properties,),
0x52bdf5ed96ef573c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#watch_address_assignment_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_net_interfaces::AddressAssignmentState, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
AddressStateProviderWatchAddressAssignmentStateResponse,
>(
(),
0x740bb58c1b2d3188,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.assignment_state)
}
pub fn r#detach(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0xc752381d739622f,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#remove(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x554407fe183e78ad,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct AddressStateProviderProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for AddressStateProviderProxy {
type Protocol = AddressStateProviderMarker;
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 AddressStateProviderProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<AddressStateProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> AddressStateProviderEventStream {
AddressStateProviderEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#update_address_properties(
&self,
mut address_properties: &AddressProperties,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
AddressStateProviderProxyInterface::r#update_address_properties(self, address_properties)
}
pub fn r#watch_address_assignment_state(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_net_interfaces::AddressAssignmentState,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
AddressStateProviderProxyInterface::r#watch_address_assignment_state(self)
}
pub fn r#detach(&self) -> Result<(), fidl::Error> {
AddressStateProviderProxyInterface::r#detach(self)
}
pub fn r#remove(&self) -> Result<(), fidl::Error> {
AddressStateProviderProxyInterface::r#remove(self)
}
}
impl AddressStateProviderProxyInterface for AddressStateProviderProxy {
type UpdateAddressPropertiesResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#update_address_properties(
&self,
mut address_properties: &AddressProperties,
) -> Self::UpdateAddressPropertiesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x52bdf5ed96ef573c,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<AddressStateProviderUpdateAddressPropertiesRequest, ()>(
(address_properties,),
0x52bdf5ed96ef573c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WatchAddressAssignmentStateResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_net_interfaces::AddressAssignmentState,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_address_assignment_state(&self) -> Self::WatchAddressAssignmentStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_net_interfaces::AddressAssignmentState, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
AddressStateProviderWatchAddressAssignmentStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x740bb58c1b2d3188,
>(_buf?)?;
Ok(_response.assignment_state)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_net_interfaces::AddressAssignmentState,
>(
(),
0x740bb58c1b2d3188,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#detach(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0xc752381d739622f,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#remove(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x554407fe183e78ad,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct AddressStateProviderEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for AddressStateProviderEventStream {}
impl futures::stream::FusedStream for AddressStateProviderEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for AddressStateProviderEventStream {
type Item = Result<AddressStateProviderEvent, 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(AddressStateProviderEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum AddressStateProviderEvent {
OnAddressAdded {},
OnAddressRemoved { error: AddressRemovalReason },
}
impl AddressStateProviderEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_address_added(self) -> Option<()> {
if let AddressStateProviderEvent::OnAddressAdded {} = self {
Some(())
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_address_removed(self) -> Option<AddressRemovalReason> {
if let AddressStateProviderEvent::OnAddressRemoved { error } = self {
Some((error))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<AddressStateProviderEvent, 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 {
0x624f6ea62cce189e => {
let mut out = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((AddressStateProviderEvent::OnAddressAdded {}))
}
0x2480eb672ffd5962 => {
let mut out = fidl::new_empty!(
AddressStateProviderOnAddressRemovedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AddressStateProviderOnAddressRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((AddressStateProviderEvent::OnAddressRemoved { error: out.error }))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<AddressStateProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct AddressStateProviderRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for AddressStateProviderRequestStream {}
impl futures::stream::FusedStream for AddressStateProviderRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for AddressStateProviderRequestStream {
type Protocol = AddressStateProviderMarker;
type ControlHandle = AddressStateProviderControlHandle;
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 {
AddressStateProviderControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for AddressStateProviderRequestStream {
type Item = Result<AddressStateProviderRequest, 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 AddressStateProviderRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x52bdf5ed96ef573c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(AddressStateProviderUpdateAddressPropertiesRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AddressStateProviderUpdateAddressPropertiesRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = AddressStateProviderControlHandle {
inner: this.inner.clone(),
};
Ok(AddressStateProviderRequest::UpdateAddressProperties {address_properties: req.address_properties,
responder: AddressStateProviderUpdateAddressPropertiesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x740bb58c1b2d3188 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = AddressStateProviderControlHandle {
inner: this.inner.clone(),
};
Ok(AddressStateProviderRequest::WatchAddressAssignmentState {
responder: AddressStateProviderWatchAddressAssignmentStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xc752381d739622f => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = AddressStateProviderControlHandle {
inner: this.inner.clone(),
};
Ok(AddressStateProviderRequest::Detach {
control_handle,
})
}
0x554407fe183e78ad => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = AddressStateProviderControlHandle {
inner: this.inner.clone(),
};
Ok(AddressStateProviderRequest::Remove {
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <AddressStateProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum AddressStateProviderRequest {
UpdateAddressProperties {
address_properties: AddressProperties,
responder: AddressStateProviderUpdateAddressPropertiesResponder,
},
WatchAddressAssignmentState {
responder: AddressStateProviderWatchAddressAssignmentStateResponder,
},
Detach { control_handle: AddressStateProviderControlHandle },
Remove { control_handle: AddressStateProviderControlHandle },
}
impl AddressStateProviderRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_update_address_properties(
self,
) -> Option<(AddressProperties, AddressStateProviderUpdateAddressPropertiesResponder)> {
if let AddressStateProviderRequest::UpdateAddressProperties {
address_properties,
responder,
} = self
{
Some((address_properties, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_address_assignment_state(
self,
) -> Option<(AddressStateProviderWatchAddressAssignmentStateResponder)> {
if let AddressStateProviderRequest::WatchAddressAssignmentState { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_detach(self) -> Option<(AddressStateProviderControlHandle)> {
if let AddressStateProviderRequest::Detach { control_handle } = self {
Some((control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove(self) -> Option<(AddressStateProviderControlHandle)> {
if let AddressStateProviderRequest::Remove { control_handle } = self {
Some((control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
AddressStateProviderRequest::UpdateAddressProperties { .. } => {
"update_address_properties"
}
AddressStateProviderRequest::WatchAddressAssignmentState { .. } => {
"watch_address_assignment_state"
}
AddressStateProviderRequest::Detach { .. } => "detach",
AddressStateProviderRequest::Remove { .. } => "remove",
}
}
}
#[derive(Debug, Clone)]
pub struct AddressStateProviderControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for AddressStateProviderControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl AddressStateProviderControlHandle {
pub fn send_on_address_added(&self) -> Result<(), fidl::Error> {
self.inner.send::<fidl::encoding::EmptyPayload>(
(),
0,
0x624f6ea62cce189e,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn send_on_address_removed(
&self,
mut error: AddressRemovalReason,
) -> Result<(), fidl::Error> {
self.inner.send::<AddressStateProviderOnAddressRemovedRequest>(
(error,),
0,
0x2480eb672ffd5962,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct AddressStateProviderUpdateAddressPropertiesResponder {
control_handle: std::mem::ManuallyDrop<AddressStateProviderControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for AddressStateProviderUpdateAddressPropertiesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for AddressStateProviderUpdateAddressPropertiesResponder {
type ControlHandle = AddressStateProviderControlHandle;
fn control_handle(&self) -> &AddressStateProviderControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl AddressStateProviderUpdateAddressPropertiesResponder {
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,
0x52bdf5ed96ef573c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct AddressStateProviderWatchAddressAssignmentStateResponder {
control_handle: std::mem::ManuallyDrop<AddressStateProviderControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for AddressStateProviderWatchAddressAssignmentStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for AddressStateProviderWatchAddressAssignmentStateResponder {
type ControlHandle = AddressStateProviderControlHandle;
fn control_handle(&self) -> &AddressStateProviderControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl AddressStateProviderWatchAddressAssignmentStateResponder {
pub fn send(
self,
mut assignment_state: fidl_fuchsia_net_interfaces::AddressAssignmentState,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(assignment_state);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut assignment_state: fidl_fuchsia_net_interfaces::AddressAssignmentState,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(assignment_state);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut assignment_state: fidl_fuchsia_net_interfaces::AddressAssignmentState,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<AddressStateProviderWatchAddressAssignmentStateResponse>(
(assignment_state,),
self.tx_id,
0x740bb58c1b2d3188,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ControlMarker;
impl fidl::endpoints::ProtocolMarker for ControlMarker {
type Proxy = ControlProxy;
type RequestStream = ControlRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ControlSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Control";
}
pub type ControlRemoveAddressResult = Result<bool, ControlRemoveAddressError>;
pub type ControlSetConfigurationResult = Result<Configuration, ControlSetConfigurationError>;
pub type ControlGetConfigurationResult = Result<Configuration, ControlGetConfigurationError>;
pub type ControlEnableResult = Result<bool, ControlEnableError>;
pub type ControlDisableResult = Result<bool, ControlDisableError>;
pub type ControlRemoveResult = Result<(), ControlRemoveError>;
pub trait ControlProxyInterface: Send + Sync {
fn r#add_address(
&self,
address: &fidl_fuchsia_net::Subnet,
parameters: &AddressParameters,
address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
) -> Result<(), fidl::Error>;
type RemoveAddressResponseFut: std::future::Future<Output = Result<ControlRemoveAddressResult, fidl::Error>>
+ Send;
fn r#remove_address(
&self,
address: &fidl_fuchsia_net::Subnet,
) -> Self::RemoveAddressResponseFut;
type GetIdResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
fn r#get_id(&self) -> Self::GetIdResponseFut;
type SetConfigurationResponseFut: std::future::Future<Output = Result<ControlSetConfigurationResult, fidl::Error>>
+ Send;
fn r#set_configuration(&self, config: &Configuration) -> Self::SetConfigurationResponseFut;
type GetConfigurationResponseFut: std::future::Future<Output = Result<ControlGetConfigurationResult, fidl::Error>>
+ Send;
fn r#get_configuration(&self) -> Self::GetConfigurationResponseFut;
type EnableResponseFut: std::future::Future<Output = Result<ControlEnableResult, fidl::Error>>
+ Send;
fn r#enable(&self) -> Self::EnableResponseFut;
type DisableResponseFut: std::future::Future<Output = Result<ControlDisableResult, fidl::Error>>
+ Send;
fn r#disable(&self) -> Self::DisableResponseFut;
fn r#detach(&self) -> Result<(), fidl::Error>;
type GetAuthorizationForInterfaceResponseFut: std::future::Future<Output = Result<GrantForInterfaceAuthorization, fidl::Error>>
+ Send;
fn r#get_authorization_for_interface(&self) -> Self::GetAuthorizationForInterfaceResponseFut;
type RemoveResponseFut: std::future::Future<Output = Result<ControlRemoveResult, fidl::Error>>
+ Send;
fn r#remove(&self) -> Self::RemoveResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ControlSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ControlSynchronousProxy {
type Proxy = ControlProxy;
type Protocol = ControlMarker;
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 ControlSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<ControlEvent, fidl::Error> {
ControlEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#add_address(
&self,
mut address: &fidl_fuchsia_net::Subnet,
mut parameters: &AddressParameters,
mut address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ControlAddAddressRequest>(
(address, parameters, address_state_provider),
0x1349d36da453ce,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#remove_address(
&self,
mut address: &fidl_fuchsia_net::Subnet,
___deadline: zx::MonotonicInstant,
) -> Result<ControlRemoveAddressResult, fidl::Error> {
let _response =
self.client.send_query::<ControlRemoveAddressRequest, fidl::encoding::ResultType<
ControlRemoveAddressResponse,
ControlRemoveAddressError,
>>(
(address,),
0x213ba73da997a620,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.did_remove))
}
pub fn r#get_id(&self, ___deadline: zx::MonotonicInstant) -> Result<u64, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, ControlGetIdResponse>(
(),
0x2a2459768d9ecc6f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.id)
}
pub fn r#set_configuration(
&self,
mut config: &Configuration,
___deadline: zx::MonotonicInstant,
) -> Result<ControlSetConfigurationResult, fidl::Error> {
let _response = self
.client
.send_query::<ControlSetConfigurationRequest, fidl::encoding::ResultType<
ControlSetConfigurationResponse,
ControlSetConfigurationError,
>>(
(config,), 0x573923b7b4bde27f, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.previous_config))
}
pub fn r#get_configuration(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControlGetConfigurationResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
ControlGetConfigurationResponse,
ControlGetConfigurationError,
>>(
(), 0x5f5d239820bdcc65, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.config))
}
pub fn r#enable(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControlEnableResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<ControlEnableResponse, ControlEnableError>,
>(
(),
0x15c983d3a8ac0b98,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.did_enable))
}
pub fn r#disable(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControlDisableResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<ControlDisableResponse, ControlDisableError>,
>(
(),
0x98d3a585d905473,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.did_disable))
}
pub fn r#detach(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x78ee27518b2dbfa,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_authorization_for_interface(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<GrantForInterfaceAuthorization, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
ControlGetAuthorizationForInterfaceResponse,
>(
(),
0xc1de2ab60b5cb9e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.credential)
}
pub fn r#remove(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControlRemoveResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
ControlRemoveError,
>>(
(),
0x13aab8bbecc7ff0b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct ControlProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ControlProxy {
type Protocol = ControlMarker;
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 ControlProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ControlEventStream {
ControlEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#add_address(
&self,
mut address: &fidl_fuchsia_net::Subnet,
mut parameters: &AddressParameters,
mut address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
) -> Result<(), fidl::Error> {
ControlProxyInterface::r#add_address(self, address, parameters, address_state_provider)
}
pub fn r#remove_address(
&self,
mut address: &fidl_fuchsia_net::Subnet,
) -> fidl::client::QueryResponseFut<
ControlRemoveAddressResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControlProxyInterface::r#remove_address(self, address)
}
pub fn r#get_id(
&self,
) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
ControlProxyInterface::r#get_id(self)
}
pub fn r#set_configuration(
&self,
mut config: &Configuration,
) -> fidl::client::QueryResponseFut<
ControlSetConfigurationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControlProxyInterface::r#set_configuration(self, config)
}
pub fn r#get_configuration(
&self,
) -> fidl::client::QueryResponseFut<
ControlGetConfigurationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControlProxyInterface::r#get_configuration(self)
}
pub fn r#enable(
&self,
) -> fidl::client::QueryResponseFut<
ControlEnableResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControlProxyInterface::r#enable(self)
}
pub fn r#disable(
&self,
) -> fidl::client::QueryResponseFut<
ControlDisableResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControlProxyInterface::r#disable(self)
}
pub fn r#detach(&self) -> Result<(), fidl::Error> {
ControlProxyInterface::r#detach(self)
}
pub fn r#get_authorization_for_interface(
&self,
) -> fidl::client::QueryResponseFut<
GrantForInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControlProxyInterface::r#get_authorization_for_interface(self)
}
pub fn r#remove(
&self,
) -> fidl::client::QueryResponseFut<
ControlRemoveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControlProxyInterface::r#remove(self)
}
}
impl ControlProxyInterface for ControlProxy {
fn r#add_address(
&self,
mut address: &fidl_fuchsia_net::Subnet,
mut parameters: &AddressParameters,
mut address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ControlAddAddressRequest>(
(address, parameters, address_state_provider),
0x1349d36da453ce,
fidl::encoding::DynamicFlags::empty(),
)
}
type RemoveAddressResponseFut = fidl::client::QueryResponseFut<
ControlRemoveAddressResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#remove_address(
&self,
mut address: &fidl_fuchsia_net::Subnet,
) -> Self::RemoveAddressResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControlRemoveAddressResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ControlRemoveAddressResponse, ControlRemoveAddressError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x213ba73da997a620,
>(_buf?)?;
Ok(_response.map(|x| x.did_remove))
}
self.client
.send_query_and_decode::<ControlRemoveAddressRequest, ControlRemoveAddressResult>(
(address,),
0x213ba73da997a620,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetIdResponseFut =
fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_id(&self) -> Self::GetIdResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u64, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ControlGetIdResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2a2459768d9ecc6f,
>(_buf?)?;
Ok(_response.id)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
(),
0x2a2459768d9ecc6f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetConfigurationResponseFut = fidl::client::QueryResponseFut<
ControlSetConfigurationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_configuration(&self, mut config: &Configuration) -> Self::SetConfigurationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControlSetConfigurationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
ControlSetConfigurationResponse,
ControlSetConfigurationError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x573923b7b4bde27f,
>(_buf?)?;
Ok(_response.map(|x| x.previous_config))
}
self.client
.send_query_and_decode::<ControlSetConfigurationRequest, ControlSetConfigurationResult>(
(config,),
0x573923b7b4bde27f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetConfigurationResponseFut = fidl::client::QueryResponseFut<
ControlGetConfigurationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_configuration(&self) -> Self::GetConfigurationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControlGetConfigurationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
ControlGetConfigurationResponse,
ControlGetConfigurationError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5f5d239820bdcc65,
>(_buf?)?;
Ok(_response.map(|x| x.config))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, ControlGetConfigurationResult>(
(),
0x5f5d239820bdcc65,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type EnableResponseFut = fidl::client::QueryResponseFut<
ControlEnableResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#enable(&self) -> Self::EnableResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControlEnableResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ControlEnableResponse, ControlEnableError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x15c983d3a8ac0b98,
>(_buf?)?;
Ok(_response.map(|x| x.did_enable))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControlEnableResult>(
(),
0x15c983d3a8ac0b98,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DisableResponseFut = fidl::client::QueryResponseFut<
ControlDisableResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#disable(&self) -> Self::DisableResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControlDisableResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ControlDisableResponse, ControlDisableError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x98d3a585d905473,
>(_buf?)?;
Ok(_response.map(|x| x.did_disable))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControlDisableResult>(
(),
0x98d3a585d905473,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#detach(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x78ee27518b2dbfa,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetAuthorizationForInterfaceResponseFut = fidl::client::QueryResponseFut<
GrantForInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_authorization_for_interface(&self) -> Self::GetAuthorizationForInterfaceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<GrantForInterfaceAuthorization, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ControlGetAuthorizationForInterfaceResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xc1de2ab60b5cb9e,
>(_buf?)?;
Ok(_response.credential)
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, GrantForInterfaceAuthorization>(
(),
0xc1de2ab60b5cb9e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RemoveResponseFut = fidl::client::QueryResponseFut<
ControlRemoveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#remove(&self) -> Self::RemoveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControlRemoveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControlRemoveError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x13aab8bbecc7ff0b,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControlRemoveResult>(
(),
0x13aab8bbecc7ff0b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ControlEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ControlEventStream {}
impl futures::stream::FusedStream for ControlEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ControlEventStream {
type Item = Result<ControlEvent, 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(ControlEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ControlEvent {
OnInterfaceRemoved { reason: InterfaceRemovedReason },
}
impl ControlEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_interface_removed(self) -> Option<InterfaceRemovedReason> {
if let ControlEvent::OnInterfaceRemoved { reason } = self {
Some((reason))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ControlEvent, 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 {
0x800d39e76c1cddd => {
let mut out = fidl::new_empty!(
ControlOnInterfaceRemovedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlOnInterfaceRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((ControlEvent::OnInterfaceRemoved { reason: out.reason }))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ControlRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ControlRequestStream {}
impl futures::stream::FusedStream for ControlRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ControlRequestStream {
type Protocol = ControlMarker;
type ControlHandle = ControlControlHandle;
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 {
ControlControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ControlRequestStream {
type Item = Result<ControlRequest, 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 ControlRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x1349d36da453ce => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ControlAddAddressRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlAddAddressRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::AddAddress {
address: req.address,
parameters: req.parameters,
address_state_provider: req.address_state_provider,
control_handle,
})
}
0x213ba73da997a620 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControlRemoveAddressRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlRemoveAddressRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::RemoveAddress {
address: req.address,
responder: ControlRemoveAddressResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2a2459768d9ecc6f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::GetId {
responder: ControlGetIdResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x573923b7b4bde27f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControlSetConfigurationRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlSetConfigurationRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::SetConfiguration {
config: req.config,
responder: ControlSetConfigurationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5f5d239820bdcc65 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::GetConfiguration {
responder: ControlGetConfigurationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x15c983d3a8ac0b98 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::Enable {
responder: ControlEnableResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x98d3a585d905473 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::Disable {
responder: ControlDisableResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x78ee27518b2dbfa => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::Detach { control_handle })
}
0xc1de2ab60b5cb9e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::GetAuthorizationForInterface {
responder: ControlGetAuthorizationForInterfaceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x13aab8bbecc7ff0b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControlControlHandle { inner: this.inner.clone() };
Ok(ControlRequest::Remove {
responder: ControlRemoveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ControlRequest {
AddAddress {
address: fidl_fuchsia_net::Subnet,
parameters: AddressParameters,
address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
control_handle: ControlControlHandle,
},
RemoveAddress { address: fidl_fuchsia_net::Subnet, responder: ControlRemoveAddressResponder },
GetId { responder: ControlGetIdResponder },
SetConfiguration { config: Configuration, responder: ControlSetConfigurationResponder },
GetConfiguration { responder: ControlGetConfigurationResponder },
Enable { responder: ControlEnableResponder },
Disable { responder: ControlDisableResponder },
Detach { control_handle: ControlControlHandle },
GetAuthorizationForInterface { responder: ControlGetAuthorizationForInterfaceResponder },
Remove { responder: ControlRemoveResponder },
}
impl ControlRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_add_address(
self,
) -> Option<(
fidl_fuchsia_net::Subnet,
AddressParameters,
fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
ControlControlHandle,
)> {
if let ControlRequest::AddAddress {
address,
parameters,
address_state_provider,
control_handle,
} = self
{
Some((address, parameters, address_state_provider, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove_address(
self,
) -> Option<(fidl_fuchsia_net::Subnet, ControlRemoveAddressResponder)> {
if let ControlRequest::RemoveAddress { address, responder } = self {
Some((address, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_id(self) -> Option<(ControlGetIdResponder)> {
if let ControlRequest::GetId { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_configuration(
self,
) -> Option<(Configuration, ControlSetConfigurationResponder)> {
if let ControlRequest::SetConfiguration { config, responder } = self {
Some((config, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_configuration(self) -> Option<(ControlGetConfigurationResponder)> {
if let ControlRequest::GetConfiguration { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_enable(self) -> Option<(ControlEnableResponder)> {
if let ControlRequest::Enable { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_disable(self) -> Option<(ControlDisableResponder)> {
if let ControlRequest::Disable { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_detach(self) -> Option<(ControlControlHandle)> {
if let ControlRequest::Detach { control_handle } = self {
Some((control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_authorization_for_interface(
self,
) -> Option<(ControlGetAuthorizationForInterfaceResponder)> {
if let ControlRequest::GetAuthorizationForInterface { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_remove(self) -> Option<(ControlRemoveResponder)> {
if let ControlRequest::Remove { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ControlRequest::AddAddress { .. } => "add_address",
ControlRequest::RemoveAddress { .. } => "remove_address",
ControlRequest::GetId { .. } => "get_id",
ControlRequest::SetConfiguration { .. } => "set_configuration",
ControlRequest::GetConfiguration { .. } => "get_configuration",
ControlRequest::Enable { .. } => "enable",
ControlRequest::Disable { .. } => "disable",
ControlRequest::Detach { .. } => "detach",
ControlRequest::GetAuthorizationForInterface { .. } => {
"get_authorization_for_interface"
}
ControlRequest::Remove { .. } => "remove",
}
}
}
#[derive(Debug, Clone)]
pub struct ControlControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ControlControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl ControlControlHandle {
pub fn send_on_interface_removed(
&self,
mut reason: InterfaceRemovedReason,
) -> Result<(), fidl::Error> {
self.inner.send::<ControlOnInterfaceRemovedRequest>(
(reason,),
0,
0x800d39e76c1cddd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControlRemoveAddressResponder {
control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControlRemoveAddressResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControlRemoveAddressResponder {
type ControlHandle = ControlControlHandle;
fn control_handle(&self) -> &ControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControlRemoveAddressResponder {
pub fn send(
self,
mut result: Result<bool, ControlRemoveAddressError>,
) -> 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<bool, ControlRemoveAddressError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<bool, ControlRemoveAddressError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControlRemoveAddressResponse,
ControlRemoveAddressError,
>>(
result.map(|did_remove| (did_remove,)),
self.tx_id,
0x213ba73da997a620,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControlGetIdResponder {
control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControlGetIdResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControlGetIdResponder {
type ControlHandle = ControlControlHandle;
fn control_handle(&self) -> &ControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControlGetIdResponder {
pub fn send(self, mut id: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(id);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut id: u64) -> Result<(), fidl::Error> {
let _result = self.send_raw(id);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut id: u64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ControlGetIdResponse>(
(id,),
self.tx_id,
0x2a2459768d9ecc6f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControlSetConfigurationResponder {
control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControlSetConfigurationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControlSetConfigurationResponder {
type ControlHandle = ControlControlHandle;
fn control_handle(&self) -> &ControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControlSetConfigurationResponder {
pub fn send(
self,
mut result: Result<&Configuration, ControlSetConfigurationError>,
) -> 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<&Configuration, ControlSetConfigurationError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&Configuration, ControlSetConfigurationError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControlSetConfigurationResponse,
ControlSetConfigurationError,
>>(
result.map(|previous_config| (previous_config,)),
self.tx_id,
0x573923b7b4bde27f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControlGetConfigurationResponder {
control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControlGetConfigurationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControlGetConfigurationResponder {
type ControlHandle = ControlControlHandle;
fn control_handle(&self) -> &ControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControlGetConfigurationResponder {
pub fn send(
self,
mut result: Result<&Configuration, ControlGetConfigurationError>,
) -> 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<&Configuration, ControlGetConfigurationError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&Configuration, ControlGetConfigurationError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControlGetConfigurationResponse,
ControlGetConfigurationError,
>>(
result.map(|config| (config,)),
self.tx_id,
0x5f5d239820bdcc65,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControlEnableResponder {
control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControlEnableResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControlEnableResponder {
type ControlHandle = ControlControlHandle;
fn control_handle(&self) -> &ControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControlEnableResponder {
pub fn send(self, mut result: Result<bool, ControlEnableError>) -> 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<bool, ControlEnableError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<bool, ControlEnableError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControlEnableResponse,
ControlEnableError,
>>(
result.map(|did_enable| (did_enable,)),
self.tx_id,
0x15c983d3a8ac0b98,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControlDisableResponder {
control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControlDisableResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControlDisableResponder {
type ControlHandle = ControlControlHandle;
fn control_handle(&self) -> &ControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControlDisableResponder {
pub fn send(self, mut result: Result<bool, ControlDisableError>) -> 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<bool, ControlDisableError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<bool, ControlDisableError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControlDisableResponse,
ControlDisableError,
>>(
result.map(|did_disable| (did_disable,)),
self.tx_id,
0x98d3a585d905473,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControlGetAuthorizationForInterfaceResponder {
control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControlGetAuthorizationForInterfaceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControlGetAuthorizationForInterfaceResponder {
type ControlHandle = ControlControlHandle;
fn control_handle(&self) -> &ControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControlGetAuthorizationForInterfaceResponder {
pub fn send(self, mut credential: GrantForInterfaceAuthorization) -> Result<(), fidl::Error> {
let _result = self.send_raw(credential);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut credential: GrantForInterfaceAuthorization,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(credential);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut credential: GrantForInterfaceAuthorization) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ControlGetAuthorizationForInterfaceResponse>(
(&mut credential,),
self.tx_id,
0xc1de2ab60b5cb9e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControlRemoveResponder {
control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControlRemoveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControlRemoveResponder {
type ControlHandle = ControlControlHandle;
fn control_handle(&self) -> &ControlControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControlRemoveResponder {
pub fn send(self, mut result: Result<(), ControlRemoveError>) -> 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<(), ControlRemoveError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), ControlRemoveError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
ControlRemoveError,
>>(
result,
self.tx_id,
0x13aab8bbecc7ff0b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DeviceControlMarker;
impl fidl::endpoints::ProtocolMarker for DeviceControlMarker {
type Proxy = DeviceControlProxy;
type RequestStream = DeviceControlRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DeviceControlSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DeviceControl";
}
pub trait DeviceControlProxyInterface: Send + Sync {
fn r#create_interface(
&self,
port: &fidl_fuchsia_hardware_network::PortId,
control: fidl::endpoints::ServerEnd<ControlMarker>,
options: &Options,
) -> Result<(), fidl::Error>;
fn r#detach(&self) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DeviceControlSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DeviceControlSynchronousProxy {
type Proxy = DeviceControlProxy;
type Protocol = DeviceControlMarker;
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 DeviceControlSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DeviceControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<DeviceControlEvent, fidl::Error> {
DeviceControlEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#create_interface(
&self,
mut port: &fidl_fuchsia_hardware_network::PortId,
mut control: fidl::endpoints::ServerEnd<ControlMarker>,
mut options: &Options,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceControlCreateInterfaceRequest>(
(port, control, options),
0x4ff8be7351d12f86,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#detach(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x57489f1554d489d2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct DeviceControlProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DeviceControlProxy {
type Protocol = DeviceControlMarker;
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 DeviceControlProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DeviceControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DeviceControlEventStream {
DeviceControlEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#create_interface(
&self,
mut port: &fidl_fuchsia_hardware_network::PortId,
mut control: fidl::endpoints::ServerEnd<ControlMarker>,
mut options: &Options,
) -> Result<(), fidl::Error> {
DeviceControlProxyInterface::r#create_interface(self, port, control, options)
}
pub fn r#detach(&self) -> Result<(), fidl::Error> {
DeviceControlProxyInterface::r#detach(self)
}
}
impl DeviceControlProxyInterface for DeviceControlProxy {
fn r#create_interface(
&self,
mut port: &fidl_fuchsia_hardware_network::PortId,
mut control: fidl::endpoints::ServerEnd<ControlMarker>,
mut options: &Options,
) -> Result<(), fidl::Error> {
self.client.send::<DeviceControlCreateInterfaceRequest>(
(port, control, options),
0x4ff8be7351d12f86,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#detach(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x57489f1554d489d2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct DeviceControlEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DeviceControlEventStream {}
impl futures::stream::FusedStream for DeviceControlEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DeviceControlEventStream {
type Item = Result<DeviceControlEvent, 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(DeviceControlEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DeviceControlEvent {}
impl DeviceControlEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DeviceControlEvent, 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: <DeviceControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DeviceControlRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DeviceControlRequestStream {}
impl futures::stream::FusedStream for DeviceControlRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DeviceControlRequestStream {
type Protocol = DeviceControlMarker;
type ControlHandle = DeviceControlControlHandle;
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 {
DeviceControlControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for DeviceControlRequestStream {
type Item = Result<DeviceControlRequest, 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 DeviceControlRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x4ff8be7351d12f86 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DeviceControlCreateInterfaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceControlCreateInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceControlControlHandle { inner: this.inner.clone() };
Ok(DeviceControlRequest::CreateInterface {
port: req.port,
control: req.control,
options: req.options,
control_handle,
})
}
0x57489f1554d489d2 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DeviceControlControlHandle { inner: this.inner.clone() };
Ok(DeviceControlRequest::Detach { control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DeviceControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DeviceControlRequest {
CreateInterface {
port: fidl_fuchsia_hardware_network::PortId,
control: fidl::endpoints::ServerEnd<ControlMarker>,
options: Options,
control_handle: DeviceControlControlHandle,
},
Detach { control_handle: DeviceControlControlHandle },
}
impl DeviceControlRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_create_interface(
self,
) -> Option<(
fidl_fuchsia_hardware_network::PortId,
fidl::endpoints::ServerEnd<ControlMarker>,
Options,
DeviceControlControlHandle,
)> {
if let DeviceControlRequest::CreateInterface { port, control, options, control_handle } =
self
{
Some((port, control, options, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_detach(self) -> Option<(DeviceControlControlHandle)> {
if let DeviceControlRequest::Detach { control_handle } = self {
Some((control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DeviceControlRequest::CreateInterface { .. } => "create_interface",
DeviceControlRequest::Detach { .. } => "detach",
}
}
}
#[derive(Debug, Clone)]
pub struct DeviceControlControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DeviceControlControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl DeviceControlControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct InstallerMarker;
impl fidl::endpoints::ProtocolMarker for InstallerMarker {
type Proxy = InstallerProxy;
type RequestStream = InstallerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = InstallerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.net.interfaces.admin.Installer";
}
impl fidl::endpoints::DiscoverableProtocolMarker for InstallerMarker {}
pub trait InstallerProxyInterface: Send + Sync {
fn r#install_device(
&self,
device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct InstallerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for InstallerSynchronousProxy {
type Proxy = InstallerProxy;
type Protocol = InstallerMarker;
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 InstallerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<InstallerEvent, fidl::Error> {
InstallerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#install_device(
&self,
mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
mut device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<InstallerInstallDeviceRequest>(
(device, device_control),
0x3e84524dcecab23a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct InstallerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for InstallerProxy {
type Protocol = InstallerMarker;
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 InstallerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> InstallerEventStream {
InstallerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#install_device(
&self,
mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
mut device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
) -> Result<(), fidl::Error> {
InstallerProxyInterface::r#install_device(self, device, device_control)
}
}
impl InstallerProxyInterface for InstallerProxy {
fn r#install_device(
&self,
mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
mut device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<InstallerInstallDeviceRequest>(
(device, device_control),
0x3e84524dcecab23a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct InstallerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for InstallerEventStream {}
impl futures::stream::FusedStream for InstallerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for InstallerEventStream {
type Item = Result<InstallerEvent, 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(InstallerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum InstallerEvent {}
impl InstallerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<InstallerEvent, 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: <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct InstallerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for InstallerRequestStream {}
impl futures::stream::FusedStream for InstallerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for InstallerRequestStream {
type Protocol = InstallerMarker;
type ControlHandle = InstallerControlHandle;
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 {
InstallerControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for InstallerRequestStream {
type Item = Result<InstallerRequest, 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 InstallerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3e84524dcecab23a => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
InstallerInstallDeviceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InstallerInstallDeviceRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = InstallerControlHandle { inner: this.inner.clone() };
Ok(InstallerRequest::InstallDevice {
device: req.device,
device_control: req.device_control,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum InstallerRequest {
InstallDevice {
device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
control_handle: InstallerControlHandle,
},
}
impl InstallerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_install_device(
self,
) -> Option<(
fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
fidl::endpoints::ServerEnd<DeviceControlMarker>,
InstallerControlHandle,
)> {
if let InstallerRequest::InstallDevice { device, device_control, control_handle } = self {
Some((device, device_control, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
InstallerRequest::InstallDevice { .. } => "install_device",
}
}
}
#[derive(Debug, Clone)]
pub struct InstallerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for InstallerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl InstallerControlHandle {}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for AddressRemovalReason {
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 AddressRemovalReason {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for AddressRemovalReason
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddressRemovalReason {
#[inline(always)]
fn new_empty() -> Self {
Self::Invalid
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ControlDisableError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ControlDisableError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ControlDisableError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlDisableError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ControlEnableError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ControlEnableError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ControlEnableError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlEnableError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ControlGetConfigurationError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ControlGetConfigurationError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ControlGetConfigurationError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlGetConfigurationError
{
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ControlRemoveAddressError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ControlRemoveAddressError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ControlRemoveAddressError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlRemoveAddressError
{
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ControlRemoveError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ControlRemoveError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ControlRemoveError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlRemoveError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ControlSetConfigurationError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ControlSetConfigurationError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ControlSetConfigurationError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlSetConfigurationError
{
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for IgmpVersion {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for IgmpVersion {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for IgmpVersion {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IgmpVersion {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for InterfaceRemovedReason {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for InterfaceRemovedReason {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for InterfaceRemovedReason
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for InterfaceRemovedReason
{
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MldVersion {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for MldVersion {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MldVersion {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MldVersion {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive_allow_unknown(prim);
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AddressStateProviderOnAddressRemovedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddressStateProviderOnAddressRemovedRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AddressStateProviderOnAddressRemovedRequest, D>
for &AddressStateProviderOnAddressRemovedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddressStateProviderOnAddressRemovedRequest>(offset);
fidl::encoding::Encode::<AddressStateProviderOnAddressRemovedRequest, D>::encode(
(<AddressRemovalReason as fidl::encoding::ValueTypeMarker>::borrow(&self.error),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<AddressRemovalReason, D>,
> fidl::encoding::Encode<AddressStateProviderOnAddressRemovedRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddressStateProviderOnAddressRemovedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AddressStateProviderOnAddressRemovedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { error: fidl::new_empty!(AddressRemovalReason, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(AddressRemovalReason, D, &mut self.error, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AddressStateProviderUpdateAddressPropertiesRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddressStateProviderUpdateAddressPropertiesRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AddressStateProviderUpdateAddressPropertiesRequest, D>
for &AddressStateProviderUpdateAddressPropertiesRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<AddressStateProviderUpdateAddressPropertiesRequest>(offset);
fidl::encoding::Encode::<AddressStateProviderUpdateAddressPropertiesRequest, D>::encode(
(<AddressProperties as fidl::encoding::ValueTypeMarker>::borrow(
&self.address_properties,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AddressProperties, D>>
fidl::encoding::Encode<AddressStateProviderUpdateAddressPropertiesRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<AddressStateProviderUpdateAddressPropertiesRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AddressStateProviderUpdateAddressPropertiesRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { address_properties: fidl::new_empty!(AddressProperties, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
AddressProperties,
D,
&mut self.address_properties,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AddressStateProviderWatchAddressAssignmentStateResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddressStateProviderWatchAddressAssignmentStateResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AddressStateProviderWatchAddressAssignmentStateResponse, D>
for &AddressStateProviderWatchAddressAssignmentStateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddressStateProviderWatchAddressAssignmentStateResponse>(
offset,
);
fidl::encoding::Encode::<AddressStateProviderWatchAddressAssignmentStateResponse, D>::encode(
(
<fidl_fuchsia_net_interfaces::AddressAssignmentState as fidl::encoding::ValueTypeMarker>::borrow(&self.assignment_state),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_net_interfaces::AddressAssignmentState, D>,
> fidl::encoding::Encode<AddressStateProviderWatchAddressAssignmentStateResponse, D>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddressStateProviderWatchAddressAssignmentStateResponse>(
offset,
);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AddressStateProviderWatchAddressAssignmentStateResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
assignment_state: fidl::new_empty!(
fidl_fuchsia_net_interfaces::AddressAssignmentState,
D
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_net_interfaces::AddressAssignmentState,
D,
&mut self.assignment_state,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ControlAddAddressRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlAddAddressRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl
fidl::encoding::Encode<
ControlAddAddressRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ControlAddAddressRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlAddAddressRequest>(offset);
fidl::encoding::Encode::<
ControlAddAddressRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl_fuchsia_net::Subnet as fidl::encoding::ValueTypeMarker>::borrow(
&self.address,
),
<AddressParameters as fidl::encoding::ValueTypeMarker>::borrow(
&self.parameters,
),
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.address_state_provider,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_net::Subnet,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
AddressParameters,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AddressStateProviderMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ControlAddAddressRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlAddAddressRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 24, depth)?;
self.2.encode(encoder, offset + 40, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ControlAddAddressRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
address: fidl::new_empty!(
fidl_fuchsia_net::Subnet,
fidl::encoding::DefaultFuchsiaResourceDialect
),
parameters: fidl::new_empty!(
AddressParameters,
fidl::encoding::DefaultFuchsiaResourceDialect
),
address_state_provider: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_net::Subnet,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.address,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
AddressParameters,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.parameters,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AddressStateProviderMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.address_state_provider,
decoder,
offset + 40,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ControlGetAuthorizationForInterfaceResponse {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlGetAuthorizationForInterfaceResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
ControlGetAuthorizationForInterfaceResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ControlGetAuthorizationForInterfaceResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlGetAuthorizationForInterfaceResponse>(offset);
fidl::encoding::Encode::<ControlGetAuthorizationForInterfaceResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<GrantForInterfaceAuthorization as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.credential),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
GrantForInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ControlGetAuthorizationForInterfaceResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlGetAuthorizationForInterfaceResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ControlGetAuthorizationForInterfaceResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
credential: fidl::new_empty!(
GrantForInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
GrantForInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.credential,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControlGetIdResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlGetIdResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ControlGetIdResponse, D>
for &ControlGetIdResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlGetIdResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ControlGetIdResponse)
.write_unaligned((self as *const ControlGetIdResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<ControlGetIdResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlGetIdResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlGetIdResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControlOnInterfaceRemovedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlOnInterfaceRemovedRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControlOnInterfaceRemovedRequest, D>
for &ControlOnInterfaceRemovedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlOnInterfaceRemovedRequest>(offset);
fidl::encoding::Encode::<ControlOnInterfaceRemovedRequest, D>::encode(
(<InterfaceRemovedReason as fidl::encoding::ValueTypeMarker>::borrow(&self.reason),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<InterfaceRemovedReason, D>,
> fidl::encoding::Encode<ControlOnInterfaceRemovedRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlOnInterfaceRemovedRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlOnInterfaceRemovedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { reason: fidl::new_empty!(InterfaceRemovedReason, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
InterfaceRemovedReason,
D,
&mut self.reason,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControlRemoveAddressRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlRemoveAddressRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControlRemoveAddressRequest, D> for &ControlRemoveAddressRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlRemoveAddressRequest>(offset);
fidl::encoding::Encode::<ControlRemoveAddressRequest, D>::encode(
(<fidl_fuchsia_net::Subnet as fidl::encoding::ValueTypeMarker>::borrow(
&self.address,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_net::Subnet, D>,
> fidl::encoding::Encode<ControlRemoveAddressRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlRemoveAddressRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlRemoveAddressRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { address: fidl::new_empty!(fidl_fuchsia_net::Subnet, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_net::Subnet,
D,
&mut self.address,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControlSetConfigurationRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlSetConfigurationRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControlSetConfigurationRequest, D>
for &ControlSetConfigurationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlSetConfigurationRequest>(offset);
fidl::encoding::Encode::<ControlSetConfigurationRequest, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<ControlSetConfigurationRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlSetConfigurationRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlSetConfigurationRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { config: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.config, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControlDisableResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlDisableResponse {
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControlDisableResponse, D> for &ControlDisableResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlDisableResponse>(offset);
fidl::encoding::Encode::<ControlDisableResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.did_disable),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<ControlDisableResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlDisableResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlDisableResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { did_disable: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(bool, D, &mut self.did_disable, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControlEnableResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlEnableResponse {
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ControlEnableResponse, D>
for &ControlEnableResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlEnableResponse>(offset);
fidl::encoding::Encode::<ControlEnableResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.did_enable),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<ControlEnableResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlEnableResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControlEnableResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { did_enable: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(bool, D, &mut self.did_enable, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControlGetConfigurationResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlGetConfigurationResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControlGetConfigurationResponse, D>
for &ControlGetConfigurationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlGetConfigurationResponse>(offset);
fidl::encoding::Encode::<ControlGetConfigurationResponse, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.config),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<ControlGetConfigurationResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlGetConfigurationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlGetConfigurationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { config: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Configuration, D, &mut self.config, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControlRemoveAddressResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlRemoveAddressResponse {
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControlRemoveAddressResponse, D> for &ControlRemoveAddressResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlRemoveAddressResponse>(offset);
fidl::encoding::Encode::<ControlRemoveAddressResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.did_remove),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<ControlRemoveAddressResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlRemoveAddressResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlRemoveAddressResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { did_remove: fidl::new_empty!(bool, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(bool, D, &mut self.did_remove, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControlSetConfigurationResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControlSetConfigurationResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControlSetConfigurationResponse, D>
for &ControlSetConfigurationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlSetConfigurationResponse>(offset);
fidl::encoding::Encode::<ControlSetConfigurationResponse, D>::encode(
(<Configuration as fidl::encoding::ValueTypeMarker>::borrow(&self.previous_config),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Configuration, D>>
fidl::encoding::Encode<ControlSetConfigurationResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControlSetConfigurationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControlSetConfigurationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { previous_config: fidl::new_empty!(Configuration, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
Configuration,
D,
&mut self.previous_config,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DeviceControlCreateInterfaceRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DeviceControlCreateInterfaceRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl
fidl::encoding::Encode<
DeviceControlCreateInterfaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DeviceControlCreateInterfaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceControlCreateInterfaceRequest>(offset);
fidl::encoding::Encode::<DeviceControlCreateInterfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_hardware_network::PortId as fidl::encoding::ValueTypeMarker>::borrow(&self.port),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.control),
<Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_hardware_network::PortId,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
>
fidl::encoding::Encode<
DeviceControlCreateInterfaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DeviceControlCreateInterfaceRequest>(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 + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DeviceControlCreateInterfaceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
port: fidl::new_empty!(
fidl_fuchsia_hardware_network::PortId,
fidl::encoding::DefaultFuchsiaResourceDialect
),
control: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_hardware_network::PortId,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.port,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.control,
decoder,
offset + 4,
_depth
)?;
fidl::decode!(
Options,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.options,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Empty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
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
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Empty>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ResourceTypeMarker for GrantForInterfaceAuthorization {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GrantForInterfaceAuthorization {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
GrantForInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut GrantForInterfaceAuthorization
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GrantForInterfaceAuthorization>(offset);
fidl::encoding::Encode::<
GrantForInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
3,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.token
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
GrantForInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GrantForInterfaceAuthorization>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for GrantForInterfaceAuthorization
{
#[inline(always)]
fn new_empty() -> Self {
Self {
interface_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.interface_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for InstallerInstallDeviceRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InstallerInstallDeviceRequest {
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
}
}
unsafe impl
fidl::encoding::Encode<
InstallerInstallDeviceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut InstallerInstallDeviceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InstallerInstallDeviceRequest>(offset);
fidl::encoding::Encode::<InstallerInstallDeviceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.device),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceControlMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.device_control),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceControlMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
InstallerInstallDeviceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InstallerInstallDeviceRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for InstallerInstallDeviceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
device: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
device_control: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceControlMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.device,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceControlMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.device_control,
decoder,
offset + 4,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ProofOfInterfaceAuthorization {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProofOfInterfaceAuthorization {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
ProofOfInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ProofOfInterfaceAuthorization
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProofOfInterfaceAuthorization>(offset);
fidl::encoding::Encode::<
ProofOfInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
<fidl::encoding::HandleType<
fidl::Event,
{ fidl::ObjectType::EVENT.into_raw() },
0,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.token
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 0>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ProofOfInterfaceAuthorization,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProofOfInterfaceAuthorization>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ProofOfInterfaceAuthorization
{
#[inline(always)]
fn new_empty() -> Self {
Self {
interface_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 0>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.interface_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 0>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl AddressParameters {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.add_subnet_route {
return 3;
}
if let Some(_) = self.temporary {
return 2;
}
if let Some(_) = self.initial_properties {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for AddressParameters {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddressParameters {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddressParameters, D>
for &AddressParameters
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddressParameters>(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::<AddressProperties, D>(
self.initial_properties
.as_ref()
.map(<AddressProperties 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::<bool, D>(
self.temporary.as_ref().map(<bool 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::<bool, D>(
self.add_subnet_route
.as_ref()
.map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddressParameters {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<AddressProperties as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.initial_properties
.get_or_insert_with(|| fidl::new_empty!(AddressProperties, D));
fidl::decode!(AddressProperties, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.temporary.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.add_subnet_route.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl AddressProperties {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.valid_lifetime_end {
return 2;
}
if let Some(_) = self.preferred_lifetime_info {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for AddressProperties {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddressProperties {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddressProperties, D>
for &AddressProperties
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddressProperties>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_interfaces::PreferredLifetimeInfo, D>(
self.preferred_lifetime_info.as_ref().map(<fidl_fuchsia_net_interfaces::PreferredLifetimeInfo 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::<i64, D>(
self.valid_lifetime_end
.as_ref()
.map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddressProperties {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_net_interfaces::PreferredLifetimeInfo 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.preferred_lifetime_info.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_net_interfaces::PreferredLifetimeInfo, D)
});
fidl::decode!(
fidl_fuchsia_net_interfaces::PreferredLifetimeInfo,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.valid_lifetime_end.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ArpConfiguration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.nud {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ArpConfiguration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ArpConfiguration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ArpConfiguration, D>
for &ArpConfiguration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ArpConfiguration>(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::<NudConfiguration, D>(
self.nud
.as_ref()
.map(<NudConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ArpConfiguration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NudConfiguration 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.nud.get_or_insert_with(|| fidl::new_empty!(NudConfiguration, D));
fidl::decode!(NudConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl Configuration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.ipv6 {
return 2;
}
if let Some(_) = self.ipv4 {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Configuration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Configuration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Configuration, D>
for &Configuration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Configuration>(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::<Ipv4Configuration, D>(
self.ipv4
.as_ref()
.map(<Ipv4Configuration 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::<Ipv6Configuration, D>(
self.ipv6
.as_ref()
.map(<Ipv6Configuration as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Configuration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Ipv4Configuration 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.ipv4.get_or_insert_with(|| fidl::new_empty!(Ipv4Configuration, D));
fidl::decode!(Ipv4Configuration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Ipv6Configuration 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.ipv6.get_or_insert_with(|| fidl::new_empty!(Ipv6Configuration, D));
fidl::decode!(Ipv6Configuration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl DadConfiguration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.transmits {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for DadConfiguration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DadConfiguration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DadConfiguration, D>
for &DadConfiguration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DadConfiguration>(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, D>(
self.transmits.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DadConfiguration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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.transmits.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl IgmpConfiguration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.version {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for IgmpConfiguration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for IgmpConfiguration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<IgmpConfiguration, D>
for &IgmpConfiguration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<IgmpConfiguration>(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::<IgmpVersion, D>(
self.version.as_ref().map(<IgmpVersion as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for IgmpConfiguration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<IgmpVersion 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.version.get_or_insert_with(|| fidl::new_empty!(IgmpVersion, D));
fidl::decode!(IgmpVersion, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl Ipv4Configuration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.arp {
return 4;
}
if let Some(_) = self.igmp {
return 3;
}
if let Some(_) = self.multicast_forwarding {
return 2;
}
if let Some(_) = self.unicast_forwarding {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Ipv4Configuration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Ipv4Configuration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv4Configuration, D>
for &Ipv4Configuration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Ipv4Configuration>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.unicast_forwarding
.as_ref()
.map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.multicast_forwarding
.as_ref()
.map(<bool 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::<IgmpConfiguration, D>(
self.igmp
.as_ref()
.map(<IgmpConfiguration 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::<ArpConfiguration, D>(
self.arp
.as_ref()
.map(<ArpConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv4Configuration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.unicast_forwarding.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.multicast_forwarding.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<IgmpConfiguration 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.igmp.get_or_insert_with(|| fidl::new_empty!(IgmpConfiguration, D));
fidl::decode!(IgmpConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<ArpConfiguration 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.arp.get_or_insert_with(|| fidl::new_empty!(ArpConfiguration, D));
fidl::decode!(ArpConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl Ipv6Configuration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.ndp {
return 4;
}
if let Some(_) = self.mld {
return 3;
}
if let Some(_) = self.multicast_forwarding {
return 2;
}
if let Some(_) = self.unicast_forwarding {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Ipv6Configuration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Ipv6Configuration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Ipv6Configuration, D>
for &Ipv6Configuration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Ipv6Configuration>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.unicast_forwarding
.as_ref()
.map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.multicast_forwarding
.as_ref()
.map(<bool 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::<MldConfiguration, D>(
self.mld
.as_ref()
.map(<MldConfiguration 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::<NdpConfiguration, D>(
self.ndp
.as_ref()
.map(<NdpConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Ipv6Configuration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.unicast_forwarding.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.multicast_forwarding.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<MldConfiguration 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.mld.get_or_insert_with(|| fidl::new_empty!(MldConfiguration, D));
fidl::decode!(MldConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NdpConfiguration 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.ndp.get_or_insert_with(|| fidl::new_empty!(NdpConfiguration, D));
fidl::decode!(NdpConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl MldConfiguration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.version {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for MldConfiguration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MldConfiguration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MldConfiguration, D>
for &MldConfiguration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MldConfiguration>(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::<MldVersion, D>(
self.version.as_ref().map(<MldVersion as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MldConfiguration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<MldVersion 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.version.get_or_insert_with(|| fidl::new_empty!(MldVersion, D));
fidl::decode!(MldVersion, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl NdpConfiguration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.slaac {
return 3;
}
if let Some(_) = self.dad {
return 2;
}
if let Some(_) = self.nud {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for NdpConfiguration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NdpConfiguration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NdpConfiguration, D>
for &NdpConfiguration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NdpConfiguration>(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::<NudConfiguration, D>(
self.nud
.as_ref()
.map(<NudConfiguration 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::<DadConfiguration, D>(
self.dad
.as_ref()
.map(<DadConfiguration 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::<SlaacConfiguration, D>(
self.slaac
.as_ref()
.map(<SlaacConfiguration as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NdpConfiguration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<NudConfiguration 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.nud.get_or_insert_with(|| fidl::new_empty!(NudConfiguration, D));
fidl::decode!(NudConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<DadConfiguration 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.dad.get_or_insert_with(|| fidl::new_empty!(DadConfiguration, D));
fidl::decode!(DadConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<SlaacConfiguration 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.slaac.get_or_insert_with(|| fidl::new_empty!(SlaacConfiguration, D));
fidl::decode!(SlaacConfiguration, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl NudConfiguration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.base_reachable_time {
return 3;
}
if let Some(_) = self.max_unicast_solicitations {
return 2;
}
if let Some(_) = self.max_multicast_solicitations {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for NudConfiguration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NudConfiguration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<NudConfiguration, D>
for &NudConfiguration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NudConfiguration>(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, D>(
self.max_multicast_solicitations
.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, D>(
self.max_unicast_solicitations
.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::<i64, D>(
self.base_reachable_time
.as_ref()
.map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NudConfiguration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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
.max_multicast_solicitations
.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<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.max_unicast_solicitations.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.base_reachable_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl Options {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.metric {
return 2;
}
if let Some(_) = self.name {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Options {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Options {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Options, D> for &Options {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Options>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<15>, D>(
self.name.as_ref().map(
<fidl::encoding::BoundedString<15> 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::<u32, D>(
self.metric.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Options {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::BoundedString<15> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<15>, D));
fidl::decode!(
fidl::encoding::BoundedString<15>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u32 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.metric.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl SlaacConfiguration {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.temporary_address {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for SlaacConfiguration {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SlaacConfiguration {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SlaacConfiguration, D>
for &SlaacConfiguration
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SlaacConfiguration>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.temporary_address
.as_ref()
.map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SlaacConfiguration {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.temporary_address.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
}