Skip to main content

fidl_next_fuchsia_device_fs/
fidl_next_fuchsia_device_fs.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7    pub use fidl_next_common_fuchsia_device_fs::natural::*;
8
9    #[derive(Debug, PartialEq)]
10    #[repr(C)]
11    pub struct ConnectorConnectRequest {
12        pub server: ::fidl_next::fuchsia::zx::Channel,
13    }
14
15    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConnectorConnectRequest, ___E>
16        for ConnectorConnectRequest
17    where
18        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19        ___E: ::fidl_next::fuchsia::HandleEncoder,
20    {
21        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
22            Self,
23            crate::wire::ConnectorConnectRequest,
24        > = unsafe {
25            ::fidl_next::CopyOptimization::enable_if(
26                true && <::fidl_next::fuchsia::zx::Channel as ::fidl_next::Encode<
27                    ::fidl_next::wire::fuchsia::Channel,
28                    ___E,
29                >>::COPY_OPTIMIZATION
30                    .is_enabled(),
31            )
32        };
33
34        #[inline]
35        fn encode(
36            self,
37            encoder_: &mut ___E,
38            out_: &mut ::core::mem::MaybeUninit<crate::wire::ConnectorConnectRequest>,
39            _: (),
40        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
41            ::fidl_next::munge! {
42                let crate::wire::ConnectorConnectRequest {
43                    server,
44
45                } = out_;
46            }
47
48            ::fidl_next::Encode::encode(self.server, encoder_, server, ())?;
49
50            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(server.as_mut_ptr()) };
51
52            Ok(())
53        }
54    }
55
56    unsafe impl<___E>
57        ::fidl_next::EncodeOption<
58            ::fidl_next::wire::Box<'static, crate::wire::ConnectorConnectRequest>,
59            ___E,
60        > for ConnectorConnectRequest
61    where
62        ___E: ::fidl_next::Encoder + ?Sized,
63        ConnectorConnectRequest: ::fidl_next::Encode<crate::wire::ConnectorConnectRequest, ___E>,
64    {
65        #[inline]
66        fn encode_option(
67            this: ::core::option::Option<Self>,
68            encoder: &mut ___E,
69            out: &mut ::core::mem::MaybeUninit<
70                ::fidl_next::wire::Box<'static, crate::wire::ConnectorConnectRequest>,
71            >,
72            _: (),
73        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
74            if let Some(inner) = this {
75                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
76                ::fidl_next::wire::Box::encode_present(out);
77            } else {
78                ::fidl_next::wire::Box::encode_absent(out);
79            }
80
81            Ok(())
82        }
83    }
84
85    impl ::fidl_next::FromWire<crate::wire::ConnectorConnectRequest> for ConnectorConnectRequest {
86        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
87            crate::wire::ConnectorConnectRequest,
88            Self,
89        > = unsafe {
90            ::fidl_next::CopyOptimization::enable_if(
91                true && <::fidl_next::fuchsia::zx::Channel as ::fidl_next::FromWire<
92                    ::fidl_next::wire::fuchsia::Channel,
93                >>::COPY_OPTIMIZATION
94                    .is_enabled(),
95            )
96        };
97
98        #[inline]
99        fn from_wire(wire: crate::wire::ConnectorConnectRequest) -> Self {
100            Self { server: ::fidl_next::FromWire::from_wire(wire.server) }
101        }
102    }
103
104    #[derive(Debug, Default, PartialEq)]
105    pub struct DevfsAddArgs {
106        pub connector: ::core::option::Option<
107            ::fidl_next::ClientEnd<crate::Connector, ::fidl_next::fuchsia::zx::Channel>,
108        >,
109
110        pub class_name: ::core::option::Option<::std::string::String>,
111
112        pub inspect: ::core::option::Option<::fidl_next::fuchsia::zx::Vmo>,
113
114        pub connector_supports: ::core::option::Option<crate::natural::ConnectionType>,
115
116        pub controller_connector: ::core::option::Option<
117            ::fidl_next::ClientEnd<crate::Connector, ::fidl_next::fuchsia::zx::Channel>,
118        >,
119    }
120
121    impl DevfsAddArgs {
122        fn __max_ordinal(&self) -> usize {
123            if self.controller_connector.is_some() {
124                return 5;
125            }
126
127            if self.connector_supports.is_some() {
128                return 4;
129            }
130
131            if self.inspect.is_some() {
132                return 3;
133            }
134
135            if self.class_name.is_some() {
136                return 2;
137            }
138
139            if self.connector.is_some() {
140                return 1;
141            }
142
143            0
144        }
145    }
146
147    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DevfsAddArgs<'static>, ___E> for DevfsAddArgs
148    where
149        ___E: ::fidl_next::Encoder + ?Sized,
150        ___E: ::fidl_next::fuchsia::HandleEncoder,
151    {
152        #[inline]
153        fn encode(
154            mut self,
155            encoder: &mut ___E,
156            out: &mut ::core::mem::MaybeUninit<crate::wire::DevfsAddArgs<'static>>,
157            _: (),
158        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
159            ::fidl_next::munge!(let crate::wire::DevfsAddArgs { table } = out);
160
161            let max_ord = self.__max_ordinal();
162
163            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
164            ::fidl_next::Wire::zero_padding(&mut out);
165
166            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
167                ::fidl_next::wire::Envelope,
168            >(encoder, max_ord);
169
170            for i in 1..=max_ord {
171                match i {
172                    5 => {
173                        if let Some(value) = self.controller_connector.take() {
174                            ::fidl_next::wire::Envelope::encode_value::<
175                                ::fidl_next::ClientEnd<
176                                    crate::Connector,
177                                    ::fidl_next::wire::fuchsia::Channel,
178                                >,
179                                ___E,
180                            >(
181                                value, preallocated.encoder, &mut out, ()
182                            )?;
183                        } else {
184                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
185                        }
186                    }
187
188                    4 => {
189                        if let Some(value) = self.connector_supports.take() {
190                            ::fidl_next::wire::Envelope::encode_value::<
191                                crate::wire::ConnectionType,
192                                ___E,
193                            >(
194                                value, preallocated.encoder, &mut out, ()
195                            )?;
196                        } else {
197                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
198                        }
199                    }
200
201                    3 => {
202                        if let Some(value) = self.inspect.take() {
203                            ::fidl_next::wire::Envelope::encode_value::<
204                                ::fidl_next::wire::fuchsia::Vmo,
205                                ___E,
206                            >(
207                                value, preallocated.encoder, &mut out, ()
208                            )?;
209                        } else {
210                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
211                        }
212                    }
213
214                    2 => {
215                        if let Some(value) = self.class_name.take() {
216                            ::fidl_next::wire::Envelope::encode_value::<
217                                ::fidl_next::wire::String<'static>,
218                                ___E,
219                            >(
220                                value, preallocated.encoder, &mut out, 255
221                            )?;
222                        } else {
223                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
224                        }
225                    }
226
227                    1 => {
228                        if let Some(value) = self.connector.take() {
229                            ::fidl_next::wire::Envelope::encode_value::<
230                                ::fidl_next::ClientEnd<
231                                    crate::Connector,
232                                    ::fidl_next::wire::fuchsia::Channel,
233                                >,
234                                ___E,
235                            >(
236                                value, preallocated.encoder, &mut out, ()
237                            )?;
238                        } else {
239                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
240                        }
241                    }
242
243                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
244                }
245                unsafe {
246                    preallocated.write_next(out.assume_init_ref());
247                }
248            }
249
250            ::fidl_next::wire::Table::encode_len(table, max_ord);
251
252            Ok(())
253        }
254    }
255
256    impl<'de> ::fidl_next::FromWire<crate::wire::DevfsAddArgs<'de>> for DevfsAddArgs {
257        #[inline]
258        fn from_wire(wire_: crate::wire::DevfsAddArgs<'de>) -> Self {
259            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
260
261            let connector = wire_.table.get(1);
262
263            let class_name = wire_.table.get(2);
264
265            let inspect = wire_.table.get(3);
266
267            let connector_supports = wire_.table.get(4);
268
269            let controller_connector = wire_.table.get(5);
270
271            Self {
272                connector: connector.map(|envelope| {
273                    ::fidl_next::FromWire::from_wire(unsafe {
274                        envelope.read_unchecked::<::fidl_next::ClientEnd<
275                            crate::Connector,
276                            ::fidl_next::wire::fuchsia::Channel,
277                        >>()
278                    })
279                }),
280
281                class_name: class_name.map(|envelope| {
282                    ::fidl_next::FromWire::from_wire(unsafe {
283                        envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
284                    })
285                }),
286
287                inspect: inspect.map(|envelope| {
288                    ::fidl_next::FromWire::from_wire(unsafe {
289                        envelope.read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
290                    })
291                }),
292
293                connector_supports: connector_supports.map(|envelope| {
294                    ::fidl_next::FromWire::from_wire(unsafe {
295                        envelope.read_unchecked::<crate::wire::ConnectionType>()
296                    })
297                }),
298
299                controller_connector: controller_connector.map(|envelope| {
300                    ::fidl_next::FromWire::from_wire(unsafe {
301                        envelope.read_unchecked::<::fidl_next::ClientEnd<
302                            crate::Connector,
303                            ::fidl_next::wire::fuchsia::Channel,
304                        >>()
305                    })
306                }),
307            }
308        }
309    }
310}
311
312pub mod wire {
313
314    pub use fidl_next_common_fuchsia_device_fs::wire::*;
315
316    /// The wire type corresponding to [`ConnectorConnectRequest`].
317    #[derive(Debug)]
318    #[repr(C)]
319    pub struct ConnectorConnectRequest {
320        pub server: ::fidl_next::wire::fuchsia::Channel,
321    }
322
323    static_assertions::const_assert_eq!(std::mem::size_of::<ConnectorConnectRequest>(), 4);
324    static_assertions::const_assert_eq!(std::mem::align_of::<ConnectorConnectRequest>(), 4);
325
326    static_assertions::const_assert_eq!(std::mem::offset_of!(ConnectorConnectRequest, server), 0);
327
328    impl ::fidl_next::Constrained for ConnectorConnectRequest {
329        type Constraint = ();
330
331        fn validate(
332            _: ::fidl_next::Slot<'_, Self>,
333            _: Self::Constraint,
334        ) -> Result<(), ::fidl_next::ValidationError> {
335            Ok(())
336        }
337    }
338
339    unsafe impl ::fidl_next::Wire for ConnectorConnectRequest {
340        type Narrowed<'de> = ConnectorConnectRequest;
341
342        #[inline]
343        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
344            ::fidl_next::munge! {
345                let Self {
346                    server,
347
348                } = &mut *out_;
349            }
350
351            ::fidl_next::Wire::zero_padding(server);
352        }
353    }
354
355    unsafe impl<___D> ::fidl_next::Decode<___D> for ConnectorConnectRequest
356    where
357        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
358        ___D: ::fidl_next::fuchsia::HandleDecoder,
359    {
360        fn decode(
361            slot_: ::fidl_next::Slot<'_, Self>,
362            decoder_: &mut ___D,
363            _: (),
364        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
365            ::fidl_next::munge! {
366                let Self {
367                    mut server,
368
369                } = slot_;
370            }
371
372            let _field = server.as_mut();
373
374            ::fidl_next::Decode::decode(server.as_mut(), decoder_, ())?;
375
376            Ok(())
377        }
378    }
379
380    impl ::fidl_next::IntoNatural for ConnectorConnectRequest {
381        type Natural = crate::natural::ConnectorConnectRequest;
382    }
383
384    /// The wire type corresponding to [`DevfsAddArgs`].
385    #[repr(C)]
386    pub struct DevfsAddArgs<'de> {
387        pub(crate) table: ::fidl_next::wire::Table<'de>,
388    }
389
390    impl<'de> Drop for DevfsAddArgs<'de> {
391        fn drop(&mut self) {
392            let _ =
393                self.table.get(1).map(|envelope| unsafe {
394                    envelope.read_unchecked::<::fidl_next::ClientEnd<
395                        crate::Connector,
396                        ::fidl_next::wire::fuchsia::Channel,
397                    >>()
398                });
399
400            let _ = self.table.get(2).map(|envelope| unsafe {
401                envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
402            });
403
404            let _ = self.table.get(3).map(|envelope| unsafe {
405                envelope.read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
406            });
407
408            let _ = self.table.get(4).map(|envelope| unsafe {
409                envelope.read_unchecked::<crate::wire::ConnectionType>()
410            });
411
412            let _ =
413                self.table.get(5).map(|envelope| unsafe {
414                    envelope.read_unchecked::<::fidl_next::ClientEnd<
415                        crate::Connector,
416                        ::fidl_next::wire::fuchsia::Channel,
417                    >>()
418                });
419        }
420    }
421
422    impl ::fidl_next::Constrained for DevfsAddArgs<'_> {
423        type Constraint = ();
424
425        fn validate(
426            _: ::fidl_next::Slot<'_, Self>,
427            _: Self::Constraint,
428        ) -> Result<(), ::fidl_next::ValidationError> {
429            Ok(())
430        }
431    }
432
433    unsafe impl ::fidl_next::Wire for DevfsAddArgs<'static> {
434        type Narrowed<'de> = DevfsAddArgs<'de>;
435
436        #[inline]
437        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
438            ::fidl_next::munge!(let Self { table } = out);
439            ::fidl_next::wire::Table::zero_padding(table);
440        }
441    }
442
443    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DevfsAddArgs<'de>
444    where
445        ___D: ::fidl_next::Decoder<'de> + ?Sized,
446        ___D: ::fidl_next::fuchsia::HandleDecoder,
447    {
448        fn decode(
449            slot: ::fidl_next::Slot<'_, Self>,
450            decoder: &mut ___D,
451            _: (),
452        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
453            ::fidl_next::munge!(let Self { table } = slot);
454
455            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
456                match ordinal {
457                    0 => unsafe { ::core::hint::unreachable_unchecked() },
458
459                    1 => {
460                        ::fidl_next::wire::Envelope::decode_as::<
461                            ___D,
462                            ::fidl_next::ClientEnd<
463                                crate::Connector,
464                                ::fidl_next::wire::fuchsia::Channel,
465                            >,
466                        >(slot.as_mut(), decoder, ())?;
467
468                        Ok(())
469                    }
470
471                    2 => {
472                        ::fidl_next::wire::Envelope::decode_as::<
473                            ___D,
474                            ::fidl_next::wire::String<'de>,
475                        >(slot.as_mut(), decoder, 255)?;
476
477                        let value = unsafe {
478                            slot.deref_unchecked()
479                                .deref_unchecked::<::fidl_next::wire::String<'_>>()
480                        };
481
482                        if value.len() > 255 {
483                            return Err(::fidl_next::DecodeError::VectorTooLong {
484                                size: value.len() as u64,
485                                limit: 255,
486                            });
487                        }
488
489                        Ok(())
490                    }
491
492                    3 => {
493                        ::fidl_next::wire::Envelope::decode_as::<
494                            ___D,
495                            ::fidl_next::wire::fuchsia::Vmo,
496                        >(slot.as_mut(), decoder, ())?;
497
498                        Ok(())
499                    }
500
501                    4 => {
502                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::ConnectionType>(
503                            slot.as_mut(),
504                            decoder,
505                            (),
506                        )?;
507
508                        Ok(())
509                    }
510
511                    5 => {
512                        ::fidl_next::wire::Envelope::decode_as::<
513                            ___D,
514                            ::fidl_next::ClientEnd<
515                                crate::Connector,
516                                ::fidl_next::wire::fuchsia::Channel,
517                            >,
518                        >(slot.as_mut(), decoder, ())?;
519
520                        Ok(())
521                    }
522
523                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
524                }
525            })
526        }
527    }
528
529    impl<'de> DevfsAddArgs<'de> {
530        pub fn connector(
531            &self,
532        ) -> ::core::option::Option<
533            &::fidl_next::ClientEnd<crate::Connector, ::fidl_next::wire::fuchsia::Channel>,
534        > {
535            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
536        }
537
538        pub fn take_connector(
539            &mut self,
540        ) -> ::core::option::Option<
541            ::fidl_next::ClientEnd<crate::Connector, ::fidl_next::wire::fuchsia::Channel>,
542        > {
543            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
544        }
545
546        pub fn class_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
547            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
548        }
549
550        pub fn take_class_name(
551            &mut self,
552        ) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
553            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
554        }
555
556        pub fn inspect(&self) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Vmo> {
557            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
558        }
559
560        pub fn take_inspect(&mut self) -> ::core::option::Option<::fidl_next::wire::fuchsia::Vmo> {
561            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
562        }
563
564        pub fn connector_supports(&self) -> ::core::option::Option<&crate::wire::ConnectionType> {
565            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
566        }
567
568        pub fn take_connector_supports(
569            &mut self,
570        ) -> ::core::option::Option<crate::wire::ConnectionType> {
571            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
572        }
573
574        pub fn controller_connector(
575            &self,
576        ) -> ::core::option::Option<
577            &::fidl_next::ClientEnd<crate::Connector, ::fidl_next::wire::fuchsia::Channel>,
578        > {
579            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
580        }
581
582        pub fn take_controller_connector(
583            &mut self,
584        ) -> ::core::option::Option<
585            ::fidl_next::ClientEnd<crate::Connector, ::fidl_next::wire::fuchsia::Channel>,
586        > {
587            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
588        }
589    }
590
591    impl<'de> ::core::fmt::Debug for DevfsAddArgs<'de> {
592        fn fmt(
593            &self,
594            f: &mut ::core::fmt::Formatter<'_>,
595        ) -> ::core::result::Result<(), ::core::fmt::Error> {
596            f.debug_struct("DevfsAddArgs")
597                .field("connector", &self.connector())
598                .field("class_name", &self.class_name())
599                .field("inspect", &self.inspect())
600                .field("connector_supports", &self.connector_supports())
601                .field("controller_connector", &self.controller_connector())
602                .finish()
603        }
604    }
605
606    impl<'de> ::fidl_next::IntoNatural for DevfsAddArgs<'de> {
607        type Natural = crate::natural::DevfsAddArgs;
608    }
609}
610
611pub mod wire_optional {
612
613    pub use fidl_next_common_fuchsia_device_fs::wire_optional::*;
614}
615
616pub mod generic {
617
618    pub use fidl_next_common_fuchsia_device_fs::generic::*;
619
620    /// The generic type corresponding to [`ConnectorConnectRequest`].
621    pub struct ConnectorConnectRequest<T0> {
622        pub server: T0,
623    }
624
625    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ConnectorConnectRequest, ___E>
626        for ConnectorConnectRequest<T0>
627    where
628        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
629        ___E: ::fidl_next::fuchsia::HandleEncoder,
630        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Channel, ___E>,
631    {
632        #[inline]
633        fn encode(
634            self,
635            encoder_: &mut ___E,
636            out_: &mut ::core::mem::MaybeUninit<crate::wire::ConnectorConnectRequest>,
637            _: (),
638        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
639            ::fidl_next::munge! {
640                let crate::wire::ConnectorConnectRequest {
641                    server,
642
643                } = out_;
644            }
645
646            ::fidl_next::Encode::encode(self.server, encoder_, server, ())?;
647
648            Ok(())
649        }
650    }
651}
652
653pub use self::natural::*;
654
655/// The type corresponding to the Connector protocol.
656#[doc = " A connector lets a client forward the server end of a protocol.\n"]
657#[derive(PartialEq, Debug)]
658pub struct Connector;
659
660#[cfg(target_os = "fuchsia")]
661impl ::fidl_next::HasTransport for Connector {
662    type Transport = ::fidl_next::fuchsia::zx::Channel;
663}
664
665pub mod connector {
666    pub mod prelude {
667        pub use crate::{
668            Connector, ConnectorClientHandler, ConnectorLocalClientHandler,
669            ConnectorLocalServerHandler, ConnectorServerHandler, connector,
670        };
671
672        pub use crate::natural::ConnectorConnectRequest;
673    }
674
675    pub struct Connect;
676
677    impl ::fidl_next::Method for Connect {
678        const ORDINAL: u64 = 3169778387179902201;
679        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
680            ::fidl_next::protocol::Flexibility::Strict;
681
682        type Protocol = crate::Connector;
683
684        type Request = crate::wire::ConnectorConnectRequest;
685    }
686
687    mod ___detail {
688        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Connector
689        where
690            ___T: ::fidl_next::Transport,
691        {
692            type Client = ConnectorClient<___T>;
693            type Server = ConnectorServer<___T>;
694        }
695
696        /// The client for the `Connector` protocol.
697        #[repr(transparent)]
698        pub struct ConnectorClient<___T: ::fidl_next::Transport> {
699            #[allow(dead_code)]
700            client: ::fidl_next::protocol::Client<___T>,
701        }
702
703        impl<___T> ConnectorClient<___T>
704        where
705            ___T: ::fidl_next::Transport,
706        {
707            #[doc = " Forward a server end of a protocol so that it can be connected.\n + request `server` the server end of the protocol to be served. The FIDL protocol that\n     this speaks is determined out-of-band.\n - response This function has no response. The function is one-way to match the pipelining\n     behaviors of other virtual filesystems.\n"]
708            pub fn connect(
709                &self,
710
711                server: impl ::fidl_next::Encode<
712                    ::fidl_next::wire::fuchsia::Channel,
713                    <___T as ::fidl_next::Transport>::SendBuffer,
714                >,
715            ) -> ::fidl_next::SendFuture<'_, ___T>
716            where
717                <___T as ::fidl_next::Transport>::SendBuffer:
718                    ::fidl_next::encoder::InternalHandleEncoder,
719                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
720            {
721                self.connect_with(crate::generic::ConnectorConnectRequest { server })
722            }
723
724            #[doc = " Forward a server end of a protocol so that it can be connected.\n + request `server` the server end of the protocol to be served. The FIDL protocol that\n     this speaks is determined out-of-band.\n - response This function has no response. The function is one-way to match the pipelining\n     behaviors of other virtual filesystems.\n"]
725            pub fn connect_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
726            where
727                ___R: ::fidl_next::Encode<
728                        crate::wire::ConnectorConnectRequest,
729                        <___T as ::fidl_next::Transport>::SendBuffer,
730                    >,
731            {
732                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
733                    3169778387179902201,
734                    <super::Connect as ::fidl_next::Method>::FLEXIBILITY,
735                    request,
736                ))
737            }
738        }
739
740        /// The server for the `Connector` protocol.
741        #[repr(transparent)]
742        pub struct ConnectorServer<___T: ::fidl_next::Transport> {
743            server: ::fidl_next::protocol::Server<___T>,
744        }
745
746        impl<___T> ConnectorServer<___T> where ___T: ::fidl_next::Transport {}
747    }
748}
749
750#[diagnostic::on_unimplemented(
751    note = "If {Self} implements the non-local ConnectorClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
752)]
753
754/// A client handler for the Connector protocol.
755///
756/// See [`Connector`] for more details.
757pub trait ConnectorLocalClientHandler<
758    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
759    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
760>
761{
762}
763
764impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Connector
765where
766    ___H: ConnectorLocalClientHandler<___T>,
767    ___T: ::fidl_next::Transport,
768{
769    async fn on_event(
770        handler: &mut ___H,
771        mut message: ::fidl_next::Message<___T>,
772    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
773        match *message.header().ordinal {
774            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
775        }
776    }
777}
778
779#[diagnostic::on_unimplemented(
780    note = "If {Self} implements the non-local ConnectorServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
781)]
782
783/// A server handler for the Connector protocol.
784///
785/// See [`Connector`] for more details.
786pub trait ConnectorLocalServerHandler<
787    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
788    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
789>
790{
791    #[doc = " Forward a server end of a protocol so that it can be connected.\n + request `server` the server end of the protocol to be served. The FIDL protocol that\n     this speaks is determined out-of-band.\n - response This function has no response. The function is one-way to match the pipelining\n     behaviors of other virtual filesystems.\n"]
792    fn connect(
793        &mut self,
794
795        request: ::fidl_next::Request<connector::Connect, ___T>,
796    ) -> impl ::core::future::Future<Output = ()>;
797}
798
799impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Connector
800where
801    ___H: ConnectorLocalServerHandler<___T>,
802    ___T: ::fidl_next::Transport,
803    for<'de> crate::wire::ConnectorConnectRequest: ::fidl_next::Decode<
804            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
805            Constraint = (),
806        >,
807{
808    async fn on_one_way(
809        handler: &mut ___H,
810        mut message: ::fidl_next::Message<___T>,
811    ) -> ::core::result::Result<
812        (),
813        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
814    > {
815        match *message.header().ordinal {
816            3169778387179902201 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
817                Ok(decoded) => {
818                    handler.connect(::fidl_next::Request::from_decoded(decoded)).await;
819                    Ok(())
820                }
821                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
822                    ordinal: 3169778387179902201,
823                    error,
824                }),
825            },
826
827            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
828        }
829    }
830
831    async fn on_two_way(
832        handler: &mut ___H,
833        mut message: ::fidl_next::Message<___T>,
834        responder: ::fidl_next::protocol::Responder<___T>,
835    ) -> ::core::result::Result<
836        (),
837        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
838    > {
839        match *message.header().ordinal {
840            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
841        }
842    }
843}
844
845/// A client handler for the Connector protocol.
846///
847/// See [`Connector`] for more details.
848pub trait ConnectorClientHandler<
849    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
850    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
851>
852{
853}
854
855impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Connector
856where
857    ___H: ConnectorClientHandler<___T> + ::core::marker::Send,
858    ___T: ::fidl_next::Transport,
859{
860    async fn on_event(
861        handler: &mut ___H,
862        mut message: ::fidl_next::Message<___T>,
863    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
864        match *message.header().ordinal {
865            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
866        }
867    }
868}
869
870/// A server handler for the Connector protocol.
871///
872/// See [`Connector`] for more details.
873pub trait ConnectorServerHandler<
874    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
875    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
876>
877{
878    #[doc = " Forward a server end of a protocol so that it can be connected.\n + request `server` the server end of the protocol to be served. The FIDL protocol that\n     this speaks is determined out-of-band.\n - response This function has no response. The function is one-way to match the pipelining\n     behaviors of other virtual filesystems.\n"]
879    fn connect(
880        &mut self,
881
882        request: ::fidl_next::Request<connector::Connect, ___T>,
883    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
884}
885
886impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Connector
887where
888    ___H: ConnectorServerHandler<___T> + ::core::marker::Send,
889    ___T: ::fidl_next::Transport,
890    for<'de> crate::wire::ConnectorConnectRequest: ::fidl_next::Decode<
891            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
892            Constraint = (),
893        >,
894{
895    async fn on_one_way(
896        handler: &mut ___H,
897        mut message: ::fidl_next::Message<___T>,
898    ) -> ::core::result::Result<
899        (),
900        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
901    > {
902        match *message.header().ordinal {
903            3169778387179902201 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
904                Ok(decoded) => {
905                    handler.connect(::fidl_next::Request::from_decoded(decoded)).await;
906                    Ok(())
907                }
908                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
909                    ordinal: 3169778387179902201,
910                    error,
911                }),
912            },
913
914            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
915        }
916    }
917
918    async fn on_two_way(
919        handler: &mut ___H,
920        mut message: ::fidl_next::Message<___T>,
921        responder: ::fidl_next::protocol::Responder<___T>,
922    ) -> ::core::result::Result<
923        (),
924        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
925    > {
926        match *message.header().ordinal {
927            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
928        }
929    }
930}
931
932impl<___T> ConnectorClientHandler<___T> for ::fidl_next::IgnoreEvents where
933    ___T: ::fidl_next::Transport
934{
935}
936
937impl<___H, ___T> ConnectorLocalClientHandler<___T> for ::fidl_next::Local<___H>
938where
939    ___H: ConnectorClientHandler<___T>,
940    ___T: ::fidl_next::Transport,
941{
942}
943
944impl<___H, ___T> ConnectorLocalServerHandler<___T> for ::fidl_next::Local<___H>
945where
946    ___H: ConnectorServerHandler<___T>,
947    ___T: ::fidl_next::Transport,
948{
949    async fn connect(&mut self, request: ::fidl_next::Request<connector::Connect, ___T>) {
950        ___H::connect(&mut self.0, request).await
951    }
952}
953
954pub use fidl_next_common_fuchsia_device_fs::*;