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