#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub type Addresses = Vec<fidl_fuchsia_net::Ipv4Address>;
pub type AsciiString = String;
pub type Duration = u32;
pub const MAX_DNS_SERVERS: u8 = 64;
pub const MAX_ROUTERS: u8 = 64;
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NodeTypes: u8 {
const B_NODE = 1;
const P_NODE = 2;
const M_NODE = 4;
const H_NODE = 8;
}
}
impl NodeTypes {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u8 {
0
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum ClientExitReason {
ClientAlreadyExistsOnInterface = 1,
WatchConfigurationAlreadyPending = 2,
InvalidInterface = 3,
InvalidParams = 4,
NetworkUnreachable = 5,
UnableToOpenSocket = 6,
GracefulShutdown = 7,
AddressRemovedByUser = 8,
AddressStateProviderError = 9,
}
impl ClientExitReason {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::ClientAlreadyExistsOnInterface),
2 => Some(Self::WatchConfigurationAlreadyPending),
3 => Some(Self::InvalidInterface),
4 => Some(Self::InvalidParams),
5 => Some(Self::NetworkUnreachable),
6 => Some(Self::UnableToOpenSocket),
7 => Some(Self::GracefulShutdown),
8 => Some(Self::AddressRemovedByUser),
9 => Some(Self::AddressStateProviderError),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum MessageType {
Dhcpdiscover = 1,
Dhcpoffer = 2,
Dhcprequest = 3,
Dhcpdecline = 4,
Dhcpack = 5,
Dhcpnak = 6,
Dhcprelease = 7,
Dhcpinform = 8,
}
impl MessageType {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Dhcpdiscover),
2 => Some(Self::Dhcpoffer),
3 => Some(Self::Dhcprequest),
4 => Some(Self::Dhcpdecline),
5 => Some(Self::Dhcpack),
6 => Some(Self::Dhcpnak),
7 => Some(Self::Dhcprelease),
8 => Some(Self::Dhcpinform),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum OptionCode {
SubnetMask = 1,
TimeOffset = 2,
Router = 3,
TimeServer = 4,
NameServer = 5,
DomainNameServer = 6,
LogServer = 7,
CookieServer = 8,
LprServer = 9,
ImpressServer = 10,
ResourceLocationServer = 11,
HostName = 12,
BootFileSize = 13,
MeritDumpFile = 14,
DomainName = 15,
SwapServer = 16,
RootPath = 17,
ExtensionsPath = 18,
IpForwarding = 19,
NonLocalSourceRouting = 20,
PolicyFilter = 21,
MaxDatagramReassemblySize = 22,
DefaultIpTtl = 23,
PathMtuAgingTimeout = 24,
PathMtuPlateauTable = 25,
InterfaceMtu = 26,
AllSubnetsLocal = 27,
BroadcastAddress = 28,
PerformMaskDiscovery = 29,
MaskSupplier = 30,
PerformRouterDiscovery = 31,
RouterSolicitationAddress = 32,
StaticRoute = 33,
TrailerEncapsulation = 34,
ArpCacheTimeout = 35,
EthernetEncapsulation = 36,
TcpDefaultTtl = 37,
TcpKeepaliveInterval = 38,
TcpKeepaliveGarbage = 39,
NetworkInformationServiceDomain = 40,
NetworkInformationServers = 41,
NetworkTimeProtocolServers = 42,
VendorSpecificInformation = 43,
NetbiosOverTcpipNameServer = 44,
NetbiosOverTcpipDatagramDistributionServer = 45,
NetbiosOverTcpipNodeType = 46,
NetbiosOverTcpipScope = 47,
XWindowSystemFontServer = 48,
XWindowSystemDisplayManager = 49,
NetworkInformationServicePlusDomain = 64,
NetworkInformationServicePlusServers = 65,
MobileIpHomeAgent = 68,
SmtpServer = 69,
Pop3Server = 70,
NntpServer = 71,
DefaultWwwServer = 72,
DefaultFingerServer = 73,
DefaultIrcServer = 74,
StreettalkServer = 75,
StreettalkDirectoryAssistanceServer = 76,
OptionOverload = 52,
TftpServerName = 66,
BootfileName = 67,
MaxDhcpMessageSize = 57,
RenewalTimeValue = 58,
RebindingTimeValue = 59,
}
impl OptionCode {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::SubnetMask),
2 => Some(Self::TimeOffset),
3 => Some(Self::Router),
4 => Some(Self::TimeServer),
5 => Some(Self::NameServer),
6 => Some(Self::DomainNameServer),
7 => Some(Self::LogServer),
8 => Some(Self::CookieServer),
9 => Some(Self::LprServer),
10 => Some(Self::ImpressServer),
11 => Some(Self::ResourceLocationServer),
12 => Some(Self::HostName),
13 => Some(Self::BootFileSize),
14 => Some(Self::MeritDumpFile),
15 => Some(Self::DomainName),
16 => Some(Self::SwapServer),
17 => Some(Self::RootPath),
18 => Some(Self::ExtensionsPath),
19 => Some(Self::IpForwarding),
20 => Some(Self::NonLocalSourceRouting),
21 => Some(Self::PolicyFilter),
22 => Some(Self::MaxDatagramReassemblySize),
23 => Some(Self::DefaultIpTtl),
24 => Some(Self::PathMtuAgingTimeout),
25 => Some(Self::PathMtuPlateauTable),
26 => Some(Self::InterfaceMtu),
27 => Some(Self::AllSubnetsLocal),
28 => Some(Self::BroadcastAddress),
29 => Some(Self::PerformMaskDiscovery),
30 => Some(Self::MaskSupplier),
31 => Some(Self::PerformRouterDiscovery),
32 => Some(Self::RouterSolicitationAddress),
33 => Some(Self::StaticRoute),
34 => Some(Self::TrailerEncapsulation),
35 => Some(Self::ArpCacheTimeout),
36 => Some(Self::EthernetEncapsulation),
37 => Some(Self::TcpDefaultTtl),
38 => Some(Self::TcpKeepaliveInterval),
39 => Some(Self::TcpKeepaliveGarbage),
40 => Some(Self::NetworkInformationServiceDomain),
41 => Some(Self::NetworkInformationServers),
42 => Some(Self::NetworkTimeProtocolServers),
43 => Some(Self::VendorSpecificInformation),
44 => Some(Self::NetbiosOverTcpipNameServer),
45 => Some(Self::NetbiosOverTcpipDatagramDistributionServer),
46 => Some(Self::NetbiosOverTcpipNodeType),
47 => Some(Self::NetbiosOverTcpipScope),
48 => Some(Self::XWindowSystemFontServer),
49 => Some(Self::XWindowSystemDisplayManager),
64 => Some(Self::NetworkInformationServicePlusDomain),
65 => Some(Self::NetworkInformationServicePlusServers),
68 => Some(Self::MobileIpHomeAgent),
69 => Some(Self::SmtpServer),
70 => Some(Self::Pop3Server),
71 => Some(Self::NntpServer),
72 => Some(Self::DefaultWwwServer),
73 => Some(Self::DefaultFingerServer),
74 => Some(Self::DefaultIrcServer),
75 => Some(Self::StreettalkServer),
76 => Some(Self::StreettalkDirectoryAssistanceServer),
52 => Some(Self::OptionOverload),
66 => Some(Self::TftpServerName),
67 => Some(Self::BootfileName),
57 => Some(Self::MaxDhcpMessageSize),
58 => Some(Self::RenewalTimeValue),
59 => Some(Self::RebindingTimeValue),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum OptionOverloadValue {
File = 1,
Sname = 2,
Both = 3,
}
impl OptionOverloadValue {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::File),
2 => Some(Self::Sname),
3 => Some(Self::Both),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum ParameterName {
IpAddrs = 0,
AddressPool = 1,
LeaseLength = 2,
PermittedMacs = 3,
StaticallyAssignedAddrs = 4,
ArpProbe = 5,
BoundDeviceNames = 6,
}
impl ParameterName {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::IpAddrs),
1 => Some(Self::AddressPool),
2 => Some(Self::LeaseLength),
3 => Some(Self::PermittedMacs),
4 => Some(Self::StaticallyAssignedAddrs),
5 => Some(Self::ArpProbe),
6 => Some(Self::BoundDeviceNames),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ClientOnExitRequest {
pub reason: ClientExitReason,
}
impl fidl::Persistable for ClientOnExitRequest {}
#[derive(Debug, PartialEq)]
pub struct ClientProviderNewClientRequest {
pub interface_id: u64,
pub params: NewClientParams,
pub request: fidl::endpoints::ServerEnd<ClientMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ClientProviderNewClientRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ServerGetOptionRequest {
pub code: OptionCode,
}
impl fidl::Persistable for ServerGetOptionRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ServerGetParameterRequest {
pub name: ParameterName,
}
impl fidl::Persistable for ServerGetParameterRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ServerIsServingResponse {
pub enabled: bool,
}
impl fidl::Persistable for ServerIsServingResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ServerSetOptionRequest {
pub value: Option_,
}
impl fidl::Persistable for ServerSetOptionRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ServerSetParameterRequest {
pub value: Parameter,
}
impl fidl::Persistable for ServerSetParameterRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ServerGetOptionResponse {
pub value: Option_,
}
impl fidl::Persistable for ServerGetOptionResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ServerGetParameterResponse {
pub value: Parameter,
}
impl fidl::Persistable for ServerGetParameterResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ServerListOptionsResponse {
pub options: Vec<Option_>,
}
impl fidl::Persistable for ServerListOptionsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ServerListParametersResponse {
pub parameters: Vec<Parameter>,
}
impl fidl::Persistable for ServerListParametersResponse {}
#[derive(Debug, Default, PartialEq)]
pub struct Address {
pub address: Option<fidl_fuchsia_net::Ipv4AddressWithPrefix>,
pub address_parameters: Option<fidl_fuchsia_net_interfaces_admin::AddressParameters>,
pub address_state_provider: Option<
fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker>,
>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Address {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct AddressPool {
pub prefix_length: Option<u8>,
pub range_start: Option<fidl_fuchsia_net::Ipv4Address>,
pub range_stop: Option<fidl_fuchsia_net::Ipv4Address>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for AddressPool {}
#[derive(Debug, Default, PartialEq)]
pub struct ClientWatchConfigurationResponse {
pub address: Option<Address>,
pub dns_servers: Option<Vec<fidl_fuchsia_net::Ipv4Address>>,
pub routers: Option<Vec<fidl_fuchsia_net::Ipv4Address>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for ClientWatchConfigurationResponse
{
}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ConfigurationToRequest {
pub routers: Option<bool>,
pub dns_servers: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ConfigurationToRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct LeaseLength {
pub default: Option<u32>,
pub max: Option<u32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for LeaseLength {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct NewClientParams {
pub configuration_to_request: Option<ConfigurationToRequest>,
pub request_ip_address: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for NewClientParams {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StaticAssignment {
pub host: Option<fidl_fuchsia_net::MacAddress>,
pub assigned_addr: Option<fidl_fuchsia_net::Ipv4Address>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for StaticAssignment {}
#[derive(Clone, Debug)]
pub enum Option_ {
SubnetMask(fidl_fuchsia_net::Ipv4Address),
TimeOffset(i32),
Router(Vec<fidl_fuchsia_net::Ipv4Address>),
TimeServer(Vec<fidl_fuchsia_net::Ipv4Address>),
NameServer(Vec<fidl_fuchsia_net::Ipv4Address>),
DomainNameServer(Vec<fidl_fuchsia_net::Ipv4Address>),
LogServer(Vec<fidl_fuchsia_net::Ipv4Address>),
CookieServer(Vec<fidl_fuchsia_net::Ipv4Address>),
LprServer(Vec<fidl_fuchsia_net::Ipv4Address>),
ImpressServer(Vec<fidl_fuchsia_net::Ipv4Address>),
ResourceLocationServer(Vec<fidl_fuchsia_net::Ipv4Address>),
HostName(String),
BootFileSize(u16),
MeritDumpFile(String),
DomainName(String),
SwapServer(fidl_fuchsia_net::Ipv4Address),
RootPath(String),
ExtensionsPath(String),
IpForwarding(bool),
NonLocalSourceRouting(bool),
PolicyFilter(Vec<fidl_fuchsia_net::Ipv4Address>),
MaxDatagramReassemblySize(u16),
DefaultIpTtl(u8),
PathMtuAgingTimeout(u32),
PathMtuPlateauTable(Vec<u16>),
InterfaceMtu(u16),
AllSubnetsLocal(bool),
BroadcastAddress(fidl_fuchsia_net::Ipv4Address),
PerformMaskDiscovery(bool),
MaskSupplier(bool),
PerformRouterDiscovery(bool),
RouterSolicitationAddress(fidl_fuchsia_net::Ipv4Address),
StaticRoute(Vec<fidl_fuchsia_net::Ipv4Address>),
TrailerEncapsulation(bool),
ArpCacheTimeout(u32),
EthernetEncapsulation(bool),
TcpDefaultTtl(u8),
TcpKeepaliveInterval(u32),
TcpKeepaliveGarbage(bool),
NetworkInformationServiceDomain(String),
NetworkInformationServers(Vec<fidl_fuchsia_net::Ipv4Address>),
NetworkTimeProtocolServers(Vec<fidl_fuchsia_net::Ipv4Address>),
VendorSpecificInformation(Vec<u8>),
NetbiosOverTcpipNameServer(Vec<fidl_fuchsia_net::Ipv4Address>),
NetbiosOverTcpipDatagramDistributionServer(Vec<fidl_fuchsia_net::Ipv4Address>),
NetbiosOverTcpipNodeType(NodeTypes),
NetbiosOverTcpipScope(String),
XWindowSystemFontServer(Vec<fidl_fuchsia_net::Ipv4Address>),
XWindowSystemDisplayManager(Vec<fidl_fuchsia_net::Ipv4Address>),
NetworkInformationServicePlusDomain(String),
NetworkInformationServicePlusServers(Vec<fidl_fuchsia_net::Ipv4Address>),
MobileIpHomeAgent(Vec<fidl_fuchsia_net::Ipv4Address>),
SmtpServer(Vec<fidl_fuchsia_net::Ipv4Address>),
Pop3Server(Vec<fidl_fuchsia_net::Ipv4Address>),
NntpServer(Vec<fidl_fuchsia_net::Ipv4Address>),
DefaultWwwServer(Vec<fidl_fuchsia_net::Ipv4Address>),
DefaultFingerServer(Vec<fidl_fuchsia_net::Ipv4Address>),
DefaultIrcServer(Vec<fidl_fuchsia_net::Ipv4Address>),
StreettalkServer(Vec<fidl_fuchsia_net::Ipv4Address>),
StreettalkDirectoryAssistanceServer(Vec<fidl_fuchsia_net::Ipv4Address>),
OptionOverload(OptionOverloadValue),
TftpServerName(String),
BootfileName(String),
MaxDhcpMessageSize(u16),
RenewalTimeValue(u32),
RebindingTimeValue(u32),
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u64 },
}
#[macro_export]
macro_rules! Option_Unknown {
() => {
_
};
}
impl PartialEq for Option_ {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::SubnetMask(x), Self::SubnetMask(y)) => *x == *y,
(Self::TimeOffset(x), Self::TimeOffset(y)) => *x == *y,
(Self::Router(x), Self::Router(y)) => *x == *y,
(Self::TimeServer(x), Self::TimeServer(y)) => *x == *y,
(Self::NameServer(x), Self::NameServer(y)) => *x == *y,
(Self::DomainNameServer(x), Self::DomainNameServer(y)) => *x == *y,
(Self::LogServer(x), Self::LogServer(y)) => *x == *y,
(Self::CookieServer(x), Self::CookieServer(y)) => *x == *y,
(Self::LprServer(x), Self::LprServer(y)) => *x == *y,
(Self::ImpressServer(x), Self::ImpressServer(y)) => *x == *y,
(Self::ResourceLocationServer(x), Self::ResourceLocationServer(y)) => *x == *y,
(Self::HostName(x), Self::HostName(y)) => *x == *y,
(Self::BootFileSize(x), Self::BootFileSize(y)) => *x == *y,
(Self::MeritDumpFile(x), Self::MeritDumpFile(y)) => *x == *y,
(Self::DomainName(x), Self::DomainName(y)) => *x == *y,
(Self::SwapServer(x), Self::SwapServer(y)) => *x == *y,
(Self::RootPath(x), Self::RootPath(y)) => *x == *y,
(Self::ExtensionsPath(x), Self::ExtensionsPath(y)) => *x == *y,
(Self::IpForwarding(x), Self::IpForwarding(y)) => *x == *y,
(Self::NonLocalSourceRouting(x), Self::NonLocalSourceRouting(y)) => *x == *y,
(Self::PolicyFilter(x), Self::PolicyFilter(y)) => *x == *y,
(Self::MaxDatagramReassemblySize(x), Self::MaxDatagramReassemblySize(y)) => *x == *y,
(Self::DefaultIpTtl(x), Self::DefaultIpTtl(y)) => *x == *y,
(Self::PathMtuAgingTimeout(x), Self::PathMtuAgingTimeout(y)) => *x == *y,
(Self::PathMtuPlateauTable(x), Self::PathMtuPlateauTable(y)) => *x == *y,
(Self::InterfaceMtu(x), Self::InterfaceMtu(y)) => *x == *y,
(Self::AllSubnetsLocal(x), Self::AllSubnetsLocal(y)) => *x == *y,
(Self::BroadcastAddress(x), Self::BroadcastAddress(y)) => *x == *y,
(Self::PerformMaskDiscovery(x), Self::PerformMaskDiscovery(y)) => *x == *y,
(Self::MaskSupplier(x), Self::MaskSupplier(y)) => *x == *y,
(Self::PerformRouterDiscovery(x), Self::PerformRouterDiscovery(y)) => *x == *y,
(Self::RouterSolicitationAddress(x), Self::RouterSolicitationAddress(y)) => *x == *y,
(Self::StaticRoute(x), Self::StaticRoute(y)) => *x == *y,
(Self::TrailerEncapsulation(x), Self::TrailerEncapsulation(y)) => *x == *y,
(Self::ArpCacheTimeout(x), Self::ArpCacheTimeout(y)) => *x == *y,
(Self::EthernetEncapsulation(x), Self::EthernetEncapsulation(y)) => *x == *y,
(Self::TcpDefaultTtl(x), Self::TcpDefaultTtl(y)) => *x == *y,
(Self::TcpKeepaliveInterval(x), Self::TcpKeepaliveInterval(y)) => *x == *y,
(Self::TcpKeepaliveGarbage(x), Self::TcpKeepaliveGarbage(y)) => *x == *y,
(
Self::NetworkInformationServiceDomain(x),
Self::NetworkInformationServiceDomain(y),
) => *x == *y,
(Self::NetworkInformationServers(x), Self::NetworkInformationServers(y)) => *x == *y,
(Self::NetworkTimeProtocolServers(x), Self::NetworkTimeProtocolServers(y)) => *x == *y,
(Self::VendorSpecificInformation(x), Self::VendorSpecificInformation(y)) => *x == *y,
(Self::NetbiosOverTcpipNameServer(x), Self::NetbiosOverTcpipNameServer(y)) => *x == *y,
(
Self::NetbiosOverTcpipDatagramDistributionServer(x),
Self::NetbiosOverTcpipDatagramDistributionServer(y),
) => *x == *y,
(Self::NetbiosOverTcpipNodeType(x), Self::NetbiosOverTcpipNodeType(y)) => *x == *y,
(Self::NetbiosOverTcpipScope(x), Self::NetbiosOverTcpipScope(y)) => *x == *y,
(Self::XWindowSystemFontServer(x), Self::XWindowSystemFontServer(y)) => *x == *y,
(Self::XWindowSystemDisplayManager(x), Self::XWindowSystemDisplayManager(y)) => {
*x == *y
}
(
Self::NetworkInformationServicePlusDomain(x),
Self::NetworkInformationServicePlusDomain(y),
) => *x == *y,
(
Self::NetworkInformationServicePlusServers(x),
Self::NetworkInformationServicePlusServers(y),
) => *x == *y,
(Self::MobileIpHomeAgent(x), Self::MobileIpHomeAgent(y)) => *x == *y,
(Self::SmtpServer(x), Self::SmtpServer(y)) => *x == *y,
(Self::Pop3Server(x), Self::Pop3Server(y)) => *x == *y,
(Self::NntpServer(x), Self::NntpServer(y)) => *x == *y,
(Self::DefaultWwwServer(x), Self::DefaultWwwServer(y)) => *x == *y,
(Self::DefaultFingerServer(x), Self::DefaultFingerServer(y)) => *x == *y,
(Self::DefaultIrcServer(x), Self::DefaultIrcServer(y)) => *x == *y,
(Self::StreettalkServer(x), Self::StreettalkServer(y)) => *x == *y,
(
Self::StreettalkDirectoryAssistanceServer(x),
Self::StreettalkDirectoryAssistanceServer(y),
) => *x == *y,
(Self::OptionOverload(x), Self::OptionOverload(y)) => *x == *y,
(Self::TftpServerName(x), Self::TftpServerName(y)) => *x == *y,
(Self::BootfileName(x), Self::BootfileName(y)) => *x == *y,
(Self::MaxDhcpMessageSize(x), Self::MaxDhcpMessageSize(y)) => *x == *y,
(Self::RenewalTimeValue(x), Self::RenewalTimeValue(y)) => *x == *y,
(Self::RebindingTimeValue(x), Self::RebindingTimeValue(y)) => *x == *y,
_ => false,
}
}
}
impl Option_ {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::SubnetMask(_) => 1,
Self::TimeOffset(_) => 2,
Self::Router(_) => 3,
Self::TimeServer(_) => 4,
Self::NameServer(_) => 5,
Self::DomainNameServer(_) => 6,
Self::LogServer(_) => 7,
Self::CookieServer(_) => 8,
Self::LprServer(_) => 9,
Self::ImpressServer(_) => 10,
Self::ResourceLocationServer(_) => 11,
Self::HostName(_) => 12,
Self::BootFileSize(_) => 13,
Self::MeritDumpFile(_) => 14,
Self::DomainName(_) => 15,
Self::SwapServer(_) => 16,
Self::RootPath(_) => 17,
Self::ExtensionsPath(_) => 18,
Self::IpForwarding(_) => 19,
Self::NonLocalSourceRouting(_) => 20,
Self::PolicyFilter(_) => 21,
Self::MaxDatagramReassemblySize(_) => 22,
Self::DefaultIpTtl(_) => 23,
Self::PathMtuAgingTimeout(_) => 24,
Self::PathMtuPlateauTable(_) => 25,
Self::InterfaceMtu(_) => 26,
Self::AllSubnetsLocal(_) => 27,
Self::BroadcastAddress(_) => 28,
Self::PerformMaskDiscovery(_) => 29,
Self::MaskSupplier(_) => 30,
Self::PerformRouterDiscovery(_) => 31,
Self::RouterSolicitationAddress(_) => 32,
Self::StaticRoute(_) => 33,
Self::TrailerEncapsulation(_) => 34,
Self::ArpCacheTimeout(_) => 35,
Self::EthernetEncapsulation(_) => 36,
Self::TcpDefaultTtl(_) => 37,
Self::TcpKeepaliveInterval(_) => 38,
Self::TcpKeepaliveGarbage(_) => 39,
Self::NetworkInformationServiceDomain(_) => 40,
Self::NetworkInformationServers(_) => 41,
Self::NetworkTimeProtocolServers(_) => 42,
Self::VendorSpecificInformation(_) => 43,
Self::NetbiosOverTcpipNameServer(_) => 44,
Self::NetbiosOverTcpipDatagramDistributionServer(_) => 45,
Self::NetbiosOverTcpipNodeType(_) => 46,
Self::NetbiosOverTcpipScope(_) => 47,
Self::XWindowSystemFontServer(_) => 48,
Self::XWindowSystemDisplayManager(_) => 49,
Self::NetworkInformationServicePlusDomain(_) => 50,
Self::NetworkInformationServicePlusServers(_) => 51,
Self::MobileIpHomeAgent(_) => 52,
Self::SmtpServer(_) => 53,
Self::Pop3Server(_) => 54,
Self::NntpServer(_) => 55,
Self::DefaultWwwServer(_) => 56,
Self::DefaultFingerServer(_) => 57,
Self::DefaultIrcServer(_) => 58,
Self::StreettalkServer(_) => 59,
Self::StreettalkDirectoryAssistanceServer(_) => 60,
Self::OptionOverload(_) => 61,
Self::TftpServerName(_) => 62,
Self::BootfileName(_) => 63,
Self::MaxDhcpMessageSize(_) => 64,
Self::RenewalTimeValue(_) => 65,
Self::RebindingTimeValue(_) => 66,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for Option_ {}
#[derive(Clone, Debug)]
pub enum Parameter {
IpAddrs(Vec<fidl_fuchsia_net::Ipv4Address>),
AddressPool(AddressPool),
Lease(LeaseLength),
PermittedMacs(Vec<fidl_fuchsia_net::MacAddress>),
StaticallyAssignedAddrs(Vec<StaticAssignment>),
ArpProbe(bool),
BoundDeviceNames(Vec<String>),
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u64 },
}
#[macro_export]
macro_rules! ParameterUnknown {
() => {
_
};
}
impl PartialEq for Parameter {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::IpAddrs(x), Self::IpAddrs(y)) => *x == *y,
(Self::AddressPool(x), Self::AddressPool(y)) => *x == *y,
(Self::Lease(x), Self::Lease(y)) => *x == *y,
(Self::PermittedMacs(x), Self::PermittedMacs(y)) => *x == *y,
(Self::StaticallyAssignedAddrs(x), Self::StaticallyAssignedAddrs(y)) => *x == *y,
(Self::ArpProbe(x), Self::ArpProbe(y)) => *x == *y,
(Self::BoundDeviceNames(x), Self::BoundDeviceNames(y)) => *x == *y,
_ => false,
}
}
}
impl Parameter {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::IpAddrs(_) => 1,
Self::AddressPool(_) => 2,
Self::Lease(_) => 3,
Self::PermittedMacs(_) => 4,
Self::StaticallyAssignedAddrs(_) => 5,
Self::ArpProbe(_) => 6,
Self::BoundDeviceNames(_) => 7,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for Parameter {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ClientMarker;
impl fidl::endpoints::ProtocolMarker for ClientMarker {
type Proxy = ClientProxy;
type RequestStream = ClientRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ClientSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Client";
}
pub trait ClientProxyInterface: Send + Sync {
type WatchConfigurationResponseFut: std::future::Future<Output = Result<ClientWatchConfigurationResponse, fidl::Error>>
+ Send;
fn r#watch_configuration(&self) -> Self::WatchConfigurationResponseFut;
fn r#shutdown(&self) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ClientSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ClientSynchronousProxy {
type Proxy = ClientProxy;
type Protocol = ClientMarker;
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 ClientSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ClientMarker 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<ClientEvent, fidl::Error> {
ClientEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#watch_configuration(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ClientWatchConfigurationResponse, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, ClientWatchConfigurationResponse>(
(),
0x2b6f7c7d3bcc6682,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#shutdown(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x265a3213e9a8abde,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct ClientProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ClientProxy {
type Protocol = ClientMarker;
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 ClientProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ClientEventStream {
ClientEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#watch_configuration(
&self,
) -> fidl::client::QueryResponseFut<
ClientWatchConfigurationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ClientProxyInterface::r#watch_configuration(self)
}
pub fn r#shutdown(&self) -> Result<(), fidl::Error> {
ClientProxyInterface::r#shutdown(self)
}
}
impl ClientProxyInterface for ClientProxy {
type WatchConfigurationResponseFut = fidl::client::QueryResponseFut<
ClientWatchConfigurationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_configuration(&self) -> Self::WatchConfigurationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ClientWatchConfigurationResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ClientWatchConfigurationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2b6f7c7d3bcc6682,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
ClientWatchConfigurationResponse,
>(
(),
0x2b6f7c7d3bcc6682,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#shutdown(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x265a3213e9a8abde,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct ClientEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ClientEventStream {}
impl futures::stream::FusedStream for ClientEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ClientEventStream {
type Item = Result<ClientEvent, 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(ClientEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ClientEvent {
OnExit { reason: ClientExitReason },
}
impl ClientEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_exit(self) -> Option<ClientExitReason> {
if let ClientEvent::OnExit { reason } = self {
Some((reason))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ClientEvent, 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 {
0x2a2a052260f657c0 => {
let mut out = fidl::new_empty!(
ClientOnExitRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientOnExitRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((ClientEvent::OnExit { reason: out.reason }))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ClientRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ClientRequestStream {}
impl futures::stream::FusedStream for ClientRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ClientRequestStream {
type Protocol = ClientMarker;
type ControlHandle = ClientControlHandle;
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 {
ClientControlHandle { 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 ClientRequestStream {
type Item = Result<ClientRequest, 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 ClientRequestStream 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 {
0x2b6f7c7d3bcc6682 => {
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 = ClientControlHandle { inner: this.inner.clone() };
Ok(ClientRequest::WatchConfiguration {
responder: ClientWatchConfigurationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x265a3213e9a8abde => {
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 = ClientControlHandle { inner: this.inner.clone() };
Ok(ClientRequest::Shutdown { control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ClientRequest {
WatchConfiguration { responder: ClientWatchConfigurationResponder },
Shutdown { control_handle: ClientControlHandle },
}
impl ClientRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_watch_configuration(self) -> Option<(ClientWatchConfigurationResponder)> {
if let ClientRequest::WatchConfiguration { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_shutdown(self) -> Option<(ClientControlHandle)> {
if let ClientRequest::Shutdown { control_handle } = self {
Some((control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ClientRequest::WatchConfiguration { .. } => "watch_configuration",
ClientRequest::Shutdown { .. } => "shutdown",
}
}
}
#[derive(Debug, Clone)]
pub struct ClientControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ClientControlHandle {
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 ClientControlHandle {
pub fn send_on_exit(&self, mut reason: ClientExitReason) -> Result<(), fidl::Error> {
self.inner.send::<ClientOnExitRequest>(
(reason,),
0,
0x2a2a052260f657c0,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClientWatchConfigurationResponder {
control_handle: std::mem::ManuallyDrop<ClientControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClientWatchConfigurationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClientWatchConfigurationResponder {
type ControlHandle = ClientControlHandle;
fn control_handle(&self) -> &ClientControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClientWatchConfigurationResponder {
pub fn send(self, mut payload: ClientWatchConfigurationResponse) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: ClientWatchConfigurationResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: ClientWatchConfigurationResponse) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ClientWatchConfigurationResponse>(
&mut payload,
self.tx_id,
0x2b6f7c7d3bcc6682,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ClientProviderMarker;
impl fidl::endpoints::ProtocolMarker for ClientProviderMarker {
type Proxy = ClientProviderProxy;
type RequestStream = ClientProviderRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ClientProviderSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.net.dhcp.ClientProvider";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ClientProviderMarker {}
pub trait ClientProviderProxyInterface: Send + Sync {
fn r#new_client(
&self,
interface_id: u64,
params: &NewClientParams,
request: fidl::endpoints::ServerEnd<ClientMarker>,
) -> Result<(), fidl::Error>;
type CheckPresenceResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#check_presence(&self) -> Self::CheckPresenceResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ClientProviderSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ClientProviderSynchronousProxy {
type Proxy = ClientProviderProxy;
type Protocol = ClientProviderMarker;
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 ClientProviderSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ClientProviderMarker 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<ClientProviderEvent, fidl::Error> {
ClientProviderEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#new_client(
&self,
mut interface_id: u64,
mut params: &NewClientParams,
mut request: fidl::endpoints::ServerEnd<ClientMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ClientProviderNewClientRequest>(
(interface_id, params, request),
0x317e9af2e462cbcd,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#check_presence(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x7ba657cd730bbf60,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
}
#[derive(Debug, Clone)]
pub struct ClientProviderProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ClientProviderProxy {
type Protocol = ClientProviderMarker;
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 ClientProviderProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ClientProviderEventStream {
ClientProviderEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#new_client(
&self,
mut interface_id: u64,
mut params: &NewClientParams,
mut request: fidl::endpoints::ServerEnd<ClientMarker>,
) -> Result<(), fidl::Error> {
ClientProviderProxyInterface::r#new_client(self, interface_id, params, request)
}
pub fn r#check_presence(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
ClientProviderProxyInterface::r#check_presence(self)
}
}
impl ClientProviderProxyInterface for ClientProviderProxy {
fn r#new_client(
&self,
mut interface_id: u64,
mut params: &NewClientParams,
mut request: fidl::endpoints::ServerEnd<ClientMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<ClientProviderNewClientRequest>(
(interface_id, params, request),
0x317e9af2e462cbcd,
fidl::encoding::DynamicFlags::empty(),
)
}
type CheckPresenceResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#check_presence(&self) -> Self::CheckPresenceResponseFut {
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,
0x7ba657cd730bbf60,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x7ba657cd730bbf60,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ClientProviderEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ClientProviderEventStream {}
impl futures::stream::FusedStream for ClientProviderEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ClientProviderEventStream {
type Item = Result<ClientProviderEvent, 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(ClientProviderEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ClientProviderEvent {}
impl ClientProviderEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ClientProviderEvent, 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:
<ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ClientProviderRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ClientProviderRequestStream {}
impl futures::stream::FusedStream for ClientProviderRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ClientProviderRequestStream {
type Protocol = ClientProviderMarker;
type ControlHandle = ClientProviderControlHandle;
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 {
ClientProviderControlHandle { 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 ClientProviderRequestStream {
type Item = Result<ClientProviderRequest, 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 ClientProviderRequestStream 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 {
0x317e9af2e462cbcd => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ClientProviderNewClientRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientProviderNewClientRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
ClientProviderControlHandle { inner: this.inner.clone() };
Ok(ClientProviderRequest::NewClient {
interface_id: req.interface_id,
params: req.params,
request: req.request,
control_handle,
})
}
0x7ba657cd730bbf60 => {
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 =
ClientProviderControlHandle { inner: this.inner.clone() };
Ok(ClientProviderRequest::CheckPresence {
responder: ClientProviderCheckPresenceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ClientProviderRequest {
NewClient {
interface_id: u64,
params: NewClientParams,
request: fidl::endpoints::ServerEnd<ClientMarker>,
control_handle: ClientProviderControlHandle,
},
CheckPresence { responder: ClientProviderCheckPresenceResponder },
}
impl ClientProviderRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_new_client(
self,
) -> Option<(
u64,
NewClientParams,
fidl::endpoints::ServerEnd<ClientMarker>,
ClientProviderControlHandle,
)> {
if let ClientProviderRequest::NewClient { interface_id, params, request, control_handle } =
self
{
Some((interface_id, params, request, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_check_presence(self) -> Option<(ClientProviderCheckPresenceResponder)> {
if let ClientProviderRequest::CheckPresence { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ClientProviderRequest::NewClient { .. } => "new_client",
ClientProviderRequest::CheckPresence { .. } => "check_presence",
}
}
}
#[derive(Debug, Clone)]
pub struct ClientProviderControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ClientProviderControlHandle {
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 ClientProviderControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ClientProviderCheckPresenceResponder {
control_handle: std::mem::ManuallyDrop<ClientProviderControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ClientProviderCheckPresenceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ClientProviderCheckPresenceResponder {
type ControlHandle = ClientProviderControlHandle;
fn control_handle(&self) -> &ClientProviderControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ClientProviderCheckPresenceResponder {
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,
0x7ba657cd730bbf60,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Server_Marker;
impl fidl::endpoints::ProtocolMarker for Server_Marker {
type Proxy = Server_Proxy;
type RequestStream = Server_RequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = Server_SynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.net.dhcp.Server";
}
impl fidl::endpoints::DiscoverableProtocolMarker for Server_Marker {}
pub type ServerStartServingResult = Result<(), i32>;
pub type ServerGetOptionResult = Result<Option_, i32>;
pub type ServerGetParameterResult = Result<Parameter, i32>;
pub type ServerSetOptionResult = Result<(), i32>;
pub type ServerSetParameterResult = Result<(), i32>;
pub type ServerListOptionsResult = Result<Vec<Option_>, i32>;
pub type ServerListParametersResult = Result<Vec<Parameter>, i32>;
pub type ServerResetOptionsResult = Result<(), i32>;
pub type ServerResetParametersResult = Result<(), i32>;
pub type ServerClearLeasesResult = Result<(), i32>;
pub trait Server_ProxyInterface: Send + Sync {
type StartServingResponseFut: std::future::Future<Output = Result<ServerStartServingResult, fidl::Error>>
+ Send;
fn r#start_serving(&self) -> Self::StartServingResponseFut;
type StopServingResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#stop_serving(&self) -> Self::StopServingResponseFut;
type IsServingResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
fn r#is_serving(&self) -> Self::IsServingResponseFut;
type GetOptionResponseFut: std::future::Future<Output = Result<ServerGetOptionResult, fidl::Error>>
+ Send;
fn r#get_option(&self, code: OptionCode) -> Self::GetOptionResponseFut;
type GetParameterResponseFut: std::future::Future<Output = Result<ServerGetParameterResult, fidl::Error>>
+ Send;
fn r#get_parameter(&self, name: ParameterName) -> Self::GetParameterResponseFut;
type SetOptionResponseFut: std::future::Future<Output = Result<ServerSetOptionResult, fidl::Error>>
+ Send;
fn r#set_option(&self, value: &Option_) -> Self::SetOptionResponseFut;
type SetParameterResponseFut: std::future::Future<Output = Result<ServerSetParameterResult, fidl::Error>>
+ Send;
fn r#set_parameter(&self, value: &Parameter) -> Self::SetParameterResponseFut;
type ListOptionsResponseFut: std::future::Future<Output = Result<ServerListOptionsResult, fidl::Error>>
+ Send;
fn r#list_options(&self) -> Self::ListOptionsResponseFut;
type ListParametersResponseFut: std::future::Future<Output = Result<ServerListParametersResult, fidl::Error>>
+ Send;
fn r#list_parameters(&self) -> Self::ListParametersResponseFut;
type ResetOptionsResponseFut: std::future::Future<Output = Result<ServerResetOptionsResult, fidl::Error>>
+ Send;
fn r#reset_options(&self) -> Self::ResetOptionsResponseFut;
type ResetParametersResponseFut: std::future::Future<Output = Result<ServerResetParametersResult, fidl::Error>>
+ Send;
fn r#reset_parameters(&self) -> Self::ResetParametersResponseFut;
type ClearLeasesResponseFut: std::future::Future<Output = Result<ServerClearLeasesResult, fidl::Error>>
+ Send;
fn r#clear_leases(&self) -> Self::ClearLeasesResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct Server_SynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for Server_SynchronousProxy {
type Proxy = Server_Proxy;
type Protocol = Server_Marker;
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 Server_SynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <Server_Marker 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<Server_Event, fidl::Error> {
Server_Event::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#start_serving(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ServerStartServingResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x10990e324ac53cd1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#stop_serving(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x7776cfe9f68a0dbe,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#is_serving(&self, ___deadline: zx::MonotonicInstant) -> Result<bool, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, ServerIsServingResponse>(
(),
0x45aadc35fcbe3826,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.enabled)
}
pub fn r#get_option(
&self,
mut code: OptionCode,
___deadline: zx::MonotonicInstant,
) -> Result<ServerGetOptionResult, fidl::Error> {
let _response = self.client.send_query::<
ServerGetOptionRequest,
fidl::encoding::ResultType<ServerGetOptionResponse, i32>,
>(
(code,),
0x5305ee2c593f68a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#get_parameter(
&self,
mut name: ParameterName,
___deadline: zx::MonotonicInstant,
) -> Result<ServerGetParameterResult, fidl::Error> {
let _response = self.client.send_query::<
ServerGetParameterRequest,
fidl::encoding::ResultType<ServerGetParameterResponse, i32>,
>(
(name,),
0x1e8c98758fb82714,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_option(
&self,
mut value: &Option_,
___deadline: zx::MonotonicInstant,
) -> Result<ServerSetOptionResult, fidl::Error> {
let _response = self.client.send_query::<
ServerSetOptionRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(value,),
0x63c98b670db8d96a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_parameter(
&self,
mut value: &Parameter,
___deadline: zx::MonotonicInstant,
) -> Result<ServerSetParameterResult, fidl::Error> {
let _response = self.client.send_query::<
ServerSetParameterRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(value,),
0x3002d0d956eb4bdc,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list_options(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ServerListOptionsResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<ServerListOptionsResponse, i32>,
>(
(),
0x72c8161c69ca67b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.options))
}
pub fn r#list_parameters(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ServerListParametersResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<ServerListParametersResponse, i32>,
>(
(),
0xa201b1d6d121c59,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.parameters))
}
pub fn r#reset_options(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ServerResetOptionsResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x31014911fd21cc13,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#reset_parameters(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ServerResetParametersResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x353fba50bcf4ecec,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#clear_leases(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ServerClearLeasesResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0xe39e35cda85a04d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct Server_Proxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for Server_Proxy {
type Protocol = Server_Marker;
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 Server_Proxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> Server_EventStream {
Server_EventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#start_serving(
&self,
) -> fidl::client::QueryResponseFut<
ServerStartServingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#start_serving(self)
}
pub fn r#stop_serving(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
Server_ProxyInterface::r#stop_serving(self)
}
pub fn r#is_serving(
&self,
) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
Server_ProxyInterface::r#is_serving(self)
}
pub fn r#get_option(
&self,
mut code: OptionCode,
) -> fidl::client::QueryResponseFut<
ServerGetOptionResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#get_option(self, code)
}
pub fn r#get_parameter(
&self,
mut name: ParameterName,
) -> fidl::client::QueryResponseFut<
ServerGetParameterResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#get_parameter(self, name)
}
pub fn r#set_option(
&self,
mut value: &Option_,
) -> fidl::client::QueryResponseFut<
ServerSetOptionResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#set_option(self, value)
}
pub fn r#set_parameter(
&self,
mut value: &Parameter,
) -> fidl::client::QueryResponseFut<
ServerSetParameterResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#set_parameter(self, value)
}
pub fn r#list_options(
&self,
) -> fidl::client::QueryResponseFut<
ServerListOptionsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#list_options(self)
}
pub fn r#list_parameters(
&self,
) -> fidl::client::QueryResponseFut<
ServerListParametersResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#list_parameters(self)
}
pub fn r#reset_options(
&self,
) -> fidl::client::QueryResponseFut<
ServerResetOptionsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#reset_options(self)
}
pub fn r#reset_parameters(
&self,
) -> fidl::client::QueryResponseFut<
ServerResetParametersResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#reset_parameters(self)
}
pub fn r#clear_leases(
&self,
) -> fidl::client::QueryResponseFut<
ServerClearLeasesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
Server_ProxyInterface::r#clear_leases(self)
}
}
impl Server_ProxyInterface for Server_Proxy {
type StartServingResponseFut = fidl::client::QueryResponseFut<
ServerStartServingResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#start_serving(&self) -> Self::StartServingResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerStartServingResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x10990e324ac53cd1,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerStartServingResult>(
(),
0x10990e324ac53cd1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopServingResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#stop_serving(&self) -> Self::StopServingResponseFut {
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,
0x7776cfe9f68a0dbe,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x7776cfe9f68a0dbe,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type IsServingResponseFut =
fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#is_serving(&self) -> Self::IsServingResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<bool, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
ServerIsServingResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x45aadc35fcbe3826,
>(_buf?)?;
Ok(_response.enabled)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
(),
0x45aadc35fcbe3826,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetOptionResponseFut = fidl::client::QueryResponseFut<
ServerGetOptionResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_option(&self, mut code: OptionCode) -> Self::GetOptionResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerGetOptionResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ServerGetOptionResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5305ee2c593f68a,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<ServerGetOptionRequest, ServerGetOptionResult>(
(code,),
0x5305ee2c593f68a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetParameterResponseFut = fidl::client::QueryResponseFut<
ServerGetParameterResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_parameter(&self, mut name: ParameterName) -> Self::GetParameterResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerGetParameterResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ServerGetParameterResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1e8c98758fb82714,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<ServerGetParameterRequest, ServerGetParameterResult>(
(name,),
0x1e8c98758fb82714,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetOptionResponseFut = fidl::client::QueryResponseFut<
ServerSetOptionResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_option(&self, mut value: &Option_) -> Self::SetOptionResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerSetOptionResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x63c98b670db8d96a,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<ServerSetOptionRequest, ServerSetOptionResult>(
(value,),
0x63c98b670db8d96a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetParameterResponseFut = fidl::client::QueryResponseFut<
ServerSetParameterResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_parameter(&self, mut value: &Parameter) -> Self::SetParameterResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerSetParameterResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3002d0d956eb4bdc,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<ServerSetParameterRequest, ServerSetParameterResult>(
(value,),
0x3002d0d956eb4bdc,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ListOptionsResponseFut = fidl::client::QueryResponseFut<
ServerListOptionsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#list_options(&self) -> Self::ListOptionsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerListOptionsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ServerListOptionsResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x72c8161c69ca67b,
>(_buf?)?;
Ok(_response.map(|x| x.options))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerListOptionsResult>(
(),
0x72c8161c69ca67b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ListParametersResponseFut = fidl::client::QueryResponseFut<
ServerListParametersResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#list_parameters(&self) -> Self::ListParametersResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerListParametersResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ServerListParametersResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xa201b1d6d121c59,
>(_buf?)?;
Ok(_response.map(|x| x.parameters))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerListParametersResult>(
(),
0xa201b1d6d121c59,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ResetOptionsResponseFut = fidl::client::QueryResponseFut<
ServerResetOptionsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#reset_options(&self) -> Self::ResetOptionsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerResetOptionsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x31014911fd21cc13,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerResetOptionsResult>(
(),
0x31014911fd21cc13,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ResetParametersResponseFut = fidl::client::QueryResponseFut<
ServerResetParametersResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#reset_parameters(&self) -> Self::ResetParametersResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerResetParametersResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x353fba50bcf4ecec,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerResetParametersResult>(
(),
0x353fba50bcf4ecec,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ClearLeasesResponseFut = fidl::client::QueryResponseFut<
ServerClearLeasesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#clear_leases(&self) -> Self::ClearLeasesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ServerClearLeasesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xe39e35cda85a04d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerClearLeasesResult>(
(),
0xe39e35cda85a04d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct Server_EventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for Server_EventStream {}
impl futures::stream::FusedStream for Server_EventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for Server_EventStream {
type Item = Result<Server_Event, 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(Server_Event::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum Server_Event {}
impl Server_Event {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<Server_Event, 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: <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct Server_RequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for Server_RequestStream {}
impl futures::stream::FusedStream for Server_RequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for Server_RequestStream {
type Protocol = Server_Marker;
type ControlHandle = Server_ControlHandle;
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 {
Server_ControlHandle { 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 Server_RequestStream {
type Item = Result<Server_Request, 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 Server_RequestStream 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 {
0x10990e324ac53cd1 => {
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 = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::StartServing {
responder: Server_StartServingResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7776cfe9f68a0dbe => {
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 = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::StopServing {
responder: Server_StopServingResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x45aadc35fcbe3826 => {
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 = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::IsServing {
responder: Server_IsServingResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5305ee2c593f68a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ServerGetOptionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerGetOptionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::GetOption {
code: req.code,
responder: Server_GetOptionResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1e8c98758fb82714 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ServerGetParameterRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerGetParameterRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::GetParameter {
name: req.name,
responder: Server_GetParameterResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x63c98b670db8d96a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ServerSetOptionRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerSetOptionRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::SetOption {
value: req.value,
responder: Server_SetOptionResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3002d0d956eb4bdc => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ServerSetParameterRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerSetParameterRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::SetParameter {
value: req.value,
responder: Server_SetParameterResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x72c8161c69ca67b => {
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 = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::ListOptions {
responder: Server_ListOptionsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xa201b1d6d121c59 => {
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 = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::ListParameters {
responder: Server_ListParametersResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x31014911fd21cc13 => {
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 = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::ResetOptions {
responder: Server_ResetOptionsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x353fba50bcf4ecec => {
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 = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::ResetParameters {
responder: Server_ResetParametersResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xe39e35cda85a04d => {
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 = Server_ControlHandle { inner: this.inner.clone() };
Ok(Server_Request::ClearLeases {
responder: Server_ClearLeasesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum Server_Request {
StartServing { responder: Server_StartServingResponder },
StopServing { responder: Server_StopServingResponder },
IsServing { responder: Server_IsServingResponder },
GetOption { code: OptionCode, responder: Server_GetOptionResponder },
GetParameter { name: ParameterName, responder: Server_GetParameterResponder },
SetOption { value: Option_, responder: Server_SetOptionResponder },
SetParameter { value: Parameter, responder: Server_SetParameterResponder },
ListOptions { responder: Server_ListOptionsResponder },
ListParameters { responder: Server_ListParametersResponder },
ResetOptions { responder: Server_ResetOptionsResponder },
ResetParameters { responder: Server_ResetParametersResponder },
ClearLeases { responder: Server_ClearLeasesResponder },
}
impl Server_Request {
#[allow(irrefutable_let_patterns)]
pub fn into_start_serving(self) -> Option<(Server_StartServingResponder)> {
if let Server_Request::StartServing { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop_serving(self) -> Option<(Server_StopServingResponder)> {
if let Server_Request::StopServing { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_is_serving(self) -> Option<(Server_IsServingResponder)> {
if let Server_Request::IsServing { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_option(self) -> Option<(OptionCode, Server_GetOptionResponder)> {
if let Server_Request::GetOption { code, responder } = self {
Some((code, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_parameter(self) -> Option<(ParameterName, Server_GetParameterResponder)> {
if let Server_Request::GetParameter { name, responder } = self {
Some((name, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_option(self) -> Option<(Option_, Server_SetOptionResponder)> {
if let Server_Request::SetOption { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_parameter(self) -> Option<(Parameter, Server_SetParameterResponder)> {
if let Server_Request::SetParameter { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_options(self) -> Option<(Server_ListOptionsResponder)> {
if let Server_Request::ListOptions { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_parameters(self) -> Option<(Server_ListParametersResponder)> {
if let Server_Request::ListParameters { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_reset_options(self) -> Option<(Server_ResetOptionsResponder)> {
if let Server_Request::ResetOptions { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_reset_parameters(self) -> Option<(Server_ResetParametersResponder)> {
if let Server_Request::ResetParameters { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_clear_leases(self) -> Option<(Server_ClearLeasesResponder)> {
if let Server_Request::ClearLeases { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
Server_Request::StartServing { .. } => "start_serving",
Server_Request::StopServing { .. } => "stop_serving",
Server_Request::IsServing { .. } => "is_serving",
Server_Request::GetOption { .. } => "get_option",
Server_Request::GetParameter { .. } => "get_parameter",
Server_Request::SetOption { .. } => "set_option",
Server_Request::SetParameter { .. } => "set_parameter",
Server_Request::ListOptions { .. } => "list_options",
Server_Request::ListParameters { .. } => "list_parameters",
Server_Request::ResetOptions { .. } => "reset_options",
Server_Request::ResetParameters { .. } => "reset_parameters",
Server_Request::ClearLeases { .. } => "clear_leases",
}
}
}
#[derive(Debug, Clone)]
pub struct Server_ControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for Server_ControlHandle {
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 Server_ControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_StartServingResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_StartServingResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_StartServingResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_StartServingResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x10990e324ac53cd1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_StopServingResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_StopServingResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_StopServingResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_StopServingResponder {
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,
0x7776cfe9f68a0dbe,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_IsServingResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_IsServingResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_IsServingResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_IsServingResponder {
pub fn send(self, mut enabled: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(enabled);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut enabled: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(enabled);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut enabled: bool) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<ServerIsServingResponse>(
(enabled,),
self.tx_id,
0x45aadc35fcbe3826,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_GetOptionResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_GetOptionResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_GetOptionResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_GetOptionResponder {
pub fn send(self, mut result: Result<&Option_, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&Option_, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&Option_, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<ServerGetOptionResponse, i32>>(
result.map(|value| (value,)),
self.tx_id,
0x5305ee2c593f68a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_GetParameterResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_GetParameterResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_GetParameterResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_GetParameterResponder {
pub fn send(self, mut result: Result<&Parameter, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&Parameter, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&Parameter, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<ServerGetParameterResponse, i32>>(
result.map(|value| (value,)),
self.tx_id,
0x1e8c98758fb82714,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_SetOptionResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_SetOptionResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_SetOptionResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_SetOptionResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x63c98b670db8d96a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_SetParameterResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_SetParameterResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_SetParameterResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_SetParameterResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x3002d0d956eb4bdc,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_ListOptionsResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_ListOptionsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_ListOptionsResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_ListOptionsResponder {
pub fn send(self, mut result: Result<&[Option_], i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[Option_], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[Option_], i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<ServerListOptionsResponse, i32>>(
result.map(|options| (options,)),
self.tx_id,
0x72c8161c69ca67b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_ListParametersResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_ListParametersResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_ListParametersResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_ListParametersResponder {
pub fn send(self, mut result: Result<&[Parameter], i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[Parameter], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[Parameter], i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<ServerListParametersResponse, i32>>(
result.map(|parameters| (parameters,)),
self.tx_id,
0xa201b1d6d121c59,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_ResetOptionsResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_ResetOptionsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_ResetOptionsResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_ResetOptionsResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x31014911fd21cc13,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_ResetParametersResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_ResetParametersResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_ResetParametersResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_ResetParametersResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x353fba50bcf4ecec,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct Server_ClearLeasesResponder {
control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for Server_ClearLeasesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for Server_ClearLeasesResponder {
type ControlHandle = Server_ControlHandle;
fn control_handle(&self) -> &Server_ControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl Server_ClearLeasesResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0xe39e35cda85a04d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for NodeTypes {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
impl fidl::encoding::ValueTypeMarker for NodeTypes {
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 NodeTypes {
#[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);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NodeTypes {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[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_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ClientExitReason {
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 ClientExitReason {
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 ClientExitReason
{
#[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 ClientExitReason {
#[inline(always)]
fn new_empty() -> Self {
Self::ClientAlreadyExistsOnInterface
}
#[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 MessageType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for MessageType {
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 MessageType {
#[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 MessageType {
#[inline(always)]
fn new_empty() -> Self {
Self::Dhcpdiscover
}
#[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(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for OptionCode {
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 OptionCode {
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 OptionCode {
#[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 OptionCode {
#[inline(always)]
fn new_empty() -> Self {
Self::SubnetMask
}
#[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 OptionOverloadValue {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for OptionOverloadValue {
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 OptionOverloadValue
{
#[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 OptionOverloadValue {
#[inline(always)]
fn new_empty() -> Self {
Self::File
}
#[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(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ParameterName {
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 ParameterName {
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 ParameterName {
#[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 ParameterName {
#[inline(always)]
fn new_empty() -> Self {
Self::IpAddrs
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ClientOnExitRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ClientOnExitRequest {
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<ClientOnExitRequest, D>
for &ClientOnExitRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClientOnExitRequest>(offset);
fidl::encoding::Encode::<ClientOnExitRequest, D>::encode(
(<ClientExitReason as fidl::encoding::ValueTypeMarker>::borrow(&self.reason),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ClientExitReason, D>>
fidl::encoding::Encode<ClientOnExitRequest, 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::<ClientOnExitRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClientOnExitRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { reason: fidl::new_empty!(ClientExitReason, 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!(ClientExitReason, D, &mut self.reason, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ClientProviderNewClientRequest {
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 ClientProviderNewClientRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl
fidl::encoding::Encode<
ClientProviderNewClientRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ClientProviderNewClientRequest
{
#[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::<ClientProviderNewClientRequest>(offset);
fidl::encoding::Encode::<ClientProviderNewClientRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
<NewClientParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<NewClientParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ClientProviderNewClientRequest,
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::<ClientProviderNewClientRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ClientProviderNewClientRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
interface_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
params: fidl::new_empty!(
NewClientParams,
fidl::encoding::DefaultFuchsiaResourceDialect
),
request: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>>,
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(24) };
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 + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.interface_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
NewClientParams,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.params,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.request,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ServerGetOptionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ServerGetOptionRequest {
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<ServerGetOptionRequest, D> for &ServerGetOptionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerGetOptionRequest>(offset);
fidl::encoding::Encode::<ServerGetOptionRequest, D>::encode(
(<OptionCode as fidl::encoding::ValueTypeMarker>::borrow(&self.code),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<OptionCode, D>>
fidl::encoding::Encode<ServerGetOptionRequest, 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::<ServerGetOptionRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ServerGetOptionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { code: fidl::new_empty!(OptionCode, 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!(OptionCode, D, &mut self.code, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ServerGetParameterRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ServerGetParameterRequest {
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<ServerGetParameterRequest, D> for &ServerGetParameterRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerGetParameterRequest>(offset);
fidl::encoding::Encode::<ServerGetParameterRequest, D>::encode(
(<ParameterName as fidl::encoding::ValueTypeMarker>::borrow(&self.name),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ParameterName, D>>
fidl::encoding::Encode<ServerGetParameterRequest, 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::<ServerGetParameterRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ServerGetParameterRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { name: fidl::new_empty!(ParameterName, 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!(ParameterName, D, &mut self.name, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ServerIsServingResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ServerIsServingResponse {
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<ServerIsServingResponse, D> for &ServerIsServingResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerIsServingResponse>(offset);
fidl::encoding::Encode::<ServerIsServingResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<ServerIsServingResponse, 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::<ServerIsServingResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ServerIsServingResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { enabled: 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.enabled, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ServerSetOptionRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ServerSetOptionRequest {
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<ServerSetOptionRequest, D> for &ServerSetOptionRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerSetOptionRequest>(offset);
fidl::encoding::Encode::<ServerSetOptionRequest, D>::encode(
(<Option_ as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Option_, D>>
fidl::encoding::Encode<ServerSetOptionRequest, 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::<ServerSetOptionRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ServerSetOptionRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Option_, 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!(Option_, D, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ServerSetParameterRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ServerSetParameterRequest {
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<ServerSetParameterRequest, D> for &ServerSetParameterRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerSetParameterRequest>(offset);
fidl::encoding::Encode::<ServerSetParameterRequest, D>::encode(
(<Parameter as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Parameter, D>>
fidl::encoding::Encode<ServerSetParameterRequest, 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::<ServerSetParameterRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ServerSetParameterRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Parameter, 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!(Parameter, D, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ServerGetOptionResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ServerGetOptionResponse {
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<ServerGetOptionResponse, D> for &ServerGetOptionResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerGetOptionResponse>(offset);
fidl::encoding::Encode::<ServerGetOptionResponse, D>::encode(
(<Option_ as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Option_, D>>
fidl::encoding::Encode<ServerGetOptionResponse, 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::<ServerGetOptionResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ServerGetOptionResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Option_, 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!(Option_, D, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ServerGetParameterResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ServerGetParameterResponse {
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<ServerGetParameterResponse, D> for &ServerGetParameterResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerGetParameterResponse>(offset);
fidl::encoding::Encode::<ServerGetParameterResponse, D>::encode(
(<Parameter as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Parameter, D>>
fidl::encoding::Encode<ServerGetParameterResponse, 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::<ServerGetParameterResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ServerGetParameterResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { value: fidl::new_empty!(Parameter, 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!(Parameter, D, &mut self.value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ServerListOptionsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ServerListOptionsResponse {
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<ServerListOptionsResponse, D> for &ServerListOptionsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerListOptionsResponse>(offset);
fidl::encoding::Encode::<ServerListOptionsResponse, D>::encode(
(
<fidl::encoding::Vector<Option_, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<Option_, 256>, D>,
> fidl::encoding::Encode<ServerListOptionsResponse, 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::<ServerListOptionsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ServerListOptionsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { options: fidl::new_empty!(fidl::encoding::Vector<Option_, 256>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<Option_, 256>, D, &mut self.options, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ServerListParametersResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ServerListParametersResponse {
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<ServerListParametersResponse, D> for &ServerListParametersResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ServerListParametersResponse>(offset);
fidl::encoding::Encode::<ServerListParametersResponse, D>::encode(
(
<fidl::encoding::Vector<Parameter, 256> as fidl::encoding::ValueTypeMarker>::borrow(&self.parameters),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<Parameter, 256>, D>,
> fidl::encoding::Encode<ServerListParametersResponse, 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::<ServerListParametersResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ServerListParametersResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { parameters: fidl::new_empty!(fidl::encoding::Vector<Parameter, 256>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<Parameter, 256>, D, &mut self.parameters, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl Address {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.address_state_provider {
return 3;
}
if let Some(_) = self.address_parameters {
return 2;
}
if let Some(_) = self.address {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for Address {
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 Address {
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<Address, fidl::encoding::DefaultFuchsiaResourceDialect>
for &mut Address
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Address>(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::Ipv4AddressWithPrefix, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.address.as_ref().map(<fidl_fuchsia_net::Ipv4AddressWithPrefix 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::<fidl_fuchsia_net_interfaces_admin::AddressParameters, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.address_parameters.as_ref().map(<fidl_fuchsia_net_interfaces_admin::AddressParameters 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::<
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<
fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.address_state_provider.as_mut().map(
<fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<
fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Address {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_net::Ipv4AddressWithPrefix 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.address.get_or_insert_with(|| {
fidl::new_empty!(
fidl_fuchsia_net::Ipv4AddressWithPrefix,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl_fuchsia_net::Ipv4AddressWithPrefix,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_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 = <fidl_fuchsia_net_interfaces_admin::AddressParameters 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.address_parameters.get_or_insert_with(|| {
fidl::new_empty!(
fidl_fuchsia_net_interfaces_admin::AddressParameters,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl_fuchsia_net_interfaces_admin::AddressParameters,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_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 = <fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<
fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
>,
> 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.address_state_provider.get_or_insert_with(|| {
fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<
fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
)
});
fidl::decode!(
fidl::encoding::Endpoint<
fidl::endpoints::ServerEnd<
fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl AddressPool {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.range_stop {
return 3;
}
if let Some(_) = self.range_start {
return 2;
}
if let Some(_) = self.prefix_length {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for AddressPool {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddressPool {
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<AddressPool, D>
for &AddressPool
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddressPool>(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::<u8, D>(
self.prefix_length.as_ref().map(<u8 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::<fidl_fuchsia_net::Ipv4Address, D>(
self.range_start.as_ref().map(
<fidl_fuchsia_net::Ipv4Address 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::<fidl_fuchsia_net::Ipv4Address, D>(
self.range_stop.as_ref().map(
<fidl_fuchsia_net::Ipv4Address 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 AddressPool {
#[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 =
<u8 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.prefix_length.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, 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 =
<fidl_fuchsia_net::Ipv4Address 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
.range_start
.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::Ipv4Address, D));
fidl::decode!(
fidl_fuchsia_net::Ipv4Address,
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 =
<fidl_fuchsia_net::Ipv4Address 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
.range_stop
.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::Ipv4Address, D));
fidl::decode!(
fidl_fuchsia_net::Ipv4Address,
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 ClientWatchConfigurationResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.routers {
return 3;
}
if let Some(_) = self.dns_servers {
return 2;
}
if let Some(_) = self.address {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for ClientWatchConfigurationResponse {
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 ClientWatchConfigurationResponse {
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<
ClientWatchConfigurationResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ClientWatchConfigurationResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ClientWatchConfigurationResponse>(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::<
Address,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.address
.as_mut()
.map(<Address as fidl::encoding::ResourceTypeMarker>::take_or_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::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.dns_servers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> 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::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
self.routers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ClientWatchConfigurationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Address 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.address.get_or_insert_with(|| {
fidl::new_empty!(Address, fidl::encoding::DefaultFuchsiaResourceDialect)
});
fidl::decode!(
Address,
fidl::encoding::DefaultFuchsiaResourceDialect,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_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 = <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> 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.dns_servers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_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 = <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> 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.routers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl ConfigurationToRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.dns_servers {
return 2;
}
if let Some(_) = self.routers {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ConfigurationToRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ConfigurationToRequest {
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<ConfigurationToRequest, D> for &ConfigurationToRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ConfigurationToRequest>(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.routers.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.dns_servers.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 ConfigurationToRequest
{
#[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.routers.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.dns_servers.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 LeaseLength {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.max {
return 2;
}
if let Some(_) = self.default {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for LeaseLength {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for LeaseLength {
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<LeaseLength, D>
for &LeaseLength
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<LeaseLength>(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::<u32, D>(
self.default.as_ref().map(<u32 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.max.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 LeaseLength {
#[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 =
<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.default.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;
_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.max.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 NewClientParams {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.request_ip_address {
return 2;
}
if let Some(_) = self.configuration_to_request {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for NewClientParams {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for NewClientParams {
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<NewClientParams, D>
for &NewClientParams
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<NewClientParams>(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::<ConfigurationToRequest, D>(
self.configuration_to_request
.as_ref()
.map(<ConfigurationToRequest 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.request_ip_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 NewClientParams {
#[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 =
<ConfigurationToRequest 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
.configuration_to_request
.get_or_insert_with(|| fidl::new_empty!(ConfigurationToRequest, D));
fidl::decode!(
ConfigurationToRequest,
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.request_ip_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(())
}
}
impl StaticAssignment {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.assigned_addr {
return 2;
}
if let Some(_) = self.host {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for StaticAssignment {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StaticAssignment {
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<StaticAssignment, D>
for &StaticAssignment
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StaticAssignment>(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::MacAddress, D>(
self.host
.as_ref()
.map(<fidl_fuchsia_net::MacAddress 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::<fidl_fuchsia_net::Ipv4Address, D>(
self.assigned_addr.as_ref().map(
<fidl_fuchsia_net::Ipv4Address 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 StaticAssignment {
#[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::MacAddress 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
.host
.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::MacAddress, D));
fidl::decode!(
fidl_fuchsia_net::MacAddress,
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 =
<fidl_fuchsia_net::Ipv4Address 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
.assigned_addr
.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_net::Ipv4Address, D));
fidl::decode!(
fidl_fuchsia_net::Ipv4Address,
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 fidl::encoding::ValueTypeMarker for Option_ {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Option_ {
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<Option_, D> for &Option_ {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Option_>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Option_::SubnetMask(ref val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_net::Ipv4Address, D>(
<fidl_fuchsia_net::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::TimeOffset(ref val) => {
fidl::encoding::encode_in_envelope::<i32, D>(
<i32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::Router(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::TimeServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NameServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::DomainNameServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::LogServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::CookieServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::LprServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::ImpressServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::ResourceLocationServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::HostName(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::BootFileSize(ref val) => {
fidl::encoding::encode_in_envelope::<u16, D>(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::MeritDumpFile(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::DomainName(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::SwapServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_net::Ipv4Address, D>(
<fidl_fuchsia_net::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::RootPath(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::ExtensionsPath(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::IpForwarding(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NonLocalSourceRouting(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::PolicyFilter(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::MaxDatagramReassemblySize(ref val) => {
fidl::encoding::encode_in_envelope::<u16, D>(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::DefaultIpTtl(ref val) => {
fidl::encoding::encode_in_envelope::<u8, D>(
<u8 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::PathMtuAgingTimeout(ref val) => {
fidl::encoding::encode_in_envelope::<u32, D>(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::PathMtuPlateauTable(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<u16, 127>, D>(
<fidl::encoding::Vector<u16, 127> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::InterfaceMtu(ref val) => {
fidl::encoding::encode_in_envelope::<u16, D>(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::AllSubnetsLocal(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::BroadcastAddress(ref val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_net::Ipv4Address, D>(
<fidl_fuchsia_net::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::PerformMaskDiscovery(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::MaskSupplier(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::PerformRouterDiscovery(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::RouterSolicitationAddress(ref val) => {
fidl::encoding::encode_in_envelope::<fidl_fuchsia_net::Ipv4Address, D>(
<fidl_fuchsia_net::Ipv4Address as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::StaticRoute(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::TrailerEncapsulation(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::ArpCacheTimeout(ref val) => {
fidl::encoding::encode_in_envelope::<u32, D>(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::EthernetEncapsulation(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::TcpDefaultTtl(ref val) => {
fidl::encoding::encode_in_envelope::<u8, D>(
<u8 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::TcpKeepaliveInterval(ref val) => {
fidl::encoding::encode_in_envelope::<u32, D>(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::TcpKeepaliveGarbage(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NetworkInformationServiceDomain(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NetworkInformationServers(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NetworkTimeProtocolServers(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::VendorSpecificInformation(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<u8, 255>, D>(
<fidl::encoding::Vector<u8, 255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NetbiosOverTcpipNameServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NetbiosOverTcpipDatagramDistributionServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NetbiosOverTcpipNodeType(ref val) => {
fidl::encoding::encode_in_envelope::<NodeTypes, D>(
<NodeTypes as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NetbiosOverTcpipScope(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::XWindowSystemFontServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::XWindowSystemDisplayManager(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NetworkInformationServicePlusDomain(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NetworkInformationServicePlusServers(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::MobileIpHomeAgent(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::SmtpServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::Pop3Server(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::NntpServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::DefaultWwwServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::DefaultFingerServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::DefaultIrcServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::StreettalkServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::StreettalkDirectoryAssistanceServer(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::OptionOverload(ref val) => {
fidl::encoding::encode_in_envelope::<OptionOverloadValue, D>(
<OptionOverloadValue as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::TftpServerName(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::BootfileName(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<255>, D>(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::MaxDhcpMessageSize(ref val) => {
fidl::encoding::encode_in_envelope::<u16, D>(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::RenewalTimeValue(ref val) => {
fidl::encoding::encode_in_envelope::<u32, D>(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::RebindingTimeValue(ref val) => {
fidl::encoding::encode_in_envelope::<u32, D>(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Option_::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Option_ {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl_fuchsia_net::Ipv4Address as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
8 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
9 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13 => <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
16 => <fidl_fuchsia_net::Ipv4Address as fidl::encoding::TypeMarker>::inline_size(decoder.context),
17 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
18 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
20 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
21 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22 => <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23 => <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25 => <fidl::encoding::Vector<u16, 127> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
26 => <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
27 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
28 => <fidl_fuchsia_net::Ipv4Address as fidl::encoding::TypeMarker>::inline_size(decoder.context),
29 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
30 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
31 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
32 => <fidl_fuchsia_net::Ipv4Address as fidl::encoding::TypeMarker>::inline_size(decoder.context),
33 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
34 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
35 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
36 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
37 => <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
38 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
39 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
40 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
41 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
42 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
43 => <fidl::encoding::Vector<u8, 255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
44 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
45 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
46 => <NodeTypes as fidl::encoding::TypeMarker>::inline_size(decoder.context),
47 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
48 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
49 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
50 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
51 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
52 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
53 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
54 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
55 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
56 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
57 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
58 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
59 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
60 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
61 => <OptionOverloadValue as fidl::encoding::TypeMarker>::inline_size(decoder.context),
62 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
63 => <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
64 => <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
65 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
66 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let Option_::SubnetMask(_) = self {
} else {
*self =
Option_::SubnetMask(fidl::new_empty!(fidl_fuchsia_net::Ipv4Address, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::SubnetMask(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_net::Ipv4Address,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Option_::TimeOffset(_) = self {
} else {
*self = Option_::TimeOffset(fidl::new_empty!(i32, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::TimeOffset(ref mut val) = self {
fidl::decode!(i32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Option_::Router(_) = self {
} else {
*self = Option_::Router(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::Router(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Option_::TimeServer(_) = self {
} else {
*self = Option_::TimeServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::TimeServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NameServer(_) = self {
} else {
*self = Option_::NameServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::NameServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
6 => {
#[allow(irrefutable_let_patterns)]
if let Option_::DomainNameServer(_) = self {
} else {
*self = Option_::DomainNameServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::DomainNameServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
7 => {
#[allow(irrefutable_let_patterns)]
if let Option_::LogServer(_) = self {
} else {
*self = Option_::LogServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::LogServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
8 => {
#[allow(irrefutable_let_patterns)]
if let Option_::CookieServer(_) = self {
} else {
*self = Option_::CookieServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::CookieServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
9 => {
#[allow(irrefutable_let_patterns)]
if let Option_::LprServer(_) = self {
} else {
*self = Option_::LprServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::LprServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
10 => {
#[allow(irrefutable_let_patterns)]
if let Option_::ImpressServer(_) = self {
} else {
*self = Option_::ImpressServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::ImpressServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
11 => {
#[allow(irrefutable_let_patterns)]
if let Option_::ResourceLocationServer(_) = self {
} else {
*self = Option_::ResourceLocationServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::ResourceLocationServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
12 => {
#[allow(irrefutable_let_patterns)]
if let Option_::HostName(_) = self {
} else {
*self = Option_::HostName(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::HostName(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
13 => {
#[allow(irrefutable_let_patterns)]
if let Option_::BootFileSize(_) = self {
} else {
*self = Option_::BootFileSize(fidl::new_empty!(u16, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::BootFileSize(ref mut val) = self {
fidl::decode!(u16, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
14 => {
#[allow(irrefutable_let_patterns)]
if let Option_::MeritDumpFile(_) = self {
} else {
*self = Option_::MeritDumpFile(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::MeritDumpFile(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
15 => {
#[allow(irrefutable_let_patterns)]
if let Option_::DomainName(_) = self {
} else {
*self = Option_::DomainName(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::DomainName(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
16 => {
#[allow(irrefutable_let_patterns)]
if let Option_::SwapServer(_) = self {
} else {
*self =
Option_::SwapServer(fidl::new_empty!(fidl_fuchsia_net::Ipv4Address, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::SwapServer(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_net::Ipv4Address,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
17 => {
#[allow(irrefutable_let_patterns)]
if let Option_::RootPath(_) = self {
} else {
*self = Option_::RootPath(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::RootPath(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
18 => {
#[allow(irrefutable_let_patterns)]
if let Option_::ExtensionsPath(_) = self {
} else {
*self = Option_::ExtensionsPath(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::ExtensionsPath(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
19 => {
#[allow(irrefutable_let_patterns)]
if let Option_::IpForwarding(_) = self {
} else {
*self = Option_::IpForwarding(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::IpForwarding(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
20 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NonLocalSourceRouting(_) = self {
} else {
*self = Option_::NonLocalSourceRouting(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::NonLocalSourceRouting(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
21 => {
#[allow(irrefutable_let_patterns)]
if let Option_::PolicyFilter(_) = self {
} else {
*self = Option_::PolicyFilter(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::PolicyFilter(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
22 => {
#[allow(irrefutable_let_patterns)]
if let Option_::MaxDatagramReassemblySize(_) = self {
} else {
*self = Option_::MaxDatagramReassemblySize(fidl::new_empty!(u16, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::MaxDatagramReassemblySize(ref mut val) = self {
fidl::decode!(u16, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
23 => {
#[allow(irrefutable_let_patterns)]
if let Option_::DefaultIpTtl(_) = self {
} else {
*self = Option_::DefaultIpTtl(fidl::new_empty!(u8, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::DefaultIpTtl(ref mut val) = self {
fidl::decode!(u8, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
24 => {
#[allow(irrefutable_let_patterns)]
if let Option_::PathMtuAgingTimeout(_) = self {
} else {
*self = Option_::PathMtuAgingTimeout(fidl::new_empty!(u32, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::PathMtuAgingTimeout(ref mut val) = self {
fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
25 => {
#[allow(irrefutable_let_patterns)]
if let Option_::PathMtuPlateauTable(_) = self {
} else {
*self = Option_::PathMtuPlateauTable(
fidl::new_empty!(fidl::encoding::Vector<u16, 127>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::PathMtuPlateauTable(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<u16, 127>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
26 => {
#[allow(irrefutable_let_patterns)]
if let Option_::InterfaceMtu(_) = self {
} else {
*self = Option_::InterfaceMtu(fidl::new_empty!(u16, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::InterfaceMtu(ref mut val) = self {
fidl::decode!(u16, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
27 => {
#[allow(irrefutable_let_patterns)]
if let Option_::AllSubnetsLocal(_) = self {
} else {
*self = Option_::AllSubnetsLocal(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::AllSubnetsLocal(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
28 => {
#[allow(irrefutable_let_patterns)]
if let Option_::BroadcastAddress(_) = self {
} else {
*self = Option_::BroadcastAddress(fidl::new_empty!(
fidl_fuchsia_net::Ipv4Address,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::BroadcastAddress(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_net::Ipv4Address,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
29 => {
#[allow(irrefutable_let_patterns)]
if let Option_::PerformMaskDiscovery(_) = self {
} else {
*self = Option_::PerformMaskDiscovery(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::PerformMaskDiscovery(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
30 => {
#[allow(irrefutable_let_patterns)]
if let Option_::MaskSupplier(_) = self {
} else {
*self = Option_::MaskSupplier(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::MaskSupplier(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
31 => {
#[allow(irrefutable_let_patterns)]
if let Option_::PerformRouterDiscovery(_) = self {
} else {
*self = Option_::PerformRouterDiscovery(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::PerformRouterDiscovery(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
32 => {
#[allow(irrefutable_let_patterns)]
if let Option_::RouterSolicitationAddress(_) = self {
} else {
*self = Option_::RouterSolicitationAddress(fidl::new_empty!(
fidl_fuchsia_net::Ipv4Address,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::RouterSolicitationAddress(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_net::Ipv4Address,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
33 => {
#[allow(irrefutable_let_patterns)]
if let Option_::StaticRoute(_) = self {
} else {
*self = Option_::StaticRoute(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::StaticRoute(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
34 => {
#[allow(irrefutable_let_patterns)]
if let Option_::TrailerEncapsulation(_) = self {
} else {
*self = Option_::TrailerEncapsulation(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::TrailerEncapsulation(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
35 => {
#[allow(irrefutable_let_patterns)]
if let Option_::ArpCacheTimeout(_) = self {
} else {
*self = Option_::ArpCacheTimeout(fidl::new_empty!(u32, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::ArpCacheTimeout(ref mut val) = self {
fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
36 => {
#[allow(irrefutable_let_patterns)]
if let Option_::EthernetEncapsulation(_) = self {
} else {
*self = Option_::EthernetEncapsulation(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::EthernetEncapsulation(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
37 => {
#[allow(irrefutable_let_patterns)]
if let Option_::TcpDefaultTtl(_) = self {
} else {
*self = Option_::TcpDefaultTtl(fidl::new_empty!(u8, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::TcpDefaultTtl(ref mut val) = self {
fidl::decode!(u8, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
38 => {
#[allow(irrefutable_let_patterns)]
if let Option_::TcpKeepaliveInterval(_) = self {
} else {
*self = Option_::TcpKeepaliveInterval(fidl::new_empty!(u32, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::TcpKeepaliveInterval(ref mut val) = self {
fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
39 => {
#[allow(irrefutable_let_patterns)]
if let Option_::TcpKeepaliveGarbage(_) = self {
} else {
*self = Option_::TcpKeepaliveGarbage(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::TcpKeepaliveGarbage(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
40 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkInformationServiceDomain(_) = self {
} else {
*self = Option_::NetworkInformationServiceDomain(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkInformationServiceDomain(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
41 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkInformationServers(_) = self {
} else {
*self = Option_::NetworkInformationServers(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkInformationServers(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
42 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkTimeProtocolServers(_) = self {
} else {
*self = Option_::NetworkTimeProtocolServers(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkTimeProtocolServers(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
43 => {
#[allow(irrefutable_let_patterns)]
if let Option_::VendorSpecificInformation(_) = self {
} else {
*self = Option_::VendorSpecificInformation(
fidl::new_empty!(fidl::encoding::Vector<u8, 255>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::VendorSpecificInformation(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<u8, 255>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
44 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NetbiosOverTcpipNameServer(_) = self {
} else {
*self = Option_::NetbiosOverTcpipNameServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::NetbiosOverTcpipNameServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
45 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NetbiosOverTcpipDatagramDistributionServer(_) = self {
} else {
*self = Option_::NetbiosOverTcpipDatagramDistributionServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::NetbiosOverTcpipDatagramDistributionServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
46 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NetbiosOverTcpipNodeType(_) = self {
} else {
*self = Option_::NetbiosOverTcpipNodeType(fidl::new_empty!(NodeTypes, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::NetbiosOverTcpipNodeType(ref mut val) = self {
fidl::decode!(NodeTypes, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
47 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NetbiosOverTcpipScope(_) = self {
} else {
*self = Option_::NetbiosOverTcpipScope(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::NetbiosOverTcpipScope(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
48 => {
#[allow(irrefutable_let_patterns)]
if let Option_::XWindowSystemFontServer(_) = self {
} else {
*self = Option_::XWindowSystemFontServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::XWindowSystemFontServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
49 => {
#[allow(irrefutable_let_patterns)]
if let Option_::XWindowSystemDisplayManager(_) = self {
} else {
*self = Option_::XWindowSystemDisplayManager(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::XWindowSystemDisplayManager(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
50 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkInformationServicePlusDomain(_) = self {
} else {
*self = Option_::NetworkInformationServicePlusDomain(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkInformationServicePlusDomain(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
51 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkInformationServicePlusServers(_) = self {
} else {
*self = Option_::NetworkInformationServicePlusServers(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::NetworkInformationServicePlusServers(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
52 => {
#[allow(irrefutable_let_patterns)]
if let Option_::MobileIpHomeAgent(_) = self {
} else {
*self = Option_::MobileIpHomeAgent(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::MobileIpHomeAgent(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
53 => {
#[allow(irrefutable_let_patterns)]
if let Option_::SmtpServer(_) = self {
} else {
*self = Option_::SmtpServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::SmtpServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
54 => {
#[allow(irrefutable_let_patterns)]
if let Option_::Pop3Server(_) = self {
} else {
*self = Option_::Pop3Server(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::Pop3Server(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
55 => {
#[allow(irrefutable_let_patterns)]
if let Option_::NntpServer(_) = self {
} else {
*self = Option_::NntpServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::NntpServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
56 => {
#[allow(irrefutable_let_patterns)]
if let Option_::DefaultWwwServer(_) = self {
} else {
*self = Option_::DefaultWwwServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::DefaultWwwServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
57 => {
#[allow(irrefutable_let_patterns)]
if let Option_::DefaultFingerServer(_) = self {
} else {
*self = Option_::DefaultFingerServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::DefaultFingerServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
58 => {
#[allow(irrefutable_let_patterns)]
if let Option_::DefaultIrcServer(_) = self {
} else {
*self = Option_::DefaultIrcServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::DefaultIrcServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
59 => {
#[allow(irrefutable_let_patterns)]
if let Option_::StreettalkServer(_) = self {
} else {
*self = Option_::StreettalkServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::StreettalkServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
60 => {
#[allow(irrefutable_let_patterns)]
if let Option_::StreettalkDirectoryAssistanceServer(_) = self {
} else {
*self = Option_::StreettalkDirectoryAssistanceServer(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Option_::StreettalkDirectoryAssistanceServer(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 63>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
61 => {
#[allow(irrefutable_let_patterns)]
if let Option_::OptionOverload(_) = self {
} else {
*self = Option_::OptionOverload(fidl::new_empty!(OptionOverloadValue, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::OptionOverload(ref mut val) = self {
fidl::decode!(OptionOverloadValue, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
62 => {
#[allow(irrefutable_let_patterns)]
if let Option_::TftpServerName(_) = self {
} else {
*self = Option_::TftpServerName(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::TftpServerName(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
63 => {
#[allow(irrefutable_let_patterns)]
if let Option_::BootfileName(_) = self {
} else {
*self = Option_::BootfileName(fidl::new_empty!(
fidl::encoding::BoundedString<255>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Option_::BootfileName(ref mut val) = self {
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
64 => {
#[allow(irrefutable_let_patterns)]
if let Option_::MaxDhcpMessageSize(_) = self {
} else {
*self = Option_::MaxDhcpMessageSize(fidl::new_empty!(u16, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::MaxDhcpMessageSize(ref mut val) = self {
fidl::decode!(u16, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
65 => {
#[allow(irrefutable_let_patterns)]
if let Option_::RenewalTimeValue(_) = self {
} else {
*self = Option_::RenewalTimeValue(fidl::new_empty!(u32, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::RenewalTimeValue(ref mut val) = self {
fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
66 => {
#[allow(irrefutable_let_patterns)]
if let Option_::RebindingTimeValue(_) = self {
} else {
*self = Option_::RebindingTimeValue(fidl::new_empty!(u32, D));
}
#[allow(irrefutable_let_patterns)]
if let Option_::RebindingTimeValue(ref mut val) = self {
fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Option_::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Parameter {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Parameter {
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<Parameter, D>
for &Parameter
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Parameter>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Parameter::IpAddrs(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 256>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 256> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Parameter::AddressPool(ref val) => {
fidl::encoding::encode_in_envelope::<AddressPool, D>(
<AddressPool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Parameter::Lease(ref val) => {
fidl::encoding::encode_in_envelope::<LeaseLength, D>(
<LeaseLength as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Parameter::PermittedMacs(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl_fuchsia_net::MacAddress, 256>, D>(
<fidl::encoding::Vector<fidl_fuchsia_net::MacAddress, 256> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Parameter::StaticallyAssignedAddrs(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<StaticAssignment, 256>, D>(
<fidl::encoding::Vector<StaticAssignment, 256> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Parameter::ArpProbe(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Parameter::BoundDeviceNames(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl::encoding::BoundedString<256>, 256>, D>(
<fidl::encoding::Vector<fidl::encoding::BoundedString<256>, 256> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
Parameter::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Parameter {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 256> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <AddressPool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
3 => <LeaseLength as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4 => <fidl::encoding::Vector<fidl_fuchsia_net::MacAddress, 256> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
5 => <fidl::encoding::Vector<StaticAssignment, 256> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
7 => <fidl::encoding::Vector<fidl::encoding::BoundedString<256>, 256> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let Parameter::IpAddrs(_) = self {
} else {
*self = Parameter::IpAddrs(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 256>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Parameter::IpAddrs(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 256>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Parameter::AddressPool(_) = self {
} else {
*self = Parameter::AddressPool(fidl::new_empty!(AddressPool, D));
}
#[allow(irrefutable_let_patterns)]
if let Parameter::AddressPool(ref mut val) = self {
fidl::decode!(AddressPool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
3 => {
#[allow(irrefutable_let_patterns)]
if let Parameter::Lease(_) = self {
} else {
*self = Parameter::Lease(fidl::new_empty!(LeaseLength, D));
}
#[allow(irrefutable_let_patterns)]
if let Parameter::Lease(ref mut val) = self {
fidl::decode!(LeaseLength, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
4 => {
#[allow(irrefutable_let_patterns)]
if let Parameter::PermittedMacs(_) = self {
} else {
*self = Parameter::PermittedMacs(
fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::MacAddress, 256>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Parameter::PermittedMacs(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::MacAddress, 256>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
5 => {
#[allow(irrefutable_let_patterns)]
if let Parameter::StaticallyAssignedAddrs(_) = self {
} else {
*self = Parameter::StaticallyAssignedAddrs(
fidl::new_empty!(fidl::encoding::Vector<StaticAssignment, 256>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let Parameter::StaticallyAssignedAddrs(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<StaticAssignment, 256>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
6 => {
#[allow(irrefutable_let_patterns)]
if let Parameter::ArpProbe(_) = self {
} else {
*self = Parameter::ArpProbe(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let Parameter::ArpProbe(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
7 => {
#[allow(irrefutable_let_patterns)]
if let Parameter::BoundDeviceNames(_) = self {
} else {
*self = Parameter::BoundDeviceNames(fidl::new_empty!(
fidl::encoding::Vector<fidl::encoding::BoundedString<256>, 256>,
D
));
}
#[allow(irrefutable_let_patterns)]
if let Parameter::BoundDeviceNames(ref mut val) = self {
fidl::decode!(
fidl::encoding::Vector<fidl::encoding::BoundedString<256>, 256>,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Parameter::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
}