fidl_fuchsia_posix_socket_packet/
fidl_fuchsia_posix_socket_packet.rs

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