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(PartialEq, Debug)]
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::fuchsia::WireChannel,
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::WireBox<'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::WireBox<'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::WireBox::encode_present(out);
77            } else {
78                ::fidl_next::WireBox::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::fuchsia::WireChannel,
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(PartialEq, Debug, Default)]
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::WireEnvelope>::uninit();
164            ::fidl_next::Wire::zero_padding(&mut out);
165
166            let mut preallocated =
167                ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
168
169            for i in 1..=max_ord {
170                match i {
171                    5 => {
172                        if let Some(value) = self.controller_connector.take() {
173                            ::fidl_next::WireEnvelope::encode_value::<
174                                ::fidl_next::ClientEnd<
175                                    crate::Connector,
176                                    ::fidl_next::fuchsia::WireChannel,
177                                >,
178                                ___E,
179                            >(
180                                value, preallocated.encoder, &mut out, ()
181                            )?;
182                        } else {
183                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
184                        }
185                    }
186
187                    4 => {
188                        if let Some(value) = self.connector_supports.take() {
189                            ::fidl_next::WireEnvelope::encode_value::<
190                                crate::wire::ConnectionType,
191                                ___E,
192                            >(
193                                value, preallocated.encoder, &mut out, ()
194                            )?;
195                        } else {
196                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
197                        }
198                    }
199
200                    3 => {
201                        if let Some(value) = self.inspect.take() {
202                            ::fidl_next::WireEnvelope::encode_value::<
203                                ::fidl_next::fuchsia::WireVmo,
204                                ___E,
205                            >(
206                                value, preallocated.encoder, &mut out, ()
207                            )?;
208                        } else {
209                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
210                        }
211                    }
212
213                    2 => {
214                        if let Some(value) = self.class_name.take() {
215                            ::fidl_next::WireEnvelope::encode_value::<
216                                ::fidl_next::WireString<'static>,
217                                ___E,
218                            >(
219                                value, preallocated.encoder, &mut out, 255
220                            )?;
221                        } else {
222                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
223                        }
224                    }
225
226                    1 => {
227                        if let Some(value) = self.connector.take() {
228                            ::fidl_next::WireEnvelope::encode_value::<
229                                ::fidl_next::ClientEnd<
230                                    crate::Connector,
231                                    ::fidl_next::fuchsia::WireChannel,
232                                >,
233                                ___E,
234                            >(
235                                value, preallocated.encoder, &mut out, ()
236                            )?;
237                        } else {
238                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
239                        }
240                    }
241
242                    _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
243                }
244                unsafe {
245                    preallocated.write_next(out.assume_init_ref());
246                }
247            }
248
249            ::fidl_next::WireTable::encode_len(table, max_ord);
250
251            Ok(())
252        }
253    }
254
255    impl<'de> ::fidl_next::FromWire<crate::wire::DevfsAddArgs<'de>> for DevfsAddArgs {
256        #[inline]
257        fn from_wire(wire_: crate::wire::DevfsAddArgs<'de>) -> Self {
258            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
259
260            let connector = wire_.table.get(1);
261
262            let class_name = wire_.table.get(2);
263
264            let inspect = wire_.table.get(3);
265
266            let connector_supports = wire_.table.get(4);
267
268            let controller_connector = wire_.table.get(5);
269
270            Self {
271                connector: connector.map(|envelope| {
272                    ::fidl_next::FromWire::from_wire(unsafe {
273                        envelope.read_unchecked::<::fidl_next::ClientEnd<
274                            crate::Connector,
275                            ::fidl_next::fuchsia::WireChannel,
276                        >>()
277                    })
278                }),
279
280                class_name: class_name.map(|envelope| {
281                    ::fidl_next::FromWire::from_wire(unsafe {
282                        envelope.read_unchecked::<::fidl_next::WireString<'de>>()
283                    })
284                }),
285
286                inspect: inspect.map(|envelope| {
287                    ::fidl_next::FromWire::from_wire(unsafe {
288                        envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>()
289                    })
290                }),
291
292                connector_supports: connector_supports.map(|envelope| {
293                    ::fidl_next::FromWire::from_wire(unsafe {
294                        envelope.read_unchecked::<crate::wire::ConnectionType>()
295                    })
296                }),
297
298                controller_connector: controller_connector.map(|envelope| {
299                    ::fidl_next::FromWire::from_wire(unsafe {
300                        envelope.read_unchecked::<::fidl_next::ClientEnd<
301                            crate::Connector,
302                            ::fidl_next::fuchsia::WireChannel,
303                        >>()
304                    })
305                }),
306            }
307        }
308    }
309}
310
311pub mod wire {
312
313    pub use fidl_next_common_fuchsia_device_fs::wire::*;
314
315    /// The wire type corresponding to [`ConnectorConnectRequest`].
316    #[derive(Debug)]
317    #[repr(C)]
318    pub struct ConnectorConnectRequest {
319        pub server: ::fidl_next::fuchsia::WireChannel,
320    }
321
322    static_assertions::const_assert_eq!(std::mem::size_of::<ConnectorConnectRequest>(), 4);
323    static_assertions::const_assert_eq!(std::mem::align_of::<ConnectorConnectRequest>(), 4);
324
325    static_assertions::const_assert_eq!(std::mem::offset_of!(ConnectorConnectRequest, server), 0);
326
327    unsafe impl ::fidl_next::Wire for ConnectorConnectRequest {
328        type Owned<'de> = ConnectorConnectRequest;
329
330        #[inline]
331        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
332            ::fidl_next::munge! {
333                let Self {
334
335                    server,
336
337                } = &mut *out_;
338            }
339
340            ::fidl_next::Wire::zero_padding(server);
341        }
342    }
343
344    unsafe impl<___D> ::fidl_next::Decode<___D> for ConnectorConnectRequest
345    where
346        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
347        ___D: ::fidl_next::fuchsia::HandleDecoder,
348    {
349        fn decode(
350            slot_: ::fidl_next::Slot<'_, Self>,
351            decoder_: &mut ___D,
352            _: (),
353        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
354            ::fidl_next::munge! {
355                let Self {
356
357                    mut server,
358
359                } = slot_;
360            }
361
362            let _field = server.as_mut();
363
364            ::fidl_next::Decode::decode(server.as_mut(), decoder_, ())?;
365
366            Ok(())
367        }
368    }
369
370    impl ::fidl_next::IntoNatural for ConnectorConnectRequest {
371        type Natural = crate::natural::ConnectorConnectRequest;
372    }
373
374    impl ::fidl_next::Unconstrained for ConnectorConnectRequest {}
375
376    /// The wire type corresponding to [`DevfsAddArgs`].
377    #[repr(C)]
378    pub struct DevfsAddArgs<'de> {
379        pub(crate) table: ::fidl_next::WireTable<'de>,
380    }
381
382    impl<'de> Drop for DevfsAddArgs<'de> {
383        fn drop(&mut self) {
384            let _ = self.table.get(1)
385                .map(|envelope| unsafe {
386                    envelope.read_unchecked::<::fidl_next::ClientEnd<crate::Connector, ::fidl_next::fuchsia::WireChannel>>()
387                });
388
389            let _ = self.table.get(2).map(|envelope| unsafe {
390                envelope.read_unchecked::<::fidl_next::WireString<'de>>()
391            });
392
393            let _ = self.table.get(3).map(|envelope| unsafe {
394                envelope.read_unchecked::<::fidl_next::fuchsia::WireVmo>()
395            });
396
397            let _ = self.table.get(4).map(|envelope| unsafe {
398                envelope.read_unchecked::<crate::wire::ConnectionType>()
399            });
400
401            let _ = self.table.get(5)
402                .map(|envelope| unsafe {
403                    envelope.read_unchecked::<::fidl_next::ClientEnd<crate::Connector, ::fidl_next::fuchsia::WireChannel>>()
404                });
405        }
406    }
407
408    unsafe impl ::fidl_next::Wire for DevfsAddArgs<'static> {
409        type Owned<'de> = DevfsAddArgs<'de>;
410
411        #[inline]
412        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
413            ::fidl_next::munge!(let Self { table } = out);
414            ::fidl_next::WireTable::zero_padding(table);
415        }
416    }
417
418    unsafe impl<___D> ::fidl_next::Decode<___D> for DevfsAddArgs<'static>
419    where
420        ___D: ::fidl_next::Decoder + ?Sized,
421        ___D: ::fidl_next::fuchsia::HandleDecoder,
422    {
423        fn decode(
424            slot: ::fidl_next::Slot<'_, Self>,
425            decoder: &mut ___D,
426            _: (),
427        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
428            ::fidl_next::munge!(let Self { table } = slot);
429
430            ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
431                match ordinal {
432                    0 => unsafe { ::core::hint::unreachable_unchecked() },
433
434                    1 => {
435                        ::fidl_next::WireEnvelope::decode_as::<
436                            ___D,
437                            ::fidl_next::ClientEnd<
438                                crate::Connector,
439                                ::fidl_next::fuchsia::WireChannel,
440                            >,
441                        >(slot.as_mut(), decoder, ())?;
442
443                        Ok(())
444                    }
445
446                    2 => {
447                        ::fidl_next::WireEnvelope::decode_as::<
448                            ___D,
449                            ::fidl_next::WireString<'static>,
450                        >(slot.as_mut(), decoder, 255)?;
451
452                        let value = unsafe {
453                            slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
454                        };
455
456                        if value.len() > 255 {
457                            return Err(::fidl_next::DecodeError::VectorTooLong {
458                                size: value.len() as u64,
459                                limit: 255,
460                            });
461                        }
462
463                        Ok(())
464                    }
465
466                    3 => {
467                        ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireVmo>(
468                            slot.as_mut(),
469                            decoder,
470                            (),
471                        )?;
472
473                        Ok(())
474                    }
475
476                    4 => {
477                        ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::ConnectionType>(
478                            slot.as_mut(),
479                            decoder,
480                            (),
481                        )?;
482
483                        Ok(())
484                    }
485
486                    5 => {
487                        ::fidl_next::WireEnvelope::decode_as::<
488                            ___D,
489                            ::fidl_next::ClientEnd<
490                                crate::Connector,
491                                ::fidl_next::fuchsia::WireChannel,
492                            >,
493                        >(slot.as_mut(), decoder, ())?;
494
495                        Ok(())
496                    }
497
498                    _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
499                }
500            })
501        }
502    }
503
504    impl<'de> DevfsAddArgs<'de> {
505        pub fn connector(
506            &self,
507        ) -> ::core::option::Option<
508            &::fidl_next::ClientEnd<crate::Connector, ::fidl_next::fuchsia::WireChannel>,
509        > {
510            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
511        }
512
513        pub fn class_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
514            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
515        }
516
517        pub fn inspect(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireVmo> {
518            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
519        }
520
521        pub fn connector_supports(&self) -> ::core::option::Option<&crate::wire::ConnectionType> {
522            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
523        }
524
525        pub fn controller_connector(
526            &self,
527        ) -> ::core::option::Option<
528            &::fidl_next::ClientEnd<crate::Connector, ::fidl_next::fuchsia::WireChannel>,
529        > {
530            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
531        }
532    }
533
534    impl<'de> ::core::fmt::Debug for DevfsAddArgs<'de> {
535        fn fmt(
536            &self,
537            f: &mut ::core::fmt::Formatter<'_>,
538        ) -> ::core::result::Result<(), ::core::fmt::Error> {
539            f.debug_struct("DevfsAddArgs")
540                .field("connector", &self.connector())
541                .field("class_name", &self.class_name())
542                .field("inspect", &self.inspect())
543                .field("connector_supports", &self.connector_supports())
544                .field("controller_connector", &self.controller_connector())
545                .finish()
546        }
547    }
548
549    impl<'de> ::fidl_next::IntoNatural for DevfsAddArgs<'de> {
550        type Natural = crate::natural::DevfsAddArgs;
551    }
552
553    impl ::fidl_next::Unconstrained for DevfsAddArgs<'_> {}
554}
555
556pub mod wire_optional {
557
558    pub use fidl_next_common_fuchsia_device_fs::wire_optional::*;
559}
560
561pub mod generic {
562
563    pub use fidl_next_common_fuchsia_device_fs::generic::*;
564
565    pub struct ConnectorConnectRequest<T0> {
566        pub server: T0,
567    }
568
569    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ConnectorConnectRequest, ___E>
570        for ConnectorConnectRequest<T0>
571    where
572        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
573        ___E: ::fidl_next::fuchsia::HandleEncoder,
574        T0: ::fidl_next::Encode<::fidl_next::fuchsia::WireChannel, ___E>,
575    {
576        #[inline]
577        fn encode(
578            self,
579            encoder_: &mut ___E,
580            out_: &mut ::core::mem::MaybeUninit<crate::wire::ConnectorConnectRequest>,
581            _: (),
582        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
583            ::fidl_next::munge! {
584                let crate::wire::ConnectorConnectRequest {
585
586                    server,
587
588                } = out_;
589            }
590
591            ::fidl_next::Encode::encode(self.server, encoder_, server, ())?;
592
593            Ok(())
594        }
595    }
596}
597
598pub use self::natural::*;
599
600/// The type corresponding to the Connector protocol.
601#[doc = " A connector lets a client forward the server end of a protocol.\n"]
602#[derive(PartialEq, Debug)]
603pub struct Connector;
604
605#[cfg(target_os = "fuchsia")]
606impl ::fidl_next::HasTransport for Connector {
607    type Transport = ::fidl_next::fuchsia::zx::Channel;
608}
609
610pub mod connector {
611    pub mod prelude {
612        pub use crate::{Connector, ConnectorClientHandler, ConnectorServerHandler, connector};
613
614        pub use crate::natural::ConnectorConnectRequest;
615    }
616
617    pub struct Connect;
618
619    impl ::fidl_next::Method for Connect {
620        const ORDINAL: u64 = 3169778387179902201;
621        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
622            ::fidl_next::protocol::Flexibility::Strict;
623
624        type Protocol = crate::Connector;
625
626        type Request = crate::wire::ConnectorConnectRequest;
627    }
628
629    mod ___detail {
630        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Connector
631        where
632            ___T: ::fidl_next::Transport,
633        {
634            type Client = ConnectorClient<___T>;
635            type Server = ConnectorServer<___T>;
636        }
637
638        /// The client for the `Connector` protocol.
639        #[repr(transparent)]
640        pub struct ConnectorClient<___T: ::fidl_next::Transport> {
641            #[allow(dead_code)]
642            client: ::fidl_next::protocol::Client<___T>,
643        }
644
645        impl<___T> ConnectorClient<___T>
646        where
647            ___T: ::fidl_next::Transport,
648        {
649            #[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"]
650            pub fn connect(
651                &self,
652
653                server: impl ::fidl_next::Encode<
654                    ::fidl_next::fuchsia::WireChannel,
655                    <___T as ::fidl_next::Transport>::SendBuffer,
656                >,
657            ) -> ::fidl_next::SendFuture<'_, ___T>
658            where
659                <___T as ::fidl_next::Transport>::SendBuffer:
660                    ::fidl_next::encoder::InternalHandleEncoder,
661                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
662            {
663                self.connect_with(crate::generic::ConnectorConnectRequest { server })
664            }
665
666            #[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"]
667            pub fn connect_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
668            where
669                ___R: ::fidl_next::Encode<
670                        crate::wire::ConnectorConnectRequest,
671                        <___T as ::fidl_next::Transport>::SendBuffer,
672                    >,
673            {
674                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
675                    3169778387179902201,
676                    <super::Connect as ::fidl_next::Method>::FLEXIBILITY,
677                    request,
678                ))
679            }
680        }
681
682        /// The server for the `Connector` protocol.
683        #[repr(transparent)]
684        pub struct ConnectorServer<___T: ::fidl_next::Transport> {
685            server: ::fidl_next::protocol::Server<___T>,
686        }
687
688        impl<___T> ConnectorServer<___T> where ___T: ::fidl_next::Transport {}
689    }
690}
691
692/// A client handler for the Connector protocol.
693///
694/// See [`Connector`] for more details.
695pub trait ConnectorClientHandler<
696    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
697    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
698>
699{
700}
701
702impl<___T> ConnectorClientHandler<___T> for ::fidl_next::IgnoreEvents where
703    ___T: ::fidl_next::Transport
704{
705}
706
707impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Connector
708where
709    ___H: ConnectorClientHandler<___T> + ::core::marker::Send,
710    ___T: ::fidl_next::Transport,
711{
712    async fn on_event(
713        handler: &mut ___H,
714        ordinal: u64,
715        flexibility: ::fidl_next::protocol::Flexibility,
716        buffer: ___T::RecvBuffer,
717    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
718        match ordinal {
719            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
720        }
721    }
722}
723
724/// A server handler for the Connector protocol.
725///
726/// See [`Connector`] for more details.
727pub trait ConnectorServerHandler<
728    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
729    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
730>
731{
732    #[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"]
733    fn connect(
734        &mut self,
735
736        request: ::fidl_next::Request<connector::Connect, ___T>,
737    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
738}
739
740impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Connector
741where
742    ___H: ConnectorServerHandler<___T> + ::core::marker::Send,
743    ___T: ::fidl_next::Transport,
744    <connector::Connect as ::fidl_next::Method>::Request:
745        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
746{
747    async fn on_one_way(
748        handler: &mut ___H,
749        ordinal: u64,
750        flexibility: ::fidl_next::protocol::Flexibility,
751        buffer: ___T::RecvBuffer,
752    ) -> ::core::result::Result<
753        (),
754        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
755    > {
756        match ordinal {
757            3169778387179902201 => match ::fidl_next::DecoderExt::decode(buffer) {
758                Ok(decoded) => {
759                    handler.connect(::fidl_next::Request::from_decoded(decoded)).await;
760                    Ok(())
761                }
762                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
763                    ordinal: 3169778387179902201,
764                    error,
765                }),
766            },
767
768            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
769        }
770    }
771
772    async fn on_two_way(
773        handler: &mut ___H,
774        ordinal: u64,
775        flexibility: ::fidl_next::protocol::Flexibility,
776        buffer: ___T::RecvBuffer,
777        responder: ::fidl_next::protocol::Responder<___T>,
778    ) -> ::core::result::Result<
779        (),
780        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
781    > {
782        match ordinal {
783            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
784        }
785    }
786}
787
788pub use fidl_next_common_fuchsia_device_fs::*;
789
790/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
791pub mod compat {
792
793    pub use fidl_next_common_fuchsia_device_fs::compat::*;
794
795    impl ::fidl_next::CompatFrom<crate::ConnectorConnectRequest>
796        for ::fidl_fuchsia_device_fs::ConnectorConnectRequest
797    {
798        #[inline]
799        fn compat_from(value: crate::ConnectorConnectRequest) -> Self {
800            Self { server: ::fidl_next::CompatFrom::compat_from(value.server) }
801        }
802    }
803
804    impl ::fidl_next::CompatFrom<::fidl_fuchsia_device_fs::ConnectorConnectRequest>
805        for crate::ConnectorConnectRequest
806    {
807        #[inline]
808        fn compat_from(value: ::fidl_fuchsia_device_fs::ConnectorConnectRequest) -> Self {
809            Self { server: ::fidl_next::CompatFrom::compat_from(value.server) }
810        }
811    }
812
813    #[cfg(target_os = "fuchsia")]
814    /// An alias for a client over `zx::Channel` for the `Connector`
815    /// protocol.
816    pub type ConnectorProxy = ::fidl_next::Client<crate::Connector>;
817
818    impl ::fidl_next::CompatFrom<crate::Connector> for ::fidl_fuchsia_device_fs::ConnectorMarker {
819        fn compat_from(_: crate::Connector) -> Self {
820            Self
821        }
822    }
823
824    impl ::fidl_next::CompatFrom<::fidl_fuchsia_device_fs::ConnectorMarker> for crate::Connector {
825        fn compat_from(_: ::fidl_fuchsia_device_fs::ConnectorMarker) -> Self {
826            Self
827        }
828    }
829
830    #[cfg(target_os = "fuchsia")]
831
832    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_device_fs::ConnectorProxy> for crate::Connector {
833        fn client_compat_from(
834            proxy: ::fidl_fuchsia_device_fs::ConnectorProxy,
835        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
836            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
837            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
838            ::fidl_next::ClientDispatcher::new(client_end)
839        }
840    }
841
842    impl ::fidl_next::CompatFrom<crate::DevfsAddArgs> for ::fidl_fuchsia_device_fs::DevfsAddArgs {
843        fn compat_from(value: crate::DevfsAddArgs) -> Self {
844            Self {
845                connector: ::fidl_next::CompatFrom::compat_from(value.connector),
846
847                class_name: ::fidl_next::CompatFrom::compat_from(value.class_name),
848
849                inspect: ::fidl_next::CompatFrom::compat_from(value.inspect),
850
851                connector_supports: ::fidl_next::CompatFrom::compat_from(value.connector_supports),
852
853                controller_connector: ::fidl_next::CompatFrom::compat_from(
854                    value.controller_connector,
855                ),
856
857                __source_breaking: ::fidl::marker::SourceBreaking,
858            }
859        }
860    }
861
862    impl ::fidl_next::CompatFrom<::fidl_fuchsia_device_fs::DevfsAddArgs> for crate::DevfsAddArgs {
863        fn compat_from(value: ::fidl_fuchsia_device_fs::DevfsAddArgs) -> Self {
864            Self {
865                connector: ::fidl_next::CompatFrom::compat_from(value.connector),
866
867                class_name: ::fidl_next::CompatFrom::compat_from(value.class_name),
868
869                inspect: ::fidl_next::CompatFrom::compat_from(value.inspect),
870
871                connector_supports: ::fidl_next::CompatFrom::compat_from(value.connector_supports),
872
873                controller_connector: ::fidl_next::CompatFrom::compat_from(
874                    value.controller_connector,
875                ),
876            }
877        }
878    }
879}