#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const MAX_UDP_POLL_LENGTH: u16 = 1024;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum Error {
Internal = 1,
HermeticNetworkRealmNotRunning = 2,
InterfaceNotFound = 3,
StubNotRunning = 4,
InvalidArguments = 5,
ComponentNotFound = 6,
TimeoutExceeded = 7,
PingFailed = 8,
AddressNotAvailable = 9,
AddressInUse = 10,
AlreadyExists = 11,
AddressUnreachable = 12,
Dhcpv6ClientNotRunning = 13,
Dhcpv4ClientNotRunning = 14,
Dhcpv4ClientShutdownFailed = 15,
}
impl Error {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Internal),
2 => Some(Self::HermeticNetworkRealmNotRunning),
3 => Some(Self::InterfaceNotFound),
4 => Some(Self::StubNotRunning),
5 => Some(Self::InvalidArguments),
6 => Some(Self::ComponentNotFound),
7 => Some(Self::TimeoutExceeded),
8 => Some(Self::PingFailed),
9 => Some(Self::AddressNotAvailable),
10 => Some(Self::AddressInUse),
11 => Some(Self::AlreadyExists),
12 => Some(Self::AddressUnreachable),
13 => Some(Self::Dhcpv6ClientNotRunning),
14 => Some(Self::Dhcpv4ClientNotRunning),
15 => Some(Self::Dhcpv4ClientShutdownFailed),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum Netstack {
V2 = 1,
V3 = 2,
}
impl Netstack {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::V2),
2 => Some(Self::V3),
_ => 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, Debug, PartialEq)]
pub struct ControllerAddInterfaceRequest {
pub mac_address: fidl_fuchsia_net::MacAddress,
pub name: String,
pub wait_any_ip_address: bool,
}
impl fidl::Persistable for ControllerAddInterfaceRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerJoinMulticastGroupRequest {
pub address: fidl_fuchsia_net::IpAddress,
pub interface_id: u64,
}
impl fidl::Persistable for ControllerJoinMulticastGroupRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerLeaveMulticastGroupRequest {
pub address: fidl_fuchsia_net::IpAddress,
pub interface_id: u64,
}
impl fidl::Persistable for ControllerLeaveMulticastGroupRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerPingRequest {
pub target: fidl_fuchsia_net::IpAddress,
pub payload_length: u16,
pub interface_name: Option<String>,
pub timeout: i64,
}
impl fidl::Persistable for ControllerPingRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerPollUdpRequest {
pub target: fidl_fuchsia_net::SocketAddress,
pub payload: Vec<u8>,
pub timeout: i64,
pub num_retries: u16,
}
impl fidl::Persistable for ControllerPollUdpRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerStartDhcpv6ClientRequest {
pub params: fidl_fuchsia_net_dhcpv6::NewClientParams,
}
impl fidl::Persistable for ControllerStartDhcpv6ClientRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerStartHermeticNetworkRealmRequest {
pub netstack: Netstack,
}
impl fidl::Persistable for ControllerStartHermeticNetworkRealmRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerStartStubRequest {
pub component_url: String,
}
impl fidl::Persistable for ControllerStartStubRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerPollUdpResponse {
pub payload: Vec<u8>,
}
impl fidl::Persistable for ControllerPollUdpResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ControllerStartOutOfStackDhcpv4ClientRequest {
pub interface_id: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ControllerStartOutOfStackDhcpv4ClientRequest {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ControllerStopOutOfStackDhcpv4ClientRequest {
pub interface_id: Option<u64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ControllerStopOutOfStackDhcpv4ClientRequest {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ControllerMarker;
impl fidl::endpoints::ProtocolMarker for ControllerMarker {
type Proxy = ControllerProxy;
type RequestStream = ControllerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ControllerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.net.test.realm.Controller";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ControllerMarker {}
pub type ControllerStartHermeticNetworkRealmResult = Result<(), Error>;
pub type ControllerStopHermeticNetworkRealmResult = Result<(), Error>;
pub type ControllerAddInterfaceResult = Result<(), Error>;
pub type ControllerStartStubResult = Result<(), Error>;
pub type ControllerStopStubResult = Result<(), Error>;
pub type ControllerPingResult = Result<(), Error>;
pub type ControllerPollUdpResult = Result<Vec<u8>, Error>;
pub type ControllerJoinMulticastGroupResult = Result<(), Error>;
pub type ControllerLeaveMulticastGroupResult = Result<(), Error>;
pub type ControllerStartDhcpv6ClientResult = Result<(), Error>;
pub type ControllerStopDhcpv6ClientResult = Result<(), Error>;
pub type ControllerStartOutOfStackDhcpv4ClientResult = Result<(), Error>;
pub type ControllerStopOutOfStackDhcpv4ClientResult = Result<(), Error>;
pub trait ControllerProxyInterface: Send + Sync {
type StartHermeticNetworkRealmResponseFut: std::future::Future<Output = Result<ControllerStartHermeticNetworkRealmResult, fidl::Error>>
+ Send;
fn r#start_hermetic_network_realm(
&self,
netstack: Netstack,
) -> Self::StartHermeticNetworkRealmResponseFut;
type StopHermeticNetworkRealmResponseFut: std::future::Future<Output = Result<ControllerStopHermeticNetworkRealmResult, fidl::Error>>
+ Send;
fn r#stop_hermetic_network_realm(&self) -> Self::StopHermeticNetworkRealmResponseFut;
type AddInterfaceResponseFut: std::future::Future<Output = Result<ControllerAddInterfaceResult, fidl::Error>>
+ Send;
fn r#add_interface(
&self,
mac_address: &fidl_fuchsia_net::MacAddress,
name: &str,
wait_any_ip_address: bool,
) -> Self::AddInterfaceResponseFut;
type StartStubResponseFut: std::future::Future<Output = Result<ControllerStartStubResult, fidl::Error>>
+ Send;
fn r#start_stub(&self, component_url: &str) -> Self::StartStubResponseFut;
type StopStubResponseFut: std::future::Future<Output = Result<ControllerStopStubResult, fidl::Error>>
+ Send;
fn r#stop_stub(&self) -> Self::StopStubResponseFut;
type PingResponseFut: std::future::Future<Output = Result<ControllerPingResult, fidl::Error>>
+ Send;
fn r#ping(
&self,
target: &fidl_fuchsia_net::IpAddress,
payload_length: u16,
interface_name: Option<&str>,
timeout: i64,
) -> Self::PingResponseFut;
type PollUdpResponseFut: std::future::Future<Output = Result<ControllerPollUdpResult, fidl::Error>>
+ Send;
fn r#poll_udp(
&self,
target: &fidl_fuchsia_net::SocketAddress,
payload: &[u8],
timeout: i64,
num_retries: u16,
) -> Self::PollUdpResponseFut;
type JoinMulticastGroupResponseFut: std::future::Future<Output = Result<ControllerJoinMulticastGroupResult, fidl::Error>>
+ Send;
fn r#join_multicast_group(
&self,
address: &fidl_fuchsia_net::IpAddress,
interface_id: u64,
) -> Self::JoinMulticastGroupResponseFut;
type LeaveMulticastGroupResponseFut: std::future::Future<Output = Result<ControllerLeaveMulticastGroupResult, fidl::Error>>
+ Send;
fn r#leave_multicast_group(
&self,
address: &fidl_fuchsia_net::IpAddress,
interface_id: u64,
) -> Self::LeaveMulticastGroupResponseFut;
type StartDhcpv6ClientResponseFut: std::future::Future<Output = Result<ControllerStartDhcpv6ClientResult, fidl::Error>>
+ Send;
fn r#start_dhcpv6_client(
&self,
params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
) -> Self::StartDhcpv6ClientResponseFut;
type StopDhcpv6ClientResponseFut: std::future::Future<Output = Result<ControllerStopDhcpv6ClientResult, fidl::Error>>
+ Send;
fn r#stop_dhcpv6_client(&self) -> Self::StopDhcpv6ClientResponseFut;
type StartOutOfStackDhcpv4ClientResponseFut: std::future::Future<
Output = Result<ControllerStartOutOfStackDhcpv4ClientResult, fidl::Error>,
> + Send;
fn r#start_out_of_stack_dhcpv4_client(
&self,
payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
) -> Self::StartOutOfStackDhcpv4ClientResponseFut;
type StopOutOfStackDhcpv4ClientResponseFut: std::future::Future<
Output = Result<ControllerStopOutOfStackDhcpv4ClientResult, fidl::Error>,
> + Send;
fn r#stop_out_of_stack_dhcpv4_client(
&self,
payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
) -> Self::StopOutOfStackDhcpv4ClientResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ControllerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
type Proxy = ControllerProxy;
type Protocol = ControllerMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl ControllerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<ControllerEvent, fidl::Error> {
ControllerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#start_hermetic_network_realm(
&self,
mut netstack: Netstack,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerStartHermeticNetworkRealmResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerStartHermeticNetworkRealmRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(netstack,),
0x58c1fa7335d4c5c2,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#stop_hermetic_network_realm(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerStopHermeticNetworkRealmResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(),
0x49d3c2501cd2f635,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#add_interface(
&self,
mut mac_address: &fidl_fuchsia_net::MacAddress,
mut name: &str,
mut wait_any_ip_address: bool,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerAddInterfaceResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerAddInterfaceRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(mac_address, name, wait_any_ip_address,),
0x668ded2d2b619c15,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#start_stub(
&self,
mut component_url: &str,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerStartStubResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerStartStubRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(component_url,),
0x6523a401f22bf664,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#stop_stub(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerStopStubResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(),
0x582c32b564ff4bb4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#ping(
&self,
mut target: &fidl_fuchsia_net::IpAddress,
mut payload_length: u16,
mut interface_name: Option<&str>,
mut timeout: i64,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerPingResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerPingRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(target, payload_length, interface_name, timeout,),
0x60c9b6cf952fa4d1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#poll_udp(
&self,
mut target: &fidl_fuchsia_net::SocketAddress,
mut payload: &[u8],
mut timeout: i64,
mut num_retries: u16,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerPollUdpResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerPollUdpRequest,
fidl::encoding::ResultType<ControllerPollUdpResponse, Error>,
>(
(target, payload, timeout, num_retries,),
0x333fb354db30f664,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.payload))
}
pub fn r#join_multicast_group(
&self,
mut address: &fidl_fuchsia_net::IpAddress,
mut interface_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerJoinMulticastGroupResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerJoinMulticastGroupRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(address, interface_id,),
0xbdbb4095640a3f4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#leave_multicast_group(
&self,
mut address: &fidl_fuchsia_net::IpAddress,
mut interface_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerLeaveMulticastGroupResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerLeaveMulticastGroupRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(address, interface_id,),
0x32ecf4e40124a29a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#start_dhcpv6_client(
&self,
mut params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerStartDhcpv6ClientResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerStartDhcpv6ClientRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(params,),
0x756c9b70864b7744,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#stop_dhcpv6_client(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerStopDhcpv6ClientResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
(),
0x16e93478e663d523,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#start_out_of_stack_dhcpv4_client(
&self,
mut payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerStartOutOfStackDhcpv4ClientResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerStartOutOfStackDhcpv4ClientRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
payload,
0x37eeec41c0077625,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#stop_out_of_stack_dhcpv4_client(
&self,
mut payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerStopOutOfStackDhcpv4ClientResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerStopOutOfStackDhcpv4ClientRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
>(
payload,
0x5d47aa5213164364,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct ControllerProxy {
client: fidl::client::Client,
}
impl fidl::endpoints::Proxy for ControllerProxy {
type Protocol = ControllerMarker;
fn from_channel(inner: fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl ControllerProxy {
pub fn new(channel: fidl::AsyncChannel) -> Self {
let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ControllerEventStream {
ControllerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#start_hermetic_network_realm(
&self,
mut netstack: Netstack,
) -> fidl::client::QueryResponseFut<ControllerStartHermeticNetworkRealmResult> {
ControllerProxyInterface::r#start_hermetic_network_realm(self, netstack)
}
pub fn r#stop_hermetic_network_realm(
&self,
) -> fidl::client::QueryResponseFut<ControllerStopHermeticNetworkRealmResult> {
ControllerProxyInterface::r#stop_hermetic_network_realm(self)
}
pub fn r#add_interface(
&self,
mut mac_address: &fidl_fuchsia_net::MacAddress,
mut name: &str,
mut wait_any_ip_address: bool,
) -> fidl::client::QueryResponseFut<ControllerAddInterfaceResult> {
ControllerProxyInterface::r#add_interface(self, mac_address, name, wait_any_ip_address)
}
pub fn r#start_stub(
&self,
mut component_url: &str,
) -> fidl::client::QueryResponseFut<ControllerStartStubResult> {
ControllerProxyInterface::r#start_stub(self, component_url)
}
pub fn r#stop_stub(&self) -> fidl::client::QueryResponseFut<ControllerStopStubResult> {
ControllerProxyInterface::r#stop_stub(self)
}
pub fn r#ping(
&self,
mut target: &fidl_fuchsia_net::IpAddress,
mut payload_length: u16,
mut interface_name: Option<&str>,
mut timeout: i64,
) -> fidl::client::QueryResponseFut<ControllerPingResult> {
ControllerProxyInterface::r#ping(self, target, payload_length, interface_name, timeout)
}
pub fn r#poll_udp(
&self,
mut target: &fidl_fuchsia_net::SocketAddress,
mut payload: &[u8],
mut timeout: i64,
mut num_retries: u16,
) -> fidl::client::QueryResponseFut<ControllerPollUdpResult> {
ControllerProxyInterface::r#poll_udp(self, target, payload, timeout, num_retries)
}
pub fn r#join_multicast_group(
&self,
mut address: &fidl_fuchsia_net::IpAddress,
mut interface_id: u64,
) -> fidl::client::QueryResponseFut<ControllerJoinMulticastGroupResult> {
ControllerProxyInterface::r#join_multicast_group(self, address, interface_id)
}
pub fn r#leave_multicast_group(
&self,
mut address: &fidl_fuchsia_net::IpAddress,
mut interface_id: u64,
) -> fidl::client::QueryResponseFut<ControllerLeaveMulticastGroupResult> {
ControllerProxyInterface::r#leave_multicast_group(self, address, interface_id)
}
pub fn r#start_dhcpv6_client(
&self,
mut params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
) -> fidl::client::QueryResponseFut<ControllerStartDhcpv6ClientResult> {
ControllerProxyInterface::r#start_dhcpv6_client(self, params)
}
pub fn r#stop_dhcpv6_client(
&self,
) -> fidl::client::QueryResponseFut<ControllerStopDhcpv6ClientResult> {
ControllerProxyInterface::r#stop_dhcpv6_client(self)
}
pub fn r#start_out_of_stack_dhcpv4_client(
&self,
mut payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
) -> fidl::client::QueryResponseFut<ControllerStartOutOfStackDhcpv4ClientResult> {
ControllerProxyInterface::r#start_out_of_stack_dhcpv4_client(self, payload)
}
pub fn r#stop_out_of_stack_dhcpv4_client(
&self,
mut payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
) -> fidl::client::QueryResponseFut<ControllerStopOutOfStackDhcpv4ClientResult> {
ControllerProxyInterface::r#stop_out_of_stack_dhcpv4_client(self, payload)
}
}
impl ControllerProxyInterface for ControllerProxy {
type StartHermeticNetworkRealmResponseFut =
fidl::client::QueryResponseFut<ControllerStartHermeticNetworkRealmResult>;
fn r#start_hermetic_network_realm(
&self,
mut netstack: Netstack,
) -> Self::StartHermeticNetworkRealmResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerStartHermeticNetworkRealmResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x58c1fa7335d4c5c2,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ControllerStartHermeticNetworkRealmRequest,
ControllerStartHermeticNetworkRealmResult,
>(
(netstack,),
0x58c1fa7335d4c5c2,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopHermeticNetworkRealmResponseFut =
fidl::client::QueryResponseFut<ControllerStopHermeticNetworkRealmResult>;
fn r#stop_hermetic_network_realm(&self) -> Self::StopHermeticNetworkRealmResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerStopHermeticNetworkRealmResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x49d3c2501cd2f635,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
ControllerStopHermeticNetworkRealmResult,
>(
(),
0x49d3c2501cd2f635,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type AddInterfaceResponseFut = fidl::client::QueryResponseFut<ControllerAddInterfaceResult>;
fn r#add_interface(
&self,
mut mac_address: &fidl_fuchsia_net::MacAddress,
mut name: &str,
mut wait_any_ip_address: bool,
) -> Self::AddInterfaceResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerAddInterfaceResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x668ded2d2b619c15,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<ControllerAddInterfaceRequest, ControllerAddInterfaceResult>(
(mac_address, name, wait_any_ip_address),
0x668ded2d2b619c15,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartStubResponseFut = fidl::client::QueryResponseFut<ControllerStartStubResult>;
fn r#start_stub(&self, mut component_url: &str) -> Self::StartStubResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerStartStubResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x6523a401f22bf664,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<ControllerStartStubRequest, ControllerStartStubResult>(
(component_url,),
0x6523a401f22bf664,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopStubResponseFut = fidl::client::QueryResponseFut<ControllerStopStubResult>;
fn r#stop_stub(&self) -> Self::StopStubResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerStopStubResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x582c32b564ff4bb4,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerStopStubResult>(
(),
0x582c32b564ff4bb4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type PingResponseFut = fidl::client::QueryResponseFut<ControllerPingResult>;
fn r#ping(
&self,
mut target: &fidl_fuchsia_net::IpAddress,
mut payload_length: u16,
mut interface_name: Option<&str>,
mut timeout: i64,
) -> Self::PingResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerPingResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x60c9b6cf952fa4d1,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<ControllerPingRequest, ControllerPingResult>(
(target, payload_length, interface_name, timeout),
0x60c9b6cf952fa4d1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type PollUdpResponseFut = fidl::client::QueryResponseFut<ControllerPollUdpResult>;
fn r#poll_udp(
&self,
mut target: &fidl_fuchsia_net::SocketAddress,
mut payload: &[u8],
mut timeout: i64,
mut num_retries: u16,
) -> Self::PollUdpResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerPollUdpResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ControllerPollUdpResponse, Error>,
0x333fb354db30f664,
>(_buf?)?;
Ok(_response.map(|x| x.payload))
}
self.client.send_query_and_decode::<ControllerPollUdpRequest, ControllerPollUdpResult>(
(target, payload, timeout, num_retries),
0x333fb354db30f664,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type JoinMulticastGroupResponseFut =
fidl::client::QueryResponseFut<ControllerJoinMulticastGroupResult>;
fn r#join_multicast_group(
&self,
mut address: &fidl_fuchsia_net::IpAddress,
mut interface_id: u64,
) -> Self::JoinMulticastGroupResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerJoinMulticastGroupResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0xbdbb4095640a3f4,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ControllerJoinMulticastGroupRequest,
ControllerJoinMulticastGroupResult,
>(
(address, interface_id,),
0xbdbb4095640a3f4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type LeaveMulticastGroupResponseFut =
fidl::client::QueryResponseFut<ControllerLeaveMulticastGroupResult>;
fn r#leave_multicast_group(
&self,
mut address: &fidl_fuchsia_net::IpAddress,
mut interface_id: u64,
) -> Self::LeaveMulticastGroupResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerLeaveMulticastGroupResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x32ecf4e40124a29a,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ControllerLeaveMulticastGroupRequest,
ControllerLeaveMulticastGroupResult,
>(
(address, interface_id,),
0x32ecf4e40124a29a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartDhcpv6ClientResponseFut =
fidl::client::QueryResponseFut<ControllerStartDhcpv6ClientResult>;
fn r#start_dhcpv6_client(
&self,
mut params: &fidl_fuchsia_net_dhcpv6::NewClientParams,
) -> Self::StartDhcpv6ClientResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerStartDhcpv6ClientResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x756c9b70864b7744,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ControllerStartDhcpv6ClientRequest,
ControllerStartDhcpv6ClientResult,
>(
(params,),
0x756c9b70864b7744,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopDhcpv6ClientResponseFut =
fidl::client::QueryResponseFut<ControllerStopDhcpv6ClientResult>;
fn r#stop_dhcpv6_client(&self) -> Self::StopDhcpv6ClientResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerStopDhcpv6ClientResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x16e93478e663d523,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
ControllerStopDhcpv6ClientResult,
>(
(),
0x16e93478e663d523,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartOutOfStackDhcpv4ClientResponseFut =
fidl::client::QueryResponseFut<ControllerStartOutOfStackDhcpv4ClientResult>;
fn r#start_out_of_stack_dhcpv4_client(
&self,
mut payload: &ControllerStartOutOfStackDhcpv4ClientRequest,
) -> Self::StartOutOfStackDhcpv4ClientResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerStartOutOfStackDhcpv4ClientResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x37eeec41c0077625,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ControllerStartOutOfStackDhcpv4ClientRequest,
ControllerStartOutOfStackDhcpv4ClientResult,
>(
payload,
0x37eeec41c0077625,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopOutOfStackDhcpv4ClientResponseFut =
fidl::client::QueryResponseFut<ControllerStopOutOfStackDhcpv4ClientResult>;
fn r#stop_out_of_stack_dhcpv4_client(
&self,
mut payload: &ControllerStopOutOfStackDhcpv4ClientRequest,
) -> Self::StopOutOfStackDhcpv4ClientResponseFut {
fn _decode(
mut _buf: Result<fidl::MessageBufEtc, fidl::Error>,
) -> Result<ControllerStopOutOfStackDhcpv4ClientResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
0x5d47aa5213164364,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ControllerStopOutOfStackDhcpv4ClientRequest,
ControllerStopOutOfStackDhcpv4ClientResult,
>(
payload,
0x5d47aa5213164364,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ControllerEventStream {
event_receiver: fidl::client::EventReceiver,
}
impl std::marker::Unpin for ControllerEventStream {}
impl futures::stream::FusedStream for ControllerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ControllerEventStream {
type Item = Result<ControllerEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ControllerEvent {}
impl ControllerEvent {
fn decode(mut buf: fidl::MessageBufEtc) -> Result<ControllerEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ControllerRequestStream {
inner: std::sync::Arc<fidl::ServeInner>,
is_terminated: bool,
}
impl std::marker::Unpin for ControllerRequestStream {}
impl futures::stream::FusedStream for ControllerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ControllerRequestStream {
type Protocol = ControllerMarker;
type ControlHandle = ControllerControlHandle;
fn from_channel(channel: fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
ControllerControlHandle { inner: self.inner.clone() }
}
fn into_inner(self) -> (::std::sync::Arc<fidl::ServeInner>, bool) {
(self.inner, self.is_terminated)
}
fn from_inner(inner: std::sync::Arc<fidl::ServeInner>, is_terminated: bool) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ControllerRequestStream {
type Item = Result<ControllerRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled ControllerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf(|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(e))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x58c1fa7335d4c5c2 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerStartHermeticNetworkRealmRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartHermeticNetworkRealmRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::StartHermeticNetworkRealm {
netstack: req.netstack,
responder: ControllerStartHermeticNetworkRealmResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x49d3c2501cd2f635 => {
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 = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::StopHermeticNetworkRealm {
responder: ControllerStopHermeticNetworkRealmResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x668ded2d2b619c15 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerAddInterfaceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerAddInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::AddInterface {
mac_address: req.mac_address,
name: req.name,
wait_any_ip_address: req.wait_any_ip_address,
responder: ControllerAddInterfaceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6523a401f22bf664 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerStartStubRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartStubRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::StartStub {
component_url: req.component_url,
responder: ControllerStartStubResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x582c32b564ff4bb4 => {
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 = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::StopStub {
responder: ControllerStopStubResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x60c9b6cf952fa4d1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerPingRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerPingRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::Ping {
target: req.target,
payload_length: req.payload_length,
interface_name: req.interface_name,
timeout: req.timeout,
responder: ControllerPingResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x333fb354db30f664 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerPollUdpRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerPollUdpRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::PollUdp {
target: req.target,
payload: req.payload,
timeout: req.timeout,
num_retries: req.num_retries,
responder: ControllerPollUdpResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xbdbb4095640a3f4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerJoinMulticastGroupRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerJoinMulticastGroupRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::JoinMulticastGroup {
address: req.address,
interface_id: req.interface_id,
responder: ControllerJoinMulticastGroupResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x32ecf4e40124a29a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerLeaveMulticastGroupRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerLeaveMulticastGroupRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::LeaveMulticastGroup {
address: req.address,
interface_id: req.interface_id,
responder: ControllerLeaveMulticastGroupResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x756c9b70864b7744 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerStartDhcpv6ClientRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartDhcpv6ClientRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::StartDhcpv6Client {
params: req.params,
responder: ControllerStartDhcpv6ClientResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x16e93478e663d523 => {
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 = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::StopDhcpv6Client {
responder: ControllerStopDhcpv6ClientResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x37eeec41c0077625 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerStartOutOfStackDhcpv4ClientRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartOutOfStackDhcpv4ClientRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::StartOutOfStackDhcpv4Client {
payload: req,
responder: ControllerStartOutOfStackDhcpv4ClientResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5d47aa5213164364 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerStopOutOfStackDhcpv4ClientRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStopOutOfStackDhcpv4ClientRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::StopOutOfStackDhcpv4Client {
payload: req,
responder: ControllerStopOutOfStackDhcpv4ClientResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
})
}
}
#[derive(Debug)]
pub enum ControllerRequest {
StartHermeticNetworkRealm {
netstack: Netstack,
responder: ControllerStartHermeticNetworkRealmResponder,
},
StopHermeticNetworkRealm { responder: ControllerStopHermeticNetworkRealmResponder },
AddInterface {
mac_address: fidl_fuchsia_net::MacAddress,
name: String,
wait_any_ip_address: bool,
responder: ControllerAddInterfaceResponder,
},
StartStub { component_url: String, responder: ControllerStartStubResponder },
StopStub { responder: ControllerStopStubResponder },
Ping {
target: fidl_fuchsia_net::IpAddress,
payload_length: u16,
interface_name: Option<String>,
timeout: i64,
responder: ControllerPingResponder,
},
PollUdp {
target: fidl_fuchsia_net::SocketAddress,
payload: Vec<u8>,
timeout: i64,
num_retries: u16,
responder: ControllerPollUdpResponder,
},
JoinMulticastGroup {
address: fidl_fuchsia_net::IpAddress,
interface_id: u64,
responder: ControllerJoinMulticastGroupResponder,
},
LeaveMulticastGroup {
address: fidl_fuchsia_net::IpAddress,
interface_id: u64,
responder: ControllerLeaveMulticastGroupResponder,
},
StartDhcpv6Client {
params: fidl_fuchsia_net_dhcpv6::NewClientParams,
responder: ControllerStartDhcpv6ClientResponder,
},
StopDhcpv6Client { responder: ControllerStopDhcpv6ClientResponder },
StartOutOfStackDhcpv4Client {
payload: ControllerStartOutOfStackDhcpv4ClientRequest,
responder: ControllerStartOutOfStackDhcpv4ClientResponder,
},
StopOutOfStackDhcpv4Client {
payload: ControllerStopOutOfStackDhcpv4ClientRequest,
responder: ControllerStopOutOfStackDhcpv4ClientResponder,
},
}
impl ControllerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_start_hermetic_network_realm(
self,
) -> Option<(Netstack, ControllerStartHermeticNetworkRealmResponder)> {
if let ControllerRequest::StartHermeticNetworkRealm { netstack, responder } = self {
Some((netstack, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop_hermetic_network_realm(
self,
) -> Option<(ControllerStopHermeticNetworkRealmResponder)> {
if let ControllerRequest::StopHermeticNetworkRealm { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_add_interface(
self,
) -> Option<(fidl_fuchsia_net::MacAddress, String, bool, ControllerAddInterfaceResponder)> {
if let ControllerRequest::AddInterface {
mac_address,
name,
wait_any_ip_address,
responder,
} = self
{
Some((mac_address, name, wait_any_ip_address, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start_stub(self) -> Option<(String, ControllerStartStubResponder)> {
if let ControllerRequest::StartStub { component_url, responder } = self {
Some((component_url, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop_stub(self) -> Option<(ControllerStopStubResponder)> {
if let ControllerRequest::StopStub { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_ping(
self,
) -> Option<(fidl_fuchsia_net::IpAddress, u16, Option<String>, i64, ControllerPingResponder)>
{
if let ControllerRequest::Ping {
target,
payload_length,
interface_name,
timeout,
responder,
} = self
{
Some((target, payload_length, interface_name, timeout, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_poll_udp(
self,
) -> Option<(fidl_fuchsia_net::SocketAddress, Vec<u8>, i64, u16, ControllerPollUdpResponder)>
{
if let ControllerRequest::PollUdp { target, payload, timeout, num_retries, responder } =
self
{
Some((target, payload, timeout, num_retries, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_join_multicast_group(
self,
) -> Option<(fidl_fuchsia_net::IpAddress, u64, ControllerJoinMulticastGroupResponder)> {
if let ControllerRequest::JoinMulticastGroup { address, interface_id, responder } = self {
Some((address, interface_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_leave_multicast_group(
self,
) -> Option<(fidl_fuchsia_net::IpAddress, u64, ControllerLeaveMulticastGroupResponder)> {
if let ControllerRequest::LeaveMulticastGroup { address, interface_id, responder } = self {
Some((address, interface_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start_dhcpv6_client(
self,
) -> Option<(fidl_fuchsia_net_dhcpv6::NewClientParams, ControllerStartDhcpv6ClientResponder)>
{
if let ControllerRequest::StartDhcpv6Client { params, responder } = self {
Some((params, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop_dhcpv6_client(self) -> Option<(ControllerStopDhcpv6ClientResponder)> {
if let ControllerRequest::StopDhcpv6Client { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start_out_of_stack_dhcpv4_client(
self,
) -> Option<(
ControllerStartOutOfStackDhcpv4ClientRequest,
ControllerStartOutOfStackDhcpv4ClientResponder,
)> {
if let ControllerRequest::StartOutOfStackDhcpv4Client { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop_out_of_stack_dhcpv4_client(
self,
) -> Option<(
ControllerStopOutOfStackDhcpv4ClientRequest,
ControllerStopOutOfStackDhcpv4ClientResponder,
)> {
if let ControllerRequest::StopOutOfStackDhcpv4Client { payload, responder } = self {
Some((payload, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ControllerRequest::StartHermeticNetworkRealm { .. } => "start_hermetic_network_realm",
ControllerRequest::StopHermeticNetworkRealm { .. } => "stop_hermetic_network_realm",
ControllerRequest::AddInterface { .. } => "add_interface",
ControllerRequest::StartStub { .. } => "start_stub",
ControllerRequest::StopStub { .. } => "stop_stub",
ControllerRequest::Ping { .. } => "ping",
ControllerRequest::PollUdp { .. } => "poll_udp",
ControllerRequest::JoinMulticastGroup { .. } => "join_multicast_group",
ControllerRequest::LeaveMulticastGroup { .. } => "leave_multicast_group",
ControllerRequest::StartDhcpv6Client { .. } => "start_dhcpv6_client",
ControllerRequest::StopDhcpv6Client { .. } => "stop_dhcpv6_client",
ControllerRequest::StartOutOfStackDhcpv4Client { .. } => {
"start_out_of_stack_dhcpv4_client"
}
ControllerRequest::StopOutOfStackDhcpv4Client { .. } => {
"stop_out_of_stack_dhcpv4_client"
}
}
}
}
#[derive(Debug, Clone)]
pub struct ControllerControlHandle {
inner: std::sync::Arc<fidl::ServeInner>,
}
impl fidl::endpoints::ControlHandle for ControllerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[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().as_ref().signal_peer(clear_mask, set_mask)
}
}
impl ControllerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerStartHermeticNetworkRealmResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerStartHermeticNetworkRealmResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerStartHermeticNetworkRealmResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerStartHermeticNetworkRealmResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x58c1fa7335d4c5c2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerStopHermeticNetworkRealmResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerStopHermeticNetworkRealmResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerStopHermeticNetworkRealmResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerStopHermeticNetworkRealmResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x49d3c2501cd2f635,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerAddInterfaceResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerAddInterfaceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerAddInterfaceResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerAddInterfaceResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x668ded2d2b619c15,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerStartStubResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerStartStubResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerStartStubResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerStartStubResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x6523a401f22bf664,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerStopStubResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerStopStubResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerStopStubResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerStopStubResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x582c32b564ff4bb4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerPingResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerPingResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerPingResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerPingResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x60c9b6cf952fa4d1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerPollUdpResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerPollUdpResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerPollUdpResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerPollUdpResponder {
pub fn send(self, mut result: Result<&[u8], Error>) -> 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<&[u8], Error>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[u8], Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<ControllerPollUdpResponse, Error>>(
result.map(|payload| (payload,)),
self.tx_id,
0x333fb354db30f664,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerJoinMulticastGroupResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerJoinMulticastGroupResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerJoinMulticastGroupResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerJoinMulticastGroupResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0xbdbb4095640a3f4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerLeaveMulticastGroupResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerLeaveMulticastGroupResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerLeaveMulticastGroupResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerLeaveMulticastGroupResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x32ecf4e40124a29a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerStartDhcpv6ClientResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerStartDhcpv6ClientResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerStartDhcpv6ClientResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerStartDhcpv6ClientResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x756c9b70864b7744,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerStopDhcpv6ClientResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerStopDhcpv6ClientResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerStopDhcpv6ClientResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerStopDhcpv6ClientResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x16e93478e663d523,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerStartOutOfStackDhcpv4ClientResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerStartOutOfStackDhcpv4ClientResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerStartOutOfStackDhcpv4ClientResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerStartOutOfStackDhcpv4ClientResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x37eeec41c0077625,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerStopOutOfStackDhcpv4ClientResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerStopOutOfStackDhcpv4ClientResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerStopOutOfStackDhcpv4ClientResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerStopOutOfStackDhcpv4ClientResponder {
pub fn send(self, mut result: Result<(), Error>) -> 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<(), Error>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
result,
self.tx_id,
0x5d47aa5213164364,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for Error {
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 Error {
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 Error {
#[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 Error {
#[inline(always)]
fn new_empty() -> Self {
Self::Internal
}
#[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 Netstack {
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 Netstack {
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 Netstack {
#[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 Netstack {
#[inline(always)]
fn new_empty() -> Self {
Self::V2
}
#[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 ControllerAddInterfaceRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerAddInterfaceRequest {
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<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerAddInterfaceRequest, D>
for &ControllerAddInterfaceRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerAddInterfaceRequest>(offset);
fidl::encoding::Encode::<ControllerAddInterfaceRequest, D>::encode(
(
<fidl_fuchsia_net::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(
&self.mac_address,
),
<fidl::encoding::BoundedString<15> as fidl::encoding::ValueTypeMarker>::borrow(
&self.name,
),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.wait_any_ip_address),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_net::MacAddress, D>,
T1: fidl::encoding::Encode<fidl::encoding::BoundedString<15>, D>,
T2: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<ControllerAddInterfaceRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerAddInterfaceRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerAddInterfaceRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
mac_address: fidl::new_empty!(fidl_fuchsia_net::MacAddress, D),
name: fidl::new_empty!(fidl::encoding::BoundedString<15>, D),
wait_any_ip_address: 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffff000000000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_net::MacAddress,
D,
&mut self.mac_address,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::BoundedString<15>,
D,
&mut self.name,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(bool, D, &mut self.wait_any_ip_address, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerJoinMulticastGroupRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerJoinMulticastGroupRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerJoinMulticastGroupRequest, D>
for &ControllerJoinMulticastGroupRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerJoinMulticastGroupRequest>(offset);
fidl::encoding::Encode::<ControllerJoinMulticastGroupRequest, D>::encode(
(
<fidl_fuchsia_net::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(
&self.address,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_net::IpAddress, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<ControllerJoinMulticastGroupRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerJoinMulticastGroupRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerJoinMulticastGroupRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
address: fidl::new_empty!(fidl_fuchsia_net::IpAddress, D),
interface_id: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_net::IpAddress,
D,
&mut self.address,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u64, D, &mut self.interface_id, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerLeaveMulticastGroupRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerLeaveMulticastGroupRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerLeaveMulticastGroupRequest, D>
for &ControllerLeaveMulticastGroupRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerLeaveMulticastGroupRequest>(offset);
fidl::encoding::Encode::<ControllerLeaveMulticastGroupRequest, D>::encode(
(
<fidl_fuchsia_net::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(
&self.address,
),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_net::IpAddress, D>,
T1: fidl::encoding::Encode<u64, D>,
> fidl::encoding::Encode<ControllerLeaveMulticastGroupRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerLeaveMulticastGroupRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerLeaveMulticastGroupRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
address: fidl::new_empty!(fidl_fuchsia_net::IpAddress, D),
interface_id: fidl::new_empty!(u64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_net::IpAddress,
D,
&mut self.address,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u64, D, &mut self.interface_id, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerPingRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerPingRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ControllerPingRequest, D>
for &ControllerPingRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerPingRequest>(offset);
fidl::encoding::Encode::<ControllerPingRequest, D>::encode(
(
<fidl_fuchsia_net::IpAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.target),
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.payload_length),
<fidl::encoding::Optional<fidl::encoding::BoundedString<15>> as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_name),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timeout),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_net::IpAddress, D>,
T1: fidl::encoding::Encode<u16, D>,
T2: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<15>>, D>,
T3: fidl::encoding::Encode<i64, D>,
> fidl::encoding::Encode<ControllerPingRequest, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerPingRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControllerPingRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
target: fidl::new_empty!(fidl_fuchsia_net::IpAddress, D),
payload_length: fidl::new_empty!(u16, D),
interface_name: fidl::new_empty!(
fidl::encoding::Optional<fidl::encoding::BoundedString<15>>,
D
),
timeout: fidl::new_empty!(i64, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_net::IpAddress,
D,
&mut self.target,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u16, D, &mut self.payload_length, decoder, offset + 16, _depth)?;
fidl::decode!(
fidl::encoding::Optional<fidl::encoding::BoundedString<15>>,
D,
&mut self.interface_name,
decoder,
offset + 24,
_depth
)?;
fidl::decode!(i64, D, &mut self.timeout, decoder, offset + 40, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerPollUdpRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerPollUdpRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerPollUdpRequest, D> for &ControllerPollUdpRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerPollUdpRequest>(offset);
fidl::encoding::Encode::<ControllerPollUdpRequest, D>::encode(
(
<fidl_fuchsia_net::SocketAddress as fidl::encoding::ValueTypeMarker>::borrow(
&self.target,
),
<fidl::encoding::Vector<u8, 1024> as fidl::encoding::ValueTypeMarker>::borrow(
&self.payload,
),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timeout),
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.num_retries),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_net::SocketAddress, D>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<u8, 1024>, D>,
T2: fidl::encoding::Encode<i64, D>,
T3: fidl::encoding::Encode<u16, D>,
> fidl::encoding::Encode<ControllerPollUdpRequest, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerPollUdpRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
self.3.encode(encoder, offset + 40, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerPollUdpRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
target: fidl::new_empty!(fidl_fuchsia_net::SocketAddress, D),
payload: fidl::new_empty!(fidl::encoding::Vector<u8, 1024>, D),
timeout: fidl::new_empty!(i64, D),
num_retries: fidl::new_empty!(u16, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_net::SocketAddress,
D,
&mut self.target,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::Vector<u8, 1024>, D, &mut self.payload, decoder, offset + 16, _depth)?;
fidl::decode!(i64, D, &mut self.timeout, decoder, offset + 32, _depth)?;
fidl::decode!(u16, D, &mut self.num_retries, decoder, offset + 40, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerStartDhcpv6ClientRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerStartDhcpv6ClientRequest {
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<ControllerStartDhcpv6ClientRequest, D>
for &ControllerStartDhcpv6ClientRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerStartDhcpv6ClientRequest>(offset);
fidl::encoding::Encode::<ControllerStartDhcpv6ClientRequest, D>::encode(
(
<fidl_fuchsia_net_dhcpv6::NewClientParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl_fuchsia_net_dhcpv6::NewClientParams, D>,
> fidl::encoding::Encode<ControllerStartDhcpv6ClientRequest, 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::<ControllerStartDhcpv6ClientRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerStartDhcpv6ClientRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { params: fidl::new_empty!(fidl_fuchsia_net_dhcpv6::NewClientParams, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl_fuchsia_net_dhcpv6::NewClientParams,
D,
&mut self.params,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerStartHermeticNetworkRealmRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerStartHermeticNetworkRealmRequest {
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<ControllerStartHermeticNetworkRealmRequest, D>
for &ControllerStartHermeticNetworkRealmRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerStartHermeticNetworkRealmRequest>(offset);
fidl::encoding::Encode::<ControllerStartHermeticNetworkRealmRequest, D>::encode(
(<Netstack as fidl::encoding::ValueTypeMarker>::borrow(&self.netstack),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Netstack, D>>
fidl::encoding::Encode<ControllerStartHermeticNetworkRealmRequest, 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::<ControllerStartHermeticNetworkRealmRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerStartHermeticNetworkRealmRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { netstack: fidl::new_empty!(Netstack, 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!(Netstack, D, &mut self.netstack, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerStartStubRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerStartStubRequest {
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<ControllerStartStubRequest, D> for &ControllerStartStubRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerStartStubRequest>(offset);
fidl::encoding::Encode::<ControllerStartStubRequest, D>::encode(
(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.component_url,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<4096>, D>,
> fidl::encoding::Encode<ControllerStartStubRequest, 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::<ControllerStartStubRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerStartStubRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { component_url: fidl::new_empty!(fidl::encoding::BoundedString<4096>, 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::BoundedString<4096>,
D,
&mut self.component_url,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerPollUdpResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerPollUdpResponse {
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<ControllerPollUdpResponse, D> for &ControllerPollUdpResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerPollUdpResponse>(offset);
fidl::encoding::Encode::<ControllerPollUdpResponse, D>::encode(
(<fidl::encoding::Vector<u8, 1024> as fidl::encoding::ValueTypeMarker>::borrow(
&self.payload,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 1024>, D>,
> fidl::encoding::Encode<ControllerPollUdpResponse, 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::<ControllerPollUdpResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerPollUdpResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { payload: fidl::new_empty!(fidl::encoding::Vector<u8, 1024>, 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<u8, 1024>, D, &mut self.payload, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl ControllerStartOutOfStackDhcpv4ClientRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.interface_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ControllerStartOutOfStackDhcpv4ClientRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerStartOutOfStackDhcpv4ClientRequest {
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<ControllerStartOutOfStackDhcpv4ClientRequest, D>
for &ControllerStartOutOfStackDhcpv4ClientRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerStartOutOfStackDhcpv4ClientRequest>(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::<u64, D>(
self.interface_id.as_ref().map(<u64 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 ControllerStartOutOfStackDhcpv4ClientRequest
{
#[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 =
<u64 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.interface_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, 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 ControllerStopOutOfStackDhcpv4ClientRequest {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.interface_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ControllerStopOutOfStackDhcpv4ClientRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerStopOutOfStackDhcpv4ClientRequest {
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<ControllerStopOutOfStackDhcpv4ClientRequest, D>
for &ControllerStopOutOfStackDhcpv4ClientRequest
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerStopOutOfStackDhcpv4ClientRequest>(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::<u64, D>(
self.interface_id.as_ref().map(<u64 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 ControllerStopOutOfStackDhcpv4ClientRequest
{
#[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 =
<u64 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.interface_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, 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(())
}
}
}