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_interfaces_admin_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ControlAddAddressRequest {
16 pub address: fidl_fuchsia_net::Subnet,
17 pub parameters: AddressParameters,
18 pub address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
19}
20
21impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ControlAddAddressRequest {}
22
23#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
24pub struct ControlGetAuthorizationForInterfaceResponse {
25 pub credential: GrantForInterfaceAuthorization,
26}
27
28impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
29 for ControlGetAuthorizationForInterfaceResponse
30{
31}
32
33#[derive(Debug, PartialEq)]
34pub struct DeviceControlCreateInterfaceRequest {
35 pub port: fidl_fuchsia_hardware_network::PortId,
36 pub control: fidl::endpoints::ServerEnd<ControlMarker>,
37 pub options: Options,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
41 for DeviceControlCreateInterfaceRequest
42{
43}
44
45#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46pub struct GrantForInterfaceAuthorization {
47 pub interface_id: u64,
49 pub token: fidl::Event,
51}
52
53impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
54 for GrantForInterfaceAuthorization
55{
56}
57
58#[derive(Debug, PartialEq)]
59pub struct InstallerInstallBlackholeInterfaceRequest {
60 pub interface: fidl::endpoints::ServerEnd<ControlMarker>,
61 pub options: Options,
62}
63
64impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
65 for InstallerInstallBlackholeInterfaceRequest
66{
67}
68
69#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
70pub struct InstallerInstallDeviceRequest {
71 pub device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
72 pub device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
73}
74
75impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
76 for InstallerInstallDeviceRequest
77{
78}
79
80#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85pub struct ProofOfInterfaceAuthorization {
86 pub interface_id: u64,
88 pub token: fidl::Event,
90}
91
92impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
93 for ProofOfInterfaceAuthorization
94{
95}
96
97#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
98pub struct AddressStateProviderMarker;
99
100impl fidl::endpoints::ProtocolMarker for AddressStateProviderMarker {
101 type Proxy = AddressStateProviderProxy;
102 type RequestStream = AddressStateProviderRequestStream;
103 #[cfg(target_os = "fuchsia")]
104 type SynchronousProxy = AddressStateProviderSynchronousProxy;
105
106 const DEBUG_NAME: &'static str = "(anonymous) AddressStateProvider";
107}
108
109pub trait AddressStateProviderProxyInterface: Send + Sync {
110 type UpdateAddressPropertiesResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
111 + Send;
112 fn r#update_address_properties(
113 &self,
114 address_properties: &AddressProperties,
115 ) -> Self::UpdateAddressPropertiesResponseFut;
116 type WatchAddressAssignmentStateResponseFut: std::future::Future<
117 Output = Result<fidl_fuchsia_net_interfaces::AddressAssignmentState, fidl::Error>,
118 > + Send;
119 fn r#watch_address_assignment_state(&self) -> Self::WatchAddressAssignmentStateResponseFut;
120 fn r#detach(&self) -> Result<(), fidl::Error>;
121 fn r#remove(&self) -> Result<(), fidl::Error>;
122}
123#[derive(Debug)]
124#[cfg(target_os = "fuchsia")]
125pub struct AddressStateProviderSynchronousProxy {
126 client: fidl::client::sync::Client,
127}
128
129#[cfg(target_os = "fuchsia")]
130impl fidl::endpoints::SynchronousProxy for AddressStateProviderSynchronousProxy {
131 type Proxy = AddressStateProviderProxy;
132 type Protocol = AddressStateProviderMarker;
133
134 fn from_channel(inner: fidl::Channel) -> Self {
135 Self::new(inner)
136 }
137
138 fn into_channel(self) -> fidl::Channel {
139 self.client.into_channel()
140 }
141
142 fn as_channel(&self) -> &fidl::Channel {
143 self.client.as_channel()
144 }
145}
146
147#[cfg(target_os = "fuchsia")]
148impl AddressStateProviderSynchronousProxy {
149 pub fn new(channel: fidl::Channel) -> Self {
150 let protocol_name =
151 <AddressStateProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
152 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
153 }
154
155 pub fn into_channel(self) -> fidl::Channel {
156 self.client.into_channel()
157 }
158
159 pub fn wait_for_event(
162 &self,
163 deadline: zx::MonotonicInstant,
164 ) -> Result<AddressStateProviderEvent, fidl::Error> {
165 AddressStateProviderEvent::decode(self.client.wait_for_event(deadline)?)
166 }
167
168 pub fn r#update_address_properties(
180 &self,
181 mut address_properties: &AddressProperties,
182 ___deadline: zx::MonotonicInstant,
183 ) -> Result<(), fidl::Error> {
184 let _response = self.client.send_query::<
185 AddressStateProviderUpdateAddressPropertiesRequest,
186 fidl::encoding::EmptyPayload,
187 >(
188 (address_properties,),
189 0x52bdf5ed96ef573c,
190 fidl::encoding::DynamicFlags::empty(),
191 ___deadline,
192 )?;
193 Ok(_response)
194 }
195
196 pub fn r#watch_address_assignment_state(
210 &self,
211 ___deadline: zx::MonotonicInstant,
212 ) -> Result<fidl_fuchsia_net_interfaces::AddressAssignmentState, fidl::Error> {
213 let _response = self.client.send_query::<
214 fidl::encoding::EmptyPayload,
215 AddressStateProviderWatchAddressAssignmentStateResponse,
216 >(
217 (),
218 0x740bb58c1b2d3188,
219 fidl::encoding::DynamicFlags::empty(),
220 ___deadline,
221 )?;
222 Ok(_response.assignment_state)
223 }
224
225 pub fn r#detach(&self) -> Result<(), fidl::Error> {
230 self.client.send::<fidl::encoding::EmptyPayload>(
231 (),
232 0xc752381d739622f,
233 fidl::encoding::DynamicFlags::empty(),
234 )
235 }
236
237 pub fn r#remove(&self) -> Result<(), fidl::Error> {
242 self.client.send::<fidl::encoding::EmptyPayload>(
243 (),
244 0x554407fe183e78ad,
245 fidl::encoding::DynamicFlags::empty(),
246 )
247 }
248}
249
250#[cfg(target_os = "fuchsia")]
251impl From<AddressStateProviderSynchronousProxy> for zx::Handle {
252 fn from(value: AddressStateProviderSynchronousProxy) -> Self {
253 value.into_channel().into()
254 }
255}
256
257#[cfg(target_os = "fuchsia")]
258impl From<fidl::Channel> for AddressStateProviderSynchronousProxy {
259 fn from(value: fidl::Channel) -> Self {
260 Self::new(value)
261 }
262}
263
264#[derive(Debug, Clone)]
265pub struct AddressStateProviderProxy {
266 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
267}
268
269impl fidl::endpoints::Proxy for AddressStateProviderProxy {
270 type Protocol = AddressStateProviderMarker;
271
272 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
273 Self::new(inner)
274 }
275
276 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
277 self.client.into_channel().map_err(|client| Self { client })
278 }
279
280 fn as_channel(&self) -> &::fidl::AsyncChannel {
281 self.client.as_channel()
282 }
283}
284
285impl AddressStateProviderProxy {
286 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
288 let protocol_name =
289 <AddressStateProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
290 Self { client: fidl::client::Client::new(channel, protocol_name) }
291 }
292
293 pub fn take_event_stream(&self) -> AddressStateProviderEventStream {
299 AddressStateProviderEventStream { event_receiver: self.client.take_event_receiver() }
300 }
301
302 pub fn r#update_address_properties(
314 &self,
315 mut address_properties: &AddressProperties,
316 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
317 AddressStateProviderProxyInterface::r#update_address_properties(self, address_properties)
318 }
319
320 pub fn r#watch_address_assignment_state(
334 &self,
335 ) -> fidl::client::QueryResponseFut<
336 fidl_fuchsia_net_interfaces::AddressAssignmentState,
337 fidl::encoding::DefaultFuchsiaResourceDialect,
338 > {
339 AddressStateProviderProxyInterface::r#watch_address_assignment_state(self)
340 }
341
342 pub fn r#detach(&self) -> Result<(), fidl::Error> {
347 AddressStateProviderProxyInterface::r#detach(self)
348 }
349
350 pub fn r#remove(&self) -> Result<(), fidl::Error> {
355 AddressStateProviderProxyInterface::r#remove(self)
356 }
357}
358
359impl AddressStateProviderProxyInterface for AddressStateProviderProxy {
360 type UpdateAddressPropertiesResponseFut =
361 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
362 fn r#update_address_properties(
363 &self,
364 mut address_properties: &AddressProperties,
365 ) -> Self::UpdateAddressPropertiesResponseFut {
366 fn _decode(
367 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
368 ) -> Result<(), fidl::Error> {
369 let _response = fidl::client::decode_transaction_body::<
370 fidl::encoding::EmptyPayload,
371 fidl::encoding::DefaultFuchsiaResourceDialect,
372 0x52bdf5ed96ef573c,
373 >(_buf?)?;
374 Ok(_response)
375 }
376 self.client.send_query_and_decode::<AddressStateProviderUpdateAddressPropertiesRequest, ()>(
377 (address_properties,),
378 0x52bdf5ed96ef573c,
379 fidl::encoding::DynamicFlags::empty(),
380 _decode,
381 )
382 }
383
384 type WatchAddressAssignmentStateResponseFut = fidl::client::QueryResponseFut<
385 fidl_fuchsia_net_interfaces::AddressAssignmentState,
386 fidl::encoding::DefaultFuchsiaResourceDialect,
387 >;
388 fn r#watch_address_assignment_state(&self) -> Self::WatchAddressAssignmentStateResponseFut {
389 fn _decode(
390 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
391 ) -> Result<fidl_fuchsia_net_interfaces::AddressAssignmentState, fidl::Error> {
392 let _response = fidl::client::decode_transaction_body::<
393 AddressStateProviderWatchAddressAssignmentStateResponse,
394 fidl::encoding::DefaultFuchsiaResourceDialect,
395 0x740bb58c1b2d3188,
396 >(_buf?)?;
397 Ok(_response.assignment_state)
398 }
399 self.client.send_query_and_decode::<
400 fidl::encoding::EmptyPayload,
401 fidl_fuchsia_net_interfaces::AddressAssignmentState,
402 >(
403 (),
404 0x740bb58c1b2d3188,
405 fidl::encoding::DynamicFlags::empty(),
406 _decode,
407 )
408 }
409
410 fn r#detach(&self) -> Result<(), fidl::Error> {
411 self.client.send::<fidl::encoding::EmptyPayload>(
412 (),
413 0xc752381d739622f,
414 fidl::encoding::DynamicFlags::empty(),
415 )
416 }
417
418 fn r#remove(&self) -> Result<(), fidl::Error> {
419 self.client.send::<fidl::encoding::EmptyPayload>(
420 (),
421 0x554407fe183e78ad,
422 fidl::encoding::DynamicFlags::empty(),
423 )
424 }
425}
426
427pub struct AddressStateProviderEventStream {
428 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
429}
430
431impl std::marker::Unpin for AddressStateProviderEventStream {}
432
433impl futures::stream::FusedStream for AddressStateProviderEventStream {
434 fn is_terminated(&self) -> bool {
435 self.event_receiver.is_terminated()
436 }
437}
438
439impl futures::Stream for AddressStateProviderEventStream {
440 type Item = Result<AddressStateProviderEvent, fidl::Error>;
441
442 fn poll_next(
443 mut self: std::pin::Pin<&mut Self>,
444 cx: &mut std::task::Context<'_>,
445 ) -> std::task::Poll<Option<Self::Item>> {
446 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
447 &mut self.event_receiver,
448 cx
449 )?) {
450 Some(buf) => std::task::Poll::Ready(Some(AddressStateProviderEvent::decode(buf))),
451 None => std::task::Poll::Ready(None),
452 }
453 }
454}
455
456#[derive(Debug)]
457pub enum AddressStateProviderEvent {
458 OnAddressAdded {},
459 OnAddressRemoved { error: AddressRemovalReason },
460}
461
462impl AddressStateProviderEvent {
463 #[allow(irrefutable_let_patterns)]
464 pub fn into_on_address_added(self) -> Option<()> {
465 if let AddressStateProviderEvent::OnAddressAdded {} = self {
466 Some(())
467 } else {
468 None
469 }
470 }
471 #[allow(irrefutable_let_patterns)]
472 pub fn into_on_address_removed(self) -> Option<AddressRemovalReason> {
473 if let AddressStateProviderEvent::OnAddressRemoved { error } = self {
474 Some((error))
475 } else {
476 None
477 }
478 }
479
480 fn decode(
482 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
483 ) -> Result<AddressStateProviderEvent, fidl::Error> {
484 let (bytes, _handles) = buf.split_mut();
485 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
486 debug_assert_eq!(tx_header.tx_id, 0);
487 match tx_header.ordinal {
488 0x624f6ea62cce189e => {
489 let mut out = fidl::new_empty!(
490 fidl::encoding::EmptyPayload,
491 fidl::encoding::DefaultFuchsiaResourceDialect
492 );
493 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
494 Ok((AddressStateProviderEvent::OnAddressAdded {}))
495 }
496 0x2480eb672ffd5962 => {
497 let mut out = fidl::new_empty!(
498 AddressStateProviderOnAddressRemovedRequest,
499 fidl::encoding::DefaultFuchsiaResourceDialect
500 );
501 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AddressStateProviderOnAddressRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
502 Ok((AddressStateProviderEvent::OnAddressRemoved { error: out.error }))
503 }
504 _ => Err(fidl::Error::UnknownOrdinal {
505 ordinal: tx_header.ordinal,
506 protocol_name:
507 <AddressStateProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
508 }),
509 }
510 }
511}
512
513pub struct AddressStateProviderRequestStream {
515 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
516 is_terminated: bool,
517}
518
519impl std::marker::Unpin for AddressStateProviderRequestStream {}
520
521impl futures::stream::FusedStream for AddressStateProviderRequestStream {
522 fn is_terminated(&self) -> bool {
523 self.is_terminated
524 }
525}
526
527impl fidl::endpoints::RequestStream for AddressStateProviderRequestStream {
528 type Protocol = AddressStateProviderMarker;
529 type ControlHandle = AddressStateProviderControlHandle;
530
531 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
532 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
533 }
534
535 fn control_handle(&self) -> Self::ControlHandle {
536 AddressStateProviderControlHandle { inner: self.inner.clone() }
537 }
538
539 fn into_inner(
540 self,
541 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
542 {
543 (self.inner, self.is_terminated)
544 }
545
546 fn from_inner(
547 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
548 is_terminated: bool,
549 ) -> Self {
550 Self { inner, is_terminated }
551 }
552}
553
554impl futures::Stream for AddressStateProviderRequestStream {
555 type Item = Result<AddressStateProviderRequest, fidl::Error>;
556
557 fn poll_next(
558 mut self: std::pin::Pin<&mut Self>,
559 cx: &mut std::task::Context<'_>,
560 ) -> std::task::Poll<Option<Self::Item>> {
561 let this = &mut *self;
562 if this.inner.check_shutdown(cx) {
563 this.is_terminated = true;
564 return std::task::Poll::Ready(None);
565 }
566 if this.is_terminated {
567 panic!("polled AddressStateProviderRequestStream after completion");
568 }
569 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
570 |bytes, handles| {
571 match this.inner.channel().read_etc(cx, bytes, handles) {
572 std::task::Poll::Ready(Ok(())) => {}
573 std::task::Poll::Pending => return std::task::Poll::Pending,
574 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
575 this.is_terminated = true;
576 return std::task::Poll::Ready(None);
577 }
578 std::task::Poll::Ready(Err(e)) => {
579 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
580 e.into(),
581 ))))
582 }
583 }
584
585 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
587
588 std::task::Poll::Ready(Some(match header.ordinal {
589 0x52bdf5ed96ef573c => {
590 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
591 let mut req = fidl::new_empty!(AddressStateProviderUpdateAddressPropertiesRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
592 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AddressStateProviderUpdateAddressPropertiesRequest>(&header, _body_bytes, handles, &mut req)?;
593 let control_handle = AddressStateProviderControlHandle {
594 inner: this.inner.clone(),
595 };
596 Ok(AddressStateProviderRequest::UpdateAddressProperties {address_properties: req.address_properties,
597
598 responder: AddressStateProviderUpdateAddressPropertiesResponder {
599 control_handle: std::mem::ManuallyDrop::new(control_handle),
600 tx_id: header.tx_id,
601 },
602 })
603 }
604 0x740bb58c1b2d3188 => {
605 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
606 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
607 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
608 let control_handle = AddressStateProviderControlHandle {
609 inner: this.inner.clone(),
610 };
611 Ok(AddressStateProviderRequest::WatchAddressAssignmentState {
612 responder: AddressStateProviderWatchAddressAssignmentStateResponder {
613 control_handle: std::mem::ManuallyDrop::new(control_handle),
614 tx_id: header.tx_id,
615 },
616 })
617 }
618 0xc752381d739622f => {
619 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
620 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
621 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
622 let control_handle = AddressStateProviderControlHandle {
623 inner: this.inner.clone(),
624 };
625 Ok(AddressStateProviderRequest::Detach {
626 control_handle,
627 })
628 }
629 0x554407fe183e78ad => {
630 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
631 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
632 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
633 let control_handle = AddressStateProviderControlHandle {
634 inner: this.inner.clone(),
635 };
636 Ok(AddressStateProviderRequest::Remove {
637 control_handle,
638 })
639 }
640 _ => Err(fidl::Error::UnknownOrdinal {
641 ordinal: header.ordinal,
642 protocol_name: <AddressStateProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
643 }),
644 }))
645 },
646 )
647 }
648}
649
650#[derive(Debug)]
660pub enum AddressStateProviderRequest {
661 UpdateAddressProperties {
673 address_properties: AddressProperties,
674 responder: AddressStateProviderUpdateAddressPropertiesResponder,
675 },
676 WatchAddressAssignmentState {
690 responder: AddressStateProviderWatchAddressAssignmentStateResponder,
691 },
692 Detach { control_handle: AddressStateProviderControlHandle },
697 Remove { control_handle: AddressStateProviderControlHandle },
702}
703
704impl AddressStateProviderRequest {
705 #[allow(irrefutable_let_patterns)]
706 pub fn into_update_address_properties(
707 self,
708 ) -> Option<(AddressProperties, AddressStateProviderUpdateAddressPropertiesResponder)> {
709 if let AddressStateProviderRequest::UpdateAddressProperties {
710 address_properties,
711 responder,
712 } = self
713 {
714 Some((address_properties, responder))
715 } else {
716 None
717 }
718 }
719
720 #[allow(irrefutable_let_patterns)]
721 pub fn into_watch_address_assignment_state(
722 self,
723 ) -> Option<(AddressStateProviderWatchAddressAssignmentStateResponder)> {
724 if let AddressStateProviderRequest::WatchAddressAssignmentState { responder } = self {
725 Some((responder))
726 } else {
727 None
728 }
729 }
730
731 #[allow(irrefutable_let_patterns)]
732 pub fn into_detach(self) -> Option<(AddressStateProviderControlHandle)> {
733 if let AddressStateProviderRequest::Detach { control_handle } = self {
734 Some((control_handle))
735 } else {
736 None
737 }
738 }
739
740 #[allow(irrefutable_let_patterns)]
741 pub fn into_remove(self) -> Option<(AddressStateProviderControlHandle)> {
742 if let AddressStateProviderRequest::Remove { control_handle } = self {
743 Some((control_handle))
744 } else {
745 None
746 }
747 }
748
749 pub fn method_name(&self) -> &'static str {
751 match *self {
752 AddressStateProviderRequest::UpdateAddressProperties { .. } => {
753 "update_address_properties"
754 }
755 AddressStateProviderRequest::WatchAddressAssignmentState { .. } => {
756 "watch_address_assignment_state"
757 }
758 AddressStateProviderRequest::Detach { .. } => "detach",
759 AddressStateProviderRequest::Remove { .. } => "remove",
760 }
761 }
762}
763
764#[derive(Debug, Clone)]
765pub struct AddressStateProviderControlHandle {
766 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
767}
768
769impl fidl::endpoints::ControlHandle for AddressStateProviderControlHandle {
770 fn shutdown(&self) {
771 self.inner.shutdown()
772 }
773 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
774 self.inner.shutdown_with_epitaph(status)
775 }
776
777 fn is_closed(&self) -> bool {
778 self.inner.channel().is_closed()
779 }
780 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
781 self.inner.channel().on_closed()
782 }
783
784 #[cfg(target_os = "fuchsia")]
785 fn signal_peer(
786 &self,
787 clear_mask: zx::Signals,
788 set_mask: zx::Signals,
789 ) -> Result<(), zx_status::Status> {
790 use fidl::Peered;
791 self.inner.channel().signal_peer(clear_mask, set_mask)
792 }
793}
794
795impl AddressStateProviderControlHandle {
796 pub fn send_on_address_added(&self) -> Result<(), fidl::Error> {
797 self.inner.send::<fidl::encoding::EmptyPayload>(
798 (),
799 0,
800 0x624f6ea62cce189e,
801 fidl::encoding::DynamicFlags::empty(),
802 )
803 }
804
805 pub fn send_on_address_removed(
806 &self,
807 mut error: AddressRemovalReason,
808 ) -> Result<(), fidl::Error> {
809 self.inner.send::<AddressStateProviderOnAddressRemovedRequest>(
810 (error,),
811 0,
812 0x2480eb672ffd5962,
813 fidl::encoding::DynamicFlags::empty(),
814 )
815 }
816}
817
818#[must_use = "FIDL methods require a response to be sent"]
819#[derive(Debug)]
820pub struct AddressStateProviderUpdateAddressPropertiesResponder {
821 control_handle: std::mem::ManuallyDrop<AddressStateProviderControlHandle>,
822 tx_id: u32,
823}
824
825impl std::ops::Drop for AddressStateProviderUpdateAddressPropertiesResponder {
829 fn drop(&mut self) {
830 self.control_handle.shutdown();
831 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
833 }
834}
835
836impl fidl::endpoints::Responder for AddressStateProviderUpdateAddressPropertiesResponder {
837 type ControlHandle = AddressStateProviderControlHandle;
838
839 fn control_handle(&self) -> &AddressStateProviderControlHandle {
840 &self.control_handle
841 }
842
843 fn drop_without_shutdown(mut self) {
844 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
846 std::mem::forget(self);
848 }
849}
850
851impl AddressStateProviderUpdateAddressPropertiesResponder {
852 pub fn send(self) -> Result<(), fidl::Error> {
856 let _result = self.send_raw();
857 if _result.is_err() {
858 self.control_handle.shutdown();
859 }
860 self.drop_without_shutdown();
861 _result
862 }
863
864 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
866 let _result = self.send_raw();
867 self.drop_without_shutdown();
868 _result
869 }
870
871 fn send_raw(&self) -> Result<(), fidl::Error> {
872 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
873 (),
874 self.tx_id,
875 0x52bdf5ed96ef573c,
876 fidl::encoding::DynamicFlags::empty(),
877 )
878 }
879}
880
881#[must_use = "FIDL methods require a response to be sent"]
882#[derive(Debug)]
883pub struct AddressStateProviderWatchAddressAssignmentStateResponder {
884 control_handle: std::mem::ManuallyDrop<AddressStateProviderControlHandle>,
885 tx_id: u32,
886}
887
888impl std::ops::Drop for AddressStateProviderWatchAddressAssignmentStateResponder {
892 fn drop(&mut self) {
893 self.control_handle.shutdown();
894 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
896 }
897}
898
899impl fidl::endpoints::Responder for AddressStateProviderWatchAddressAssignmentStateResponder {
900 type ControlHandle = AddressStateProviderControlHandle;
901
902 fn control_handle(&self) -> &AddressStateProviderControlHandle {
903 &self.control_handle
904 }
905
906 fn drop_without_shutdown(mut self) {
907 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
909 std::mem::forget(self);
911 }
912}
913
914impl AddressStateProviderWatchAddressAssignmentStateResponder {
915 pub fn send(
919 self,
920 mut assignment_state: fidl_fuchsia_net_interfaces::AddressAssignmentState,
921 ) -> Result<(), fidl::Error> {
922 let _result = self.send_raw(assignment_state);
923 if _result.is_err() {
924 self.control_handle.shutdown();
925 }
926 self.drop_without_shutdown();
927 _result
928 }
929
930 pub fn send_no_shutdown_on_err(
932 self,
933 mut assignment_state: fidl_fuchsia_net_interfaces::AddressAssignmentState,
934 ) -> Result<(), fidl::Error> {
935 let _result = self.send_raw(assignment_state);
936 self.drop_without_shutdown();
937 _result
938 }
939
940 fn send_raw(
941 &self,
942 mut assignment_state: fidl_fuchsia_net_interfaces::AddressAssignmentState,
943 ) -> Result<(), fidl::Error> {
944 self.control_handle.inner.send::<AddressStateProviderWatchAddressAssignmentStateResponse>(
945 (assignment_state,),
946 self.tx_id,
947 0x740bb58c1b2d3188,
948 fidl::encoding::DynamicFlags::empty(),
949 )
950 }
951}
952
953#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
954pub struct ControlMarker;
955
956impl fidl::endpoints::ProtocolMarker for ControlMarker {
957 type Proxy = ControlProxy;
958 type RequestStream = ControlRequestStream;
959 #[cfg(target_os = "fuchsia")]
960 type SynchronousProxy = ControlSynchronousProxy;
961
962 const DEBUG_NAME: &'static str = "(anonymous) Control";
963}
964pub type ControlRemoveAddressResult = Result<bool, ControlRemoveAddressError>;
965pub type ControlSetConfigurationResult = Result<Configuration, ControlSetConfigurationError>;
966pub type ControlGetConfigurationResult = Result<Configuration, ControlGetConfigurationError>;
967pub type ControlEnableResult = Result<bool, ControlEnableError>;
968pub type ControlDisableResult = Result<bool, ControlDisableError>;
969pub type ControlRemoveResult = Result<(), ControlRemoveError>;
970
971pub trait ControlProxyInterface: Send + Sync {
972 fn r#add_address(
973 &self,
974 address: &fidl_fuchsia_net::Subnet,
975 parameters: &AddressParameters,
976 address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
977 ) -> Result<(), fidl::Error>;
978 type RemoveAddressResponseFut: std::future::Future<Output = Result<ControlRemoveAddressResult, fidl::Error>>
979 + Send;
980 fn r#remove_address(
981 &self,
982 address: &fidl_fuchsia_net::Subnet,
983 ) -> Self::RemoveAddressResponseFut;
984 type GetIdResponseFut: std::future::Future<Output = Result<u64, fidl::Error>> + Send;
985 fn r#get_id(&self) -> Self::GetIdResponseFut;
986 type SetConfigurationResponseFut: std::future::Future<Output = Result<ControlSetConfigurationResult, fidl::Error>>
987 + Send;
988 fn r#set_configuration(&self, config: &Configuration) -> Self::SetConfigurationResponseFut;
989 type GetConfigurationResponseFut: std::future::Future<Output = Result<ControlGetConfigurationResult, fidl::Error>>
990 + Send;
991 fn r#get_configuration(&self) -> Self::GetConfigurationResponseFut;
992 type EnableResponseFut: std::future::Future<Output = Result<ControlEnableResult, fidl::Error>>
993 + Send;
994 fn r#enable(&self) -> Self::EnableResponseFut;
995 type DisableResponseFut: std::future::Future<Output = Result<ControlDisableResult, fidl::Error>>
996 + Send;
997 fn r#disable(&self) -> Self::DisableResponseFut;
998 fn r#detach(&self) -> Result<(), fidl::Error>;
999 type GetAuthorizationForInterfaceResponseFut: std::future::Future<Output = Result<GrantForInterfaceAuthorization, fidl::Error>>
1000 + Send;
1001 fn r#get_authorization_for_interface(&self) -> Self::GetAuthorizationForInterfaceResponseFut;
1002 type RemoveResponseFut: std::future::Future<Output = Result<ControlRemoveResult, fidl::Error>>
1003 + Send;
1004 fn r#remove(&self) -> Self::RemoveResponseFut;
1005}
1006#[derive(Debug)]
1007#[cfg(target_os = "fuchsia")]
1008pub struct ControlSynchronousProxy {
1009 client: fidl::client::sync::Client,
1010}
1011
1012#[cfg(target_os = "fuchsia")]
1013impl fidl::endpoints::SynchronousProxy for ControlSynchronousProxy {
1014 type Proxy = ControlProxy;
1015 type Protocol = ControlMarker;
1016
1017 fn from_channel(inner: fidl::Channel) -> Self {
1018 Self::new(inner)
1019 }
1020
1021 fn into_channel(self) -> fidl::Channel {
1022 self.client.into_channel()
1023 }
1024
1025 fn as_channel(&self) -> &fidl::Channel {
1026 self.client.as_channel()
1027 }
1028}
1029
1030#[cfg(target_os = "fuchsia")]
1031impl ControlSynchronousProxy {
1032 pub fn new(channel: fidl::Channel) -> Self {
1033 let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1034 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1035 }
1036
1037 pub fn into_channel(self) -> fidl::Channel {
1038 self.client.into_channel()
1039 }
1040
1041 pub fn wait_for_event(
1044 &self,
1045 deadline: zx::MonotonicInstant,
1046 ) -> Result<ControlEvent, fidl::Error> {
1047 ControlEvent::decode(self.client.wait_for_event(deadline)?)
1048 }
1049
1050 pub fn r#add_address(
1060 &self,
1061 mut address: &fidl_fuchsia_net::Subnet,
1062 mut parameters: &AddressParameters,
1063 mut address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
1064 ) -> Result<(), fidl::Error> {
1065 self.client.send::<ControlAddAddressRequest>(
1066 (address, parameters, address_state_provider),
1067 0x1349d36da453ce,
1068 fidl::encoding::DynamicFlags::empty(),
1069 )
1070 }
1071
1072 pub fn r#remove_address(
1078 &self,
1079 mut address: &fidl_fuchsia_net::Subnet,
1080 ___deadline: zx::MonotonicInstant,
1081 ) -> Result<ControlRemoveAddressResult, fidl::Error> {
1082 let _response =
1083 self.client.send_query::<ControlRemoveAddressRequest, fidl::encoding::ResultType<
1084 ControlRemoveAddressResponse,
1085 ControlRemoveAddressError,
1086 >>(
1087 (address,),
1088 0x213ba73da997a620,
1089 fidl::encoding::DynamicFlags::empty(),
1090 ___deadline,
1091 )?;
1092 Ok(_response.map(|x| x.did_remove))
1093 }
1094
1095 pub fn r#get_id(&self, ___deadline: zx::MonotonicInstant) -> Result<u64, fidl::Error> {
1099 let _response =
1100 self.client.send_query::<fidl::encoding::EmptyPayload, ControlGetIdResponse>(
1101 (),
1102 0x2a2459768d9ecc6f,
1103 fidl::encoding::DynamicFlags::empty(),
1104 ___deadline,
1105 )?;
1106 Ok(_response.id)
1107 }
1108
1109 pub fn r#set_configuration(
1121 &self,
1122 mut config: &Configuration,
1123 ___deadline: zx::MonotonicInstant,
1124 ) -> Result<ControlSetConfigurationResult, fidl::Error> {
1125 let _response = self
1126 .client
1127 .send_query::<ControlSetConfigurationRequest, fidl::encoding::ResultType<
1128 ControlSetConfigurationResponse,
1129 ControlSetConfigurationError,
1130 >>(
1131 (config,), 0x573923b7b4bde27f, fidl::encoding::DynamicFlags::empty(), ___deadline
1132 )?;
1133 Ok(_response.map(|x| x.previous_config))
1134 }
1135
1136 pub fn r#get_configuration(
1145 &self,
1146 ___deadline: zx::MonotonicInstant,
1147 ) -> Result<ControlGetConfigurationResult, fidl::Error> {
1148 let _response = self
1149 .client
1150 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1151 ControlGetConfigurationResponse,
1152 ControlGetConfigurationError,
1153 >>(
1154 (), 0x5f5d239820bdcc65, fidl::encoding::DynamicFlags::empty(), ___deadline
1155 )?;
1156 Ok(_response.map(|x| x.config))
1157 }
1158
1159 pub fn r#enable(
1164 &self,
1165 ___deadline: zx::MonotonicInstant,
1166 ) -> Result<ControlEnableResult, fidl::Error> {
1167 let _response = self.client.send_query::<
1168 fidl::encoding::EmptyPayload,
1169 fidl::encoding::ResultType<ControlEnableResponse, ControlEnableError>,
1170 >(
1171 (),
1172 0x15c983d3a8ac0b98,
1173 fidl::encoding::DynamicFlags::empty(),
1174 ___deadline,
1175 )?;
1176 Ok(_response.map(|x| x.did_enable))
1177 }
1178
1179 pub fn r#disable(
1184 &self,
1185 ___deadline: zx::MonotonicInstant,
1186 ) -> Result<ControlDisableResult, fidl::Error> {
1187 let _response = self.client.send_query::<
1188 fidl::encoding::EmptyPayload,
1189 fidl::encoding::ResultType<ControlDisableResponse, ControlDisableError>,
1190 >(
1191 (),
1192 0x98d3a585d905473,
1193 fidl::encoding::DynamicFlags::empty(),
1194 ___deadline,
1195 )?;
1196 Ok(_response.map(|x| x.did_disable))
1197 }
1198
1199 pub fn r#detach(&self) -> Result<(), fidl::Error> {
1204 self.client.send::<fidl::encoding::EmptyPayload>(
1205 (),
1206 0x78ee27518b2dbfa,
1207 fidl::encoding::DynamicFlags::empty(),
1208 )
1209 }
1210
1211 pub fn r#get_authorization_for_interface(
1223 &self,
1224 ___deadline: zx::MonotonicInstant,
1225 ) -> Result<GrantForInterfaceAuthorization, fidl::Error> {
1226 let _response = self.client.send_query::<
1227 fidl::encoding::EmptyPayload,
1228 ControlGetAuthorizationForInterfaceResponse,
1229 >(
1230 (),
1231 0xc1de2ab60b5cb9e,
1232 fidl::encoding::DynamicFlags::empty(),
1233 ___deadline,
1234 )?;
1235 Ok(_response.credential)
1236 }
1237
1238 pub fn r#remove(
1244 &self,
1245 ___deadline: zx::MonotonicInstant,
1246 ) -> Result<ControlRemoveResult, fidl::Error> {
1247 let _response =
1248 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1249 fidl::encoding::EmptyStruct,
1250 ControlRemoveError,
1251 >>(
1252 (),
1253 0x13aab8bbecc7ff0b,
1254 fidl::encoding::DynamicFlags::empty(),
1255 ___deadline,
1256 )?;
1257 Ok(_response.map(|x| x))
1258 }
1259}
1260
1261#[cfg(target_os = "fuchsia")]
1262impl From<ControlSynchronousProxy> for zx::Handle {
1263 fn from(value: ControlSynchronousProxy) -> Self {
1264 value.into_channel().into()
1265 }
1266}
1267
1268#[cfg(target_os = "fuchsia")]
1269impl From<fidl::Channel> for ControlSynchronousProxy {
1270 fn from(value: fidl::Channel) -> Self {
1271 Self::new(value)
1272 }
1273}
1274
1275#[derive(Debug, Clone)]
1276pub struct ControlProxy {
1277 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1278}
1279
1280impl fidl::endpoints::Proxy for ControlProxy {
1281 type Protocol = ControlMarker;
1282
1283 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1284 Self::new(inner)
1285 }
1286
1287 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1288 self.client.into_channel().map_err(|client| Self { client })
1289 }
1290
1291 fn as_channel(&self) -> &::fidl::AsyncChannel {
1292 self.client.as_channel()
1293 }
1294}
1295
1296impl ControlProxy {
1297 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1299 let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1300 Self { client: fidl::client::Client::new(channel, protocol_name) }
1301 }
1302
1303 pub fn take_event_stream(&self) -> ControlEventStream {
1309 ControlEventStream { event_receiver: self.client.take_event_receiver() }
1310 }
1311
1312 pub fn r#add_address(
1322 &self,
1323 mut address: &fidl_fuchsia_net::Subnet,
1324 mut parameters: &AddressParameters,
1325 mut address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
1326 ) -> Result<(), fidl::Error> {
1327 ControlProxyInterface::r#add_address(self, address, parameters, address_state_provider)
1328 }
1329
1330 pub fn r#remove_address(
1336 &self,
1337 mut address: &fidl_fuchsia_net::Subnet,
1338 ) -> fidl::client::QueryResponseFut<
1339 ControlRemoveAddressResult,
1340 fidl::encoding::DefaultFuchsiaResourceDialect,
1341 > {
1342 ControlProxyInterface::r#remove_address(self, address)
1343 }
1344
1345 pub fn r#get_id(
1349 &self,
1350 ) -> fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect> {
1351 ControlProxyInterface::r#get_id(self)
1352 }
1353
1354 pub fn r#set_configuration(
1366 &self,
1367 mut config: &Configuration,
1368 ) -> fidl::client::QueryResponseFut<
1369 ControlSetConfigurationResult,
1370 fidl::encoding::DefaultFuchsiaResourceDialect,
1371 > {
1372 ControlProxyInterface::r#set_configuration(self, config)
1373 }
1374
1375 pub fn r#get_configuration(
1384 &self,
1385 ) -> fidl::client::QueryResponseFut<
1386 ControlGetConfigurationResult,
1387 fidl::encoding::DefaultFuchsiaResourceDialect,
1388 > {
1389 ControlProxyInterface::r#get_configuration(self)
1390 }
1391
1392 pub fn r#enable(
1397 &self,
1398 ) -> fidl::client::QueryResponseFut<
1399 ControlEnableResult,
1400 fidl::encoding::DefaultFuchsiaResourceDialect,
1401 > {
1402 ControlProxyInterface::r#enable(self)
1403 }
1404
1405 pub fn r#disable(
1410 &self,
1411 ) -> fidl::client::QueryResponseFut<
1412 ControlDisableResult,
1413 fidl::encoding::DefaultFuchsiaResourceDialect,
1414 > {
1415 ControlProxyInterface::r#disable(self)
1416 }
1417
1418 pub fn r#detach(&self) -> Result<(), fidl::Error> {
1423 ControlProxyInterface::r#detach(self)
1424 }
1425
1426 pub fn r#get_authorization_for_interface(
1438 &self,
1439 ) -> fidl::client::QueryResponseFut<
1440 GrantForInterfaceAuthorization,
1441 fidl::encoding::DefaultFuchsiaResourceDialect,
1442 > {
1443 ControlProxyInterface::r#get_authorization_for_interface(self)
1444 }
1445
1446 pub fn r#remove(
1452 &self,
1453 ) -> fidl::client::QueryResponseFut<
1454 ControlRemoveResult,
1455 fidl::encoding::DefaultFuchsiaResourceDialect,
1456 > {
1457 ControlProxyInterface::r#remove(self)
1458 }
1459}
1460
1461impl ControlProxyInterface for ControlProxy {
1462 fn r#add_address(
1463 &self,
1464 mut address: &fidl_fuchsia_net::Subnet,
1465 mut parameters: &AddressParameters,
1466 mut address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
1467 ) -> Result<(), fidl::Error> {
1468 self.client.send::<ControlAddAddressRequest>(
1469 (address, parameters, address_state_provider),
1470 0x1349d36da453ce,
1471 fidl::encoding::DynamicFlags::empty(),
1472 )
1473 }
1474
1475 type RemoveAddressResponseFut = fidl::client::QueryResponseFut<
1476 ControlRemoveAddressResult,
1477 fidl::encoding::DefaultFuchsiaResourceDialect,
1478 >;
1479 fn r#remove_address(
1480 &self,
1481 mut address: &fidl_fuchsia_net::Subnet,
1482 ) -> Self::RemoveAddressResponseFut {
1483 fn _decode(
1484 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1485 ) -> Result<ControlRemoveAddressResult, fidl::Error> {
1486 let _response = fidl::client::decode_transaction_body::<
1487 fidl::encoding::ResultType<ControlRemoveAddressResponse, ControlRemoveAddressError>,
1488 fidl::encoding::DefaultFuchsiaResourceDialect,
1489 0x213ba73da997a620,
1490 >(_buf?)?;
1491 Ok(_response.map(|x| x.did_remove))
1492 }
1493 self.client
1494 .send_query_and_decode::<ControlRemoveAddressRequest, ControlRemoveAddressResult>(
1495 (address,),
1496 0x213ba73da997a620,
1497 fidl::encoding::DynamicFlags::empty(),
1498 _decode,
1499 )
1500 }
1501
1502 type GetIdResponseFut =
1503 fidl::client::QueryResponseFut<u64, fidl::encoding::DefaultFuchsiaResourceDialect>;
1504 fn r#get_id(&self) -> Self::GetIdResponseFut {
1505 fn _decode(
1506 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1507 ) -> Result<u64, fidl::Error> {
1508 let _response = fidl::client::decode_transaction_body::<
1509 ControlGetIdResponse,
1510 fidl::encoding::DefaultFuchsiaResourceDialect,
1511 0x2a2459768d9ecc6f,
1512 >(_buf?)?;
1513 Ok(_response.id)
1514 }
1515 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u64>(
1516 (),
1517 0x2a2459768d9ecc6f,
1518 fidl::encoding::DynamicFlags::empty(),
1519 _decode,
1520 )
1521 }
1522
1523 type SetConfigurationResponseFut = fidl::client::QueryResponseFut<
1524 ControlSetConfigurationResult,
1525 fidl::encoding::DefaultFuchsiaResourceDialect,
1526 >;
1527 fn r#set_configuration(&self, mut config: &Configuration) -> Self::SetConfigurationResponseFut {
1528 fn _decode(
1529 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1530 ) -> Result<ControlSetConfigurationResult, fidl::Error> {
1531 let _response = fidl::client::decode_transaction_body::<
1532 fidl::encoding::ResultType<
1533 ControlSetConfigurationResponse,
1534 ControlSetConfigurationError,
1535 >,
1536 fidl::encoding::DefaultFuchsiaResourceDialect,
1537 0x573923b7b4bde27f,
1538 >(_buf?)?;
1539 Ok(_response.map(|x| x.previous_config))
1540 }
1541 self.client
1542 .send_query_and_decode::<ControlSetConfigurationRequest, ControlSetConfigurationResult>(
1543 (config,),
1544 0x573923b7b4bde27f,
1545 fidl::encoding::DynamicFlags::empty(),
1546 _decode,
1547 )
1548 }
1549
1550 type GetConfigurationResponseFut = fidl::client::QueryResponseFut<
1551 ControlGetConfigurationResult,
1552 fidl::encoding::DefaultFuchsiaResourceDialect,
1553 >;
1554 fn r#get_configuration(&self) -> Self::GetConfigurationResponseFut {
1555 fn _decode(
1556 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1557 ) -> Result<ControlGetConfigurationResult, fidl::Error> {
1558 let _response = fidl::client::decode_transaction_body::<
1559 fidl::encoding::ResultType<
1560 ControlGetConfigurationResponse,
1561 ControlGetConfigurationError,
1562 >,
1563 fidl::encoding::DefaultFuchsiaResourceDialect,
1564 0x5f5d239820bdcc65,
1565 >(_buf?)?;
1566 Ok(_response.map(|x| x.config))
1567 }
1568 self.client
1569 .send_query_and_decode::<fidl::encoding::EmptyPayload, ControlGetConfigurationResult>(
1570 (),
1571 0x5f5d239820bdcc65,
1572 fidl::encoding::DynamicFlags::empty(),
1573 _decode,
1574 )
1575 }
1576
1577 type EnableResponseFut = fidl::client::QueryResponseFut<
1578 ControlEnableResult,
1579 fidl::encoding::DefaultFuchsiaResourceDialect,
1580 >;
1581 fn r#enable(&self) -> Self::EnableResponseFut {
1582 fn _decode(
1583 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1584 ) -> Result<ControlEnableResult, fidl::Error> {
1585 let _response = fidl::client::decode_transaction_body::<
1586 fidl::encoding::ResultType<ControlEnableResponse, ControlEnableError>,
1587 fidl::encoding::DefaultFuchsiaResourceDialect,
1588 0x15c983d3a8ac0b98,
1589 >(_buf?)?;
1590 Ok(_response.map(|x| x.did_enable))
1591 }
1592 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControlEnableResult>(
1593 (),
1594 0x15c983d3a8ac0b98,
1595 fidl::encoding::DynamicFlags::empty(),
1596 _decode,
1597 )
1598 }
1599
1600 type DisableResponseFut = fidl::client::QueryResponseFut<
1601 ControlDisableResult,
1602 fidl::encoding::DefaultFuchsiaResourceDialect,
1603 >;
1604 fn r#disable(&self) -> Self::DisableResponseFut {
1605 fn _decode(
1606 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1607 ) -> Result<ControlDisableResult, fidl::Error> {
1608 let _response = fidl::client::decode_transaction_body::<
1609 fidl::encoding::ResultType<ControlDisableResponse, ControlDisableError>,
1610 fidl::encoding::DefaultFuchsiaResourceDialect,
1611 0x98d3a585d905473,
1612 >(_buf?)?;
1613 Ok(_response.map(|x| x.did_disable))
1614 }
1615 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControlDisableResult>(
1616 (),
1617 0x98d3a585d905473,
1618 fidl::encoding::DynamicFlags::empty(),
1619 _decode,
1620 )
1621 }
1622
1623 fn r#detach(&self) -> Result<(), fidl::Error> {
1624 self.client.send::<fidl::encoding::EmptyPayload>(
1625 (),
1626 0x78ee27518b2dbfa,
1627 fidl::encoding::DynamicFlags::empty(),
1628 )
1629 }
1630
1631 type GetAuthorizationForInterfaceResponseFut = fidl::client::QueryResponseFut<
1632 GrantForInterfaceAuthorization,
1633 fidl::encoding::DefaultFuchsiaResourceDialect,
1634 >;
1635 fn r#get_authorization_for_interface(&self) -> Self::GetAuthorizationForInterfaceResponseFut {
1636 fn _decode(
1637 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1638 ) -> Result<GrantForInterfaceAuthorization, fidl::Error> {
1639 let _response = fidl::client::decode_transaction_body::<
1640 ControlGetAuthorizationForInterfaceResponse,
1641 fidl::encoding::DefaultFuchsiaResourceDialect,
1642 0xc1de2ab60b5cb9e,
1643 >(_buf?)?;
1644 Ok(_response.credential)
1645 }
1646 self.client
1647 .send_query_and_decode::<fidl::encoding::EmptyPayload, GrantForInterfaceAuthorization>(
1648 (),
1649 0xc1de2ab60b5cb9e,
1650 fidl::encoding::DynamicFlags::empty(),
1651 _decode,
1652 )
1653 }
1654
1655 type RemoveResponseFut = fidl::client::QueryResponseFut<
1656 ControlRemoveResult,
1657 fidl::encoding::DefaultFuchsiaResourceDialect,
1658 >;
1659 fn r#remove(&self) -> Self::RemoveResponseFut {
1660 fn _decode(
1661 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1662 ) -> Result<ControlRemoveResult, fidl::Error> {
1663 let _response = fidl::client::decode_transaction_body::<
1664 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControlRemoveError>,
1665 fidl::encoding::DefaultFuchsiaResourceDialect,
1666 0x13aab8bbecc7ff0b,
1667 >(_buf?)?;
1668 Ok(_response.map(|x| x))
1669 }
1670 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControlRemoveResult>(
1671 (),
1672 0x13aab8bbecc7ff0b,
1673 fidl::encoding::DynamicFlags::empty(),
1674 _decode,
1675 )
1676 }
1677}
1678
1679pub struct ControlEventStream {
1680 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1681}
1682
1683impl std::marker::Unpin for ControlEventStream {}
1684
1685impl futures::stream::FusedStream for ControlEventStream {
1686 fn is_terminated(&self) -> bool {
1687 self.event_receiver.is_terminated()
1688 }
1689}
1690
1691impl futures::Stream for ControlEventStream {
1692 type Item = Result<ControlEvent, fidl::Error>;
1693
1694 fn poll_next(
1695 mut self: std::pin::Pin<&mut Self>,
1696 cx: &mut std::task::Context<'_>,
1697 ) -> std::task::Poll<Option<Self::Item>> {
1698 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1699 &mut self.event_receiver,
1700 cx
1701 )?) {
1702 Some(buf) => std::task::Poll::Ready(Some(ControlEvent::decode(buf))),
1703 None => std::task::Poll::Ready(None),
1704 }
1705 }
1706}
1707
1708#[derive(Debug)]
1709pub enum ControlEvent {
1710 OnInterfaceRemoved { reason: InterfaceRemovedReason },
1711}
1712
1713impl ControlEvent {
1714 #[allow(irrefutable_let_patterns)]
1715 pub fn into_on_interface_removed(self) -> Option<InterfaceRemovedReason> {
1716 if let ControlEvent::OnInterfaceRemoved { reason } = self {
1717 Some((reason))
1718 } else {
1719 None
1720 }
1721 }
1722
1723 fn decode(
1725 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1726 ) -> Result<ControlEvent, fidl::Error> {
1727 let (bytes, _handles) = buf.split_mut();
1728 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1729 debug_assert_eq!(tx_header.tx_id, 0);
1730 match tx_header.ordinal {
1731 0x800d39e76c1cddd => {
1732 let mut out = fidl::new_empty!(
1733 ControlOnInterfaceRemovedRequest,
1734 fidl::encoding::DefaultFuchsiaResourceDialect
1735 );
1736 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlOnInterfaceRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1737 Ok((ControlEvent::OnInterfaceRemoved { reason: out.reason }))
1738 }
1739 _ => Err(fidl::Error::UnknownOrdinal {
1740 ordinal: tx_header.ordinal,
1741 protocol_name: <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1742 }),
1743 }
1744 }
1745}
1746
1747pub struct ControlRequestStream {
1749 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1750 is_terminated: bool,
1751}
1752
1753impl std::marker::Unpin for ControlRequestStream {}
1754
1755impl futures::stream::FusedStream for ControlRequestStream {
1756 fn is_terminated(&self) -> bool {
1757 self.is_terminated
1758 }
1759}
1760
1761impl fidl::endpoints::RequestStream for ControlRequestStream {
1762 type Protocol = ControlMarker;
1763 type ControlHandle = ControlControlHandle;
1764
1765 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1766 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1767 }
1768
1769 fn control_handle(&self) -> Self::ControlHandle {
1770 ControlControlHandle { inner: self.inner.clone() }
1771 }
1772
1773 fn into_inner(
1774 self,
1775 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1776 {
1777 (self.inner, self.is_terminated)
1778 }
1779
1780 fn from_inner(
1781 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1782 is_terminated: bool,
1783 ) -> Self {
1784 Self { inner, is_terminated }
1785 }
1786}
1787
1788impl futures::Stream for ControlRequestStream {
1789 type Item = Result<ControlRequest, fidl::Error>;
1790
1791 fn poll_next(
1792 mut self: std::pin::Pin<&mut Self>,
1793 cx: &mut std::task::Context<'_>,
1794 ) -> std::task::Poll<Option<Self::Item>> {
1795 let this = &mut *self;
1796 if this.inner.check_shutdown(cx) {
1797 this.is_terminated = true;
1798 return std::task::Poll::Ready(None);
1799 }
1800 if this.is_terminated {
1801 panic!("polled ControlRequestStream after completion");
1802 }
1803 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1804 |bytes, handles| {
1805 match this.inner.channel().read_etc(cx, bytes, handles) {
1806 std::task::Poll::Ready(Ok(())) => {}
1807 std::task::Poll::Pending => return std::task::Poll::Pending,
1808 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1809 this.is_terminated = true;
1810 return std::task::Poll::Ready(None);
1811 }
1812 std::task::Poll::Ready(Err(e)) => {
1813 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1814 e.into(),
1815 ))))
1816 }
1817 }
1818
1819 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1821
1822 std::task::Poll::Ready(Some(match header.ordinal {
1823 0x1349d36da453ce => {
1824 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1825 let mut req = fidl::new_empty!(
1826 ControlAddAddressRequest,
1827 fidl::encoding::DefaultFuchsiaResourceDialect
1828 );
1829 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlAddAddressRequest>(&header, _body_bytes, handles, &mut req)?;
1830 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1831 Ok(ControlRequest::AddAddress {
1832 address: req.address,
1833 parameters: req.parameters,
1834 address_state_provider: req.address_state_provider,
1835
1836 control_handle,
1837 })
1838 }
1839 0x213ba73da997a620 => {
1840 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1841 let mut req = fidl::new_empty!(
1842 ControlRemoveAddressRequest,
1843 fidl::encoding::DefaultFuchsiaResourceDialect
1844 );
1845 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlRemoveAddressRequest>(&header, _body_bytes, handles, &mut req)?;
1846 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1847 Ok(ControlRequest::RemoveAddress {
1848 address: req.address,
1849
1850 responder: ControlRemoveAddressResponder {
1851 control_handle: std::mem::ManuallyDrop::new(control_handle),
1852 tx_id: header.tx_id,
1853 },
1854 })
1855 }
1856 0x2a2459768d9ecc6f => {
1857 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1858 let mut req = fidl::new_empty!(
1859 fidl::encoding::EmptyPayload,
1860 fidl::encoding::DefaultFuchsiaResourceDialect
1861 );
1862 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1863 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1864 Ok(ControlRequest::GetId {
1865 responder: ControlGetIdResponder {
1866 control_handle: std::mem::ManuallyDrop::new(control_handle),
1867 tx_id: header.tx_id,
1868 },
1869 })
1870 }
1871 0x573923b7b4bde27f => {
1872 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1873 let mut req = fidl::new_empty!(
1874 ControlSetConfigurationRequest,
1875 fidl::encoding::DefaultFuchsiaResourceDialect
1876 );
1877 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControlSetConfigurationRequest>(&header, _body_bytes, handles, &mut req)?;
1878 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1879 Ok(ControlRequest::SetConfiguration {
1880 config: req.config,
1881
1882 responder: ControlSetConfigurationResponder {
1883 control_handle: std::mem::ManuallyDrop::new(control_handle),
1884 tx_id: header.tx_id,
1885 },
1886 })
1887 }
1888 0x5f5d239820bdcc65 => {
1889 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1890 let mut req = fidl::new_empty!(
1891 fidl::encoding::EmptyPayload,
1892 fidl::encoding::DefaultFuchsiaResourceDialect
1893 );
1894 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1895 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1896 Ok(ControlRequest::GetConfiguration {
1897 responder: ControlGetConfigurationResponder {
1898 control_handle: std::mem::ManuallyDrop::new(control_handle),
1899 tx_id: header.tx_id,
1900 },
1901 })
1902 }
1903 0x15c983d3a8ac0b98 => {
1904 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1905 let mut req = fidl::new_empty!(
1906 fidl::encoding::EmptyPayload,
1907 fidl::encoding::DefaultFuchsiaResourceDialect
1908 );
1909 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1910 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1911 Ok(ControlRequest::Enable {
1912 responder: ControlEnableResponder {
1913 control_handle: std::mem::ManuallyDrop::new(control_handle),
1914 tx_id: header.tx_id,
1915 },
1916 })
1917 }
1918 0x98d3a585d905473 => {
1919 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1920 let mut req = fidl::new_empty!(
1921 fidl::encoding::EmptyPayload,
1922 fidl::encoding::DefaultFuchsiaResourceDialect
1923 );
1924 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1925 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1926 Ok(ControlRequest::Disable {
1927 responder: ControlDisableResponder {
1928 control_handle: std::mem::ManuallyDrop::new(control_handle),
1929 tx_id: header.tx_id,
1930 },
1931 })
1932 }
1933 0x78ee27518b2dbfa => {
1934 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1935 let mut req = fidl::new_empty!(
1936 fidl::encoding::EmptyPayload,
1937 fidl::encoding::DefaultFuchsiaResourceDialect
1938 );
1939 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1940 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1941 Ok(ControlRequest::Detach { control_handle })
1942 }
1943 0xc1de2ab60b5cb9e => {
1944 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1945 let mut req = fidl::new_empty!(
1946 fidl::encoding::EmptyPayload,
1947 fidl::encoding::DefaultFuchsiaResourceDialect
1948 );
1949 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1950 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1951 Ok(ControlRequest::GetAuthorizationForInterface {
1952 responder: ControlGetAuthorizationForInterfaceResponder {
1953 control_handle: std::mem::ManuallyDrop::new(control_handle),
1954 tx_id: header.tx_id,
1955 },
1956 })
1957 }
1958 0x13aab8bbecc7ff0b => {
1959 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1960 let mut req = fidl::new_empty!(
1961 fidl::encoding::EmptyPayload,
1962 fidl::encoding::DefaultFuchsiaResourceDialect
1963 );
1964 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1965 let control_handle = ControlControlHandle { inner: this.inner.clone() };
1966 Ok(ControlRequest::Remove {
1967 responder: ControlRemoveResponder {
1968 control_handle: std::mem::ManuallyDrop::new(control_handle),
1969 tx_id: header.tx_id,
1970 },
1971 })
1972 }
1973 _ => Err(fidl::Error::UnknownOrdinal {
1974 ordinal: header.ordinal,
1975 protocol_name:
1976 <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1977 }),
1978 }))
1979 },
1980 )
1981 }
1982}
1983
1984#[derive(Debug)]
1994pub enum ControlRequest {
1995 AddAddress {
2005 address: fidl_fuchsia_net::Subnet,
2006 parameters: AddressParameters,
2007 address_state_provider: fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
2008 control_handle: ControlControlHandle,
2009 },
2010 RemoveAddress { address: fidl_fuchsia_net::Subnet, responder: ControlRemoveAddressResponder },
2016 GetId { responder: ControlGetIdResponder },
2020 SetConfiguration { config: Configuration, responder: ControlSetConfigurationResponder },
2032 GetConfiguration { responder: ControlGetConfigurationResponder },
2041 Enable { responder: ControlEnableResponder },
2046 Disable { responder: ControlDisableResponder },
2051 Detach { control_handle: ControlControlHandle },
2056 GetAuthorizationForInterface { responder: ControlGetAuthorizationForInterfaceResponder },
2068 Remove { responder: ControlRemoveResponder },
2074}
2075
2076impl ControlRequest {
2077 #[allow(irrefutable_let_patterns)]
2078 pub fn into_add_address(
2079 self,
2080 ) -> Option<(
2081 fidl_fuchsia_net::Subnet,
2082 AddressParameters,
2083 fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
2084 ControlControlHandle,
2085 )> {
2086 if let ControlRequest::AddAddress {
2087 address,
2088 parameters,
2089 address_state_provider,
2090 control_handle,
2091 } = self
2092 {
2093 Some((address, parameters, address_state_provider, control_handle))
2094 } else {
2095 None
2096 }
2097 }
2098
2099 #[allow(irrefutable_let_patterns)]
2100 pub fn into_remove_address(
2101 self,
2102 ) -> Option<(fidl_fuchsia_net::Subnet, ControlRemoveAddressResponder)> {
2103 if let ControlRequest::RemoveAddress { address, responder } = self {
2104 Some((address, responder))
2105 } else {
2106 None
2107 }
2108 }
2109
2110 #[allow(irrefutable_let_patterns)]
2111 pub fn into_get_id(self) -> Option<(ControlGetIdResponder)> {
2112 if let ControlRequest::GetId { responder } = self {
2113 Some((responder))
2114 } else {
2115 None
2116 }
2117 }
2118
2119 #[allow(irrefutable_let_patterns)]
2120 pub fn into_set_configuration(
2121 self,
2122 ) -> Option<(Configuration, ControlSetConfigurationResponder)> {
2123 if let ControlRequest::SetConfiguration { config, responder } = self {
2124 Some((config, responder))
2125 } else {
2126 None
2127 }
2128 }
2129
2130 #[allow(irrefutable_let_patterns)]
2131 pub fn into_get_configuration(self) -> Option<(ControlGetConfigurationResponder)> {
2132 if let ControlRequest::GetConfiguration { responder } = self {
2133 Some((responder))
2134 } else {
2135 None
2136 }
2137 }
2138
2139 #[allow(irrefutable_let_patterns)]
2140 pub fn into_enable(self) -> Option<(ControlEnableResponder)> {
2141 if let ControlRequest::Enable { responder } = self {
2142 Some((responder))
2143 } else {
2144 None
2145 }
2146 }
2147
2148 #[allow(irrefutable_let_patterns)]
2149 pub fn into_disable(self) -> Option<(ControlDisableResponder)> {
2150 if let ControlRequest::Disable { responder } = self {
2151 Some((responder))
2152 } else {
2153 None
2154 }
2155 }
2156
2157 #[allow(irrefutable_let_patterns)]
2158 pub fn into_detach(self) -> Option<(ControlControlHandle)> {
2159 if let ControlRequest::Detach { control_handle } = self {
2160 Some((control_handle))
2161 } else {
2162 None
2163 }
2164 }
2165
2166 #[allow(irrefutable_let_patterns)]
2167 pub fn into_get_authorization_for_interface(
2168 self,
2169 ) -> Option<(ControlGetAuthorizationForInterfaceResponder)> {
2170 if let ControlRequest::GetAuthorizationForInterface { responder } = self {
2171 Some((responder))
2172 } else {
2173 None
2174 }
2175 }
2176
2177 #[allow(irrefutable_let_patterns)]
2178 pub fn into_remove(self) -> Option<(ControlRemoveResponder)> {
2179 if let ControlRequest::Remove { responder } = self {
2180 Some((responder))
2181 } else {
2182 None
2183 }
2184 }
2185
2186 pub fn method_name(&self) -> &'static str {
2188 match *self {
2189 ControlRequest::AddAddress { .. } => "add_address",
2190 ControlRequest::RemoveAddress { .. } => "remove_address",
2191 ControlRequest::GetId { .. } => "get_id",
2192 ControlRequest::SetConfiguration { .. } => "set_configuration",
2193 ControlRequest::GetConfiguration { .. } => "get_configuration",
2194 ControlRequest::Enable { .. } => "enable",
2195 ControlRequest::Disable { .. } => "disable",
2196 ControlRequest::Detach { .. } => "detach",
2197 ControlRequest::GetAuthorizationForInterface { .. } => {
2198 "get_authorization_for_interface"
2199 }
2200 ControlRequest::Remove { .. } => "remove",
2201 }
2202 }
2203}
2204
2205#[derive(Debug, Clone)]
2206pub struct ControlControlHandle {
2207 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2208}
2209
2210impl fidl::endpoints::ControlHandle for ControlControlHandle {
2211 fn shutdown(&self) {
2212 self.inner.shutdown()
2213 }
2214 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2215 self.inner.shutdown_with_epitaph(status)
2216 }
2217
2218 fn is_closed(&self) -> bool {
2219 self.inner.channel().is_closed()
2220 }
2221 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2222 self.inner.channel().on_closed()
2223 }
2224
2225 #[cfg(target_os = "fuchsia")]
2226 fn signal_peer(
2227 &self,
2228 clear_mask: zx::Signals,
2229 set_mask: zx::Signals,
2230 ) -> Result<(), zx_status::Status> {
2231 use fidl::Peered;
2232 self.inner.channel().signal_peer(clear_mask, set_mask)
2233 }
2234}
2235
2236impl ControlControlHandle {
2237 pub fn send_on_interface_removed(
2238 &self,
2239 mut reason: InterfaceRemovedReason,
2240 ) -> Result<(), fidl::Error> {
2241 self.inner.send::<ControlOnInterfaceRemovedRequest>(
2242 (reason,),
2243 0,
2244 0x800d39e76c1cddd,
2245 fidl::encoding::DynamicFlags::empty(),
2246 )
2247 }
2248}
2249
2250#[must_use = "FIDL methods require a response to be sent"]
2251#[derive(Debug)]
2252pub struct ControlRemoveAddressResponder {
2253 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
2254 tx_id: u32,
2255}
2256
2257impl std::ops::Drop for ControlRemoveAddressResponder {
2261 fn drop(&mut self) {
2262 self.control_handle.shutdown();
2263 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2265 }
2266}
2267
2268impl fidl::endpoints::Responder for ControlRemoveAddressResponder {
2269 type ControlHandle = ControlControlHandle;
2270
2271 fn control_handle(&self) -> &ControlControlHandle {
2272 &self.control_handle
2273 }
2274
2275 fn drop_without_shutdown(mut self) {
2276 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2278 std::mem::forget(self);
2280 }
2281}
2282
2283impl ControlRemoveAddressResponder {
2284 pub fn send(
2288 self,
2289 mut result: Result<bool, ControlRemoveAddressError>,
2290 ) -> Result<(), fidl::Error> {
2291 let _result = self.send_raw(result);
2292 if _result.is_err() {
2293 self.control_handle.shutdown();
2294 }
2295 self.drop_without_shutdown();
2296 _result
2297 }
2298
2299 pub fn send_no_shutdown_on_err(
2301 self,
2302 mut result: Result<bool, ControlRemoveAddressError>,
2303 ) -> Result<(), fidl::Error> {
2304 let _result = self.send_raw(result);
2305 self.drop_without_shutdown();
2306 _result
2307 }
2308
2309 fn send_raw(
2310 &self,
2311 mut result: Result<bool, ControlRemoveAddressError>,
2312 ) -> Result<(), fidl::Error> {
2313 self.control_handle.inner.send::<fidl::encoding::ResultType<
2314 ControlRemoveAddressResponse,
2315 ControlRemoveAddressError,
2316 >>(
2317 result.map(|did_remove| (did_remove,)),
2318 self.tx_id,
2319 0x213ba73da997a620,
2320 fidl::encoding::DynamicFlags::empty(),
2321 )
2322 }
2323}
2324
2325#[must_use = "FIDL methods require a response to be sent"]
2326#[derive(Debug)]
2327pub struct ControlGetIdResponder {
2328 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
2329 tx_id: u32,
2330}
2331
2332impl std::ops::Drop for ControlGetIdResponder {
2336 fn drop(&mut self) {
2337 self.control_handle.shutdown();
2338 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2340 }
2341}
2342
2343impl fidl::endpoints::Responder for ControlGetIdResponder {
2344 type ControlHandle = ControlControlHandle;
2345
2346 fn control_handle(&self) -> &ControlControlHandle {
2347 &self.control_handle
2348 }
2349
2350 fn drop_without_shutdown(mut self) {
2351 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2353 std::mem::forget(self);
2355 }
2356}
2357
2358impl ControlGetIdResponder {
2359 pub fn send(self, mut id: u64) -> Result<(), fidl::Error> {
2363 let _result = self.send_raw(id);
2364 if _result.is_err() {
2365 self.control_handle.shutdown();
2366 }
2367 self.drop_without_shutdown();
2368 _result
2369 }
2370
2371 pub fn send_no_shutdown_on_err(self, mut id: u64) -> Result<(), fidl::Error> {
2373 let _result = self.send_raw(id);
2374 self.drop_without_shutdown();
2375 _result
2376 }
2377
2378 fn send_raw(&self, mut id: u64) -> Result<(), fidl::Error> {
2379 self.control_handle.inner.send::<ControlGetIdResponse>(
2380 (id,),
2381 self.tx_id,
2382 0x2a2459768d9ecc6f,
2383 fidl::encoding::DynamicFlags::empty(),
2384 )
2385 }
2386}
2387
2388#[must_use = "FIDL methods require a response to be sent"]
2389#[derive(Debug)]
2390pub struct ControlSetConfigurationResponder {
2391 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
2392 tx_id: u32,
2393}
2394
2395impl std::ops::Drop for ControlSetConfigurationResponder {
2399 fn drop(&mut self) {
2400 self.control_handle.shutdown();
2401 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2403 }
2404}
2405
2406impl fidl::endpoints::Responder for ControlSetConfigurationResponder {
2407 type ControlHandle = ControlControlHandle;
2408
2409 fn control_handle(&self) -> &ControlControlHandle {
2410 &self.control_handle
2411 }
2412
2413 fn drop_without_shutdown(mut self) {
2414 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2416 std::mem::forget(self);
2418 }
2419}
2420
2421impl ControlSetConfigurationResponder {
2422 pub fn send(
2426 self,
2427 mut result: Result<&Configuration, ControlSetConfigurationError>,
2428 ) -> Result<(), fidl::Error> {
2429 let _result = self.send_raw(result);
2430 if _result.is_err() {
2431 self.control_handle.shutdown();
2432 }
2433 self.drop_without_shutdown();
2434 _result
2435 }
2436
2437 pub fn send_no_shutdown_on_err(
2439 self,
2440 mut result: Result<&Configuration, ControlSetConfigurationError>,
2441 ) -> Result<(), fidl::Error> {
2442 let _result = self.send_raw(result);
2443 self.drop_without_shutdown();
2444 _result
2445 }
2446
2447 fn send_raw(
2448 &self,
2449 mut result: Result<&Configuration, ControlSetConfigurationError>,
2450 ) -> Result<(), fidl::Error> {
2451 self.control_handle.inner.send::<fidl::encoding::ResultType<
2452 ControlSetConfigurationResponse,
2453 ControlSetConfigurationError,
2454 >>(
2455 result.map(|previous_config| (previous_config,)),
2456 self.tx_id,
2457 0x573923b7b4bde27f,
2458 fidl::encoding::DynamicFlags::empty(),
2459 )
2460 }
2461}
2462
2463#[must_use = "FIDL methods require a response to be sent"]
2464#[derive(Debug)]
2465pub struct ControlGetConfigurationResponder {
2466 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
2467 tx_id: u32,
2468}
2469
2470impl std::ops::Drop for ControlGetConfigurationResponder {
2474 fn drop(&mut self) {
2475 self.control_handle.shutdown();
2476 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2478 }
2479}
2480
2481impl fidl::endpoints::Responder for ControlGetConfigurationResponder {
2482 type ControlHandle = ControlControlHandle;
2483
2484 fn control_handle(&self) -> &ControlControlHandle {
2485 &self.control_handle
2486 }
2487
2488 fn drop_without_shutdown(mut self) {
2489 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2491 std::mem::forget(self);
2493 }
2494}
2495
2496impl ControlGetConfigurationResponder {
2497 pub fn send(
2501 self,
2502 mut result: Result<&Configuration, ControlGetConfigurationError>,
2503 ) -> Result<(), fidl::Error> {
2504 let _result = self.send_raw(result);
2505 if _result.is_err() {
2506 self.control_handle.shutdown();
2507 }
2508 self.drop_without_shutdown();
2509 _result
2510 }
2511
2512 pub fn send_no_shutdown_on_err(
2514 self,
2515 mut result: Result<&Configuration, ControlGetConfigurationError>,
2516 ) -> Result<(), fidl::Error> {
2517 let _result = self.send_raw(result);
2518 self.drop_without_shutdown();
2519 _result
2520 }
2521
2522 fn send_raw(
2523 &self,
2524 mut result: Result<&Configuration, ControlGetConfigurationError>,
2525 ) -> Result<(), fidl::Error> {
2526 self.control_handle.inner.send::<fidl::encoding::ResultType<
2527 ControlGetConfigurationResponse,
2528 ControlGetConfigurationError,
2529 >>(
2530 result.map(|config| (config,)),
2531 self.tx_id,
2532 0x5f5d239820bdcc65,
2533 fidl::encoding::DynamicFlags::empty(),
2534 )
2535 }
2536}
2537
2538#[must_use = "FIDL methods require a response to be sent"]
2539#[derive(Debug)]
2540pub struct ControlEnableResponder {
2541 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
2542 tx_id: u32,
2543}
2544
2545impl std::ops::Drop for ControlEnableResponder {
2549 fn drop(&mut self) {
2550 self.control_handle.shutdown();
2551 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2553 }
2554}
2555
2556impl fidl::endpoints::Responder for ControlEnableResponder {
2557 type ControlHandle = ControlControlHandle;
2558
2559 fn control_handle(&self) -> &ControlControlHandle {
2560 &self.control_handle
2561 }
2562
2563 fn drop_without_shutdown(mut self) {
2564 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2566 std::mem::forget(self);
2568 }
2569}
2570
2571impl ControlEnableResponder {
2572 pub fn send(self, mut result: Result<bool, ControlEnableError>) -> Result<(), fidl::Error> {
2576 let _result = self.send_raw(result);
2577 if _result.is_err() {
2578 self.control_handle.shutdown();
2579 }
2580 self.drop_without_shutdown();
2581 _result
2582 }
2583
2584 pub fn send_no_shutdown_on_err(
2586 self,
2587 mut result: Result<bool, ControlEnableError>,
2588 ) -> Result<(), fidl::Error> {
2589 let _result = self.send_raw(result);
2590 self.drop_without_shutdown();
2591 _result
2592 }
2593
2594 fn send_raw(&self, mut result: Result<bool, ControlEnableError>) -> Result<(), fidl::Error> {
2595 self.control_handle.inner.send::<fidl::encoding::ResultType<
2596 ControlEnableResponse,
2597 ControlEnableError,
2598 >>(
2599 result.map(|did_enable| (did_enable,)),
2600 self.tx_id,
2601 0x15c983d3a8ac0b98,
2602 fidl::encoding::DynamicFlags::empty(),
2603 )
2604 }
2605}
2606
2607#[must_use = "FIDL methods require a response to be sent"]
2608#[derive(Debug)]
2609pub struct ControlDisableResponder {
2610 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
2611 tx_id: u32,
2612}
2613
2614impl std::ops::Drop for ControlDisableResponder {
2618 fn drop(&mut self) {
2619 self.control_handle.shutdown();
2620 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2622 }
2623}
2624
2625impl fidl::endpoints::Responder for ControlDisableResponder {
2626 type ControlHandle = ControlControlHandle;
2627
2628 fn control_handle(&self) -> &ControlControlHandle {
2629 &self.control_handle
2630 }
2631
2632 fn drop_without_shutdown(mut self) {
2633 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2635 std::mem::forget(self);
2637 }
2638}
2639
2640impl ControlDisableResponder {
2641 pub fn send(self, mut result: Result<bool, ControlDisableError>) -> Result<(), fidl::Error> {
2645 let _result = self.send_raw(result);
2646 if _result.is_err() {
2647 self.control_handle.shutdown();
2648 }
2649 self.drop_without_shutdown();
2650 _result
2651 }
2652
2653 pub fn send_no_shutdown_on_err(
2655 self,
2656 mut result: Result<bool, ControlDisableError>,
2657 ) -> Result<(), fidl::Error> {
2658 let _result = self.send_raw(result);
2659 self.drop_without_shutdown();
2660 _result
2661 }
2662
2663 fn send_raw(&self, mut result: Result<bool, ControlDisableError>) -> Result<(), fidl::Error> {
2664 self.control_handle.inner.send::<fidl::encoding::ResultType<
2665 ControlDisableResponse,
2666 ControlDisableError,
2667 >>(
2668 result.map(|did_disable| (did_disable,)),
2669 self.tx_id,
2670 0x98d3a585d905473,
2671 fidl::encoding::DynamicFlags::empty(),
2672 )
2673 }
2674}
2675
2676#[must_use = "FIDL methods require a response to be sent"]
2677#[derive(Debug)]
2678pub struct ControlGetAuthorizationForInterfaceResponder {
2679 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
2680 tx_id: u32,
2681}
2682
2683impl std::ops::Drop for ControlGetAuthorizationForInterfaceResponder {
2687 fn drop(&mut self) {
2688 self.control_handle.shutdown();
2689 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2691 }
2692}
2693
2694impl fidl::endpoints::Responder for ControlGetAuthorizationForInterfaceResponder {
2695 type ControlHandle = ControlControlHandle;
2696
2697 fn control_handle(&self) -> &ControlControlHandle {
2698 &self.control_handle
2699 }
2700
2701 fn drop_without_shutdown(mut self) {
2702 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2704 std::mem::forget(self);
2706 }
2707}
2708
2709impl ControlGetAuthorizationForInterfaceResponder {
2710 pub fn send(self, mut credential: GrantForInterfaceAuthorization) -> Result<(), fidl::Error> {
2714 let _result = self.send_raw(credential);
2715 if _result.is_err() {
2716 self.control_handle.shutdown();
2717 }
2718 self.drop_without_shutdown();
2719 _result
2720 }
2721
2722 pub fn send_no_shutdown_on_err(
2724 self,
2725 mut credential: GrantForInterfaceAuthorization,
2726 ) -> Result<(), fidl::Error> {
2727 let _result = self.send_raw(credential);
2728 self.drop_without_shutdown();
2729 _result
2730 }
2731
2732 fn send_raw(&self, mut credential: GrantForInterfaceAuthorization) -> Result<(), fidl::Error> {
2733 self.control_handle.inner.send::<ControlGetAuthorizationForInterfaceResponse>(
2734 (&mut credential,),
2735 self.tx_id,
2736 0xc1de2ab60b5cb9e,
2737 fidl::encoding::DynamicFlags::empty(),
2738 )
2739 }
2740}
2741
2742#[must_use = "FIDL methods require a response to be sent"]
2743#[derive(Debug)]
2744pub struct ControlRemoveResponder {
2745 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
2746 tx_id: u32,
2747}
2748
2749impl std::ops::Drop for ControlRemoveResponder {
2753 fn drop(&mut self) {
2754 self.control_handle.shutdown();
2755 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2757 }
2758}
2759
2760impl fidl::endpoints::Responder for ControlRemoveResponder {
2761 type ControlHandle = ControlControlHandle;
2762
2763 fn control_handle(&self) -> &ControlControlHandle {
2764 &self.control_handle
2765 }
2766
2767 fn drop_without_shutdown(mut self) {
2768 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2770 std::mem::forget(self);
2772 }
2773}
2774
2775impl ControlRemoveResponder {
2776 pub fn send(self, mut result: Result<(), ControlRemoveError>) -> Result<(), fidl::Error> {
2780 let _result = self.send_raw(result);
2781 if _result.is_err() {
2782 self.control_handle.shutdown();
2783 }
2784 self.drop_without_shutdown();
2785 _result
2786 }
2787
2788 pub fn send_no_shutdown_on_err(
2790 self,
2791 mut result: Result<(), ControlRemoveError>,
2792 ) -> Result<(), fidl::Error> {
2793 let _result = self.send_raw(result);
2794 self.drop_without_shutdown();
2795 _result
2796 }
2797
2798 fn send_raw(&self, mut result: Result<(), ControlRemoveError>) -> Result<(), fidl::Error> {
2799 self.control_handle.inner.send::<fidl::encoding::ResultType<
2800 fidl::encoding::EmptyStruct,
2801 ControlRemoveError,
2802 >>(
2803 result,
2804 self.tx_id,
2805 0x13aab8bbecc7ff0b,
2806 fidl::encoding::DynamicFlags::empty(),
2807 )
2808 }
2809}
2810
2811#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2812pub struct DeviceControlMarker;
2813
2814impl fidl::endpoints::ProtocolMarker for DeviceControlMarker {
2815 type Proxy = DeviceControlProxy;
2816 type RequestStream = DeviceControlRequestStream;
2817 #[cfg(target_os = "fuchsia")]
2818 type SynchronousProxy = DeviceControlSynchronousProxy;
2819
2820 const DEBUG_NAME: &'static str = "(anonymous) DeviceControl";
2821}
2822
2823pub trait DeviceControlProxyInterface: Send + Sync {
2824 fn r#create_interface(
2825 &self,
2826 port: &fidl_fuchsia_hardware_network::PortId,
2827 control: fidl::endpoints::ServerEnd<ControlMarker>,
2828 options: &Options,
2829 ) -> Result<(), fidl::Error>;
2830 fn r#detach(&self) -> Result<(), fidl::Error>;
2831}
2832#[derive(Debug)]
2833#[cfg(target_os = "fuchsia")]
2834pub struct DeviceControlSynchronousProxy {
2835 client: fidl::client::sync::Client,
2836}
2837
2838#[cfg(target_os = "fuchsia")]
2839impl fidl::endpoints::SynchronousProxy for DeviceControlSynchronousProxy {
2840 type Proxy = DeviceControlProxy;
2841 type Protocol = DeviceControlMarker;
2842
2843 fn from_channel(inner: fidl::Channel) -> Self {
2844 Self::new(inner)
2845 }
2846
2847 fn into_channel(self) -> fidl::Channel {
2848 self.client.into_channel()
2849 }
2850
2851 fn as_channel(&self) -> &fidl::Channel {
2852 self.client.as_channel()
2853 }
2854}
2855
2856#[cfg(target_os = "fuchsia")]
2857impl DeviceControlSynchronousProxy {
2858 pub fn new(channel: fidl::Channel) -> Self {
2859 let protocol_name = <DeviceControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2860 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2861 }
2862
2863 pub fn into_channel(self) -> fidl::Channel {
2864 self.client.into_channel()
2865 }
2866
2867 pub fn wait_for_event(
2870 &self,
2871 deadline: zx::MonotonicInstant,
2872 ) -> Result<DeviceControlEvent, fidl::Error> {
2873 DeviceControlEvent::decode(self.client.wait_for_event(deadline)?)
2874 }
2875
2876 pub fn r#create_interface(
2881 &self,
2882 mut port: &fidl_fuchsia_hardware_network::PortId,
2883 mut control: fidl::endpoints::ServerEnd<ControlMarker>,
2884 mut options: &Options,
2885 ) -> Result<(), fidl::Error> {
2886 self.client.send::<DeviceControlCreateInterfaceRequest>(
2887 (port, control, options),
2888 0x4ff8be7351d12f86,
2889 fidl::encoding::DynamicFlags::empty(),
2890 )
2891 }
2892
2893 pub fn r#detach(&self) -> Result<(), fidl::Error> {
2900 self.client.send::<fidl::encoding::EmptyPayload>(
2901 (),
2902 0x57489f1554d489d2,
2903 fidl::encoding::DynamicFlags::empty(),
2904 )
2905 }
2906}
2907
2908#[cfg(target_os = "fuchsia")]
2909impl From<DeviceControlSynchronousProxy> for zx::Handle {
2910 fn from(value: DeviceControlSynchronousProxy) -> Self {
2911 value.into_channel().into()
2912 }
2913}
2914
2915#[cfg(target_os = "fuchsia")]
2916impl From<fidl::Channel> for DeviceControlSynchronousProxy {
2917 fn from(value: fidl::Channel) -> Self {
2918 Self::new(value)
2919 }
2920}
2921
2922#[derive(Debug, Clone)]
2923pub struct DeviceControlProxy {
2924 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2925}
2926
2927impl fidl::endpoints::Proxy for DeviceControlProxy {
2928 type Protocol = DeviceControlMarker;
2929
2930 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2931 Self::new(inner)
2932 }
2933
2934 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2935 self.client.into_channel().map_err(|client| Self { client })
2936 }
2937
2938 fn as_channel(&self) -> &::fidl::AsyncChannel {
2939 self.client.as_channel()
2940 }
2941}
2942
2943impl DeviceControlProxy {
2944 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2946 let protocol_name = <DeviceControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2947 Self { client: fidl::client::Client::new(channel, protocol_name) }
2948 }
2949
2950 pub fn take_event_stream(&self) -> DeviceControlEventStream {
2956 DeviceControlEventStream { event_receiver: self.client.take_event_receiver() }
2957 }
2958
2959 pub fn r#create_interface(
2964 &self,
2965 mut port: &fidl_fuchsia_hardware_network::PortId,
2966 mut control: fidl::endpoints::ServerEnd<ControlMarker>,
2967 mut options: &Options,
2968 ) -> Result<(), fidl::Error> {
2969 DeviceControlProxyInterface::r#create_interface(self, port, control, options)
2970 }
2971
2972 pub fn r#detach(&self) -> Result<(), fidl::Error> {
2979 DeviceControlProxyInterface::r#detach(self)
2980 }
2981}
2982
2983impl DeviceControlProxyInterface for DeviceControlProxy {
2984 fn r#create_interface(
2985 &self,
2986 mut port: &fidl_fuchsia_hardware_network::PortId,
2987 mut control: fidl::endpoints::ServerEnd<ControlMarker>,
2988 mut options: &Options,
2989 ) -> Result<(), fidl::Error> {
2990 self.client.send::<DeviceControlCreateInterfaceRequest>(
2991 (port, control, options),
2992 0x4ff8be7351d12f86,
2993 fidl::encoding::DynamicFlags::empty(),
2994 )
2995 }
2996
2997 fn r#detach(&self) -> Result<(), fidl::Error> {
2998 self.client.send::<fidl::encoding::EmptyPayload>(
2999 (),
3000 0x57489f1554d489d2,
3001 fidl::encoding::DynamicFlags::empty(),
3002 )
3003 }
3004}
3005
3006pub struct DeviceControlEventStream {
3007 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3008}
3009
3010impl std::marker::Unpin for DeviceControlEventStream {}
3011
3012impl futures::stream::FusedStream for DeviceControlEventStream {
3013 fn is_terminated(&self) -> bool {
3014 self.event_receiver.is_terminated()
3015 }
3016}
3017
3018impl futures::Stream for DeviceControlEventStream {
3019 type Item = Result<DeviceControlEvent, fidl::Error>;
3020
3021 fn poll_next(
3022 mut self: std::pin::Pin<&mut Self>,
3023 cx: &mut std::task::Context<'_>,
3024 ) -> std::task::Poll<Option<Self::Item>> {
3025 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3026 &mut self.event_receiver,
3027 cx
3028 )?) {
3029 Some(buf) => std::task::Poll::Ready(Some(DeviceControlEvent::decode(buf))),
3030 None => std::task::Poll::Ready(None),
3031 }
3032 }
3033}
3034
3035#[derive(Debug)]
3036pub enum DeviceControlEvent {}
3037
3038impl DeviceControlEvent {
3039 fn decode(
3041 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3042 ) -> Result<DeviceControlEvent, fidl::Error> {
3043 let (bytes, _handles) = buf.split_mut();
3044 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3045 debug_assert_eq!(tx_header.tx_id, 0);
3046 match tx_header.ordinal {
3047 _ => Err(fidl::Error::UnknownOrdinal {
3048 ordinal: tx_header.ordinal,
3049 protocol_name: <DeviceControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3050 }),
3051 }
3052 }
3053}
3054
3055pub struct DeviceControlRequestStream {
3057 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3058 is_terminated: bool,
3059}
3060
3061impl std::marker::Unpin for DeviceControlRequestStream {}
3062
3063impl futures::stream::FusedStream for DeviceControlRequestStream {
3064 fn is_terminated(&self) -> bool {
3065 self.is_terminated
3066 }
3067}
3068
3069impl fidl::endpoints::RequestStream for DeviceControlRequestStream {
3070 type Protocol = DeviceControlMarker;
3071 type ControlHandle = DeviceControlControlHandle;
3072
3073 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3074 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3075 }
3076
3077 fn control_handle(&self) -> Self::ControlHandle {
3078 DeviceControlControlHandle { inner: self.inner.clone() }
3079 }
3080
3081 fn into_inner(
3082 self,
3083 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3084 {
3085 (self.inner, self.is_terminated)
3086 }
3087
3088 fn from_inner(
3089 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3090 is_terminated: bool,
3091 ) -> Self {
3092 Self { inner, is_terminated }
3093 }
3094}
3095
3096impl futures::Stream for DeviceControlRequestStream {
3097 type Item = Result<DeviceControlRequest, fidl::Error>;
3098
3099 fn poll_next(
3100 mut self: std::pin::Pin<&mut Self>,
3101 cx: &mut std::task::Context<'_>,
3102 ) -> std::task::Poll<Option<Self::Item>> {
3103 let this = &mut *self;
3104 if this.inner.check_shutdown(cx) {
3105 this.is_terminated = true;
3106 return std::task::Poll::Ready(None);
3107 }
3108 if this.is_terminated {
3109 panic!("polled DeviceControlRequestStream after completion");
3110 }
3111 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3112 |bytes, handles| {
3113 match this.inner.channel().read_etc(cx, bytes, handles) {
3114 std::task::Poll::Ready(Ok(())) => {}
3115 std::task::Poll::Pending => return std::task::Poll::Pending,
3116 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3117 this.is_terminated = true;
3118 return std::task::Poll::Ready(None);
3119 }
3120 std::task::Poll::Ready(Err(e)) => {
3121 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3122 e.into(),
3123 ))))
3124 }
3125 }
3126
3127 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3129
3130 std::task::Poll::Ready(Some(match header.ordinal {
3131 0x4ff8be7351d12f86 => {
3132 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3133 let mut req = fidl::new_empty!(
3134 DeviceControlCreateInterfaceRequest,
3135 fidl::encoding::DefaultFuchsiaResourceDialect
3136 );
3137 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceControlCreateInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
3138 let control_handle =
3139 DeviceControlControlHandle { inner: this.inner.clone() };
3140 Ok(DeviceControlRequest::CreateInterface {
3141 port: req.port,
3142 control: req.control,
3143 options: req.options,
3144
3145 control_handle,
3146 })
3147 }
3148 0x57489f1554d489d2 => {
3149 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3150 let mut req = fidl::new_empty!(
3151 fidl::encoding::EmptyPayload,
3152 fidl::encoding::DefaultFuchsiaResourceDialect
3153 );
3154 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3155 let control_handle =
3156 DeviceControlControlHandle { inner: this.inner.clone() };
3157 Ok(DeviceControlRequest::Detach { control_handle })
3158 }
3159 _ => Err(fidl::Error::UnknownOrdinal {
3160 ordinal: header.ordinal,
3161 protocol_name:
3162 <DeviceControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3163 }),
3164 }))
3165 },
3166 )
3167 }
3168}
3169
3170#[derive(Debug)]
3193pub enum DeviceControlRequest {
3194 CreateInterface {
3199 port: fidl_fuchsia_hardware_network::PortId,
3200 control: fidl::endpoints::ServerEnd<ControlMarker>,
3201 options: Options,
3202 control_handle: DeviceControlControlHandle,
3203 },
3204 Detach { control_handle: DeviceControlControlHandle },
3211}
3212
3213impl DeviceControlRequest {
3214 #[allow(irrefutable_let_patterns)]
3215 pub fn into_create_interface(
3216 self,
3217 ) -> Option<(
3218 fidl_fuchsia_hardware_network::PortId,
3219 fidl::endpoints::ServerEnd<ControlMarker>,
3220 Options,
3221 DeviceControlControlHandle,
3222 )> {
3223 if let DeviceControlRequest::CreateInterface { port, control, options, control_handle } =
3224 self
3225 {
3226 Some((port, control, options, control_handle))
3227 } else {
3228 None
3229 }
3230 }
3231
3232 #[allow(irrefutable_let_patterns)]
3233 pub fn into_detach(self) -> Option<(DeviceControlControlHandle)> {
3234 if let DeviceControlRequest::Detach { control_handle } = self {
3235 Some((control_handle))
3236 } else {
3237 None
3238 }
3239 }
3240
3241 pub fn method_name(&self) -> &'static str {
3243 match *self {
3244 DeviceControlRequest::CreateInterface { .. } => "create_interface",
3245 DeviceControlRequest::Detach { .. } => "detach",
3246 }
3247 }
3248}
3249
3250#[derive(Debug, Clone)]
3251pub struct DeviceControlControlHandle {
3252 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3253}
3254
3255impl fidl::endpoints::ControlHandle for DeviceControlControlHandle {
3256 fn shutdown(&self) {
3257 self.inner.shutdown()
3258 }
3259 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3260 self.inner.shutdown_with_epitaph(status)
3261 }
3262
3263 fn is_closed(&self) -> bool {
3264 self.inner.channel().is_closed()
3265 }
3266 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3267 self.inner.channel().on_closed()
3268 }
3269
3270 #[cfg(target_os = "fuchsia")]
3271 fn signal_peer(
3272 &self,
3273 clear_mask: zx::Signals,
3274 set_mask: zx::Signals,
3275 ) -> Result<(), zx_status::Status> {
3276 use fidl::Peered;
3277 self.inner.channel().signal_peer(clear_mask, set_mask)
3278 }
3279}
3280
3281impl DeviceControlControlHandle {}
3282
3283#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3284pub struct InstallerMarker;
3285
3286impl fidl::endpoints::ProtocolMarker for InstallerMarker {
3287 type Proxy = InstallerProxy;
3288 type RequestStream = InstallerRequestStream;
3289 #[cfg(target_os = "fuchsia")]
3290 type SynchronousProxy = InstallerSynchronousProxy;
3291
3292 const DEBUG_NAME: &'static str = "fuchsia.net.interfaces.admin.Installer";
3293}
3294impl fidl::endpoints::DiscoverableProtocolMarker for InstallerMarker {}
3295
3296pub trait InstallerProxyInterface: Send + Sync {
3297 fn r#install_device(
3298 &self,
3299 device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
3300 device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
3301 ) -> Result<(), fidl::Error>;
3302 fn r#install_blackhole_interface(
3303 &self,
3304 interface: fidl::endpoints::ServerEnd<ControlMarker>,
3305 options: &Options,
3306 ) -> Result<(), fidl::Error>;
3307}
3308#[derive(Debug)]
3309#[cfg(target_os = "fuchsia")]
3310pub struct InstallerSynchronousProxy {
3311 client: fidl::client::sync::Client,
3312}
3313
3314#[cfg(target_os = "fuchsia")]
3315impl fidl::endpoints::SynchronousProxy for InstallerSynchronousProxy {
3316 type Proxy = InstallerProxy;
3317 type Protocol = InstallerMarker;
3318
3319 fn from_channel(inner: fidl::Channel) -> Self {
3320 Self::new(inner)
3321 }
3322
3323 fn into_channel(self) -> fidl::Channel {
3324 self.client.into_channel()
3325 }
3326
3327 fn as_channel(&self) -> &fidl::Channel {
3328 self.client.as_channel()
3329 }
3330}
3331
3332#[cfg(target_os = "fuchsia")]
3333impl InstallerSynchronousProxy {
3334 pub fn new(channel: fidl::Channel) -> Self {
3335 let protocol_name = <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3336 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3337 }
3338
3339 pub fn into_channel(self) -> fidl::Channel {
3340 self.client.into_channel()
3341 }
3342
3343 pub fn wait_for_event(
3346 &self,
3347 deadline: zx::MonotonicInstant,
3348 ) -> Result<InstallerEvent, fidl::Error> {
3349 InstallerEvent::decode(self.client.wait_for_event(deadline)?)
3350 }
3351
3352 pub fn r#install_device(
3357 &self,
3358 mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
3359 mut device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
3360 ) -> Result<(), fidl::Error> {
3361 self.client.send::<InstallerInstallDeviceRequest>(
3362 (device, device_control),
3363 0x3e84524dcecab23a,
3364 fidl::encoding::DynamicFlags::empty(),
3365 )
3366 }
3367
3368 pub fn r#install_blackhole_interface(
3375 &self,
3376 mut interface: fidl::endpoints::ServerEnd<ControlMarker>,
3377 mut options: &Options,
3378 ) -> Result<(), fidl::Error> {
3379 self.client.send::<InstallerInstallBlackholeInterfaceRequest>(
3380 (interface, options),
3381 0x2ce57e87cdbcb809,
3382 fidl::encoding::DynamicFlags::empty(),
3383 )
3384 }
3385}
3386
3387#[cfg(target_os = "fuchsia")]
3388impl From<InstallerSynchronousProxy> for zx::Handle {
3389 fn from(value: InstallerSynchronousProxy) -> Self {
3390 value.into_channel().into()
3391 }
3392}
3393
3394#[cfg(target_os = "fuchsia")]
3395impl From<fidl::Channel> for InstallerSynchronousProxy {
3396 fn from(value: fidl::Channel) -> Self {
3397 Self::new(value)
3398 }
3399}
3400
3401#[derive(Debug, Clone)]
3402pub struct InstallerProxy {
3403 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3404}
3405
3406impl fidl::endpoints::Proxy for InstallerProxy {
3407 type Protocol = InstallerMarker;
3408
3409 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3410 Self::new(inner)
3411 }
3412
3413 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3414 self.client.into_channel().map_err(|client| Self { client })
3415 }
3416
3417 fn as_channel(&self) -> &::fidl::AsyncChannel {
3418 self.client.as_channel()
3419 }
3420}
3421
3422impl InstallerProxy {
3423 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3425 let protocol_name = <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3426 Self { client: fidl::client::Client::new(channel, protocol_name) }
3427 }
3428
3429 pub fn take_event_stream(&self) -> InstallerEventStream {
3435 InstallerEventStream { event_receiver: self.client.take_event_receiver() }
3436 }
3437
3438 pub fn r#install_device(
3443 &self,
3444 mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
3445 mut device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
3446 ) -> Result<(), fidl::Error> {
3447 InstallerProxyInterface::r#install_device(self, device, device_control)
3448 }
3449
3450 pub fn r#install_blackhole_interface(
3457 &self,
3458 mut interface: fidl::endpoints::ServerEnd<ControlMarker>,
3459 mut options: &Options,
3460 ) -> Result<(), fidl::Error> {
3461 InstallerProxyInterface::r#install_blackhole_interface(self, interface, options)
3462 }
3463}
3464
3465impl InstallerProxyInterface for InstallerProxy {
3466 fn r#install_device(
3467 &self,
3468 mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
3469 mut device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
3470 ) -> Result<(), fidl::Error> {
3471 self.client.send::<InstallerInstallDeviceRequest>(
3472 (device, device_control),
3473 0x3e84524dcecab23a,
3474 fidl::encoding::DynamicFlags::empty(),
3475 )
3476 }
3477
3478 fn r#install_blackhole_interface(
3479 &self,
3480 mut interface: fidl::endpoints::ServerEnd<ControlMarker>,
3481 mut options: &Options,
3482 ) -> Result<(), fidl::Error> {
3483 self.client.send::<InstallerInstallBlackholeInterfaceRequest>(
3484 (interface, options),
3485 0x2ce57e87cdbcb809,
3486 fidl::encoding::DynamicFlags::empty(),
3487 )
3488 }
3489}
3490
3491pub struct InstallerEventStream {
3492 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3493}
3494
3495impl std::marker::Unpin for InstallerEventStream {}
3496
3497impl futures::stream::FusedStream for InstallerEventStream {
3498 fn is_terminated(&self) -> bool {
3499 self.event_receiver.is_terminated()
3500 }
3501}
3502
3503impl futures::Stream for InstallerEventStream {
3504 type Item = Result<InstallerEvent, fidl::Error>;
3505
3506 fn poll_next(
3507 mut self: std::pin::Pin<&mut Self>,
3508 cx: &mut std::task::Context<'_>,
3509 ) -> std::task::Poll<Option<Self::Item>> {
3510 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3511 &mut self.event_receiver,
3512 cx
3513 )?) {
3514 Some(buf) => std::task::Poll::Ready(Some(InstallerEvent::decode(buf))),
3515 None => std::task::Poll::Ready(None),
3516 }
3517 }
3518}
3519
3520#[derive(Debug)]
3521pub enum InstallerEvent {}
3522
3523impl InstallerEvent {
3524 fn decode(
3526 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3527 ) -> Result<InstallerEvent, fidl::Error> {
3528 let (bytes, _handles) = buf.split_mut();
3529 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3530 debug_assert_eq!(tx_header.tx_id, 0);
3531 match tx_header.ordinal {
3532 _ => Err(fidl::Error::UnknownOrdinal {
3533 ordinal: tx_header.ordinal,
3534 protocol_name: <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3535 }),
3536 }
3537 }
3538}
3539
3540pub struct InstallerRequestStream {
3542 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3543 is_terminated: bool,
3544}
3545
3546impl std::marker::Unpin for InstallerRequestStream {}
3547
3548impl futures::stream::FusedStream for InstallerRequestStream {
3549 fn is_terminated(&self) -> bool {
3550 self.is_terminated
3551 }
3552}
3553
3554impl fidl::endpoints::RequestStream for InstallerRequestStream {
3555 type Protocol = InstallerMarker;
3556 type ControlHandle = InstallerControlHandle;
3557
3558 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3559 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3560 }
3561
3562 fn control_handle(&self) -> Self::ControlHandle {
3563 InstallerControlHandle { inner: self.inner.clone() }
3564 }
3565
3566 fn into_inner(
3567 self,
3568 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3569 {
3570 (self.inner, self.is_terminated)
3571 }
3572
3573 fn from_inner(
3574 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3575 is_terminated: bool,
3576 ) -> Self {
3577 Self { inner, is_terminated }
3578 }
3579}
3580
3581impl futures::Stream for InstallerRequestStream {
3582 type Item = Result<InstallerRequest, fidl::Error>;
3583
3584 fn poll_next(
3585 mut self: std::pin::Pin<&mut Self>,
3586 cx: &mut std::task::Context<'_>,
3587 ) -> std::task::Poll<Option<Self::Item>> {
3588 let this = &mut *self;
3589 if this.inner.check_shutdown(cx) {
3590 this.is_terminated = true;
3591 return std::task::Poll::Ready(None);
3592 }
3593 if this.is_terminated {
3594 panic!("polled InstallerRequestStream after completion");
3595 }
3596 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3597 |bytes, handles| {
3598 match this.inner.channel().read_etc(cx, bytes, handles) {
3599 std::task::Poll::Ready(Ok(())) => {}
3600 std::task::Poll::Pending => return std::task::Poll::Pending,
3601 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3602 this.is_terminated = true;
3603 return std::task::Poll::Ready(None);
3604 }
3605 std::task::Poll::Ready(Err(e)) => {
3606 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3607 e.into(),
3608 ))))
3609 }
3610 }
3611
3612 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3614
3615 std::task::Poll::Ready(Some(match header.ordinal {
3616 0x3e84524dcecab23a => {
3617 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3618 let mut req = fidl::new_empty!(
3619 InstallerInstallDeviceRequest,
3620 fidl::encoding::DefaultFuchsiaResourceDialect
3621 );
3622 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InstallerInstallDeviceRequest>(&header, _body_bytes, handles, &mut req)?;
3623 let control_handle = InstallerControlHandle { inner: this.inner.clone() };
3624 Ok(InstallerRequest::InstallDevice {
3625 device: req.device,
3626 device_control: req.device_control,
3627
3628 control_handle,
3629 })
3630 }
3631 0x2ce57e87cdbcb809 => {
3632 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3633 let mut req = fidl::new_empty!(
3634 InstallerInstallBlackholeInterfaceRequest,
3635 fidl::encoding::DefaultFuchsiaResourceDialect
3636 );
3637 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InstallerInstallBlackholeInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
3638 let control_handle = InstallerControlHandle { inner: this.inner.clone() };
3639 Ok(InstallerRequest::InstallBlackholeInterface {
3640 interface: req.interface,
3641 options: req.options,
3642
3643 control_handle,
3644 })
3645 }
3646 _ => Err(fidl::Error::UnknownOrdinal {
3647 ordinal: header.ordinal,
3648 protocol_name:
3649 <InstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3650 }),
3651 }))
3652 },
3653 )
3654 }
3655}
3656
3657#[derive(Debug)]
3659pub enum InstallerRequest {
3660 InstallDevice {
3665 device: fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
3666 device_control: fidl::endpoints::ServerEnd<DeviceControlMarker>,
3667 control_handle: InstallerControlHandle,
3668 },
3669 InstallBlackholeInterface {
3676 interface: fidl::endpoints::ServerEnd<ControlMarker>,
3677 options: Options,
3678 control_handle: InstallerControlHandle,
3679 },
3680}
3681
3682impl InstallerRequest {
3683 #[allow(irrefutable_let_patterns)]
3684 pub fn into_install_device(
3685 self,
3686 ) -> Option<(
3687 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
3688 fidl::endpoints::ServerEnd<DeviceControlMarker>,
3689 InstallerControlHandle,
3690 )> {
3691 if let InstallerRequest::InstallDevice { device, device_control, control_handle } = self {
3692 Some((device, device_control, control_handle))
3693 } else {
3694 None
3695 }
3696 }
3697
3698 #[allow(irrefutable_let_patterns)]
3699 pub fn into_install_blackhole_interface(
3700 self,
3701 ) -> Option<(fidl::endpoints::ServerEnd<ControlMarker>, Options, InstallerControlHandle)> {
3702 if let InstallerRequest::InstallBlackholeInterface { interface, options, control_handle } =
3703 self
3704 {
3705 Some((interface, options, control_handle))
3706 } else {
3707 None
3708 }
3709 }
3710
3711 pub fn method_name(&self) -> &'static str {
3713 match *self {
3714 InstallerRequest::InstallDevice { .. } => "install_device",
3715 InstallerRequest::InstallBlackholeInterface { .. } => "install_blackhole_interface",
3716 }
3717 }
3718}
3719
3720#[derive(Debug, Clone)]
3721pub struct InstallerControlHandle {
3722 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3723}
3724
3725impl fidl::endpoints::ControlHandle for InstallerControlHandle {
3726 fn shutdown(&self) {
3727 self.inner.shutdown()
3728 }
3729 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3730 self.inner.shutdown_with_epitaph(status)
3731 }
3732
3733 fn is_closed(&self) -> bool {
3734 self.inner.channel().is_closed()
3735 }
3736 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3737 self.inner.channel().on_closed()
3738 }
3739
3740 #[cfg(target_os = "fuchsia")]
3741 fn signal_peer(
3742 &self,
3743 clear_mask: zx::Signals,
3744 set_mask: zx::Signals,
3745 ) -> Result<(), zx_status::Status> {
3746 use fidl::Peered;
3747 self.inner.channel().signal_peer(clear_mask, set_mask)
3748 }
3749}
3750
3751impl InstallerControlHandle {}
3752
3753mod internal {
3754 use super::*;
3755
3756 impl fidl::encoding::ResourceTypeMarker for ControlAddAddressRequest {
3757 type Borrowed<'a> = &'a mut Self;
3758 fn take_or_borrow<'a>(
3759 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3760 ) -> Self::Borrowed<'a> {
3761 value
3762 }
3763 }
3764
3765 unsafe impl fidl::encoding::TypeMarker for ControlAddAddressRequest {
3766 type Owned = Self;
3767
3768 #[inline(always)]
3769 fn inline_align(_context: fidl::encoding::Context) -> usize {
3770 8
3771 }
3772
3773 #[inline(always)]
3774 fn inline_size(_context: fidl::encoding::Context) -> usize {
3775 48
3776 }
3777 }
3778
3779 unsafe impl
3780 fidl::encoding::Encode<
3781 ControlAddAddressRequest,
3782 fidl::encoding::DefaultFuchsiaResourceDialect,
3783 > for &mut ControlAddAddressRequest
3784 {
3785 #[inline]
3786 unsafe fn encode(
3787 self,
3788 encoder: &mut fidl::encoding::Encoder<
3789 '_,
3790 fidl::encoding::DefaultFuchsiaResourceDialect,
3791 >,
3792 offset: usize,
3793 _depth: fidl::encoding::Depth,
3794 ) -> fidl::Result<()> {
3795 encoder.debug_check_bounds::<ControlAddAddressRequest>(offset);
3796 fidl::encoding::Encode::<
3798 ControlAddAddressRequest,
3799 fidl::encoding::DefaultFuchsiaResourceDialect,
3800 >::encode(
3801 (
3802 <fidl_fuchsia_net::Subnet as fidl::encoding::ValueTypeMarker>::borrow(
3803 &self.address,
3804 ),
3805 <AddressParameters as fidl::encoding::ValueTypeMarker>::borrow(
3806 &self.parameters,
3807 ),
3808 <fidl::encoding::Endpoint<
3809 fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
3810 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3811 &mut self.address_state_provider,
3812 ),
3813 ),
3814 encoder,
3815 offset,
3816 _depth,
3817 )
3818 }
3819 }
3820 unsafe impl<
3821 T0: fidl::encoding::Encode<
3822 fidl_fuchsia_net::Subnet,
3823 fidl::encoding::DefaultFuchsiaResourceDialect,
3824 >,
3825 T1: fidl::encoding::Encode<
3826 AddressParameters,
3827 fidl::encoding::DefaultFuchsiaResourceDialect,
3828 >,
3829 T2: fidl::encoding::Encode<
3830 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AddressStateProviderMarker>>,
3831 fidl::encoding::DefaultFuchsiaResourceDialect,
3832 >,
3833 >
3834 fidl::encoding::Encode<
3835 ControlAddAddressRequest,
3836 fidl::encoding::DefaultFuchsiaResourceDialect,
3837 > for (T0, T1, T2)
3838 {
3839 #[inline]
3840 unsafe fn encode(
3841 self,
3842 encoder: &mut fidl::encoding::Encoder<
3843 '_,
3844 fidl::encoding::DefaultFuchsiaResourceDialect,
3845 >,
3846 offset: usize,
3847 depth: fidl::encoding::Depth,
3848 ) -> fidl::Result<()> {
3849 encoder.debug_check_bounds::<ControlAddAddressRequest>(offset);
3850 unsafe {
3853 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
3854 (ptr as *mut u64).write_unaligned(0);
3855 }
3856 self.0.encode(encoder, offset + 0, depth)?;
3858 self.1.encode(encoder, offset + 24, depth)?;
3859 self.2.encode(encoder, offset + 40, depth)?;
3860 Ok(())
3861 }
3862 }
3863
3864 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3865 for ControlAddAddressRequest
3866 {
3867 #[inline(always)]
3868 fn new_empty() -> Self {
3869 Self {
3870 address: fidl::new_empty!(
3871 fidl_fuchsia_net::Subnet,
3872 fidl::encoding::DefaultFuchsiaResourceDialect
3873 ),
3874 parameters: fidl::new_empty!(
3875 AddressParameters,
3876 fidl::encoding::DefaultFuchsiaResourceDialect
3877 ),
3878 address_state_provider: fidl::new_empty!(
3879 fidl::encoding::Endpoint<
3880 fidl::endpoints::ServerEnd<AddressStateProviderMarker>,
3881 >,
3882 fidl::encoding::DefaultFuchsiaResourceDialect
3883 ),
3884 }
3885 }
3886
3887 #[inline]
3888 unsafe fn decode(
3889 &mut self,
3890 decoder: &mut fidl::encoding::Decoder<
3891 '_,
3892 fidl::encoding::DefaultFuchsiaResourceDialect,
3893 >,
3894 offset: usize,
3895 _depth: fidl::encoding::Depth,
3896 ) -> fidl::Result<()> {
3897 decoder.debug_check_bounds::<Self>(offset);
3898 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
3900 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3901 let mask = 0xffffffff00000000u64;
3902 let maskedval = padval & mask;
3903 if maskedval != 0 {
3904 return Err(fidl::Error::NonZeroPadding {
3905 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
3906 });
3907 }
3908 fidl::decode!(
3909 fidl_fuchsia_net::Subnet,
3910 fidl::encoding::DefaultFuchsiaResourceDialect,
3911 &mut self.address,
3912 decoder,
3913 offset + 0,
3914 _depth
3915 )?;
3916 fidl::decode!(
3917 AddressParameters,
3918 fidl::encoding::DefaultFuchsiaResourceDialect,
3919 &mut self.parameters,
3920 decoder,
3921 offset + 24,
3922 _depth
3923 )?;
3924 fidl::decode!(
3925 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<AddressStateProviderMarker>>,
3926 fidl::encoding::DefaultFuchsiaResourceDialect,
3927 &mut self.address_state_provider,
3928 decoder,
3929 offset + 40,
3930 _depth
3931 )?;
3932 Ok(())
3933 }
3934 }
3935
3936 impl fidl::encoding::ResourceTypeMarker for ControlGetAuthorizationForInterfaceResponse {
3937 type Borrowed<'a> = &'a mut Self;
3938 fn take_or_borrow<'a>(
3939 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3940 ) -> Self::Borrowed<'a> {
3941 value
3942 }
3943 }
3944
3945 unsafe impl fidl::encoding::TypeMarker for ControlGetAuthorizationForInterfaceResponse {
3946 type Owned = Self;
3947
3948 #[inline(always)]
3949 fn inline_align(_context: fidl::encoding::Context) -> usize {
3950 8
3951 }
3952
3953 #[inline(always)]
3954 fn inline_size(_context: fidl::encoding::Context) -> usize {
3955 16
3956 }
3957 }
3958
3959 unsafe impl
3960 fidl::encoding::Encode<
3961 ControlGetAuthorizationForInterfaceResponse,
3962 fidl::encoding::DefaultFuchsiaResourceDialect,
3963 > for &mut ControlGetAuthorizationForInterfaceResponse
3964 {
3965 #[inline]
3966 unsafe fn encode(
3967 self,
3968 encoder: &mut fidl::encoding::Encoder<
3969 '_,
3970 fidl::encoding::DefaultFuchsiaResourceDialect,
3971 >,
3972 offset: usize,
3973 _depth: fidl::encoding::Depth,
3974 ) -> fidl::Result<()> {
3975 encoder.debug_check_bounds::<ControlGetAuthorizationForInterfaceResponse>(offset);
3976 fidl::encoding::Encode::<ControlGetAuthorizationForInterfaceResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3978 (
3979 <GrantForInterfaceAuthorization as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.credential),
3980 ),
3981 encoder, offset, _depth
3982 )
3983 }
3984 }
3985 unsafe impl<
3986 T0: fidl::encoding::Encode<
3987 GrantForInterfaceAuthorization,
3988 fidl::encoding::DefaultFuchsiaResourceDialect,
3989 >,
3990 >
3991 fidl::encoding::Encode<
3992 ControlGetAuthorizationForInterfaceResponse,
3993 fidl::encoding::DefaultFuchsiaResourceDialect,
3994 > for (T0,)
3995 {
3996 #[inline]
3997 unsafe fn encode(
3998 self,
3999 encoder: &mut fidl::encoding::Encoder<
4000 '_,
4001 fidl::encoding::DefaultFuchsiaResourceDialect,
4002 >,
4003 offset: usize,
4004 depth: fidl::encoding::Depth,
4005 ) -> fidl::Result<()> {
4006 encoder.debug_check_bounds::<ControlGetAuthorizationForInterfaceResponse>(offset);
4007 self.0.encode(encoder, offset + 0, depth)?;
4011 Ok(())
4012 }
4013 }
4014
4015 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4016 for ControlGetAuthorizationForInterfaceResponse
4017 {
4018 #[inline(always)]
4019 fn new_empty() -> Self {
4020 Self {
4021 credential: fidl::new_empty!(
4022 GrantForInterfaceAuthorization,
4023 fidl::encoding::DefaultFuchsiaResourceDialect
4024 ),
4025 }
4026 }
4027
4028 #[inline]
4029 unsafe fn decode(
4030 &mut self,
4031 decoder: &mut fidl::encoding::Decoder<
4032 '_,
4033 fidl::encoding::DefaultFuchsiaResourceDialect,
4034 >,
4035 offset: usize,
4036 _depth: fidl::encoding::Depth,
4037 ) -> fidl::Result<()> {
4038 decoder.debug_check_bounds::<Self>(offset);
4039 fidl::decode!(
4041 GrantForInterfaceAuthorization,
4042 fidl::encoding::DefaultFuchsiaResourceDialect,
4043 &mut self.credential,
4044 decoder,
4045 offset + 0,
4046 _depth
4047 )?;
4048 Ok(())
4049 }
4050 }
4051
4052 impl fidl::encoding::ResourceTypeMarker for DeviceControlCreateInterfaceRequest {
4053 type Borrowed<'a> = &'a mut Self;
4054 fn take_or_borrow<'a>(
4055 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4056 ) -> Self::Borrowed<'a> {
4057 value
4058 }
4059 }
4060
4061 unsafe impl fidl::encoding::TypeMarker for DeviceControlCreateInterfaceRequest {
4062 type Owned = Self;
4063
4064 #[inline(always)]
4065 fn inline_align(_context: fidl::encoding::Context) -> usize {
4066 8
4067 }
4068
4069 #[inline(always)]
4070 fn inline_size(_context: fidl::encoding::Context) -> usize {
4071 24
4072 }
4073 }
4074
4075 unsafe impl
4076 fidl::encoding::Encode<
4077 DeviceControlCreateInterfaceRequest,
4078 fidl::encoding::DefaultFuchsiaResourceDialect,
4079 > for &mut DeviceControlCreateInterfaceRequest
4080 {
4081 #[inline]
4082 unsafe fn encode(
4083 self,
4084 encoder: &mut fidl::encoding::Encoder<
4085 '_,
4086 fidl::encoding::DefaultFuchsiaResourceDialect,
4087 >,
4088 offset: usize,
4089 _depth: fidl::encoding::Depth,
4090 ) -> fidl::Result<()> {
4091 encoder.debug_check_bounds::<DeviceControlCreateInterfaceRequest>(offset);
4092 fidl::encoding::Encode::<DeviceControlCreateInterfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4094 (
4095 <fidl_fuchsia_hardware_network::PortId as fidl::encoding::ValueTypeMarker>::borrow(&self.port),
4096 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.control),
4097 <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
4098 ),
4099 encoder, offset, _depth
4100 )
4101 }
4102 }
4103 unsafe impl<
4104 T0: fidl::encoding::Encode<
4105 fidl_fuchsia_hardware_network::PortId,
4106 fidl::encoding::DefaultFuchsiaResourceDialect,
4107 >,
4108 T1: fidl::encoding::Encode<
4109 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>>,
4110 fidl::encoding::DefaultFuchsiaResourceDialect,
4111 >,
4112 T2: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
4113 >
4114 fidl::encoding::Encode<
4115 DeviceControlCreateInterfaceRequest,
4116 fidl::encoding::DefaultFuchsiaResourceDialect,
4117 > for (T0, T1, T2)
4118 {
4119 #[inline]
4120 unsafe fn encode(
4121 self,
4122 encoder: &mut fidl::encoding::Encoder<
4123 '_,
4124 fidl::encoding::DefaultFuchsiaResourceDialect,
4125 >,
4126 offset: usize,
4127 depth: fidl::encoding::Depth,
4128 ) -> fidl::Result<()> {
4129 encoder.debug_check_bounds::<DeviceControlCreateInterfaceRequest>(offset);
4130 unsafe {
4133 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4134 (ptr as *mut u64).write_unaligned(0);
4135 }
4136 self.0.encode(encoder, offset + 0, depth)?;
4138 self.1.encode(encoder, offset + 4, depth)?;
4139 self.2.encode(encoder, offset + 8, depth)?;
4140 Ok(())
4141 }
4142 }
4143
4144 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4145 for DeviceControlCreateInterfaceRequest
4146 {
4147 #[inline(always)]
4148 fn new_empty() -> Self {
4149 Self {
4150 port: fidl::new_empty!(
4151 fidl_fuchsia_hardware_network::PortId,
4152 fidl::encoding::DefaultFuchsiaResourceDialect
4153 ),
4154 control: fidl::new_empty!(
4155 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>>,
4156 fidl::encoding::DefaultFuchsiaResourceDialect
4157 ),
4158 options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
4159 }
4160 }
4161
4162 #[inline]
4163 unsafe fn decode(
4164 &mut self,
4165 decoder: &mut fidl::encoding::Decoder<
4166 '_,
4167 fidl::encoding::DefaultFuchsiaResourceDialect,
4168 >,
4169 offset: usize,
4170 _depth: fidl::encoding::Depth,
4171 ) -> fidl::Result<()> {
4172 decoder.debug_check_bounds::<Self>(offset);
4173 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4175 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4176 let mask = 0xffff0000u64;
4177 let maskedval = padval & mask;
4178 if maskedval != 0 {
4179 return Err(fidl::Error::NonZeroPadding {
4180 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4181 });
4182 }
4183 fidl::decode!(
4184 fidl_fuchsia_hardware_network::PortId,
4185 fidl::encoding::DefaultFuchsiaResourceDialect,
4186 &mut self.port,
4187 decoder,
4188 offset + 0,
4189 _depth
4190 )?;
4191 fidl::decode!(
4192 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>>,
4193 fidl::encoding::DefaultFuchsiaResourceDialect,
4194 &mut self.control,
4195 decoder,
4196 offset + 4,
4197 _depth
4198 )?;
4199 fidl::decode!(
4200 Options,
4201 fidl::encoding::DefaultFuchsiaResourceDialect,
4202 &mut self.options,
4203 decoder,
4204 offset + 8,
4205 _depth
4206 )?;
4207 Ok(())
4208 }
4209 }
4210
4211 impl fidl::encoding::ResourceTypeMarker for GrantForInterfaceAuthorization {
4212 type Borrowed<'a> = &'a mut Self;
4213 fn take_or_borrow<'a>(
4214 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4215 ) -> Self::Borrowed<'a> {
4216 value
4217 }
4218 }
4219
4220 unsafe impl fidl::encoding::TypeMarker for GrantForInterfaceAuthorization {
4221 type Owned = Self;
4222
4223 #[inline(always)]
4224 fn inline_align(_context: fidl::encoding::Context) -> usize {
4225 8
4226 }
4227
4228 #[inline(always)]
4229 fn inline_size(_context: fidl::encoding::Context) -> usize {
4230 16
4231 }
4232 }
4233
4234 unsafe impl
4235 fidl::encoding::Encode<
4236 GrantForInterfaceAuthorization,
4237 fidl::encoding::DefaultFuchsiaResourceDialect,
4238 > for &mut GrantForInterfaceAuthorization
4239 {
4240 #[inline]
4241 unsafe fn encode(
4242 self,
4243 encoder: &mut fidl::encoding::Encoder<
4244 '_,
4245 fidl::encoding::DefaultFuchsiaResourceDialect,
4246 >,
4247 offset: usize,
4248 _depth: fidl::encoding::Depth,
4249 ) -> fidl::Result<()> {
4250 encoder.debug_check_bounds::<GrantForInterfaceAuthorization>(offset);
4251 fidl::encoding::Encode::<
4253 GrantForInterfaceAuthorization,
4254 fidl::encoding::DefaultFuchsiaResourceDialect,
4255 >::encode(
4256 (
4257 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
4258 <fidl::encoding::HandleType<
4259 fidl::Event,
4260 { fidl::ObjectType::EVENT.into_raw() },
4261 3,
4262 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4263 &mut self.token
4264 ),
4265 ),
4266 encoder,
4267 offset,
4268 _depth,
4269 )
4270 }
4271 }
4272 unsafe impl<
4273 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
4274 T1: fidl::encoding::Encode<
4275 fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>,
4276 fidl::encoding::DefaultFuchsiaResourceDialect,
4277 >,
4278 >
4279 fidl::encoding::Encode<
4280 GrantForInterfaceAuthorization,
4281 fidl::encoding::DefaultFuchsiaResourceDialect,
4282 > for (T0, T1)
4283 {
4284 #[inline]
4285 unsafe fn encode(
4286 self,
4287 encoder: &mut fidl::encoding::Encoder<
4288 '_,
4289 fidl::encoding::DefaultFuchsiaResourceDialect,
4290 >,
4291 offset: usize,
4292 depth: fidl::encoding::Depth,
4293 ) -> fidl::Result<()> {
4294 encoder.debug_check_bounds::<GrantForInterfaceAuthorization>(offset);
4295 unsafe {
4298 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4299 (ptr as *mut u64).write_unaligned(0);
4300 }
4301 self.0.encode(encoder, offset + 0, depth)?;
4303 self.1.encode(encoder, offset + 8, depth)?;
4304 Ok(())
4305 }
4306 }
4307
4308 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4309 for GrantForInterfaceAuthorization
4310 {
4311 #[inline(always)]
4312 fn new_empty() -> Self {
4313 Self {
4314 interface_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
4315 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>, fidl::encoding::DefaultFuchsiaResourceDialect),
4316 }
4317 }
4318
4319 #[inline]
4320 unsafe fn decode(
4321 &mut self,
4322 decoder: &mut fidl::encoding::Decoder<
4323 '_,
4324 fidl::encoding::DefaultFuchsiaResourceDialect,
4325 >,
4326 offset: usize,
4327 _depth: fidl::encoding::Depth,
4328 ) -> fidl::Result<()> {
4329 decoder.debug_check_bounds::<Self>(offset);
4330 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4332 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4333 let mask = 0xffffffff00000000u64;
4334 let maskedval = padval & mask;
4335 if maskedval != 0 {
4336 return Err(fidl::Error::NonZeroPadding {
4337 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4338 });
4339 }
4340 fidl::decode!(
4341 u64,
4342 fidl::encoding::DefaultFuchsiaResourceDialect,
4343 &mut self.interface_id,
4344 decoder,
4345 offset + 0,
4346 _depth
4347 )?;
4348 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 8, _depth)?;
4349 Ok(())
4350 }
4351 }
4352
4353 impl fidl::encoding::ResourceTypeMarker for InstallerInstallBlackholeInterfaceRequest {
4354 type Borrowed<'a> = &'a mut Self;
4355 fn take_or_borrow<'a>(
4356 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4357 ) -> Self::Borrowed<'a> {
4358 value
4359 }
4360 }
4361
4362 unsafe impl fidl::encoding::TypeMarker for InstallerInstallBlackholeInterfaceRequest {
4363 type Owned = Self;
4364
4365 #[inline(always)]
4366 fn inline_align(_context: fidl::encoding::Context) -> usize {
4367 8
4368 }
4369
4370 #[inline(always)]
4371 fn inline_size(_context: fidl::encoding::Context) -> usize {
4372 24
4373 }
4374 }
4375
4376 unsafe impl
4377 fidl::encoding::Encode<
4378 InstallerInstallBlackholeInterfaceRequest,
4379 fidl::encoding::DefaultFuchsiaResourceDialect,
4380 > for &mut InstallerInstallBlackholeInterfaceRequest
4381 {
4382 #[inline]
4383 unsafe fn encode(
4384 self,
4385 encoder: &mut fidl::encoding::Encoder<
4386 '_,
4387 fidl::encoding::DefaultFuchsiaResourceDialect,
4388 >,
4389 offset: usize,
4390 _depth: fidl::encoding::Depth,
4391 ) -> fidl::Result<()> {
4392 encoder.debug_check_bounds::<InstallerInstallBlackholeInterfaceRequest>(offset);
4393 fidl::encoding::Encode::<InstallerInstallBlackholeInterfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4395 (
4396 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.interface),
4397 <Options as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
4398 ),
4399 encoder, offset, _depth
4400 )
4401 }
4402 }
4403 unsafe impl<
4404 T0: fidl::encoding::Encode<
4405 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>>,
4406 fidl::encoding::DefaultFuchsiaResourceDialect,
4407 >,
4408 T1: fidl::encoding::Encode<Options, fidl::encoding::DefaultFuchsiaResourceDialect>,
4409 >
4410 fidl::encoding::Encode<
4411 InstallerInstallBlackholeInterfaceRequest,
4412 fidl::encoding::DefaultFuchsiaResourceDialect,
4413 > for (T0, T1)
4414 {
4415 #[inline]
4416 unsafe fn encode(
4417 self,
4418 encoder: &mut fidl::encoding::Encoder<
4419 '_,
4420 fidl::encoding::DefaultFuchsiaResourceDialect,
4421 >,
4422 offset: usize,
4423 depth: fidl::encoding::Depth,
4424 ) -> fidl::Result<()> {
4425 encoder.debug_check_bounds::<InstallerInstallBlackholeInterfaceRequest>(offset);
4426 unsafe {
4429 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4430 (ptr as *mut u64).write_unaligned(0);
4431 }
4432 self.0.encode(encoder, offset + 0, depth)?;
4434 self.1.encode(encoder, offset + 8, depth)?;
4435 Ok(())
4436 }
4437 }
4438
4439 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4440 for InstallerInstallBlackholeInterfaceRequest
4441 {
4442 #[inline(always)]
4443 fn new_empty() -> Self {
4444 Self {
4445 interface: fidl::new_empty!(
4446 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>>,
4447 fidl::encoding::DefaultFuchsiaResourceDialect
4448 ),
4449 options: fidl::new_empty!(Options, fidl::encoding::DefaultFuchsiaResourceDialect),
4450 }
4451 }
4452
4453 #[inline]
4454 unsafe fn decode(
4455 &mut self,
4456 decoder: &mut fidl::encoding::Decoder<
4457 '_,
4458 fidl::encoding::DefaultFuchsiaResourceDialect,
4459 >,
4460 offset: usize,
4461 _depth: fidl::encoding::Depth,
4462 ) -> fidl::Result<()> {
4463 decoder.debug_check_bounds::<Self>(offset);
4464 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4466 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4467 let mask = 0xffffffff00000000u64;
4468 let maskedval = padval & mask;
4469 if maskedval != 0 {
4470 return Err(fidl::Error::NonZeroPadding {
4471 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4472 });
4473 }
4474 fidl::decode!(
4475 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControlMarker>>,
4476 fidl::encoding::DefaultFuchsiaResourceDialect,
4477 &mut self.interface,
4478 decoder,
4479 offset + 0,
4480 _depth
4481 )?;
4482 fidl::decode!(
4483 Options,
4484 fidl::encoding::DefaultFuchsiaResourceDialect,
4485 &mut self.options,
4486 decoder,
4487 offset + 8,
4488 _depth
4489 )?;
4490 Ok(())
4491 }
4492 }
4493
4494 impl fidl::encoding::ResourceTypeMarker for InstallerInstallDeviceRequest {
4495 type Borrowed<'a> = &'a mut Self;
4496 fn take_or_borrow<'a>(
4497 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4498 ) -> Self::Borrowed<'a> {
4499 value
4500 }
4501 }
4502
4503 unsafe impl fidl::encoding::TypeMarker for InstallerInstallDeviceRequest {
4504 type Owned = Self;
4505
4506 #[inline(always)]
4507 fn inline_align(_context: fidl::encoding::Context) -> usize {
4508 4
4509 }
4510
4511 #[inline(always)]
4512 fn inline_size(_context: fidl::encoding::Context) -> usize {
4513 8
4514 }
4515 }
4516
4517 unsafe impl
4518 fidl::encoding::Encode<
4519 InstallerInstallDeviceRequest,
4520 fidl::encoding::DefaultFuchsiaResourceDialect,
4521 > for &mut InstallerInstallDeviceRequest
4522 {
4523 #[inline]
4524 unsafe fn encode(
4525 self,
4526 encoder: &mut fidl::encoding::Encoder<
4527 '_,
4528 fidl::encoding::DefaultFuchsiaResourceDialect,
4529 >,
4530 offset: usize,
4531 _depth: fidl::encoding::Depth,
4532 ) -> fidl::Result<()> {
4533 encoder.debug_check_bounds::<InstallerInstallDeviceRequest>(offset);
4534 fidl::encoding::Encode::<InstallerInstallDeviceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4536 (
4537 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.device),
4538 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceControlMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.device_control),
4539 ),
4540 encoder, offset, _depth
4541 )
4542 }
4543 }
4544 unsafe impl<
4545 T0: fidl::encoding::Encode<
4546 fidl::encoding::Endpoint<
4547 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
4548 >,
4549 fidl::encoding::DefaultFuchsiaResourceDialect,
4550 >,
4551 T1: fidl::encoding::Encode<
4552 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceControlMarker>>,
4553 fidl::encoding::DefaultFuchsiaResourceDialect,
4554 >,
4555 >
4556 fidl::encoding::Encode<
4557 InstallerInstallDeviceRequest,
4558 fidl::encoding::DefaultFuchsiaResourceDialect,
4559 > for (T0, T1)
4560 {
4561 #[inline]
4562 unsafe fn encode(
4563 self,
4564 encoder: &mut fidl::encoding::Encoder<
4565 '_,
4566 fidl::encoding::DefaultFuchsiaResourceDialect,
4567 >,
4568 offset: usize,
4569 depth: fidl::encoding::Depth,
4570 ) -> fidl::Result<()> {
4571 encoder.debug_check_bounds::<InstallerInstallDeviceRequest>(offset);
4572 self.0.encode(encoder, offset + 0, depth)?;
4576 self.1.encode(encoder, offset + 4, depth)?;
4577 Ok(())
4578 }
4579 }
4580
4581 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4582 for InstallerInstallDeviceRequest
4583 {
4584 #[inline(always)]
4585 fn new_empty() -> Self {
4586 Self {
4587 device: fidl::new_empty!(
4588 fidl::encoding::Endpoint<
4589 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
4590 >,
4591 fidl::encoding::DefaultFuchsiaResourceDialect
4592 ),
4593 device_control: fidl::new_empty!(
4594 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceControlMarker>>,
4595 fidl::encoding::DefaultFuchsiaResourceDialect
4596 ),
4597 }
4598 }
4599
4600 #[inline]
4601 unsafe fn decode(
4602 &mut self,
4603 decoder: &mut fidl::encoding::Decoder<
4604 '_,
4605 fidl::encoding::DefaultFuchsiaResourceDialect,
4606 >,
4607 offset: usize,
4608 _depth: fidl::encoding::Depth,
4609 ) -> fidl::Result<()> {
4610 decoder.debug_check_bounds::<Self>(offset);
4611 fidl::decode!(
4613 fidl::encoding::Endpoint<
4614 fidl::endpoints::ClientEnd<fidl_fuchsia_hardware_network::DeviceMarker>,
4615 >,
4616 fidl::encoding::DefaultFuchsiaResourceDialect,
4617 &mut self.device,
4618 decoder,
4619 offset + 0,
4620 _depth
4621 )?;
4622 fidl::decode!(
4623 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceControlMarker>>,
4624 fidl::encoding::DefaultFuchsiaResourceDialect,
4625 &mut self.device_control,
4626 decoder,
4627 offset + 4,
4628 _depth
4629 )?;
4630 Ok(())
4631 }
4632 }
4633
4634 impl fidl::encoding::ResourceTypeMarker for ProofOfInterfaceAuthorization {
4635 type Borrowed<'a> = &'a mut Self;
4636 fn take_or_borrow<'a>(
4637 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4638 ) -> Self::Borrowed<'a> {
4639 value
4640 }
4641 }
4642
4643 unsafe impl fidl::encoding::TypeMarker for ProofOfInterfaceAuthorization {
4644 type Owned = Self;
4645
4646 #[inline(always)]
4647 fn inline_align(_context: fidl::encoding::Context) -> usize {
4648 8
4649 }
4650
4651 #[inline(always)]
4652 fn inline_size(_context: fidl::encoding::Context) -> usize {
4653 16
4654 }
4655 }
4656
4657 unsafe impl
4658 fidl::encoding::Encode<
4659 ProofOfInterfaceAuthorization,
4660 fidl::encoding::DefaultFuchsiaResourceDialect,
4661 > for &mut ProofOfInterfaceAuthorization
4662 {
4663 #[inline]
4664 unsafe fn encode(
4665 self,
4666 encoder: &mut fidl::encoding::Encoder<
4667 '_,
4668 fidl::encoding::DefaultFuchsiaResourceDialect,
4669 >,
4670 offset: usize,
4671 _depth: fidl::encoding::Depth,
4672 ) -> fidl::Result<()> {
4673 encoder.debug_check_bounds::<ProofOfInterfaceAuthorization>(offset);
4674 fidl::encoding::Encode::<
4676 ProofOfInterfaceAuthorization,
4677 fidl::encoding::DefaultFuchsiaResourceDialect,
4678 >::encode(
4679 (
4680 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
4681 <fidl::encoding::HandleType<
4682 fidl::Event,
4683 { fidl::ObjectType::EVENT.into_raw() },
4684 0,
4685 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4686 &mut self.token
4687 ),
4688 ),
4689 encoder,
4690 offset,
4691 _depth,
4692 )
4693 }
4694 }
4695 unsafe impl<
4696 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
4697 T1: fidl::encoding::Encode<
4698 fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 0>,
4699 fidl::encoding::DefaultFuchsiaResourceDialect,
4700 >,
4701 >
4702 fidl::encoding::Encode<
4703 ProofOfInterfaceAuthorization,
4704 fidl::encoding::DefaultFuchsiaResourceDialect,
4705 > for (T0, T1)
4706 {
4707 #[inline]
4708 unsafe fn encode(
4709 self,
4710 encoder: &mut fidl::encoding::Encoder<
4711 '_,
4712 fidl::encoding::DefaultFuchsiaResourceDialect,
4713 >,
4714 offset: usize,
4715 depth: fidl::encoding::Depth,
4716 ) -> fidl::Result<()> {
4717 encoder.debug_check_bounds::<ProofOfInterfaceAuthorization>(offset);
4718 unsafe {
4721 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4722 (ptr as *mut u64).write_unaligned(0);
4723 }
4724 self.0.encode(encoder, offset + 0, depth)?;
4726 self.1.encode(encoder, offset + 8, depth)?;
4727 Ok(())
4728 }
4729 }
4730
4731 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4732 for ProofOfInterfaceAuthorization
4733 {
4734 #[inline(always)]
4735 fn new_empty() -> Self {
4736 Self {
4737 interface_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
4738 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 0>, fidl::encoding::DefaultFuchsiaResourceDialect),
4739 }
4740 }
4741
4742 #[inline]
4743 unsafe fn decode(
4744 &mut self,
4745 decoder: &mut fidl::encoding::Decoder<
4746 '_,
4747 fidl::encoding::DefaultFuchsiaResourceDialect,
4748 >,
4749 offset: usize,
4750 _depth: fidl::encoding::Depth,
4751 ) -> fidl::Result<()> {
4752 decoder.debug_check_bounds::<Self>(offset);
4753 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4755 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4756 let mask = 0xffffffff00000000u64;
4757 let maskedval = padval & mask;
4758 if maskedval != 0 {
4759 return Err(fidl::Error::NonZeroPadding {
4760 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4761 });
4762 }
4763 fidl::decode!(
4764 u64,
4765 fidl::encoding::DefaultFuchsiaResourceDialect,
4766 &mut self.interface_id,
4767 decoder,
4768 offset + 0,
4769 _depth
4770 )?;
4771 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 0>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 8, _depth)?;
4772 Ok(())
4773 }
4774 }
4775}