1#![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 #[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 #[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 _ = self.table.get(1).map(|envelope| unsafe {
393 envelope.read_unchecked::<::fidl_next::ClientEnd<
394 crate::Connector,
395 ::fidl_next::wire::fuchsia::Channel,
396 >>()
397 });
398
399 let _ = self.table.get(2).map(|envelope| unsafe {
400 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
401 });
402
403 let _ = self.table.get(3).map(|envelope| unsafe {
404 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Vmo>()
405 });
406
407 let _ = self.table.get(4).map(|envelope| unsafe {
408 envelope.read_unchecked::<crate::wire::ConnectionType>()
409 });
410
411 let _ = self.table.get(5).map(|envelope| unsafe {
412 envelope.read_unchecked::<::fidl_next::ClientEnd<
413 crate::Connector,
414 ::fidl_next::wire::fuchsia::Channel,
415 >>()
416 });
417 }
418 }
419
420 impl ::fidl_next::Constrained for DevfsAddArgs<'_> {
421 type Constraint = ();
422
423 fn validate(
424 _: ::fidl_next::Slot<'_, Self>,
425 _: Self::Constraint,
426 ) -> Result<(), ::fidl_next::ValidationError> {
427 Ok(())
428 }
429 }
430
431 unsafe impl ::fidl_next::Wire for DevfsAddArgs<'static> {
432 type Narrowed<'de> = DevfsAddArgs<'de>;
433
434 #[inline]
435 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
436 ::fidl_next::munge!(let Self { table } = out);
437 ::fidl_next::wire::Table::zero_padding(table);
438 }
439 }
440
441 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DevfsAddArgs<'de>
442 where
443 ___D: ::fidl_next::Decoder<'de> + ?Sized,
444 ___D: ::fidl_next::fuchsia::HandleDecoder,
445 {
446 fn decode(
447 slot: ::fidl_next::Slot<'_, Self>,
448 decoder: &mut ___D,
449 _: (),
450 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
451 ::fidl_next::munge!(let Self { table } = slot);
452
453 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
454 match ordinal {
455 0 => unsafe { ::core::hint::unreachable_unchecked() },
456
457 1 => {
458 ::fidl_next::wire::Envelope::decode_as::<
459 ___D,
460 ::fidl_next::ClientEnd<
461 crate::Connector,
462 ::fidl_next::wire::fuchsia::Channel,
463 >,
464 >(slot.as_mut(), decoder, ())?;
465
466 Ok(())
467 }
468
469 2 => {
470 ::fidl_next::wire::Envelope::decode_as::<
471 ___D,
472 ::fidl_next::wire::String<'de>,
473 >(slot.as_mut(), decoder, 255)?;
474
475 let value = unsafe {
476 slot.deref_unchecked()
477 .deref_unchecked::<::fidl_next::wire::String<'_>>()
478 };
479
480 if value.len() > 255 {
481 return Err(::fidl_next::DecodeError::VectorTooLong {
482 size: value.len() as u64,
483 limit: 255,
484 });
485 }
486
487 Ok(())
488 }
489
490 3 => {
491 ::fidl_next::wire::Envelope::decode_as::<
492 ___D,
493 ::fidl_next::wire::fuchsia::Vmo,
494 >(slot.as_mut(), decoder, ())?;
495
496 Ok(())
497 }
498
499 4 => {
500 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::ConnectionType>(
501 slot.as_mut(),
502 decoder,
503 (),
504 )?;
505
506 Ok(())
507 }
508
509 5 => {
510 ::fidl_next::wire::Envelope::decode_as::<
511 ___D,
512 ::fidl_next::ClientEnd<
513 crate::Connector,
514 ::fidl_next::wire::fuchsia::Channel,
515 >,
516 >(slot.as_mut(), decoder, ())?;
517
518 Ok(())
519 }
520
521 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
522 }
523 })
524 }
525 }
526
527 impl<'de> DevfsAddArgs<'de> {
528 pub fn connector(
529 &self,
530 ) -> ::core::option::Option<
531 &::fidl_next::ClientEnd<crate::Connector, ::fidl_next::wire::fuchsia::Channel>,
532 > {
533 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
534 }
535
536 pub fn take_connector(
537 &mut self,
538 ) -> ::core::option::Option<
539 ::fidl_next::ClientEnd<crate::Connector, ::fidl_next::wire::fuchsia::Channel>,
540 > {
541 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
542 }
543
544 pub fn class_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
545 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
546 }
547
548 pub fn take_class_name(
549 &mut self,
550 ) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
551 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
552 }
553
554 pub fn inspect(&self) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Vmo> {
555 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
556 }
557
558 pub fn take_inspect(&mut self) -> ::core::option::Option<::fidl_next::wire::fuchsia::Vmo> {
559 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
560 }
561
562 pub fn connector_supports(&self) -> ::core::option::Option<&crate::wire::ConnectionType> {
563 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
564 }
565
566 pub fn take_connector_supports(
567 &mut self,
568 ) -> ::core::option::Option<crate::wire::ConnectionType> {
569 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
570 }
571
572 pub fn controller_connector(
573 &self,
574 ) -> ::core::option::Option<
575 &::fidl_next::ClientEnd<crate::Connector, ::fidl_next::wire::fuchsia::Channel>,
576 > {
577 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
578 }
579
580 pub fn take_controller_connector(
581 &mut self,
582 ) -> ::core::option::Option<
583 ::fidl_next::ClientEnd<crate::Connector, ::fidl_next::wire::fuchsia::Channel>,
584 > {
585 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
586 }
587 }
588
589 impl<'de> ::core::fmt::Debug for DevfsAddArgs<'de> {
590 fn fmt(
591 &self,
592 f: &mut ::core::fmt::Formatter<'_>,
593 ) -> ::core::result::Result<(), ::core::fmt::Error> {
594 f.debug_struct("DevfsAddArgs")
595 .field("connector", &self.connector())
596 .field("class_name", &self.class_name())
597 .field("inspect", &self.inspect())
598 .field("connector_supports", &self.connector_supports())
599 .field("controller_connector", &self.controller_connector())
600 .finish()
601 }
602 }
603
604 impl<'de> ::fidl_next::IntoNatural for DevfsAddArgs<'de> {
605 type Natural = crate::natural::DevfsAddArgs;
606 }
607}
608
609pub mod wire_optional {
610
611 pub use fidl_next_common_fuchsia_device_fs::wire_optional::*;
612}
613
614pub mod generic {
615
616 pub use fidl_next_common_fuchsia_device_fs::generic::*;
617
618 pub struct ConnectorConnectRequest<T0> {
620 pub server: T0,
621 }
622
623 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ConnectorConnectRequest, ___E>
624 for ConnectorConnectRequest<T0>
625 where
626 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
627 ___E: ::fidl_next::fuchsia::HandleEncoder,
628 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Channel, ___E>,
629 {
630 #[inline]
631 fn encode(
632 self,
633 encoder_: &mut ___E,
634 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConnectorConnectRequest>,
635 _: (),
636 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
637 ::fidl_next::munge! {
638 let crate::wire::ConnectorConnectRequest {
639 server,
640
641 } = out_;
642 }
643
644 ::fidl_next::Encode::encode(self.server, encoder_, server, ())?;
645
646 Ok(())
647 }
648 }
649
650 unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::ConnectorConnectRequest, ___E>
651 for &'a ConnectorConnectRequest<T0>
652 where
653 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
654 ___E: ::fidl_next::fuchsia::HandleEncoder,
655 &'a T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Channel, ___E>,
656 {
657 #[inline]
658 fn encode(
659 self,
660 encoder_: &mut ___E,
661 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConnectorConnectRequest>,
662 _: (),
663 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
664 ::fidl_next::munge! {
665 let crate::wire::ConnectorConnectRequest {
666 server,
667
668 } = out_;
669 }
670
671 ::fidl_next::Encode::encode(&self.server, encoder_, server, ())?;
672
673 Ok(())
674 }
675 }
676}
677
678pub use self::natural::*;
679
680#[doc = " A connector lets a client forward the server end of a protocol.\n"]
682#[derive(PartialEq, Debug)]
683pub struct Connector;
684
685#[cfg(target_os = "fuchsia")]
686impl ::fidl_next::HasTransport for Connector {
687 type Transport = ::fidl_next::fuchsia::zx::Channel;
688}
689
690pub mod connector {
691 pub mod prelude {
692 pub use crate::{
693 Connector, ConnectorClientHandler, ConnectorLocalClientHandler,
694 ConnectorLocalServerHandler, ConnectorServerHandler, connector,
695 };
696
697 pub use crate::natural::ConnectorConnectRequest;
698 }
699
700 pub struct Connect;
701
702 impl ::fidl_next::Method for Connect {
703 const ORDINAL: u64 = 3169778387179902201;
704 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
705 ::fidl_next::protocol::Flexibility::Strict;
706
707 type Protocol = crate::Connector;
708
709 type Request = crate::wire::ConnectorConnectRequest;
710 }
711
712 mod ___detail {
713 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Connector
714 where
715 ___T: ::fidl_next::Transport,
716 {
717 type Client = ConnectorClient<___T>;
718 type Server = ConnectorServer<___T>;
719 }
720
721 #[repr(transparent)]
723 pub struct ConnectorClient<___T: ::fidl_next::Transport> {
724 #[allow(dead_code)]
725 client: ::fidl_next::protocol::Client<___T>,
726 }
727
728 impl<___T> ConnectorClient<___T>
729 where
730 ___T: ::fidl_next::Transport,
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 pub fn connect(
734 &self,
735
736 server: impl ::fidl_next::Encode<
737 ::fidl_next::wire::fuchsia::Channel,
738 <___T as ::fidl_next::Transport>::SendBuffer,
739 >,
740 ) -> ::fidl_next::SendFuture<'_, ___T>
741 where
742 <___T as ::fidl_next::Transport>::SendBuffer:
743 ::fidl_next::encoder::InternalHandleEncoder,
744 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
745 {
746 self.connect_with(crate::generic::ConnectorConnectRequest { server })
747 }
748
749 #[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"]
750 pub fn connect_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
751 where
752 ___R: ::fidl_next::Encode<
753 crate::wire::ConnectorConnectRequest,
754 <___T as ::fidl_next::Transport>::SendBuffer,
755 >,
756 {
757 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
758 3169778387179902201,
759 <super::Connect as ::fidl_next::Method>::FLEXIBILITY,
760 request,
761 ))
762 }
763 }
764
765 #[repr(transparent)]
767 pub struct ConnectorServer<___T: ::fidl_next::Transport> {
768 server: ::fidl_next::protocol::Server<___T>,
769 }
770
771 impl<___T> ConnectorServer<___T> where ___T: ::fidl_next::Transport {}
772 }
773}
774
775#[diagnostic::on_unimplemented(
776 note = "If {Self} implements the non-local ConnectorClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
777)]
778
779pub trait ConnectorLocalClientHandler<
783 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
784 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
785>
786{
787}
788
789impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Connector
790where
791 ___H: ConnectorLocalClientHandler<___T>,
792 ___T: ::fidl_next::Transport,
793{
794 async fn on_event(
795 handler: &mut ___H,
796 mut message: ::fidl_next::Message<___T>,
797 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
798 match *message.header().ordinal {
799 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
800 }
801 }
802}
803
804#[diagnostic::on_unimplemented(
805 note = "If {Self} implements the non-local ConnectorServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
806)]
807
808pub trait ConnectorLocalServerHandler<
812 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
813 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
814>
815{
816 #[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"]
817 fn connect(
818 &mut self,
819
820 request: ::fidl_next::Request<connector::Connect, ___T>,
821 ) -> impl ::core::future::Future<Output = ()>;
822}
823
824impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Connector
825where
826 ___H: ConnectorLocalServerHandler<___T>,
827 ___T: ::fidl_next::Transport,
828 for<'de> crate::wire::ConnectorConnectRequest: ::fidl_next::Decode<
829 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
830 Constraint = (),
831 >,
832{
833 async fn on_one_way(
834 handler: &mut ___H,
835 mut message: ::fidl_next::Message<___T>,
836 ) -> ::core::result::Result<
837 (),
838 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
839 > {
840 match *message.header().ordinal {
841 3169778387179902201 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
842 Ok(decoded) => {
843 handler.connect(::fidl_next::Request::from_decoded(decoded)).await;
844 Ok(())
845 }
846 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
847 ordinal: 3169778387179902201,
848 error,
849 }),
850 },
851
852 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
853 }
854 }
855
856 async fn on_two_way(
857 handler: &mut ___H,
858 mut message: ::fidl_next::Message<___T>,
859 responder: ::fidl_next::protocol::Responder<___T>,
860 ) -> ::core::result::Result<
861 (),
862 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
863 > {
864 match *message.header().ordinal {
865 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
866 }
867 }
868}
869
870pub trait ConnectorClientHandler<
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}
879
880impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Connector
881where
882 ___H: ConnectorClientHandler<___T> + ::core::marker::Send,
883 ___T: ::fidl_next::Transport,
884{
885 async fn on_event(
886 handler: &mut ___H,
887 mut message: ::fidl_next::Message<___T>,
888 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
889 match *message.header().ordinal {
890 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
891 }
892 }
893}
894
895pub trait ConnectorServerHandler<
899 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
900 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
901>
902{
903 #[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"]
904 fn connect(
905 &mut self,
906
907 request: ::fidl_next::Request<connector::Connect, ___T>,
908 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
909}
910
911impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Connector
912where
913 ___H: ConnectorServerHandler<___T> + ::core::marker::Send,
914 ___T: ::fidl_next::Transport,
915 for<'de> crate::wire::ConnectorConnectRequest: ::fidl_next::Decode<
916 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
917 Constraint = (),
918 >,
919{
920 async fn on_one_way(
921 handler: &mut ___H,
922 mut message: ::fidl_next::Message<___T>,
923 ) -> ::core::result::Result<
924 (),
925 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
926 > {
927 match *message.header().ordinal {
928 3169778387179902201 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
929 Ok(decoded) => {
930 handler.connect(::fidl_next::Request::from_decoded(decoded)).await;
931 Ok(())
932 }
933 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
934 ordinal: 3169778387179902201,
935 error,
936 }),
937 },
938
939 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
940 }
941 }
942
943 async fn on_two_way(
944 handler: &mut ___H,
945 mut message: ::fidl_next::Message<___T>,
946 responder: ::fidl_next::protocol::Responder<___T>,
947 ) -> ::core::result::Result<
948 (),
949 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
950 > {
951 match *message.header().ordinal {
952 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
953 }
954 }
955}
956
957impl<___T> ConnectorClientHandler<___T> for ::fidl_next::IgnoreEvents where
958 ___T: ::fidl_next::Transport
959{
960}
961
962impl<___H, ___T> ConnectorLocalClientHandler<___T> for ::fidl_next::Local<___H>
963where
964 ___H: ConnectorClientHandler<___T>,
965 ___T: ::fidl_next::Transport,
966{
967}
968
969impl<___H, ___T> ConnectorLocalServerHandler<___T> for ::fidl_next::Local<___H>
970where
971 ___H: ConnectorServerHandler<___T>,
972 ___T: ::fidl_next::Transport,
973{
974 async fn connect(&mut self, request: ::fidl_next::Request<connector::Connect, ___T>) {
975 ___H::connect(&mut self.0, request).await
976 }
977}
978
979pub use fidl_next_common_fuchsia_device_fs::*;