1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5::fidl_next::bitflags! {
6 #[derive(
7 Clone,
8 Copy,
9 Debug,
10 PartialEq,
11 Eq,
12 Hash,
13 )]
14 pub struct ConnectionType: u8 {
15 #[doc = " Represents the fuchsia.io/Node protocol.\n"]const NODE = 1;
16 #[doc = " Represents the fuchsia.device/Controller protocol.\n"]const CONTROLLER = 2;
17 #[doc = " Represents the device specific FIDL.\n"]const DEVICE = 4;
18 const _ = !0;
19 }
20}
21
22impl ::fidl_next::Encodable for ConnectionType {
23 type Encoded = WireConnectionType;
24}
25
26unsafe impl<___E> ::fidl_next::Encode<___E> for ConnectionType
27where
28 ___E: ?Sized,
29{
30 #[inline]
31 fn encode(
32 &mut self,
33 _: &mut ___E,
34 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
35 ) -> Result<(), ::fidl_next::EncodeError> {
36 ::fidl_next::munge!(let WireConnectionType { value } = out);
37 let _ = value.write(u8::from(self.bits()));
38 Ok(())
39 }
40}
41
42impl ::core::convert::From<WireConnectionType> for ConnectionType {
43 fn from(wire: WireConnectionType) -> Self {
44 Self::from_bits_retain(u8::from(wire.value))
45 }
46}
47
48impl ::fidl_next::TakeFrom<WireConnectionType> for ConnectionType {
49 #[inline]
50 fn take_from(from: &WireConnectionType) -> Self {
51 Self::from(*from)
52 }
53}
54
55#[derive(Clone, Copy, Debug)]
57#[repr(transparent)]
58pub struct WireConnectionType {
59 value: u8,
60}
61
62unsafe impl ::fidl_next::ZeroPadding for WireConnectionType {
63 #[inline]
64 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
65 }
67}
68
69unsafe impl<___D> ::fidl_next::Decode<___D> for WireConnectionType
70where
71 ___D: ?Sized,
72{
73 fn decode(
74 slot: ::fidl_next::Slot<'_, Self>,
75 _: &mut ___D,
76 ) -> Result<(), ::fidl_next::DecodeError> {
77 Ok(())
78 }
79}
80
81impl ::core::convert::From<ConnectionType> for WireConnectionType {
82 fn from(natural: ConnectionType) -> Self {
83 Self { value: u8::from(natural.bits()) }
84 }
85}
86
87#[derive(Debug)]
88#[repr(C)]
89pub struct ConnectorConnectRequest {
90 pub server: ::fidl_next::fuchsia::zx::Handle,
91}
92
93impl ::fidl_next::Encodable for ConnectorConnectRequest {
94 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
95 ::fidl_next::CopyOptimization::enable_if(
96 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
97 .is_enabled(),
98 )
99 };
100
101 type Encoded = WireConnectorConnectRequest;
102}
103
104unsafe impl<___E> ::fidl_next::Encode<___E> for ConnectorConnectRequest
105where
106 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
107
108 ___E: ::fidl_next::fuchsia::HandleEncoder,
109{
110 #[inline]
111 fn encode(
112 &mut self,
113 encoder: &mut ___E,
114 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
115 ) -> Result<(), ::fidl_next::EncodeError> {
116 ::fidl_next::munge! {
117 let Self::Encoded {
118 server,
119
120 } = out;
121 }
122
123 ::fidl_next::Encode::encode(&mut self.server, encoder, server)?;
124
125 Ok(())
126 }
127}
128
129impl ::fidl_next::EncodableOption for Box<ConnectorConnectRequest> {
130 type EncodedOption = ::fidl_next::WireBox<WireConnectorConnectRequest>;
131}
132
133unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<ConnectorConnectRequest>
134where
135 ___E: ::fidl_next::Encoder + ?Sized,
136 ConnectorConnectRequest: ::fidl_next::Encode<___E>,
137{
138 #[inline]
139 fn encode_option(
140 this: Option<&mut Self>,
141 encoder: &mut ___E,
142 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
143 ) -> Result<(), ::fidl_next::EncodeError> {
144 if let Some(inner) = this {
145 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
146 ::fidl_next::WireBox::encode_present(out);
147 } else {
148 ::fidl_next::WireBox::encode_absent(out);
149 }
150
151 Ok(())
152 }
153}
154
155impl ::fidl_next::TakeFrom<WireConnectorConnectRequest> for ConnectorConnectRequest {
156 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self> = unsafe {
157 ::fidl_next::CopyOptimization::enable_if(
158 true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
159 .is_enabled(),
160 )
161 };
162
163 #[inline]
164 fn take_from(from: &WireConnectorConnectRequest) -> Self {
165 Self { server: ::fidl_next::TakeFrom::take_from(&from.server) }
166 }
167}
168
169#[derive(Debug)]
171#[repr(C)]
172pub struct WireConnectorConnectRequest {
173 pub server: ::fidl_next::fuchsia::WireHandle,
174}
175
176unsafe impl ::fidl_next::ZeroPadding for WireConnectorConnectRequest {
177 #[inline]
178 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
179}
180
181unsafe impl<___D> ::fidl_next::Decode<___D> for WireConnectorConnectRequest
182where
183 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
184
185 ___D: ::fidl_next::fuchsia::HandleDecoder,
186{
187 fn decode(
188 slot: ::fidl_next::Slot<'_, Self>,
189 decoder: &mut ___D,
190 ) -> Result<(), ::fidl_next::DecodeError> {
191 ::fidl_next::munge! {
192 let Self {
193 mut server,
194
195 } = slot;
196 }
197
198 ::fidl_next::Decode::decode(server.as_mut(), decoder)?;
199
200 Ok(())
201 }
202}
203
204#[doc = " A connector lets a client forward the server end of a protocol.\n"]
206#[derive(Debug)]
207pub struct Connector;
208
209pub mod connector {
210 pub mod prelude {
211 pub use crate::{
212 connector, Connector, ConnectorClientHandler, ConnectorClientSender,
213 ConnectorServerHandler, ConnectorServerSender,
214 };
215
216 pub use crate::ConnectorConnectRequest;
217 }
218
219 pub struct Connect;
220
221 impl ::fidl_next::Method for Connect {
222 const ORDINAL: u64 = 3169778387179902201;
223
224 type Protocol = crate::Connector;
225
226 type Request = crate::WireConnectorConnectRequest;
227
228 type Response = ::fidl_next::Never;
229 }
230}
231
232pub trait ConnectorClientSender {
234 type Transport: ::fidl_next::Transport;
235
236 #[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"]
237 fn connect<___R>(
238 &self,
239 request: &mut ___R,
240 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
241 where
242 ___R: ::fidl_next::Encode<
243 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
244 Encoded = crate::WireConnectorConnectRequest,
245 >;
246}
247
248impl<___T> ConnectorClientSender for ::fidl_next::ClientSender<___T, Connector>
249where
250 ___T: ::fidl_next::Transport,
251{
252 type Transport = ___T;
253
254 #[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"]
255 fn connect<___R>(
256 &self,
257 request: &mut ___R,
258 ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
259 where
260 ___R: ::fidl_next::Encode<
261 <Self::Transport as ::fidl_next::Transport>::SendBuffer,
262 Encoded = crate::WireConnectorConnectRequest,
263 >,
264 {
265 self.as_untyped().send_one_way(3169778387179902201, request)
266 }
267}
268
269pub trait ConnectorClientHandler<___T: ::fidl_next::Transport> {}
273
274impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Connector
275where
276 ___T: ::fidl_next::Transport,
277 ___H: ConnectorClientHandler<___T>,
278{
279 fn on_event(
280 handler: &mut ___H,
281 sender: &::fidl_next::ClientSender<___T, Self>,
282 ordinal: u64,
283 buffer: ___T::RecvBuffer,
284 ) {
285 match ordinal {
286 ordinal => {
287 sender.close();
288 }
289 }
290 }
291}
292
293pub trait ConnectorServerSender {
295 type Transport: ::fidl_next::Transport;
296}
297
298impl<___T> ConnectorServerSender for ::fidl_next::ServerSender<___T, Connector>
299where
300 ___T: ::fidl_next::Transport,
301{
302 type Transport = ___T;
303}
304
305pub trait ConnectorServerHandler<___T: ::fidl_next::Transport> {
309 #[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"]
310 fn connect(
311 &mut self,
312 sender: &::fidl_next::ServerSender<___T, Connector>,
313
314 request: ::fidl_next::RequestBuffer<___T, connector::Connect>,
315 );
316}
317
318impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Connector
319where
320 ___T: ::fidl_next::Transport,
321 ___H: ConnectorServerHandler<___T>,
322
323 crate::WireConnectorConnectRequest:
324 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
325{
326 fn on_one_way(
327 handler: &mut ___H,
328 sender: &::fidl_next::ServerSender<___T, Self>,
329 ordinal: u64,
330 buffer: ___T::RecvBuffer,
331 ) {
332 match ordinal {
333 3169778387179902201 => {
334 let buffer = ::fidl_next::RequestBuffer::from_untyped(buffer);
335 handler.connect(sender, buffer);
336 }
337
338 ordinal => {
339 sender.close();
340 }
341 }
342 }
343
344 fn on_two_way(
345 handler: &mut ___H,
346 sender: &::fidl_next::ServerSender<___T, Self>,
347 ordinal: u64,
348 buffer: ___T::RecvBuffer,
349 responder: ::fidl_next::protocol::Responder,
350 ) {
351 match ordinal {
352 ordinal => {
353 sender.close();
354 }
355 }
356 }
357}
358
359#[doc = " This name is reserved for accessing the fuchsia.device/Controller protocol\n within /dev/. No devices can be created with this name.\n"]
360pub const DEVICE_CONTROLLER_NAME: &str = "device_controller";
361
362#[doc = " This name is reserved for accessing the device specific protocol\n within /dev/. No devices can be created with this name.\n"]
363pub const DEVICE_PROTOCOL_NAME: &str = "device_protocol";
364
365#[doc = " This name is reserved for accessing the fuchsia.device.fs/TopologicalPath protocol\n within /dev/. No devices can be created with this name.\n"]
366pub const DEVICE_TOPOLOGY_NAME: &str = "device_topology";
367
368#[derive(Debug)]
369pub struct DevfsAddArgs {
370 pub connector:
371 Option<::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::Connector>>,
372
373 pub class_name: Option<String>,
374
375 pub inspect: Option<::fidl_next::fuchsia::zx::Handle>,
376
377 pub connector_supports: Option<crate::ConnectionType>,
378
379 pub controller_connector:
380 Option<::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, crate::Connector>>,
381}
382
383impl DevfsAddArgs {
384 fn __max_ordinal(&self) -> usize {
385 if self.connector.is_some() {
386 return 1;
387 }
388
389 if self.class_name.is_some() {
390 return 2;
391 }
392
393 if self.inspect.is_some() {
394 return 3;
395 }
396
397 if self.connector_supports.is_some() {
398 return 4;
399 }
400
401 if self.controller_connector.is_some() {
402 return 5;
403 }
404
405 0
406 }
407}
408
409impl ::fidl_next::Encodable for DevfsAddArgs {
410 type Encoded = WireDevfsAddArgs;
411}
412
413unsafe impl<___E> ::fidl_next::Encode<___E> for DevfsAddArgs
414where
415 ___E: ::fidl_next::Encoder + ?Sized,
416
417 ___E: ::fidl_next::fuchsia::HandleEncoder,
418{
419 #[inline]
420 fn encode(
421 &mut self,
422 encoder: &mut ___E,
423 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
424 ) -> Result<(), ::fidl_next::EncodeError> {
425 ::fidl_next::munge!(let WireDevfsAddArgs { table } = out);
426
427 let max_ord = self.__max_ordinal();
428
429 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
430 ::fidl_next::ZeroPadding::zero_padding(&mut out);
431
432 let mut preallocated =
433 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
434
435 for i in 1..=max_ord {
436 match i {
437 5 => {
438 if let Some(controller_connector) = &mut self.controller_connector {
439 ::fidl_next::WireEnvelope::encode_value(
440 controller_connector,
441 preallocated.encoder,
442 &mut out,
443 )?;
444 } else {
445 ::fidl_next::WireEnvelope::encode_zero(&mut out)
446 }
447 }
448
449 4 => {
450 if let Some(connector_supports) = &mut self.connector_supports {
451 ::fidl_next::WireEnvelope::encode_value(
452 connector_supports,
453 preallocated.encoder,
454 &mut out,
455 )?;
456 } else {
457 ::fidl_next::WireEnvelope::encode_zero(&mut out)
458 }
459 }
460
461 3 => {
462 if let Some(inspect) = &mut self.inspect {
463 ::fidl_next::WireEnvelope::encode_value(
464 inspect,
465 preallocated.encoder,
466 &mut out,
467 )?;
468 } else {
469 ::fidl_next::WireEnvelope::encode_zero(&mut out)
470 }
471 }
472
473 2 => {
474 if let Some(class_name) = &mut self.class_name {
475 ::fidl_next::WireEnvelope::encode_value(
476 class_name,
477 preallocated.encoder,
478 &mut out,
479 )?;
480 } else {
481 ::fidl_next::WireEnvelope::encode_zero(&mut out)
482 }
483 }
484
485 1 => {
486 if let Some(connector) = &mut self.connector {
487 ::fidl_next::WireEnvelope::encode_value(
488 connector,
489 preallocated.encoder,
490 &mut out,
491 )?;
492 } else {
493 ::fidl_next::WireEnvelope::encode_zero(&mut out)
494 }
495 }
496
497 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
498 }
499 unsafe {
500 preallocated.write_next(out.assume_init_ref());
501 }
502 }
503
504 ::fidl_next::WireTable::encode_len(table, max_ord);
505
506 Ok(())
507 }
508}
509
510impl ::fidl_next::TakeFrom<WireDevfsAddArgs> for DevfsAddArgs {
511 #[inline]
512 fn take_from(from: &WireDevfsAddArgs) -> Self {
513 Self {
514 connector: from.connector().map(::fidl_next::TakeFrom::take_from),
515
516 class_name: from.class_name().map(::fidl_next::TakeFrom::take_from),
517
518 inspect: from.inspect().map(::fidl_next::TakeFrom::take_from),
519
520 connector_supports: from.connector_supports().map(::fidl_next::TakeFrom::take_from),
521
522 controller_connector: from.controller_connector().map(::fidl_next::TakeFrom::take_from),
523 }
524 }
525}
526
527#[repr(C)]
529pub struct WireDevfsAddArgs {
530 table: ::fidl_next::WireTable,
531}
532
533unsafe impl ::fidl_next::ZeroPadding for WireDevfsAddArgs {
534 #[inline]
535 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
536 ::fidl_next::munge!(let Self { table } = out);
537 ::fidl_next::WireTable::zero_padding(table);
538 }
539}
540
541unsafe impl<___D> ::fidl_next::Decode<___D> for WireDevfsAddArgs
542where
543 ___D: ::fidl_next::Decoder + ?Sized,
544
545 ___D: ::fidl_next::fuchsia::HandleDecoder,
546{
547 fn decode(
548 slot: ::fidl_next::Slot<'_, Self>,
549 decoder: &mut ___D,
550 ) -> Result<(), ::fidl_next::DecodeError> {
551 ::fidl_next::munge!(let Self { table } = slot);
552
553 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
554 match ordinal {
555 0 => unsafe { ::core::hint::unreachable_unchecked() },
556
557 1 => {
558 ::fidl_next::WireEnvelope::decode_as::<
559 ___D,
560 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::Connector>,
561 >(slot.as_mut(), decoder)?;
562
563 Ok(())
564 }
565
566 2 => {
567 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString>(
568 slot.as_mut(),
569 decoder,
570 )?;
571
572 let class_name = unsafe {
573 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString>()
574 };
575
576 if class_name.len() > 255 {
577 return Err(::fidl_next::DecodeError::VectorTooLong {
578 size: class_name.len() as u64,
579 limit: 255,
580 });
581 }
582
583 Ok(())
584 }
585
586 3 => {
587 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
588 slot.as_mut(),
589 decoder,
590 )?;
591
592 Ok(())
593 }
594
595 4 => {
596 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireConnectionType>(
597 slot.as_mut(),
598 decoder,
599 )?;
600
601 Ok(())
602 }
603
604 5 => {
605 ::fidl_next::WireEnvelope::decode_as::<
606 ___D,
607 ::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::Connector>,
608 >(slot.as_mut(), decoder)?;
609
610 Ok(())
611 }
612
613 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
614 }
615 })
616 }
617}
618
619impl WireDevfsAddArgs {
620 pub fn connector(
621 &self,
622 ) -> Option<&::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::Connector>> {
623 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
624 }
625
626 pub fn class_name(&self) -> Option<&::fidl_next::WireString> {
627 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
628 }
629
630 pub fn inspect(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
631 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
632 }
633
634 pub fn connector_supports(&self) -> Option<&crate::WireConnectionType> {
635 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
636 }
637
638 pub fn controller_connector(
639 &self,
640 ) -> Option<&::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, crate::Connector>> {
641 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
642 }
643}
644
645impl ::core::fmt::Debug for WireDevfsAddArgs {
646 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
647 f.debug_struct("DevfsAddArgs")
648 .field("connector", &self.connector())
649 .field("class_name", &self.class_name())
650 .field("inspect", &self.inspect())
651 .field("connector_supports", &self.connector_supports())
652 .field("controller_connector", &self.controller_connector())
653 .finish()
654 }
655}
656
657#[doc = " Maximum length of a device path\n"]
658pub const MAX_DEVICE_PATH_LEN: u64 = 1024;
659
660#[doc = " Maximum length for a driver path\n"]
661pub const MAX_DRIVER_PATH_LEN: u64 = 1024;
662
663#[derive(Clone, Debug)]
664pub struct TopologicalPathGetTopologicalPathResponse {
665 pub path: String,
666}
667
668impl ::fidl_next::Encodable for TopologicalPathGetTopologicalPathResponse {
669 type Encoded = WireTopologicalPathGetTopologicalPathResponse;
670}
671
672unsafe impl<___E> ::fidl_next::Encode<___E> for TopologicalPathGetTopologicalPathResponse
673where
674 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
675
676 ___E: ::fidl_next::Encoder,
677{
678 #[inline]
679 fn encode(
680 &mut self,
681 encoder: &mut ___E,
682 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
683 ) -> Result<(), ::fidl_next::EncodeError> {
684 ::fidl_next::munge! {
685 let Self::Encoded {
686 path,
687
688 } = out;
689 }
690
691 ::fidl_next::Encode::encode(&mut self.path, encoder, path)?;
692
693 Ok(())
694 }
695}
696
697impl ::fidl_next::EncodableOption for Box<TopologicalPathGetTopologicalPathResponse> {
698 type EncodedOption = ::fidl_next::WireBox<WireTopologicalPathGetTopologicalPathResponse>;
699}
700
701unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Box<TopologicalPathGetTopologicalPathResponse>
702where
703 ___E: ::fidl_next::Encoder + ?Sized,
704 TopologicalPathGetTopologicalPathResponse: ::fidl_next::Encode<___E>,
705{
706 #[inline]
707 fn encode_option(
708 this: Option<&mut Self>,
709 encoder: &mut ___E,
710 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
711 ) -> Result<(), ::fidl_next::EncodeError> {
712 if let Some(inner) = this {
713 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
714 ::fidl_next::WireBox::encode_present(out);
715 } else {
716 ::fidl_next::WireBox::encode_absent(out);
717 }
718
719 Ok(())
720 }
721}
722
723impl ::fidl_next::TakeFrom<WireTopologicalPathGetTopologicalPathResponse>
724 for TopologicalPathGetTopologicalPathResponse
725{
726 #[inline]
727 fn take_from(from: &WireTopologicalPathGetTopologicalPathResponse) -> Self {
728 Self { path: ::fidl_next::TakeFrom::take_from(&from.path) }
729 }
730}
731
732#[derive(Debug)]
734#[repr(C)]
735pub struct WireTopologicalPathGetTopologicalPathResponse {
736 pub path: ::fidl_next::WireString,
737}
738
739unsafe impl ::fidl_next::ZeroPadding for WireTopologicalPathGetTopologicalPathResponse {
740 #[inline]
741 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
742}
743
744unsafe impl<___D> ::fidl_next::Decode<___D> for WireTopologicalPathGetTopologicalPathResponse
745where
746 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
747
748 ___D: ::fidl_next::Decoder,
749{
750 fn decode(
751 slot: ::fidl_next::Slot<'_, Self>,
752 decoder: &mut ___D,
753 ) -> Result<(), ::fidl_next::DecodeError> {
754 ::fidl_next::munge! {
755 let Self {
756 mut path,
757
758 } = slot;
759 }
760
761 ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
762
763 let path = unsafe { path.deref_unchecked() };
764
765 if path.len() > 1024 {
766 return Err(::fidl_next::DecodeError::VectorTooLong {
767 size: path.len() as u64,
768 limit: 1024,
769 });
770 }
771
772 Ok(())
773 }
774}
775
776#[derive(Debug)]
778pub struct TopologicalPath;
779
780pub mod topological_path {
781 pub mod prelude {
782 pub use crate::{
783 topological_path, TopologicalPath, TopologicalPathClientHandler,
784 TopologicalPathClientSender, TopologicalPathServerHandler, TopologicalPathServerSender,
785 };
786
787 pub use crate::TopologicalPathGetTopologicalPathResponse;
788 }
789
790 pub struct GetTopologicalPath;
791
792 impl ::fidl_next::Method for GetTopologicalPath {
793 const ORDINAL: u64 = 6266213890697819096;
794
795 type Protocol = crate::TopologicalPath;
796
797 type Request = ();
798
799 type Response = ::fidl_next::WireResult<
800 crate::WireTopologicalPathGetTopologicalPathResponse,
801 ::fidl_next::WireI32,
802 >;
803 }
804}
805
806pub trait TopologicalPathClientSender {
808 type Transport: ::fidl_next::Transport;
809
810 #[doc = " Return the topological path for this device\n"]
811 fn get_topological_path(
812 &self,
813 ) -> Result<
814 ::fidl_next::ResponseFuture<'_, Self::Transport, topological_path::GetTopologicalPath>,
815 ::fidl_next::EncodeError,
816 >;
817}
818
819impl<___T> TopologicalPathClientSender for ::fidl_next::ClientSender<___T, TopologicalPath>
820where
821 ___T: ::fidl_next::Transport,
822{
823 type Transport = ___T;
824
825 #[doc = " Return the topological path for this device\n"]
826 fn get_topological_path(
827 &self,
828 ) -> Result<
829 ::fidl_next::ResponseFuture<'_, Self::Transport, topological_path::GetTopologicalPath>,
830 ::fidl_next::EncodeError,
831 > {
832 self.as_untyped()
833 .send_two_way(6266213890697819096, &mut ())
834 .map(::fidl_next::ResponseFuture::from_untyped)
835 }
836}
837
838pub trait TopologicalPathClientHandler<___T: ::fidl_next::Transport> {}
842
843impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for TopologicalPath
844where
845 ___T: ::fidl_next::Transport,
846 ___H: TopologicalPathClientHandler<___T>,
847
848 <topological_path::GetTopologicalPath as ::fidl_next::Method>::Response:
849 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
850{
851 fn on_event(
852 handler: &mut ___H,
853 sender: &::fidl_next::ClientSender<___T, Self>,
854 ordinal: u64,
855 buffer: ___T::RecvBuffer,
856 ) {
857 match ordinal {
858 ordinal => {
859 sender.close();
860 }
861 }
862 }
863}
864
865pub trait TopologicalPathServerSender {
867 type Transport: ::fidl_next::Transport;
868}
869
870impl<___T> TopologicalPathServerSender for ::fidl_next::ServerSender<___T, TopologicalPath>
871where
872 ___T: ::fidl_next::Transport,
873{
874 type Transport = ___T;
875}
876
877pub trait TopologicalPathServerHandler<___T: ::fidl_next::Transport> {
881 #[doc = " Return the topological path for this device\n"]
882 fn get_topological_path(
883 &mut self,
884 sender: &::fidl_next::ServerSender<___T, TopologicalPath>,
885
886 responder: ::fidl_next::Responder<topological_path::GetTopologicalPath>,
887 );
888}
889
890impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for TopologicalPath
891where
892 ___T: ::fidl_next::Transport,
893 ___H: TopologicalPathServerHandler<___T>,
894{
895 fn on_one_way(
896 handler: &mut ___H,
897 sender: &::fidl_next::ServerSender<___T, Self>,
898 ordinal: u64,
899 buffer: ___T::RecvBuffer,
900 ) {
901 match ordinal {
902 ordinal => {
903 sender.close();
904 }
905 }
906 }
907
908 fn on_two_way(
909 handler: &mut ___H,
910 sender: &::fidl_next::ServerSender<___T, Self>,
911 ordinal: u64,
912 buffer: ___T::RecvBuffer,
913 responder: ::fidl_next::protocol::Responder,
914 ) {
915 match ordinal {
916 6266213890697819096 => {
917 let responder = ::fidl_next::Responder::from_untyped(responder);
918
919 handler.get_topological_path(sender, responder);
920 }
921
922 ordinal => {
923 sender.close();
924 }
925 }
926 }
927}
928
929pub mod compat {
931
932 impl ::fidl_next::TakeFrom<crate::WireConnectionType> for ::fidl_fuchsia_device_fs::ConnectionType {
933 #[inline]
934 fn take_from(from: &crate::WireConnectionType) -> Self {
935 Self::from_bits_retain(from.value.into())
936 }
937 }
938
939 impl ::fidl_next::TakeFrom<crate::WireConnectorConnectRequest>
940 for ::fidl_fuchsia_device_fs::ConnectorConnectRequest
941 {
942 #[inline]
943 fn take_from(from: &crate::WireConnectorConnectRequest) -> Self {
944 Self { server: ::fidl_next::TakeFrom::take_from(&from.server) }
945 }
946 }
947
948 #[cfg(target_os = "fuchsia")]
949 pub type ConnectorProxy =
952 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Connector>;
953
954 impl ::fidl_next::TakeFrom<crate::Connector> for ::fidl_fuchsia_device_fs::ConnectorMarker {
955 #[inline]
956 fn take_from(from: &crate::Connector) -> Self {
957 Self
958 }
959 }
960
961 impl ::fidl_next::TakeFrom<crate::WireDevfsAddArgs> for ::fidl_fuchsia_device_fs::DevfsAddArgs {
962 #[inline]
963 fn take_from(from: &crate::WireDevfsAddArgs) -> Self {
964 Self {
965 connector: from.connector().map(::fidl_next::TakeFrom::take_from),
966
967 class_name: from.class_name().map(::fidl_next::TakeFrom::take_from),
968
969 inspect: from.inspect().map(::fidl_next::TakeFrom::take_from),
970
971 connector_supports: from.connector_supports().map(::fidl_next::TakeFrom::take_from),
972
973 controller_connector: from
974 .controller_connector()
975 .map(::fidl_next::TakeFrom::take_from),
976
977 __source_breaking: ::fidl::marker::SourceBreaking,
978 }
979 }
980 }
981
982 impl ::fidl_next::TakeFrom<crate::WireTopologicalPathGetTopologicalPathResponse>
983 for ::fidl_fuchsia_device_fs::TopologicalPathGetTopologicalPathResponse
984 {
985 #[inline]
986 fn take_from(from: &crate::WireTopologicalPathGetTopologicalPathResponse) -> Self {
987 Self { path: ::fidl_next::TakeFrom::take_from(&from.path) }
988 }
989 }
990
991 #[cfg(target_os = "fuchsia")]
992 pub type TopologicalPathProxy =
995 ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::TopologicalPath>;
996
997 impl ::fidl_next::TakeFrom<crate::TopologicalPath>
998 for ::fidl_fuchsia_device_fs::TopologicalPathMarker
999 {
1000 #[inline]
1001 fn take_from(from: &crate::TopologicalPath) -> Self {
1002 Self
1003 }
1004 }
1005}