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