1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_net_virtualization_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ControlCreateNetworkRequest {
16 pub config: Config,
17 pub network: fidl::endpoints::ServerEnd<NetworkMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for ControlCreateNetworkRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct NetworkAddPortRequest {
27 pub port: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
28 pub interface: fidl::endpoints::ServerEnd<InterfaceMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NetworkAddPortRequest {}
32
33#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
34pub struct ControlMarker;
35
36impl fidl::endpoints::ProtocolMarker for ControlMarker {
37 type Proxy = ControlProxy;
38 type RequestStream = ControlRequestStream;
39 #[cfg(target_os = "fuchsia")]
40 type SynchronousProxy = ControlSynchronousProxy;
41
42 const DEBUG_NAME: &'static str = "fuchsia.net.virtualization.Control";
43}
44impl fidl::endpoints::DiscoverableProtocolMarker for ControlMarker {}
45
46pub trait ControlProxyInterface: Send + Sync {
47 fn r#create_network(
48 &self,
49 config: &Config,
50 network: fidl::endpoints::ServerEnd<NetworkMarker>,
51 ) -> Result<(), fidl::Error>;
52}
53#[derive(Debug)]
54#[cfg(target_os = "fuchsia")]
55pub struct ControlSynchronousProxy {
56 client: fidl::client::sync::Client,
57}
58
59#[cfg(target_os = "fuchsia")]
60impl fidl::endpoints::SynchronousProxy for ControlSynchronousProxy {
61 type Proxy = ControlProxy;
62 type Protocol = ControlMarker;
63
64 fn from_channel(inner: fidl::Channel) -> Self {
65 Self::new(inner)
66 }
67
68 fn into_channel(self) -> fidl::Channel {
69 self.client.into_channel()
70 }
71
72 fn as_channel(&self) -> &fidl::Channel {
73 self.client.as_channel()
74 }
75}
76
77#[cfg(target_os = "fuchsia")]
78impl ControlSynchronousProxy {
79 pub fn new(channel: fidl::Channel) -> Self {
80 let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
81 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
82 }
83
84 pub fn into_channel(self) -> fidl::Channel {
85 self.client.into_channel()
86 }
87
88 pub fn wait_for_event(
91 &self,
92 deadline: zx::MonotonicInstant,
93 ) -> Result<ControlEvent, fidl::Error> {
94 ControlEvent::decode(self.client.wait_for_event(deadline)?)
95 }
96
97 pub fn r#create_network(
108 &self,
109 mut config: &Config,
110 mut network: fidl::endpoints::ServerEnd<NetworkMarker>,
111 ) -> Result<(), fidl::Error> {
112 self.client.send::<ControlCreateNetworkRequest>(
113 (config, network),
114 0x4e5909b506960eaf,
115 fidl::encoding::DynamicFlags::empty(),
116 )
117 }
118}
119
120#[cfg(target_os = "fuchsia")]
121impl From<ControlSynchronousProxy> for zx::Handle {
122 fn from(value: ControlSynchronousProxy) -> Self {
123 value.into_channel().into()
124 }
125}
126
127#[cfg(target_os = "fuchsia")]
128impl From<fidl::Channel> for ControlSynchronousProxy {
129 fn from(value: fidl::Channel) -> Self {
130 Self::new(value)
131 }
132}
133
134#[derive(Debug, Clone)]
135pub struct ControlProxy {
136 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
137}
138
139impl fidl::endpoints::Proxy for ControlProxy {
140 type Protocol = ControlMarker;
141
142 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
143 Self::new(inner)
144 }
145
146 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
147 self.client.into_channel().map_err(|client| Self { client })
148 }
149
150 fn as_channel(&self) -> &::fidl::AsyncChannel {
151 self.client.as_channel()
152 }
153}
154
155impl ControlProxy {
156 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
158 let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
159 Self { client: fidl::client::Client::new(channel, protocol_name) }
160 }
161
162 pub fn take_event_stream(&self) -> ControlEventStream {
168 ControlEventStream { event_receiver: self.client.take_event_receiver() }
169 }
170
171 pub fn r#create_network(
182 &self,
183 mut config: &Config,
184 mut network: fidl::endpoints::ServerEnd<NetworkMarker>,
185 ) -> Result<(), fidl::Error> {
186 ControlProxyInterface::r#create_network(self, config, network)
187 }
188}
189
190impl ControlProxyInterface for ControlProxy {
191 fn r#create_network(
192 &self,
193 mut config: &Config,
194 mut network: fidl::endpoints::ServerEnd<NetworkMarker>,
195 ) -> Result<(), fidl::Error> {
196 self.client.send::<ControlCreateNetworkRequest>(
197 (config, network),
198 0x4e5909b506960eaf,
199 fidl::encoding::DynamicFlags::empty(),
200 )
201 }
202}
203
204pub struct ControlEventStream {
205 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
206}
207
208impl std::marker::Unpin for ControlEventStream {}
209
210impl futures::stream::FusedStream for ControlEventStream {
211 fn is_terminated(&self) -> bool {
212 self.event_receiver.is_terminated()
213 }
214}
215
216impl futures::Stream for ControlEventStream {
217 type Item = Result<ControlEvent, fidl::Error>;
218
219 fn poll_next(
220 mut self: std::pin::Pin<&mut Self>,
221 cx: &mut std::task::Context<'_>,
222 ) -> std::task::Poll<Option<Self::Item>> {
223 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
224 &mut self.event_receiver,
225 cx
226 )?) {
227 Some(buf) => std::task::Poll::Ready(Some(ControlEvent::decode(buf))),
228 None => std::task::Poll::Ready(None),
229 }
230 }
231}
232
233#[derive(Debug)]
234pub enum ControlEvent {}
235
236impl ControlEvent {
237 fn decode(
239 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
240 ) -> Result<ControlEvent, fidl::Error> {
241 let (bytes, _handles) = buf.split_mut();
242 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
243 debug_assert_eq!(tx_header.tx_id, 0);
244 match tx_header.ordinal {
245 _ => Err(fidl::Error::UnknownOrdinal {
246 ordinal: tx_header.ordinal,
247 protocol_name: <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
248 }),
249 }
250 }
251}
252
253pub struct ControlRequestStream {
255 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
256 is_terminated: bool,
257}
258
259impl std::marker::Unpin for ControlRequestStream {}
260
261impl futures::stream::FusedStream for ControlRequestStream {
262 fn is_terminated(&self) -> bool {
263 self.is_terminated
264 }
265}
266
267impl fidl::endpoints::RequestStream for ControlRequestStream {
268 type Protocol = ControlMarker;
269 type ControlHandle = ControlControlHandle;
270
271 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
272 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
273 }
274
275 fn control_handle(&self) -> Self::ControlHandle {
276 ControlControlHandle { inner: self.inner.clone() }
277 }
278
279 fn into_inner(
280 self,
281 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
282 {
283 (self.inner, self.is_terminated)
284 }
285
286 fn from_inner(
287 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
288 is_terminated: bool,
289 ) -> Self {
290 Self { inner, is_terminated }
291 }
292}
293
294impl futures::Stream for ControlRequestStream {
295 type Item = Result<ControlRequest, fidl::Error>;
296
297 fn poll_next(
298 mut self: std::pin::Pin<&mut Self>,
299 cx: &mut std::task::Context<'_>,
300 ) -> std::task::Poll<Option<Self::Item>> {
301 let this = &mut *self;
302 if this.inner.check_shutdown(cx) {
303 this.is_terminated = true;
304 return std::task::Poll::Ready(None);
305 }
306 if this.is_terminated {
307 panic!("polled ControlRequestStream after completion");
308 }
309 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
310 |bytes, handles| {
311 match this.inner.channel().read_etc(cx, bytes, handles) {
312 std::task::Poll::Ready(Ok(())) => {}
313 std::task::Poll::Pending => return std::task::Poll::Pending,
314 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
315 this.is_terminated = true;
316 return std::task::Poll::Ready(None);
317 }
318 std::task::Poll::Ready(Err(e)) => {
319 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
320 e.into(),
321 ))))
322 }
323 }
324
325 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
327
328 std::task::Poll::Ready(Some(match header.ordinal {
329 0x4e5909b506960eaf => {
330 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
331 let mut req = fidl::new_empty!(
332 ControlCreateNetworkRequest,
333 fidl::encoding::DefaultFuchsiaResourceDialect
334 );
335 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlCreateNetworkRequest>(&header, _body_bytes, handles, &mut req)?;
336 let control_handle = ControlControlHandle { inner: this.inner.clone() };
337 Ok(ControlRequest::CreateNetwork {
338 config: req.config,
339 network: req.network,
340
341 control_handle,
342 })
343 }
344 _ => Err(fidl::Error::UnknownOrdinal {
345 ordinal: header.ordinal,
346 protocol_name:
347 <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
348 }),
349 }))
350 },
351 )
352 }
353}
354
355#[derive(Debug)]
357pub enum ControlRequest {
358 CreateNetwork {
369 config: Config,
370 network: fidl::endpoints::ServerEnd<NetworkMarker>,
371 control_handle: ControlControlHandle,
372 },
373}
374
375impl ControlRequest {
376 #[allow(irrefutable_let_patterns)]
377 pub fn into_create_network(
378 self,
379 ) -> Option<(Config, fidl::endpoints::ServerEnd<NetworkMarker>, ControlControlHandle)> {
380 if let ControlRequest::CreateNetwork { config, network, control_handle } = self {
381 Some((config, network, control_handle))
382 } else {
383 None
384 }
385 }
386
387 pub fn method_name(&self) -> &'static str {
389 match *self {
390 ControlRequest::CreateNetwork { .. } => "create_network",
391 }
392 }
393}
394
395#[derive(Debug, Clone)]
396pub struct ControlControlHandle {
397 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
398}
399
400impl fidl::endpoints::ControlHandle for ControlControlHandle {
401 fn shutdown(&self) {
402 self.inner.shutdown()
403 }
404 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
405 self.inner.shutdown_with_epitaph(status)
406 }
407
408 fn is_closed(&self) -> bool {
409 self.inner.channel().is_closed()
410 }
411 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
412 self.inner.channel().on_closed()
413 }
414
415 #[cfg(target_os = "fuchsia")]
416 fn signal_peer(
417 &self,
418 clear_mask: zx::Signals,
419 set_mask: zx::Signals,
420 ) -> Result<(), zx_status::Status> {
421 use fidl::Peered;
422 self.inner.channel().signal_peer(clear_mask, set_mask)
423 }
424}
425
426impl ControlControlHandle {}
427
428#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
429pub struct InterfaceMarker;
430
431impl fidl::endpoints::ProtocolMarker for InterfaceMarker {
432 type Proxy = InterfaceProxy;
433 type RequestStream = InterfaceRequestStream;
434 #[cfg(target_os = "fuchsia")]
435 type SynchronousProxy = InterfaceSynchronousProxy;
436
437 const DEBUG_NAME: &'static str = "(anonymous) Interface";
438}
439
440pub trait InterfaceProxyInterface: Send + Sync {}
441#[derive(Debug)]
442#[cfg(target_os = "fuchsia")]
443pub struct InterfaceSynchronousProxy {
444 client: fidl::client::sync::Client,
445}
446
447#[cfg(target_os = "fuchsia")]
448impl fidl::endpoints::SynchronousProxy for InterfaceSynchronousProxy {
449 type Proxy = InterfaceProxy;
450 type Protocol = InterfaceMarker;
451
452 fn from_channel(inner: fidl::Channel) -> Self {
453 Self::new(inner)
454 }
455
456 fn into_channel(self) -> fidl::Channel {
457 self.client.into_channel()
458 }
459
460 fn as_channel(&self) -> &fidl::Channel {
461 self.client.as_channel()
462 }
463}
464
465#[cfg(target_os = "fuchsia")]
466impl InterfaceSynchronousProxy {
467 pub fn new(channel: fidl::Channel) -> Self {
468 let protocol_name = <InterfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
469 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
470 }
471
472 pub fn into_channel(self) -> fidl::Channel {
473 self.client.into_channel()
474 }
475
476 pub fn wait_for_event(
479 &self,
480 deadline: zx::MonotonicInstant,
481 ) -> Result<InterfaceEvent, fidl::Error> {
482 InterfaceEvent::decode(self.client.wait_for_event(deadline)?)
483 }
484}
485
486#[cfg(target_os = "fuchsia")]
487impl From<InterfaceSynchronousProxy> for zx::Handle {
488 fn from(value: InterfaceSynchronousProxy) -> Self {
489 value.into_channel().into()
490 }
491}
492
493#[cfg(target_os = "fuchsia")]
494impl From<fidl::Channel> for InterfaceSynchronousProxy {
495 fn from(value: fidl::Channel) -> Self {
496 Self::new(value)
497 }
498}
499
500#[derive(Debug, Clone)]
501pub struct InterfaceProxy {
502 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
503}
504
505impl fidl::endpoints::Proxy for InterfaceProxy {
506 type Protocol = InterfaceMarker;
507
508 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
509 Self::new(inner)
510 }
511
512 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
513 self.client.into_channel().map_err(|client| Self { client })
514 }
515
516 fn as_channel(&self) -> &::fidl::AsyncChannel {
517 self.client.as_channel()
518 }
519}
520
521impl InterfaceProxy {
522 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
524 let protocol_name = <InterfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
525 Self { client: fidl::client::Client::new(channel, protocol_name) }
526 }
527
528 pub fn take_event_stream(&self) -> InterfaceEventStream {
534 InterfaceEventStream { event_receiver: self.client.take_event_receiver() }
535 }
536}
537
538impl InterfaceProxyInterface for InterfaceProxy {}
539
540pub struct InterfaceEventStream {
541 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
542}
543
544impl std::marker::Unpin for InterfaceEventStream {}
545
546impl futures::stream::FusedStream for InterfaceEventStream {
547 fn is_terminated(&self) -> bool {
548 self.event_receiver.is_terminated()
549 }
550}
551
552impl futures::Stream for InterfaceEventStream {
553 type Item = Result<InterfaceEvent, fidl::Error>;
554
555 fn poll_next(
556 mut self: std::pin::Pin<&mut Self>,
557 cx: &mut std::task::Context<'_>,
558 ) -> std::task::Poll<Option<Self::Item>> {
559 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
560 &mut self.event_receiver,
561 cx
562 )?) {
563 Some(buf) => std::task::Poll::Ready(Some(InterfaceEvent::decode(buf))),
564 None => std::task::Poll::Ready(None),
565 }
566 }
567}
568
569#[derive(Debug)]
570pub enum InterfaceEvent {
571 OnRemoved { reason: InterfaceRemovalReason },
572}
573
574impl InterfaceEvent {
575 #[allow(irrefutable_let_patterns)]
576 pub fn into_on_removed(self) -> Option<InterfaceRemovalReason> {
577 if let InterfaceEvent::OnRemoved { reason } = self {
578 Some((reason))
579 } else {
580 None
581 }
582 }
583
584 fn decode(
586 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
587 ) -> Result<InterfaceEvent, fidl::Error> {
588 let (bytes, _handles) = buf.split_mut();
589 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
590 debug_assert_eq!(tx_header.tx_id, 0);
591 match tx_header.ordinal {
592 0x4785571ae39a2617 => {
593 let mut out = fidl::new_empty!(
594 InterfaceOnRemovedRequest,
595 fidl::encoding::DefaultFuchsiaResourceDialect
596 );
597 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InterfaceOnRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
598 Ok((InterfaceEvent::OnRemoved { reason: out.reason }))
599 }
600 _ => Err(fidl::Error::UnknownOrdinal {
601 ordinal: tx_header.ordinal,
602 protocol_name: <InterfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
603 }),
604 }
605 }
606}
607
608pub struct InterfaceRequestStream {
610 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
611 is_terminated: bool,
612}
613
614impl std::marker::Unpin for InterfaceRequestStream {}
615
616impl futures::stream::FusedStream for InterfaceRequestStream {
617 fn is_terminated(&self) -> bool {
618 self.is_terminated
619 }
620}
621
622impl fidl::endpoints::RequestStream for InterfaceRequestStream {
623 type Protocol = InterfaceMarker;
624 type ControlHandle = InterfaceControlHandle;
625
626 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
627 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
628 }
629
630 fn control_handle(&self) -> Self::ControlHandle {
631 InterfaceControlHandle { inner: self.inner.clone() }
632 }
633
634 fn into_inner(
635 self,
636 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
637 {
638 (self.inner, self.is_terminated)
639 }
640
641 fn from_inner(
642 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
643 is_terminated: bool,
644 ) -> Self {
645 Self { inner, is_terminated }
646 }
647}
648
649impl futures::Stream for InterfaceRequestStream {
650 type Item = Result<InterfaceRequest, fidl::Error>;
651
652 fn poll_next(
653 mut self: std::pin::Pin<&mut Self>,
654 cx: &mut std::task::Context<'_>,
655 ) -> std::task::Poll<Option<Self::Item>> {
656 let this = &mut *self;
657 if this.inner.check_shutdown(cx) {
658 this.is_terminated = true;
659 return std::task::Poll::Ready(None);
660 }
661 if this.is_terminated {
662 panic!("polled InterfaceRequestStream after completion");
663 }
664 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
665 |bytes, handles| {
666 match this.inner.channel().read_etc(cx, bytes, handles) {
667 std::task::Poll::Ready(Ok(())) => {}
668 std::task::Poll::Pending => return std::task::Poll::Pending,
669 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
670 this.is_terminated = true;
671 return std::task::Poll::Ready(None);
672 }
673 std::task::Poll::Ready(Err(e)) => {
674 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
675 e.into(),
676 ))))
677 }
678 }
679
680 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
682
683 std::task::Poll::Ready(Some(match header.ordinal {
684 _ => Err(fidl::Error::UnknownOrdinal {
685 ordinal: header.ordinal,
686 protocol_name:
687 <InterfaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
688 }),
689 }))
690 },
691 )
692 }
693}
694
695#[derive(Debug)]
704pub enum InterfaceRequest {}
705
706impl InterfaceRequest {
707 pub fn method_name(&self) -> &'static str {
709 match *self {}
710 }
711}
712
713#[derive(Debug, Clone)]
714pub struct InterfaceControlHandle {
715 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
716}
717
718impl fidl::endpoints::ControlHandle for InterfaceControlHandle {
719 fn shutdown(&self) {
720 self.inner.shutdown()
721 }
722 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
723 self.inner.shutdown_with_epitaph(status)
724 }
725
726 fn is_closed(&self) -> bool {
727 self.inner.channel().is_closed()
728 }
729 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
730 self.inner.channel().on_closed()
731 }
732
733 #[cfg(target_os = "fuchsia")]
734 fn signal_peer(
735 &self,
736 clear_mask: zx::Signals,
737 set_mask: zx::Signals,
738 ) -> Result<(), zx_status::Status> {
739 use fidl::Peered;
740 self.inner.channel().signal_peer(clear_mask, set_mask)
741 }
742}
743
744impl InterfaceControlHandle {
745 pub fn send_on_removed(&self, mut reason: InterfaceRemovalReason) -> Result<(), fidl::Error> {
746 self.inner.send::<InterfaceOnRemovedRequest>(
747 (reason,),
748 0,
749 0x4785571ae39a2617,
750 fidl::encoding::DynamicFlags::empty(),
751 )
752 }
753}
754
755#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
756pub struct NetworkMarker;
757
758impl fidl::endpoints::ProtocolMarker for NetworkMarker {
759 type Proxy = NetworkProxy;
760 type RequestStream = NetworkRequestStream;
761 #[cfg(target_os = "fuchsia")]
762 type SynchronousProxy = NetworkSynchronousProxy;
763
764 const DEBUG_NAME: &'static str = "(anonymous) Network";
765}
766
767pub trait NetworkProxyInterface: Send + Sync {
768 fn r#add_port(
769 &self,
770 port: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
771 interface: fidl::endpoints::ServerEnd<InterfaceMarker>,
772 ) -> Result<(), fidl::Error>;
773}
774#[derive(Debug)]
775#[cfg(target_os = "fuchsia")]
776pub struct NetworkSynchronousProxy {
777 client: fidl::client::sync::Client,
778}
779
780#[cfg(target_os = "fuchsia")]
781impl fidl::endpoints::SynchronousProxy for NetworkSynchronousProxy {
782 type Proxy = NetworkProxy;
783 type Protocol = NetworkMarker;
784
785 fn from_channel(inner: fidl::Channel) -> Self {
786 Self::new(inner)
787 }
788
789 fn into_channel(self) -> fidl::Channel {
790 self.client.into_channel()
791 }
792
793 fn as_channel(&self) -> &fidl::Channel {
794 self.client.as_channel()
795 }
796}
797
798#[cfg(target_os = "fuchsia")]
799impl NetworkSynchronousProxy {
800 pub fn new(channel: fidl::Channel) -> Self {
801 let protocol_name = <NetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
802 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
803 }
804
805 pub fn into_channel(self) -> fidl::Channel {
806 self.client.into_channel()
807 }
808
809 pub fn wait_for_event(
812 &self,
813 deadline: zx::MonotonicInstant,
814 ) -> Result<NetworkEvent, fidl::Error> {
815 NetworkEvent::decode(self.client.wait_for_event(deadline)?)
816 }
817
818 pub fn r#add_port(
823 &self,
824 mut port: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
825 mut interface: fidl::endpoints::ServerEnd<InterfaceMarker>,
826 ) -> Result<(), fidl::Error> {
827 self.client.send::<NetworkAddPortRequest>(
828 (port, interface),
829 0x7ad6a60c931a3f4e,
830 fidl::encoding::DynamicFlags::empty(),
831 )
832 }
833}
834
835#[cfg(target_os = "fuchsia")]
836impl From<NetworkSynchronousProxy> for zx::Handle {
837 fn from(value: NetworkSynchronousProxy) -> Self {
838 value.into_channel().into()
839 }
840}
841
842#[cfg(target_os = "fuchsia")]
843impl From<fidl::Channel> for NetworkSynchronousProxy {
844 fn from(value: fidl::Channel) -> Self {
845 Self::new(value)
846 }
847}
848
849#[derive(Debug, Clone)]
850pub struct NetworkProxy {
851 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
852}
853
854impl fidl::endpoints::Proxy for NetworkProxy {
855 type Protocol = NetworkMarker;
856
857 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
858 Self::new(inner)
859 }
860
861 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
862 self.client.into_channel().map_err(|client| Self { client })
863 }
864
865 fn as_channel(&self) -> &::fidl::AsyncChannel {
866 self.client.as_channel()
867 }
868}
869
870impl NetworkProxy {
871 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
873 let protocol_name = <NetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
874 Self { client: fidl::client::Client::new(channel, protocol_name) }
875 }
876
877 pub fn take_event_stream(&self) -> NetworkEventStream {
883 NetworkEventStream { event_receiver: self.client.take_event_receiver() }
884 }
885
886 pub fn r#add_port(
891 &self,
892 mut port: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
893 mut interface: fidl::endpoints::ServerEnd<InterfaceMarker>,
894 ) -> Result<(), fidl::Error> {
895 NetworkProxyInterface::r#add_port(self, port, interface)
896 }
897}
898
899impl NetworkProxyInterface for NetworkProxy {
900 fn r#add_port(
901 &self,
902 mut port: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
903 mut interface: fidl::endpoints::ServerEnd<InterfaceMarker>,
904 ) -> Result<(), fidl::Error> {
905 self.client.send::<NetworkAddPortRequest>(
906 (port, interface),
907 0x7ad6a60c931a3f4e,
908 fidl::encoding::DynamicFlags::empty(),
909 )
910 }
911}
912
913pub struct NetworkEventStream {
914 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
915}
916
917impl std::marker::Unpin for NetworkEventStream {}
918
919impl futures::stream::FusedStream for NetworkEventStream {
920 fn is_terminated(&self) -> bool {
921 self.event_receiver.is_terminated()
922 }
923}
924
925impl futures::Stream for NetworkEventStream {
926 type Item = Result<NetworkEvent, fidl::Error>;
927
928 fn poll_next(
929 mut self: std::pin::Pin<&mut Self>,
930 cx: &mut std::task::Context<'_>,
931 ) -> std::task::Poll<Option<Self::Item>> {
932 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
933 &mut self.event_receiver,
934 cx
935 )?) {
936 Some(buf) => std::task::Poll::Ready(Some(NetworkEvent::decode(buf))),
937 None => std::task::Poll::Ready(None),
938 }
939 }
940}
941
942#[derive(Debug)]
943pub enum NetworkEvent {
944 OnRemoved { reason: NetworkRemovalReason },
945}
946
947impl NetworkEvent {
948 #[allow(irrefutable_let_patterns)]
949 pub fn into_on_removed(self) -> Option<NetworkRemovalReason> {
950 if let NetworkEvent::OnRemoved { reason } = self {
951 Some((reason))
952 } else {
953 None
954 }
955 }
956
957 fn decode(
959 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
960 ) -> Result<NetworkEvent, fidl::Error> {
961 let (bytes, _handles) = buf.split_mut();
962 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
963 debug_assert_eq!(tx_header.tx_id, 0);
964 match tx_header.ordinal {
965 0xfe80656d1e5ec4a => {
966 let mut out = fidl::new_empty!(
967 NetworkOnRemovedRequest,
968 fidl::encoding::DefaultFuchsiaResourceDialect
969 );
970 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NetworkOnRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
971 Ok((NetworkEvent::OnRemoved { reason: out.reason }))
972 }
973 _ => Err(fidl::Error::UnknownOrdinal {
974 ordinal: tx_header.ordinal,
975 protocol_name: <NetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
976 }),
977 }
978 }
979}
980
981pub struct NetworkRequestStream {
983 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
984 is_terminated: bool,
985}
986
987impl std::marker::Unpin for NetworkRequestStream {}
988
989impl futures::stream::FusedStream for NetworkRequestStream {
990 fn is_terminated(&self) -> bool {
991 self.is_terminated
992 }
993}
994
995impl fidl::endpoints::RequestStream for NetworkRequestStream {
996 type Protocol = NetworkMarker;
997 type ControlHandle = NetworkControlHandle;
998
999 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1000 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1001 }
1002
1003 fn control_handle(&self) -> Self::ControlHandle {
1004 NetworkControlHandle { inner: self.inner.clone() }
1005 }
1006
1007 fn into_inner(
1008 self,
1009 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1010 {
1011 (self.inner, self.is_terminated)
1012 }
1013
1014 fn from_inner(
1015 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1016 is_terminated: bool,
1017 ) -> Self {
1018 Self { inner, is_terminated }
1019 }
1020}
1021
1022impl futures::Stream for NetworkRequestStream {
1023 type Item = Result<NetworkRequest, fidl::Error>;
1024
1025 fn poll_next(
1026 mut self: std::pin::Pin<&mut Self>,
1027 cx: &mut std::task::Context<'_>,
1028 ) -> std::task::Poll<Option<Self::Item>> {
1029 let this = &mut *self;
1030 if this.inner.check_shutdown(cx) {
1031 this.is_terminated = true;
1032 return std::task::Poll::Ready(None);
1033 }
1034 if this.is_terminated {
1035 panic!("polled NetworkRequestStream after completion");
1036 }
1037 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1038 |bytes, handles| {
1039 match this.inner.channel().read_etc(cx, bytes, handles) {
1040 std::task::Poll::Ready(Ok(())) => {}
1041 std::task::Poll::Pending => return std::task::Poll::Pending,
1042 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1043 this.is_terminated = true;
1044 return std::task::Poll::Ready(None);
1045 }
1046 std::task::Poll::Ready(Err(e)) => {
1047 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1048 e.into(),
1049 ))))
1050 }
1051 }
1052
1053 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1055
1056 std::task::Poll::Ready(Some(match header.ordinal {
1057 0x7ad6a60c931a3f4e => {
1058 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1059 let mut req = fidl::new_empty!(
1060 NetworkAddPortRequest,
1061 fidl::encoding::DefaultFuchsiaResourceDialect
1062 );
1063 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NetworkAddPortRequest>(&header, _body_bytes, handles, &mut req)?;
1064 let control_handle = NetworkControlHandle { inner: this.inner.clone() };
1065 Ok(NetworkRequest::AddPort {
1066 port: req.port,
1067 interface: req.interface,
1068
1069 control_handle,
1070 })
1071 }
1072 _ => Err(fidl::Error::UnknownOrdinal {
1073 ordinal: header.ordinal,
1074 protocol_name:
1075 <NetworkMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1076 }),
1077 }))
1078 },
1079 )
1080 }
1081}
1082
1083#[derive(Debug)]
1093pub enum NetworkRequest {
1094 AddPort {
1099 port: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
1100 interface: fidl::endpoints::ServerEnd<InterfaceMarker>,
1101 control_handle: NetworkControlHandle,
1102 },
1103}
1104
1105impl NetworkRequest {
1106 #[allow(irrefutable_let_patterns)]
1107 pub fn into_add_port(
1108 self,
1109 ) -> Option<(
1110 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
1111 fidl::endpoints::ServerEnd<InterfaceMarker>,
1112 NetworkControlHandle,
1113 )> {
1114 if let NetworkRequest::AddPort { port, interface, control_handle } = self {
1115 Some((port, interface, control_handle))
1116 } else {
1117 None
1118 }
1119 }
1120
1121 pub fn method_name(&self) -> &'static str {
1123 match *self {
1124 NetworkRequest::AddPort { .. } => "add_port",
1125 }
1126 }
1127}
1128
1129#[derive(Debug, Clone)]
1130pub struct NetworkControlHandle {
1131 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1132}
1133
1134impl fidl::endpoints::ControlHandle for NetworkControlHandle {
1135 fn shutdown(&self) {
1136 self.inner.shutdown()
1137 }
1138 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1139 self.inner.shutdown_with_epitaph(status)
1140 }
1141
1142 fn is_closed(&self) -> bool {
1143 self.inner.channel().is_closed()
1144 }
1145 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1146 self.inner.channel().on_closed()
1147 }
1148
1149 #[cfg(target_os = "fuchsia")]
1150 fn signal_peer(
1151 &self,
1152 clear_mask: zx::Signals,
1153 set_mask: zx::Signals,
1154 ) -> Result<(), zx_status::Status> {
1155 use fidl::Peered;
1156 self.inner.channel().signal_peer(clear_mask, set_mask)
1157 }
1158}
1159
1160impl NetworkControlHandle {
1161 pub fn send_on_removed(&self, mut reason: NetworkRemovalReason) -> Result<(), fidl::Error> {
1162 self.inner.send::<NetworkOnRemovedRequest>(
1163 (reason,),
1164 0,
1165 0xfe80656d1e5ec4a,
1166 fidl::encoding::DynamicFlags::empty(),
1167 )
1168 }
1169}
1170
1171mod internal {
1172 use super::*;
1173
1174 impl fidl::encoding::ResourceTypeMarker for ControlCreateNetworkRequest {
1175 type Borrowed<'a> = &'a mut Self;
1176 fn take_or_borrow<'a>(
1177 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1178 ) -> Self::Borrowed<'a> {
1179 value
1180 }
1181 }
1182
1183 unsafe impl fidl::encoding::TypeMarker for ControlCreateNetworkRequest {
1184 type Owned = Self;
1185
1186 #[inline(always)]
1187 fn inline_align(_context: fidl::encoding::Context) -> usize {
1188 8
1189 }
1190
1191 #[inline(always)]
1192 fn inline_size(_context: fidl::encoding::Context) -> usize {
1193 24
1194 }
1195 }
1196
1197 unsafe impl
1198 fidl::encoding::Encode<
1199 ControlCreateNetworkRequest,
1200 fidl::encoding::DefaultFuchsiaResourceDialect,
1201 > for &mut ControlCreateNetworkRequest
1202 {
1203 #[inline]
1204 unsafe fn encode(
1205 self,
1206 encoder: &mut fidl::encoding::Encoder<
1207 '_,
1208 fidl::encoding::DefaultFuchsiaResourceDialect,
1209 >,
1210 offset: usize,
1211 _depth: fidl::encoding::Depth,
1212 ) -> fidl::Result<()> {
1213 encoder.debug_check_bounds::<ControlCreateNetworkRequest>(offset);
1214 fidl::encoding::Encode::<ControlCreateNetworkRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1216 (
1217 <Config as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
1218 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NetworkMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.network),
1219 ),
1220 encoder, offset, _depth
1221 )
1222 }
1223 }
1224 unsafe impl<
1225 T0: fidl::encoding::Encode<Config, fidl::encoding::DefaultFuchsiaResourceDialect>,
1226 T1: fidl::encoding::Encode<
1227 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NetworkMarker>>,
1228 fidl::encoding::DefaultFuchsiaResourceDialect,
1229 >,
1230 >
1231 fidl::encoding::Encode<
1232 ControlCreateNetworkRequest,
1233 fidl::encoding::DefaultFuchsiaResourceDialect,
1234 > for (T0, T1)
1235 {
1236 #[inline]
1237 unsafe fn encode(
1238 self,
1239 encoder: &mut fidl::encoding::Encoder<
1240 '_,
1241 fidl::encoding::DefaultFuchsiaResourceDialect,
1242 >,
1243 offset: usize,
1244 depth: fidl::encoding::Depth,
1245 ) -> fidl::Result<()> {
1246 encoder.debug_check_bounds::<ControlCreateNetworkRequest>(offset);
1247 unsafe {
1250 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1251 (ptr as *mut u64).write_unaligned(0);
1252 }
1253 self.0.encode(encoder, offset + 0, depth)?;
1255 self.1.encode(encoder, offset + 16, depth)?;
1256 Ok(())
1257 }
1258 }
1259
1260 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1261 for ControlCreateNetworkRequest
1262 {
1263 #[inline(always)]
1264 fn new_empty() -> Self {
1265 Self {
1266 config: fidl::new_empty!(Config, fidl::encoding::DefaultFuchsiaResourceDialect),
1267 network: fidl::new_empty!(
1268 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NetworkMarker>>,
1269 fidl::encoding::DefaultFuchsiaResourceDialect
1270 ),
1271 }
1272 }
1273
1274 #[inline]
1275 unsafe fn decode(
1276 &mut self,
1277 decoder: &mut fidl::encoding::Decoder<
1278 '_,
1279 fidl::encoding::DefaultFuchsiaResourceDialect,
1280 >,
1281 offset: usize,
1282 _depth: fidl::encoding::Depth,
1283 ) -> fidl::Result<()> {
1284 decoder.debug_check_bounds::<Self>(offset);
1285 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1287 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1288 let mask = 0xffffffff00000000u64;
1289 let maskedval = padval & mask;
1290 if maskedval != 0 {
1291 return Err(fidl::Error::NonZeroPadding {
1292 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1293 });
1294 }
1295 fidl::decode!(
1296 Config,
1297 fidl::encoding::DefaultFuchsiaResourceDialect,
1298 &mut self.config,
1299 decoder,
1300 offset + 0,
1301 _depth
1302 )?;
1303 fidl::decode!(
1304 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NetworkMarker>>,
1305 fidl::encoding::DefaultFuchsiaResourceDialect,
1306 &mut self.network,
1307 decoder,
1308 offset + 16,
1309 _depth
1310 )?;
1311 Ok(())
1312 }
1313 }
1314
1315 impl fidl::encoding::ResourceTypeMarker for NetworkAddPortRequest {
1316 type Borrowed<'a> = &'a mut Self;
1317 fn take_or_borrow<'a>(
1318 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1319 ) -> Self::Borrowed<'a> {
1320 value
1321 }
1322 }
1323
1324 unsafe impl fidl::encoding::TypeMarker for NetworkAddPortRequest {
1325 type Owned = Self;
1326
1327 #[inline(always)]
1328 fn inline_align(_context: fidl::encoding::Context) -> usize {
1329 4
1330 }
1331
1332 #[inline(always)]
1333 fn inline_size(_context: fidl::encoding::Context) -> usize {
1334 8
1335 }
1336 }
1337
1338 unsafe impl
1339 fidl::encoding::Encode<NetworkAddPortRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
1340 for &mut NetworkAddPortRequest
1341 {
1342 #[inline]
1343 unsafe fn encode(
1344 self,
1345 encoder: &mut fidl::encoding::Encoder<
1346 '_,
1347 fidl::encoding::DefaultFuchsiaResourceDialect,
1348 >,
1349 offset: usize,
1350 _depth: fidl::encoding::Depth,
1351 ) -> fidl::Result<()> {
1352 encoder.debug_check_bounds::<NetworkAddPortRequest>(offset);
1353 fidl::encoding::Encode::<NetworkAddPortRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1355 (
1356 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.port),
1357 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<InterfaceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.interface),
1358 ),
1359 encoder, offset, _depth
1360 )
1361 }
1362 }
1363 unsafe impl<
1364 T0: fidl::encoding::Encode<
1365 fidl::encoding::Endpoint<
1366 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
1367 >,
1368 fidl::encoding::DefaultFuchsiaResourceDialect,
1369 >,
1370 T1: fidl::encoding::Encode<
1371 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<InterfaceMarker>>,
1372 fidl::encoding::DefaultFuchsiaResourceDialect,
1373 >,
1374 >
1375 fidl::encoding::Encode<NetworkAddPortRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
1376 for (T0, T1)
1377 {
1378 #[inline]
1379 unsafe fn encode(
1380 self,
1381 encoder: &mut fidl::encoding::Encoder<
1382 '_,
1383 fidl::encoding::DefaultFuchsiaResourceDialect,
1384 >,
1385 offset: usize,
1386 depth: fidl::encoding::Depth,
1387 ) -> fidl::Result<()> {
1388 encoder.debug_check_bounds::<NetworkAddPortRequest>(offset);
1389 self.0.encode(encoder, offset + 0, depth)?;
1393 self.1.encode(encoder, offset + 4, depth)?;
1394 Ok(())
1395 }
1396 }
1397
1398 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1399 for NetworkAddPortRequest
1400 {
1401 #[inline(always)]
1402 fn new_empty() -> Self {
1403 Self {
1404 port: fidl::new_empty!(
1405 fidl::encoding::Endpoint<
1406 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
1407 >,
1408 fidl::encoding::DefaultFuchsiaResourceDialect
1409 ),
1410 interface: fidl::new_empty!(
1411 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<InterfaceMarker>>,
1412 fidl::encoding::DefaultFuchsiaResourceDialect
1413 ),
1414 }
1415 }
1416
1417 #[inline]
1418 unsafe fn decode(
1419 &mut self,
1420 decoder: &mut fidl::encoding::Decoder<
1421 '_,
1422 fidl::encoding::DefaultFuchsiaResourceDialect,
1423 >,
1424 offset: usize,
1425 _depth: fidl::encoding::Depth,
1426 ) -> fidl::Result<()> {
1427 decoder.debug_check_bounds::<Self>(offset);
1428 fidl::decode!(
1430 fidl::encoding::Endpoint<
1431 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::PortMarker>,
1432 >,
1433 fidl::encoding::DefaultFuchsiaResourceDialect,
1434 &mut self.port,
1435 decoder,
1436 offset + 0,
1437 _depth
1438 )?;
1439 fidl::decode!(
1440 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<InterfaceMarker>>,
1441 fidl::encoding::DefaultFuchsiaResourceDialect,
1442 &mut self.interface,
1443 decoder,
1444 offset + 4,
1445 _depth
1446 )?;
1447 Ok(())
1448 }
1449 }
1450}