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