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