#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub type Protocol = u16;
pub const SOCKET_PROTOCOL_NAME: &str = "fuchsia.posix.socket.packet/Socket";
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum HardwareType {
NetworkOnly = 1,
Ethernet = 2,
Loopback = 3,
}
impl HardwareType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::NetworkOnly),
2 => Some(Self::Ethernet),
3 => Some(Self::Loopback),
_ => 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 Kind {
Network = 1,
Link = 2,
}
impl Kind {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Network),
2 => Some(Self::Link),
_ => 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 PacketType {
Host = 1,
Broadcast = 2,
Multicast = 3,
OtherHost = 4,
Outgoing = 5,
}
impl PacketType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Host),
2 => Some(Self::Broadcast),
3 => Some(Self::Multicast),
4 => Some(Self::OtherHost),
5 => Some(Self::Outgoing),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Empty;
impl fidl::Persistable for Empty {}
#[derive(Clone, Debug, PartialEq)]
pub struct InterfaceProperties {
pub id: u64,
pub addr: HardwareAddress,
pub type_: HardwareType,
}
impl fidl::Persistable for InterfaceProperties {}
#[derive(Clone, Debug, PartialEq)]
pub struct PacketInfo {
pub protocol: u16,
pub interface_id: u64,
pub addr: HardwareAddress,
}
impl fidl::Persistable for PacketInfo {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ProviderSocketRequest {
pub kind: Kind,
}
impl fidl::Persistable for ProviderSocketRequest {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ProviderSocketResponse {
pub socket: fidl::endpoints::ClientEnd<SocketMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ProviderSocketResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct RecvPacketInfo {
pub packet_info: PacketInfo,
pub packet_type: PacketType,
pub interface_type: HardwareType,
}
impl fidl::Persistable for RecvPacketInfo {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SocketAttachBpfFilterUnsafeRequest {
pub code: Vec<u64>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for SocketAttachBpfFilterUnsafeRequest
{
}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SocketBindRequest {
pub protocol: Option<Box<ProtocolAssociation>>,
pub bound_interface_id: BoundInterfaceId,
}
impl fidl::Persistable for SocketBindRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct SocketRecvMsgRequest {
pub want_packet_info: bool,
pub data_len: u32,
pub want_control: bool,
pub flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
}
impl fidl::Persistable for SocketRecvMsgRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct SocketSendMsgRequest {
pub packet_info: Option<Box<PacketInfo>>,
pub data: Vec<u8>,
pub control: SendControlData,
pub flags: fidl_fuchsia_posix_socket::SendMsgFlags,
}
impl fidl::Persistable for SocketSendMsgRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct SocketGetInfoResponse {
pub kind: Kind,
pub protocol: Option<Box<ProtocolAssociation>>,
pub bound_interface: BoundInterface,
}
impl fidl::Persistable for SocketGetInfoResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct SocketRecvMsgResponse {
pub packet_info: Option<Box<RecvPacketInfo>>,
pub data: Vec<u8>,
pub control: RecvControlData,
pub truncated: u32,
}
impl fidl::Persistable for SocketRecvMsgResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct RecvControlData {
pub socket: Option<fidl_fuchsia_posix_socket::SocketRecvControlData>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for RecvControlData {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct SendControlData {
pub socket: Option<fidl_fuchsia_posix_socket::SocketSendControlData>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for SendControlData {}
#[derive(Debug, Default, PartialEq)]
pub struct SocketDescribeResponse {
pub event: Option<fidl::EventPair>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SocketDescribeResponse {}
#[derive(Clone, Debug, PartialEq)]
pub enum BoundInterface {
All(Empty),
Specified(InterfaceProperties),
}
impl BoundInterface {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::All(_) => 1,
Self::Specified(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for BoundInterface {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum BoundInterfaceId {
All(Empty),
Specified(u64),
}
impl BoundInterfaceId {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::All(_) => 1,
Self::Specified(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for BoundInterfaceId {}
#[derive(Clone, Debug)]
pub enum HardwareAddress {
None(Empty),
Eui48(fidl_fuchsia_net::MacAddress),
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u64 },
}
#[macro_export]
macro_rules! HardwareAddressUnknown {
() => {
_
};
}
impl PartialEq for HardwareAddress {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::None(x), Self::None(y)) => *x == *y,
(Self::Eui48(x), Self::Eui48(y)) => *x == *y,
_ => false,
}
}
}
impl HardwareAddress {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::None(_) => 1,
Self::Eui48(_) => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for HardwareAddress {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum ProtocolAssociation {
All(Empty),
Specified(u16),
}
impl ProtocolAssociation {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::All(_) => 1,
Self::Specified(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for ProtocolAssociation {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ProviderMarker;
impl fidl::endpoints::ProtocolMarker for ProviderMarker {
type Proxy = ProviderProxy;
type RequestStream = ProviderRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ProviderSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.posix.socket.packet.Provider";
}
impl fidl::endpoints::DiscoverableProtocolMarker for ProviderMarker {}
pub type ProviderSocketResult =
Result<fidl::endpoints::ClientEnd<SocketMarker>, fidl_fuchsia_posix::Errno>;
pub trait ProviderProxyInterface: Send + Sync {
type SocketResponseFut: std::future::Future<Output = Result<ProviderSocketResult, fidl::Error>>
+ Send;
fn r#socket(&self, kind: Kind) -> Self::SocketResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ProviderSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ProviderSynchronousProxy {
type Proxy = ProviderProxy;
type Protocol = ProviderMarker;
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 ProviderSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ProviderMarker 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<ProviderEvent, fidl::Error> {
ProviderEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#socket(
&self,
mut kind: Kind,
___deadline: zx::MonotonicInstant,
) -> Result<ProviderSocketResult, fidl::Error> {
let _response =
self.client.send_query::<ProviderSocketRequest, fidl::encoding::ResultType<
ProviderSocketResponse,
fidl_fuchsia_posix::Errno,
>>(
(kind,),
0x3aad2da99889858e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.socket))
}
}
#[derive(Debug, Clone)]
pub struct ProviderProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ProviderProxy {
type Protocol = ProviderMarker;
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 ProviderProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ProviderEventStream {
ProviderEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#socket(
&self,
mut kind: Kind,
) -> fidl::client::QueryResponseFut<
ProviderSocketResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ProviderProxyInterface::r#socket(self, kind)
}
}
impl ProviderProxyInterface for ProviderProxy {
type SocketResponseFut = fidl::client::QueryResponseFut<
ProviderSocketResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#socket(&self, mut kind: Kind) -> Self::SocketResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ProviderSocketResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ProviderSocketResponse, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3aad2da99889858e,
>(_buf?)?;
Ok(_response.map(|x| x.socket))
}
self.client.send_query_and_decode::<ProviderSocketRequest, ProviderSocketResult>(
(kind,),
0x3aad2da99889858e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ProviderEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ProviderEventStream {}
impl futures::stream::FusedStream for ProviderEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ProviderEventStream {
type Item = Result<ProviderEvent, 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(ProviderEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ProviderEvent {}
impl ProviderEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ProviderEvent, 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: <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ProviderRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ProviderRequestStream {}
impl futures::stream::FusedStream for ProviderRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ProviderRequestStream {
type Protocol = ProviderMarker;
type ControlHandle = ProviderControlHandle;
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 {
ProviderControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ProviderRequestStream {
type Item = Result<ProviderRequest, 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 ProviderRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x3aad2da99889858e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ProviderSocketRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderSocketRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ProviderControlHandle { inner: this.inner.clone() };
Ok(ProviderRequest::Socket {
kind: req.kind,
responder: ProviderSocketResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ProviderRequest {
Socket { kind: Kind, responder: ProviderSocketResponder },
}
impl ProviderRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_socket(self) -> Option<(Kind, ProviderSocketResponder)> {
if let ProviderRequest::Socket { kind, responder } = self {
Some((kind, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ProviderRequest::Socket { .. } => "socket",
}
}
}
#[derive(Debug, Clone)]
pub struct ProviderControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ProviderControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl ProviderControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ProviderSocketResponder {
control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ProviderSocketResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ProviderSocketResponder {
type ControlHandle = ProviderControlHandle;
fn control_handle(&self) -> &ProviderControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ProviderSocketResponder {
pub fn send(
self,
mut result: Result<fidl::endpoints::ClientEnd<SocketMarker>, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<fidl::endpoints::ClientEnd<SocketMarker>, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl::endpoints::ClientEnd<SocketMarker>, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ProviderSocketResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|socket| (socket,)),
self.tx_id,
0x3aad2da99889858e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct SocketMarker;
impl fidl::endpoints::ProtocolMarker for SocketMarker {
type Proxy = SocketProxy;
type RequestStream = SocketRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = SocketSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.posix.socket.packet.Socket";
}
impl fidl::endpoints::DiscoverableProtocolMarker for SocketMarker {}
pub type SocketBindResult = Result<(), fidl_fuchsia_posix::Errno>;
pub type SocketGetInfoResult =
Result<(Kind, Option<Box<ProtocolAssociation>>, BoundInterface), fidl_fuchsia_posix::Errno>;
pub type SocketRecvMsgResult =
Result<(Option<Box<RecvPacketInfo>>, Vec<u8>, RecvControlData, u32), fidl_fuchsia_posix::Errno>;
pub type SocketSendMsgResult = Result<(), fidl_fuchsia_posix::Errno>;
pub type SocketAttachBpfFilterUnsafeResult = Result<(), fidl_fuchsia_posix::Errno>;
pub trait SocketProxyInterface: Send + Sync {
fn r#clone2(
&self,
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error>;
type CloseResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
> + Send;
fn r#close(&self) -> Self::CloseResponseFut;
type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
fn r#query(&self) -> Self::QueryResponseFut;
type SetReuseAddressResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult,
fidl::Error,
>,
> + Send;
fn r#set_reuse_address(&self, value: bool) -> Self::SetReuseAddressResponseFut;
type GetReuseAddressResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult,
fidl::Error,
>,
> + Send;
fn r#get_reuse_address(&self) -> Self::GetReuseAddressResponseFut;
type GetErrorResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetErrorResult, fidl::Error>,
> + Send;
fn r#get_error(&self) -> Self::GetErrorResponseFut;
type SetBroadcastResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult, fidl::Error>,
> + Send;
fn r#set_broadcast(&self, value: bool) -> Self::SetBroadcastResponseFut;
type GetBroadcastResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult, fidl::Error>,
> + Send;
fn r#get_broadcast(&self) -> Self::GetBroadcastResponseFut;
type SetSendBufferResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult, fidl::Error>,
> + Send;
fn r#set_send_buffer(&self, value_bytes: u64) -> Self::SetSendBufferResponseFut;
type GetSendBufferResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult, fidl::Error>,
> + Send;
fn r#get_send_buffer(&self) -> Self::GetSendBufferResponseFut;
type SetReceiveBufferResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult,
fidl::Error,
>,
> + Send;
fn r#set_receive_buffer(&self, value_bytes: u64) -> Self::SetReceiveBufferResponseFut;
type GetReceiveBufferResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult,
fidl::Error,
>,
> + Send;
fn r#get_receive_buffer(&self) -> Self::GetReceiveBufferResponseFut;
type SetKeepAliveResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult, fidl::Error>,
> + Send;
fn r#set_keep_alive(&self, value: bool) -> Self::SetKeepAliveResponseFut;
type GetKeepAliveResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult, fidl::Error>,
> + Send;
fn r#get_keep_alive(&self) -> Self::GetKeepAliveResponseFut;
type SetOutOfBandInlineResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult,
fidl::Error,
>,
> + Send;
fn r#set_out_of_band_inline(&self, value: bool) -> Self::SetOutOfBandInlineResponseFut;
type GetOutOfBandInlineResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult,
fidl::Error,
>,
> + Send;
fn r#get_out_of_band_inline(&self) -> Self::GetOutOfBandInlineResponseFut;
type SetNoCheckResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult, fidl::Error>,
> + Send;
fn r#set_no_check(&self, value: bool) -> Self::SetNoCheckResponseFut;
type GetNoCheckResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult, fidl::Error>,
> + Send;
fn r#get_no_check(&self) -> Self::GetNoCheckResponseFut;
type SetLingerResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetLingerResult, fidl::Error>,
> + Send;
fn r#set_linger(&self, linger: bool, length_secs: u32) -> Self::SetLingerResponseFut;
type GetLingerResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetLingerResult, fidl::Error>,
> + Send;
fn r#get_linger(&self) -> Self::GetLingerResponseFut;
type SetReusePortResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult, fidl::Error>,
> + Send;
fn r#set_reuse_port(&self, value: bool) -> Self::SetReusePortResponseFut;
type GetReusePortResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult, fidl::Error>,
> + Send;
fn r#get_reuse_port(&self) -> Self::GetReusePortResponseFut;
type GetAcceptConnResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult, fidl::Error>,
> + Send;
fn r#get_accept_conn(&self) -> Self::GetAcceptConnResponseFut;
type SetBindToDeviceResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult,
fidl::Error,
>,
> + Send;
fn r#set_bind_to_device(&self, value: &str) -> Self::SetBindToDeviceResponseFut;
type GetBindToDeviceResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult,
fidl::Error,
>,
> + Send;
fn r#get_bind_to_device(&self) -> Self::GetBindToDeviceResponseFut;
type SetBindToInterfaceIndexResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult,
fidl::Error,
>,
> + Send;
fn r#set_bind_to_interface_index(&self, value: u64)
-> Self::SetBindToInterfaceIndexResponseFut;
type GetBindToInterfaceIndexResponseFut: std::future::Future<
Output = Result<
fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult,
fidl::Error,
>,
> + Send;
fn r#get_bind_to_interface_index(&self) -> Self::GetBindToInterfaceIndexResponseFut;
type SetTimestampResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult, fidl::Error>,
> + Send;
fn r#set_timestamp(
&self,
value: fidl_fuchsia_posix_socket::TimestampOption,
) -> Self::SetTimestampResponseFut;
type GetTimestampResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult, fidl::Error>,
> + Send;
fn r#get_timestamp(&self) -> Self::GetTimestampResponseFut;
type SetMarkResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetMarkResult, fidl::Error>,
> + Send;
fn r#set_mark(
&self,
domain: fidl_fuchsia_posix_socket::MarkDomain,
mark: &fidl_fuchsia_posix_socket::OptionalUint32,
) -> Self::SetMarkResponseFut;
type GetMarkResponseFut: std::future::Future<
Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetMarkResult, fidl::Error>,
> + Send;
fn r#get_mark(&self, domain: fidl_fuchsia_posix_socket::MarkDomain)
-> Self::GetMarkResponseFut;
type DescribeResponseFut: std::future::Future<Output = Result<SocketDescribeResponse, fidl::Error>>
+ Send;
fn r#describe(&self) -> Self::DescribeResponseFut;
type BindResponseFut: std::future::Future<Output = Result<SocketBindResult, fidl::Error>> + Send;
fn r#bind(
&self,
protocol: Option<&ProtocolAssociation>,
bound_interface_id: &BoundInterfaceId,
) -> Self::BindResponseFut;
type GetInfoResponseFut: std::future::Future<Output = Result<SocketGetInfoResult, fidl::Error>>
+ Send;
fn r#get_info(&self) -> Self::GetInfoResponseFut;
type RecvMsgResponseFut: std::future::Future<Output = Result<SocketRecvMsgResult, fidl::Error>>
+ Send;
fn r#recv_msg(
&self,
want_packet_info: bool,
data_len: u32,
want_control: bool,
flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
) -> Self::RecvMsgResponseFut;
type SendMsgResponseFut: std::future::Future<Output = Result<SocketSendMsgResult, fidl::Error>>
+ Send;
fn r#send_msg(
&self,
packet_info: Option<&PacketInfo>,
data: &[u8],
control: &SendControlData,
flags: fidl_fuchsia_posix_socket::SendMsgFlags,
) -> Self::SendMsgResponseFut;
type AttachBpfFilterUnsafeResponseFut: std::future::Future<Output = Result<SocketAttachBpfFilterUnsafeResult, fidl::Error>>
+ Send;
fn r#attach_bpf_filter_unsafe(&self, code: &[u64]) -> Self::AttachBpfFilterUnsafeResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct SocketSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for SocketSynchronousProxy {
type Proxy = SocketProxy;
type Protocol = SocketMarker;
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 SocketSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <SocketMarker 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<SocketEvent, fidl::Error> {
SocketEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#close(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::QueryableQueryResponse,
>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.protocol)
}
pub fn r#set_reuse_address(
&self,
mut value: bool,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value,),
0x1fd74ee8b9a4a876,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_reuse_address(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x67b7206b8d1bc0a5, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#get_error(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetErrorResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
(),
0x5aad39b33e5f6ebb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_broadcast(
&self,
mut value: bool,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetBroadcastRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value,),
0x6023e081ce3cd947,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_broadcast(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x68796fc556f9780d, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_send_buffer(
&self,
mut value_bytes: u64,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetSendBufferRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value_bytes,),
0x756eac32d73a7a70,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_send_buffer(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x78a52fd9c7b2410b, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value_bytes))
}
pub fn r#set_receive_buffer(
&self,
mut value_bytes: u64,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value_bytes,),
0x6b0cf2f1919c7001,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_receive_buffer(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x14c1a4b64f709e5c, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value_bytes))
}
pub fn r#set_keep_alive(
&self,
mut value: bool,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value,),
0x572df8f0b920d2c7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_keep_alive(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x2dd29d3215f2c9d2, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_out_of_band_inline(
&self,
mut value: bool,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value,),
0x3ecb49968bee439,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_out_of_band_inline(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x348c1ab3aeca1745, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_no_check(
&self,
mut value: bool,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetNoCheckRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value,),
0x6bbf00c53a4c78c2,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_no_check(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x2cd4249286417694, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_linger(
&self,
mut linger: bool,
mut length_secs: u32,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetLingerResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetLingerRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(linger, length_secs,),
0x45386351246e998e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_linger(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetLingerResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetLingerResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x48eb20fc5ccb0e45, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| (x.linger, x.length_secs)))
}
pub fn r#set_reuse_port(
&self,
mut value: bool,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetReusePortRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value,),
0x24dd3e5cb36d9ccb,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_reuse_port(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetReusePortResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x7a112c1ab54ff828, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#get_accept_conn(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x67ce6db6c2ec8966, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_bind_to_device(
&self,
mut value: &str,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value,),
0x2118b483f28aafc4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_bind_to_device(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x1ab1fbf0ef7906c8, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_bind_to_interface_index(
&self,
mut value: u64,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult, fidl::Error>
{
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value,),
0x6e387a0def00821,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_bind_to_interface_index(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult, fidl::Error>
{
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x59c31dd3e3078295, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_timestamp(
&self,
mut value: fidl_fuchsia_posix_socket::TimestampOption,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetTimestampRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(value,),
0x285d6516c263d839,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_timestamp(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetTimestampResponse,
fidl_fuchsia_posix::Errno,
>>(
(), 0x49f2fffbbcc2bd27, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.value))
}
pub fn r#set_mark(
&self,
mut domain: fidl_fuchsia_posix_socket::MarkDomain,
mut mark: &fidl_fuchsia_posix_socket::OptionalUint32,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetMarkResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketSetMarkRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
>(
(domain, mark,),
0x6ead6de09f653236,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_mark(
&self,
mut domain: fidl_fuchsia_posix_socket::MarkDomain,
___deadline: zx::MonotonicInstant,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetMarkResult, fidl::Error> {
let _response = self.client.send_query::<
fidl_fuchsia_posix_socket::BaseSocketGetMarkRequest,
fidl::encoding::ResultType<fidl_fuchsia_posix_socket::BaseSocketGetMarkResponse, fidl_fuchsia_posix::Errno>,
>(
(domain,),
0x57a2752c61d93d47,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.mark))
}
pub fn r#describe(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<SocketDescribeResponse, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, SocketDescribeResponse>(
(),
0x4fd7c08c9c804484,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#bind(
&self,
mut protocol: Option<&ProtocolAssociation>,
mut bound_interface_id: &BoundInterfaceId,
___deadline: zx::MonotonicInstant,
) -> Result<SocketBindResult, fidl::Error> {
let _response = self.client.send_query::<SocketBindRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
(protocol, bound_interface_id),
0x6caedb2d31b56db8,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<SocketGetInfoResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
SocketGetInfoResponse,
fidl_fuchsia_posix::Errno,
>>(
(),
0x7f67457e85c3914c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.kind, x.protocol, x.bound_interface)))
}
pub fn r#recv_msg(
&self,
mut want_packet_info: bool,
mut data_len: u32,
mut want_control: bool,
mut flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
___deadline: zx::MonotonicInstant,
) -> Result<SocketRecvMsgResult, fidl::Error> {
let _response = self.client.send_query::<SocketRecvMsgRequest, fidl::encoding::ResultType<
SocketRecvMsgResponse,
fidl_fuchsia_posix::Errno,
>>(
(want_packet_info, data_len, want_control, flags),
0x52b95ba982826a61,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.packet_info, x.data, x.control, x.truncated)))
}
pub fn r#send_msg(
&self,
mut packet_info: Option<&PacketInfo>,
mut data: &[u8],
mut control: &SendControlData,
mut flags: fidl_fuchsia_posix_socket::SendMsgFlags,
___deadline: zx::MonotonicInstant,
) -> Result<SocketSendMsgResult, fidl::Error> {
let _response = self.client.send_query::<SocketSendMsgRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
(packet_info, data, control, flags),
0x150c9ff91f944922,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#attach_bpf_filter_unsafe(
&self,
mut code: &[u64],
___deadline: zx::MonotonicInstant,
) -> Result<SocketAttachBpfFilterUnsafeResult, fidl::Error> {
let _response =
self.client
.send_query::<SocketAttachBpfFilterUnsafeRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
(code,),
0x593998d38670f823,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct SocketProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for SocketProxy {
type Protocol = SocketMarker;
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 SocketProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <SocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> SocketEventStream {
SocketEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
SocketProxyInterface::r#clone2(self, request)
}
pub fn r#close(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#close(self)
}
pub fn r#query(
&self,
) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
{
SocketProxyInterface::r#query(self)
}
pub fn r#set_reuse_address(
&self,
mut value: bool,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_reuse_address(self, value)
}
pub fn r#get_reuse_address(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_reuse_address(self)
}
pub fn r#get_error(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetErrorResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_error(self)
}
pub fn r#set_broadcast(
&self,
mut value: bool,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_broadcast(self, value)
}
pub fn r#get_broadcast(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_broadcast(self)
}
pub fn r#set_send_buffer(
&self,
mut value_bytes: u64,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_send_buffer(self, value_bytes)
}
pub fn r#get_send_buffer(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_send_buffer(self)
}
pub fn r#set_receive_buffer(
&self,
mut value_bytes: u64,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_receive_buffer(self, value_bytes)
}
pub fn r#get_receive_buffer(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_receive_buffer(self)
}
pub fn r#set_keep_alive(
&self,
mut value: bool,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_keep_alive(self, value)
}
pub fn r#get_keep_alive(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_keep_alive(self)
}
pub fn r#set_out_of_band_inline(
&self,
mut value: bool,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_out_of_band_inline(self, value)
}
pub fn r#get_out_of_band_inline(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_out_of_band_inline(self)
}
pub fn r#set_no_check(
&self,
mut value: bool,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_no_check(self, value)
}
pub fn r#get_no_check(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_no_check(self)
}
pub fn r#set_linger(
&self,
mut linger: bool,
mut length_secs: u32,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetLingerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_linger(self, linger, length_secs)
}
pub fn r#get_linger(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetLingerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_linger(self)
}
pub fn r#set_reuse_port(
&self,
mut value: bool,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_reuse_port(self, value)
}
pub fn r#get_reuse_port(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_reuse_port(self)
}
pub fn r#get_accept_conn(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_accept_conn(self)
}
pub fn r#set_bind_to_device(
&self,
mut value: &str,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_bind_to_device(self, value)
}
pub fn r#get_bind_to_device(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_bind_to_device(self)
}
pub fn r#set_bind_to_interface_index(
&self,
mut value: u64,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_bind_to_interface_index(self, value)
}
pub fn r#get_bind_to_interface_index(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_bind_to_interface_index(self)
}
pub fn r#set_timestamp(
&self,
mut value: fidl_fuchsia_posix_socket::TimestampOption,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_timestamp(self, value)
}
pub fn r#get_timestamp(
&self,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_timestamp(self)
}
pub fn r#set_mark(
&self,
mut domain: fidl_fuchsia_posix_socket::MarkDomain,
mut mark: &fidl_fuchsia_posix_socket::OptionalUint32,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetMarkResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#set_mark(self, domain, mark)
}
pub fn r#get_mark(
&self,
mut domain: fidl_fuchsia_posix_socket::MarkDomain,
) -> fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetMarkResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_mark(self, domain)
}
pub fn r#describe(
&self,
) -> fidl::client::QueryResponseFut<
SocketDescribeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#describe(self)
}
pub fn r#bind(
&self,
mut protocol: Option<&ProtocolAssociation>,
mut bound_interface_id: &BoundInterfaceId,
) -> fidl::client::QueryResponseFut<
SocketBindResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#bind(self, protocol, bound_interface_id)
}
pub fn r#get_info(
&self,
) -> fidl::client::QueryResponseFut<
SocketGetInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#get_info(self)
}
pub fn r#recv_msg(
&self,
mut want_packet_info: bool,
mut data_len: u32,
mut want_control: bool,
mut flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
) -> fidl::client::QueryResponseFut<
SocketRecvMsgResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#recv_msg(self, want_packet_info, data_len, want_control, flags)
}
pub fn r#send_msg(
&self,
mut packet_info: Option<&PacketInfo>,
mut data: &[u8],
mut control: &SendControlData,
mut flags: fidl_fuchsia_posix_socket::SendMsgFlags,
) -> fidl::client::QueryResponseFut<
SocketSendMsgResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#send_msg(self, packet_info, data, control, flags)
}
pub fn r#attach_bpf_filter_unsafe(
&self,
mut code: &[u64],
) -> fidl::client::QueryResponseFut<
SocketAttachBpfFilterUnsafeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
SocketProxyInterface::r#attach_bpf_filter_unsafe(self, code)
}
}
impl SocketProxyInterface for SocketProxy {
fn r#clone2(
&self,
mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_unknown::CloneableClone2Request>(
(request,),
0x20d8a7aba2168a79,
fidl::encoding::DynamicFlags::empty(),
)
}
type CloseResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_unknown::CloseableCloseResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#close(&self) -> Self::CloseResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5ac5d459ad7f657e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_unknown::CloseableCloseResult,
>(
(),
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type QueryResponseFut =
fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#query(&self) -> Self::QueryResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<u8>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl_fuchsia_unknown::QueryableQueryResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2658edee9decfc06,
>(_buf?)?;
Ok(_response.protocol)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
(),
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetReuseAddressResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_reuse_address(&self, mut value: bool) -> Self::SetReuseAddressResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1fd74ee8b9a4a876,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressRequest,
fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult,
>(
(value,),
0x1fd74ee8b9a4a876,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetReuseAddressResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_reuse_address(&self) -> Self::GetReuseAddressResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x67b7206b8d1bc0a5,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult,
>(
(),
0x67b7206b8d1bc0a5,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetErrorResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetErrorResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_error(&self) -> Self::GetErrorResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetErrorResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5aad39b33e5f6ebb,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetErrorResult,
>(
(),
0x5aad39b33e5f6ebb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetBroadcastResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_broadcast(&self, mut value: bool) -> Self::SetBroadcastResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6023e081ce3cd947,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetBroadcastRequest,
fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult,
>(
(value,),
0x6023e081ce3cd947,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetBroadcastResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_broadcast(&self) -> Self::GetBroadcastResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x68796fc556f9780d,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult,
>(
(),
0x68796fc556f9780d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetSendBufferResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_send_buffer(&self, mut value_bytes: u64) -> Self::SetSendBufferResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x756eac32d73a7a70,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetSendBufferRequest,
fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult,
>(
(value_bytes,),
0x756eac32d73a7a70,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetSendBufferResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_send_buffer(&self) -> Self::GetSendBufferResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x78a52fd9c7b2410b,
>(_buf?)?;
Ok(_response.map(|x| x.value_bytes))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult,
>(
(),
0x78a52fd9c7b2410b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetReceiveBufferResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_receive_buffer(&self, mut value_bytes: u64) -> Self::SetReceiveBufferResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6b0cf2f1919c7001,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferRequest,
fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult,
>(
(value_bytes,),
0x6b0cf2f1919c7001,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetReceiveBufferResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_receive_buffer(&self) -> Self::GetReceiveBufferResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x14c1a4b64f709e5c,
>(_buf?)?;
Ok(_response.map(|x| x.value_bytes))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult,
>(
(),
0x14c1a4b64f709e5c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetKeepAliveResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_keep_alive(&self, mut value: bool) -> Self::SetKeepAliveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x572df8f0b920d2c7,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveRequest,
fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult,
>(
(value,),
0x572df8f0b920d2c7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetKeepAliveResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_keep_alive(&self) -> Self::GetKeepAliveResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2dd29d3215f2c9d2,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult,
>(
(),
0x2dd29d3215f2c9d2,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetOutOfBandInlineResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_out_of_band_inline(&self, mut value: bool) -> Self::SetOutOfBandInlineResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3ecb49968bee439,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineRequest,
fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult,
>(
(value,),
0x3ecb49968bee439,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetOutOfBandInlineResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_out_of_band_inline(&self) -> Self::GetOutOfBandInlineResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x348c1ab3aeca1745,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult,
>(
(),
0x348c1ab3aeca1745,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetNoCheckResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_no_check(&self, mut value: bool) -> Self::SetNoCheckResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6bbf00c53a4c78c2,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetNoCheckRequest,
fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult,
>(
(value,),
0x6bbf00c53a4c78c2,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetNoCheckResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_no_check(&self) -> Self::GetNoCheckResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2cd4249286417694,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult,
>(
(),
0x2cd4249286417694,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetLingerResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetLingerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_linger(&self, mut linger: bool, mut length_secs: u32) -> Self::SetLingerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetLingerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x45386351246e998e,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetLingerRequest,
fidl_fuchsia_posix_socket::BaseSocketSetLingerResult,
>(
(linger, length_secs,),
0x45386351246e998e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetLingerResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetLingerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_linger(&self) -> Self::GetLingerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetLingerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetLingerResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x48eb20fc5ccb0e45,
>(_buf?)?;
Ok(_response.map(|x| (x.linger, x.length_secs)))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetLingerResult,
>(
(),
0x48eb20fc5ccb0e45,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetReusePortResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_reuse_port(&self, mut value: bool) -> Self::SetReusePortResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x24dd3e5cb36d9ccb,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetReusePortRequest,
fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult,
>(
(value,),
0x24dd3e5cb36d9ccb,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetReusePortResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_reuse_port(&self) -> Self::GetReusePortResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetReusePortResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7a112c1ab54ff828,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult,
>(
(),
0x7a112c1ab54ff828,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetAcceptConnResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_accept_conn(&self) -> Self::GetAcceptConnResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x67ce6db6c2ec8966,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult,
>(
(),
0x67ce6db6c2ec8966,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetBindToDeviceResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_bind_to_device(&self, mut value: &str) -> Self::SetBindToDeviceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2118b483f28aafc4,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceRequest,
fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult,
>(
(value,),
0x2118b483f28aafc4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetBindToDeviceResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_bind_to_device(&self) -> Self::GetBindToDeviceResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1ab1fbf0ef7906c8,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult,
>(
(),
0x1ab1fbf0ef7906c8,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetBindToInterfaceIndexResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_bind_to_interface_index(
&self,
mut value: u64,
) -> Self::SetBindToInterfaceIndexResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6e387a0def00821,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexRequest,
fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult,
>(
(value,),
0x6e387a0def00821,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetBindToInterfaceIndexResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_bind_to_interface_index(&self) -> Self::GetBindToInterfaceIndexResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x59c31dd3e3078295,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult,
>(
(),
0x59c31dd3e3078295,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetTimestampResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_timestamp(
&self,
mut value: fidl_fuchsia_posix_socket::TimestampOption,
) -> Self::SetTimestampResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x285d6516c263d839,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetTimestampRequest,
fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult,
>(
(value,),
0x285d6516c263d839,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetTimestampResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_timestamp(&self) -> Self::GetTimestampResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetTimestampResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x49f2fffbbcc2bd27,
>(_buf?)?;
Ok(_response.map(|x| x.value))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult,
>(
(),
0x49f2fffbbcc2bd27,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetMarkResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketSetMarkResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_mark(
&self,
mut domain: fidl_fuchsia_posix_socket::MarkDomain,
mut mark: &fidl_fuchsia_posix_socket::OptionalUint32,
) -> Self::SetMarkResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetMarkResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6ead6de09f653236,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketSetMarkRequest,
fidl_fuchsia_posix_socket::BaseSocketSetMarkResult,
>(
(domain, mark,),
0x6ead6de09f653236,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetMarkResponseFut = fidl::client::QueryResponseFut<
fidl_fuchsia_posix_socket::BaseSocketGetMarkResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_mark(
&self,
mut domain: fidl_fuchsia_posix_socket::MarkDomain,
) -> Self::GetMarkResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetMarkResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetMarkResponse,
fidl_fuchsia_posix::Errno,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x57a2752c61d93d47,
>(_buf?)?;
Ok(_response.map(|x| x.mark))
}
self.client.send_query_and_decode::<
fidl_fuchsia_posix_socket::BaseSocketGetMarkRequest,
fidl_fuchsia_posix_socket::BaseSocketGetMarkResult,
>(
(domain,),
0x57a2752c61d93d47,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type DescribeResponseFut = fidl::client::QueryResponseFut<
SocketDescribeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#describe(&self) -> Self::DescribeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SocketDescribeResponse, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
SocketDescribeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4fd7c08c9c804484,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SocketDescribeResponse>(
(),
0x4fd7c08c9c804484,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type BindResponseFut = fidl::client::QueryResponseFut<
SocketBindResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#bind(
&self,
mut protocol: Option<&ProtocolAssociation>,
mut bound_interface_id: &BoundInterfaceId,
) -> Self::BindResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SocketBindResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6caedb2d31b56db8,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<SocketBindRequest, SocketBindResult>(
(protocol, bound_interface_id),
0x6caedb2d31b56db8,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetInfoResponseFut = fidl::client::QueryResponseFut<
SocketGetInfoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_info(&self) -> Self::GetInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SocketGetInfoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<SocketGetInfoResponse, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7f67457e85c3914c,
>(_buf?)?;
Ok(_response.map(|x| (x.kind, x.protocol, x.bound_interface)))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SocketGetInfoResult>(
(),
0x7f67457e85c3914c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RecvMsgResponseFut = fidl::client::QueryResponseFut<
SocketRecvMsgResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#recv_msg(
&self,
mut want_packet_info: bool,
mut data_len: u32,
mut want_control: bool,
mut flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
) -> Self::RecvMsgResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SocketRecvMsgResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<SocketRecvMsgResponse, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x52b95ba982826a61,
>(_buf?)?;
Ok(_response.map(|x| (x.packet_info, x.data, x.control, x.truncated)))
}
self.client.send_query_and_decode::<SocketRecvMsgRequest, SocketRecvMsgResult>(
(want_packet_info, data_len, want_control, flags),
0x52b95ba982826a61,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SendMsgResponseFut = fidl::client::QueryResponseFut<
SocketSendMsgResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#send_msg(
&self,
mut packet_info: Option<&PacketInfo>,
mut data: &[u8],
mut control: &SendControlData,
mut flags: fidl_fuchsia_posix_socket::SendMsgFlags,
) -> Self::SendMsgResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SocketSendMsgResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x150c9ff91f944922,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<SocketSendMsgRequest, SocketSendMsgResult>(
(packet_info, data, control, flags),
0x150c9ff91f944922,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type AttachBpfFilterUnsafeResponseFut = fidl::client::QueryResponseFut<
SocketAttachBpfFilterUnsafeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#attach_bpf_filter_unsafe(
&self,
mut code: &[u64],
) -> Self::AttachBpfFilterUnsafeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<SocketAttachBpfFilterUnsafeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x593998d38670f823,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
SocketAttachBpfFilterUnsafeRequest,
SocketAttachBpfFilterUnsafeResult,
>(
(code,),
0x593998d38670f823,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct SocketEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for SocketEventStream {}
impl futures::stream::FusedStream for SocketEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for SocketEventStream {
type Item = Result<SocketEvent, 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(SocketEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum SocketEvent {}
impl SocketEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<SocketEvent, 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: <SocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct SocketRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for SocketRequestStream {}
impl futures::stream::FusedStream for SocketRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for SocketRequestStream {
type Protocol = SocketMarker;
type ControlHandle = SocketControlHandle;
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 {
SocketControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for SocketRequestStream {
type Item = Result<SocketRequest, 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 SocketRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x20d8a7aba2168a79 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_unknown::CloneableClone2Request,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableClone2Request>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::Clone2 { request: req.request, control_handle })
}
0x5ac5d459ad7f657e => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::Close {
responder: SocketCloseResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2658edee9decfc06 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::Query {
responder: SocketQueryResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1fd74ee8b9a4a876 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetReuseAddress {
value: req.value,
responder: SocketSetReuseAddressResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x67b7206b8d1bc0a5 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetReuseAddress {
responder: SocketGetReuseAddressResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5aad39b33e5f6ebb => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetError {
responder: SocketGetErrorResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6023e081ce3cd947 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetBroadcastRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetBroadcastRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetBroadcast {
value: req.value,
responder: SocketSetBroadcastResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x68796fc556f9780d => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetBroadcast {
responder: SocketGetBroadcastResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x756eac32d73a7a70 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetSendBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetSendBufferRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetSendBuffer {
value_bytes: req.value_bytes,
responder: SocketSetSendBufferResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x78a52fd9c7b2410b => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetSendBuffer {
responder: SocketGetSendBufferResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6b0cf2f1919c7001 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetReceiveBuffer {
value_bytes: req.value_bytes,
responder: SocketSetReceiveBufferResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x14c1a4b64f709e5c => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetReceiveBuffer {
responder: SocketGetReceiveBufferResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x572df8f0b920d2c7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetKeepAlive {
value: req.value,
responder: SocketSetKeepAliveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2dd29d3215f2c9d2 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetKeepAlive {
responder: SocketGetKeepAliveResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3ecb49968bee439 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetOutOfBandInline {
value: req.value,
responder: SocketSetOutOfBandInlineResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x348c1ab3aeca1745 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetOutOfBandInline {
responder: SocketGetOutOfBandInlineResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6bbf00c53a4c78c2 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetNoCheckRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetNoCheckRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetNoCheck {
value: req.value,
responder: SocketSetNoCheckResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2cd4249286417694 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetNoCheck {
responder: SocketGetNoCheckResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x45386351246e998e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetLingerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetLingerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetLinger {
linger: req.linger,
length_secs: req.length_secs,
responder: SocketSetLingerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x48eb20fc5ccb0e45 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetLinger {
responder: SocketGetLingerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x24dd3e5cb36d9ccb => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetReusePortRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetReusePortRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetReusePort {
value: req.value,
responder: SocketSetReusePortResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a112c1ab54ff828 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetReusePort {
responder: SocketGetReusePortResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x67ce6db6c2ec8966 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetAcceptConn {
responder: SocketGetAcceptConnResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2118b483f28aafc4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetBindToDevice {
value: req.value,
responder: SocketSetBindToDeviceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1ab1fbf0ef7906c8 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetBindToDevice {
responder: SocketGetBindToDeviceResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6e387a0def00821 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetBindToInterfaceIndex {
value: req.value,
responder: SocketSetBindToInterfaceIndexResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x59c31dd3e3078295 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetBindToInterfaceIndex {
responder: SocketGetBindToInterfaceIndexResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x285d6516c263d839 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetTimestampRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetTimestampRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetTimestamp {
value: req.value,
responder: SocketSetTimestampResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x49f2fffbbcc2bd27 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetTimestamp {
responder: SocketGetTimestampResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6ead6de09f653236 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketSetMarkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetMarkRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SetMark {
domain: req.domain,
mark: req.mark,
responder: SocketSetMarkResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x57a2752c61d93d47 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl_fuchsia_posix_socket::BaseSocketGetMarkRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketGetMarkRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetMark {
domain: req.domain,
responder: SocketGetMarkResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4fd7c08c9c804484 => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::Describe {
responder: SocketDescribeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6caedb2d31b56db8 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
SocketBindRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SocketBindRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::Bind {
protocol: req.protocol,
bound_interface_id: req.bound_interface_id,
responder: SocketBindResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7f67457e85c3914c => {
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 = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::GetInfo {
responder: SocketGetInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x52b95ba982826a61 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
SocketRecvMsgRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SocketRecvMsgRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::RecvMsg {
want_packet_info: req.want_packet_info,
data_len: req.data_len,
want_control: req.want_control,
flags: req.flags,
responder: SocketRecvMsgResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x150c9ff91f944922 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
SocketSendMsgRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SocketSendMsgRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::SendMsg {
packet_info: req.packet_info,
data: req.data,
control: req.control,
flags: req.flags,
responder: SocketSendMsgResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x593998d38670f823 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
SocketAttachBpfFilterUnsafeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SocketAttachBpfFilterUnsafeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = SocketControlHandle { inner: this.inner.clone() };
Ok(SocketRequest::AttachBpfFilterUnsafe {
code: req.code,
responder: SocketAttachBpfFilterUnsafeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<SocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum SocketRequest {
Clone2 {
request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
control_handle: SocketControlHandle,
},
Close {
responder: SocketCloseResponder,
},
Query {
responder: SocketQueryResponder,
},
SetReuseAddress {
value: bool,
responder: SocketSetReuseAddressResponder,
},
GetReuseAddress {
responder: SocketGetReuseAddressResponder,
},
GetError {
responder: SocketGetErrorResponder,
},
SetBroadcast {
value: bool,
responder: SocketSetBroadcastResponder,
},
GetBroadcast {
responder: SocketGetBroadcastResponder,
},
SetSendBuffer {
value_bytes: u64,
responder: SocketSetSendBufferResponder,
},
GetSendBuffer {
responder: SocketGetSendBufferResponder,
},
SetReceiveBuffer {
value_bytes: u64,
responder: SocketSetReceiveBufferResponder,
},
GetReceiveBuffer {
responder: SocketGetReceiveBufferResponder,
},
SetKeepAlive {
value: bool,
responder: SocketSetKeepAliveResponder,
},
GetKeepAlive {
responder: SocketGetKeepAliveResponder,
},
SetOutOfBandInline {
value: bool,
responder: SocketSetOutOfBandInlineResponder,
},
GetOutOfBandInline {
responder: SocketGetOutOfBandInlineResponder,
},
SetNoCheck {
value: bool,
responder: SocketSetNoCheckResponder,
},
GetNoCheck {
responder: SocketGetNoCheckResponder,
},
SetLinger {
linger: bool,
length_secs: u32,
responder: SocketSetLingerResponder,
},
GetLinger {
responder: SocketGetLingerResponder,
},
SetReusePort {
value: bool,
responder: SocketSetReusePortResponder,
},
GetReusePort {
responder: SocketGetReusePortResponder,
},
GetAcceptConn {
responder: SocketGetAcceptConnResponder,
},
SetBindToDevice {
value: String,
responder: SocketSetBindToDeviceResponder,
},
GetBindToDevice {
responder: SocketGetBindToDeviceResponder,
},
SetBindToInterfaceIndex {
value: u64,
responder: SocketSetBindToInterfaceIndexResponder,
},
GetBindToInterfaceIndex {
responder: SocketGetBindToInterfaceIndexResponder,
},
SetTimestamp {
value: fidl_fuchsia_posix_socket::TimestampOption,
responder: SocketSetTimestampResponder,
},
GetTimestamp {
responder: SocketGetTimestampResponder,
},
SetMark {
domain: fidl_fuchsia_posix_socket::MarkDomain,
mark: fidl_fuchsia_posix_socket::OptionalUint32,
responder: SocketSetMarkResponder,
},
GetMark {
domain: fidl_fuchsia_posix_socket::MarkDomain,
responder: SocketGetMarkResponder,
},
Describe {
responder: SocketDescribeResponder,
},
Bind {
protocol: Option<Box<ProtocolAssociation>>,
bound_interface_id: BoundInterfaceId,
responder: SocketBindResponder,
},
GetInfo {
responder: SocketGetInfoResponder,
},
RecvMsg {
want_packet_info: bool,
data_len: u32,
want_control: bool,
flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
responder: SocketRecvMsgResponder,
},
SendMsg {
packet_info: Option<Box<PacketInfo>>,
data: Vec<u8>,
control: SendControlData,
flags: fidl_fuchsia_posix_socket::SendMsgFlags,
responder: SocketSendMsgResponder,
},
AttachBpfFilterUnsafe {
code: Vec<u64>,
responder: SocketAttachBpfFilterUnsafeResponder,
},
}
impl SocketRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_clone2(
self,
) -> Option<(
fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
SocketControlHandle,
)> {
if let SocketRequest::Clone2 { request, control_handle } = self {
Some((request, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_close(self) -> Option<(SocketCloseResponder)> {
if let SocketRequest::Close { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_query(self) -> Option<(SocketQueryResponder)> {
if let SocketRequest::Query { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_reuse_address(self) -> Option<(bool, SocketSetReuseAddressResponder)> {
if let SocketRequest::SetReuseAddress { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_reuse_address(self) -> Option<(SocketGetReuseAddressResponder)> {
if let SocketRequest::GetReuseAddress { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_error(self) -> Option<(SocketGetErrorResponder)> {
if let SocketRequest::GetError { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_broadcast(self) -> Option<(bool, SocketSetBroadcastResponder)> {
if let SocketRequest::SetBroadcast { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_broadcast(self) -> Option<(SocketGetBroadcastResponder)> {
if let SocketRequest::GetBroadcast { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_send_buffer(self) -> Option<(u64, SocketSetSendBufferResponder)> {
if let SocketRequest::SetSendBuffer { value_bytes, responder } = self {
Some((value_bytes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_send_buffer(self) -> Option<(SocketGetSendBufferResponder)> {
if let SocketRequest::GetSendBuffer { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_receive_buffer(self) -> Option<(u64, SocketSetReceiveBufferResponder)> {
if let SocketRequest::SetReceiveBuffer { value_bytes, responder } = self {
Some((value_bytes, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_receive_buffer(self) -> Option<(SocketGetReceiveBufferResponder)> {
if let SocketRequest::GetReceiveBuffer { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_keep_alive(self) -> Option<(bool, SocketSetKeepAliveResponder)> {
if let SocketRequest::SetKeepAlive { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_keep_alive(self) -> Option<(SocketGetKeepAliveResponder)> {
if let SocketRequest::GetKeepAlive { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_out_of_band_inline(self) -> Option<(bool, SocketSetOutOfBandInlineResponder)> {
if let SocketRequest::SetOutOfBandInline { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_out_of_band_inline(self) -> Option<(SocketGetOutOfBandInlineResponder)> {
if let SocketRequest::GetOutOfBandInline { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_no_check(self) -> Option<(bool, SocketSetNoCheckResponder)> {
if let SocketRequest::SetNoCheck { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_no_check(self) -> Option<(SocketGetNoCheckResponder)> {
if let SocketRequest::GetNoCheck { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_linger(self) -> Option<(bool, u32, SocketSetLingerResponder)> {
if let SocketRequest::SetLinger { linger, length_secs, responder } = self {
Some((linger, length_secs, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_linger(self) -> Option<(SocketGetLingerResponder)> {
if let SocketRequest::GetLinger { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_reuse_port(self) -> Option<(bool, SocketSetReusePortResponder)> {
if let SocketRequest::SetReusePort { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_reuse_port(self) -> Option<(SocketGetReusePortResponder)> {
if let SocketRequest::GetReusePort { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_accept_conn(self) -> Option<(SocketGetAcceptConnResponder)> {
if let SocketRequest::GetAcceptConn { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_bind_to_device(self) -> Option<(String, SocketSetBindToDeviceResponder)> {
if let SocketRequest::SetBindToDevice { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_bind_to_device(self) -> Option<(SocketGetBindToDeviceResponder)> {
if let SocketRequest::GetBindToDevice { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_bind_to_interface_index(
self,
) -> Option<(u64, SocketSetBindToInterfaceIndexResponder)> {
if let SocketRequest::SetBindToInterfaceIndex { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_bind_to_interface_index(
self,
) -> Option<(SocketGetBindToInterfaceIndexResponder)> {
if let SocketRequest::GetBindToInterfaceIndex { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_timestamp(
self,
) -> Option<(fidl_fuchsia_posix_socket::TimestampOption, SocketSetTimestampResponder)> {
if let SocketRequest::SetTimestamp { value, responder } = self {
Some((value, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_timestamp(self) -> Option<(SocketGetTimestampResponder)> {
if let SocketRequest::GetTimestamp { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_mark(
self,
) -> Option<(
fidl_fuchsia_posix_socket::MarkDomain,
fidl_fuchsia_posix_socket::OptionalUint32,
SocketSetMarkResponder,
)> {
if let SocketRequest::SetMark { domain, mark, responder } = self {
Some((domain, mark, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_mark(
self,
) -> Option<(fidl_fuchsia_posix_socket::MarkDomain, SocketGetMarkResponder)> {
if let SocketRequest::GetMark { domain, responder } = self {
Some((domain, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_describe(self) -> Option<(SocketDescribeResponder)> {
if let SocketRequest::Describe { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_bind(
self,
) -> Option<(Option<Box<ProtocolAssociation>>, BoundInterfaceId, SocketBindResponder)> {
if let SocketRequest::Bind { protocol, bound_interface_id, responder } = self {
Some((protocol, bound_interface_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_info(self) -> Option<(SocketGetInfoResponder)> {
if let SocketRequest::GetInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_recv_msg(
self,
) -> Option<(bool, u32, bool, fidl_fuchsia_posix_socket::RecvMsgFlags, SocketRecvMsgResponder)>
{
if let SocketRequest::RecvMsg {
want_packet_info,
data_len,
want_control,
flags,
responder,
} = self
{
Some((want_packet_info, data_len, want_control, flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_send_msg(
self,
) -> Option<(
Option<Box<PacketInfo>>,
Vec<u8>,
SendControlData,
fidl_fuchsia_posix_socket::SendMsgFlags,
SocketSendMsgResponder,
)> {
if let SocketRequest::SendMsg { packet_info, data, control, flags, responder } = self {
Some((packet_info, data, control, flags, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_attach_bpf_filter_unsafe(
self,
) -> Option<(Vec<u64>, SocketAttachBpfFilterUnsafeResponder)> {
if let SocketRequest::AttachBpfFilterUnsafe { code, responder } = self {
Some((code, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
SocketRequest::Clone2 { .. } => "clone2",
SocketRequest::Close { .. } => "close",
SocketRequest::Query { .. } => "query",
SocketRequest::SetReuseAddress { .. } => "set_reuse_address",
SocketRequest::GetReuseAddress { .. } => "get_reuse_address",
SocketRequest::GetError { .. } => "get_error",
SocketRequest::SetBroadcast { .. } => "set_broadcast",
SocketRequest::GetBroadcast { .. } => "get_broadcast",
SocketRequest::SetSendBuffer { .. } => "set_send_buffer",
SocketRequest::GetSendBuffer { .. } => "get_send_buffer",
SocketRequest::SetReceiveBuffer { .. } => "set_receive_buffer",
SocketRequest::GetReceiveBuffer { .. } => "get_receive_buffer",
SocketRequest::SetKeepAlive { .. } => "set_keep_alive",
SocketRequest::GetKeepAlive { .. } => "get_keep_alive",
SocketRequest::SetOutOfBandInline { .. } => "set_out_of_band_inline",
SocketRequest::GetOutOfBandInline { .. } => "get_out_of_band_inline",
SocketRequest::SetNoCheck { .. } => "set_no_check",
SocketRequest::GetNoCheck { .. } => "get_no_check",
SocketRequest::SetLinger { .. } => "set_linger",
SocketRequest::GetLinger { .. } => "get_linger",
SocketRequest::SetReusePort { .. } => "set_reuse_port",
SocketRequest::GetReusePort { .. } => "get_reuse_port",
SocketRequest::GetAcceptConn { .. } => "get_accept_conn",
SocketRequest::SetBindToDevice { .. } => "set_bind_to_device",
SocketRequest::GetBindToDevice { .. } => "get_bind_to_device",
SocketRequest::SetBindToInterfaceIndex { .. } => "set_bind_to_interface_index",
SocketRequest::GetBindToInterfaceIndex { .. } => "get_bind_to_interface_index",
SocketRequest::SetTimestamp { .. } => "set_timestamp",
SocketRequest::GetTimestamp { .. } => "get_timestamp",
SocketRequest::SetMark { .. } => "set_mark",
SocketRequest::GetMark { .. } => "get_mark",
SocketRequest::Describe { .. } => "describe",
SocketRequest::Bind { .. } => "bind",
SocketRequest::GetInfo { .. } => "get_info",
SocketRequest::RecvMsg { .. } => "recv_msg",
SocketRequest::SendMsg { .. } => "send_msg",
SocketRequest::AttachBpfFilterUnsafe { .. } => "attach_bpf_filter_unsafe",
}
}
}
#[derive(Debug, Clone)]
pub struct SocketControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for SocketControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl SocketControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketCloseResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketCloseResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketCloseResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketCloseResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x5ac5d459ad7f657e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketQueryResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketQueryResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketQueryResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketQueryResponder {
pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
let _result = self.send_raw(protocol);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
(protocol,),
self.tx_id,
0x2658edee9decfc06,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetReuseAddressResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetReuseAddressResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetReuseAddressResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetReuseAddressResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x1fd74ee8b9a4a876,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetReuseAddressResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetReuseAddressResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetReuseAddressResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetReuseAddressResponder {
pub fn send(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x67b7206b8d1bc0a5,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetErrorResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetErrorResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetErrorResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetErrorResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x5aad39b33e5f6ebb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetBroadcastResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetBroadcastResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetBroadcastResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetBroadcastResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x6023e081ce3cd947,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetBroadcastResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetBroadcastResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetBroadcastResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetBroadcastResponder {
pub fn send(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x68796fc556f9780d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetSendBufferResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetSendBufferResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetSendBufferResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetSendBufferResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x756eac32d73a7a70,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetSendBufferResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetSendBufferResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetSendBufferResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetSendBufferResponder {
pub fn send(
self,
mut result: Result<u64, fidl_fuchsia_posix::Errno>,
) -> 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<u64, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<u64, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value_bytes| (value_bytes,)),
self.tx_id,
0x78a52fd9c7b2410b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetReceiveBufferResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetReceiveBufferResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetReceiveBufferResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetReceiveBufferResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x6b0cf2f1919c7001,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetReceiveBufferResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetReceiveBufferResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetReceiveBufferResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetReceiveBufferResponder {
pub fn send(
self,
mut result: Result<u64, fidl_fuchsia_posix::Errno>,
) -> 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<u64, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<u64, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value_bytes| (value_bytes,)),
self.tx_id,
0x14c1a4b64f709e5c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetKeepAliveResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetKeepAliveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetKeepAliveResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetKeepAliveResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x572df8f0b920d2c7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetKeepAliveResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetKeepAliveResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetKeepAliveResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetKeepAliveResponder {
pub fn send(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x2dd29d3215f2c9d2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetOutOfBandInlineResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetOutOfBandInlineResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetOutOfBandInlineResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetOutOfBandInlineResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x3ecb49968bee439,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetOutOfBandInlineResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetOutOfBandInlineResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetOutOfBandInlineResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetOutOfBandInlineResponder {
pub fn send(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x348c1ab3aeca1745,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetNoCheckResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetNoCheckResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetNoCheckResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetNoCheckResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x6bbf00c53a4c78c2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetNoCheckResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetNoCheckResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetNoCheckResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetNoCheckResponder {
pub fn send(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x2cd4249286417694,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetLingerResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetLingerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetLingerResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetLingerResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x45386351246e998e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetLingerResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetLingerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetLingerResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetLingerResponder {
pub fn send(
self,
mut result: Result<(bool, u32), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(bool, u32), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(bool, u32), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetLingerResponse,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x48eb20fc5ccb0e45,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetReusePortResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetReusePortResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetReusePortResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetReusePortResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x24dd3e5cb36d9ccb,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetReusePortResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetReusePortResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetReusePortResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetReusePortResponder {
pub fn send(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetReusePortResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x7a112c1ab54ff828,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetAcceptConnResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetAcceptConnResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetAcceptConnResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetAcceptConnResponder {
pub fn send(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<bool, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x67ce6db6c2ec8966,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetBindToDeviceResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetBindToDeviceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetBindToDeviceResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetBindToDeviceResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x2118b483f28aafc4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetBindToDeviceResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetBindToDeviceResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetBindToDeviceResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetBindToDeviceResponder {
pub fn send(
self,
mut result: Result<&str, fidl_fuchsia_posix::Errno>,
) -> 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<&str, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&str, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x1ab1fbf0ef7906c8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetBindToInterfaceIndexResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetBindToInterfaceIndexResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetBindToInterfaceIndexResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetBindToInterfaceIndexResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x6e387a0def00821,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetBindToInterfaceIndexResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetBindToInterfaceIndexResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetBindToInterfaceIndexResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetBindToInterfaceIndexResponder {
pub fn send(
self,
mut result: Result<u64, fidl_fuchsia_posix::Errno>,
) -> 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<u64, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<u64, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x59c31dd3e3078295,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetTimestampResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetTimestampResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetTimestampResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetTimestampResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x285d6516c263d839,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetTimestampResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetTimestampResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetTimestampResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetTimestampResponder {
pub fn send(
self,
mut result: Result<fidl_fuchsia_posix_socket::TimestampOption, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<fidl_fuchsia_posix_socket::TimestampOption, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<fidl_fuchsia_posix_socket::TimestampOption, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetTimestampResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|value| (value,)),
self.tx_id,
0x49f2fffbbcc2bd27,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSetMarkResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSetMarkResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSetMarkResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSetMarkResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x6ead6de09f653236,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetMarkResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetMarkResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetMarkResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetMarkResponder {
pub fn send(
self,
mut result: Result<&fidl_fuchsia_posix_socket::OptionalUint32, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&fidl_fuchsia_posix_socket::OptionalUint32, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&fidl_fuchsia_posix_socket::OptionalUint32, fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl_fuchsia_posix_socket::BaseSocketGetMarkResponse,
fidl_fuchsia_posix::Errno,
>>(
result.map(|mark| (mark,)),
self.tx_id,
0x57a2752c61d93d47,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketDescribeResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketDescribeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketDescribeResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketDescribeResponder {
pub fn send(self, mut payload: SocketDescribeResponse) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut payload: SocketDescribeResponse,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(payload);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut payload: SocketDescribeResponse) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<SocketDescribeResponse>(
&mut payload,
self.tx_id,
0x4fd7c08c9c804484,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketBindResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketBindResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketBindResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketBindResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x6caedb2d31b56db8,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketGetInfoResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketGetInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketGetInfoResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketGetInfoResponder {
pub fn send(
self,
mut result: Result<
(Kind, Option<&ProtocolAssociation>, &BoundInterface),
fidl_fuchsia_posix::Errno,
>,
) -> 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<
(Kind, Option<&ProtocolAssociation>, &BoundInterface),
fidl_fuchsia_posix::Errno,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
(Kind, Option<&ProtocolAssociation>, &BoundInterface),
fidl_fuchsia_posix::Errno,
>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
SocketGetInfoResponse,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x7f67457e85c3914c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketRecvMsgResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketRecvMsgResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketRecvMsgResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketRecvMsgResponder {
pub fn send(
self,
mut result: Result<
(Option<&RecvPacketInfo>, &[u8], &RecvControlData, u32),
fidl_fuchsia_posix::Errno,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<
(Option<&RecvPacketInfo>, &[u8], &RecvControlData, u32),
fidl_fuchsia_posix::Errno,
>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<
(Option<&RecvPacketInfo>, &[u8], &RecvControlData, u32),
fidl_fuchsia_posix::Errno,
>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
SocketRecvMsgResponse,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x52b95ba982826a61,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketSendMsgResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketSendMsgResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketSendMsgResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketSendMsgResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x150c9ff91f944922,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct SocketAttachBpfFilterUnsafeResponder {
control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for SocketAttachBpfFilterUnsafeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for SocketAttachBpfFilterUnsafeResponder {
type ControlHandle = SocketControlHandle;
fn control_handle(&self) -> &SocketControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl SocketAttachBpfFilterUnsafeResponder {
pub fn send(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(), fidl_fuchsia_posix::Errno>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
fidl_fuchsia_posix::Errno,
>>(
result,
self.tx_id,
0x593998d38670f823,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for HardwareType {
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 HardwareType {
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 HardwareType {
#[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 HardwareType {
#[inline(always)]
fn new_empty() -> Self {
Self::NetworkOnly
}
#[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 Kind {
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 Kind {
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 Kind {
#[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 Kind {
#[inline(always)]
fn new_empty() -> Self {
Self::Network
}
#[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 PacketType {
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 PacketType {
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 PacketType {
#[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 PacketType {
#[inline(always)]
fn new_empty() -> Self {
Self::Host
}
#[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 Empty {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Empty {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Empty, D> for &Empty {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Empty>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Empty {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ValueTypeMarker for InterfaceProperties {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for InterfaceProperties {
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<InterfaceProperties, D>
for &InterfaceProperties
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<InterfaceProperties>(offset);
fidl::encoding::Encode::<InterfaceProperties, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
<HardwareAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
<HardwareType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<HardwareAddress, D>,
T2: fidl::encoding::Encode<HardwareType, D>,
> fidl::encoding::Encode<InterfaceProperties, 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::<InterfaceProperties>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InterfaceProperties {
#[inline(always)]
fn new_empty() -> Self {
Self {
id: fidl::new_empty!(u64, D),
addr: fidl::new_empty!(HardwareAddress, D),
type_: fidl::new_empty!(HardwareType, 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(24) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u64, D, &mut self.id, decoder, offset + 0, _depth)?;
fidl::decode!(HardwareAddress, D, &mut self.addr, decoder, offset + 8, _depth)?;
fidl::decode!(HardwareType, D, &mut self.type_, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PacketInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PacketInfo {
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<PacketInfo, D>
for &PacketInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PacketInfo>(offset);
fidl::encoding::Encode::<PacketInfo, D>::encode(
(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.protocol),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
<HardwareAddress as fidl::encoding::ValueTypeMarker>::borrow(&self.addr),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u16, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<HardwareAddress, D>,
> fidl::encoding::Encode<PacketInfo, 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::<PacketInfo>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PacketInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
protocol: fidl::new_empty!(u16, D),
interface_id: fidl::new_empty!(u64, D),
addr: fidl::new_empty!(HardwareAddress, 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 = 0xffffffffffff0000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u16, D, &mut self.protocol, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.interface_id, decoder, offset + 8, _depth)?;
fidl::decode!(HardwareAddress, D, &mut self.addr, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProviderSocketRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProviderSocketRequest {
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<ProviderSocketRequest, D>
for &ProviderSocketRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProviderSocketRequest>(offset);
fidl::encoding::Encode::<ProviderSocketRequest, D>::encode(
(<Kind as fidl::encoding::ValueTypeMarker>::borrow(&self.kind),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Kind, D>>
fidl::encoding::Encode<ProviderSocketRequest, 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::<ProviderSocketRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProviderSocketRequest {
#[inline(always)]
fn new_empty() -> Self {
Self { kind: fidl::new_empty!(Kind, 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!(Kind, D, &mut self.kind, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for ProviderSocketResponse {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProviderSocketResponse {
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
fidl::encoding::Encode<
ProviderSocketResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut ProviderSocketResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProviderSocketResponse>(offset);
fidl::encoding::Encode::<ProviderSocketResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SocketMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SocketMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
ProviderSocketResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProviderSocketResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for ProviderSocketResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
socket: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SocketMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SocketMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.socket,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RecvPacketInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RecvPacketInfo {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RecvPacketInfo, D>
for &RecvPacketInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RecvPacketInfo>(offset);
fidl::encoding::Encode::<RecvPacketInfo, D>::encode(
(
<PacketInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.packet_info),
<PacketType as fidl::encoding::ValueTypeMarker>::borrow(&self.packet_type),
<HardwareType as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_type),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<PacketInfo, D>,
T1: fidl::encoding::Encode<PacketType, D>,
T2: fidl::encoding::Encode<HardwareType, D>,
> fidl::encoding::Encode<RecvPacketInfo, 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::<RecvPacketInfo>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 32, depth)?;
self.2.encode(encoder, offset + 36, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RecvPacketInfo {
#[inline(always)]
fn new_empty() -> Self {
Self {
packet_info: fidl::new_empty!(PacketInfo, D),
packet_type: fidl::new_empty!(PacketType, D),
interface_type: fidl::new_empty!(HardwareType, 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!(PacketInfo, D, &mut self.packet_info, decoder, offset + 0, _depth)?;
fidl::decode!(PacketType, D, &mut self.packet_type, decoder, offset + 32, _depth)?;
fidl::decode!(HardwareType, D, &mut self.interface_type, decoder, offset + 36, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for SocketAttachBpfFilterUnsafeRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SocketAttachBpfFilterUnsafeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
SocketAttachBpfFilterUnsafeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut SocketAttachBpfFilterUnsafeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SocketAttachBpfFilterUnsafeRequest>(offset);
fidl::encoding::Encode::<
SocketAttachBpfFilterUnsafeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(<fidl::encoding::Vector<u64, 4096> as fidl::encoding::ValueTypeMarker>::borrow(
&self.code,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Vector<u64, 4096>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
SocketAttachBpfFilterUnsafeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SocketAttachBpfFilterUnsafeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SocketAttachBpfFilterUnsafeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
code: fidl::new_empty!(fidl::encoding::Vector<u64, 4096>, fidl::encoding::DefaultFuchsiaResourceDialect),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<u64, 4096>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.code, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SocketBindRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SocketBindRequest {
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<SocketBindRequest, D>
for &SocketBindRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SocketBindRequest>(offset);
fidl::encoding::Encode::<SocketBindRequest, D>::encode(
(
<fidl::encoding::OptionalUnion<ProtocolAssociation> as fidl::encoding::ValueTypeMarker>::borrow(&self.protocol),
<BoundInterfaceId as fidl::encoding::ValueTypeMarker>::borrow(&self.bound_interface_id),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::OptionalUnion<ProtocolAssociation>, D>,
T1: fidl::encoding::Encode<BoundInterfaceId, D>,
> fidl::encoding::Encode<SocketBindRequest, 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::<SocketBindRequest>(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 SocketBindRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
protocol: fidl::new_empty!(fidl::encoding::OptionalUnion<ProtocolAssociation>, D),
bound_interface_id: fidl::new_empty!(BoundInterfaceId, 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::OptionalUnion<ProtocolAssociation>,
D,
&mut self.protocol,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
BoundInterfaceId,
D,
&mut self.bound_interface_id,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SocketRecvMsgRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SocketRecvMsgRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
12
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketRecvMsgRequest, D>
for &SocketRecvMsgRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SocketRecvMsgRequest>(offset);
fidl::encoding::Encode::<SocketRecvMsgRequest, D>::encode(
(
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_packet_info),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_len),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.want_control),
<fidl_fuchsia_posix_socket::RecvMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<bool, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<bool, D>,
T3: fidl::encoding::Encode<fidl_fuchsia_posix_socket::RecvMsgFlags, D>,
> fidl::encoding::Encode<SocketRecvMsgRequest, 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::<SocketRecvMsgRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u32).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u32).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
self.3.encode(encoder, offset + 10, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketRecvMsgRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
want_packet_info: fidl::new_empty!(bool, D),
data_len: fidl::new_empty!(u32, D),
want_control: fidl::new_empty!(bool, D),
flags: fidl::new_empty!(fidl_fuchsia_posix_socket::RecvMsgFlags, 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 u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(bool, D, &mut self.want_packet_info, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.data_len, decoder, offset + 4, _depth)?;
fidl::decode!(bool, D, &mut self.want_control, decoder, offset + 8, _depth)?;
fidl::decode!(
fidl_fuchsia_posix_socket::RecvMsgFlags,
D,
&mut self.flags,
decoder,
offset + 10,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SocketSendMsgRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SocketSendMsgRequest {
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<SocketSendMsgRequest, D>
for &SocketSendMsgRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SocketSendMsgRequest>(offset);
fidl::encoding::Encode::<SocketSendMsgRequest, D>::encode(
(
<fidl::encoding::Boxed<PacketInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.packet_info),
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
<SendControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
<fidl_fuchsia_posix_socket::SendMsgFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Boxed<PacketInfo>, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
T2: fidl::encoding::Encode<SendControlData, D>,
T3: fidl::encoding::Encode<fidl_fuchsia_posix_socket::SendMsgFlags, D>,
> fidl::encoding::Encode<SocketSendMsgRequest, 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::<SocketSendMsgRequest>(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 + 8, 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 SocketSendMsgRequest {
#[inline(always)]
fn new_empty() -> Self {
Self {
packet_info: fidl::new_empty!(fidl::encoding::Boxed<PacketInfo>, D),
data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
control: fidl::new_empty!(SendControlData, D),
flags: fidl::new_empty!(fidl_fuchsia_posix_socket::SendMsgFlags, 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::encoding::Boxed<PacketInfo>,
D,
&mut self.packet_info,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.data,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(SendControlData, D, &mut self.control, decoder, offset + 24, _depth)?;
fidl::decode!(
fidl_fuchsia_posix_socket::SendMsgFlags,
D,
&mut self.flags,
decoder,
offset + 40,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SocketGetInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SocketGetInfoResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
40
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SocketGetInfoResponse, D>
for &SocketGetInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SocketGetInfoResponse>(offset);
fidl::encoding::Encode::<SocketGetInfoResponse, D>::encode(
(
<Kind as fidl::encoding::ValueTypeMarker>::borrow(&self.kind),
<fidl::encoding::OptionalUnion<ProtocolAssociation> as fidl::encoding::ValueTypeMarker>::borrow(&self.protocol),
<BoundInterface as fidl::encoding::ValueTypeMarker>::borrow(&self.bound_interface),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Kind, D>,
T1: fidl::encoding::Encode<fidl::encoding::OptionalUnion<ProtocolAssociation>, D>,
T2: fidl::encoding::Encode<BoundInterface, D>,
> fidl::encoding::Encode<SocketGetInfoResponse, 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::<SocketGetInfoResponse>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SocketGetInfoResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
kind: fidl::new_empty!(Kind, D),
protocol: fidl::new_empty!(fidl::encoding::OptionalUnion<ProtocolAssociation>, D),
bound_interface: fidl::new_empty!(BoundInterface, 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 = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(Kind, D, &mut self.kind, decoder, offset + 0, _depth)?;
fidl::decode!(
fidl::encoding::OptionalUnion<ProtocolAssociation>,
D,
&mut self.protocol,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
BoundInterface,
D,
&mut self.bound_interface,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for SocketRecvMsgResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SocketRecvMsgResponse {
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<SocketRecvMsgResponse, D>
for &SocketRecvMsgResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SocketRecvMsgResponse>(offset);
fidl::encoding::Encode::<SocketRecvMsgResponse, D>::encode(
(
<fidl::encoding::Boxed<RecvPacketInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.packet_info),
<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
<RecvControlData as fidl::encoding::ValueTypeMarker>::borrow(&self.control),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.truncated),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Boxed<RecvPacketInfo>, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
T2: fidl::encoding::Encode<RecvControlData, D>,
T3: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<SocketRecvMsgResponse, 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::<SocketRecvMsgResponse>(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 + 8, 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 SocketRecvMsgResponse {
#[inline(always)]
fn new_empty() -> Self {
Self {
packet_info: fidl::new_empty!(fidl::encoding::Boxed<RecvPacketInfo>, D),
data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
control: fidl::new_empty!(RecvControlData, D),
truncated: fidl::new_empty!(u32, 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 = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::Boxed<RecvPacketInfo>,
D,
&mut self.packet_info,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedVector<u8>,
D,
&mut self.data,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(RecvControlData, D, &mut self.control, decoder, offset + 24, _depth)?;
fidl::decode!(u32, D, &mut self.truncated, decoder, offset + 40, _depth)?;
Ok(())
}
}
impl RecvControlData {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.socket {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for RecvControlData {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RecvControlData {
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<RecvControlData, D>
for &RecvControlData
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RecvControlData>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_posix_socket::SocketRecvControlData, D>(
self.socket.as_ref().map(<fidl_fuchsia_posix_socket::SocketRecvControlData 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 RecvControlData {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_posix_socket::SocketRecvControlData 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.socket.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_posix_socket::SocketRecvControlData, D)
});
fidl::decode!(
fidl_fuchsia_posix_socket::SocketRecvControlData,
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 SendControlData {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.socket {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for SendControlData {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SendControlData {
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<SendControlData, D>
for &SendControlData
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SendControlData>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_posix_socket::SocketSendControlData, D>(
self.socket.as_ref().map(<fidl_fuchsia_posix_socket::SocketSendControlData 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 SendControlData {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl_fuchsia_posix_socket::SocketSendControlData 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.socket.get_or_insert_with(|| {
fidl::new_empty!(fidl_fuchsia_posix_socket::SocketSendControlData, D)
});
fidl::decode!(
fidl_fuchsia_posix_socket::SocketSendControlData,
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 SocketDescribeResponse {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.event {
return 1;
}
0
}
}
impl fidl::encoding::ResourceTypeMarker for SocketDescribeResponse {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SocketDescribeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
SocketDescribeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut SocketDescribeResponse
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SocketDescribeResponse>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<
fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>(
self.event.as_mut().map(
<fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for SocketDescribeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::HandleType<
fidl::EventPair,
{ fidl::ObjectType::EVENTPAIR.into_raw() },
2147483648,
> 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.event.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BoundInterface {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BoundInterface {
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<BoundInterface, D>
for &BoundInterface
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BoundInterface>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
BoundInterface::All(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
<Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
BoundInterface::Specified(ref val) => {
fidl::encoding::encode_in_envelope::<InterfaceProperties, D>(
<InterfaceProperties as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BoundInterface {
#[inline(always)]
fn new_empty() -> Self {
Self::All(fidl::new_empty!(Empty, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <InterfaceProperties as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let BoundInterface::All(_) = self {
} else {
*self = BoundInterface::All(fidl::new_empty!(Empty, D));
}
#[allow(irrefutable_let_patterns)]
if let BoundInterface::All(ref mut val) = self {
fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let BoundInterface::Specified(_) = self {
} else {
*self = BoundInterface::Specified(fidl::new_empty!(InterfaceProperties, D));
}
#[allow(irrefutable_let_patterns)]
if let BoundInterface::Specified(ref mut val) = self {
fidl::decode!(InterfaceProperties, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BoundInterfaceId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BoundInterfaceId {
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<BoundInterfaceId, D>
for &BoundInterfaceId
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BoundInterfaceId>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
BoundInterfaceId::All(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
<Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
BoundInterfaceId::Specified(ref val) => {
fidl::encoding::encode_in_envelope::<u64, D>(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BoundInterfaceId {
#[inline(always)]
fn new_empty() -> Self {
Self::All(fidl::new_empty!(Empty, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let BoundInterfaceId::All(_) = self {
} else {
*self = BoundInterfaceId::All(fidl::new_empty!(Empty, D));
}
#[allow(irrefutable_let_patterns)]
if let BoundInterfaceId::All(ref mut val) = self {
fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let BoundInterfaceId::Specified(_) = self {
} else {
*self = BoundInterfaceId::Specified(fidl::new_empty!(u64, D));
}
#[allow(irrefutable_let_patterns)]
if let BoundInterfaceId::Specified(ref mut val) = self {
fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for HardwareAddress {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for HardwareAddress {
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<HardwareAddress, D>
for &HardwareAddress
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<HardwareAddress>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
HardwareAddress::None(ref val) => fidl::encoding::encode_in_envelope::<Empty, D>(
<Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
HardwareAddress::Eui48(ref val) => fidl::encoding::encode_in_envelope::<
fidl_fuchsia_net::MacAddress,
D,
>(
<fidl_fuchsia_net::MacAddress as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
HardwareAddress::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HardwareAddress {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <fidl_fuchsia_net::MacAddress as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let HardwareAddress::None(_) = self {
} else {
*self = HardwareAddress::None(fidl::new_empty!(Empty, D));
}
#[allow(irrefutable_let_patterns)]
if let HardwareAddress::None(ref mut val) = self {
fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let HardwareAddress::Eui48(_) = self {
} else {
*self = HardwareAddress::Eui48(fidl::new_empty!(
fidl_fuchsia_net::MacAddress,
D
));
}
#[allow(irrefutable_let_patterns)]
if let HardwareAddress::Eui48(ref mut val) = self {
fidl::decode!(
fidl_fuchsia_net::MacAddress,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = HardwareAddress::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ProtocolAssociation {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ProtocolAssociation {
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<ProtocolAssociation, D>
for &ProtocolAssociation
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ProtocolAssociation>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
ProtocolAssociation::All(ref val) => {
fidl::encoding::encode_in_envelope::<Empty, D>(
<Empty as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
ProtocolAssociation::Specified(ref val) => {
fidl::encoding::encode_in_envelope::<u16, D>(
<u16 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProtocolAssociation {
#[inline(always)]
fn new_empty() -> Self {
Self::All(fidl::new_empty!(Empty, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Empty as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let ProtocolAssociation::All(_) = self {
} else {
*self = ProtocolAssociation::All(fidl::new_empty!(Empty, D));
}
#[allow(irrefutable_let_patterns)]
if let ProtocolAssociation::All(ref mut val) = self {
fidl::decode!(Empty, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let ProtocolAssociation::Specified(_) = self {
} else {
*self = ProtocolAssociation::Specified(fidl::new_empty!(u16, D));
}
#[allow(irrefutable_let_patterns)]
if let ProtocolAssociation::Specified(ref mut val) = self {
fidl::decode!(u16, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
}