Skip to main content

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