fidl_fuchsia_posix_socket_packet/
fidl_fuchsia_posix_socket_packet.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_posix_socket_packet__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ProviderSocketResponse {
16    pub socket: fidl::endpoints::ClientEnd<SocketMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ProviderSocketResponse {}
20
21#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct SocketAttachBpfFilterUnsafeRequest {
23    pub code: Vec<u64>,
24}
25
26impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
27    for SocketAttachBpfFilterUnsafeRequest
28{
29}
30
31#[derive(Debug, Default, PartialEq)]
32pub struct SocketDescribeResponse {
33    /// Signals additional information about the state of the socket such as
34    /// readiness or shutdown-ness.
35    pub event: Option<fidl::EventPair>,
36    #[doc(hidden)]
37    pub __source_breaking: fidl::marker::SourceBreaking,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SocketDescribeResponse {}
41
42#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
43pub struct ProviderMarker;
44
45impl fidl::endpoints::ProtocolMarker for ProviderMarker {
46    type Proxy = ProviderProxy;
47    type RequestStream = ProviderRequestStream;
48    #[cfg(target_os = "fuchsia")]
49    type SynchronousProxy = ProviderSynchronousProxy;
50
51    const DEBUG_NAME: &'static str = "fuchsia.posix.socket.packet.Provider";
52}
53impl fidl::endpoints::DiscoverableProtocolMarker for ProviderMarker {}
54pub type ProviderSocketResult =
55    Result<fidl::endpoints::ClientEnd<SocketMarker>, fidl_fuchsia_posix::Errno>;
56
57pub trait ProviderProxyInterface: Send + Sync {
58    type SocketResponseFut: std::future::Future<Output = Result<ProviderSocketResult, fidl::Error>>
59        + Send;
60    fn r#socket(&self, kind: Kind) -> Self::SocketResponseFut;
61}
62#[derive(Debug)]
63#[cfg(target_os = "fuchsia")]
64pub struct ProviderSynchronousProxy {
65    client: fidl::client::sync::Client,
66}
67
68#[cfg(target_os = "fuchsia")]
69impl fidl::endpoints::SynchronousProxy for ProviderSynchronousProxy {
70    type Proxy = ProviderProxy;
71    type Protocol = ProviderMarker;
72
73    fn from_channel(inner: fidl::Channel) -> Self {
74        Self::new(inner)
75    }
76
77    fn into_channel(self) -> fidl::Channel {
78        self.client.into_channel()
79    }
80
81    fn as_channel(&self) -> &fidl::Channel {
82        self.client.as_channel()
83    }
84}
85
86#[cfg(target_os = "fuchsia")]
87impl ProviderSynchronousProxy {
88    pub fn new(channel: fidl::Channel) -> Self {
89        let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
90        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
91    }
92
93    pub fn into_channel(self) -> fidl::Channel {
94        self.client.into_channel()
95    }
96
97    /// Waits until an event arrives and returns it. It is safe for other
98    /// threads to make concurrent requests while waiting for an event.
99    pub fn wait_for_event(
100        &self,
101        deadline: zx::MonotonicInstant,
102    ) -> Result<ProviderEvent, fidl::Error> {
103        ProviderEvent::decode(self.client.wait_for_event(deadline)?)
104    }
105
106    /// Requests a packet socket.
107    ///
108    /// + request `kind` the kind of packet socket to create.
109    /// - response `socket` the packet socket.
110    pub fn r#socket(
111        &self,
112        mut kind: Kind,
113        ___deadline: zx::MonotonicInstant,
114    ) -> Result<ProviderSocketResult, fidl::Error> {
115        let _response =
116            self.client.send_query::<ProviderSocketRequest, fidl::encoding::ResultType<
117                ProviderSocketResponse,
118                fidl_fuchsia_posix::Errno,
119            >>(
120                (kind,),
121                0x3aad2da99889858e,
122                fidl::encoding::DynamicFlags::empty(),
123                ___deadline,
124            )?;
125        Ok(_response.map(|x| x.socket))
126    }
127}
128
129#[cfg(target_os = "fuchsia")]
130impl From<ProviderSynchronousProxy> for zx::Handle {
131    fn from(value: ProviderSynchronousProxy) -> Self {
132        value.into_channel().into()
133    }
134}
135
136#[cfg(target_os = "fuchsia")]
137impl From<fidl::Channel> for ProviderSynchronousProxy {
138    fn from(value: fidl::Channel) -> Self {
139        Self::new(value)
140    }
141}
142
143#[cfg(target_os = "fuchsia")]
144impl fidl::endpoints::FromClient for ProviderSynchronousProxy {
145    type Protocol = ProviderMarker;
146
147    fn from_client(value: fidl::endpoints::ClientEnd<ProviderMarker>) -> Self {
148        Self::new(value.into_channel())
149    }
150}
151
152#[derive(Debug, Clone)]
153pub struct ProviderProxy {
154    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
155}
156
157impl fidl::endpoints::Proxy for ProviderProxy {
158    type Protocol = ProviderMarker;
159
160    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
161        Self::new(inner)
162    }
163
164    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
165        self.client.into_channel().map_err(|client| Self { client })
166    }
167
168    fn as_channel(&self) -> &::fidl::AsyncChannel {
169        self.client.as_channel()
170    }
171}
172
173impl ProviderProxy {
174    /// Create a new Proxy for fuchsia.posix.socket.packet/Provider.
175    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
176        let protocol_name = <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
177        Self { client: fidl::client::Client::new(channel, protocol_name) }
178    }
179
180    /// Get a Stream of events from the remote end of the protocol.
181    ///
182    /// # Panics
183    ///
184    /// Panics if the event stream was already taken.
185    pub fn take_event_stream(&self) -> ProviderEventStream {
186        ProviderEventStream { event_receiver: self.client.take_event_receiver() }
187    }
188
189    /// Requests a packet socket.
190    ///
191    /// + request `kind` the kind of packet socket to create.
192    /// - response `socket` the packet socket.
193    pub fn r#socket(
194        &self,
195        mut kind: Kind,
196    ) -> fidl::client::QueryResponseFut<
197        ProviderSocketResult,
198        fidl::encoding::DefaultFuchsiaResourceDialect,
199    > {
200        ProviderProxyInterface::r#socket(self, kind)
201    }
202}
203
204impl ProviderProxyInterface for ProviderProxy {
205    type SocketResponseFut = fidl::client::QueryResponseFut<
206        ProviderSocketResult,
207        fidl::encoding::DefaultFuchsiaResourceDialect,
208    >;
209    fn r#socket(&self, mut kind: Kind) -> Self::SocketResponseFut {
210        fn _decode(
211            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
212        ) -> Result<ProviderSocketResult, fidl::Error> {
213            let _response = fidl::client::decode_transaction_body::<
214                fidl::encoding::ResultType<ProviderSocketResponse, fidl_fuchsia_posix::Errno>,
215                fidl::encoding::DefaultFuchsiaResourceDialect,
216                0x3aad2da99889858e,
217            >(_buf?)?;
218            Ok(_response.map(|x| x.socket))
219        }
220        self.client.send_query_and_decode::<ProviderSocketRequest, ProviderSocketResult>(
221            (kind,),
222            0x3aad2da99889858e,
223            fidl::encoding::DynamicFlags::empty(),
224            _decode,
225        )
226    }
227}
228
229pub struct ProviderEventStream {
230    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
231}
232
233impl std::marker::Unpin for ProviderEventStream {}
234
235impl futures::stream::FusedStream for ProviderEventStream {
236    fn is_terminated(&self) -> bool {
237        self.event_receiver.is_terminated()
238    }
239}
240
241impl futures::Stream for ProviderEventStream {
242    type Item = Result<ProviderEvent, fidl::Error>;
243
244    fn poll_next(
245        mut self: std::pin::Pin<&mut Self>,
246        cx: &mut std::task::Context<'_>,
247    ) -> std::task::Poll<Option<Self::Item>> {
248        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
249            &mut self.event_receiver,
250            cx
251        )?) {
252            Some(buf) => std::task::Poll::Ready(Some(ProviderEvent::decode(buf))),
253            None => std::task::Poll::Ready(None),
254        }
255    }
256}
257
258#[derive(Debug)]
259pub enum ProviderEvent {}
260
261impl ProviderEvent {
262    /// Decodes a message buffer as a [`ProviderEvent`].
263    fn decode(
264        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
265    ) -> Result<ProviderEvent, fidl::Error> {
266        let (bytes, _handles) = buf.split_mut();
267        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
268        debug_assert_eq!(tx_header.tx_id, 0);
269        match tx_header.ordinal {
270            _ => Err(fidl::Error::UnknownOrdinal {
271                ordinal: tx_header.ordinal,
272                protocol_name: <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
273            }),
274        }
275    }
276}
277
278/// A Stream of incoming requests for fuchsia.posix.socket.packet/Provider.
279pub struct ProviderRequestStream {
280    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
281    is_terminated: bool,
282}
283
284impl std::marker::Unpin for ProviderRequestStream {}
285
286impl futures::stream::FusedStream for ProviderRequestStream {
287    fn is_terminated(&self) -> bool {
288        self.is_terminated
289    }
290}
291
292impl fidl::endpoints::RequestStream for ProviderRequestStream {
293    type Protocol = ProviderMarker;
294    type ControlHandle = ProviderControlHandle;
295
296    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
297        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
298    }
299
300    fn control_handle(&self) -> Self::ControlHandle {
301        ProviderControlHandle { inner: self.inner.clone() }
302    }
303
304    fn into_inner(
305        self,
306    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
307    {
308        (self.inner, self.is_terminated)
309    }
310
311    fn from_inner(
312        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
313        is_terminated: bool,
314    ) -> Self {
315        Self { inner, is_terminated }
316    }
317}
318
319impl futures::Stream for ProviderRequestStream {
320    type Item = Result<ProviderRequest, fidl::Error>;
321
322    fn poll_next(
323        mut self: std::pin::Pin<&mut Self>,
324        cx: &mut std::task::Context<'_>,
325    ) -> std::task::Poll<Option<Self::Item>> {
326        let this = &mut *self;
327        if this.inner.check_shutdown(cx) {
328            this.is_terminated = true;
329            return std::task::Poll::Ready(None);
330        }
331        if this.is_terminated {
332            panic!("polled ProviderRequestStream after completion");
333        }
334        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
335            |bytes, handles| {
336                match this.inner.channel().read_etc(cx, bytes, handles) {
337                    std::task::Poll::Ready(Ok(())) => {}
338                    std::task::Poll::Pending => return std::task::Poll::Pending,
339                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
340                        this.is_terminated = true;
341                        return std::task::Poll::Ready(None);
342                    }
343                    std::task::Poll::Ready(Err(e)) => {
344                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
345                            e.into(),
346                        ))));
347                    }
348                }
349
350                // A message has been received from the channel
351                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
352
353                std::task::Poll::Ready(Some(match header.ordinal {
354                    0x3aad2da99889858e => {
355                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
356                        let mut req = fidl::new_empty!(
357                            ProviderSocketRequest,
358                            fidl::encoding::DefaultFuchsiaResourceDialect
359                        );
360                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProviderSocketRequest>(&header, _body_bytes, handles, &mut req)?;
361                        let control_handle = ProviderControlHandle { inner: this.inner.clone() };
362                        Ok(ProviderRequest::Socket {
363                            kind: req.kind,
364
365                            responder: ProviderSocketResponder {
366                                control_handle: std::mem::ManuallyDrop::new(control_handle),
367                                tx_id: header.tx_id,
368                            },
369                        })
370                    }
371                    _ => Err(fidl::Error::UnknownOrdinal {
372                        ordinal: header.ordinal,
373                        protocol_name:
374                            <ProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
375                    }),
376                }))
377            },
378        )
379    }
380}
381
382/// A packet socket provider.
383#[derive(Debug)]
384pub enum ProviderRequest {
385    /// Requests a packet socket.
386    ///
387    /// + request `kind` the kind of packet socket to create.
388    /// - response `socket` the packet socket.
389    Socket { kind: Kind, responder: ProviderSocketResponder },
390}
391
392impl ProviderRequest {
393    #[allow(irrefutable_let_patterns)]
394    pub fn into_socket(self) -> Option<(Kind, ProviderSocketResponder)> {
395        if let ProviderRequest::Socket { kind, responder } = self {
396            Some((kind, responder))
397        } else {
398            None
399        }
400    }
401
402    /// Name of the method defined in FIDL
403    pub fn method_name(&self) -> &'static str {
404        match *self {
405            ProviderRequest::Socket { .. } => "socket",
406        }
407    }
408}
409
410#[derive(Debug, Clone)]
411pub struct ProviderControlHandle {
412    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
413}
414
415impl fidl::endpoints::ControlHandle for ProviderControlHandle {
416    fn shutdown(&self) {
417        self.inner.shutdown()
418    }
419    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
420        self.inner.shutdown_with_epitaph(status)
421    }
422
423    fn is_closed(&self) -> bool {
424        self.inner.channel().is_closed()
425    }
426    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
427        self.inner.channel().on_closed()
428    }
429
430    #[cfg(target_os = "fuchsia")]
431    fn signal_peer(
432        &self,
433        clear_mask: zx::Signals,
434        set_mask: zx::Signals,
435    ) -> Result<(), zx_status::Status> {
436        use fidl::Peered;
437        self.inner.channel().signal_peer(clear_mask, set_mask)
438    }
439}
440
441impl ProviderControlHandle {}
442
443#[must_use = "FIDL methods require a response to be sent"]
444#[derive(Debug)]
445pub struct ProviderSocketResponder {
446    control_handle: std::mem::ManuallyDrop<ProviderControlHandle>,
447    tx_id: u32,
448}
449
450/// Set the the channel to be shutdown (see [`ProviderControlHandle::shutdown`])
451/// if the responder is dropped without sending a response, so that the client
452/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
453impl std::ops::Drop for ProviderSocketResponder {
454    fn drop(&mut self) {
455        self.control_handle.shutdown();
456        // Safety: drops once, never accessed again
457        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
458    }
459}
460
461impl fidl::endpoints::Responder for ProviderSocketResponder {
462    type ControlHandle = ProviderControlHandle;
463
464    fn control_handle(&self) -> &ProviderControlHandle {
465        &self.control_handle
466    }
467
468    fn drop_without_shutdown(mut self) {
469        // Safety: drops once, never accessed again due to mem::forget
470        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
471        // Prevent Drop from running (which would shut down the channel)
472        std::mem::forget(self);
473    }
474}
475
476impl ProviderSocketResponder {
477    /// Sends a response to the FIDL transaction.
478    ///
479    /// Sets the channel to shutdown if an error occurs.
480    pub fn send(
481        self,
482        mut result: Result<fidl::endpoints::ClientEnd<SocketMarker>, fidl_fuchsia_posix::Errno>,
483    ) -> Result<(), fidl::Error> {
484        let _result = self.send_raw(result);
485        if _result.is_err() {
486            self.control_handle.shutdown();
487        }
488        self.drop_without_shutdown();
489        _result
490    }
491
492    /// Similar to "send" but does not shutdown the channel if an error occurs.
493    pub fn send_no_shutdown_on_err(
494        self,
495        mut result: Result<fidl::endpoints::ClientEnd<SocketMarker>, fidl_fuchsia_posix::Errno>,
496    ) -> Result<(), fidl::Error> {
497        let _result = self.send_raw(result);
498        self.drop_without_shutdown();
499        _result
500    }
501
502    fn send_raw(
503        &self,
504        mut result: Result<fidl::endpoints::ClientEnd<SocketMarker>, fidl_fuchsia_posix::Errno>,
505    ) -> Result<(), fidl::Error> {
506        self.control_handle.inner.send::<fidl::encoding::ResultType<
507            ProviderSocketResponse,
508            fidl_fuchsia_posix::Errno,
509        >>(
510            result.map(|socket| (socket,)),
511            self.tx_id,
512            0x3aad2da99889858e,
513            fidl::encoding::DynamicFlags::empty(),
514        )
515    }
516}
517
518#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
519pub struct SocketMarker;
520
521impl fidl::endpoints::ProtocolMarker for SocketMarker {
522    type Proxy = SocketProxy;
523    type RequestStream = SocketRequestStream;
524    #[cfg(target_os = "fuchsia")]
525    type SynchronousProxy = SocketSynchronousProxy;
526
527    const DEBUG_NAME: &'static str = "fuchsia.posix.socket.packet.Socket";
528}
529impl fidl::endpoints::DiscoverableProtocolMarker for SocketMarker {}
530pub type SocketBindResult = Result<(), fidl_fuchsia_posix::Errno>;
531pub type SocketGetInfoResult =
532    Result<(Kind, Option<Box<ProtocolAssociation>>, BoundInterface), fidl_fuchsia_posix::Errno>;
533pub type SocketRecvMsgResult =
534    Result<(Option<Box<RecvPacketInfo>>, Vec<u8>, RecvControlData, u32), fidl_fuchsia_posix::Errno>;
535pub type SocketSendMsgResult = Result<(), fidl_fuchsia_posix::Errno>;
536pub type SocketAttachBpfFilterUnsafeResult = Result<(), fidl_fuchsia_posix::Errno>;
537
538pub trait SocketProxyInterface: Send + Sync {
539    fn r#clone(
540        &self,
541        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
542    ) -> Result<(), fidl::Error>;
543    type CloseResponseFut: std::future::Future<
544            Output = Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error>,
545        > + Send;
546    fn r#close(&self) -> Self::CloseResponseFut;
547    type QueryResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
548    fn r#query(&self) -> Self::QueryResponseFut;
549    type SetReuseAddressResponseFut: std::future::Future<
550            Output = Result<
551                fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult,
552                fidl::Error,
553            >,
554        > + Send;
555    fn r#set_reuse_address(&self, value: bool) -> Self::SetReuseAddressResponseFut;
556    type GetReuseAddressResponseFut: std::future::Future<
557            Output = Result<
558                fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult,
559                fidl::Error,
560            >,
561        > + Send;
562    fn r#get_reuse_address(&self) -> Self::GetReuseAddressResponseFut;
563    type GetErrorResponseFut: std::future::Future<
564            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetErrorResult, fidl::Error>,
565        > + Send;
566    fn r#get_error(&self) -> Self::GetErrorResponseFut;
567    type SetBroadcastResponseFut: std::future::Future<
568            Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult, fidl::Error>,
569        > + Send;
570    fn r#set_broadcast(&self, value: bool) -> Self::SetBroadcastResponseFut;
571    type GetBroadcastResponseFut: std::future::Future<
572            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult, fidl::Error>,
573        > + Send;
574    fn r#get_broadcast(&self) -> Self::GetBroadcastResponseFut;
575    type SetSendBufferResponseFut: std::future::Future<
576            Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult, fidl::Error>,
577        > + Send;
578    fn r#set_send_buffer(&self, value_bytes: u64) -> Self::SetSendBufferResponseFut;
579    type GetSendBufferResponseFut: std::future::Future<
580            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult, fidl::Error>,
581        > + Send;
582    fn r#get_send_buffer(&self) -> Self::GetSendBufferResponseFut;
583    type SetReceiveBufferResponseFut: std::future::Future<
584            Output = Result<
585                fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult,
586                fidl::Error,
587            >,
588        > + Send;
589    fn r#set_receive_buffer(&self, value_bytes: u64) -> Self::SetReceiveBufferResponseFut;
590    type GetReceiveBufferResponseFut: std::future::Future<
591            Output = Result<
592                fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult,
593                fidl::Error,
594            >,
595        > + Send;
596    fn r#get_receive_buffer(&self) -> Self::GetReceiveBufferResponseFut;
597    type SetKeepAliveResponseFut: std::future::Future<
598            Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult, fidl::Error>,
599        > + Send;
600    fn r#set_keep_alive(&self, value: bool) -> Self::SetKeepAliveResponseFut;
601    type GetKeepAliveResponseFut: std::future::Future<
602            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult, fidl::Error>,
603        > + Send;
604    fn r#get_keep_alive(&self) -> Self::GetKeepAliveResponseFut;
605    type SetOutOfBandInlineResponseFut: std::future::Future<
606            Output = Result<
607                fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult,
608                fidl::Error,
609            >,
610        > + Send;
611    fn r#set_out_of_band_inline(&self, value: bool) -> Self::SetOutOfBandInlineResponseFut;
612    type GetOutOfBandInlineResponseFut: std::future::Future<
613            Output = Result<
614                fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult,
615                fidl::Error,
616            >,
617        > + Send;
618    fn r#get_out_of_band_inline(&self) -> Self::GetOutOfBandInlineResponseFut;
619    type SetNoCheckResponseFut: std::future::Future<
620            Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult, fidl::Error>,
621        > + Send;
622    fn r#set_no_check(&self, value: bool) -> Self::SetNoCheckResponseFut;
623    type GetNoCheckResponseFut: std::future::Future<
624            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult, fidl::Error>,
625        > + Send;
626    fn r#get_no_check(&self) -> Self::GetNoCheckResponseFut;
627    type SetLingerResponseFut: std::future::Future<
628            Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetLingerResult, fidl::Error>,
629        > + Send;
630    fn r#set_linger(&self, linger: bool, length_secs: u32) -> Self::SetLingerResponseFut;
631    type GetLingerResponseFut: std::future::Future<
632            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetLingerResult, fidl::Error>,
633        > + Send;
634    fn r#get_linger(&self) -> Self::GetLingerResponseFut;
635    type SetReusePortResponseFut: std::future::Future<
636            Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult, fidl::Error>,
637        > + Send;
638    fn r#set_reuse_port(&self, value: bool) -> Self::SetReusePortResponseFut;
639    type GetReusePortResponseFut: std::future::Future<
640            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult, fidl::Error>,
641        > + Send;
642    fn r#get_reuse_port(&self) -> Self::GetReusePortResponseFut;
643    type GetAcceptConnResponseFut: std::future::Future<
644            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult, fidl::Error>,
645        > + Send;
646    fn r#get_accept_conn(&self) -> Self::GetAcceptConnResponseFut;
647    type SetBindToDeviceResponseFut: std::future::Future<
648            Output = Result<
649                fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult,
650                fidl::Error,
651            >,
652        > + Send;
653    fn r#set_bind_to_device(&self, value: &str) -> Self::SetBindToDeviceResponseFut;
654    type GetBindToDeviceResponseFut: std::future::Future<
655            Output = Result<
656                fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult,
657                fidl::Error,
658            >,
659        > + Send;
660    fn r#get_bind_to_device(&self) -> Self::GetBindToDeviceResponseFut;
661    type SetBindToInterfaceIndexResponseFut: std::future::Future<
662            Output = Result<
663                fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult,
664                fidl::Error,
665            >,
666        > + Send;
667    fn r#set_bind_to_interface_index(&self, value: u64)
668    -> Self::SetBindToInterfaceIndexResponseFut;
669    type GetBindToInterfaceIndexResponseFut: std::future::Future<
670            Output = Result<
671                fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult,
672                fidl::Error,
673            >,
674        > + Send;
675    fn r#get_bind_to_interface_index(&self) -> Self::GetBindToInterfaceIndexResponseFut;
676    type SetTimestampResponseFut: std::future::Future<
677            Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult, fidl::Error>,
678        > + Send;
679    fn r#set_timestamp(
680        &self,
681        value: fidl_fuchsia_posix_socket::TimestampOption,
682    ) -> Self::SetTimestampResponseFut;
683    type GetTimestampResponseFut: std::future::Future<
684            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult, fidl::Error>,
685        > + Send;
686    fn r#get_timestamp(&self) -> Self::GetTimestampResponseFut;
687    type SetMarkResponseFut: std::future::Future<
688            Output = Result<fidl_fuchsia_posix_socket::BaseSocketSetMarkResult, fidl::Error>,
689        > + Send;
690    fn r#set_mark(
691        &self,
692        domain: fidl_fuchsia_net::MarkDomain,
693        mark: &fidl_fuchsia_posix_socket::OptionalUint32,
694    ) -> Self::SetMarkResponseFut;
695    type GetMarkResponseFut: std::future::Future<
696            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetMarkResult, fidl::Error>,
697        > + Send;
698    fn r#get_mark(&self, domain: fidl_fuchsia_net::MarkDomain) -> Self::GetMarkResponseFut;
699    type GetCookieResponseFut: std::future::Future<
700            Output = Result<fidl_fuchsia_posix_socket::BaseSocketGetCookieResult, fidl::Error>,
701        > + Send;
702    fn r#get_cookie(&self) -> Self::GetCookieResponseFut;
703    type DescribeResponseFut: std::future::Future<Output = Result<SocketDescribeResponse, fidl::Error>>
704        + Send;
705    fn r#describe(&self) -> Self::DescribeResponseFut;
706    type BindResponseFut: std::future::Future<Output = Result<SocketBindResult, fidl::Error>> + Send;
707    fn r#bind(
708        &self,
709        protocol: Option<&ProtocolAssociation>,
710        bound_interface_id: &BoundInterfaceId,
711    ) -> Self::BindResponseFut;
712    type GetInfoResponseFut: std::future::Future<Output = Result<SocketGetInfoResult, fidl::Error>>
713        + Send;
714    fn r#get_info(&self) -> Self::GetInfoResponseFut;
715    type RecvMsgResponseFut: std::future::Future<Output = Result<SocketRecvMsgResult, fidl::Error>>
716        + Send;
717    fn r#recv_msg(
718        &self,
719        want_packet_info: bool,
720        data_len: u32,
721        want_control: bool,
722        flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
723    ) -> Self::RecvMsgResponseFut;
724    type SendMsgResponseFut: std::future::Future<Output = Result<SocketSendMsgResult, fidl::Error>>
725        + Send;
726    fn r#send_msg(
727        &self,
728        packet_info: Option<&PacketInfo>,
729        data: &[u8],
730        control: &SendControlData,
731        flags: fidl_fuchsia_posix_socket::SendMsgFlags,
732    ) -> Self::SendMsgResponseFut;
733    type AttachBpfFilterUnsafeResponseFut: std::future::Future<Output = Result<SocketAttachBpfFilterUnsafeResult, fidl::Error>>
734        + Send;
735    fn r#attach_bpf_filter_unsafe(&self, code: &[u64]) -> Self::AttachBpfFilterUnsafeResponseFut;
736}
737#[derive(Debug)]
738#[cfg(target_os = "fuchsia")]
739pub struct SocketSynchronousProxy {
740    client: fidl::client::sync::Client,
741}
742
743#[cfg(target_os = "fuchsia")]
744impl fidl::endpoints::SynchronousProxy for SocketSynchronousProxy {
745    type Proxy = SocketProxy;
746    type Protocol = SocketMarker;
747
748    fn from_channel(inner: fidl::Channel) -> Self {
749        Self::new(inner)
750    }
751
752    fn into_channel(self) -> fidl::Channel {
753        self.client.into_channel()
754    }
755
756    fn as_channel(&self) -> &fidl::Channel {
757        self.client.as_channel()
758    }
759}
760
761#[cfg(target_os = "fuchsia")]
762impl SocketSynchronousProxy {
763    pub fn new(channel: fidl::Channel) -> Self {
764        let protocol_name = <SocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
765        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
766    }
767
768    pub fn into_channel(self) -> fidl::Channel {
769        self.client.into_channel()
770    }
771
772    /// Waits until an event arrives and returns it. It is safe for other
773    /// threads to make concurrent requests while waiting for an event.
774    pub fn wait_for_event(
775        &self,
776        deadline: zx::MonotonicInstant,
777    ) -> Result<SocketEvent, fidl::Error> {
778        SocketEvent::decode(self.client.wait_for_event(deadline)?)
779    }
780
781    pub fn r#clone(
782        &self,
783        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
784    ) -> Result<(), fidl::Error> {
785        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
786            (request,),
787            0x20d8a7aba2168a79,
788            fidl::encoding::DynamicFlags::empty(),
789        )
790    }
791
792    /// Terminates the connection.
793    ///
794    /// After calling `Close`, the client must not send any other requests.
795    ///
796    /// Servers, after sending the status response, should close the connection
797    /// regardless of status and without sending an epitaph.
798    ///
799    /// Closing the client end of the channel should be semantically equivalent
800    /// to calling `Close` without knowing when the close has completed or its
801    /// status.
802    pub fn r#close(
803        &self,
804        ___deadline: zx::MonotonicInstant,
805    ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
806        let _response = self.client.send_query::<
807            fidl::encoding::EmptyPayload,
808            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
809        >(
810            (),
811            0x5ac5d459ad7f657e,
812            fidl::encoding::DynamicFlags::empty(),
813            ___deadline,
814        )?;
815        Ok(_response.map(|x| x))
816    }
817
818    pub fn r#query(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
819        let _response = self.client.send_query::<
820            fidl::encoding::EmptyPayload,
821            fidl_fuchsia_unknown::QueryableQueryResponse,
822        >(
823            (),
824            0x2658edee9decfc06,
825            fidl::encoding::DynamicFlags::empty(),
826            ___deadline,
827        )?;
828        Ok(_response.protocol)
829    }
830
831    /// Set `SOL_SOCKET` -> `SO_REUSEADDR`.
832    pub fn r#set_reuse_address(
833        &self,
834        mut value: bool,
835        ___deadline: zx::MonotonicInstant,
836    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult, fidl::Error> {
837        let _response = self.client.send_query::<
838            fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressRequest,
839            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
840        >(
841            (value,),
842            0x1fd74ee8b9a4a876,
843            fidl::encoding::DynamicFlags::empty(),
844            ___deadline,
845        )?;
846        Ok(_response.map(|x| x))
847    }
848
849    /// Get `SOL_SOCKET` -> `SO_REUSEADDR`.
850    pub fn r#get_reuse_address(
851        &self,
852        ___deadline: zx::MonotonicInstant,
853    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult, fidl::Error> {
854        let _response = self
855            .client
856            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
857                fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResponse,
858                fidl_fuchsia_posix::Errno,
859            >>(
860                (), 0x67b7206b8d1bc0a5, fidl::encoding::DynamicFlags::empty(), ___deadline
861            )?;
862        Ok(_response.map(|x| x.value))
863    }
864
865    /// Get `SOL_SOCKET` -> `SO_ERROR`.
866    /// Returns the last error if there is an error set on the socket.
867    pub fn r#get_error(
868        &self,
869        ___deadline: zx::MonotonicInstant,
870    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetErrorResult, fidl::Error> {
871        let _response =
872            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
873                fidl::encoding::EmptyStruct,
874                fidl_fuchsia_posix::Errno,
875            >>(
876                (),
877                0x5aad39b33e5f6ebb,
878                fidl::encoding::DynamicFlags::empty(),
879                ___deadline,
880            )?;
881        Ok(_response.map(|x| x))
882    }
883
884    /// Set `SOL_SOCKET` -> `SO_BROADCAST`.
885    pub fn r#set_broadcast(
886        &self,
887        mut value: bool,
888        ___deadline: zx::MonotonicInstant,
889    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult, fidl::Error> {
890        let _response = self.client.send_query::<
891            fidl_fuchsia_posix_socket::BaseSocketSetBroadcastRequest,
892            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
893        >(
894            (value,),
895            0x6023e081ce3cd947,
896            fidl::encoding::DynamicFlags::empty(),
897            ___deadline,
898        )?;
899        Ok(_response.map(|x| x))
900    }
901
902    /// Get `SOL_SOCKET` -> `SO_BROADCAST`.
903    pub fn r#get_broadcast(
904        &self,
905        ___deadline: zx::MonotonicInstant,
906    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult, fidl::Error> {
907        let _response = self
908            .client
909            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
910                fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResponse,
911                fidl_fuchsia_posix::Errno,
912            >>(
913                (), 0x68796fc556f9780d, fidl::encoding::DynamicFlags::empty(), ___deadline
914            )?;
915        Ok(_response.map(|x| x.value))
916    }
917
918    /// Set `SOL_SOCKET` -> `SO_SNDBUF`.
919    pub fn r#set_send_buffer(
920        &self,
921        mut value_bytes: u64,
922        ___deadline: zx::MonotonicInstant,
923    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult, fidl::Error> {
924        let _response = self.client.send_query::<
925            fidl_fuchsia_posix_socket::BaseSocketSetSendBufferRequest,
926            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
927        >(
928            (value_bytes,),
929            0x756eac32d73a7a70,
930            fidl::encoding::DynamicFlags::empty(),
931            ___deadline,
932        )?;
933        Ok(_response.map(|x| x))
934    }
935
936    /// Get `SOL_SOCKET` -> `SO_SNDBUF`.
937    pub fn r#get_send_buffer(
938        &self,
939        ___deadline: zx::MonotonicInstant,
940    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult, fidl::Error> {
941        let _response = self
942            .client
943            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
944                fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResponse,
945                fidl_fuchsia_posix::Errno,
946            >>(
947                (), 0x78a52fd9c7b2410b, fidl::encoding::DynamicFlags::empty(), ___deadline
948            )?;
949        Ok(_response.map(|x| x.value_bytes))
950    }
951
952    /// Set `SOL_SOCKET` -> `SO_RCVBUF`.
953    pub fn r#set_receive_buffer(
954        &self,
955        mut value_bytes: u64,
956        ___deadline: zx::MonotonicInstant,
957    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult, fidl::Error> {
958        let _response = self.client.send_query::<
959            fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferRequest,
960            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
961        >(
962            (value_bytes,),
963            0x6b0cf2f1919c7001,
964            fidl::encoding::DynamicFlags::empty(),
965            ___deadline,
966        )?;
967        Ok(_response.map(|x| x))
968    }
969
970    /// Get `SOL_SOCKET` -> `SO_RCVBUF`.
971    pub fn r#get_receive_buffer(
972        &self,
973        ___deadline: zx::MonotonicInstant,
974    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult, fidl::Error> {
975        let _response = self
976            .client
977            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
978                fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResponse,
979                fidl_fuchsia_posix::Errno,
980            >>(
981                (), 0x14c1a4b64f709e5c, fidl::encoding::DynamicFlags::empty(), ___deadline
982            )?;
983        Ok(_response.map(|x| x.value_bytes))
984    }
985
986    /// Set `SOL_SOCKET` -> `SO_KEEPALIVE`.
987    pub fn r#set_keep_alive(
988        &self,
989        mut value: bool,
990        ___deadline: zx::MonotonicInstant,
991    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult, fidl::Error> {
992        let _response = self.client.send_query::<
993            fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveRequest,
994            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
995        >(
996            (value,),
997            0x572df8f0b920d2c7,
998            fidl::encoding::DynamicFlags::empty(),
999            ___deadline,
1000        )?;
1001        Ok(_response.map(|x| x))
1002    }
1003
1004    /// Get `SOL_SOCKET` -> `SO_KEEPALIVE`.
1005    pub fn r#get_keep_alive(
1006        &self,
1007        ___deadline: zx::MonotonicInstant,
1008    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult, fidl::Error> {
1009        let _response = self
1010            .client
1011            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1012                fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResponse,
1013                fidl_fuchsia_posix::Errno,
1014            >>(
1015                (), 0x2dd29d3215f2c9d2, fidl::encoding::DynamicFlags::empty(), ___deadline
1016            )?;
1017        Ok(_response.map(|x| x.value))
1018    }
1019
1020    /// Set `SOL_SOCKET` -> `SO_OOBINLINE`.
1021    pub fn r#set_out_of_band_inline(
1022        &self,
1023        mut value: bool,
1024        ___deadline: zx::MonotonicInstant,
1025    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult, fidl::Error> {
1026        let _response = self.client.send_query::<
1027            fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineRequest,
1028            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
1029        >(
1030            (value,),
1031            0x3ecb49968bee439,
1032            fidl::encoding::DynamicFlags::empty(),
1033            ___deadline,
1034        )?;
1035        Ok(_response.map(|x| x))
1036    }
1037
1038    /// Get `SOL_SOCKET` -> `SO_OOBINLINE`.
1039    pub fn r#get_out_of_band_inline(
1040        &self,
1041        ___deadline: zx::MonotonicInstant,
1042    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult, fidl::Error> {
1043        let _response = self
1044            .client
1045            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1046                fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResponse,
1047                fidl_fuchsia_posix::Errno,
1048            >>(
1049                (), 0x348c1ab3aeca1745, fidl::encoding::DynamicFlags::empty(), ___deadline
1050            )?;
1051        Ok(_response.map(|x| x.value))
1052    }
1053
1054    /// Set `SOL_SOCKET` -> `SO_NO_CHECK`.
1055    pub fn r#set_no_check(
1056        &self,
1057        mut value: bool,
1058        ___deadline: zx::MonotonicInstant,
1059    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult, fidl::Error> {
1060        let _response = self.client.send_query::<
1061            fidl_fuchsia_posix_socket::BaseSocketSetNoCheckRequest,
1062            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
1063        >(
1064            (value,),
1065            0x6bbf00c53a4c78c2,
1066            fidl::encoding::DynamicFlags::empty(),
1067            ___deadline,
1068        )?;
1069        Ok(_response.map(|x| x))
1070    }
1071
1072    /// Get `SOL_SOCKET` -> `SO_NO_CHECK`.
1073    pub fn r#get_no_check(
1074        &self,
1075        ___deadline: zx::MonotonicInstant,
1076    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult, fidl::Error> {
1077        let _response = self
1078            .client
1079            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1080                fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResponse,
1081                fidl_fuchsia_posix::Errno,
1082            >>(
1083                (), 0x2cd4249286417694, fidl::encoding::DynamicFlags::empty(), ___deadline
1084            )?;
1085        Ok(_response.map(|x| x.value))
1086    }
1087
1088    /// Set `SOL_SOCKET` -> `SO_LINGER`.
1089    pub fn r#set_linger(
1090        &self,
1091        mut linger: bool,
1092        mut length_secs: u32,
1093        ___deadline: zx::MonotonicInstant,
1094    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetLingerResult, fidl::Error> {
1095        let _response = self.client.send_query::<
1096            fidl_fuchsia_posix_socket::BaseSocketSetLingerRequest,
1097            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
1098        >(
1099            (linger, length_secs,),
1100            0x45386351246e998e,
1101            fidl::encoding::DynamicFlags::empty(),
1102            ___deadline,
1103        )?;
1104        Ok(_response.map(|x| x))
1105    }
1106
1107    /// Get `SOL_SOCKET` -> `SO_LINGER`.
1108    pub fn r#get_linger(
1109        &self,
1110        ___deadline: zx::MonotonicInstant,
1111    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetLingerResult, fidl::Error> {
1112        let _response = self
1113            .client
1114            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1115                fidl_fuchsia_posix_socket::BaseSocketGetLingerResponse,
1116                fidl_fuchsia_posix::Errno,
1117            >>(
1118                (), 0x48eb20fc5ccb0e45, fidl::encoding::DynamicFlags::empty(), ___deadline
1119            )?;
1120        Ok(_response.map(|x| (x.linger, x.length_secs)))
1121    }
1122
1123    /// Set `SOL_SOCKET` -> `SO_REUSEPORT`.
1124    pub fn r#set_reuse_port(
1125        &self,
1126        mut value: bool,
1127        ___deadline: zx::MonotonicInstant,
1128    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult, fidl::Error> {
1129        let _response = self.client.send_query::<
1130            fidl_fuchsia_posix_socket::BaseSocketSetReusePortRequest,
1131            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
1132        >(
1133            (value,),
1134            0x24dd3e5cb36d9ccb,
1135            fidl::encoding::DynamicFlags::empty(),
1136            ___deadline,
1137        )?;
1138        Ok(_response.map(|x| x))
1139    }
1140
1141    /// Get `SOL_SOCKET` -> `SO_REUSEPORT`.
1142    pub fn r#get_reuse_port(
1143        &self,
1144        ___deadline: zx::MonotonicInstant,
1145    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult, fidl::Error> {
1146        let _response = self
1147            .client
1148            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1149                fidl_fuchsia_posix_socket::BaseSocketGetReusePortResponse,
1150                fidl_fuchsia_posix::Errno,
1151            >>(
1152                (), 0x7a112c1ab54ff828, fidl::encoding::DynamicFlags::empty(), ___deadline
1153            )?;
1154        Ok(_response.map(|x| x.value))
1155    }
1156
1157    /// Get `SOL_SOCKET` -> `SO_ACCEPTCONN`.
1158    pub fn r#get_accept_conn(
1159        &self,
1160        ___deadline: zx::MonotonicInstant,
1161    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult, fidl::Error> {
1162        let _response = self
1163            .client
1164            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1165                fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResponse,
1166                fidl_fuchsia_posix::Errno,
1167            >>(
1168                (), 0x67ce6db6c2ec8966, fidl::encoding::DynamicFlags::empty(), ___deadline
1169            )?;
1170        Ok(_response.map(|x| x.value))
1171    }
1172
1173    /// Set `SOL_SOCKET` -> `SO_BINDTODEVICE`.
1174    pub fn r#set_bind_to_device(
1175        &self,
1176        mut value: &str,
1177        ___deadline: zx::MonotonicInstant,
1178    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult, fidl::Error> {
1179        let _response = self.client.send_query::<
1180            fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceRequest,
1181            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
1182        >(
1183            (value,),
1184            0x2118b483f28aafc4,
1185            fidl::encoding::DynamicFlags::empty(),
1186            ___deadline,
1187        )?;
1188        Ok(_response.map(|x| x))
1189    }
1190
1191    /// Get `SOL_SOCKET` -> `SO_BINDTODEVICE`.
1192    pub fn r#get_bind_to_device(
1193        &self,
1194        ___deadline: zx::MonotonicInstant,
1195    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult, fidl::Error> {
1196        let _response = self
1197            .client
1198            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1199                fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResponse,
1200                fidl_fuchsia_posix::Errno,
1201            >>(
1202                (), 0x1ab1fbf0ef7906c8, fidl::encoding::DynamicFlags::empty(), ___deadline
1203            )?;
1204        Ok(_response.map(|x| x.value))
1205    }
1206
1207    /// Set `SOL_SOCKET` -> `SO_BINDTOIFINDEX`.
1208    /// If `value` is 0, this clears the bound interface.
1209    pub fn r#set_bind_to_interface_index(
1210        &self,
1211        mut value: u64,
1212        ___deadline: zx::MonotonicInstant,
1213    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult, fidl::Error>
1214    {
1215        let _response = self.client.send_query::<
1216            fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexRequest,
1217            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
1218        >(
1219            (value,),
1220            0x6e387a0def00821,
1221            fidl::encoding::DynamicFlags::empty(),
1222            ___deadline,
1223        )?;
1224        Ok(_response.map(|x| x))
1225    }
1226
1227    /// Get `SOL_SOCKET` -> `SO_BINDTOIFINDEX`.
1228    pub fn r#get_bind_to_interface_index(
1229        &self,
1230        ___deadline: zx::MonotonicInstant,
1231    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult, fidl::Error>
1232    {
1233        let _response = self
1234            .client
1235            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1236                fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResponse,
1237                fidl_fuchsia_posix::Errno,
1238            >>(
1239                (), 0x59c31dd3e3078295, fidl::encoding::DynamicFlags::empty(), ___deadline
1240            )?;
1241        Ok(_response.map(|x| x.value))
1242    }
1243
1244    /// Set `SOL_SOCKET` -> `SO_TIMESTAMP` or `SO_TIMESTAMPNS`.
1245    pub fn r#set_timestamp(
1246        &self,
1247        mut value: fidl_fuchsia_posix_socket::TimestampOption,
1248        ___deadline: zx::MonotonicInstant,
1249    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult, fidl::Error> {
1250        let _response = self.client.send_query::<
1251            fidl_fuchsia_posix_socket::BaseSocketSetTimestampRequest,
1252            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
1253        >(
1254            (value,),
1255            0x285d6516c263d839,
1256            fidl::encoding::DynamicFlags::empty(),
1257            ___deadline,
1258        )?;
1259        Ok(_response.map(|x| x))
1260    }
1261
1262    /// Get `SOL_SOCKET` -> `SO_TIMESTAMP` or `SO_TIMESTAMPNS`.
1263    pub fn r#get_timestamp(
1264        &self,
1265        ___deadline: zx::MonotonicInstant,
1266    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult, fidl::Error> {
1267        let _response = self
1268            .client
1269            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1270                fidl_fuchsia_posix_socket::BaseSocketGetTimestampResponse,
1271                fidl_fuchsia_posix::Errno,
1272            >>(
1273                (), 0x49f2fffbbcc2bd27, fidl::encoding::DynamicFlags::empty(), ___deadline
1274            )?;
1275        Ok(_response.map(|x| x.value))
1276    }
1277
1278    /// Like setting `SOL_SOCKET` -> `SO_MARK`. The major difference is that
1279    /// unlike the standard SO_MARK, this API has multiple mark domains and each
1280    /// mark can be set independently in each domain.
1281    pub fn r#set_mark(
1282        &self,
1283        mut domain: fidl_fuchsia_net::MarkDomain,
1284        mut mark: &fidl_fuchsia_posix_socket::OptionalUint32,
1285        ___deadline: zx::MonotonicInstant,
1286    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetMarkResult, fidl::Error> {
1287        let _response = self.client.send_query::<
1288            fidl_fuchsia_posix_socket::BaseSocketSetMarkRequest,
1289            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
1290        >(
1291            (domain, mark,),
1292            0x6ead6de09f653236,
1293            fidl::encoding::DynamicFlags::empty(),
1294            ___deadline,
1295        )?;
1296        Ok(_response.map(|x| x))
1297    }
1298
1299    /// Like getting `SOL_SOCKET` -> `SO_MARK`. The major difference is that
1300    /// unlike the standard SO_MARK, this API has multiple mark domains and each
1301    /// mark can be retrieved independently in each domain.
1302    pub fn r#get_mark(
1303        &self,
1304        mut domain: fidl_fuchsia_net::MarkDomain,
1305        ___deadline: zx::MonotonicInstant,
1306    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetMarkResult, fidl::Error> {
1307        let _response = self.client.send_query::<
1308            fidl_fuchsia_posix_socket::BaseSocketGetMarkRequest,
1309            fidl::encoding::ResultType<fidl_fuchsia_posix_socket::BaseSocketGetMarkResponse, fidl_fuchsia_posix::Errno>,
1310        >(
1311            (domain,),
1312            0x57a2752c61d93d47,
1313            fidl::encoding::DynamicFlags::empty(),
1314            ___deadline,
1315        )?;
1316        Ok(_response.map(|x| x.mark))
1317    }
1318
1319    /// Get `SOL_SOCKET` -> `SO_COOKIE`.
1320    pub fn r#get_cookie(
1321        &self,
1322        ___deadline: zx::MonotonicInstant,
1323    ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetCookieResult, fidl::Error> {
1324        let _response = self
1325            .client
1326            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1327                fidl_fuchsia_posix_socket::BaseSocketGetCookieResponse,
1328                fidl_fuchsia_posix::Errno,
1329            >>(
1330                (), 0x2c2f47fd8f924e52, fidl::encoding::DynamicFlags::empty(), ___deadline
1331            )?;
1332        Ok(_response.map(|x| x.value))
1333    }
1334
1335    pub fn r#describe(
1336        &self,
1337        ___deadline: zx::MonotonicInstant,
1338    ) -> Result<SocketDescribeResponse, fidl::Error> {
1339        let _response =
1340            self.client.send_query::<fidl::encoding::EmptyPayload, SocketDescribeResponse>(
1341                (),
1342                0x4fd7c08c9c804484,
1343                fidl::encoding::DynamicFlags::empty(),
1344                ___deadline,
1345            )?;
1346        Ok(_response)
1347    }
1348
1349    /// Bind the socket to a protocol and/or interface.
1350    ///
1351    /// + request `protocol` the socket's new protocol association.
1352    /// + request `bound_interface_id` the socket's new interface binding.
1353    pub fn r#bind(
1354        &self,
1355        mut protocol: Option<&ProtocolAssociation>,
1356        mut bound_interface_id: &BoundInterfaceId,
1357        ___deadline: zx::MonotonicInstant,
1358    ) -> Result<SocketBindResult, fidl::Error> {
1359        let _response = self.client.send_query::<SocketBindRequest, fidl::encoding::ResultType<
1360            fidl::encoding::EmptyStruct,
1361            fidl_fuchsia_posix::Errno,
1362        >>(
1363            (protocol, bound_interface_id),
1364            0x6caedb2d31b56db8,
1365            fidl::encoding::DynamicFlags::empty(),
1366            ___deadline,
1367        )?;
1368        Ok(_response.map(|x| x))
1369    }
1370
1371    /// Returns the the socket's properties.
1372    ///
1373    /// - response `kind` the socket's `Kind`.
1374    /// - response `protocol` the socket's protocol association, if associated.
1375    /// - response `bound_interface` properties of the socket's interface
1376    ///   binding.
1377    pub fn r#get_info(
1378        &self,
1379        ___deadline: zx::MonotonicInstant,
1380    ) -> Result<SocketGetInfoResult, fidl::Error> {
1381        let _response =
1382            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1383                SocketGetInfoResponse,
1384                fidl_fuchsia_posix::Errno,
1385            >>(
1386                (),
1387                0x7f67457e85c3914c,
1388                fidl::encoding::DynamicFlags::empty(),
1389                ___deadline,
1390            )?;
1391        Ok(_response.map(|x| (x.kind, x.protocol, x.bound_interface)))
1392    }
1393
1394    /// Receives a message from the socket.
1395    ///
1396    /// + request `want_packet_info` request information about the packet to be
1397    ///   returned.
1398    /// + request `data_len` the maximum allowed length of the response data
1399    ///   buffer.
1400    /// + request `want_control` request ancillary data to be returned.
1401    /// + request `flags` flags for the receive request.
1402    /// - response `packet_info` information about the packet, if requested.
1403    /// - response `data` the message.
1404    /// - response `control` control messages, if requested.
1405    /// - response `truncated` indicates whether or not the returned message
1406    ///   was truncated.
1407    pub fn r#recv_msg(
1408        &self,
1409        mut want_packet_info: bool,
1410        mut data_len: u32,
1411        mut want_control: bool,
1412        mut flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
1413        ___deadline: zx::MonotonicInstant,
1414    ) -> Result<SocketRecvMsgResult, fidl::Error> {
1415        let _response = self.client.send_query::<SocketRecvMsgRequest, fidl::encoding::ResultType<
1416            SocketRecvMsgResponse,
1417            fidl_fuchsia_posix::Errno,
1418        >>(
1419            (want_packet_info, data_len, want_control, flags),
1420            0x52b95ba982826a61,
1421            fidl::encoding::DynamicFlags::empty(),
1422            ___deadline,
1423        )?;
1424        Ok(_response.map(|x| (x.packet_info, x.data, x.control, x.truncated)))
1425    }
1426
1427    /// Sends a message on the socket.
1428    ///
1429    /// + request `packet_info` information about the packet.
1430    /// + request `data` the message.
1431    /// + request `control` ancillary data.
1432    /// + request `flags` flags for the send request.
1433    pub fn r#send_msg(
1434        &self,
1435        mut packet_info: Option<&PacketInfo>,
1436        mut data: &[u8],
1437        mut control: &SendControlData,
1438        mut flags: fidl_fuchsia_posix_socket::SendMsgFlags,
1439        ___deadline: zx::MonotonicInstant,
1440    ) -> Result<SocketSendMsgResult, fidl::Error> {
1441        let _response = self.client.send_query::<SocketSendMsgRequest, fidl::encoding::ResultType<
1442            fidl::encoding::EmptyStruct,
1443            fidl_fuchsia_posix::Errno,
1444        >>(
1445            (packet_info, data, control, flags),
1446            0x150c9ff91f944922,
1447            fidl::encoding::DynamicFlags::empty(),
1448            ___deadline,
1449        )?;
1450        Ok(_response.map(|x| x))
1451    }
1452
1453    /// Attaches the specified eBPF filter. The filter is assumed to be verified with 2 arguments
1454    ///  1. Pointer to the packet of size 0, i.e. not accessed directly (only using cBPF packet
1455    ///     load instructions).
1456    ///  2. Packet size (BPF_LOAD).
1457    /// Helper functions and maps are not supported.
1458    pub fn r#attach_bpf_filter_unsafe(
1459        &self,
1460        mut code: &[u64],
1461        ___deadline: zx::MonotonicInstant,
1462    ) -> Result<SocketAttachBpfFilterUnsafeResult, fidl::Error> {
1463        let _response =
1464            self.client
1465                .send_query::<SocketAttachBpfFilterUnsafeRequest, fidl::encoding::ResultType<
1466                    fidl::encoding::EmptyStruct,
1467                    fidl_fuchsia_posix::Errno,
1468                >>(
1469                    (code,),
1470                    0x593998d38670f823,
1471                    fidl::encoding::DynamicFlags::empty(),
1472                    ___deadline,
1473                )?;
1474        Ok(_response.map(|x| x))
1475    }
1476}
1477
1478#[cfg(target_os = "fuchsia")]
1479impl From<SocketSynchronousProxy> for zx::Handle {
1480    fn from(value: SocketSynchronousProxy) -> Self {
1481        value.into_channel().into()
1482    }
1483}
1484
1485#[cfg(target_os = "fuchsia")]
1486impl From<fidl::Channel> for SocketSynchronousProxy {
1487    fn from(value: fidl::Channel) -> Self {
1488        Self::new(value)
1489    }
1490}
1491
1492#[cfg(target_os = "fuchsia")]
1493impl fidl::endpoints::FromClient for SocketSynchronousProxy {
1494    type Protocol = SocketMarker;
1495
1496    fn from_client(value: fidl::endpoints::ClientEnd<SocketMarker>) -> Self {
1497        Self::new(value.into_channel())
1498    }
1499}
1500
1501#[derive(Debug, Clone)]
1502pub struct SocketProxy {
1503    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1504}
1505
1506impl fidl::endpoints::Proxy for SocketProxy {
1507    type Protocol = SocketMarker;
1508
1509    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1510        Self::new(inner)
1511    }
1512
1513    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1514        self.client.into_channel().map_err(|client| Self { client })
1515    }
1516
1517    fn as_channel(&self) -> &::fidl::AsyncChannel {
1518        self.client.as_channel()
1519    }
1520}
1521
1522impl SocketProxy {
1523    /// Create a new Proxy for fuchsia.posix.socket.packet/Socket.
1524    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1525        let protocol_name = <SocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1526        Self { client: fidl::client::Client::new(channel, protocol_name) }
1527    }
1528
1529    /// Get a Stream of events from the remote end of the protocol.
1530    ///
1531    /// # Panics
1532    ///
1533    /// Panics if the event stream was already taken.
1534    pub fn take_event_stream(&self) -> SocketEventStream {
1535        SocketEventStream { event_receiver: self.client.take_event_receiver() }
1536    }
1537
1538    pub fn r#clone(
1539        &self,
1540        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1541    ) -> Result<(), fidl::Error> {
1542        SocketProxyInterface::r#clone(self, request)
1543    }
1544
1545    /// Terminates the connection.
1546    ///
1547    /// After calling `Close`, the client must not send any other requests.
1548    ///
1549    /// Servers, after sending the status response, should close the connection
1550    /// regardless of status and without sending an epitaph.
1551    ///
1552    /// Closing the client end of the channel should be semantically equivalent
1553    /// to calling `Close` without knowing when the close has completed or its
1554    /// status.
1555    pub fn r#close(
1556        &self,
1557    ) -> fidl::client::QueryResponseFut<
1558        fidl_fuchsia_unknown::CloseableCloseResult,
1559        fidl::encoding::DefaultFuchsiaResourceDialect,
1560    > {
1561        SocketProxyInterface::r#close(self)
1562    }
1563
1564    pub fn r#query(
1565        &self,
1566    ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
1567    {
1568        SocketProxyInterface::r#query(self)
1569    }
1570
1571    /// Set `SOL_SOCKET` -> `SO_REUSEADDR`.
1572    pub fn r#set_reuse_address(
1573        &self,
1574        mut value: bool,
1575    ) -> fidl::client::QueryResponseFut<
1576        fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult,
1577        fidl::encoding::DefaultFuchsiaResourceDialect,
1578    > {
1579        SocketProxyInterface::r#set_reuse_address(self, value)
1580    }
1581
1582    /// Get `SOL_SOCKET` -> `SO_REUSEADDR`.
1583    pub fn r#get_reuse_address(
1584        &self,
1585    ) -> fidl::client::QueryResponseFut<
1586        fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult,
1587        fidl::encoding::DefaultFuchsiaResourceDialect,
1588    > {
1589        SocketProxyInterface::r#get_reuse_address(self)
1590    }
1591
1592    /// Get `SOL_SOCKET` -> `SO_ERROR`.
1593    /// Returns the last error if there is an error set on the socket.
1594    pub fn r#get_error(
1595        &self,
1596    ) -> fidl::client::QueryResponseFut<
1597        fidl_fuchsia_posix_socket::BaseSocketGetErrorResult,
1598        fidl::encoding::DefaultFuchsiaResourceDialect,
1599    > {
1600        SocketProxyInterface::r#get_error(self)
1601    }
1602
1603    /// Set `SOL_SOCKET` -> `SO_BROADCAST`.
1604    pub fn r#set_broadcast(
1605        &self,
1606        mut value: bool,
1607    ) -> fidl::client::QueryResponseFut<
1608        fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult,
1609        fidl::encoding::DefaultFuchsiaResourceDialect,
1610    > {
1611        SocketProxyInterface::r#set_broadcast(self, value)
1612    }
1613
1614    /// Get `SOL_SOCKET` -> `SO_BROADCAST`.
1615    pub fn r#get_broadcast(
1616        &self,
1617    ) -> fidl::client::QueryResponseFut<
1618        fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult,
1619        fidl::encoding::DefaultFuchsiaResourceDialect,
1620    > {
1621        SocketProxyInterface::r#get_broadcast(self)
1622    }
1623
1624    /// Set `SOL_SOCKET` -> `SO_SNDBUF`.
1625    pub fn r#set_send_buffer(
1626        &self,
1627        mut value_bytes: u64,
1628    ) -> fidl::client::QueryResponseFut<
1629        fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult,
1630        fidl::encoding::DefaultFuchsiaResourceDialect,
1631    > {
1632        SocketProxyInterface::r#set_send_buffer(self, value_bytes)
1633    }
1634
1635    /// Get `SOL_SOCKET` -> `SO_SNDBUF`.
1636    pub fn r#get_send_buffer(
1637        &self,
1638    ) -> fidl::client::QueryResponseFut<
1639        fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult,
1640        fidl::encoding::DefaultFuchsiaResourceDialect,
1641    > {
1642        SocketProxyInterface::r#get_send_buffer(self)
1643    }
1644
1645    /// Set `SOL_SOCKET` -> `SO_RCVBUF`.
1646    pub fn r#set_receive_buffer(
1647        &self,
1648        mut value_bytes: u64,
1649    ) -> fidl::client::QueryResponseFut<
1650        fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult,
1651        fidl::encoding::DefaultFuchsiaResourceDialect,
1652    > {
1653        SocketProxyInterface::r#set_receive_buffer(self, value_bytes)
1654    }
1655
1656    /// Get `SOL_SOCKET` -> `SO_RCVBUF`.
1657    pub fn r#get_receive_buffer(
1658        &self,
1659    ) -> fidl::client::QueryResponseFut<
1660        fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult,
1661        fidl::encoding::DefaultFuchsiaResourceDialect,
1662    > {
1663        SocketProxyInterface::r#get_receive_buffer(self)
1664    }
1665
1666    /// Set `SOL_SOCKET` -> `SO_KEEPALIVE`.
1667    pub fn r#set_keep_alive(
1668        &self,
1669        mut value: bool,
1670    ) -> fidl::client::QueryResponseFut<
1671        fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult,
1672        fidl::encoding::DefaultFuchsiaResourceDialect,
1673    > {
1674        SocketProxyInterface::r#set_keep_alive(self, value)
1675    }
1676
1677    /// Get `SOL_SOCKET` -> `SO_KEEPALIVE`.
1678    pub fn r#get_keep_alive(
1679        &self,
1680    ) -> fidl::client::QueryResponseFut<
1681        fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult,
1682        fidl::encoding::DefaultFuchsiaResourceDialect,
1683    > {
1684        SocketProxyInterface::r#get_keep_alive(self)
1685    }
1686
1687    /// Set `SOL_SOCKET` -> `SO_OOBINLINE`.
1688    pub fn r#set_out_of_band_inline(
1689        &self,
1690        mut value: bool,
1691    ) -> fidl::client::QueryResponseFut<
1692        fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult,
1693        fidl::encoding::DefaultFuchsiaResourceDialect,
1694    > {
1695        SocketProxyInterface::r#set_out_of_band_inline(self, value)
1696    }
1697
1698    /// Get `SOL_SOCKET` -> `SO_OOBINLINE`.
1699    pub fn r#get_out_of_band_inline(
1700        &self,
1701    ) -> fidl::client::QueryResponseFut<
1702        fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult,
1703        fidl::encoding::DefaultFuchsiaResourceDialect,
1704    > {
1705        SocketProxyInterface::r#get_out_of_band_inline(self)
1706    }
1707
1708    /// Set `SOL_SOCKET` -> `SO_NO_CHECK`.
1709    pub fn r#set_no_check(
1710        &self,
1711        mut value: bool,
1712    ) -> fidl::client::QueryResponseFut<
1713        fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult,
1714        fidl::encoding::DefaultFuchsiaResourceDialect,
1715    > {
1716        SocketProxyInterface::r#set_no_check(self, value)
1717    }
1718
1719    /// Get `SOL_SOCKET` -> `SO_NO_CHECK`.
1720    pub fn r#get_no_check(
1721        &self,
1722    ) -> fidl::client::QueryResponseFut<
1723        fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult,
1724        fidl::encoding::DefaultFuchsiaResourceDialect,
1725    > {
1726        SocketProxyInterface::r#get_no_check(self)
1727    }
1728
1729    /// Set `SOL_SOCKET` -> `SO_LINGER`.
1730    pub fn r#set_linger(
1731        &self,
1732        mut linger: bool,
1733        mut length_secs: u32,
1734    ) -> fidl::client::QueryResponseFut<
1735        fidl_fuchsia_posix_socket::BaseSocketSetLingerResult,
1736        fidl::encoding::DefaultFuchsiaResourceDialect,
1737    > {
1738        SocketProxyInterface::r#set_linger(self, linger, length_secs)
1739    }
1740
1741    /// Get `SOL_SOCKET` -> `SO_LINGER`.
1742    pub fn r#get_linger(
1743        &self,
1744    ) -> fidl::client::QueryResponseFut<
1745        fidl_fuchsia_posix_socket::BaseSocketGetLingerResult,
1746        fidl::encoding::DefaultFuchsiaResourceDialect,
1747    > {
1748        SocketProxyInterface::r#get_linger(self)
1749    }
1750
1751    /// Set `SOL_SOCKET` -> `SO_REUSEPORT`.
1752    pub fn r#set_reuse_port(
1753        &self,
1754        mut value: bool,
1755    ) -> fidl::client::QueryResponseFut<
1756        fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult,
1757        fidl::encoding::DefaultFuchsiaResourceDialect,
1758    > {
1759        SocketProxyInterface::r#set_reuse_port(self, value)
1760    }
1761
1762    /// Get `SOL_SOCKET` -> `SO_REUSEPORT`.
1763    pub fn r#get_reuse_port(
1764        &self,
1765    ) -> fidl::client::QueryResponseFut<
1766        fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult,
1767        fidl::encoding::DefaultFuchsiaResourceDialect,
1768    > {
1769        SocketProxyInterface::r#get_reuse_port(self)
1770    }
1771
1772    /// Get `SOL_SOCKET` -> `SO_ACCEPTCONN`.
1773    pub fn r#get_accept_conn(
1774        &self,
1775    ) -> fidl::client::QueryResponseFut<
1776        fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult,
1777        fidl::encoding::DefaultFuchsiaResourceDialect,
1778    > {
1779        SocketProxyInterface::r#get_accept_conn(self)
1780    }
1781
1782    /// Set `SOL_SOCKET` -> `SO_BINDTODEVICE`.
1783    pub fn r#set_bind_to_device(
1784        &self,
1785        mut value: &str,
1786    ) -> fidl::client::QueryResponseFut<
1787        fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult,
1788        fidl::encoding::DefaultFuchsiaResourceDialect,
1789    > {
1790        SocketProxyInterface::r#set_bind_to_device(self, value)
1791    }
1792
1793    /// Get `SOL_SOCKET` -> `SO_BINDTODEVICE`.
1794    pub fn r#get_bind_to_device(
1795        &self,
1796    ) -> fidl::client::QueryResponseFut<
1797        fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult,
1798        fidl::encoding::DefaultFuchsiaResourceDialect,
1799    > {
1800        SocketProxyInterface::r#get_bind_to_device(self)
1801    }
1802
1803    /// Set `SOL_SOCKET` -> `SO_BINDTOIFINDEX`.
1804    /// If `value` is 0, this clears the bound interface.
1805    pub fn r#set_bind_to_interface_index(
1806        &self,
1807        mut value: u64,
1808    ) -> fidl::client::QueryResponseFut<
1809        fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult,
1810        fidl::encoding::DefaultFuchsiaResourceDialect,
1811    > {
1812        SocketProxyInterface::r#set_bind_to_interface_index(self, value)
1813    }
1814
1815    /// Get `SOL_SOCKET` -> `SO_BINDTOIFINDEX`.
1816    pub fn r#get_bind_to_interface_index(
1817        &self,
1818    ) -> fidl::client::QueryResponseFut<
1819        fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult,
1820        fidl::encoding::DefaultFuchsiaResourceDialect,
1821    > {
1822        SocketProxyInterface::r#get_bind_to_interface_index(self)
1823    }
1824
1825    /// Set `SOL_SOCKET` -> `SO_TIMESTAMP` or `SO_TIMESTAMPNS`.
1826    pub fn r#set_timestamp(
1827        &self,
1828        mut value: fidl_fuchsia_posix_socket::TimestampOption,
1829    ) -> fidl::client::QueryResponseFut<
1830        fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult,
1831        fidl::encoding::DefaultFuchsiaResourceDialect,
1832    > {
1833        SocketProxyInterface::r#set_timestamp(self, value)
1834    }
1835
1836    /// Get `SOL_SOCKET` -> `SO_TIMESTAMP` or `SO_TIMESTAMPNS`.
1837    pub fn r#get_timestamp(
1838        &self,
1839    ) -> fidl::client::QueryResponseFut<
1840        fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult,
1841        fidl::encoding::DefaultFuchsiaResourceDialect,
1842    > {
1843        SocketProxyInterface::r#get_timestamp(self)
1844    }
1845
1846    /// Like setting `SOL_SOCKET` -> `SO_MARK`. The major difference is that
1847    /// unlike the standard SO_MARK, this API has multiple mark domains and each
1848    /// mark can be set independently in each domain.
1849    pub fn r#set_mark(
1850        &self,
1851        mut domain: fidl_fuchsia_net::MarkDomain,
1852        mut mark: &fidl_fuchsia_posix_socket::OptionalUint32,
1853    ) -> fidl::client::QueryResponseFut<
1854        fidl_fuchsia_posix_socket::BaseSocketSetMarkResult,
1855        fidl::encoding::DefaultFuchsiaResourceDialect,
1856    > {
1857        SocketProxyInterface::r#set_mark(self, domain, mark)
1858    }
1859
1860    /// Like getting `SOL_SOCKET` -> `SO_MARK`. The major difference is that
1861    /// unlike the standard SO_MARK, this API has multiple mark domains and each
1862    /// mark can be retrieved independently in each domain.
1863    pub fn r#get_mark(
1864        &self,
1865        mut domain: fidl_fuchsia_net::MarkDomain,
1866    ) -> fidl::client::QueryResponseFut<
1867        fidl_fuchsia_posix_socket::BaseSocketGetMarkResult,
1868        fidl::encoding::DefaultFuchsiaResourceDialect,
1869    > {
1870        SocketProxyInterface::r#get_mark(self, domain)
1871    }
1872
1873    /// Get `SOL_SOCKET` -> `SO_COOKIE`.
1874    pub fn r#get_cookie(
1875        &self,
1876    ) -> fidl::client::QueryResponseFut<
1877        fidl_fuchsia_posix_socket::BaseSocketGetCookieResult,
1878        fidl::encoding::DefaultFuchsiaResourceDialect,
1879    > {
1880        SocketProxyInterface::r#get_cookie(self)
1881    }
1882
1883    pub fn r#describe(
1884        &self,
1885    ) -> fidl::client::QueryResponseFut<
1886        SocketDescribeResponse,
1887        fidl::encoding::DefaultFuchsiaResourceDialect,
1888    > {
1889        SocketProxyInterface::r#describe(self)
1890    }
1891
1892    /// Bind the socket to a protocol and/or interface.
1893    ///
1894    /// + request `protocol` the socket's new protocol association.
1895    /// + request `bound_interface_id` the socket's new interface binding.
1896    pub fn r#bind(
1897        &self,
1898        mut protocol: Option<&ProtocolAssociation>,
1899        mut bound_interface_id: &BoundInterfaceId,
1900    ) -> fidl::client::QueryResponseFut<
1901        SocketBindResult,
1902        fidl::encoding::DefaultFuchsiaResourceDialect,
1903    > {
1904        SocketProxyInterface::r#bind(self, protocol, bound_interface_id)
1905    }
1906
1907    /// Returns the the socket's properties.
1908    ///
1909    /// - response `kind` the socket's `Kind`.
1910    /// - response `protocol` the socket's protocol association, if associated.
1911    /// - response `bound_interface` properties of the socket's interface
1912    ///   binding.
1913    pub fn r#get_info(
1914        &self,
1915    ) -> fidl::client::QueryResponseFut<
1916        SocketGetInfoResult,
1917        fidl::encoding::DefaultFuchsiaResourceDialect,
1918    > {
1919        SocketProxyInterface::r#get_info(self)
1920    }
1921
1922    /// Receives a message from the socket.
1923    ///
1924    /// + request `want_packet_info` request information about the packet to be
1925    ///   returned.
1926    /// + request `data_len` the maximum allowed length of the response data
1927    ///   buffer.
1928    /// + request `want_control` request ancillary data to be returned.
1929    /// + request `flags` flags for the receive request.
1930    /// - response `packet_info` information about the packet, if requested.
1931    /// - response `data` the message.
1932    /// - response `control` control messages, if requested.
1933    /// - response `truncated` indicates whether or not the returned message
1934    ///   was truncated.
1935    pub fn r#recv_msg(
1936        &self,
1937        mut want_packet_info: bool,
1938        mut data_len: u32,
1939        mut want_control: bool,
1940        mut flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
1941    ) -> fidl::client::QueryResponseFut<
1942        SocketRecvMsgResult,
1943        fidl::encoding::DefaultFuchsiaResourceDialect,
1944    > {
1945        SocketProxyInterface::r#recv_msg(self, want_packet_info, data_len, want_control, flags)
1946    }
1947
1948    /// Sends a message on the socket.
1949    ///
1950    /// + request `packet_info` information about the packet.
1951    /// + request `data` the message.
1952    /// + request `control` ancillary data.
1953    /// + request `flags` flags for the send request.
1954    pub fn r#send_msg(
1955        &self,
1956        mut packet_info: Option<&PacketInfo>,
1957        mut data: &[u8],
1958        mut control: &SendControlData,
1959        mut flags: fidl_fuchsia_posix_socket::SendMsgFlags,
1960    ) -> fidl::client::QueryResponseFut<
1961        SocketSendMsgResult,
1962        fidl::encoding::DefaultFuchsiaResourceDialect,
1963    > {
1964        SocketProxyInterface::r#send_msg(self, packet_info, data, control, flags)
1965    }
1966
1967    /// Attaches the specified eBPF filter. The filter is assumed to be verified with 2 arguments
1968    ///  1. Pointer to the packet of size 0, i.e. not accessed directly (only using cBPF packet
1969    ///     load instructions).
1970    ///  2. Packet size (BPF_LOAD).
1971    /// Helper functions and maps are not supported.
1972    pub fn r#attach_bpf_filter_unsafe(
1973        &self,
1974        mut code: &[u64],
1975    ) -> fidl::client::QueryResponseFut<
1976        SocketAttachBpfFilterUnsafeResult,
1977        fidl::encoding::DefaultFuchsiaResourceDialect,
1978    > {
1979        SocketProxyInterface::r#attach_bpf_filter_unsafe(self, code)
1980    }
1981}
1982
1983impl SocketProxyInterface for SocketProxy {
1984    fn r#clone(
1985        &self,
1986        mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
1987    ) -> Result<(), fidl::Error> {
1988        self.client.send::<fidl_fuchsia_unknown::CloneableCloneRequest>(
1989            (request,),
1990            0x20d8a7aba2168a79,
1991            fidl::encoding::DynamicFlags::empty(),
1992        )
1993    }
1994
1995    type CloseResponseFut = fidl::client::QueryResponseFut<
1996        fidl_fuchsia_unknown::CloseableCloseResult,
1997        fidl::encoding::DefaultFuchsiaResourceDialect,
1998    >;
1999    fn r#close(&self) -> Self::CloseResponseFut {
2000        fn _decode(
2001            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2002        ) -> Result<fidl_fuchsia_unknown::CloseableCloseResult, fidl::Error> {
2003            let _response = fidl::client::decode_transaction_body::<
2004                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2005                fidl::encoding::DefaultFuchsiaResourceDialect,
2006                0x5ac5d459ad7f657e,
2007            >(_buf?)?;
2008            Ok(_response.map(|x| x))
2009        }
2010        self.client.send_query_and_decode::<
2011            fidl::encoding::EmptyPayload,
2012            fidl_fuchsia_unknown::CloseableCloseResult,
2013        >(
2014            (),
2015            0x5ac5d459ad7f657e,
2016            fidl::encoding::DynamicFlags::empty(),
2017            _decode,
2018        )
2019    }
2020
2021    type QueryResponseFut =
2022        fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2023    fn r#query(&self) -> Self::QueryResponseFut {
2024        fn _decode(
2025            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2026        ) -> Result<Vec<u8>, fidl::Error> {
2027            let _response = fidl::client::decode_transaction_body::<
2028                fidl_fuchsia_unknown::QueryableQueryResponse,
2029                fidl::encoding::DefaultFuchsiaResourceDialect,
2030                0x2658edee9decfc06,
2031            >(_buf?)?;
2032            Ok(_response.protocol)
2033        }
2034        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
2035            (),
2036            0x2658edee9decfc06,
2037            fidl::encoding::DynamicFlags::empty(),
2038            _decode,
2039        )
2040    }
2041
2042    type SetReuseAddressResponseFut = fidl::client::QueryResponseFut<
2043        fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult,
2044        fidl::encoding::DefaultFuchsiaResourceDialect,
2045    >;
2046    fn r#set_reuse_address(&self, mut value: bool) -> Self::SetReuseAddressResponseFut {
2047        fn _decode(
2048            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2049        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult, fidl::Error>
2050        {
2051            let _response = fidl::client::decode_transaction_body::<
2052                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2053                fidl::encoding::DefaultFuchsiaResourceDialect,
2054                0x1fd74ee8b9a4a876,
2055            >(_buf?)?;
2056            Ok(_response.map(|x| x))
2057        }
2058        self.client.send_query_and_decode::<
2059            fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressRequest,
2060            fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressResult,
2061        >(
2062            (value,),
2063            0x1fd74ee8b9a4a876,
2064            fidl::encoding::DynamicFlags::empty(),
2065            _decode,
2066        )
2067    }
2068
2069    type GetReuseAddressResponseFut = fidl::client::QueryResponseFut<
2070        fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult,
2071        fidl::encoding::DefaultFuchsiaResourceDialect,
2072    >;
2073    fn r#get_reuse_address(&self) -> Self::GetReuseAddressResponseFut {
2074        fn _decode(
2075            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2076        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult, fidl::Error>
2077        {
2078            let _response = fidl::client::decode_transaction_body::<
2079                fidl::encoding::ResultType<
2080                    fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResponse,
2081                    fidl_fuchsia_posix::Errno,
2082                >,
2083                fidl::encoding::DefaultFuchsiaResourceDialect,
2084                0x67b7206b8d1bc0a5,
2085            >(_buf?)?;
2086            Ok(_response.map(|x| x.value))
2087        }
2088        self.client.send_query_and_decode::<
2089            fidl::encoding::EmptyPayload,
2090            fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResult,
2091        >(
2092            (),
2093            0x67b7206b8d1bc0a5,
2094            fidl::encoding::DynamicFlags::empty(),
2095            _decode,
2096        )
2097    }
2098
2099    type GetErrorResponseFut = fidl::client::QueryResponseFut<
2100        fidl_fuchsia_posix_socket::BaseSocketGetErrorResult,
2101        fidl::encoding::DefaultFuchsiaResourceDialect,
2102    >;
2103    fn r#get_error(&self) -> Self::GetErrorResponseFut {
2104        fn _decode(
2105            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2106        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetErrorResult, fidl::Error> {
2107            let _response = fidl::client::decode_transaction_body::<
2108                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2109                fidl::encoding::DefaultFuchsiaResourceDialect,
2110                0x5aad39b33e5f6ebb,
2111            >(_buf?)?;
2112            Ok(_response.map(|x| x))
2113        }
2114        self.client.send_query_and_decode::<
2115            fidl::encoding::EmptyPayload,
2116            fidl_fuchsia_posix_socket::BaseSocketGetErrorResult,
2117        >(
2118            (),
2119            0x5aad39b33e5f6ebb,
2120            fidl::encoding::DynamicFlags::empty(),
2121            _decode,
2122        )
2123    }
2124
2125    type SetBroadcastResponseFut = fidl::client::QueryResponseFut<
2126        fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult,
2127        fidl::encoding::DefaultFuchsiaResourceDialect,
2128    >;
2129    fn r#set_broadcast(&self, mut value: bool) -> Self::SetBroadcastResponseFut {
2130        fn _decode(
2131            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2132        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult, fidl::Error> {
2133            let _response = fidl::client::decode_transaction_body::<
2134                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2135                fidl::encoding::DefaultFuchsiaResourceDialect,
2136                0x6023e081ce3cd947,
2137            >(_buf?)?;
2138            Ok(_response.map(|x| x))
2139        }
2140        self.client.send_query_and_decode::<
2141            fidl_fuchsia_posix_socket::BaseSocketSetBroadcastRequest,
2142            fidl_fuchsia_posix_socket::BaseSocketSetBroadcastResult,
2143        >(
2144            (value,),
2145            0x6023e081ce3cd947,
2146            fidl::encoding::DynamicFlags::empty(),
2147            _decode,
2148        )
2149    }
2150
2151    type GetBroadcastResponseFut = fidl::client::QueryResponseFut<
2152        fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult,
2153        fidl::encoding::DefaultFuchsiaResourceDialect,
2154    >;
2155    fn r#get_broadcast(&self) -> Self::GetBroadcastResponseFut {
2156        fn _decode(
2157            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2158        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult, fidl::Error> {
2159            let _response = fidl::client::decode_transaction_body::<
2160                fidl::encoding::ResultType<
2161                    fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResponse,
2162                    fidl_fuchsia_posix::Errno,
2163                >,
2164                fidl::encoding::DefaultFuchsiaResourceDialect,
2165                0x68796fc556f9780d,
2166            >(_buf?)?;
2167            Ok(_response.map(|x| x.value))
2168        }
2169        self.client.send_query_and_decode::<
2170            fidl::encoding::EmptyPayload,
2171            fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResult,
2172        >(
2173            (),
2174            0x68796fc556f9780d,
2175            fidl::encoding::DynamicFlags::empty(),
2176            _decode,
2177        )
2178    }
2179
2180    type SetSendBufferResponseFut = fidl::client::QueryResponseFut<
2181        fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult,
2182        fidl::encoding::DefaultFuchsiaResourceDialect,
2183    >;
2184    fn r#set_send_buffer(&self, mut value_bytes: u64) -> Self::SetSendBufferResponseFut {
2185        fn _decode(
2186            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2187        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult, fidl::Error> {
2188            let _response = fidl::client::decode_transaction_body::<
2189                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2190                fidl::encoding::DefaultFuchsiaResourceDialect,
2191                0x756eac32d73a7a70,
2192            >(_buf?)?;
2193            Ok(_response.map(|x| x))
2194        }
2195        self.client.send_query_and_decode::<
2196            fidl_fuchsia_posix_socket::BaseSocketSetSendBufferRequest,
2197            fidl_fuchsia_posix_socket::BaseSocketSetSendBufferResult,
2198        >(
2199            (value_bytes,),
2200            0x756eac32d73a7a70,
2201            fidl::encoding::DynamicFlags::empty(),
2202            _decode,
2203        )
2204    }
2205
2206    type GetSendBufferResponseFut = fidl::client::QueryResponseFut<
2207        fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult,
2208        fidl::encoding::DefaultFuchsiaResourceDialect,
2209    >;
2210    fn r#get_send_buffer(&self) -> Self::GetSendBufferResponseFut {
2211        fn _decode(
2212            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2213        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult, fidl::Error> {
2214            let _response = fidl::client::decode_transaction_body::<
2215                fidl::encoding::ResultType<
2216                    fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResponse,
2217                    fidl_fuchsia_posix::Errno,
2218                >,
2219                fidl::encoding::DefaultFuchsiaResourceDialect,
2220                0x78a52fd9c7b2410b,
2221            >(_buf?)?;
2222            Ok(_response.map(|x| x.value_bytes))
2223        }
2224        self.client.send_query_and_decode::<
2225            fidl::encoding::EmptyPayload,
2226            fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResult,
2227        >(
2228            (),
2229            0x78a52fd9c7b2410b,
2230            fidl::encoding::DynamicFlags::empty(),
2231            _decode,
2232        )
2233    }
2234
2235    type SetReceiveBufferResponseFut = fidl::client::QueryResponseFut<
2236        fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult,
2237        fidl::encoding::DefaultFuchsiaResourceDialect,
2238    >;
2239    fn r#set_receive_buffer(&self, mut value_bytes: u64) -> Self::SetReceiveBufferResponseFut {
2240        fn _decode(
2241            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2242        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult, fidl::Error>
2243        {
2244            let _response = fidl::client::decode_transaction_body::<
2245                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2246                fidl::encoding::DefaultFuchsiaResourceDialect,
2247                0x6b0cf2f1919c7001,
2248            >(_buf?)?;
2249            Ok(_response.map(|x| x))
2250        }
2251        self.client.send_query_and_decode::<
2252            fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferRequest,
2253            fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferResult,
2254        >(
2255            (value_bytes,),
2256            0x6b0cf2f1919c7001,
2257            fidl::encoding::DynamicFlags::empty(),
2258            _decode,
2259        )
2260    }
2261
2262    type GetReceiveBufferResponseFut = fidl::client::QueryResponseFut<
2263        fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult,
2264        fidl::encoding::DefaultFuchsiaResourceDialect,
2265    >;
2266    fn r#get_receive_buffer(&self) -> Self::GetReceiveBufferResponseFut {
2267        fn _decode(
2268            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2269        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult, fidl::Error>
2270        {
2271            let _response = fidl::client::decode_transaction_body::<
2272                fidl::encoding::ResultType<
2273                    fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResponse,
2274                    fidl_fuchsia_posix::Errno,
2275                >,
2276                fidl::encoding::DefaultFuchsiaResourceDialect,
2277                0x14c1a4b64f709e5c,
2278            >(_buf?)?;
2279            Ok(_response.map(|x| x.value_bytes))
2280        }
2281        self.client.send_query_and_decode::<
2282            fidl::encoding::EmptyPayload,
2283            fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResult,
2284        >(
2285            (),
2286            0x14c1a4b64f709e5c,
2287            fidl::encoding::DynamicFlags::empty(),
2288            _decode,
2289        )
2290    }
2291
2292    type SetKeepAliveResponseFut = fidl::client::QueryResponseFut<
2293        fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult,
2294        fidl::encoding::DefaultFuchsiaResourceDialect,
2295    >;
2296    fn r#set_keep_alive(&self, mut value: bool) -> Self::SetKeepAliveResponseFut {
2297        fn _decode(
2298            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2299        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult, fidl::Error> {
2300            let _response = fidl::client::decode_transaction_body::<
2301                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2302                fidl::encoding::DefaultFuchsiaResourceDialect,
2303                0x572df8f0b920d2c7,
2304            >(_buf?)?;
2305            Ok(_response.map(|x| x))
2306        }
2307        self.client.send_query_and_decode::<
2308            fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveRequest,
2309            fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveResult,
2310        >(
2311            (value,),
2312            0x572df8f0b920d2c7,
2313            fidl::encoding::DynamicFlags::empty(),
2314            _decode,
2315        )
2316    }
2317
2318    type GetKeepAliveResponseFut = fidl::client::QueryResponseFut<
2319        fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult,
2320        fidl::encoding::DefaultFuchsiaResourceDialect,
2321    >;
2322    fn r#get_keep_alive(&self) -> Self::GetKeepAliveResponseFut {
2323        fn _decode(
2324            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2325        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult, fidl::Error> {
2326            let _response = fidl::client::decode_transaction_body::<
2327                fidl::encoding::ResultType<
2328                    fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResponse,
2329                    fidl_fuchsia_posix::Errno,
2330                >,
2331                fidl::encoding::DefaultFuchsiaResourceDialect,
2332                0x2dd29d3215f2c9d2,
2333            >(_buf?)?;
2334            Ok(_response.map(|x| x.value))
2335        }
2336        self.client.send_query_and_decode::<
2337            fidl::encoding::EmptyPayload,
2338            fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResult,
2339        >(
2340            (),
2341            0x2dd29d3215f2c9d2,
2342            fidl::encoding::DynamicFlags::empty(),
2343            _decode,
2344        )
2345    }
2346
2347    type SetOutOfBandInlineResponseFut = fidl::client::QueryResponseFut<
2348        fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult,
2349        fidl::encoding::DefaultFuchsiaResourceDialect,
2350    >;
2351    fn r#set_out_of_band_inline(&self, mut value: bool) -> Self::SetOutOfBandInlineResponseFut {
2352        fn _decode(
2353            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2354        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult, fidl::Error>
2355        {
2356            let _response = fidl::client::decode_transaction_body::<
2357                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2358                fidl::encoding::DefaultFuchsiaResourceDialect,
2359                0x3ecb49968bee439,
2360            >(_buf?)?;
2361            Ok(_response.map(|x| x))
2362        }
2363        self.client.send_query_and_decode::<
2364            fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineRequest,
2365            fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineResult,
2366        >(
2367            (value,),
2368            0x3ecb49968bee439,
2369            fidl::encoding::DynamicFlags::empty(),
2370            _decode,
2371        )
2372    }
2373
2374    type GetOutOfBandInlineResponseFut = fidl::client::QueryResponseFut<
2375        fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult,
2376        fidl::encoding::DefaultFuchsiaResourceDialect,
2377    >;
2378    fn r#get_out_of_band_inline(&self) -> Self::GetOutOfBandInlineResponseFut {
2379        fn _decode(
2380            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2381        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult, fidl::Error>
2382        {
2383            let _response = fidl::client::decode_transaction_body::<
2384                fidl::encoding::ResultType<
2385                    fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResponse,
2386                    fidl_fuchsia_posix::Errno,
2387                >,
2388                fidl::encoding::DefaultFuchsiaResourceDialect,
2389                0x348c1ab3aeca1745,
2390            >(_buf?)?;
2391            Ok(_response.map(|x| x.value))
2392        }
2393        self.client.send_query_and_decode::<
2394            fidl::encoding::EmptyPayload,
2395            fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResult,
2396        >(
2397            (),
2398            0x348c1ab3aeca1745,
2399            fidl::encoding::DynamicFlags::empty(),
2400            _decode,
2401        )
2402    }
2403
2404    type SetNoCheckResponseFut = fidl::client::QueryResponseFut<
2405        fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult,
2406        fidl::encoding::DefaultFuchsiaResourceDialect,
2407    >;
2408    fn r#set_no_check(&self, mut value: bool) -> Self::SetNoCheckResponseFut {
2409        fn _decode(
2410            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2411        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult, fidl::Error> {
2412            let _response = fidl::client::decode_transaction_body::<
2413                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2414                fidl::encoding::DefaultFuchsiaResourceDialect,
2415                0x6bbf00c53a4c78c2,
2416            >(_buf?)?;
2417            Ok(_response.map(|x| x))
2418        }
2419        self.client.send_query_and_decode::<
2420            fidl_fuchsia_posix_socket::BaseSocketSetNoCheckRequest,
2421            fidl_fuchsia_posix_socket::BaseSocketSetNoCheckResult,
2422        >(
2423            (value,),
2424            0x6bbf00c53a4c78c2,
2425            fidl::encoding::DynamicFlags::empty(),
2426            _decode,
2427        )
2428    }
2429
2430    type GetNoCheckResponseFut = fidl::client::QueryResponseFut<
2431        fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult,
2432        fidl::encoding::DefaultFuchsiaResourceDialect,
2433    >;
2434    fn r#get_no_check(&self) -> Self::GetNoCheckResponseFut {
2435        fn _decode(
2436            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2437        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult, fidl::Error> {
2438            let _response = fidl::client::decode_transaction_body::<
2439                fidl::encoding::ResultType<
2440                    fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResponse,
2441                    fidl_fuchsia_posix::Errno,
2442                >,
2443                fidl::encoding::DefaultFuchsiaResourceDialect,
2444                0x2cd4249286417694,
2445            >(_buf?)?;
2446            Ok(_response.map(|x| x.value))
2447        }
2448        self.client.send_query_and_decode::<
2449            fidl::encoding::EmptyPayload,
2450            fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResult,
2451        >(
2452            (),
2453            0x2cd4249286417694,
2454            fidl::encoding::DynamicFlags::empty(),
2455            _decode,
2456        )
2457    }
2458
2459    type SetLingerResponseFut = fidl::client::QueryResponseFut<
2460        fidl_fuchsia_posix_socket::BaseSocketSetLingerResult,
2461        fidl::encoding::DefaultFuchsiaResourceDialect,
2462    >;
2463    fn r#set_linger(&self, mut linger: bool, mut length_secs: u32) -> Self::SetLingerResponseFut {
2464        fn _decode(
2465            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2466        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetLingerResult, fidl::Error> {
2467            let _response = fidl::client::decode_transaction_body::<
2468                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2469                fidl::encoding::DefaultFuchsiaResourceDialect,
2470                0x45386351246e998e,
2471            >(_buf?)?;
2472            Ok(_response.map(|x| x))
2473        }
2474        self.client.send_query_and_decode::<
2475            fidl_fuchsia_posix_socket::BaseSocketSetLingerRequest,
2476            fidl_fuchsia_posix_socket::BaseSocketSetLingerResult,
2477        >(
2478            (linger, length_secs,),
2479            0x45386351246e998e,
2480            fidl::encoding::DynamicFlags::empty(),
2481            _decode,
2482        )
2483    }
2484
2485    type GetLingerResponseFut = fidl::client::QueryResponseFut<
2486        fidl_fuchsia_posix_socket::BaseSocketGetLingerResult,
2487        fidl::encoding::DefaultFuchsiaResourceDialect,
2488    >;
2489    fn r#get_linger(&self) -> Self::GetLingerResponseFut {
2490        fn _decode(
2491            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2492        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetLingerResult, fidl::Error> {
2493            let _response = fidl::client::decode_transaction_body::<
2494                fidl::encoding::ResultType<
2495                    fidl_fuchsia_posix_socket::BaseSocketGetLingerResponse,
2496                    fidl_fuchsia_posix::Errno,
2497                >,
2498                fidl::encoding::DefaultFuchsiaResourceDialect,
2499                0x48eb20fc5ccb0e45,
2500            >(_buf?)?;
2501            Ok(_response.map(|x| (x.linger, x.length_secs)))
2502        }
2503        self.client.send_query_and_decode::<
2504            fidl::encoding::EmptyPayload,
2505            fidl_fuchsia_posix_socket::BaseSocketGetLingerResult,
2506        >(
2507            (),
2508            0x48eb20fc5ccb0e45,
2509            fidl::encoding::DynamicFlags::empty(),
2510            _decode,
2511        )
2512    }
2513
2514    type SetReusePortResponseFut = fidl::client::QueryResponseFut<
2515        fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult,
2516        fidl::encoding::DefaultFuchsiaResourceDialect,
2517    >;
2518    fn r#set_reuse_port(&self, mut value: bool) -> Self::SetReusePortResponseFut {
2519        fn _decode(
2520            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2521        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult, fidl::Error> {
2522            let _response = fidl::client::decode_transaction_body::<
2523                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2524                fidl::encoding::DefaultFuchsiaResourceDialect,
2525                0x24dd3e5cb36d9ccb,
2526            >(_buf?)?;
2527            Ok(_response.map(|x| x))
2528        }
2529        self.client.send_query_and_decode::<
2530            fidl_fuchsia_posix_socket::BaseSocketSetReusePortRequest,
2531            fidl_fuchsia_posix_socket::BaseSocketSetReusePortResult,
2532        >(
2533            (value,),
2534            0x24dd3e5cb36d9ccb,
2535            fidl::encoding::DynamicFlags::empty(),
2536            _decode,
2537        )
2538    }
2539
2540    type GetReusePortResponseFut = fidl::client::QueryResponseFut<
2541        fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult,
2542        fidl::encoding::DefaultFuchsiaResourceDialect,
2543    >;
2544    fn r#get_reuse_port(&self) -> Self::GetReusePortResponseFut {
2545        fn _decode(
2546            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2547        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult, fidl::Error> {
2548            let _response = fidl::client::decode_transaction_body::<
2549                fidl::encoding::ResultType<
2550                    fidl_fuchsia_posix_socket::BaseSocketGetReusePortResponse,
2551                    fidl_fuchsia_posix::Errno,
2552                >,
2553                fidl::encoding::DefaultFuchsiaResourceDialect,
2554                0x7a112c1ab54ff828,
2555            >(_buf?)?;
2556            Ok(_response.map(|x| x.value))
2557        }
2558        self.client.send_query_and_decode::<
2559            fidl::encoding::EmptyPayload,
2560            fidl_fuchsia_posix_socket::BaseSocketGetReusePortResult,
2561        >(
2562            (),
2563            0x7a112c1ab54ff828,
2564            fidl::encoding::DynamicFlags::empty(),
2565            _decode,
2566        )
2567    }
2568
2569    type GetAcceptConnResponseFut = fidl::client::QueryResponseFut<
2570        fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult,
2571        fidl::encoding::DefaultFuchsiaResourceDialect,
2572    >;
2573    fn r#get_accept_conn(&self) -> Self::GetAcceptConnResponseFut {
2574        fn _decode(
2575            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2576        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult, fidl::Error> {
2577            let _response = fidl::client::decode_transaction_body::<
2578                fidl::encoding::ResultType<
2579                    fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResponse,
2580                    fidl_fuchsia_posix::Errno,
2581                >,
2582                fidl::encoding::DefaultFuchsiaResourceDialect,
2583                0x67ce6db6c2ec8966,
2584            >(_buf?)?;
2585            Ok(_response.map(|x| x.value))
2586        }
2587        self.client.send_query_and_decode::<
2588            fidl::encoding::EmptyPayload,
2589            fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResult,
2590        >(
2591            (),
2592            0x67ce6db6c2ec8966,
2593            fidl::encoding::DynamicFlags::empty(),
2594            _decode,
2595        )
2596    }
2597
2598    type SetBindToDeviceResponseFut = fidl::client::QueryResponseFut<
2599        fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult,
2600        fidl::encoding::DefaultFuchsiaResourceDialect,
2601    >;
2602    fn r#set_bind_to_device(&self, mut value: &str) -> Self::SetBindToDeviceResponseFut {
2603        fn _decode(
2604            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2605        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult, fidl::Error>
2606        {
2607            let _response = fidl::client::decode_transaction_body::<
2608                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2609                fidl::encoding::DefaultFuchsiaResourceDialect,
2610                0x2118b483f28aafc4,
2611            >(_buf?)?;
2612            Ok(_response.map(|x| x))
2613        }
2614        self.client.send_query_and_decode::<
2615            fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceRequest,
2616            fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceResult,
2617        >(
2618            (value,),
2619            0x2118b483f28aafc4,
2620            fidl::encoding::DynamicFlags::empty(),
2621            _decode,
2622        )
2623    }
2624
2625    type GetBindToDeviceResponseFut = fidl::client::QueryResponseFut<
2626        fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult,
2627        fidl::encoding::DefaultFuchsiaResourceDialect,
2628    >;
2629    fn r#get_bind_to_device(&self) -> Self::GetBindToDeviceResponseFut {
2630        fn _decode(
2631            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2632        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult, fidl::Error>
2633        {
2634            let _response = fidl::client::decode_transaction_body::<
2635                fidl::encoding::ResultType<
2636                    fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResponse,
2637                    fidl_fuchsia_posix::Errno,
2638                >,
2639                fidl::encoding::DefaultFuchsiaResourceDialect,
2640                0x1ab1fbf0ef7906c8,
2641            >(_buf?)?;
2642            Ok(_response.map(|x| x.value))
2643        }
2644        self.client.send_query_and_decode::<
2645            fidl::encoding::EmptyPayload,
2646            fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResult,
2647        >(
2648            (),
2649            0x1ab1fbf0ef7906c8,
2650            fidl::encoding::DynamicFlags::empty(),
2651            _decode,
2652        )
2653    }
2654
2655    type SetBindToInterfaceIndexResponseFut = fidl::client::QueryResponseFut<
2656        fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult,
2657        fidl::encoding::DefaultFuchsiaResourceDialect,
2658    >;
2659    fn r#set_bind_to_interface_index(
2660        &self,
2661        mut value: u64,
2662    ) -> Self::SetBindToInterfaceIndexResponseFut {
2663        fn _decode(
2664            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2665        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult, fidl::Error>
2666        {
2667            let _response = fidl::client::decode_transaction_body::<
2668                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2669                fidl::encoding::DefaultFuchsiaResourceDialect,
2670                0x6e387a0def00821,
2671            >(_buf?)?;
2672            Ok(_response.map(|x| x))
2673        }
2674        self.client.send_query_and_decode::<
2675            fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexRequest,
2676            fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexResult,
2677        >(
2678            (value,),
2679            0x6e387a0def00821,
2680            fidl::encoding::DynamicFlags::empty(),
2681            _decode,
2682        )
2683    }
2684
2685    type GetBindToInterfaceIndexResponseFut = fidl::client::QueryResponseFut<
2686        fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult,
2687        fidl::encoding::DefaultFuchsiaResourceDialect,
2688    >;
2689    fn r#get_bind_to_interface_index(&self) -> Self::GetBindToInterfaceIndexResponseFut {
2690        fn _decode(
2691            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2692        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult, fidl::Error>
2693        {
2694            let _response = fidl::client::decode_transaction_body::<
2695                fidl::encoding::ResultType<
2696                    fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResponse,
2697                    fidl_fuchsia_posix::Errno,
2698                >,
2699                fidl::encoding::DefaultFuchsiaResourceDialect,
2700                0x59c31dd3e3078295,
2701            >(_buf?)?;
2702            Ok(_response.map(|x| x.value))
2703        }
2704        self.client.send_query_and_decode::<
2705            fidl::encoding::EmptyPayload,
2706            fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResult,
2707        >(
2708            (),
2709            0x59c31dd3e3078295,
2710            fidl::encoding::DynamicFlags::empty(),
2711            _decode,
2712        )
2713    }
2714
2715    type SetTimestampResponseFut = fidl::client::QueryResponseFut<
2716        fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult,
2717        fidl::encoding::DefaultFuchsiaResourceDialect,
2718    >;
2719    fn r#set_timestamp(
2720        &self,
2721        mut value: fidl_fuchsia_posix_socket::TimestampOption,
2722    ) -> Self::SetTimestampResponseFut {
2723        fn _decode(
2724            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2725        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult, fidl::Error> {
2726            let _response = fidl::client::decode_transaction_body::<
2727                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2728                fidl::encoding::DefaultFuchsiaResourceDialect,
2729                0x285d6516c263d839,
2730            >(_buf?)?;
2731            Ok(_response.map(|x| x))
2732        }
2733        self.client.send_query_and_decode::<
2734            fidl_fuchsia_posix_socket::BaseSocketSetTimestampRequest,
2735            fidl_fuchsia_posix_socket::BaseSocketSetTimestampResult,
2736        >(
2737            (value,),
2738            0x285d6516c263d839,
2739            fidl::encoding::DynamicFlags::empty(),
2740            _decode,
2741        )
2742    }
2743
2744    type GetTimestampResponseFut = fidl::client::QueryResponseFut<
2745        fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult,
2746        fidl::encoding::DefaultFuchsiaResourceDialect,
2747    >;
2748    fn r#get_timestamp(&self) -> Self::GetTimestampResponseFut {
2749        fn _decode(
2750            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2751        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult, fidl::Error> {
2752            let _response = fidl::client::decode_transaction_body::<
2753                fidl::encoding::ResultType<
2754                    fidl_fuchsia_posix_socket::BaseSocketGetTimestampResponse,
2755                    fidl_fuchsia_posix::Errno,
2756                >,
2757                fidl::encoding::DefaultFuchsiaResourceDialect,
2758                0x49f2fffbbcc2bd27,
2759            >(_buf?)?;
2760            Ok(_response.map(|x| x.value))
2761        }
2762        self.client.send_query_and_decode::<
2763            fidl::encoding::EmptyPayload,
2764            fidl_fuchsia_posix_socket::BaseSocketGetTimestampResult,
2765        >(
2766            (),
2767            0x49f2fffbbcc2bd27,
2768            fidl::encoding::DynamicFlags::empty(),
2769            _decode,
2770        )
2771    }
2772
2773    type SetMarkResponseFut = fidl::client::QueryResponseFut<
2774        fidl_fuchsia_posix_socket::BaseSocketSetMarkResult,
2775        fidl::encoding::DefaultFuchsiaResourceDialect,
2776    >;
2777    fn r#set_mark(
2778        &self,
2779        mut domain: fidl_fuchsia_net::MarkDomain,
2780        mut mark: &fidl_fuchsia_posix_socket::OptionalUint32,
2781    ) -> Self::SetMarkResponseFut {
2782        fn _decode(
2783            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2784        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketSetMarkResult, fidl::Error> {
2785            let _response = fidl::client::decode_transaction_body::<
2786                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2787                fidl::encoding::DefaultFuchsiaResourceDialect,
2788                0x6ead6de09f653236,
2789            >(_buf?)?;
2790            Ok(_response.map(|x| x))
2791        }
2792        self.client.send_query_and_decode::<
2793            fidl_fuchsia_posix_socket::BaseSocketSetMarkRequest,
2794            fidl_fuchsia_posix_socket::BaseSocketSetMarkResult,
2795        >(
2796            (domain, mark,),
2797            0x6ead6de09f653236,
2798            fidl::encoding::DynamicFlags::empty(),
2799            _decode,
2800        )
2801    }
2802
2803    type GetMarkResponseFut = fidl::client::QueryResponseFut<
2804        fidl_fuchsia_posix_socket::BaseSocketGetMarkResult,
2805        fidl::encoding::DefaultFuchsiaResourceDialect,
2806    >;
2807    fn r#get_mark(&self, mut domain: fidl_fuchsia_net::MarkDomain) -> Self::GetMarkResponseFut {
2808        fn _decode(
2809            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2810        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetMarkResult, fidl::Error> {
2811            let _response = fidl::client::decode_transaction_body::<
2812                fidl::encoding::ResultType<
2813                    fidl_fuchsia_posix_socket::BaseSocketGetMarkResponse,
2814                    fidl_fuchsia_posix::Errno,
2815                >,
2816                fidl::encoding::DefaultFuchsiaResourceDialect,
2817                0x57a2752c61d93d47,
2818            >(_buf?)?;
2819            Ok(_response.map(|x| x.mark))
2820        }
2821        self.client.send_query_and_decode::<
2822            fidl_fuchsia_posix_socket::BaseSocketGetMarkRequest,
2823            fidl_fuchsia_posix_socket::BaseSocketGetMarkResult,
2824        >(
2825            (domain,),
2826            0x57a2752c61d93d47,
2827            fidl::encoding::DynamicFlags::empty(),
2828            _decode,
2829        )
2830    }
2831
2832    type GetCookieResponseFut = fidl::client::QueryResponseFut<
2833        fidl_fuchsia_posix_socket::BaseSocketGetCookieResult,
2834        fidl::encoding::DefaultFuchsiaResourceDialect,
2835    >;
2836    fn r#get_cookie(&self) -> Self::GetCookieResponseFut {
2837        fn _decode(
2838            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2839        ) -> Result<fidl_fuchsia_posix_socket::BaseSocketGetCookieResult, fidl::Error> {
2840            let _response = fidl::client::decode_transaction_body::<
2841                fidl::encoding::ResultType<
2842                    fidl_fuchsia_posix_socket::BaseSocketGetCookieResponse,
2843                    fidl_fuchsia_posix::Errno,
2844                >,
2845                fidl::encoding::DefaultFuchsiaResourceDialect,
2846                0x2c2f47fd8f924e52,
2847            >(_buf?)?;
2848            Ok(_response.map(|x| x.value))
2849        }
2850        self.client.send_query_and_decode::<
2851            fidl::encoding::EmptyPayload,
2852            fidl_fuchsia_posix_socket::BaseSocketGetCookieResult,
2853        >(
2854            (),
2855            0x2c2f47fd8f924e52,
2856            fidl::encoding::DynamicFlags::empty(),
2857            _decode,
2858        )
2859    }
2860
2861    type DescribeResponseFut = fidl::client::QueryResponseFut<
2862        SocketDescribeResponse,
2863        fidl::encoding::DefaultFuchsiaResourceDialect,
2864    >;
2865    fn r#describe(&self) -> Self::DescribeResponseFut {
2866        fn _decode(
2867            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2868        ) -> Result<SocketDescribeResponse, fidl::Error> {
2869            let _response = fidl::client::decode_transaction_body::<
2870                SocketDescribeResponse,
2871                fidl::encoding::DefaultFuchsiaResourceDialect,
2872                0x4fd7c08c9c804484,
2873            >(_buf?)?;
2874            Ok(_response)
2875        }
2876        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SocketDescribeResponse>(
2877            (),
2878            0x4fd7c08c9c804484,
2879            fidl::encoding::DynamicFlags::empty(),
2880            _decode,
2881        )
2882    }
2883
2884    type BindResponseFut = fidl::client::QueryResponseFut<
2885        SocketBindResult,
2886        fidl::encoding::DefaultFuchsiaResourceDialect,
2887    >;
2888    fn r#bind(
2889        &self,
2890        mut protocol: Option<&ProtocolAssociation>,
2891        mut bound_interface_id: &BoundInterfaceId,
2892    ) -> Self::BindResponseFut {
2893        fn _decode(
2894            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2895        ) -> Result<SocketBindResult, fidl::Error> {
2896            let _response = fidl::client::decode_transaction_body::<
2897                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2898                fidl::encoding::DefaultFuchsiaResourceDialect,
2899                0x6caedb2d31b56db8,
2900            >(_buf?)?;
2901            Ok(_response.map(|x| x))
2902        }
2903        self.client.send_query_and_decode::<SocketBindRequest, SocketBindResult>(
2904            (protocol, bound_interface_id),
2905            0x6caedb2d31b56db8,
2906            fidl::encoding::DynamicFlags::empty(),
2907            _decode,
2908        )
2909    }
2910
2911    type GetInfoResponseFut = fidl::client::QueryResponseFut<
2912        SocketGetInfoResult,
2913        fidl::encoding::DefaultFuchsiaResourceDialect,
2914    >;
2915    fn r#get_info(&self) -> Self::GetInfoResponseFut {
2916        fn _decode(
2917            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2918        ) -> Result<SocketGetInfoResult, fidl::Error> {
2919            let _response = fidl::client::decode_transaction_body::<
2920                fidl::encoding::ResultType<SocketGetInfoResponse, fidl_fuchsia_posix::Errno>,
2921                fidl::encoding::DefaultFuchsiaResourceDialect,
2922                0x7f67457e85c3914c,
2923            >(_buf?)?;
2924            Ok(_response.map(|x| (x.kind, x.protocol, x.bound_interface)))
2925        }
2926        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, SocketGetInfoResult>(
2927            (),
2928            0x7f67457e85c3914c,
2929            fidl::encoding::DynamicFlags::empty(),
2930            _decode,
2931        )
2932    }
2933
2934    type RecvMsgResponseFut = fidl::client::QueryResponseFut<
2935        SocketRecvMsgResult,
2936        fidl::encoding::DefaultFuchsiaResourceDialect,
2937    >;
2938    fn r#recv_msg(
2939        &self,
2940        mut want_packet_info: bool,
2941        mut data_len: u32,
2942        mut want_control: bool,
2943        mut flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
2944    ) -> Self::RecvMsgResponseFut {
2945        fn _decode(
2946            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2947        ) -> Result<SocketRecvMsgResult, fidl::Error> {
2948            let _response = fidl::client::decode_transaction_body::<
2949                fidl::encoding::ResultType<SocketRecvMsgResponse, fidl_fuchsia_posix::Errno>,
2950                fidl::encoding::DefaultFuchsiaResourceDialect,
2951                0x52b95ba982826a61,
2952            >(_buf?)?;
2953            Ok(_response.map(|x| (x.packet_info, x.data, x.control, x.truncated)))
2954        }
2955        self.client.send_query_and_decode::<SocketRecvMsgRequest, SocketRecvMsgResult>(
2956            (want_packet_info, data_len, want_control, flags),
2957            0x52b95ba982826a61,
2958            fidl::encoding::DynamicFlags::empty(),
2959            _decode,
2960        )
2961    }
2962
2963    type SendMsgResponseFut = fidl::client::QueryResponseFut<
2964        SocketSendMsgResult,
2965        fidl::encoding::DefaultFuchsiaResourceDialect,
2966    >;
2967    fn r#send_msg(
2968        &self,
2969        mut packet_info: Option<&PacketInfo>,
2970        mut data: &[u8],
2971        mut control: &SendControlData,
2972        mut flags: fidl_fuchsia_posix_socket::SendMsgFlags,
2973    ) -> Self::SendMsgResponseFut {
2974        fn _decode(
2975            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2976        ) -> Result<SocketSendMsgResult, fidl::Error> {
2977            let _response = fidl::client::decode_transaction_body::<
2978                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
2979                fidl::encoding::DefaultFuchsiaResourceDialect,
2980                0x150c9ff91f944922,
2981            >(_buf?)?;
2982            Ok(_response.map(|x| x))
2983        }
2984        self.client.send_query_and_decode::<SocketSendMsgRequest, SocketSendMsgResult>(
2985            (packet_info, data, control, flags),
2986            0x150c9ff91f944922,
2987            fidl::encoding::DynamicFlags::empty(),
2988            _decode,
2989        )
2990    }
2991
2992    type AttachBpfFilterUnsafeResponseFut = fidl::client::QueryResponseFut<
2993        SocketAttachBpfFilterUnsafeResult,
2994        fidl::encoding::DefaultFuchsiaResourceDialect,
2995    >;
2996    fn r#attach_bpf_filter_unsafe(
2997        &self,
2998        mut code: &[u64],
2999    ) -> Self::AttachBpfFilterUnsafeResponseFut {
3000        fn _decode(
3001            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3002        ) -> Result<SocketAttachBpfFilterUnsafeResult, fidl::Error> {
3003            let _response = fidl::client::decode_transaction_body::<
3004                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, fidl_fuchsia_posix::Errno>,
3005                fidl::encoding::DefaultFuchsiaResourceDialect,
3006                0x593998d38670f823,
3007            >(_buf?)?;
3008            Ok(_response.map(|x| x))
3009        }
3010        self.client.send_query_and_decode::<
3011            SocketAttachBpfFilterUnsafeRequest,
3012            SocketAttachBpfFilterUnsafeResult,
3013        >(
3014            (code,),
3015            0x593998d38670f823,
3016            fidl::encoding::DynamicFlags::empty(),
3017            _decode,
3018        )
3019    }
3020}
3021
3022pub struct SocketEventStream {
3023    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3024}
3025
3026impl std::marker::Unpin for SocketEventStream {}
3027
3028impl futures::stream::FusedStream for SocketEventStream {
3029    fn is_terminated(&self) -> bool {
3030        self.event_receiver.is_terminated()
3031    }
3032}
3033
3034impl futures::Stream for SocketEventStream {
3035    type Item = Result<SocketEvent, fidl::Error>;
3036
3037    fn poll_next(
3038        mut self: std::pin::Pin<&mut Self>,
3039        cx: &mut std::task::Context<'_>,
3040    ) -> std::task::Poll<Option<Self::Item>> {
3041        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3042            &mut self.event_receiver,
3043            cx
3044        )?) {
3045            Some(buf) => std::task::Poll::Ready(Some(SocketEvent::decode(buf))),
3046            None => std::task::Poll::Ready(None),
3047        }
3048    }
3049}
3050
3051#[derive(Debug)]
3052pub enum SocketEvent {}
3053
3054impl SocketEvent {
3055    /// Decodes a message buffer as a [`SocketEvent`].
3056    fn decode(
3057        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3058    ) -> Result<SocketEvent, fidl::Error> {
3059        let (bytes, _handles) = buf.split_mut();
3060        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3061        debug_assert_eq!(tx_header.tx_id, 0);
3062        match tx_header.ordinal {
3063            _ => Err(fidl::Error::UnknownOrdinal {
3064                ordinal: tx_header.ordinal,
3065                protocol_name: <SocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3066            }),
3067        }
3068    }
3069}
3070
3071/// A Stream of incoming requests for fuchsia.posix.socket.packet/Socket.
3072pub struct SocketRequestStream {
3073    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3074    is_terminated: bool,
3075}
3076
3077impl std::marker::Unpin for SocketRequestStream {}
3078
3079impl futures::stream::FusedStream for SocketRequestStream {
3080    fn is_terminated(&self) -> bool {
3081        self.is_terminated
3082    }
3083}
3084
3085impl fidl::endpoints::RequestStream for SocketRequestStream {
3086    type Protocol = SocketMarker;
3087    type ControlHandle = SocketControlHandle;
3088
3089    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3090        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3091    }
3092
3093    fn control_handle(&self) -> Self::ControlHandle {
3094        SocketControlHandle { inner: self.inner.clone() }
3095    }
3096
3097    fn into_inner(
3098        self,
3099    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3100    {
3101        (self.inner, self.is_terminated)
3102    }
3103
3104    fn from_inner(
3105        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3106        is_terminated: bool,
3107    ) -> Self {
3108        Self { inner, is_terminated }
3109    }
3110}
3111
3112impl futures::Stream for SocketRequestStream {
3113    type Item = Result<SocketRequest, fidl::Error>;
3114
3115    fn poll_next(
3116        mut self: std::pin::Pin<&mut Self>,
3117        cx: &mut std::task::Context<'_>,
3118    ) -> std::task::Poll<Option<Self::Item>> {
3119        let this = &mut *self;
3120        if this.inner.check_shutdown(cx) {
3121            this.is_terminated = true;
3122            return std::task::Poll::Ready(None);
3123        }
3124        if this.is_terminated {
3125            panic!("polled SocketRequestStream after completion");
3126        }
3127        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3128            |bytes, handles| {
3129                match this.inner.channel().read_etc(cx, bytes, handles) {
3130                    std::task::Poll::Ready(Ok(())) => {}
3131                    std::task::Poll::Pending => return std::task::Poll::Pending,
3132                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3133                        this.is_terminated = true;
3134                        return std::task::Poll::Ready(None);
3135                    }
3136                    std::task::Poll::Ready(Err(e)) => {
3137                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3138                            e.into(),
3139                        ))));
3140                    }
3141                }
3142
3143                // A message has been received from the channel
3144                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3145
3146                std::task::Poll::Ready(Some(match header.ordinal {
3147                    0x20d8a7aba2168a79 => {
3148                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3149                        let mut req = fidl::new_empty!(
3150                            fidl_fuchsia_unknown::CloneableCloneRequest,
3151                            fidl::encoding::DefaultFuchsiaResourceDialect
3152                        );
3153                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_unknown::CloneableCloneRequest>(&header, _body_bytes, handles, &mut req)?;
3154                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3155                        Ok(SocketRequest::Clone { request: req.request, control_handle })
3156                    }
3157                    0x5ac5d459ad7f657e => {
3158                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3159                        let mut req = fidl::new_empty!(
3160                            fidl::encoding::EmptyPayload,
3161                            fidl::encoding::DefaultFuchsiaResourceDialect
3162                        );
3163                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3164                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3165                        Ok(SocketRequest::Close {
3166                            responder: SocketCloseResponder {
3167                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3168                                tx_id: header.tx_id,
3169                            },
3170                        })
3171                    }
3172                    0x2658edee9decfc06 => {
3173                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3174                        let mut req = fidl::new_empty!(
3175                            fidl::encoding::EmptyPayload,
3176                            fidl::encoding::DefaultFuchsiaResourceDialect
3177                        );
3178                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3179                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3180                        Ok(SocketRequest::Query {
3181                            responder: SocketQueryResponder {
3182                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3183                                tx_id: header.tx_id,
3184                            },
3185                        })
3186                    }
3187                    0x1fd74ee8b9a4a876 => {
3188                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3189                        let mut req = fidl::new_empty!(
3190                            fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressRequest,
3191                            fidl::encoding::DefaultFuchsiaResourceDialect
3192                        );
3193                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetReuseAddressRequest>(&header, _body_bytes, handles, &mut req)?;
3194                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3195                        Ok(SocketRequest::SetReuseAddress {
3196                            value: req.value,
3197
3198                            responder: SocketSetReuseAddressResponder {
3199                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3200                                tx_id: header.tx_id,
3201                            },
3202                        })
3203                    }
3204                    0x67b7206b8d1bc0a5 => {
3205                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3206                        let mut req = fidl::new_empty!(
3207                            fidl::encoding::EmptyPayload,
3208                            fidl::encoding::DefaultFuchsiaResourceDialect
3209                        );
3210                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3211                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3212                        Ok(SocketRequest::GetReuseAddress {
3213                            responder: SocketGetReuseAddressResponder {
3214                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3215                                tx_id: header.tx_id,
3216                            },
3217                        })
3218                    }
3219                    0x5aad39b33e5f6ebb => {
3220                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3221                        let mut req = fidl::new_empty!(
3222                            fidl::encoding::EmptyPayload,
3223                            fidl::encoding::DefaultFuchsiaResourceDialect
3224                        );
3225                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3226                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3227                        Ok(SocketRequest::GetError {
3228                            responder: SocketGetErrorResponder {
3229                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3230                                tx_id: header.tx_id,
3231                            },
3232                        })
3233                    }
3234                    0x6023e081ce3cd947 => {
3235                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3236                        let mut req = fidl::new_empty!(
3237                            fidl_fuchsia_posix_socket::BaseSocketSetBroadcastRequest,
3238                            fidl::encoding::DefaultFuchsiaResourceDialect
3239                        );
3240                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetBroadcastRequest>(&header, _body_bytes, handles, &mut req)?;
3241                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3242                        Ok(SocketRequest::SetBroadcast {
3243                            value: req.value,
3244
3245                            responder: SocketSetBroadcastResponder {
3246                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3247                                tx_id: header.tx_id,
3248                            },
3249                        })
3250                    }
3251                    0x68796fc556f9780d => {
3252                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3253                        let mut req = fidl::new_empty!(
3254                            fidl::encoding::EmptyPayload,
3255                            fidl::encoding::DefaultFuchsiaResourceDialect
3256                        );
3257                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3258                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3259                        Ok(SocketRequest::GetBroadcast {
3260                            responder: SocketGetBroadcastResponder {
3261                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3262                                tx_id: header.tx_id,
3263                            },
3264                        })
3265                    }
3266                    0x756eac32d73a7a70 => {
3267                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3268                        let mut req = fidl::new_empty!(
3269                            fidl_fuchsia_posix_socket::BaseSocketSetSendBufferRequest,
3270                            fidl::encoding::DefaultFuchsiaResourceDialect
3271                        );
3272                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetSendBufferRequest>(&header, _body_bytes, handles, &mut req)?;
3273                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3274                        Ok(SocketRequest::SetSendBuffer {
3275                            value_bytes: req.value_bytes,
3276
3277                            responder: SocketSetSendBufferResponder {
3278                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3279                                tx_id: header.tx_id,
3280                            },
3281                        })
3282                    }
3283                    0x78a52fd9c7b2410b => {
3284                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3285                        let mut req = fidl::new_empty!(
3286                            fidl::encoding::EmptyPayload,
3287                            fidl::encoding::DefaultFuchsiaResourceDialect
3288                        );
3289                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3290                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3291                        Ok(SocketRequest::GetSendBuffer {
3292                            responder: SocketGetSendBufferResponder {
3293                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3294                                tx_id: header.tx_id,
3295                            },
3296                        })
3297                    }
3298                    0x6b0cf2f1919c7001 => {
3299                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3300                        let mut req = fidl::new_empty!(
3301                            fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferRequest,
3302                            fidl::encoding::DefaultFuchsiaResourceDialect
3303                        );
3304                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetReceiveBufferRequest>(&header, _body_bytes, handles, &mut req)?;
3305                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3306                        Ok(SocketRequest::SetReceiveBuffer {
3307                            value_bytes: req.value_bytes,
3308
3309                            responder: SocketSetReceiveBufferResponder {
3310                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3311                                tx_id: header.tx_id,
3312                            },
3313                        })
3314                    }
3315                    0x14c1a4b64f709e5c => {
3316                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3317                        let mut req = fidl::new_empty!(
3318                            fidl::encoding::EmptyPayload,
3319                            fidl::encoding::DefaultFuchsiaResourceDialect
3320                        );
3321                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3322                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3323                        Ok(SocketRequest::GetReceiveBuffer {
3324                            responder: SocketGetReceiveBufferResponder {
3325                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3326                                tx_id: header.tx_id,
3327                            },
3328                        })
3329                    }
3330                    0x572df8f0b920d2c7 => {
3331                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3332                        let mut req = fidl::new_empty!(
3333                            fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveRequest,
3334                            fidl::encoding::DefaultFuchsiaResourceDialect
3335                        );
3336                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetKeepAliveRequest>(&header, _body_bytes, handles, &mut req)?;
3337                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3338                        Ok(SocketRequest::SetKeepAlive {
3339                            value: req.value,
3340
3341                            responder: SocketSetKeepAliveResponder {
3342                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3343                                tx_id: header.tx_id,
3344                            },
3345                        })
3346                    }
3347                    0x2dd29d3215f2c9d2 => {
3348                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3349                        let mut req = fidl::new_empty!(
3350                            fidl::encoding::EmptyPayload,
3351                            fidl::encoding::DefaultFuchsiaResourceDialect
3352                        );
3353                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3354                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3355                        Ok(SocketRequest::GetKeepAlive {
3356                            responder: SocketGetKeepAliveResponder {
3357                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3358                                tx_id: header.tx_id,
3359                            },
3360                        })
3361                    }
3362                    0x3ecb49968bee439 => {
3363                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3364                        let mut req = fidl::new_empty!(
3365                            fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineRequest,
3366                            fidl::encoding::DefaultFuchsiaResourceDialect
3367                        );
3368                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetOutOfBandInlineRequest>(&header, _body_bytes, handles, &mut req)?;
3369                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3370                        Ok(SocketRequest::SetOutOfBandInline {
3371                            value: req.value,
3372
3373                            responder: SocketSetOutOfBandInlineResponder {
3374                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3375                                tx_id: header.tx_id,
3376                            },
3377                        })
3378                    }
3379                    0x348c1ab3aeca1745 => {
3380                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3381                        let mut req = fidl::new_empty!(
3382                            fidl::encoding::EmptyPayload,
3383                            fidl::encoding::DefaultFuchsiaResourceDialect
3384                        );
3385                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3386                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3387                        Ok(SocketRequest::GetOutOfBandInline {
3388                            responder: SocketGetOutOfBandInlineResponder {
3389                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3390                                tx_id: header.tx_id,
3391                            },
3392                        })
3393                    }
3394                    0x6bbf00c53a4c78c2 => {
3395                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3396                        let mut req = fidl::new_empty!(
3397                            fidl_fuchsia_posix_socket::BaseSocketSetNoCheckRequest,
3398                            fidl::encoding::DefaultFuchsiaResourceDialect
3399                        );
3400                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetNoCheckRequest>(&header, _body_bytes, handles, &mut req)?;
3401                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3402                        Ok(SocketRequest::SetNoCheck {
3403                            value: req.value,
3404
3405                            responder: SocketSetNoCheckResponder {
3406                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3407                                tx_id: header.tx_id,
3408                            },
3409                        })
3410                    }
3411                    0x2cd4249286417694 => {
3412                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3413                        let mut req = fidl::new_empty!(
3414                            fidl::encoding::EmptyPayload,
3415                            fidl::encoding::DefaultFuchsiaResourceDialect
3416                        );
3417                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3418                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3419                        Ok(SocketRequest::GetNoCheck {
3420                            responder: SocketGetNoCheckResponder {
3421                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3422                                tx_id: header.tx_id,
3423                            },
3424                        })
3425                    }
3426                    0x45386351246e998e => {
3427                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3428                        let mut req = fidl::new_empty!(
3429                            fidl_fuchsia_posix_socket::BaseSocketSetLingerRequest,
3430                            fidl::encoding::DefaultFuchsiaResourceDialect
3431                        );
3432                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetLingerRequest>(&header, _body_bytes, handles, &mut req)?;
3433                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3434                        Ok(SocketRequest::SetLinger {
3435                            linger: req.linger,
3436                            length_secs: req.length_secs,
3437
3438                            responder: SocketSetLingerResponder {
3439                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3440                                tx_id: header.tx_id,
3441                            },
3442                        })
3443                    }
3444                    0x48eb20fc5ccb0e45 => {
3445                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3446                        let mut req = fidl::new_empty!(
3447                            fidl::encoding::EmptyPayload,
3448                            fidl::encoding::DefaultFuchsiaResourceDialect
3449                        );
3450                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3451                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3452                        Ok(SocketRequest::GetLinger {
3453                            responder: SocketGetLingerResponder {
3454                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3455                                tx_id: header.tx_id,
3456                            },
3457                        })
3458                    }
3459                    0x24dd3e5cb36d9ccb => {
3460                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3461                        let mut req = fidl::new_empty!(
3462                            fidl_fuchsia_posix_socket::BaseSocketSetReusePortRequest,
3463                            fidl::encoding::DefaultFuchsiaResourceDialect
3464                        );
3465                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetReusePortRequest>(&header, _body_bytes, handles, &mut req)?;
3466                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3467                        Ok(SocketRequest::SetReusePort {
3468                            value: req.value,
3469
3470                            responder: SocketSetReusePortResponder {
3471                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3472                                tx_id: header.tx_id,
3473                            },
3474                        })
3475                    }
3476                    0x7a112c1ab54ff828 => {
3477                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3478                        let mut req = fidl::new_empty!(
3479                            fidl::encoding::EmptyPayload,
3480                            fidl::encoding::DefaultFuchsiaResourceDialect
3481                        );
3482                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3483                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3484                        Ok(SocketRequest::GetReusePort {
3485                            responder: SocketGetReusePortResponder {
3486                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3487                                tx_id: header.tx_id,
3488                            },
3489                        })
3490                    }
3491                    0x67ce6db6c2ec8966 => {
3492                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3493                        let mut req = fidl::new_empty!(
3494                            fidl::encoding::EmptyPayload,
3495                            fidl::encoding::DefaultFuchsiaResourceDialect
3496                        );
3497                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3498                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3499                        Ok(SocketRequest::GetAcceptConn {
3500                            responder: SocketGetAcceptConnResponder {
3501                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3502                                tx_id: header.tx_id,
3503                            },
3504                        })
3505                    }
3506                    0x2118b483f28aafc4 => {
3507                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3508                        let mut req = fidl::new_empty!(
3509                            fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceRequest,
3510                            fidl::encoding::DefaultFuchsiaResourceDialect
3511                        );
3512                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetBindToDeviceRequest>(&header, _body_bytes, handles, &mut req)?;
3513                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3514                        Ok(SocketRequest::SetBindToDevice {
3515                            value: req.value,
3516
3517                            responder: SocketSetBindToDeviceResponder {
3518                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3519                                tx_id: header.tx_id,
3520                            },
3521                        })
3522                    }
3523                    0x1ab1fbf0ef7906c8 => {
3524                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3525                        let mut req = fidl::new_empty!(
3526                            fidl::encoding::EmptyPayload,
3527                            fidl::encoding::DefaultFuchsiaResourceDialect
3528                        );
3529                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3530                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3531                        Ok(SocketRequest::GetBindToDevice {
3532                            responder: SocketGetBindToDeviceResponder {
3533                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3534                                tx_id: header.tx_id,
3535                            },
3536                        })
3537                    }
3538                    0x6e387a0def00821 => {
3539                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3540                        let mut req = fidl::new_empty!(
3541                            fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexRequest,
3542                            fidl::encoding::DefaultFuchsiaResourceDialect
3543                        );
3544                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetBindToInterfaceIndexRequest>(&header, _body_bytes, handles, &mut req)?;
3545                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3546                        Ok(SocketRequest::SetBindToInterfaceIndex {
3547                            value: req.value,
3548
3549                            responder: SocketSetBindToInterfaceIndexResponder {
3550                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3551                                tx_id: header.tx_id,
3552                            },
3553                        })
3554                    }
3555                    0x59c31dd3e3078295 => {
3556                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3557                        let mut req = fidl::new_empty!(
3558                            fidl::encoding::EmptyPayload,
3559                            fidl::encoding::DefaultFuchsiaResourceDialect
3560                        );
3561                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3562                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3563                        Ok(SocketRequest::GetBindToInterfaceIndex {
3564                            responder: SocketGetBindToInterfaceIndexResponder {
3565                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3566                                tx_id: header.tx_id,
3567                            },
3568                        })
3569                    }
3570                    0x285d6516c263d839 => {
3571                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3572                        let mut req = fidl::new_empty!(
3573                            fidl_fuchsia_posix_socket::BaseSocketSetTimestampRequest,
3574                            fidl::encoding::DefaultFuchsiaResourceDialect
3575                        );
3576                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetTimestampRequest>(&header, _body_bytes, handles, &mut req)?;
3577                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3578                        Ok(SocketRequest::SetTimestamp {
3579                            value: req.value,
3580
3581                            responder: SocketSetTimestampResponder {
3582                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3583                                tx_id: header.tx_id,
3584                            },
3585                        })
3586                    }
3587                    0x49f2fffbbcc2bd27 => {
3588                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3589                        let mut req = fidl::new_empty!(
3590                            fidl::encoding::EmptyPayload,
3591                            fidl::encoding::DefaultFuchsiaResourceDialect
3592                        );
3593                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3594                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3595                        Ok(SocketRequest::GetTimestamp {
3596                            responder: SocketGetTimestampResponder {
3597                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3598                                tx_id: header.tx_id,
3599                            },
3600                        })
3601                    }
3602                    0x6ead6de09f653236 => {
3603                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3604                        let mut req = fidl::new_empty!(
3605                            fidl_fuchsia_posix_socket::BaseSocketSetMarkRequest,
3606                            fidl::encoding::DefaultFuchsiaResourceDialect
3607                        );
3608                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketSetMarkRequest>(&header, _body_bytes, handles, &mut req)?;
3609                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3610                        Ok(SocketRequest::SetMark {
3611                            domain: req.domain,
3612                            mark: req.mark,
3613
3614                            responder: SocketSetMarkResponder {
3615                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3616                                tx_id: header.tx_id,
3617                            },
3618                        })
3619                    }
3620                    0x57a2752c61d93d47 => {
3621                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3622                        let mut req = fidl::new_empty!(
3623                            fidl_fuchsia_posix_socket::BaseSocketGetMarkRequest,
3624                            fidl::encoding::DefaultFuchsiaResourceDialect
3625                        );
3626                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_posix_socket::BaseSocketGetMarkRequest>(&header, _body_bytes, handles, &mut req)?;
3627                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3628                        Ok(SocketRequest::GetMark {
3629                            domain: req.domain,
3630
3631                            responder: SocketGetMarkResponder {
3632                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3633                                tx_id: header.tx_id,
3634                            },
3635                        })
3636                    }
3637                    0x2c2f47fd8f924e52 => {
3638                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3639                        let mut req = fidl::new_empty!(
3640                            fidl::encoding::EmptyPayload,
3641                            fidl::encoding::DefaultFuchsiaResourceDialect
3642                        );
3643                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3644                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3645                        Ok(SocketRequest::GetCookie {
3646                            responder: SocketGetCookieResponder {
3647                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3648                                tx_id: header.tx_id,
3649                            },
3650                        })
3651                    }
3652                    0x4fd7c08c9c804484 => {
3653                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3654                        let mut req = fidl::new_empty!(
3655                            fidl::encoding::EmptyPayload,
3656                            fidl::encoding::DefaultFuchsiaResourceDialect
3657                        );
3658                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3659                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3660                        Ok(SocketRequest::Describe {
3661                            responder: SocketDescribeResponder {
3662                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3663                                tx_id: header.tx_id,
3664                            },
3665                        })
3666                    }
3667                    0x6caedb2d31b56db8 => {
3668                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3669                        let mut req = fidl::new_empty!(
3670                            SocketBindRequest,
3671                            fidl::encoding::DefaultFuchsiaResourceDialect
3672                        );
3673                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SocketBindRequest>(&header, _body_bytes, handles, &mut req)?;
3674                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3675                        Ok(SocketRequest::Bind {
3676                            protocol: req.protocol,
3677                            bound_interface_id: req.bound_interface_id,
3678
3679                            responder: SocketBindResponder {
3680                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3681                                tx_id: header.tx_id,
3682                            },
3683                        })
3684                    }
3685                    0x7f67457e85c3914c => {
3686                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3687                        let mut req = fidl::new_empty!(
3688                            fidl::encoding::EmptyPayload,
3689                            fidl::encoding::DefaultFuchsiaResourceDialect
3690                        );
3691                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3692                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3693                        Ok(SocketRequest::GetInfo {
3694                            responder: SocketGetInfoResponder {
3695                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3696                                tx_id: header.tx_id,
3697                            },
3698                        })
3699                    }
3700                    0x52b95ba982826a61 => {
3701                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3702                        let mut req = fidl::new_empty!(
3703                            SocketRecvMsgRequest,
3704                            fidl::encoding::DefaultFuchsiaResourceDialect
3705                        );
3706                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SocketRecvMsgRequest>(&header, _body_bytes, handles, &mut req)?;
3707                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3708                        Ok(SocketRequest::RecvMsg {
3709                            want_packet_info: req.want_packet_info,
3710                            data_len: req.data_len,
3711                            want_control: req.want_control,
3712                            flags: req.flags,
3713
3714                            responder: SocketRecvMsgResponder {
3715                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3716                                tx_id: header.tx_id,
3717                            },
3718                        })
3719                    }
3720                    0x150c9ff91f944922 => {
3721                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3722                        let mut req = fidl::new_empty!(
3723                            SocketSendMsgRequest,
3724                            fidl::encoding::DefaultFuchsiaResourceDialect
3725                        );
3726                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SocketSendMsgRequest>(&header, _body_bytes, handles, &mut req)?;
3727                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3728                        Ok(SocketRequest::SendMsg {
3729                            packet_info: req.packet_info,
3730                            data: req.data,
3731                            control: req.control,
3732                            flags: req.flags,
3733
3734                            responder: SocketSendMsgResponder {
3735                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3736                                tx_id: header.tx_id,
3737                            },
3738                        })
3739                    }
3740                    0x593998d38670f823 => {
3741                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3742                        let mut req = fidl::new_empty!(
3743                            SocketAttachBpfFilterUnsafeRequest,
3744                            fidl::encoding::DefaultFuchsiaResourceDialect
3745                        );
3746                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SocketAttachBpfFilterUnsafeRequest>(&header, _body_bytes, handles, &mut req)?;
3747                        let control_handle = SocketControlHandle { inner: this.inner.clone() };
3748                        Ok(SocketRequest::AttachBpfFilterUnsafe {
3749                            code: req.code,
3750
3751                            responder: SocketAttachBpfFilterUnsafeResponder {
3752                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3753                                tx_id: header.tx_id,
3754                            },
3755                        })
3756                    }
3757                    _ => Err(fidl::Error::UnknownOrdinal {
3758                        ordinal: header.ordinal,
3759                        protocol_name:
3760                            <SocketMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3761                    }),
3762                }))
3763            },
3764        )
3765    }
3766}
3767
3768/// A packet socket.
3769///
3770/// This interface is essentially POSIX.
3771///
3772/// All methods on this type are nonblocking; their exact behaviors match their
3773/// Linux counterparts.
3774///
3775/// *Warning:* This protocol is not yet ready for direct use by clients.
3776/// Instead, clients should use the BSD sockets API to interact with sockets.
3777/// We plan to change this protocol substantially and clients that couple
3778/// directly to this protocol will make those changes more difficult.
3779#[derive(Debug)]
3780pub enum SocketRequest {
3781    Clone {
3782        request: fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
3783        control_handle: SocketControlHandle,
3784    },
3785    /// Terminates the connection.
3786    ///
3787    /// After calling `Close`, the client must not send any other requests.
3788    ///
3789    /// Servers, after sending the status response, should close the connection
3790    /// regardless of status and without sending an epitaph.
3791    ///
3792    /// Closing the client end of the channel should be semantically equivalent
3793    /// to calling `Close` without knowing when the close has completed or its
3794    /// status.
3795    Close {
3796        responder: SocketCloseResponder,
3797    },
3798    Query {
3799        responder: SocketQueryResponder,
3800    },
3801    /// Set `SOL_SOCKET` -> `SO_REUSEADDR`.
3802    SetReuseAddress {
3803        value: bool,
3804        responder: SocketSetReuseAddressResponder,
3805    },
3806    /// Get `SOL_SOCKET` -> `SO_REUSEADDR`.
3807    GetReuseAddress {
3808        responder: SocketGetReuseAddressResponder,
3809    },
3810    /// Get `SOL_SOCKET` -> `SO_ERROR`.
3811    /// Returns the last error if there is an error set on the socket.
3812    GetError {
3813        responder: SocketGetErrorResponder,
3814    },
3815    /// Set `SOL_SOCKET` -> `SO_BROADCAST`.
3816    SetBroadcast {
3817        value: bool,
3818        responder: SocketSetBroadcastResponder,
3819    },
3820    /// Get `SOL_SOCKET` -> `SO_BROADCAST`.
3821    GetBroadcast {
3822        responder: SocketGetBroadcastResponder,
3823    },
3824    /// Set `SOL_SOCKET` -> `SO_SNDBUF`.
3825    SetSendBuffer {
3826        value_bytes: u64,
3827        responder: SocketSetSendBufferResponder,
3828    },
3829    /// Get `SOL_SOCKET` -> `SO_SNDBUF`.
3830    GetSendBuffer {
3831        responder: SocketGetSendBufferResponder,
3832    },
3833    /// Set `SOL_SOCKET` -> `SO_RCVBUF`.
3834    SetReceiveBuffer {
3835        value_bytes: u64,
3836        responder: SocketSetReceiveBufferResponder,
3837    },
3838    /// Get `SOL_SOCKET` -> `SO_RCVBUF`.
3839    GetReceiveBuffer {
3840        responder: SocketGetReceiveBufferResponder,
3841    },
3842    /// Set `SOL_SOCKET` -> `SO_KEEPALIVE`.
3843    SetKeepAlive {
3844        value: bool,
3845        responder: SocketSetKeepAliveResponder,
3846    },
3847    /// Get `SOL_SOCKET` -> `SO_KEEPALIVE`.
3848    GetKeepAlive {
3849        responder: SocketGetKeepAliveResponder,
3850    },
3851    /// Set `SOL_SOCKET` -> `SO_OOBINLINE`.
3852    SetOutOfBandInline {
3853        value: bool,
3854        responder: SocketSetOutOfBandInlineResponder,
3855    },
3856    /// Get `SOL_SOCKET` -> `SO_OOBINLINE`.
3857    GetOutOfBandInline {
3858        responder: SocketGetOutOfBandInlineResponder,
3859    },
3860    /// Set `SOL_SOCKET` -> `SO_NO_CHECK`.
3861    SetNoCheck {
3862        value: bool,
3863        responder: SocketSetNoCheckResponder,
3864    },
3865    /// Get `SOL_SOCKET` -> `SO_NO_CHECK`.
3866    GetNoCheck {
3867        responder: SocketGetNoCheckResponder,
3868    },
3869    /// Set `SOL_SOCKET` -> `SO_LINGER`.
3870    SetLinger {
3871        linger: bool,
3872        length_secs: u32,
3873        responder: SocketSetLingerResponder,
3874    },
3875    /// Get `SOL_SOCKET` -> `SO_LINGER`.
3876    GetLinger {
3877        responder: SocketGetLingerResponder,
3878    },
3879    /// Set `SOL_SOCKET` -> `SO_REUSEPORT`.
3880    SetReusePort {
3881        value: bool,
3882        responder: SocketSetReusePortResponder,
3883    },
3884    /// Get `SOL_SOCKET` -> `SO_REUSEPORT`.
3885    GetReusePort {
3886        responder: SocketGetReusePortResponder,
3887    },
3888    /// Get `SOL_SOCKET` -> `SO_ACCEPTCONN`.
3889    GetAcceptConn {
3890        responder: SocketGetAcceptConnResponder,
3891    },
3892    /// Set `SOL_SOCKET` -> `SO_BINDTODEVICE`.
3893    SetBindToDevice {
3894        value: String,
3895        responder: SocketSetBindToDeviceResponder,
3896    },
3897    /// Get `SOL_SOCKET` -> `SO_BINDTODEVICE`.
3898    GetBindToDevice {
3899        responder: SocketGetBindToDeviceResponder,
3900    },
3901    /// Set `SOL_SOCKET` -> `SO_BINDTOIFINDEX`.
3902    /// If `value` is 0, this clears the bound interface.
3903    SetBindToInterfaceIndex {
3904        value: u64,
3905        responder: SocketSetBindToInterfaceIndexResponder,
3906    },
3907    /// Get `SOL_SOCKET` -> `SO_BINDTOIFINDEX`.
3908    GetBindToInterfaceIndex {
3909        responder: SocketGetBindToInterfaceIndexResponder,
3910    },
3911    /// Set `SOL_SOCKET` -> `SO_TIMESTAMP` or `SO_TIMESTAMPNS`.
3912    SetTimestamp {
3913        value: fidl_fuchsia_posix_socket::TimestampOption,
3914        responder: SocketSetTimestampResponder,
3915    },
3916    /// Get `SOL_SOCKET` -> `SO_TIMESTAMP` or `SO_TIMESTAMPNS`.
3917    GetTimestamp {
3918        responder: SocketGetTimestampResponder,
3919    },
3920    /// Like setting `SOL_SOCKET` -> `SO_MARK`. The major difference is that
3921    /// unlike the standard SO_MARK, this API has multiple mark domains and each
3922    /// mark can be set independently in each domain.
3923    SetMark {
3924        domain: fidl_fuchsia_net::MarkDomain,
3925        mark: fidl_fuchsia_posix_socket::OptionalUint32,
3926        responder: SocketSetMarkResponder,
3927    },
3928    /// Like getting `SOL_SOCKET` -> `SO_MARK`. The major difference is that
3929    /// unlike the standard SO_MARK, this API has multiple mark domains and each
3930    /// mark can be retrieved independently in each domain.
3931    GetMark {
3932        domain: fidl_fuchsia_net::MarkDomain,
3933        responder: SocketGetMarkResponder,
3934    },
3935    /// Get `SOL_SOCKET` -> `SO_COOKIE`.
3936    GetCookie {
3937        responder: SocketGetCookieResponder,
3938    },
3939    Describe {
3940        responder: SocketDescribeResponder,
3941    },
3942    /// Bind the socket to a protocol and/or interface.
3943    ///
3944    /// + request `protocol` the socket's new protocol association.
3945    /// + request `bound_interface_id` the socket's new interface binding.
3946    Bind {
3947        protocol: Option<Box<ProtocolAssociation>>,
3948        bound_interface_id: BoundInterfaceId,
3949        responder: SocketBindResponder,
3950    },
3951    /// Returns the the socket's properties.
3952    ///
3953    /// - response `kind` the socket's `Kind`.
3954    /// - response `protocol` the socket's protocol association, if associated.
3955    /// - response `bound_interface` properties of the socket's interface
3956    ///   binding.
3957    GetInfo {
3958        responder: SocketGetInfoResponder,
3959    },
3960    /// Receives a message from the socket.
3961    ///
3962    /// + request `want_packet_info` request information about the packet to be
3963    ///   returned.
3964    /// + request `data_len` the maximum allowed length of the response data
3965    ///   buffer.
3966    /// + request `want_control` request ancillary data to be returned.
3967    /// + request `flags` flags for the receive request.
3968    /// - response `packet_info` information about the packet, if requested.
3969    /// - response `data` the message.
3970    /// - response `control` control messages, if requested.
3971    /// - response `truncated` indicates whether or not the returned message
3972    ///   was truncated.
3973    RecvMsg {
3974        want_packet_info: bool,
3975        data_len: u32,
3976        want_control: bool,
3977        flags: fidl_fuchsia_posix_socket::RecvMsgFlags,
3978        responder: SocketRecvMsgResponder,
3979    },
3980    /// Sends a message on the socket.
3981    ///
3982    /// + request `packet_info` information about the packet.
3983    /// + request `data` the message.
3984    /// + request `control` ancillary data.
3985    /// + request `flags` flags for the send request.
3986    SendMsg {
3987        packet_info: Option<Box<PacketInfo>>,
3988        data: Vec<u8>,
3989        control: SendControlData,
3990        flags: fidl_fuchsia_posix_socket::SendMsgFlags,
3991        responder: SocketSendMsgResponder,
3992    },
3993    /// Attaches the specified eBPF filter. The filter is assumed to be verified with 2 arguments
3994    ///  1. Pointer to the packet of size 0, i.e. not accessed directly (only using cBPF packet
3995    ///     load instructions).
3996    ///  2. Packet size (BPF_LOAD).
3997    /// Helper functions and maps are not supported.
3998    AttachBpfFilterUnsafe {
3999        code: Vec<u64>,
4000        responder: SocketAttachBpfFilterUnsafeResponder,
4001    },
4002}
4003
4004impl SocketRequest {
4005    #[allow(irrefutable_let_patterns)]
4006    pub fn into_clone(
4007        self,
4008    ) -> Option<(
4009        fidl::endpoints::ServerEnd<fidl_fuchsia_unknown::CloneableMarker>,
4010        SocketControlHandle,
4011    )> {
4012        if let SocketRequest::Clone { request, control_handle } = self {
4013            Some((request, control_handle))
4014        } else {
4015            None
4016        }
4017    }
4018
4019    #[allow(irrefutable_let_patterns)]
4020    pub fn into_close(self) -> Option<(SocketCloseResponder)> {
4021        if let SocketRequest::Close { responder } = self { Some((responder)) } else { None }
4022    }
4023
4024    #[allow(irrefutable_let_patterns)]
4025    pub fn into_query(self) -> Option<(SocketQueryResponder)> {
4026        if let SocketRequest::Query { responder } = self { Some((responder)) } else { None }
4027    }
4028
4029    #[allow(irrefutable_let_patterns)]
4030    pub fn into_set_reuse_address(self) -> Option<(bool, SocketSetReuseAddressResponder)> {
4031        if let SocketRequest::SetReuseAddress { value, responder } = self {
4032            Some((value, responder))
4033        } else {
4034            None
4035        }
4036    }
4037
4038    #[allow(irrefutable_let_patterns)]
4039    pub fn into_get_reuse_address(self) -> Option<(SocketGetReuseAddressResponder)> {
4040        if let SocketRequest::GetReuseAddress { responder } = self {
4041            Some((responder))
4042        } else {
4043            None
4044        }
4045    }
4046
4047    #[allow(irrefutable_let_patterns)]
4048    pub fn into_get_error(self) -> Option<(SocketGetErrorResponder)> {
4049        if let SocketRequest::GetError { responder } = self { Some((responder)) } else { None }
4050    }
4051
4052    #[allow(irrefutable_let_patterns)]
4053    pub fn into_set_broadcast(self) -> Option<(bool, SocketSetBroadcastResponder)> {
4054        if let SocketRequest::SetBroadcast { value, responder } = self {
4055            Some((value, responder))
4056        } else {
4057            None
4058        }
4059    }
4060
4061    #[allow(irrefutable_let_patterns)]
4062    pub fn into_get_broadcast(self) -> Option<(SocketGetBroadcastResponder)> {
4063        if let SocketRequest::GetBroadcast { responder } = self { Some((responder)) } else { None }
4064    }
4065
4066    #[allow(irrefutable_let_patterns)]
4067    pub fn into_set_send_buffer(self) -> Option<(u64, SocketSetSendBufferResponder)> {
4068        if let SocketRequest::SetSendBuffer { value_bytes, responder } = self {
4069            Some((value_bytes, responder))
4070        } else {
4071            None
4072        }
4073    }
4074
4075    #[allow(irrefutable_let_patterns)]
4076    pub fn into_get_send_buffer(self) -> Option<(SocketGetSendBufferResponder)> {
4077        if let SocketRequest::GetSendBuffer { responder } = self { Some((responder)) } else { None }
4078    }
4079
4080    #[allow(irrefutable_let_patterns)]
4081    pub fn into_set_receive_buffer(self) -> Option<(u64, SocketSetReceiveBufferResponder)> {
4082        if let SocketRequest::SetReceiveBuffer { value_bytes, responder } = self {
4083            Some((value_bytes, responder))
4084        } else {
4085            None
4086        }
4087    }
4088
4089    #[allow(irrefutable_let_patterns)]
4090    pub fn into_get_receive_buffer(self) -> Option<(SocketGetReceiveBufferResponder)> {
4091        if let SocketRequest::GetReceiveBuffer { responder } = self {
4092            Some((responder))
4093        } else {
4094            None
4095        }
4096    }
4097
4098    #[allow(irrefutable_let_patterns)]
4099    pub fn into_set_keep_alive(self) -> Option<(bool, SocketSetKeepAliveResponder)> {
4100        if let SocketRequest::SetKeepAlive { value, responder } = self {
4101            Some((value, responder))
4102        } else {
4103            None
4104        }
4105    }
4106
4107    #[allow(irrefutable_let_patterns)]
4108    pub fn into_get_keep_alive(self) -> Option<(SocketGetKeepAliveResponder)> {
4109        if let SocketRequest::GetKeepAlive { responder } = self { Some((responder)) } else { None }
4110    }
4111
4112    #[allow(irrefutable_let_patterns)]
4113    pub fn into_set_out_of_band_inline(self) -> Option<(bool, SocketSetOutOfBandInlineResponder)> {
4114        if let SocketRequest::SetOutOfBandInline { value, responder } = self {
4115            Some((value, responder))
4116        } else {
4117            None
4118        }
4119    }
4120
4121    #[allow(irrefutable_let_patterns)]
4122    pub fn into_get_out_of_band_inline(self) -> Option<(SocketGetOutOfBandInlineResponder)> {
4123        if let SocketRequest::GetOutOfBandInline { responder } = self {
4124            Some((responder))
4125        } else {
4126            None
4127        }
4128    }
4129
4130    #[allow(irrefutable_let_patterns)]
4131    pub fn into_set_no_check(self) -> Option<(bool, SocketSetNoCheckResponder)> {
4132        if let SocketRequest::SetNoCheck { value, responder } = self {
4133            Some((value, responder))
4134        } else {
4135            None
4136        }
4137    }
4138
4139    #[allow(irrefutable_let_patterns)]
4140    pub fn into_get_no_check(self) -> Option<(SocketGetNoCheckResponder)> {
4141        if let SocketRequest::GetNoCheck { responder } = self { Some((responder)) } else { None }
4142    }
4143
4144    #[allow(irrefutable_let_patterns)]
4145    pub fn into_set_linger(self) -> Option<(bool, u32, SocketSetLingerResponder)> {
4146        if let SocketRequest::SetLinger { linger, length_secs, responder } = self {
4147            Some((linger, length_secs, responder))
4148        } else {
4149            None
4150        }
4151    }
4152
4153    #[allow(irrefutable_let_patterns)]
4154    pub fn into_get_linger(self) -> Option<(SocketGetLingerResponder)> {
4155        if let SocketRequest::GetLinger { responder } = self { Some((responder)) } else { None }
4156    }
4157
4158    #[allow(irrefutable_let_patterns)]
4159    pub fn into_set_reuse_port(self) -> Option<(bool, SocketSetReusePortResponder)> {
4160        if let SocketRequest::SetReusePort { value, responder } = self {
4161            Some((value, responder))
4162        } else {
4163            None
4164        }
4165    }
4166
4167    #[allow(irrefutable_let_patterns)]
4168    pub fn into_get_reuse_port(self) -> Option<(SocketGetReusePortResponder)> {
4169        if let SocketRequest::GetReusePort { responder } = self { Some((responder)) } else { None }
4170    }
4171
4172    #[allow(irrefutable_let_patterns)]
4173    pub fn into_get_accept_conn(self) -> Option<(SocketGetAcceptConnResponder)> {
4174        if let SocketRequest::GetAcceptConn { responder } = self { Some((responder)) } else { None }
4175    }
4176
4177    #[allow(irrefutable_let_patterns)]
4178    pub fn into_set_bind_to_device(self) -> Option<(String, SocketSetBindToDeviceResponder)> {
4179        if let SocketRequest::SetBindToDevice { value, responder } = self {
4180            Some((value, responder))
4181        } else {
4182            None
4183        }
4184    }
4185
4186    #[allow(irrefutable_let_patterns)]
4187    pub fn into_get_bind_to_device(self) -> Option<(SocketGetBindToDeviceResponder)> {
4188        if let SocketRequest::GetBindToDevice { responder } = self {
4189            Some((responder))
4190        } else {
4191            None
4192        }
4193    }
4194
4195    #[allow(irrefutable_let_patterns)]
4196    pub fn into_set_bind_to_interface_index(
4197        self,
4198    ) -> Option<(u64, SocketSetBindToInterfaceIndexResponder)> {
4199        if let SocketRequest::SetBindToInterfaceIndex { value, responder } = self {
4200            Some((value, responder))
4201        } else {
4202            None
4203        }
4204    }
4205
4206    #[allow(irrefutable_let_patterns)]
4207    pub fn into_get_bind_to_interface_index(
4208        self,
4209    ) -> Option<(SocketGetBindToInterfaceIndexResponder)> {
4210        if let SocketRequest::GetBindToInterfaceIndex { responder } = self {
4211            Some((responder))
4212        } else {
4213            None
4214        }
4215    }
4216
4217    #[allow(irrefutable_let_patterns)]
4218    pub fn into_set_timestamp(
4219        self,
4220    ) -> Option<(fidl_fuchsia_posix_socket::TimestampOption, SocketSetTimestampResponder)> {
4221        if let SocketRequest::SetTimestamp { value, responder } = self {
4222            Some((value, responder))
4223        } else {
4224            None
4225        }
4226    }
4227
4228    #[allow(irrefutable_let_patterns)]
4229    pub fn into_get_timestamp(self) -> Option<(SocketGetTimestampResponder)> {
4230        if let SocketRequest::GetTimestamp { responder } = self { Some((responder)) } else { None }
4231    }
4232
4233    #[allow(irrefutable_let_patterns)]
4234    pub fn into_set_mark(
4235        self,
4236    ) -> Option<(
4237        fidl_fuchsia_net::MarkDomain,
4238        fidl_fuchsia_posix_socket::OptionalUint32,
4239        SocketSetMarkResponder,
4240    )> {
4241        if let SocketRequest::SetMark { domain, mark, responder } = self {
4242            Some((domain, mark, responder))
4243        } else {
4244            None
4245        }
4246    }
4247
4248    #[allow(irrefutable_let_patterns)]
4249    pub fn into_get_mark(self) -> Option<(fidl_fuchsia_net::MarkDomain, SocketGetMarkResponder)> {
4250        if let SocketRequest::GetMark { domain, responder } = self {
4251            Some((domain, responder))
4252        } else {
4253            None
4254        }
4255    }
4256
4257    #[allow(irrefutable_let_patterns)]
4258    pub fn into_get_cookie(self) -> Option<(SocketGetCookieResponder)> {
4259        if let SocketRequest::GetCookie { responder } = self { Some((responder)) } else { None }
4260    }
4261
4262    #[allow(irrefutable_let_patterns)]
4263    pub fn into_describe(self) -> Option<(SocketDescribeResponder)> {
4264        if let SocketRequest::Describe { responder } = self { Some((responder)) } else { None }
4265    }
4266
4267    #[allow(irrefutable_let_patterns)]
4268    pub fn into_bind(
4269        self,
4270    ) -> Option<(Option<Box<ProtocolAssociation>>, BoundInterfaceId, SocketBindResponder)> {
4271        if let SocketRequest::Bind { protocol, bound_interface_id, responder } = self {
4272            Some((protocol, bound_interface_id, responder))
4273        } else {
4274            None
4275        }
4276    }
4277
4278    #[allow(irrefutable_let_patterns)]
4279    pub fn into_get_info(self) -> Option<(SocketGetInfoResponder)> {
4280        if let SocketRequest::GetInfo { responder } = self { Some((responder)) } else { None }
4281    }
4282
4283    #[allow(irrefutable_let_patterns)]
4284    pub fn into_recv_msg(
4285        self,
4286    ) -> Option<(bool, u32, bool, fidl_fuchsia_posix_socket::RecvMsgFlags, SocketRecvMsgResponder)>
4287    {
4288        if let SocketRequest::RecvMsg {
4289            want_packet_info,
4290            data_len,
4291            want_control,
4292            flags,
4293            responder,
4294        } = self
4295        {
4296            Some((want_packet_info, data_len, want_control, flags, responder))
4297        } else {
4298            None
4299        }
4300    }
4301
4302    #[allow(irrefutable_let_patterns)]
4303    pub fn into_send_msg(
4304        self,
4305    ) -> Option<(
4306        Option<Box<PacketInfo>>,
4307        Vec<u8>,
4308        SendControlData,
4309        fidl_fuchsia_posix_socket::SendMsgFlags,
4310        SocketSendMsgResponder,
4311    )> {
4312        if let SocketRequest::SendMsg { packet_info, data, control, flags, responder } = self {
4313            Some((packet_info, data, control, flags, responder))
4314        } else {
4315            None
4316        }
4317    }
4318
4319    #[allow(irrefutable_let_patterns)]
4320    pub fn into_attach_bpf_filter_unsafe(
4321        self,
4322    ) -> Option<(Vec<u64>, SocketAttachBpfFilterUnsafeResponder)> {
4323        if let SocketRequest::AttachBpfFilterUnsafe { code, responder } = self {
4324            Some((code, responder))
4325        } else {
4326            None
4327        }
4328    }
4329
4330    /// Name of the method defined in FIDL
4331    pub fn method_name(&self) -> &'static str {
4332        match *self {
4333            SocketRequest::Clone { .. } => "clone",
4334            SocketRequest::Close { .. } => "close",
4335            SocketRequest::Query { .. } => "query",
4336            SocketRequest::SetReuseAddress { .. } => "set_reuse_address",
4337            SocketRequest::GetReuseAddress { .. } => "get_reuse_address",
4338            SocketRequest::GetError { .. } => "get_error",
4339            SocketRequest::SetBroadcast { .. } => "set_broadcast",
4340            SocketRequest::GetBroadcast { .. } => "get_broadcast",
4341            SocketRequest::SetSendBuffer { .. } => "set_send_buffer",
4342            SocketRequest::GetSendBuffer { .. } => "get_send_buffer",
4343            SocketRequest::SetReceiveBuffer { .. } => "set_receive_buffer",
4344            SocketRequest::GetReceiveBuffer { .. } => "get_receive_buffer",
4345            SocketRequest::SetKeepAlive { .. } => "set_keep_alive",
4346            SocketRequest::GetKeepAlive { .. } => "get_keep_alive",
4347            SocketRequest::SetOutOfBandInline { .. } => "set_out_of_band_inline",
4348            SocketRequest::GetOutOfBandInline { .. } => "get_out_of_band_inline",
4349            SocketRequest::SetNoCheck { .. } => "set_no_check",
4350            SocketRequest::GetNoCheck { .. } => "get_no_check",
4351            SocketRequest::SetLinger { .. } => "set_linger",
4352            SocketRequest::GetLinger { .. } => "get_linger",
4353            SocketRequest::SetReusePort { .. } => "set_reuse_port",
4354            SocketRequest::GetReusePort { .. } => "get_reuse_port",
4355            SocketRequest::GetAcceptConn { .. } => "get_accept_conn",
4356            SocketRequest::SetBindToDevice { .. } => "set_bind_to_device",
4357            SocketRequest::GetBindToDevice { .. } => "get_bind_to_device",
4358            SocketRequest::SetBindToInterfaceIndex { .. } => "set_bind_to_interface_index",
4359            SocketRequest::GetBindToInterfaceIndex { .. } => "get_bind_to_interface_index",
4360            SocketRequest::SetTimestamp { .. } => "set_timestamp",
4361            SocketRequest::GetTimestamp { .. } => "get_timestamp",
4362            SocketRequest::SetMark { .. } => "set_mark",
4363            SocketRequest::GetMark { .. } => "get_mark",
4364            SocketRequest::GetCookie { .. } => "get_cookie",
4365            SocketRequest::Describe { .. } => "describe",
4366            SocketRequest::Bind { .. } => "bind",
4367            SocketRequest::GetInfo { .. } => "get_info",
4368            SocketRequest::RecvMsg { .. } => "recv_msg",
4369            SocketRequest::SendMsg { .. } => "send_msg",
4370            SocketRequest::AttachBpfFilterUnsafe { .. } => "attach_bpf_filter_unsafe",
4371        }
4372    }
4373}
4374
4375#[derive(Debug, Clone)]
4376pub struct SocketControlHandle {
4377    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4378}
4379
4380impl fidl::endpoints::ControlHandle for SocketControlHandle {
4381    fn shutdown(&self) {
4382        self.inner.shutdown()
4383    }
4384    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4385        self.inner.shutdown_with_epitaph(status)
4386    }
4387
4388    fn is_closed(&self) -> bool {
4389        self.inner.channel().is_closed()
4390    }
4391    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4392        self.inner.channel().on_closed()
4393    }
4394
4395    #[cfg(target_os = "fuchsia")]
4396    fn signal_peer(
4397        &self,
4398        clear_mask: zx::Signals,
4399        set_mask: zx::Signals,
4400    ) -> Result<(), zx_status::Status> {
4401        use fidl::Peered;
4402        self.inner.channel().signal_peer(clear_mask, set_mask)
4403    }
4404}
4405
4406impl SocketControlHandle {}
4407
4408#[must_use = "FIDL methods require a response to be sent"]
4409#[derive(Debug)]
4410pub struct SocketCloseResponder {
4411    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
4412    tx_id: u32,
4413}
4414
4415/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
4416/// if the responder is dropped without sending a response, so that the client
4417/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4418impl std::ops::Drop for SocketCloseResponder {
4419    fn drop(&mut self) {
4420        self.control_handle.shutdown();
4421        // Safety: drops once, never accessed again
4422        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4423    }
4424}
4425
4426impl fidl::endpoints::Responder for SocketCloseResponder {
4427    type ControlHandle = SocketControlHandle;
4428
4429    fn control_handle(&self) -> &SocketControlHandle {
4430        &self.control_handle
4431    }
4432
4433    fn drop_without_shutdown(mut self) {
4434        // Safety: drops once, never accessed again due to mem::forget
4435        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4436        // Prevent Drop from running (which would shut down the channel)
4437        std::mem::forget(self);
4438    }
4439}
4440
4441impl SocketCloseResponder {
4442    /// Sends a response to the FIDL transaction.
4443    ///
4444    /// Sets the channel to shutdown if an error occurs.
4445    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4446        let _result = self.send_raw(result);
4447        if _result.is_err() {
4448            self.control_handle.shutdown();
4449        }
4450        self.drop_without_shutdown();
4451        _result
4452    }
4453
4454    /// Similar to "send" but does not shutdown the channel if an error occurs.
4455    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4456        let _result = self.send_raw(result);
4457        self.drop_without_shutdown();
4458        _result
4459    }
4460
4461    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4462        self.control_handle
4463            .inner
4464            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4465                result,
4466                self.tx_id,
4467                0x5ac5d459ad7f657e,
4468                fidl::encoding::DynamicFlags::empty(),
4469            )
4470    }
4471}
4472
4473#[must_use = "FIDL methods require a response to be sent"]
4474#[derive(Debug)]
4475pub struct SocketQueryResponder {
4476    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
4477    tx_id: u32,
4478}
4479
4480/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
4481/// if the responder is dropped without sending a response, so that the client
4482/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4483impl std::ops::Drop for SocketQueryResponder {
4484    fn drop(&mut self) {
4485        self.control_handle.shutdown();
4486        // Safety: drops once, never accessed again
4487        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4488    }
4489}
4490
4491impl fidl::endpoints::Responder for SocketQueryResponder {
4492    type ControlHandle = SocketControlHandle;
4493
4494    fn control_handle(&self) -> &SocketControlHandle {
4495        &self.control_handle
4496    }
4497
4498    fn drop_without_shutdown(mut self) {
4499        // Safety: drops once, never accessed again due to mem::forget
4500        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4501        // Prevent Drop from running (which would shut down the channel)
4502        std::mem::forget(self);
4503    }
4504}
4505
4506impl SocketQueryResponder {
4507    /// Sends a response to the FIDL transaction.
4508    ///
4509    /// Sets the channel to shutdown if an error occurs.
4510    pub fn send(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4511        let _result = self.send_raw(protocol);
4512        if _result.is_err() {
4513            self.control_handle.shutdown();
4514        }
4515        self.drop_without_shutdown();
4516        _result
4517    }
4518
4519    /// Similar to "send" but does not shutdown the channel if an error occurs.
4520    pub fn send_no_shutdown_on_err(self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4521        let _result = self.send_raw(protocol);
4522        self.drop_without_shutdown();
4523        _result
4524    }
4525
4526    fn send_raw(&self, mut protocol: &[u8]) -> Result<(), fidl::Error> {
4527        self.control_handle.inner.send::<fidl_fuchsia_unknown::QueryableQueryResponse>(
4528            (protocol,),
4529            self.tx_id,
4530            0x2658edee9decfc06,
4531            fidl::encoding::DynamicFlags::empty(),
4532        )
4533    }
4534}
4535
4536#[must_use = "FIDL methods require a response to be sent"]
4537#[derive(Debug)]
4538pub struct SocketSetReuseAddressResponder {
4539    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
4540    tx_id: u32,
4541}
4542
4543/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
4544/// if the responder is dropped without sending a response, so that the client
4545/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4546impl std::ops::Drop for SocketSetReuseAddressResponder {
4547    fn drop(&mut self) {
4548        self.control_handle.shutdown();
4549        // Safety: drops once, never accessed again
4550        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4551    }
4552}
4553
4554impl fidl::endpoints::Responder for SocketSetReuseAddressResponder {
4555    type ControlHandle = SocketControlHandle;
4556
4557    fn control_handle(&self) -> &SocketControlHandle {
4558        &self.control_handle
4559    }
4560
4561    fn drop_without_shutdown(mut self) {
4562        // Safety: drops once, never accessed again due to mem::forget
4563        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4564        // Prevent Drop from running (which would shut down the channel)
4565        std::mem::forget(self);
4566    }
4567}
4568
4569impl SocketSetReuseAddressResponder {
4570    /// Sends a response to the FIDL transaction.
4571    ///
4572    /// Sets the channel to shutdown if an error occurs.
4573    pub fn send(
4574        self,
4575        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4576    ) -> Result<(), fidl::Error> {
4577        let _result = self.send_raw(result);
4578        if _result.is_err() {
4579            self.control_handle.shutdown();
4580        }
4581        self.drop_without_shutdown();
4582        _result
4583    }
4584
4585    /// Similar to "send" but does not shutdown the channel if an error occurs.
4586    pub fn send_no_shutdown_on_err(
4587        self,
4588        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4589    ) -> Result<(), fidl::Error> {
4590        let _result = self.send_raw(result);
4591        self.drop_without_shutdown();
4592        _result
4593    }
4594
4595    fn send_raw(
4596        &self,
4597        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4598    ) -> Result<(), fidl::Error> {
4599        self.control_handle.inner.send::<fidl::encoding::ResultType<
4600            fidl::encoding::EmptyStruct,
4601            fidl_fuchsia_posix::Errno,
4602        >>(
4603            result,
4604            self.tx_id,
4605            0x1fd74ee8b9a4a876,
4606            fidl::encoding::DynamicFlags::empty(),
4607        )
4608    }
4609}
4610
4611#[must_use = "FIDL methods require a response to be sent"]
4612#[derive(Debug)]
4613pub struct SocketGetReuseAddressResponder {
4614    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
4615    tx_id: u32,
4616}
4617
4618/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
4619/// if the responder is dropped without sending a response, so that the client
4620/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4621impl std::ops::Drop for SocketGetReuseAddressResponder {
4622    fn drop(&mut self) {
4623        self.control_handle.shutdown();
4624        // Safety: drops once, never accessed again
4625        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4626    }
4627}
4628
4629impl fidl::endpoints::Responder for SocketGetReuseAddressResponder {
4630    type ControlHandle = SocketControlHandle;
4631
4632    fn control_handle(&self) -> &SocketControlHandle {
4633        &self.control_handle
4634    }
4635
4636    fn drop_without_shutdown(mut self) {
4637        // Safety: drops once, never accessed again due to mem::forget
4638        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4639        // Prevent Drop from running (which would shut down the channel)
4640        std::mem::forget(self);
4641    }
4642}
4643
4644impl SocketGetReuseAddressResponder {
4645    /// Sends a response to the FIDL transaction.
4646    ///
4647    /// Sets the channel to shutdown if an error occurs.
4648    pub fn send(
4649        self,
4650        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
4651    ) -> Result<(), fidl::Error> {
4652        let _result = self.send_raw(result);
4653        if _result.is_err() {
4654            self.control_handle.shutdown();
4655        }
4656        self.drop_without_shutdown();
4657        _result
4658    }
4659
4660    /// Similar to "send" but does not shutdown the channel if an error occurs.
4661    pub fn send_no_shutdown_on_err(
4662        self,
4663        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
4664    ) -> Result<(), fidl::Error> {
4665        let _result = self.send_raw(result);
4666        self.drop_without_shutdown();
4667        _result
4668    }
4669
4670    fn send_raw(
4671        &self,
4672        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
4673    ) -> Result<(), fidl::Error> {
4674        self.control_handle.inner.send::<fidl::encoding::ResultType<
4675            fidl_fuchsia_posix_socket::BaseSocketGetReuseAddressResponse,
4676            fidl_fuchsia_posix::Errno,
4677        >>(
4678            result.map(|value| (value,)),
4679            self.tx_id,
4680            0x67b7206b8d1bc0a5,
4681            fidl::encoding::DynamicFlags::empty(),
4682        )
4683    }
4684}
4685
4686#[must_use = "FIDL methods require a response to be sent"]
4687#[derive(Debug)]
4688pub struct SocketGetErrorResponder {
4689    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
4690    tx_id: u32,
4691}
4692
4693/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
4694/// if the responder is dropped without sending a response, so that the client
4695/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4696impl std::ops::Drop for SocketGetErrorResponder {
4697    fn drop(&mut self) {
4698        self.control_handle.shutdown();
4699        // Safety: drops once, never accessed again
4700        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4701    }
4702}
4703
4704impl fidl::endpoints::Responder for SocketGetErrorResponder {
4705    type ControlHandle = SocketControlHandle;
4706
4707    fn control_handle(&self) -> &SocketControlHandle {
4708        &self.control_handle
4709    }
4710
4711    fn drop_without_shutdown(mut self) {
4712        // Safety: drops once, never accessed again due to mem::forget
4713        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4714        // Prevent Drop from running (which would shut down the channel)
4715        std::mem::forget(self);
4716    }
4717}
4718
4719impl SocketGetErrorResponder {
4720    /// Sends a response to the FIDL transaction.
4721    ///
4722    /// Sets the channel to shutdown if an error occurs.
4723    pub fn send(
4724        self,
4725        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4726    ) -> Result<(), fidl::Error> {
4727        let _result = self.send_raw(result);
4728        if _result.is_err() {
4729            self.control_handle.shutdown();
4730        }
4731        self.drop_without_shutdown();
4732        _result
4733    }
4734
4735    /// Similar to "send" but does not shutdown the channel if an error occurs.
4736    pub fn send_no_shutdown_on_err(
4737        self,
4738        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4739    ) -> Result<(), fidl::Error> {
4740        let _result = self.send_raw(result);
4741        self.drop_without_shutdown();
4742        _result
4743    }
4744
4745    fn send_raw(
4746        &self,
4747        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4748    ) -> Result<(), fidl::Error> {
4749        self.control_handle.inner.send::<fidl::encoding::ResultType<
4750            fidl::encoding::EmptyStruct,
4751            fidl_fuchsia_posix::Errno,
4752        >>(
4753            result,
4754            self.tx_id,
4755            0x5aad39b33e5f6ebb,
4756            fidl::encoding::DynamicFlags::empty(),
4757        )
4758    }
4759}
4760
4761#[must_use = "FIDL methods require a response to be sent"]
4762#[derive(Debug)]
4763pub struct SocketSetBroadcastResponder {
4764    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
4765    tx_id: u32,
4766}
4767
4768/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
4769/// if the responder is dropped without sending a response, so that the client
4770/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4771impl std::ops::Drop for SocketSetBroadcastResponder {
4772    fn drop(&mut self) {
4773        self.control_handle.shutdown();
4774        // Safety: drops once, never accessed again
4775        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4776    }
4777}
4778
4779impl fidl::endpoints::Responder for SocketSetBroadcastResponder {
4780    type ControlHandle = SocketControlHandle;
4781
4782    fn control_handle(&self) -> &SocketControlHandle {
4783        &self.control_handle
4784    }
4785
4786    fn drop_without_shutdown(mut self) {
4787        // Safety: drops once, never accessed again due to mem::forget
4788        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4789        // Prevent Drop from running (which would shut down the channel)
4790        std::mem::forget(self);
4791    }
4792}
4793
4794impl SocketSetBroadcastResponder {
4795    /// Sends a response to the FIDL transaction.
4796    ///
4797    /// Sets the channel to shutdown if an error occurs.
4798    pub fn send(
4799        self,
4800        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4801    ) -> Result<(), fidl::Error> {
4802        let _result = self.send_raw(result);
4803        if _result.is_err() {
4804            self.control_handle.shutdown();
4805        }
4806        self.drop_without_shutdown();
4807        _result
4808    }
4809
4810    /// Similar to "send" but does not shutdown the channel if an error occurs.
4811    pub fn send_no_shutdown_on_err(
4812        self,
4813        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4814    ) -> Result<(), fidl::Error> {
4815        let _result = self.send_raw(result);
4816        self.drop_without_shutdown();
4817        _result
4818    }
4819
4820    fn send_raw(
4821        &self,
4822        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4823    ) -> Result<(), fidl::Error> {
4824        self.control_handle.inner.send::<fidl::encoding::ResultType<
4825            fidl::encoding::EmptyStruct,
4826            fidl_fuchsia_posix::Errno,
4827        >>(
4828            result,
4829            self.tx_id,
4830            0x6023e081ce3cd947,
4831            fidl::encoding::DynamicFlags::empty(),
4832        )
4833    }
4834}
4835
4836#[must_use = "FIDL methods require a response to be sent"]
4837#[derive(Debug)]
4838pub struct SocketGetBroadcastResponder {
4839    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
4840    tx_id: u32,
4841}
4842
4843/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
4844/// if the responder is dropped without sending a response, so that the client
4845/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4846impl std::ops::Drop for SocketGetBroadcastResponder {
4847    fn drop(&mut self) {
4848        self.control_handle.shutdown();
4849        // Safety: drops once, never accessed again
4850        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4851    }
4852}
4853
4854impl fidl::endpoints::Responder for SocketGetBroadcastResponder {
4855    type ControlHandle = SocketControlHandle;
4856
4857    fn control_handle(&self) -> &SocketControlHandle {
4858        &self.control_handle
4859    }
4860
4861    fn drop_without_shutdown(mut self) {
4862        // Safety: drops once, never accessed again due to mem::forget
4863        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4864        // Prevent Drop from running (which would shut down the channel)
4865        std::mem::forget(self);
4866    }
4867}
4868
4869impl SocketGetBroadcastResponder {
4870    /// Sends a response to the FIDL transaction.
4871    ///
4872    /// Sets the channel to shutdown if an error occurs.
4873    pub fn send(
4874        self,
4875        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
4876    ) -> Result<(), fidl::Error> {
4877        let _result = self.send_raw(result);
4878        if _result.is_err() {
4879            self.control_handle.shutdown();
4880        }
4881        self.drop_without_shutdown();
4882        _result
4883    }
4884
4885    /// Similar to "send" but does not shutdown the channel if an error occurs.
4886    pub fn send_no_shutdown_on_err(
4887        self,
4888        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
4889    ) -> Result<(), fidl::Error> {
4890        let _result = self.send_raw(result);
4891        self.drop_without_shutdown();
4892        _result
4893    }
4894
4895    fn send_raw(
4896        &self,
4897        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
4898    ) -> Result<(), fidl::Error> {
4899        self.control_handle.inner.send::<fidl::encoding::ResultType<
4900            fidl_fuchsia_posix_socket::BaseSocketGetBroadcastResponse,
4901            fidl_fuchsia_posix::Errno,
4902        >>(
4903            result.map(|value| (value,)),
4904            self.tx_id,
4905            0x68796fc556f9780d,
4906            fidl::encoding::DynamicFlags::empty(),
4907        )
4908    }
4909}
4910
4911#[must_use = "FIDL methods require a response to be sent"]
4912#[derive(Debug)]
4913pub struct SocketSetSendBufferResponder {
4914    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
4915    tx_id: u32,
4916}
4917
4918/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
4919/// if the responder is dropped without sending a response, so that the client
4920/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4921impl std::ops::Drop for SocketSetSendBufferResponder {
4922    fn drop(&mut self) {
4923        self.control_handle.shutdown();
4924        // Safety: drops once, never accessed again
4925        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4926    }
4927}
4928
4929impl fidl::endpoints::Responder for SocketSetSendBufferResponder {
4930    type ControlHandle = SocketControlHandle;
4931
4932    fn control_handle(&self) -> &SocketControlHandle {
4933        &self.control_handle
4934    }
4935
4936    fn drop_without_shutdown(mut self) {
4937        // Safety: drops once, never accessed again due to mem::forget
4938        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4939        // Prevent Drop from running (which would shut down the channel)
4940        std::mem::forget(self);
4941    }
4942}
4943
4944impl SocketSetSendBufferResponder {
4945    /// Sends a response to the FIDL transaction.
4946    ///
4947    /// Sets the channel to shutdown if an error occurs.
4948    pub fn send(
4949        self,
4950        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4951    ) -> Result<(), fidl::Error> {
4952        let _result = self.send_raw(result);
4953        if _result.is_err() {
4954            self.control_handle.shutdown();
4955        }
4956        self.drop_without_shutdown();
4957        _result
4958    }
4959
4960    /// Similar to "send" but does not shutdown the channel if an error occurs.
4961    pub fn send_no_shutdown_on_err(
4962        self,
4963        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4964    ) -> Result<(), fidl::Error> {
4965        let _result = self.send_raw(result);
4966        self.drop_without_shutdown();
4967        _result
4968    }
4969
4970    fn send_raw(
4971        &self,
4972        mut result: Result<(), fidl_fuchsia_posix::Errno>,
4973    ) -> Result<(), fidl::Error> {
4974        self.control_handle.inner.send::<fidl::encoding::ResultType<
4975            fidl::encoding::EmptyStruct,
4976            fidl_fuchsia_posix::Errno,
4977        >>(
4978            result,
4979            self.tx_id,
4980            0x756eac32d73a7a70,
4981            fidl::encoding::DynamicFlags::empty(),
4982        )
4983    }
4984}
4985
4986#[must_use = "FIDL methods require a response to be sent"]
4987#[derive(Debug)]
4988pub struct SocketGetSendBufferResponder {
4989    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
4990    tx_id: u32,
4991}
4992
4993/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
4994/// if the responder is dropped without sending a response, so that the client
4995/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4996impl std::ops::Drop for SocketGetSendBufferResponder {
4997    fn drop(&mut self) {
4998        self.control_handle.shutdown();
4999        // Safety: drops once, never accessed again
5000        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5001    }
5002}
5003
5004impl fidl::endpoints::Responder for SocketGetSendBufferResponder {
5005    type ControlHandle = SocketControlHandle;
5006
5007    fn control_handle(&self) -> &SocketControlHandle {
5008        &self.control_handle
5009    }
5010
5011    fn drop_without_shutdown(mut self) {
5012        // Safety: drops once, never accessed again due to mem::forget
5013        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5014        // Prevent Drop from running (which would shut down the channel)
5015        std::mem::forget(self);
5016    }
5017}
5018
5019impl SocketGetSendBufferResponder {
5020    /// Sends a response to the FIDL transaction.
5021    ///
5022    /// Sets the channel to shutdown if an error occurs.
5023    pub fn send(
5024        self,
5025        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
5026    ) -> Result<(), fidl::Error> {
5027        let _result = self.send_raw(result);
5028        if _result.is_err() {
5029            self.control_handle.shutdown();
5030        }
5031        self.drop_without_shutdown();
5032        _result
5033    }
5034
5035    /// Similar to "send" but does not shutdown the channel if an error occurs.
5036    pub fn send_no_shutdown_on_err(
5037        self,
5038        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
5039    ) -> Result<(), fidl::Error> {
5040        let _result = self.send_raw(result);
5041        self.drop_without_shutdown();
5042        _result
5043    }
5044
5045    fn send_raw(
5046        &self,
5047        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
5048    ) -> Result<(), fidl::Error> {
5049        self.control_handle.inner.send::<fidl::encoding::ResultType<
5050            fidl_fuchsia_posix_socket::BaseSocketGetSendBufferResponse,
5051            fidl_fuchsia_posix::Errno,
5052        >>(
5053            result.map(|value_bytes| (value_bytes,)),
5054            self.tx_id,
5055            0x78a52fd9c7b2410b,
5056            fidl::encoding::DynamicFlags::empty(),
5057        )
5058    }
5059}
5060
5061#[must_use = "FIDL methods require a response to be sent"]
5062#[derive(Debug)]
5063pub struct SocketSetReceiveBufferResponder {
5064    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5065    tx_id: u32,
5066}
5067
5068/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5069/// if the responder is dropped without sending a response, so that the client
5070/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5071impl std::ops::Drop for SocketSetReceiveBufferResponder {
5072    fn drop(&mut self) {
5073        self.control_handle.shutdown();
5074        // Safety: drops once, never accessed again
5075        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5076    }
5077}
5078
5079impl fidl::endpoints::Responder for SocketSetReceiveBufferResponder {
5080    type ControlHandle = SocketControlHandle;
5081
5082    fn control_handle(&self) -> &SocketControlHandle {
5083        &self.control_handle
5084    }
5085
5086    fn drop_without_shutdown(mut self) {
5087        // Safety: drops once, never accessed again due to mem::forget
5088        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5089        // Prevent Drop from running (which would shut down the channel)
5090        std::mem::forget(self);
5091    }
5092}
5093
5094impl SocketSetReceiveBufferResponder {
5095    /// Sends a response to the FIDL transaction.
5096    ///
5097    /// Sets the channel to shutdown if an error occurs.
5098    pub fn send(
5099        self,
5100        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5101    ) -> Result<(), fidl::Error> {
5102        let _result = self.send_raw(result);
5103        if _result.is_err() {
5104            self.control_handle.shutdown();
5105        }
5106        self.drop_without_shutdown();
5107        _result
5108    }
5109
5110    /// Similar to "send" but does not shutdown the channel if an error occurs.
5111    pub fn send_no_shutdown_on_err(
5112        self,
5113        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5114    ) -> Result<(), fidl::Error> {
5115        let _result = self.send_raw(result);
5116        self.drop_without_shutdown();
5117        _result
5118    }
5119
5120    fn send_raw(
5121        &self,
5122        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5123    ) -> Result<(), fidl::Error> {
5124        self.control_handle.inner.send::<fidl::encoding::ResultType<
5125            fidl::encoding::EmptyStruct,
5126            fidl_fuchsia_posix::Errno,
5127        >>(
5128            result,
5129            self.tx_id,
5130            0x6b0cf2f1919c7001,
5131            fidl::encoding::DynamicFlags::empty(),
5132        )
5133    }
5134}
5135
5136#[must_use = "FIDL methods require a response to be sent"]
5137#[derive(Debug)]
5138pub struct SocketGetReceiveBufferResponder {
5139    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5140    tx_id: u32,
5141}
5142
5143/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5144/// if the responder is dropped without sending a response, so that the client
5145/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5146impl std::ops::Drop for SocketGetReceiveBufferResponder {
5147    fn drop(&mut self) {
5148        self.control_handle.shutdown();
5149        // Safety: drops once, never accessed again
5150        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5151    }
5152}
5153
5154impl fidl::endpoints::Responder for SocketGetReceiveBufferResponder {
5155    type ControlHandle = SocketControlHandle;
5156
5157    fn control_handle(&self) -> &SocketControlHandle {
5158        &self.control_handle
5159    }
5160
5161    fn drop_without_shutdown(mut self) {
5162        // Safety: drops once, never accessed again due to mem::forget
5163        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5164        // Prevent Drop from running (which would shut down the channel)
5165        std::mem::forget(self);
5166    }
5167}
5168
5169impl SocketGetReceiveBufferResponder {
5170    /// Sends a response to the FIDL transaction.
5171    ///
5172    /// Sets the channel to shutdown if an error occurs.
5173    pub fn send(
5174        self,
5175        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
5176    ) -> Result<(), fidl::Error> {
5177        let _result = self.send_raw(result);
5178        if _result.is_err() {
5179            self.control_handle.shutdown();
5180        }
5181        self.drop_without_shutdown();
5182        _result
5183    }
5184
5185    /// Similar to "send" but does not shutdown the channel if an error occurs.
5186    pub fn send_no_shutdown_on_err(
5187        self,
5188        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
5189    ) -> Result<(), fidl::Error> {
5190        let _result = self.send_raw(result);
5191        self.drop_without_shutdown();
5192        _result
5193    }
5194
5195    fn send_raw(
5196        &self,
5197        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
5198    ) -> Result<(), fidl::Error> {
5199        self.control_handle.inner.send::<fidl::encoding::ResultType<
5200            fidl_fuchsia_posix_socket::BaseSocketGetReceiveBufferResponse,
5201            fidl_fuchsia_posix::Errno,
5202        >>(
5203            result.map(|value_bytes| (value_bytes,)),
5204            self.tx_id,
5205            0x14c1a4b64f709e5c,
5206            fidl::encoding::DynamicFlags::empty(),
5207        )
5208    }
5209}
5210
5211#[must_use = "FIDL methods require a response to be sent"]
5212#[derive(Debug)]
5213pub struct SocketSetKeepAliveResponder {
5214    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5215    tx_id: u32,
5216}
5217
5218/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5219/// if the responder is dropped without sending a response, so that the client
5220/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5221impl std::ops::Drop for SocketSetKeepAliveResponder {
5222    fn drop(&mut self) {
5223        self.control_handle.shutdown();
5224        // Safety: drops once, never accessed again
5225        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5226    }
5227}
5228
5229impl fidl::endpoints::Responder for SocketSetKeepAliveResponder {
5230    type ControlHandle = SocketControlHandle;
5231
5232    fn control_handle(&self) -> &SocketControlHandle {
5233        &self.control_handle
5234    }
5235
5236    fn drop_without_shutdown(mut self) {
5237        // Safety: drops once, never accessed again due to mem::forget
5238        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5239        // Prevent Drop from running (which would shut down the channel)
5240        std::mem::forget(self);
5241    }
5242}
5243
5244impl SocketSetKeepAliveResponder {
5245    /// Sends a response to the FIDL transaction.
5246    ///
5247    /// Sets the channel to shutdown if an error occurs.
5248    pub fn send(
5249        self,
5250        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5251    ) -> Result<(), fidl::Error> {
5252        let _result = self.send_raw(result);
5253        if _result.is_err() {
5254            self.control_handle.shutdown();
5255        }
5256        self.drop_without_shutdown();
5257        _result
5258    }
5259
5260    /// Similar to "send" but does not shutdown the channel if an error occurs.
5261    pub fn send_no_shutdown_on_err(
5262        self,
5263        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5264    ) -> Result<(), fidl::Error> {
5265        let _result = self.send_raw(result);
5266        self.drop_without_shutdown();
5267        _result
5268    }
5269
5270    fn send_raw(
5271        &self,
5272        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5273    ) -> Result<(), fidl::Error> {
5274        self.control_handle.inner.send::<fidl::encoding::ResultType<
5275            fidl::encoding::EmptyStruct,
5276            fidl_fuchsia_posix::Errno,
5277        >>(
5278            result,
5279            self.tx_id,
5280            0x572df8f0b920d2c7,
5281            fidl::encoding::DynamicFlags::empty(),
5282        )
5283    }
5284}
5285
5286#[must_use = "FIDL methods require a response to be sent"]
5287#[derive(Debug)]
5288pub struct SocketGetKeepAliveResponder {
5289    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5290    tx_id: u32,
5291}
5292
5293/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5294/// if the responder is dropped without sending a response, so that the client
5295/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5296impl std::ops::Drop for SocketGetKeepAliveResponder {
5297    fn drop(&mut self) {
5298        self.control_handle.shutdown();
5299        // Safety: drops once, never accessed again
5300        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5301    }
5302}
5303
5304impl fidl::endpoints::Responder for SocketGetKeepAliveResponder {
5305    type ControlHandle = SocketControlHandle;
5306
5307    fn control_handle(&self) -> &SocketControlHandle {
5308        &self.control_handle
5309    }
5310
5311    fn drop_without_shutdown(mut self) {
5312        // Safety: drops once, never accessed again due to mem::forget
5313        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5314        // Prevent Drop from running (which would shut down the channel)
5315        std::mem::forget(self);
5316    }
5317}
5318
5319impl SocketGetKeepAliveResponder {
5320    /// Sends a response to the FIDL transaction.
5321    ///
5322    /// Sets the channel to shutdown if an error occurs.
5323    pub fn send(
5324        self,
5325        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5326    ) -> Result<(), fidl::Error> {
5327        let _result = self.send_raw(result);
5328        if _result.is_err() {
5329            self.control_handle.shutdown();
5330        }
5331        self.drop_without_shutdown();
5332        _result
5333    }
5334
5335    /// Similar to "send" but does not shutdown the channel if an error occurs.
5336    pub fn send_no_shutdown_on_err(
5337        self,
5338        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5339    ) -> Result<(), fidl::Error> {
5340        let _result = self.send_raw(result);
5341        self.drop_without_shutdown();
5342        _result
5343    }
5344
5345    fn send_raw(
5346        &self,
5347        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5348    ) -> Result<(), fidl::Error> {
5349        self.control_handle.inner.send::<fidl::encoding::ResultType<
5350            fidl_fuchsia_posix_socket::BaseSocketGetKeepAliveResponse,
5351            fidl_fuchsia_posix::Errno,
5352        >>(
5353            result.map(|value| (value,)),
5354            self.tx_id,
5355            0x2dd29d3215f2c9d2,
5356            fidl::encoding::DynamicFlags::empty(),
5357        )
5358    }
5359}
5360
5361#[must_use = "FIDL methods require a response to be sent"]
5362#[derive(Debug)]
5363pub struct SocketSetOutOfBandInlineResponder {
5364    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5365    tx_id: u32,
5366}
5367
5368/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5369/// if the responder is dropped without sending a response, so that the client
5370/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5371impl std::ops::Drop for SocketSetOutOfBandInlineResponder {
5372    fn drop(&mut self) {
5373        self.control_handle.shutdown();
5374        // Safety: drops once, never accessed again
5375        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5376    }
5377}
5378
5379impl fidl::endpoints::Responder for SocketSetOutOfBandInlineResponder {
5380    type ControlHandle = SocketControlHandle;
5381
5382    fn control_handle(&self) -> &SocketControlHandle {
5383        &self.control_handle
5384    }
5385
5386    fn drop_without_shutdown(mut self) {
5387        // Safety: drops once, never accessed again due to mem::forget
5388        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5389        // Prevent Drop from running (which would shut down the channel)
5390        std::mem::forget(self);
5391    }
5392}
5393
5394impl SocketSetOutOfBandInlineResponder {
5395    /// Sends a response to the FIDL transaction.
5396    ///
5397    /// Sets the channel to shutdown if an error occurs.
5398    pub fn send(
5399        self,
5400        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5401    ) -> Result<(), fidl::Error> {
5402        let _result = self.send_raw(result);
5403        if _result.is_err() {
5404            self.control_handle.shutdown();
5405        }
5406        self.drop_without_shutdown();
5407        _result
5408    }
5409
5410    /// Similar to "send" but does not shutdown the channel if an error occurs.
5411    pub fn send_no_shutdown_on_err(
5412        self,
5413        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5414    ) -> Result<(), fidl::Error> {
5415        let _result = self.send_raw(result);
5416        self.drop_without_shutdown();
5417        _result
5418    }
5419
5420    fn send_raw(
5421        &self,
5422        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5423    ) -> Result<(), fidl::Error> {
5424        self.control_handle.inner.send::<fidl::encoding::ResultType<
5425            fidl::encoding::EmptyStruct,
5426            fidl_fuchsia_posix::Errno,
5427        >>(
5428            result,
5429            self.tx_id,
5430            0x3ecb49968bee439,
5431            fidl::encoding::DynamicFlags::empty(),
5432        )
5433    }
5434}
5435
5436#[must_use = "FIDL methods require a response to be sent"]
5437#[derive(Debug)]
5438pub struct SocketGetOutOfBandInlineResponder {
5439    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5440    tx_id: u32,
5441}
5442
5443/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5444/// if the responder is dropped without sending a response, so that the client
5445/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5446impl std::ops::Drop for SocketGetOutOfBandInlineResponder {
5447    fn drop(&mut self) {
5448        self.control_handle.shutdown();
5449        // Safety: drops once, never accessed again
5450        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5451    }
5452}
5453
5454impl fidl::endpoints::Responder for SocketGetOutOfBandInlineResponder {
5455    type ControlHandle = SocketControlHandle;
5456
5457    fn control_handle(&self) -> &SocketControlHandle {
5458        &self.control_handle
5459    }
5460
5461    fn drop_without_shutdown(mut self) {
5462        // Safety: drops once, never accessed again due to mem::forget
5463        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5464        // Prevent Drop from running (which would shut down the channel)
5465        std::mem::forget(self);
5466    }
5467}
5468
5469impl SocketGetOutOfBandInlineResponder {
5470    /// Sends a response to the FIDL transaction.
5471    ///
5472    /// Sets the channel to shutdown if an error occurs.
5473    pub fn send(
5474        self,
5475        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5476    ) -> Result<(), fidl::Error> {
5477        let _result = self.send_raw(result);
5478        if _result.is_err() {
5479            self.control_handle.shutdown();
5480        }
5481        self.drop_without_shutdown();
5482        _result
5483    }
5484
5485    /// Similar to "send" but does not shutdown the channel if an error occurs.
5486    pub fn send_no_shutdown_on_err(
5487        self,
5488        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5489    ) -> Result<(), fidl::Error> {
5490        let _result = self.send_raw(result);
5491        self.drop_without_shutdown();
5492        _result
5493    }
5494
5495    fn send_raw(
5496        &self,
5497        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5498    ) -> Result<(), fidl::Error> {
5499        self.control_handle.inner.send::<fidl::encoding::ResultType<
5500            fidl_fuchsia_posix_socket::BaseSocketGetOutOfBandInlineResponse,
5501            fidl_fuchsia_posix::Errno,
5502        >>(
5503            result.map(|value| (value,)),
5504            self.tx_id,
5505            0x348c1ab3aeca1745,
5506            fidl::encoding::DynamicFlags::empty(),
5507        )
5508    }
5509}
5510
5511#[must_use = "FIDL methods require a response to be sent"]
5512#[derive(Debug)]
5513pub struct SocketSetNoCheckResponder {
5514    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5515    tx_id: u32,
5516}
5517
5518/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5519/// if the responder is dropped without sending a response, so that the client
5520/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5521impl std::ops::Drop for SocketSetNoCheckResponder {
5522    fn drop(&mut self) {
5523        self.control_handle.shutdown();
5524        // Safety: drops once, never accessed again
5525        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5526    }
5527}
5528
5529impl fidl::endpoints::Responder for SocketSetNoCheckResponder {
5530    type ControlHandle = SocketControlHandle;
5531
5532    fn control_handle(&self) -> &SocketControlHandle {
5533        &self.control_handle
5534    }
5535
5536    fn drop_without_shutdown(mut self) {
5537        // Safety: drops once, never accessed again due to mem::forget
5538        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5539        // Prevent Drop from running (which would shut down the channel)
5540        std::mem::forget(self);
5541    }
5542}
5543
5544impl SocketSetNoCheckResponder {
5545    /// Sends a response to the FIDL transaction.
5546    ///
5547    /// Sets the channel to shutdown if an error occurs.
5548    pub fn send(
5549        self,
5550        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5551    ) -> Result<(), fidl::Error> {
5552        let _result = self.send_raw(result);
5553        if _result.is_err() {
5554            self.control_handle.shutdown();
5555        }
5556        self.drop_without_shutdown();
5557        _result
5558    }
5559
5560    /// Similar to "send" but does not shutdown the channel if an error occurs.
5561    pub fn send_no_shutdown_on_err(
5562        self,
5563        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5564    ) -> Result<(), fidl::Error> {
5565        let _result = self.send_raw(result);
5566        self.drop_without_shutdown();
5567        _result
5568    }
5569
5570    fn send_raw(
5571        &self,
5572        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5573    ) -> Result<(), fidl::Error> {
5574        self.control_handle.inner.send::<fidl::encoding::ResultType<
5575            fidl::encoding::EmptyStruct,
5576            fidl_fuchsia_posix::Errno,
5577        >>(
5578            result,
5579            self.tx_id,
5580            0x6bbf00c53a4c78c2,
5581            fidl::encoding::DynamicFlags::empty(),
5582        )
5583    }
5584}
5585
5586#[must_use = "FIDL methods require a response to be sent"]
5587#[derive(Debug)]
5588pub struct SocketGetNoCheckResponder {
5589    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5590    tx_id: u32,
5591}
5592
5593/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5594/// if the responder is dropped without sending a response, so that the client
5595/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5596impl std::ops::Drop for SocketGetNoCheckResponder {
5597    fn drop(&mut self) {
5598        self.control_handle.shutdown();
5599        // Safety: drops once, never accessed again
5600        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5601    }
5602}
5603
5604impl fidl::endpoints::Responder for SocketGetNoCheckResponder {
5605    type ControlHandle = SocketControlHandle;
5606
5607    fn control_handle(&self) -> &SocketControlHandle {
5608        &self.control_handle
5609    }
5610
5611    fn drop_without_shutdown(mut self) {
5612        // Safety: drops once, never accessed again due to mem::forget
5613        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5614        // Prevent Drop from running (which would shut down the channel)
5615        std::mem::forget(self);
5616    }
5617}
5618
5619impl SocketGetNoCheckResponder {
5620    /// Sends a response to the FIDL transaction.
5621    ///
5622    /// Sets the channel to shutdown if an error occurs.
5623    pub fn send(
5624        self,
5625        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5626    ) -> Result<(), fidl::Error> {
5627        let _result = self.send_raw(result);
5628        if _result.is_err() {
5629            self.control_handle.shutdown();
5630        }
5631        self.drop_without_shutdown();
5632        _result
5633    }
5634
5635    /// Similar to "send" but does not shutdown the channel if an error occurs.
5636    pub fn send_no_shutdown_on_err(
5637        self,
5638        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5639    ) -> Result<(), fidl::Error> {
5640        let _result = self.send_raw(result);
5641        self.drop_without_shutdown();
5642        _result
5643    }
5644
5645    fn send_raw(
5646        &self,
5647        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5648    ) -> Result<(), fidl::Error> {
5649        self.control_handle.inner.send::<fidl::encoding::ResultType<
5650            fidl_fuchsia_posix_socket::BaseSocketGetNoCheckResponse,
5651            fidl_fuchsia_posix::Errno,
5652        >>(
5653            result.map(|value| (value,)),
5654            self.tx_id,
5655            0x2cd4249286417694,
5656            fidl::encoding::DynamicFlags::empty(),
5657        )
5658    }
5659}
5660
5661#[must_use = "FIDL methods require a response to be sent"]
5662#[derive(Debug)]
5663pub struct SocketSetLingerResponder {
5664    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5665    tx_id: u32,
5666}
5667
5668/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5669/// if the responder is dropped without sending a response, so that the client
5670/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5671impl std::ops::Drop for SocketSetLingerResponder {
5672    fn drop(&mut self) {
5673        self.control_handle.shutdown();
5674        // Safety: drops once, never accessed again
5675        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5676    }
5677}
5678
5679impl fidl::endpoints::Responder for SocketSetLingerResponder {
5680    type ControlHandle = SocketControlHandle;
5681
5682    fn control_handle(&self) -> &SocketControlHandle {
5683        &self.control_handle
5684    }
5685
5686    fn drop_without_shutdown(mut self) {
5687        // Safety: drops once, never accessed again due to mem::forget
5688        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5689        // Prevent Drop from running (which would shut down the channel)
5690        std::mem::forget(self);
5691    }
5692}
5693
5694impl SocketSetLingerResponder {
5695    /// Sends a response to the FIDL transaction.
5696    ///
5697    /// Sets the channel to shutdown if an error occurs.
5698    pub fn send(
5699        self,
5700        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5701    ) -> Result<(), fidl::Error> {
5702        let _result = self.send_raw(result);
5703        if _result.is_err() {
5704            self.control_handle.shutdown();
5705        }
5706        self.drop_without_shutdown();
5707        _result
5708    }
5709
5710    /// Similar to "send" but does not shutdown the channel if an error occurs.
5711    pub fn send_no_shutdown_on_err(
5712        self,
5713        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5714    ) -> Result<(), fidl::Error> {
5715        let _result = self.send_raw(result);
5716        self.drop_without_shutdown();
5717        _result
5718    }
5719
5720    fn send_raw(
5721        &self,
5722        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5723    ) -> Result<(), fidl::Error> {
5724        self.control_handle.inner.send::<fidl::encoding::ResultType<
5725            fidl::encoding::EmptyStruct,
5726            fidl_fuchsia_posix::Errno,
5727        >>(
5728            result,
5729            self.tx_id,
5730            0x45386351246e998e,
5731            fidl::encoding::DynamicFlags::empty(),
5732        )
5733    }
5734}
5735
5736#[must_use = "FIDL methods require a response to be sent"]
5737#[derive(Debug)]
5738pub struct SocketGetLingerResponder {
5739    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5740    tx_id: u32,
5741}
5742
5743/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5744/// if the responder is dropped without sending a response, so that the client
5745/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5746impl std::ops::Drop for SocketGetLingerResponder {
5747    fn drop(&mut self) {
5748        self.control_handle.shutdown();
5749        // Safety: drops once, never accessed again
5750        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5751    }
5752}
5753
5754impl fidl::endpoints::Responder for SocketGetLingerResponder {
5755    type ControlHandle = SocketControlHandle;
5756
5757    fn control_handle(&self) -> &SocketControlHandle {
5758        &self.control_handle
5759    }
5760
5761    fn drop_without_shutdown(mut self) {
5762        // Safety: drops once, never accessed again due to mem::forget
5763        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5764        // Prevent Drop from running (which would shut down the channel)
5765        std::mem::forget(self);
5766    }
5767}
5768
5769impl SocketGetLingerResponder {
5770    /// Sends a response to the FIDL transaction.
5771    ///
5772    /// Sets the channel to shutdown if an error occurs.
5773    pub fn send(
5774        self,
5775        mut result: Result<(bool, u32), fidl_fuchsia_posix::Errno>,
5776    ) -> Result<(), fidl::Error> {
5777        let _result = self.send_raw(result);
5778        if _result.is_err() {
5779            self.control_handle.shutdown();
5780        }
5781        self.drop_without_shutdown();
5782        _result
5783    }
5784
5785    /// Similar to "send" but does not shutdown the channel if an error occurs.
5786    pub fn send_no_shutdown_on_err(
5787        self,
5788        mut result: Result<(bool, u32), fidl_fuchsia_posix::Errno>,
5789    ) -> Result<(), fidl::Error> {
5790        let _result = self.send_raw(result);
5791        self.drop_without_shutdown();
5792        _result
5793    }
5794
5795    fn send_raw(
5796        &self,
5797        mut result: Result<(bool, u32), fidl_fuchsia_posix::Errno>,
5798    ) -> Result<(), fidl::Error> {
5799        self.control_handle.inner.send::<fidl::encoding::ResultType<
5800            fidl_fuchsia_posix_socket::BaseSocketGetLingerResponse,
5801            fidl_fuchsia_posix::Errno,
5802        >>(
5803            result,
5804            self.tx_id,
5805            0x48eb20fc5ccb0e45,
5806            fidl::encoding::DynamicFlags::empty(),
5807        )
5808    }
5809}
5810
5811#[must_use = "FIDL methods require a response to be sent"]
5812#[derive(Debug)]
5813pub struct SocketSetReusePortResponder {
5814    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5815    tx_id: u32,
5816}
5817
5818/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5819/// if the responder is dropped without sending a response, so that the client
5820/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5821impl std::ops::Drop for SocketSetReusePortResponder {
5822    fn drop(&mut self) {
5823        self.control_handle.shutdown();
5824        // Safety: drops once, never accessed again
5825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5826    }
5827}
5828
5829impl fidl::endpoints::Responder for SocketSetReusePortResponder {
5830    type ControlHandle = SocketControlHandle;
5831
5832    fn control_handle(&self) -> &SocketControlHandle {
5833        &self.control_handle
5834    }
5835
5836    fn drop_without_shutdown(mut self) {
5837        // Safety: drops once, never accessed again due to mem::forget
5838        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5839        // Prevent Drop from running (which would shut down the channel)
5840        std::mem::forget(self);
5841    }
5842}
5843
5844impl SocketSetReusePortResponder {
5845    /// Sends a response to the FIDL transaction.
5846    ///
5847    /// Sets the channel to shutdown if an error occurs.
5848    pub fn send(
5849        self,
5850        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5851    ) -> Result<(), fidl::Error> {
5852        let _result = self.send_raw(result);
5853        if _result.is_err() {
5854            self.control_handle.shutdown();
5855        }
5856        self.drop_without_shutdown();
5857        _result
5858    }
5859
5860    /// Similar to "send" but does not shutdown the channel if an error occurs.
5861    pub fn send_no_shutdown_on_err(
5862        self,
5863        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5864    ) -> Result<(), fidl::Error> {
5865        let _result = self.send_raw(result);
5866        self.drop_without_shutdown();
5867        _result
5868    }
5869
5870    fn send_raw(
5871        &self,
5872        mut result: Result<(), fidl_fuchsia_posix::Errno>,
5873    ) -> Result<(), fidl::Error> {
5874        self.control_handle.inner.send::<fidl::encoding::ResultType<
5875            fidl::encoding::EmptyStruct,
5876            fidl_fuchsia_posix::Errno,
5877        >>(
5878            result,
5879            self.tx_id,
5880            0x24dd3e5cb36d9ccb,
5881            fidl::encoding::DynamicFlags::empty(),
5882        )
5883    }
5884}
5885
5886#[must_use = "FIDL methods require a response to be sent"]
5887#[derive(Debug)]
5888pub struct SocketGetReusePortResponder {
5889    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5890    tx_id: u32,
5891}
5892
5893/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5894/// if the responder is dropped without sending a response, so that the client
5895/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5896impl std::ops::Drop for SocketGetReusePortResponder {
5897    fn drop(&mut self) {
5898        self.control_handle.shutdown();
5899        // Safety: drops once, never accessed again
5900        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5901    }
5902}
5903
5904impl fidl::endpoints::Responder for SocketGetReusePortResponder {
5905    type ControlHandle = SocketControlHandle;
5906
5907    fn control_handle(&self) -> &SocketControlHandle {
5908        &self.control_handle
5909    }
5910
5911    fn drop_without_shutdown(mut self) {
5912        // Safety: drops once, never accessed again due to mem::forget
5913        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5914        // Prevent Drop from running (which would shut down the channel)
5915        std::mem::forget(self);
5916    }
5917}
5918
5919impl SocketGetReusePortResponder {
5920    /// Sends a response to the FIDL transaction.
5921    ///
5922    /// Sets the channel to shutdown if an error occurs.
5923    pub fn send(
5924        self,
5925        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5926    ) -> Result<(), fidl::Error> {
5927        let _result = self.send_raw(result);
5928        if _result.is_err() {
5929            self.control_handle.shutdown();
5930        }
5931        self.drop_without_shutdown();
5932        _result
5933    }
5934
5935    /// Similar to "send" but does not shutdown the channel if an error occurs.
5936    pub fn send_no_shutdown_on_err(
5937        self,
5938        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5939    ) -> Result<(), fidl::Error> {
5940        let _result = self.send_raw(result);
5941        self.drop_without_shutdown();
5942        _result
5943    }
5944
5945    fn send_raw(
5946        &self,
5947        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
5948    ) -> Result<(), fidl::Error> {
5949        self.control_handle.inner.send::<fidl::encoding::ResultType<
5950            fidl_fuchsia_posix_socket::BaseSocketGetReusePortResponse,
5951            fidl_fuchsia_posix::Errno,
5952        >>(
5953            result.map(|value| (value,)),
5954            self.tx_id,
5955            0x7a112c1ab54ff828,
5956            fidl::encoding::DynamicFlags::empty(),
5957        )
5958    }
5959}
5960
5961#[must_use = "FIDL methods require a response to be sent"]
5962#[derive(Debug)]
5963pub struct SocketGetAcceptConnResponder {
5964    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
5965    tx_id: u32,
5966}
5967
5968/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
5969/// if the responder is dropped without sending a response, so that the client
5970/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5971impl std::ops::Drop for SocketGetAcceptConnResponder {
5972    fn drop(&mut self) {
5973        self.control_handle.shutdown();
5974        // Safety: drops once, never accessed again
5975        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5976    }
5977}
5978
5979impl fidl::endpoints::Responder for SocketGetAcceptConnResponder {
5980    type ControlHandle = SocketControlHandle;
5981
5982    fn control_handle(&self) -> &SocketControlHandle {
5983        &self.control_handle
5984    }
5985
5986    fn drop_without_shutdown(mut self) {
5987        // Safety: drops once, never accessed again due to mem::forget
5988        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5989        // Prevent Drop from running (which would shut down the channel)
5990        std::mem::forget(self);
5991    }
5992}
5993
5994impl SocketGetAcceptConnResponder {
5995    /// Sends a response to the FIDL transaction.
5996    ///
5997    /// Sets the channel to shutdown if an error occurs.
5998    pub fn send(
5999        self,
6000        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
6001    ) -> Result<(), fidl::Error> {
6002        let _result = self.send_raw(result);
6003        if _result.is_err() {
6004            self.control_handle.shutdown();
6005        }
6006        self.drop_without_shutdown();
6007        _result
6008    }
6009
6010    /// Similar to "send" but does not shutdown the channel if an error occurs.
6011    pub fn send_no_shutdown_on_err(
6012        self,
6013        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
6014    ) -> Result<(), fidl::Error> {
6015        let _result = self.send_raw(result);
6016        self.drop_without_shutdown();
6017        _result
6018    }
6019
6020    fn send_raw(
6021        &self,
6022        mut result: Result<bool, fidl_fuchsia_posix::Errno>,
6023    ) -> Result<(), fidl::Error> {
6024        self.control_handle.inner.send::<fidl::encoding::ResultType<
6025            fidl_fuchsia_posix_socket::BaseSocketGetAcceptConnResponse,
6026            fidl_fuchsia_posix::Errno,
6027        >>(
6028            result.map(|value| (value,)),
6029            self.tx_id,
6030            0x67ce6db6c2ec8966,
6031            fidl::encoding::DynamicFlags::empty(),
6032        )
6033    }
6034}
6035
6036#[must_use = "FIDL methods require a response to be sent"]
6037#[derive(Debug)]
6038pub struct SocketSetBindToDeviceResponder {
6039    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6040    tx_id: u32,
6041}
6042
6043/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6044/// if the responder is dropped without sending a response, so that the client
6045/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6046impl std::ops::Drop for SocketSetBindToDeviceResponder {
6047    fn drop(&mut self) {
6048        self.control_handle.shutdown();
6049        // Safety: drops once, never accessed again
6050        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6051    }
6052}
6053
6054impl fidl::endpoints::Responder for SocketSetBindToDeviceResponder {
6055    type ControlHandle = SocketControlHandle;
6056
6057    fn control_handle(&self) -> &SocketControlHandle {
6058        &self.control_handle
6059    }
6060
6061    fn drop_without_shutdown(mut self) {
6062        // Safety: drops once, never accessed again due to mem::forget
6063        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6064        // Prevent Drop from running (which would shut down the channel)
6065        std::mem::forget(self);
6066    }
6067}
6068
6069impl SocketSetBindToDeviceResponder {
6070    /// Sends a response to the FIDL transaction.
6071    ///
6072    /// Sets the channel to shutdown if an error occurs.
6073    pub fn send(
6074        self,
6075        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6076    ) -> Result<(), fidl::Error> {
6077        let _result = self.send_raw(result);
6078        if _result.is_err() {
6079            self.control_handle.shutdown();
6080        }
6081        self.drop_without_shutdown();
6082        _result
6083    }
6084
6085    /// Similar to "send" but does not shutdown the channel if an error occurs.
6086    pub fn send_no_shutdown_on_err(
6087        self,
6088        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6089    ) -> Result<(), fidl::Error> {
6090        let _result = self.send_raw(result);
6091        self.drop_without_shutdown();
6092        _result
6093    }
6094
6095    fn send_raw(
6096        &self,
6097        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6098    ) -> Result<(), fidl::Error> {
6099        self.control_handle.inner.send::<fidl::encoding::ResultType<
6100            fidl::encoding::EmptyStruct,
6101            fidl_fuchsia_posix::Errno,
6102        >>(
6103            result,
6104            self.tx_id,
6105            0x2118b483f28aafc4,
6106            fidl::encoding::DynamicFlags::empty(),
6107        )
6108    }
6109}
6110
6111#[must_use = "FIDL methods require a response to be sent"]
6112#[derive(Debug)]
6113pub struct SocketGetBindToDeviceResponder {
6114    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6115    tx_id: u32,
6116}
6117
6118/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6119/// if the responder is dropped without sending a response, so that the client
6120/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6121impl std::ops::Drop for SocketGetBindToDeviceResponder {
6122    fn drop(&mut self) {
6123        self.control_handle.shutdown();
6124        // Safety: drops once, never accessed again
6125        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6126    }
6127}
6128
6129impl fidl::endpoints::Responder for SocketGetBindToDeviceResponder {
6130    type ControlHandle = SocketControlHandle;
6131
6132    fn control_handle(&self) -> &SocketControlHandle {
6133        &self.control_handle
6134    }
6135
6136    fn drop_without_shutdown(mut self) {
6137        // Safety: drops once, never accessed again due to mem::forget
6138        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6139        // Prevent Drop from running (which would shut down the channel)
6140        std::mem::forget(self);
6141    }
6142}
6143
6144impl SocketGetBindToDeviceResponder {
6145    /// Sends a response to the FIDL transaction.
6146    ///
6147    /// Sets the channel to shutdown if an error occurs.
6148    pub fn send(
6149        self,
6150        mut result: Result<&str, fidl_fuchsia_posix::Errno>,
6151    ) -> Result<(), fidl::Error> {
6152        let _result = self.send_raw(result);
6153        if _result.is_err() {
6154            self.control_handle.shutdown();
6155        }
6156        self.drop_without_shutdown();
6157        _result
6158    }
6159
6160    /// Similar to "send" but does not shutdown the channel if an error occurs.
6161    pub fn send_no_shutdown_on_err(
6162        self,
6163        mut result: Result<&str, fidl_fuchsia_posix::Errno>,
6164    ) -> Result<(), fidl::Error> {
6165        let _result = self.send_raw(result);
6166        self.drop_without_shutdown();
6167        _result
6168    }
6169
6170    fn send_raw(
6171        &self,
6172        mut result: Result<&str, fidl_fuchsia_posix::Errno>,
6173    ) -> Result<(), fidl::Error> {
6174        self.control_handle.inner.send::<fidl::encoding::ResultType<
6175            fidl_fuchsia_posix_socket::BaseSocketGetBindToDeviceResponse,
6176            fidl_fuchsia_posix::Errno,
6177        >>(
6178            result.map(|value| (value,)),
6179            self.tx_id,
6180            0x1ab1fbf0ef7906c8,
6181            fidl::encoding::DynamicFlags::empty(),
6182        )
6183    }
6184}
6185
6186#[must_use = "FIDL methods require a response to be sent"]
6187#[derive(Debug)]
6188pub struct SocketSetBindToInterfaceIndexResponder {
6189    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6190    tx_id: u32,
6191}
6192
6193/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6194/// if the responder is dropped without sending a response, so that the client
6195/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6196impl std::ops::Drop for SocketSetBindToInterfaceIndexResponder {
6197    fn drop(&mut self) {
6198        self.control_handle.shutdown();
6199        // Safety: drops once, never accessed again
6200        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6201    }
6202}
6203
6204impl fidl::endpoints::Responder for SocketSetBindToInterfaceIndexResponder {
6205    type ControlHandle = SocketControlHandle;
6206
6207    fn control_handle(&self) -> &SocketControlHandle {
6208        &self.control_handle
6209    }
6210
6211    fn drop_without_shutdown(mut self) {
6212        // Safety: drops once, never accessed again due to mem::forget
6213        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6214        // Prevent Drop from running (which would shut down the channel)
6215        std::mem::forget(self);
6216    }
6217}
6218
6219impl SocketSetBindToInterfaceIndexResponder {
6220    /// Sends a response to the FIDL transaction.
6221    ///
6222    /// Sets the channel to shutdown if an error occurs.
6223    pub fn send(
6224        self,
6225        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6226    ) -> Result<(), fidl::Error> {
6227        let _result = self.send_raw(result);
6228        if _result.is_err() {
6229            self.control_handle.shutdown();
6230        }
6231        self.drop_without_shutdown();
6232        _result
6233    }
6234
6235    /// Similar to "send" but does not shutdown the channel if an error occurs.
6236    pub fn send_no_shutdown_on_err(
6237        self,
6238        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6239    ) -> Result<(), fidl::Error> {
6240        let _result = self.send_raw(result);
6241        self.drop_without_shutdown();
6242        _result
6243    }
6244
6245    fn send_raw(
6246        &self,
6247        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6248    ) -> Result<(), fidl::Error> {
6249        self.control_handle.inner.send::<fidl::encoding::ResultType<
6250            fidl::encoding::EmptyStruct,
6251            fidl_fuchsia_posix::Errno,
6252        >>(
6253            result,
6254            self.tx_id,
6255            0x6e387a0def00821,
6256            fidl::encoding::DynamicFlags::empty(),
6257        )
6258    }
6259}
6260
6261#[must_use = "FIDL methods require a response to be sent"]
6262#[derive(Debug)]
6263pub struct SocketGetBindToInterfaceIndexResponder {
6264    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6265    tx_id: u32,
6266}
6267
6268/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6269/// if the responder is dropped without sending a response, so that the client
6270/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6271impl std::ops::Drop for SocketGetBindToInterfaceIndexResponder {
6272    fn drop(&mut self) {
6273        self.control_handle.shutdown();
6274        // Safety: drops once, never accessed again
6275        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6276    }
6277}
6278
6279impl fidl::endpoints::Responder for SocketGetBindToInterfaceIndexResponder {
6280    type ControlHandle = SocketControlHandle;
6281
6282    fn control_handle(&self) -> &SocketControlHandle {
6283        &self.control_handle
6284    }
6285
6286    fn drop_without_shutdown(mut self) {
6287        // Safety: drops once, never accessed again due to mem::forget
6288        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6289        // Prevent Drop from running (which would shut down the channel)
6290        std::mem::forget(self);
6291    }
6292}
6293
6294impl SocketGetBindToInterfaceIndexResponder {
6295    /// Sends a response to the FIDL transaction.
6296    ///
6297    /// Sets the channel to shutdown if an error occurs.
6298    pub fn send(
6299        self,
6300        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
6301    ) -> Result<(), fidl::Error> {
6302        let _result = self.send_raw(result);
6303        if _result.is_err() {
6304            self.control_handle.shutdown();
6305        }
6306        self.drop_without_shutdown();
6307        _result
6308    }
6309
6310    /// Similar to "send" but does not shutdown the channel if an error occurs.
6311    pub fn send_no_shutdown_on_err(
6312        self,
6313        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
6314    ) -> Result<(), fidl::Error> {
6315        let _result = self.send_raw(result);
6316        self.drop_without_shutdown();
6317        _result
6318    }
6319
6320    fn send_raw(
6321        &self,
6322        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
6323    ) -> Result<(), fidl::Error> {
6324        self.control_handle.inner.send::<fidl::encoding::ResultType<
6325            fidl_fuchsia_posix_socket::BaseSocketGetBindToInterfaceIndexResponse,
6326            fidl_fuchsia_posix::Errno,
6327        >>(
6328            result.map(|value| (value,)),
6329            self.tx_id,
6330            0x59c31dd3e3078295,
6331            fidl::encoding::DynamicFlags::empty(),
6332        )
6333    }
6334}
6335
6336#[must_use = "FIDL methods require a response to be sent"]
6337#[derive(Debug)]
6338pub struct SocketSetTimestampResponder {
6339    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6340    tx_id: u32,
6341}
6342
6343/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6344/// if the responder is dropped without sending a response, so that the client
6345/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6346impl std::ops::Drop for SocketSetTimestampResponder {
6347    fn drop(&mut self) {
6348        self.control_handle.shutdown();
6349        // Safety: drops once, never accessed again
6350        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6351    }
6352}
6353
6354impl fidl::endpoints::Responder for SocketSetTimestampResponder {
6355    type ControlHandle = SocketControlHandle;
6356
6357    fn control_handle(&self) -> &SocketControlHandle {
6358        &self.control_handle
6359    }
6360
6361    fn drop_without_shutdown(mut self) {
6362        // Safety: drops once, never accessed again due to mem::forget
6363        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6364        // Prevent Drop from running (which would shut down the channel)
6365        std::mem::forget(self);
6366    }
6367}
6368
6369impl SocketSetTimestampResponder {
6370    /// Sends a response to the FIDL transaction.
6371    ///
6372    /// Sets the channel to shutdown if an error occurs.
6373    pub fn send(
6374        self,
6375        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6376    ) -> Result<(), fidl::Error> {
6377        let _result = self.send_raw(result);
6378        if _result.is_err() {
6379            self.control_handle.shutdown();
6380        }
6381        self.drop_without_shutdown();
6382        _result
6383    }
6384
6385    /// Similar to "send" but does not shutdown the channel if an error occurs.
6386    pub fn send_no_shutdown_on_err(
6387        self,
6388        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6389    ) -> Result<(), fidl::Error> {
6390        let _result = self.send_raw(result);
6391        self.drop_without_shutdown();
6392        _result
6393    }
6394
6395    fn send_raw(
6396        &self,
6397        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6398    ) -> Result<(), fidl::Error> {
6399        self.control_handle.inner.send::<fidl::encoding::ResultType<
6400            fidl::encoding::EmptyStruct,
6401            fidl_fuchsia_posix::Errno,
6402        >>(
6403            result,
6404            self.tx_id,
6405            0x285d6516c263d839,
6406            fidl::encoding::DynamicFlags::empty(),
6407        )
6408    }
6409}
6410
6411#[must_use = "FIDL methods require a response to be sent"]
6412#[derive(Debug)]
6413pub struct SocketGetTimestampResponder {
6414    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6415    tx_id: u32,
6416}
6417
6418/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6419/// if the responder is dropped without sending a response, so that the client
6420/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6421impl std::ops::Drop for SocketGetTimestampResponder {
6422    fn drop(&mut self) {
6423        self.control_handle.shutdown();
6424        // Safety: drops once, never accessed again
6425        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6426    }
6427}
6428
6429impl fidl::endpoints::Responder for SocketGetTimestampResponder {
6430    type ControlHandle = SocketControlHandle;
6431
6432    fn control_handle(&self) -> &SocketControlHandle {
6433        &self.control_handle
6434    }
6435
6436    fn drop_without_shutdown(mut self) {
6437        // Safety: drops once, never accessed again due to mem::forget
6438        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6439        // Prevent Drop from running (which would shut down the channel)
6440        std::mem::forget(self);
6441    }
6442}
6443
6444impl SocketGetTimestampResponder {
6445    /// Sends a response to the FIDL transaction.
6446    ///
6447    /// Sets the channel to shutdown if an error occurs.
6448    pub fn send(
6449        self,
6450        mut result: Result<fidl_fuchsia_posix_socket::TimestampOption, fidl_fuchsia_posix::Errno>,
6451    ) -> Result<(), fidl::Error> {
6452        let _result = self.send_raw(result);
6453        if _result.is_err() {
6454            self.control_handle.shutdown();
6455        }
6456        self.drop_without_shutdown();
6457        _result
6458    }
6459
6460    /// Similar to "send" but does not shutdown the channel if an error occurs.
6461    pub fn send_no_shutdown_on_err(
6462        self,
6463        mut result: Result<fidl_fuchsia_posix_socket::TimestampOption, fidl_fuchsia_posix::Errno>,
6464    ) -> Result<(), fidl::Error> {
6465        let _result = self.send_raw(result);
6466        self.drop_without_shutdown();
6467        _result
6468    }
6469
6470    fn send_raw(
6471        &self,
6472        mut result: Result<fidl_fuchsia_posix_socket::TimestampOption, fidl_fuchsia_posix::Errno>,
6473    ) -> Result<(), fidl::Error> {
6474        self.control_handle.inner.send::<fidl::encoding::ResultType<
6475            fidl_fuchsia_posix_socket::BaseSocketGetTimestampResponse,
6476            fidl_fuchsia_posix::Errno,
6477        >>(
6478            result.map(|value| (value,)),
6479            self.tx_id,
6480            0x49f2fffbbcc2bd27,
6481            fidl::encoding::DynamicFlags::empty(),
6482        )
6483    }
6484}
6485
6486#[must_use = "FIDL methods require a response to be sent"]
6487#[derive(Debug)]
6488pub struct SocketSetMarkResponder {
6489    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6490    tx_id: u32,
6491}
6492
6493/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6494/// if the responder is dropped without sending a response, so that the client
6495/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6496impl std::ops::Drop for SocketSetMarkResponder {
6497    fn drop(&mut self) {
6498        self.control_handle.shutdown();
6499        // Safety: drops once, never accessed again
6500        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6501    }
6502}
6503
6504impl fidl::endpoints::Responder for SocketSetMarkResponder {
6505    type ControlHandle = SocketControlHandle;
6506
6507    fn control_handle(&self) -> &SocketControlHandle {
6508        &self.control_handle
6509    }
6510
6511    fn drop_without_shutdown(mut self) {
6512        // Safety: drops once, never accessed again due to mem::forget
6513        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6514        // Prevent Drop from running (which would shut down the channel)
6515        std::mem::forget(self);
6516    }
6517}
6518
6519impl SocketSetMarkResponder {
6520    /// Sends a response to the FIDL transaction.
6521    ///
6522    /// Sets the channel to shutdown if an error occurs.
6523    pub fn send(
6524        self,
6525        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6526    ) -> Result<(), fidl::Error> {
6527        let _result = self.send_raw(result);
6528        if _result.is_err() {
6529            self.control_handle.shutdown();
6530        }
6531        self.drop_without_shutdown();
6532        _result
6533    }
6534
6535    /// Similar to "send" but does not shutdown the channel if an error occurs.
6536    pub fn send_no_shutdown_on_err(
6537        self,
6538        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6539    ) -> Result<(), fidl::Error> {
6540        let _result = self.send_raw(result);
6541        self.drop_without_shutdown();
6542        _result
6543    }
6544
6545    fn send_raw(
6546        &self,
6547        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6548    ) -> Result<(), fidl::Error> {
6549        self.control_handle.inner.send::<fidl::encoding::ResultType<
6550            fidl::encoding::EmptyStruct,
6551            fidl_fuchsia_posix::Errno,
6552        >>(
6553            result,
6554            self.tx_id,
6555            0x6ead6de09f653236,
6556            fidl::encoding::DynamicFlags::empty(),
6557        )
6558    }
6559}
6560
6561#[must_use = "FIDL methods require a response to be sent"]
6562#[derive(Debug)]
6563pub struct SocketGetMarkResponder {
6564    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6565    tx_id: u32,
6566}
6567
6568/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6569/// if the responder is dropped without sending a response, so that the client
6570/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6571impl std::ops::Drop for SocketGetMarkResponder {
6572    fn drop(&mut self) {
6573        self.control_handle.shutdown();
6574        // Safety: drops once, never accessed again
6575        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6576    }
6577}
6578
6579impl fidl::endpoints::Responder for SocketGetMarkResponder {
6580    type ControlHandle = SocketControlHandle;
6581
6582    fn control_handle(&self) -> &SocketControlHandle {
6583        &self.control_handle
6584    }
6585
6586    fn drop_without_shutdown(mut self) {
6587        // Safety: drops once, never accessed again due to mem::forget
6588        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6589        // Prevent Drop from running (which would shut down the channel)
6590        std::mem::forget(self);
6591    }
6592}
6593
6594impl SocketGetMarkResponder {
6595    /// Sends a response to the FIDL transaction.
6596    ///
6597    /// Sets the channel to shutdown if an error occurs.
6598    pub fn send(
6599        self,
6600        mut result: Result<&fidl_fuchsia_posix_socket::OptionalUint32, fidl_fuchsia_posix::Errno>,
6601    ) -> Result<(), fidl::Error> {
6602        let _result = self.send_raw(result);
6603        if _result.is_err() {
6604            self.control_handle.shutdown();
6605        }
6606        self.drop_without_shutdown();
6607        _result
6608    }
6609
6610    /// Similar to "send" but does not shutdown the channel if an error occurs.
6611    pub fn send_no_shutdown_on_err(
6612        self,
6613        mut result: Result<&fidl_fuchsia_posix_socket::OptionalUint32, fidl_fuchsia_posix::Errno>,
6614    ) -> Result<(), fidl::Error> {
6615        let _result = self.send_raw(result);
6616        self.drop_without_shutdown();
6617        _result
6618    }
6619
6620    fn send_raw(
6621        &self,
6622        mut result: Result<&fidl_fuchsia_posix_socket::OptionalUint32, fidl_fuchsia_posix::Errno>,
6623    ) -> Result<(), fidl::Error> {
6624        self.control_handle.inner.send::<fidl::encoding::ResultType<
6625            fidl_fuchsia_posix_socket::BaseSocketGetMarkResponse,
6626            fidl_fuchsia_posix::Errno,
6627        >>(
6628            result.map(|mark| (mark,)),
6629            self.tx_id,
6630            0x57a2752c61d93d47,
6631            fidl::encoding::DynamicFlags::empty(),
6632        )
6633    }
6634}
6635
6636#[must_use = "FIDL methods require a response to be sent"]
6637#[derive(Debug)]
6638pub struct SocketGetCookieResponder {
6639    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6640    tx_id: u32,
6641}
6642
6643/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6644/// if the responder is dropped without sending a response, so that the client
6645/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6646impl std::ops::Drop for SocketGetCookieResponder {
6647    fn drop(&mut self) {
6648        self.control_handle.shutdown();
6649        // Safety: drops once, never accessed again
6650        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6651    }
6652}
6653
6654impl fidl::endpoints::Responder for SocketGetCookieResponder {
6655    type ControlHandle = SocketControlHandle;
6656
6657    fn control_handle(&self) -> &SocketControlHandle {
6658        &self.control_handle
6659    }
6660
6661    fn drop_without_shutdown(mut self) {
6662        // Safety: drops once, never accessed again due to mem::forget
6663        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6664        // Prevent Drop from running (which would shut down the channel)
6665        std::mem::forget(self);
6666    }
6667}
6668
6669impl SocketGetCookieResponder {
6670    /// Sends a response to the FIDL transaction.
6671    ///
6672    /// Sets the channel to shutdown if an error occurs.
6673    pub fn send(
6674        self,
6675        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
6676    ) -> Result<(), fidl::Error> {
6677        let _result = self.send_raw(result);
6678        if _result.is_err() {
6679            self.control_handle.shutdown();
6680        }
6681        self.drop_without_shutdown();
6682        _result
6683    }
6684
6685    /// Similar to "send" but does not shutdown the channel if an error occurs.
6686    pub fn send_no_shutdown_on_err(
6687        self,
6688        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
6689    ) -> Result<(), fidl::Error> {
6690        let _result = self.send_raw(result);
6691        self.drop_without_shutdown();
6692        _result
6693    }
6694
6695    fn send_raw(
6696        &self,
6697        mut result: Result<u64, fidl_fuchsia_posix::Errno>,
6698    ) -> Result<(), fidl::Error> {
6699        self.control_handle.inner.send::<fidl::encoding::ResultType<
6700            fidl_fuchsia_posix_socket::BaseSocketGetCookieResponse,
6701            fidl_fuchsia_posix::Errno,
6702        >>(
6703            result.map(|value| (value,)),
6704            self.tx_id,
6705            0x2c2f47fd8f924e52,
6706            fidl::encoding::DynamicFlags::empty(),
6707        )
6708    }
6709}
6710
6711#[must_use = "FIDL methods require a response to be sent"]
6712#[derive(Debug)]
6713pub struct SocketDescribeResponder {
6714    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6715    tx_id: u32,
6716}
6717
6718/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6719/// if the responder is dropped without sending a response, so that the client
6720/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6721impl std::ops::Drop for SocketDescribeResponder {
6722    fn drop(&mut self) {
6723        self.control_handle.shutdown();
6724        // Safety: drops once, never accessed again
6725        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6726    }
6727}
6728
6729impl fidl::endpoints::Responder for SocketDescribeResponder {
6730    type ControlHandle = SocketControlHandle;
6731
6732    fn control_handle(&self) -> &SocketControlHandle {
6733        &self.control_handle
6734    }
6735
6736    fn drop_without_shutdown(mut self) {
6737        // Safety: drops once, never accessed again due to mem::forget
6738        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6739        // Prevent Drop from running (which would shut down the channel)
6740        std::mem::forget(self);
6741    }
6742}
6743
6744impl SocketDescribeResponder {
6745    /// Sends a response to the FIDL transaction.
6746    ///
6747    /// Sets the channel to shutdown if an error occurs.
6748    pub fn send(self, mut payload: SocketDescribeResponse) -> Result<(), fidl::Error> {
6749        let _result = self.send_raw(payload);
6750        if _result.is_err() {
6751            self.control_handle.shutdown();
6752        }
6753        self.drop_without_shutdown();
6754        _result
6755    }
6756
6757    /// Similar to "send" but does not shutdown the channel if an error occurs.
6758    pub fn send_no_shutdown_on_err(
6759        self,
6760        mut payload: SocketDescribeResponse,
6761    ) -> Result<(), fidl::Error> {
6762        let _result = self.send_raw(payload);
6763        self.drop_without_shutdown();
6764        _result
6765    }
6766
6767    fn send_raw(&self, mut payload: SocketDescribeResponse) -> Result<(), fidl::Error> {
6768        self.control_handle.inner.send::<SocketDescribeResponse>(
6769            &mut payload,
6770            self.tx_id,
6771            0x4fd7c08c9c804484,
6772            fidl::encoding::DynamicFlags::empty(),
6773        )
6774    }
6775}
6776
6777#[must_use = "FIDL methods require a response to be sent"]
6778#[derive(Debug)]
6779pub struct SocketBindResponder {
6780    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6781    tx_id: u32,
6782}
6783
6784/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6785/// if the responder is dropped without sending a response, so that the client
6786/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6787impl std::ops::Drop for SocketBindResponder {
6788    fn drop(&mut self) {
6789        self.control_handle.shutdown();
6790        // Safety: drops once, never accessed again
6791        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6792    }
6793}
6794
6795impl fidl::endpoints::Responder for SocketBindResponder {
6796    type ControlHandle = SocketControlHandle;
6797
6798    fn control_handle(&self) -> &SocketControlHandle {
6799        &self.control_handle
6800    }
6801
6802    fn drop_without_shutdown(mut self) {
6803        // Safety: drops once, never accessed again due to mem::forget
6804        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6805        // Prevent Drop from running (which would shut down the channel)
6806        std::mem::forget(self);
6807    }
6808}
6809
6810impl SocketBindResponder {
6811    /// Sends a response to the FIDL transaction.
6812    ///
6813    /// Sets the channel to shutdown if an error occurs.
6814    pub fn send(
6815        self,
6816        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6817    ) -> Result<(), fidl::Error> {
6818        let _result = self.send_raw(result);
6819        if _result.is_err() {
6820            self.control_handle.shutdown();
6821        }
6822        self.drop_without_shutdown();
6823        _result
6824    }
6825
6826    /// Similar to "send" but does not shutdown the channel if an error occurs.
6827    pub fn send_no_shutdown_on_err(
6828        self,
6829        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6830    ) -> Result<(), fidl::Error> {
6831        let _result = self.send_raw(result);
6832        self.drop_without_shutdown();
6833        _result
6834    }
6835
6836    fn send_raw(
6837        &self,
6838        mut result: Result<(), fidl_fuchsia_posix::Errno>,
6839    ) -> Result<(), fidl::Error> {
6840        self.control_handle.inner.send::<fidl::encoding::ResultType<
6841            fidl::encoding::EmptyStruct,
6842            fidl_fuchsia_posix::Errno,
6843        >>(
6844            result,
6845            self.tx_id,
6846            0x6caedb2d31b56db8,
6847            fidl::encoding::DynamicFlags::empty(),
6848        )
6849    }
6850}
6851
6852#[must_use = "FIDL methods require a response to be sent"]
6853#[derive(Debug)]
6854pub struct SocketGetInfoResponder {
6855    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6856    tx_id: u32,
6857}
6858
6859/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6860/// if the responder is dropped without sending a response, so that the client
6861/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6862impl std::ops::Drop for SocketGetInfoResponder {
6863    fn drop(&mut self) {
6864        self.control_handle.shutdown();
6865        // Safety: drops once, never accessed again
6866        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6867    }
6868}
6869
6870impl fidl::endpoints::Responder for SocketGetInfoResponder {
6871    type ControlHandle = SocketControlHandle;
6872
6873    fn control_handle(&self) -> &SocketControlHandle {
6874        &self.control_handle
6875    }
6876
6877    fn drop_without_shutdown(mut self) {
6878        // Safety: drops once, never accessed again due to mem::forget
6879        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6880        // Prevent Drop from running (which would shut down the channel)
6881        std::mem::forget(self);
6882    }
6883}
6884
6885impl SocketGetInfoResponder {
6886    /// Sends a response to the FIDL transaction.
6887    ///
6888    /// Sets the channel to shutdown if an error occurs.
6889    pub fn send(
6890        self,
6891        mut result: Result<
6892            (Kind, Option<&ProtocolAssociation>, &BoundInterface),
6893            fidl_fuchsia_posix::Errno,
6894        >,
6895    ) -> Result<(), fidl::Error> {
6896        let _result = self.send_raw(result);
6897        if _result.is_err() {
6898            self.control_handle.shutdown();
6899        }
6900        self.drop_without_shutdown();
6901        _result
6902    }
6903
6904    /// Similar to "send" but does not shutdown the channel if an error occurs.
6905    pub fn send_no_shutdown_on_err(
6906        self,
6907        mut result: Result<
6908            (Kind, Option<&ProtocolAssociation>, &BoundInterface),
6909            fidl_fuchsia_posix::Errno,
6910        >,
6911    ) -> Result<(), fidl::Error> {
6912        let _result = self.send_raw(result);
6913        self.drop_without_shutdown();
6914        _result
6915    }
6916
6917    fn send_raw(
6918        &self,
6919        mut result: Result<
6920            (Kind, Option<&ProtocolAssociation>, &BoundInterface),
6921            fidl_fuchsia_posix::Errno,
6922        >,
6923    ) -> Result<(), fidl::Error> {
6924        self.control_handle.inner.send::<fidl::encoding::ResultType<
6925            SocketGetInfoResponse,
6926            fidl_fuchsia_posix::Errno,
6927        >>(
6928            result,
6929            self.tx_id,
6930            0x7f67457e85c3914c,
6931            fidl::encoding::DynamicFlags::empty(),
6932        )
6933    }
6934}
6935
6936#[must_use = "FIDL methods require a response to be sent"]
6937#[derive(Debug)]
6938pub struct SocketRecvMsgResponder {
6939    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
6940    tx_id: u32,
6941}
6942
6943/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
6944/// if the responder is dropped without sending a response, so that the client
6945/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6946impl std::ops::Drop for SocketRecvMsgResponder {
6947    fn drop(&mut self) {
6948        self.control_handle.shutdown();
6949        // Safety: drops once, never accessed again
6950        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6951    }
6952}
6953
6954impl fidl::endpoints::Responder for SocketRecvMsgResponder {
6955    type ControlHandle = SocketControlHandle;
6956
6957    fn control_handle(&self) -> &SocketControlHandle {
6958        &self.control_handle
6959    }
6960
6961    fn drop_without_shutdown(mut self) {
6962        // Safety: drops once, never accessed again due to mem::forget
6963        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6964        // Prevent Drop from running (which would shut down the channel)
6965        std::mem::forget(self);
6966    }
6967}
6968
6969impl SocketRecvMsgResponder {
6970    /// Sends a response to the FIDL transaction.
6971    ///
6972    /// Sets the channel to shutdown if an error occurs.
6973    pub fn send(
6974        self,
6975        mut result: Result<
6976            (Option<&RecvPacketInfo>, &[u8], &RecvControlData, u32),
6977            fidl_fuchsia_posix::Errno,
6978        >,
6979    ) -> Result<(), fidl::Error> {
6980        let _result = self.send_raw(result);
6981        if _result.is_err() {
6982            self.control_handle.shutdown();
6983        }
6984        self.drop_without_shutdown();
6985        _result
6986    }
6987
6988    /// Similar to "send" but does not shutdown the channel if an error occurs.
6989    pub fn send_no_shutdown_on_err(
6990        self,
6991        mut result: Result<
6992            (Option<&RecvPacketInfo>, &[u8], &RecvControlData, u32),
6993            fidl_fuchsia_posix::Errno,
6994        >,
6995    ) -> Result<(), fidl::Error> {
6996        let _result = self.send_raw(result);
6997        self.drop_without_shutdown();
6998        _result
6999    }
7000
7001    fn send_raw(
7002        &self,
7003        mut result: Result<
7004            (Option<&RecvPacketInfo>, &[u8], &RecvControlData, u32),
7005            fidl_fuchsia_posix::Errno,
7006        >,
7007    ) -> Result<(), fidl::Error> {
7008        self.control_handle.inner.send::<fidl::encoding::ResultType<
7009            SocketRecvMsgResponse,
7010            fidl_fuchsia_posix::Errno,
7011        >>(
7012            result,
7013            self.tx_id,
7014            0x52b95ba982826a61,
7015            fidl::encoding::DynamicFlags::empty(),
7016        )
7017    }
7018}
7019
7020#[must_use = "FIDL methods require a response to be sent"]
7021#[derive(Debug)]
7022pub struct SocketSendMsgResponder {
7023    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
7024    tx_id: u32,
7025}
7026
7027/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
7028/// if the responder is dropped without sending a response, so that the client
7029/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7030impl std::ops::Drop for SocketSendMsgResponder {
7031    fn drop(&mut self) {
7032        self.control_handle.shutdown();
7033        // Safety: drops once, never accessed again
7034        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7035    }
7036}
7037
7038impl fidl::endpoints::Responder for SocketSendMsgResponder {
7039    type ControlHandle = SocketControlHandle;
7040
7041    fn control_handle(&self) -> &SocketControlHandle {
7042        &self.control_handle
7043    }
7044
7045    fn drop_without_shutdown(mut self) {
7046        // Safety: drops once, never accessed again due to mem::forget
7047        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7048        // Prevent Drop from running (which would shut down the channel)
7049        std::mem::forget(self);
7050    }
7051}
7052
7053impl SocketSendMsgResponder {
7054    /// Sends a response to the FIDL transaction.
7055    ///
7056    /// Sets the channel to shutdown if an error occurs.
7057    pub fn send(
7058        self,
7059        mut result: Result<(), fidl_fuchsia_posix::Errno>,
7060    ) -> Result<(), fidl::Error> {
7061        let _result = self.send_raw(result);
7062        if _result.is_err() {
7063            self.control_handle.shutdown();
7064        }
7065        self.drop_without_shutdown();
7066        _result
7067    }
7068
7069    /// Similar to "send" but does not shutdown the channel if an error occurs.
7070    pub fn send_no_shutdown_on_err(
7071        self,
7072        mut result: Result<(), fidl_fuchsia_posix::Errno>,
7073    ) -> Result<(), fidl::Error> {
7074        let _result = self.send_raw(result);
7075        self.drop_without_shutdown();
7076        _result
7077    }
7078
7079    fn send_raw(
7080        &self,
7081        mut result: Result<(), fidl_fuchsia_posix::Errno>,
7082    ) -> Result<(), fidl::Error> {
7083        self.control_handle.inner.send::<fidl::encoding::ResultType<
7084            fidl::encoding::EmptyStruct,
7085            fidl_fuchsia_posix::Errno,
7086        >>(
7087            result,
7088            self.tx_id,
7089            0x150c9ff91f944922,
7090            fidl::encoding::DynamicFlags::empty(),
7091        )
7092    }
7093}
7094
7095#[must_use = "FIDL methods require a response to be sent"]
7096#[derive(Debug)]
7097pub struct SocketAttachBpfFilterUnsafeResponder {
7098    control_handle: std::mem::ManuallyDrop<SocketControlHandle>,
7099    tx_id: u32,
7100}
7101
7102/// Set the the channel to be shutdown (see [`SocketControlHandle::shutdown`])
7103/// if the responder is dropped without sending a response, so that the client
7104/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7105impl std::ops::Drop for SocketAttachBpfFilterUnsafeResponder {
7106    fn drop(&mut self) {
7107        self.control_handle.shutdown();
7108        // Safety: drops once, never accessed again
7109        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7110    }
7111}
7112
7113impl fidl::endpoints::Responder for SocketAttachBpfFilterUnsafeResponder {
7114    type ControlHandle = SocketControlHandle;
7115
7116    fn control_handle(&self) -> &SocketControlHandle {
7117        &self.control_handle
7118    }
7119
7120    fn drop_without_shutdown(mut self) {
7121        // Safety: drops once, never accessed again due to mem::forget
7122        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7123        // Prevent Drop from running (which would shut down the channel)
7124        std::mem::forget(self);
7125    }
7126}
7127
7128impl SocketAttachBpfFilterUnsafeResponder {
7129    /// Sends a response to the FIDL transaction.
7130    ///
7131    /// Sets the channel to shutdown if an error occurs.
7132    pub fn send(
7133        self,
7134        mut result: Result<(), fidl_fuchsia_posix::Errno>,
7135    ) -> Result<(), fidl::Error> {
7136        let _result = self.send_raw(result);
7137        if _result.is_err() {
7138            self.control_handle.shutdown();
7139        }
7140        self.drop_without_shutdown();
7141        _result
7142    }
7143
7144    /// Similar to "send" but does not shutdown the channel if an error occurs.
7145    pub fn send_no_shutdown_on_err(
7146        self,
7147        mut result: Result<(), fidl_fuchsia_posix::Errno>,
7148    ) -> Result<(), fidl::Error> {
7149        let _result = self.send_raw(result);
7150        self.drop_without_shutdown();
7151        _result
7152    }
7153
7154    fn send_raw(
7155        &self,
7156        mut result: Result<(), fidl_fuchsia_posix::Errno>,
7157    ) -> Result<(), fidl::Error> {
7158        self.control_handle.inner.send::<fidl::encoding::ResultType<
7159            fidl::encoding::EmptyStruct,
7160            fidl_fuchsia_posix::Errno,
7161        >>(
7162            result,
7163            self.tx_id,
7164            0x593998d38670f823,
7165            fidl::encoding::DynamicFlags::empty(),
7166        )
7167    }
7168}
7169
7170mod internal {
7171    use super::*;
7172
7173    impl fidl::encoding::ResourceTypeMarker for ProviderSocketResponse {
7174        type Borrowed<'a> = &'a mut Self;
7175        fn take_or_borrow<'a>(
7176            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7177        ) -> Self::Borrowed<'a> {
7178            value
7179        }
7180    }
7181
7182    unsafe impl fidl::encoding::TypeMarker for ProviderSocketResponse {
7183        type Owned = Self;
7184
7185        #[inline(always)]
7186        fn inline_align(_context: fidl::encoding::Context) -> usize {
7187            4
7188        }
7189
7190        #[inline(always)]
7191        fn inline_size(_context: fidl::encoding::Context) -> usize {
7192            4
7193        }
7194    }
7195
7196    unsafe impl
7197        fidl::encoding::Encode<
7198            ProviderSocketResponse,
7199            fidl::encoding::DefaultFuchsiaResourceDialect,
7200        > for &mut ProviderSocketResponse
7201    {
7202        #[inline]
7203        unsafe fn encode(
7204            self,
7205            encoder: &mut fidl::encoding::Encoder<
7206                '_,
7207                fidl::encoding::DefaultFuchsiaResourceDialect,
7208            >,
7209            offset: usize,
7210            _depth: fidl::encoding::Depth,
7211        ) -> fidl::Result<()> {
7212            encoder.debug_check_bounds::<ProviderSocketResponse>(offset);
7213            // Delegate to tuple encoding.
7214            fidl::encoding::Encode::<ProviderSocketResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7215                (
7216                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SocketMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.socket),
7217                ),
7218                encoder, offset, _depth
7219            )
7220        }
7221    }
7222    unsafe impl<
7223        T0: fidl::encoding::Encode<
7224                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SocketMarker>>,
7225                fidl::encoding::DefaultFuchsiaResourceDialect,
7226            >,
7227    >
7228        fidl::encoding::Encode<
7229            ProviderSocketResponse,
7230            fidl::encoding::DefaultFuchsiaResourceDialect,
7231        > for (T0,)
7232    {
7233        #[inline]
7234        unsafe fn encode(
7235            self,
7236            encoder: &mut fidl::encoding::Encoder<
7237                '_,
7238                fidl::encoding::DefaultFuchsiaResourceDialect,
7239            >,
7240            offset: usize,
7241            depth: fidl::encoding::Depth,
7242        ) -> fidl::Result<()> {
7243            encoder.debug_check_bounds::<ProviderSocketResponse>(offset);
7244            // Zero out padding regions. There's no need to apply masks
7245            // because the unmasked parts will be overwritten by fields.
7246            // Write the fields.
7247            self.0.encode(encoder, offset + 0, depth)?;
7248            Ok(())
7249        }
7250    }
7251
7252    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7253        for ProviderSocketResponse
7254    {
7255        #[inline(always)]
7256        fn new_empty() -> Self {
7257            Self {
7258                socket: fidl::new_empty!(
7259                    fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SocketMarker>>,
7260                    fidl::encoding::DefaultFuchsiaResourceDialect
7261                ),
7262            }
7263        }
7264
7265        #[inline]
7266        unsafe fn decode(
7267            &mut self,
7268            decoder: &mut fidl::encoding::Decoder<
7269                '_,
7270                fidl::encoding::DefaultFuchsiaResourceDialect,
7271            >,
7272            offset: usize,
7273            _depth: fidl::encoding::Depth,
7274        ) -> fidl::Result<()> {
7275            decoder.debug_check_bounds::<Self>(offset);
7276            // Verify that padding bytes are zero.
7277            fidl::decode!(
7278                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SocketMarker>>,
7279                fidl::encoding::DefaultFuchsiaResourceDialect,
7280                &mut self.socket,
7281                decoder,
7282                offset + 0,
7283                _depth
7284            )?;
7285            Ok(())
7286        }
7287    }
7288
7289    impl fidl::encoding::ResourceTypeMarker for SocketAttachBpfFilterUnsafeRequest {
7290        type Borrowed<'a> = &'a mut Self;
7291        fn take_or_borrow<'a>(
7292            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7293        ) -> Self::Borrowed<'a> {
7294            value
7295        }
7296    }
7297
7298    unsafe impl fidl::encoding::TypeMarker for SocketAttachBpfFilterUnsafeRequest {
7299        type Owned = Self;
7300
7301        #[inline(always)]
7302        fn inline_align(_context: fidl::encoding::Context) -> usize {
7303            8
7304        }
7305
7306        #[inline(always)]
7307        fn inline_size(_context: fidl::encoding::Context) -> usize {
7308            16
7309        }
7310    }
7311
7312    unsafe impl
7313        fidl::encoding::Encode<
7314            SocketAttachBpfFilterUnsafeRequest,
7315            fidl::encoding::DefaultFuchsiaResourceDialect,
7316        > for &mut SocketAttachBpfFilterUnsafeRequest
7317    {
7318        #[inline]
7319        unsafe fn encode(
7320            self,
7321            encoder: &mut fidl::encoding::Encoder<
7322                '_,
7323                fidl::encoding::DefaultFuchsiaResourceDialect,
7324            >,
7325            offset: usize,
7326            _depth: fidl::encoding::Depth,
7327        ) -> fidl::Result<()> {
7328            encoder.debug_check_bounds::<SocketAttachBpfFilterUnsafeRequest>(offset);
7329            // Delegate to tuple encoding.
7330            fidl::encoding::Encode::<
7331                SocketAttachBpfFilterUnsafeRequest,
7332                fidl::encoding::DefaultFuchsiaResourceDialect,
7333            >::encode(
7334                (<fidl::encoding::Vector<u64, 4096> as fidl::encoding::ValueTypeMarker>::borrow(
7335                    &self.code,
7336                ),),
7337                encoder,
7338                offset,
7339                _depth,
7340            )
7341        }
7342    }
7343    unsafe impl<
7344        T0: fidl::encoding::Encode<
7345                fidl::encoding::Vector<u64, 4096>,
7346                fidl::encoding::DefaultFuchsiaResourceDialect,
7347            >,
7348    >
7349        fidl::encoding::Encode<
7350            SocketAttachBpfFilterUnsafeRequest,
7351            fidl::encoding::DefaultFuchsiaResourceDialect,
7352        > for (T0,)
7353    {
7354        #[inline]
7355        unsafe fn encode(
7356            self,
7357            encoder: &mut fidl::encoding::Encoder<
7358                '_,
7359                fidl::encoding::DefaultFuchsiaResourceDialect,
7360            >,
7361            offset: usize,
7362            depth: fidl::encoding::Depth,
7363        ) -> fidl::Result<()> {
7364            encoder.debug_check_bounds::<SocketAttachBpfFilterUnsafeRequest>(offset);
7365            // Zero out padding regions. There's no need to apply masks
7366            // because the unmasked parts will be overwritten by fields.
7367            // Write the fields.
7368            self.0.encode(encoder, offset + 0, depth)?;
7369            Ok(())
7370        }
7371    }
7372
7373    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7374        for SocketAttachBpfFilterUnsafeRequest
7375    {
7376        #[inline(always)]
7377        fn new_empty() -> Self {
7378            Self {
7379                code: fidl::new_empty!(fidl::encoding::Vector<u64, 4096>, fidl::encoding::DefaultFuchsiaResourceDialect),
7380            }
7381        }
7382
7383        #[inline]
7384        unsafe fn decode(
7385            &mut self,
7386            decoder: &mut fidl::encoding::Decoder<
7387                '_,
7388                fidl::encoding::DefaultFuchsiaResourceDialect,
7389            >,
7390            offset: usize,
7391            _depth: fidl::encoding::Depth,
7392        ) -> fidl::Result<()> {
7393            decoder.debug_check_bounds::<Self>(offset);
7394            // Verify that padding bytes are zero.
7395            fidl::decode!(fidl::encoding::Vector<u64, 4096>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.code, decoder, offset + 0, _depth)?;
7396            Ok(())
7397        }
7398    }
7399
7400    impl SocketDescribeResponse {
7401        #[inline(always)]
7402        fn max_ordinal_present(&self) -> u64 {
7403            if let Some(_) = self.event {
7404                return 1;
7405            }
7406            0
7407        }
7408    }
7409
7410    impl fidl::encoding::ResourceTypeMarker for SocketDescribeResponse {
7411        type Borrowed<'a> = &'a mut Self;
7412        fn take_or_borrow<'a>(
7413            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7414        ) -> Self::Borrowed<'a> {
7415            value
7416        }
7417    }
7418
7419    unsafe impl fidl::encoding::TypeMarker for SocketDescribeResponse {
7420        type Owned = Self;
7421
7422        #[inline(always)]
7423        fn inline_align(_context: fidl::encoding::Context) -> usize {
7424            8
7425        }
7426
7427        #[inline(always)]
7428        fn inline_size(_context: fidl::encoding::Context) -> usize {
7429            16
7430        }
7431    }
7432
7433    unsafe impl
7434        fidl::encoding::Encode<
7435            SocketDescribeResponse,
7436            fidl::encoding::DefaultFuchsiaResourceDialect,
7437        > for &mut SocketDescribeResponse
7438    {
7439        unsafe fn encode(
7440            self,
7441            encoder: &mut fidl::encoding::Encoder<
7442                '_,
7443                fidl::encoding::DefaultFuchsiaResourceDialect,
7444            >,
7445            offset: usize,
7446            mut depth: fidl::encoding::Depth,
7447        ) -> fidl::Result<()> {
7448            encoder.debug_check_bounds::<SocketDescribeResponse>(offset);
7449            // Vector header
7450            let max_ordinal: u64 = self.max_ordinal_present();
7451            encoder.write_num(max_ordinal, offset);
7452            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7453            // Calling encoder.out_of_line_offset(0) is not allowed.
7454            if max_ordinal == 0 {
7455                return Ok(());
7456            }
7457            depth.increment()?;
7458            let envelope_size = 8;
7459            let bytes_len = max_ordinal as usize * envelope_size;
7460            #[allow(unused_variables)]
7461            let offset = encoder.out_of_line_offset(bytes_len);
7462            let mut _prev_end_offset: usize = 0;
7463            if 1 > max_ordinal {
7464                return Ok(());
7465            }
7466
7467            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7468            // are envelope_size bytes.
7469            let cur_offset: usize = (1 - 1) * envelope_size;
7470
7471            // Zero reserved fields.
7472            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7473
7474            // Safety:
7475            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7476            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7477            //   envelope_size bytes, there is always sufficient room.
7478            fidl::encoding::encode_in_envelope_optional::<
7479                fidl::encoding::HandleType<
7480                    fidl::EventPair,
7481                    { fidl::ObjectType::EVENTPAIR.into_raw() },
7482                    2147483648,
7483                >,
7484                fidl::encoding::DefaultFuchsiaResourceDialect,
7485            >(
7486                self.event.as_mut().map(
7487                    <fidl::encoding::HandleType<
7488                        fidl::EventPair,
7489                        { fidl::ObjectType::EVENTPAIR.into_raw() },
7490                        2147483648,
7491                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
7492                ),
7493                encoder,
7494                offset + cur_offset,
7495                depth,
7496            )?;
7497
7498            _prev_end_offset = cur_offset + envelope_size;
7499
7500            Ok(())
7501        }
7502    }
7503
7504    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7505        for SocketDescribeResponse
7506    {
7507        #[inline(always)]
7508        fn new_empty() -> Self {
7509            Self::default()
7510        }
7511
7512        unsafe fn decode(
7513            &mut self,
7514            decoder: &mut fidl::encoding::Decoder<
7515                '_,
7516                fidl::encoding::DefaultFuchsiaResourceDialect,
7517            >,
7518            offset: usize,
7519            mut depth: fidl::encoding::Depth,
7520        ) -> fidl::Result<()> {
7521            decoder.debug_check_bounds::<Self>(offset);
7522            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7523                None => return Err(fidl::Error::NotNullable),
7524                Some(len) => len,
7525            };
7526            // Calling decoder.out_of_line_offset(0) is not allowed.
7527            if len == 0 {
7528                return Ok(());
7529            };
7530            depth.increment()?;
7531            let envelope_size = 8;
7532            let bytes_len = len * envelope_size;
7533            let offset = decoder.out_of_line_offset(bytes_len)?;
7534            // Decode the envelope for each type.
7535            let mut _next_ordinal_to_read = 0;
7536            let mut next_offset = offset;
7537            let end_offset = offset + bytes_len;
7538            _next_ordinal_to_read += 1;
7539            if next_offset >= end_offset {
7540                return Ok(());
7541            }
7542
7543            // Decode unknown envelopes for gaps in ordinals.
7544            while _next_ordinal_to_read < 1 {
7545                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7546                _next_ordinal_to_read += 1;
7547                next_offset += envelope_size;
7548            }
7549
7550            let next_out_of_line = decoder.next_out_of_line();
7551            let handles_before = decoder.remaining_handles();
7552            if let Some((inlined, num_bytes, num_handles)) =
7553                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7554            {
7555                let member_inline_size = <fidl::encoding::HandleType<
7556                    fidl::EventPair,
7557                    { fidl::ObjectType::EVENTPAIR.into_raw() },
7558                    2147483648,
7559                > as fidl::encoding::TypeMarker>::inline_size(
7560                    decoder.context
7561                );
7562                if inlined != (member_inline_size <= 4) {
7563                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7564                }
7565                let inner_offset;
7566                let mut inner_depth = depth.clone();
7567                if inlined {
7568                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7569                    inner_offset = next_offset;
7570                } else {
7571                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7572                    inner_depth.increment()?;
7573                }
7574                let val_ref =
7575                self.event.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
7576                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
7577                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7578                {
7579                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7580                }
7581                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7582                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7583                }
7584            }
7585
7586            next_offset += envelope_size;
7587
7588            // Decode the remaining unknown envelopes.
7589            while next_offset < end_offset {
7590                _next_ordinal_to_read += 1;
7591                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7592                next_offset += envelope_size;
7593            }
7594
7595            Ok(())
7596        }
7597    }
7598}