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_weave_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct BootstrapImportWeaveConfigRequest {
16 pub config_json: fidl_fuchsia_mem::Buffer,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for BootstrapImportWeaveConfigRequest
21{
22}
23
24#[derive(Debug, PartialEq)]
25pub struct FactoryDataManagerGetWeaveCertificateResponse {
26 pub certificate: fidl_fuchsia_mem::Buffer,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for FactoryDataManagerGetWeaveCertificateResponse
31{
32}
33
34#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35pub struct StackGetPairingStateWatcherRequest {
36 pub watcher: fidl::endpoints::ServerEnd<PairingStateWatcherMarker>,
37}
38
39impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
40 for StackGetPairingStateWatcherRequest
41{
42}
43
44#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
45pub struct StackGetSvcDirectoryWatcherRequest {
46 pub endpoint_id: u64,
47 pub watcher: fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>,
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
51 for StackGetSvcDirectoryWatcherRequest
52{
53}
54
55#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
56pub struct StackProviderSetWlanNetworkConfigProviderRequest {
57 pub provider: fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
58}
59
60impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
61 for StackProviderSetWlanNetworkConfigProviderRequest
62{
63}
64
65#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
66pub struct BootstrapMarker;
67
68impl fidl::endpoints::ProtocolMarker for BootstrapMarker {
69 type Proxy = BootstrapProxy;
70 type RequestStream = BootstrapRequestStream;
71 #[cfg(target_os = "fuchsia")]
72 type SynchronousProxy = BootstrapSynchronousProxy;
73
74 const DEBUG_NAME: &'static str = "fuchsia.weave.Bootstrap";
75}
76impl fidl::endpoints::DiscoverableProtocolMarker for BootstrapMarker {}
77pub type BootstrapImportWeaveConfigResult = Result<(), i32>;
78
79pub trait BootstrapProxyInterface: Send + Sync {
80 type ImportWeaveConfigResponseFut: std::future::Future<Output = Result<BootstrapImportWeaveConfigResult, fidl::Error>>
81 + Send;
82 fn r#import_weave_config(
83 &self,
84 config_json: fidl_fuchsia_mem::Buffer,
85 ) -> Self::ImportWeaveConfigResponseFut;
86}
87#[derive(Debug)]
88#[cfg(target_os = "fuchsia")]
89pub struct BootstrapSynchronousProxy {
90 client: fidl::client::sync::Client,
91}
92
93#[cfg(target_os = "fuchsia")]
94impl fidl::endpoints::SynchronousProxy for BootstrapSynchronousProxy {
95 type Proxy = BootstrapProxy;
96 type Protocol = BootstrapMarker;
97
98 fn from_channel(inner: fidl::Channel) -> Self {
99 Self::new(inner)
100 }
101
102 fn into_channel(self) -> fidl::Channel {
103 self.client.into_channel()
104 }
105
106 fn as_channel(&self) -> &fidl::Channel {
107 self.client.as_channel()
108 }
109}
110
111#[cfg(target_os = "fuchsia")]
112impl BootstrapSynchronousProxy {
113 pub fn new(channel: fidl::Channel) -> Self {
114 let protocol_name = <BootstrapMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
115 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
116 }
117
118 pub fn into_channel(self) -> fidl::Channel {
119 self.client.into_channel()
120 }
121
122 pub fn wait_for_event(
125 &self,
126 deadline: zx::MonotonicInstant,
127 ) -> Result<BootstrapEvent, fidl::Error> {
128 BootstrapEvent::decode(self.client.wait_for_event(deadline)?)
129 }
130
131 pub fn r#import_weave_config(
138 &self,
139 mut config_json: fidl_fuchsia_mem::Buffer,
140 ___deadline: zx::MonotonicInstant,
141 ) -> Result<BootstrapImportWeaveConfigResult, fidl::Error> {
142 let _response = self.client.send_query::<
143 BootstrapImportWeaveConfigRequest,
144 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
145 >(
146 (&mut config_json,),
147 0x3cba680ade22f738,
148 fidl::encoding::DynamicFlags::empty(),
149 ___deadline,
150 )?;
151 Ok(_response.map(|x| x))
152 }
153}
154
155#[cfg(target_os = "fuchsia")]
156impl From<BootstrapSynchronousProxy> for zx::Handle {
157 fn from(value: BootstrapSynchronousProxy) -> Self {
158 value.into_channel().into()
159 }
160}
161
162#[cfg(target_os = "fuchsia")]
163impl From<fidl::Channel> for BootstrapSynchronousProxy {
164 fn from(value: fidl::Channel) -> Self {
165 Self::new(value)
166 }
167}
168
169#[derive(Debug, Clone)]
170pub struct BootstrapProxy {
171 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
172}
173
174impl fidl::endpoints::Proxy for BootstrapProxy {
175 type Protocol = BootstrapMarker;
176
177 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
178 Self::new(inner)
179 }
180
181 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
182 self.client.into_channel().map_err(|client| Self { client })
183 }
184
185 fn as_channel(&self) -> &::fidl::AsyncChannel {
186 self.client.as_channel()
187 }
188}
189
190impl BootstrapProxy {
191 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
193 let protocol_name = <BootstrapMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
194 Self { client: fidl::client::Client::new(channel, protocol_name) }
195 }
196
197 pub fn take_event_stream(&self) -> BootstrapEventStream {
203 BootstrapEventStream { event_receiver: self.client.take_event_receiver() }
204 }
205
206 pub fn r#import_weave_config(
213 &self,
214 mut config_json: fidl_fuchsia_mem::Buffer,
215 ) -> fidl::client::QueryResponseFut<
216 BootstrapImportWeaveConfigResult,
217 fidl::encoding::DefaultFuchsiaResourceDialect,
218 > {
219 BootstrapProxyInterface::r#import_weave_config(self, config_json)
220 }
221}
222
223impl BootstrapProxyInterface for BootstrapProxy {
224 type ImportWeaveConfigResponseFut = fidl::client::QueryResponseFut<
225 BootstrapImportWeaveConfigResult,
226 fidl::encoding::DefaultFuchsiaResourceDialect,
227 >;
228 fn r#import_weave_config(
229 &self,
230 mut config_json: fidl_fuchsia_mem::Buffer,
231 ) -> Self::ImportWeaveConfigResponseFut {
232 fn _decode(
233 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
234 ) -> Result<BootstrapImportWeaveConfigResult, fidl::Error> {
235 let _response = fidl::client::decode_transaction_body::<
236 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
237 fidl::encoding::DefaultFuchsiaResourceDialect,
238 0x3cba680ade22f738,
239 >(_buf?)?;
240 Ok(_response.map(|x| x))
241 }
242 self.client.send_query_and_decode::<
243 BootstrapImportWeaveConfigRequest,
244 BootstrapImportWeaveConfigResult,
245 >(
246 (&mut config_json,),
247 0x3cba680ade22f738,
248 fidl::encoding::DynamicFlags::empty(),
249 _decode,
250 )
251 }
252}
253
254pub struct BootstrapEventStream {
255 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
256}
257
258impl std::marker::Unpin for BootstrapEventStream {}
259
260impl futures::stream::FusedStream for BootstrapEventStream {
261 fn is_terminated(&self) -> bool {
262 self.event_receiver.is_terminated()
263 }
264}
265
266impl futures::Stream for BootstrapEventStream {
267 type Item = Result<BootstrapEvent, fidl::Error>;
268
269 fn poll_next(
270 mut self: std::pin::Pin<&mut Self>,
271 cx: &mut std::task::Context<'_>,
272 ) -> std::task::Poll<Option<Self::Item>> {
273 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
274 &mut self.event_receiver,
275 cx
276 )?) {
277 Some(buf) => std::task::Poll::Ready(Some(BootstrapEvent::decode(buf))),
278 None => std::task::Poll::Ready(None),
279 }
280 }
281}
282
283#[derive(Debug)]
284pub enum BootstrapEvent {}
285
286impl BootstrapEvent {
287 fn decode(
289 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
290 ) -> Result<BootstrapEvent, fidl::Error> {
291 let (bytes, _handles) = buf.split_mut();
292 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
293 debug_assert_eq!(tx_header.tx_id, 0);
294 match tx_header.ordinal {
295 _ => Err(fidl::Error::UnknownOrdinal {
296 ordinal: tx_header.ordinal,
297 protocol_name: <BootstrapMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
298 }),
299 }
300 }
301}
302
303pub struct BootstrapRequestStream {
305 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
306 is_terminated: bool,
307}
308
309impl std::marker::Unpin for BootstrapRequestStream {}
310
311impl futures::stream::FusedStream for BootstrapRequestStream {
312 fn is_terminated(&self) -> bool {
313 self.is_terminated
314 }
315}
316
317impl fidl::endpoints::RequestStream for BootstrapRequestStream {
318 type Protocol = BootstrapMarker;
319 type ControlHandle = BootstrapControlHandle;
320
321 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
322 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
323 }
324
325 fn control_handle(&self) -> Self::ControlHandle {
326 BootstrapControlHandle { inner: self.inner.clone() }
327 }
328
329 fn into_inner(
330 self,
331 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
332 {
333 (self.inner, self.is_terminated)
334 }
335
336 fn from_inner(
337 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
338 is_terminated: bool,
339 ) -> Self {
340 Self { inner, is_terminated }
341 }
342}
343
344impl futures::Stream for BootstrapRequestStream {
345 type Item = Result<BootstrapRequest, fidl::Error>;
346
347 fn poll_next(
348 mut self: std::pin::Pin<&mut Self>,
349 cx: &mut std::task::Context<'_>,
350 ) -> std::task::Poll<Option<Self::Item>> {
351 let this = &mut *self;
352 if this.inner.check_shutdown(cx) {
353 this.is_terminated = true;
354 return std::task::Poll::Ready(None);
355 }
356 if this.is_terminated {
357 panic!("polled BootstrapRequestStream after completion");
358 }
359 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
360 |bytes, handles| {
361 match this.inner.channel().read_etc(cx, bytes, handles) {
362 std::task::Poll::Ready(Ok(())) => {}
363 std::task::Poll::Pending => return std::task::Poll::Pending,
364 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
365 this.is_terminated = true;
366 return std::task::Poll::Ready(None);
367 }
368 std::task::Poll::Ready(Err(e)) => {
369 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
370 e.into(),
371 ))))
372 }
373 }
374
375 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
377
378 std::task::Poll::Ready(Some(match header.ordinal {
379 0x3cba680ade22f738 => {
380 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
381 let mut req = fidl::new_empty!(
382 BootstrapImportWeaveConfigRequest,
383 fidl::encoding::DefaultFuchsiaResourceDialect
384 );
385 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BootstrapImportWeaveConfigRequest>(&header, _body_bytes, handles, &mut req)?;
386 let control_handle = BootstrapControlHandle { inner: this.inner.clone() };
387 Ok(BootstrapRequest::ImportWeaveConfig {
388 config_json: req.config_json,
389
390 responder: BootstrapImportWeaveConfigResponder {
391 control_handle: std::mem::ManuallyDrop::new(control_handle),
392 tx_id: header.tx_id,
393 },
394 })
395 }
396 _ => Err(fidl::Error::UnknownOrdinal {
397 ordinal: header.ordinal,
398 protocol_name:
399 <BootstrapMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
400 }),
401 }))
402 },
403 )
404 }
405}
406
407#[derive(Debug)]
411pub enum BootstrapRequest {
412 ImportWeaveConfig {
419 config_json: fidl_fuchsia_mem::Buffer,
420 responder: BootstrapImportWeaveConfigResponder,
421 },
422}
423
424impl BootstrapRequest {
425 #[allow(irrefutable_let_patterns)]
426 pub fn into_import_weave_config(
427 self,
428 ) -> Option<(fidl_fuchsia_mem::Buffer, BootstrapImportWeaveConfigResponder)> {
429 if let BootstrapRequest::ImportWeaveConfig { config_json, responder } = self {
430 Some((config_json, responder))
431 } else {
432 None
433 }
434 }
435
436 pub fn method_name(&self) -> &'static str {
438 match *self {
439 BootstrapRequest::ImportWeaveConfig { .. } => "import_weave_config",
440 }
441 }
442}
443
444#[derive(Debug, Clone)]
445pub struct BootstrapControlHandle {
446 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
447}
448
449impl fidl::endpoints::ControlHandle for BootstrapControlHandle {
450 fn shutdown(&self) {
451 self.inner.shutdown()
452 }
453 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
454 self.inner.shutdown_with_epitaph(status)
455 }
456
457 fn is_closed(&self) -> bool {
458 self.inner.channel().is_closed()
459 }
460 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
461 self.inner.channel().on_closed()
462 }
463
464 #[cfg(target_os = "fuchsia")]
465 fn signal_peer(
466 &self,
467 clear_mask: zx::Signals,
468 set_mask: zx::Signals,
469 ) -> Result<(), zx_status::Status> {
470 use fidl::Peered;
471 self.inner.channel().signal_peer(clear_mask, set_mask)
472 }
473}
474
475impl BootstrapControlHandle {}
476
477#[must_use = "FIDL methods require a response to be sent"]
478#[derive(Debug)]
479pub struct BootstrapImportWeaveConfigResponder {
480 control_handle: std::mem::ManuallyDrop<BootstrapControlHandle>,
481 tx_id: u32,
482}
483
484impl std::ops::Drop for BootstrapImportWeaveConfigResponder {
488 fn drop(&mut self) {
489 self.control_handle.shutdown();
490 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
492 }
493}
494
495impl fidl::endpoints::Responder for BootstrapImportWeaveConfigResponder {
496 type ControlHandle = BootstrapControlHandle;
497
498 fn control_handle(&self) -> &BootstrapControlHandle {
499 &self.control_handle
500 }
501
502 fn drop_without_shutdown(mut self) {
503 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
505 std::mem::forget(self);
507 }
508}
509
510impl BootstrapImportWeaveConfigResponder {
511 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
515 let _result = self.send_raw(result);
516 if _result.is_err() {
517 self.control_handle.shutdown();
518 }
519 self.drop_without_shutdown();
520 _result
521 }
522
523 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
525 let _result = self.send_raw(result);
526 self.drop_without_shutdown();
527 _result
528 }
529
530 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
531 self.control_handle
532 .inner
533 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
534 result,
535 self.tx_id,
536 0x3cba680ade22f738,
537 fidl::encoding::DynamicFlags::empty(),
538 )
539 }
540}
541
542#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
543pub struct FactoryDataManagerMarker;
544
545impl fidl::endpoints::ProtocolMarker for FactoryDataManagerMarker {
546 type Proxy = FactoryDataManagerProxy;
547 type RequestStream = FactoryDataManagerRequestStream;
548 #[cfg(target_os = "fuchsia")]
549 type SynchronousProxy = FactoryDataManagerSynchronousProxy;
550
551 const DEBUG_NAME: &'static str = "fuchsia.weave.FactoryDataManager";
552}
553impl fidl::endpoints::DiscoverableProtocolMarker for FactoryDataManagerMarker {}
554pub type FactoryDataManagerGetPairingCodeResult = Result<Vec<u8>, ErrorCode>;
555pub type FactoryDataManagerGetWeaveCertificateResult = Result<fidl_fuchsia_mem::Buffer, ErrorCode>;
556
557pub trait FactoryDataManagerProxyInterface: Send + Sync {
558 type GetPairingCodeResponseFut: std::future::Future<Output = Result<FactoryDataManagerGetPairingCodeResult, fidl::Error>>
559 + Send;
560 fn r#get_pairing_code(&self) -> Self::GetPairingCodeResponseFut;
561 type GetWeaveCertificateResponseFut: std::future::Future<
562 Output = Result<FactoryDataManagerGetWeaveCertificateResult, fidl::Error>,
563 > + Send;
564 fn r#get_weave_certificate(&self) -> Self::GetWeaveCertificateResponseFut;
565}
566#[derive(Debug)]
567#[cfg(target_os = "fuchsia")]
568pub struct FactoryDataManagerSynchronousProxy {
569 client: fidl::client::sync::Client,
570}
571
572#[cfg(target_os = "fuchsia")]
573impl fidl::endpoints::SynchronousProxy for FactoryDataManagerSynchronousProxy {
574 type Proxy = FactoryDataManagerProxy;
575 type Protocol = FactoryDataManagerMarker;
576
577 fn from_channel(inner: fidl::Channel) -> Self {
578 Self::new(inner)
579 }
580
581 fn into_channel(self) -> fidl::Channel {
582 self.client.into_channel()
583 }
584
585 fn as_channel(&self) -> &fidl::Channel {
586 self.client.as_channel()
587 }
588}
589
590#[cfg(target_os = "fuchsia")]
591impl FactoryDataManagerSynchronousProxy {
592 pub fn new(channel: fidl::Channel) -> Self {
593 let protocol_name =
594 <FactoryDataManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
595 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
596 }
597
598 pub fn into_channel(self) -> fidl::Channel {
599 self.client.into_channel()
600 }
601
602 pub fn wait_for_event(
605 &self,
606 deadline: zx::MonotonicInstant,
607 ) -> Result<FactoryDataManagerEvent, fidl::Error> {
608 FactoryDataManagerEvent::decode(self.client.wait_for_event(deadline)?)
609 }
610
611 pub fn r#get_pairing_code(
613 &self,
614 ___deadline: zx::MonotonicInstant,
615 ) -> Result<FactoryDataManagerGetPairingCodeResult, fidl::Error> {
616 let _response =
617 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
618 FactoryDataManagerGetPairingCodeResponse,
619 ErrorCode,
620 >>(
621 (),
622 0x75630bcd80418a0f,
623 fidl::encoding::DynamicFlags::empty(),
624 ___deadline,
625 )?;
626 Ok(_response.map(|x| x.pairing_code))
627 }
628
629 pub fn r#get_weave_certificate(
631 &self,
632 ___deadline: zx::MonotonicInstant,
633 ) -> Result<FactoryDataManagerGetWeaveCertificateResult, fidl::Error> {
634 let _response =
635 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
636 FactoryDataManagerGetWeaveCertificateResponse,
637 ErrorCode,
638 >>(
639 (),
640 0x1b4feca8bc141380,
641 fidl::encoding::DynamicFlags::empty(),
642 ___deadline,
643 )?;
644 Ok(_response.map(|x| x.certificate))
645 }
646}
647
648#[cfg(target_os = "fuchsia")]
649impl From<FactoryDataManagerSynchronousProxy> for zx::Handle {
650 fn from(value: FactoryDataManagerSynchronousProxy) -> Self {
651 value.into_channel().into()
652 }
653}
654
655#[cfg(target_os = "fuchsia")]
656impl From<fidl::Channel> for FactoryDataManagerSynchronousProxy {
657 fn from(value: fidl::Channel) -> Self {
658 Self::new(value)
659 }
660}
661
662#[derive(Debug, Clone)]
663pub struct FactoryDataManagerProxy {
664 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
665}
666
667impl fidl::endpoints::Proxy for FactoryDataManagerProxy {
668 type Protocol = FactoryDataManagerMarker;
669
670 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
671 Self::new(inner)
672 }
673
674 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
675 self.client.into_channel().map_err(|client| Self { client })
676 }
677
678 fn as_channel(&self) -> &::fidl::AsyncChannel {
679 self.client.as_channel()
680 }
681}
682
683impl FactoryDataManagerProxy {
684 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
686 let protocol_name =
687 <FactoryDataManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
688 Self { client: fidl::client::Client::new(channel, protocol_name) }
689 }
690
691 pub fn take_event_stream(&self) -> FactoryDataManagerEventStream {
697 FactoryDataManagerEventStream { event_receiver: self.client.take_event_receiver() }
698 }
699
700 pub fn r#get_pairing_code(
702 &self,
703 ) -> fidl::client::QueryResponseFut<
704 FactoryDataManagerGetPairingCodeResult,
705 fidl::encoding::DefaultFuchsiaResourceDialect,
706 > {
707 FactoryDataManagerProxyInterface::r#get_pairing_code(self)
708 }
709
710 pub fn r#get_weave_certificate(
712 &self,
713 ) -> fidl::client::QueryResponseFut<
714 FactoryDataManagerGetWeaveCertificateResult,
715 fidl::encoding::DefaultFuchsiaResourceDialect,
716 > {
717 FactoryDataManagerProxyInterface::r#get_weave_certificate(self)
718 }
719}
720
721impl FactoryDataManagerProxyInterface for FactoryDataManagerProxy {
722 type GetPairingCodeResponseFut = fidl::client::QueryResponseFut<
723 FactoryDataManagerGetPairingCodeResult,
724 fidl::encoding::DefaultFuchsiaResourceDialect,
725 >;
726 fn r#get_pairing_code(&self) -> Self::GetPairingCodeResponseFut {
727 fn _decode(
728 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
729 ) -> Result<FactoryDataManagerGetPairingCodeResult, fidl::Error> {
730 let _response = fidl::client::decode_transaction_body::<
731 fidl::encoding::ResultType<FactoryDataManagerGetPairingCodeResponse, ErrorCode>,
732 fidl::encoding::DefaultFuchsiaResourceDialect,
733 0x75630bcd80418a0f,
734 >(_buf?)?;
735 Ok(_response.map(|x| x.pairing_code))
736 }
737 self.client.send_query_and_decode::<
738 fidl::encoding::EmptyPayload,
739 FactoryDataManagerGetPairingCodeResult,
740 >(
741 (),
742 0x75630bcd80418a0f,
743 fidl::encoding::DynamicFlags::empty(),
744 _decode,
745 )
746 }
747
748 type GetWeaveCertificateResponseFut = fidl::client::QueryResponseFut<
749 FactoryDataManagerGetWeaveCertificateResult,
750 fidl::encoding::DefaultFuchsiaResourceDialect,
751 >;
752 fn r#get_weave_certificate(&self) -> Self::GetWeaveCertificateResponseFut {
753 fn _decode(
754 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
755 ) -> Result<FactoryDataManagerGetWeaveCertificateResult, fidl::Error> {
756 let _response = fidl::client::decode_transaction_body::<
757 fidl::encoding::ResultType<
758 FactoryDataManagerGetWeaveCertificateResponse,
759 ErrorCode,
760 >,
761 fidl::encoding::DefaultFuchsiaResourceDialect,
762 0x1b4feca8bc141380,
763 >(_buf?)?;
764 Ok(_response.map(|x| x.certificate))
765 }
766 self.client.send_query_and_decode::<
767 fidl::encoding::EmptyPayload,
768 FactoryDataManagerGetWeaveCertificateResult,
769 >(
770 (),
771 0x1b4feca8bc141380,
772 fidl::encoding::DynamicFlags::empty(),
773 _decode,
774 )
775 }
776}
777
778pub struct FactoryDataManagerEventStream {
779 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
780}
781
782impl std::marker::Unpin for FactoryDataManagerEventStream {}
783
784impl futures::stream::FusedStream for FactoryDataManagerEventStream {
785 fn is_terminated(&self) -> bool {
786 self.event_receiver.is_terminated()
787 }
788}
789
790impl futures::Stream for FactoryDataManagerEventStream {
791 type Item = Result<FactoryDataManagerEvent, fidl::Error>;
792
793 fn poll_next(
794 mut self: std::pin::Pin<&mut Self>,
795 cx: &mut std::task::Context<'_>,
796 ) -> std::task::Poll<Option<Self::Item>> {
797 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
798 &mut self.event_receiver,
799 cx
800 )?) {
801 Some(buf) => std::task::Poll::Ready(Some(FactoryDataManagerEvent::decode(buf))),
802 None => std::task::Poll::Ready(None),
803 }
804 }
805}
806
807#[derive(Debug)]
808pub enum FactoryDataManagerEvent {}
809
810impl FactoryDataManagerEvent {
811 fn decode(
813 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
814 ) -> Result<FactoryDataManagerEvent, fidl::Error> {
815 let (bytes, _handles) = buf.split_mut();
816 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
817 debug_assert_eq!(tx_header.tx_id, 0);
818 match tx_header.ordinal {
819 _ => Err(fidl::Error::UnknownOrdinal {
820 ordinal: tx_header.ordinal,
821 protocol_name:
822 <FactoryDataManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
823 }),
824 }
825 }
826}
827
828pub struct FactoryDataManagerRequestStream {
830 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
831 is_terminated: bool,
832}
833
834impl std::marker::Unpin for FactoryDataManagerRequestStream {}
835
836impl futures::stream::FusedStream for FactoryDataManagerRequestStream {
837 fn is_terminated(&self) -> bool {
838 self.is_terminated
839 }
840}
841
842impl fidl::endpoints::RequestStream for FactoryDataManagerRequestStream {
843 type Protocol = FactoryDataManagerMarker;
844 type ControlHandle = FactoryDataManagerControlHandle;
845
846 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
847 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
848 }
849
850 fn control_handle(&self) -> Self::ControlHandle {
851 FactoryDataManagerControlHandle { inner: self.inner.clone() }
852 }
853
854 fn into_inner(
855 self,
856 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
857 {
858 (self.inner, self.is_terminated)
859 }
860
861 fn from_inner(
862 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
863 is_terminated: bool,
864 ) -> Self {
865 Self { inner, is_terminated }
866 }
867}
868
869impl futures::Stream for FactoryDataManagerRequestStream {
870 type Item = Result<FactoryDataManagerRequest, fidl::Error>;
871
872 fn poll_next(
873 mut self: std::pin::Pin<&mut Self>,
874 cx: &mut std::task::Context<'_>,
875 ) -> std::task::Poll<Option<Self::Item>> {
876 let this = &mut *self;
877 if this.inner.check_shutdown(cx) {
878 this.is_terminated = true;
879 return std::task::Poll::Ready(None);
880 }
881 if this.is_terminated {
882 panic!("polled FactoryDataManagerRequestStream after completion");
883 }
884 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
885 |bytes, handles| {
886 match this.inner.channel().read_etc(cx, bytes, handles) {
887 std::task::Poll::Ready(Ok(())) => {}
888 std::task::Poll::Pending => return std::task::Poll::Pending,
889 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
890 this.is_terminated = true;
891 return std::task::Poll::Ready(None);
892 }
893 std::task::Poll::Ready(Err(e)) => {
894 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
895 e.into(),
896 ))))
897 }
898 }
899
900 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
902
903 std::task::Poll::Ready(Some(match header.ordinal {
904 0x75630bcd80418a0f => {
905 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
906 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
907 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
908 let control_handle = FactoryDataManagerControlHandle {
909 inner: this.inner.clone(),
910 };
911 Ok(FactoryDataManagerRequest::GetPairingCode {
912 responder: FactoryDataManagerGetPairingCodeResponder {
913 control_handle: std::mem::ManuallyDrop::new(control_handle),
914 tx_id: header.tx_id,
915 },
916 })
917 }
918 0x1b4feca8bc141380 => {
919 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
920 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
921 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
922 let control_handle = FactoryDataManagerControlHandle {
923 inner: this.inner.clone(),
924 };
925 Ok(FactoryDataManagerRequest::GetWeaveCertificate {
926 responder: FactoryDataManagerGetWeaveCertificateResponder {
927 control_handle: std::mem::ManuallyDrop::new(control_handle),
928 tx_id: header.tx_id,
929 },
930 })
931 }
932 _ => Err(fidl::Error::UnknownOrdinal {
933 ordinal: header.ordinal,
934 protocol_name: <FactoryDataManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
935 }),
936 }))
937 },
938 )
939 }
940}
941
942#[derive(Debug)]
945pub enum FactoryDataManagerRequest {
946 GetPairingCode { responder: FactoryDataManagerGetPairingCodeResponder },
948 GetWeaveCertificate { responder: FactoryDataManagerGetWeaveCertificateResponder },
950}
951
952impl FactoryDataManagerRequest {
953 #[allow(irrefutable_let_patterns)]
954 pub fn into_get_pairing_code(self) -> Option<(FactoryDataManagerGetPairingCodeResponder)> {
955 if let FactoryDataManagerRequest::GetPairingCode { responder } = self {
956 Some((responder))
957 } else {
958 None
959 }
960 }
961
962 #[allow(irrefutable_let_patterns)]
963 pub fn into_get_weave_certificate(
964 self,
965 ) -> Option<(FactoryDataManagerGetWeaveCertificateResponder)> {
966 if let FactoryDataManagerRequest::GetWeaveCertificate { responder } = self {
967 Some((responder))
968 } else {
969 None
970 }
971 }
972
973 pub fn method_name(&self) -> &'static str {
975 match *self {
976 FactoryDataManagerRequest::GetPairingCode { .. } => "get_pairing_code",
977 FactoryDataManagerRequest::GetWeaveCertificate { .. } => "get_weave_certificate",
978 }
979 }
980}
981
982#[derive(Debug, Clone)]
983pub struct FactoryDataManagerControlHandle {
984 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
985}
986
987impl fidl::endpoints::ControlHandle for FactoryDataManagerControlHandle {
988 fn shutdown(&self) {
989 self.inner.shutdown()
990 }
991 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
992 self.inner.shutdown_with_epitaph(status)
993 }
994
995 fn is_closed(&self) -> bool {
996 self.inner.channel().is_closed()
997 }
998 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
999 self.inner.channel().on_closed()
1000 }
1001
1002 #[cfg(target_os = "fuchsia")]
1003 fn signal_peer(
1004 &self,
1005 clear_mask: zx::Signals,
1006 set_mask: zx::Signals,
1007 ) -> Result<(), zx_status::Status> {
1008 use fidl::Peered;
1009 self.inner.channel().signal_peer(clear_mask, set_mask)
1010 }
1011}
1012
1013impl FactoryDataManagerControlHandle {}
1014
1015#[must_use = "FIDL methods require a response to be sent"]
1016#[derive(Debug)]
1017pub struct FactoryDataManagerGetPairingCodeResponder {
1018 control_handle: std::mem::ManuallyDrop<FactoryDataManagerControlHandle>,
1019 tx_id: u32,
1020}
1021
1022impl std::ops::Drop for FactoryDataManagerGetPairingCodeResponder {
1026 fn drop(&mut self) {
1027 self.control_handle.shutdown();
1028 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1030 }
1031}
1032
1033impl fidl::endpoints::Responder for FactoryDataManagerGetPairingCodeResponder {
1034 type ControlHandle = FactoryDataManagerControlHandle;
1035
1036 fn control_handle(&self) -> &FactoryDataManagerControlHandle {
1037 &self.control_handle
1038 }
1039
1040 fn drop_without_shutdown(mut self) {
1041 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1043 std::mem::forget(self);
1045 }
1046}
1047
1048impl FactoryDataManagerGetPairingCodeResponder {
1049 pub fn send(self, mut result: Result<&[u8], ErrorCode>) -> Result<(), fidl::Error> {
1053 let _result = self.send_raw(result);
1054 if _result.is_err() {
1055 self.control_handle.shutdown();
1056 }
1057 self.drop_without_shutdown();
1058 _result
1059 }
1060
1061 pub fn send_no_shutdown_on_err(
1063 self,
1064 mut result: Result<&[u8], ErrorCode>,
1065 ) -> Result<(), fidl::Error> {
1066 let _result = self.send_raw(result);
1067 self.drop_without_shutdown();
1068 _result
1069 }
1070
1071 fn send_raw(&self, mut result: Result<&[u8], ErrorCode>) -> Result<(), fidl::Error> {
1072 self.control_handle.inner.send::<fidl::encoding::ResultType<
1073 FactoryDataManagerGetPairingCodeResponse,
1074 ErrorCode,
1075 >>(
1076 result.map(|pairing_code| (pairing_code,)),
1077 self.tx_id,
1078 0x75630bcd80418a0f,
1079 fidl::encoding::DynamicFlags::empty(),
1080 )
1081 }
1082}
1083
1084#[must_use = "FIDL methods require a response to be sent"]
1085#[derive(Debug)]
1086pub struct FactoryDataManagerGetWeaveCertificateResponder {
1087 control_handle: std::mem::ManuallyDrop<FactoryDataManagerControlHandle>,
1088 tx_id: u32,
1089}
1090
1091impl std::ops::Drop for FactoryDataManagerGetWeaveCertificateResponder {
1095 fn drop(&mut self) {
1096 self.control_handle.shutdown();
1097 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1099 }
1100}
1101
1102impl fidl::endpoints::Responder for FactoryDataManagerGetWeaveCertificateResponder {
1103 type ControlHandle = FactoryDataManagerControlHandle;
1104
1105 fn control_handle(&self) -> &FactoryDataManagerControlHandle {
1106 &self.control_handle
1107 }
1108
1109 fn drop_without_shutdown(mut self) {
1110 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1112 std::mem::forget(self);
1114 }
1115}
1116
1117impl FactoryDataManagerGetWeaveCertificateResponder {
1118 pub fn send(
1122 self,
1123 mut result: Result<fidl_fuchsia_mem::Buffer, ErrorCode>,
1124 ) -> Result<(), fidl::Error> {
1125 let _result = self.send_raw(result);
1126 if _result.is_err() {
1127 self.control_handle.shutdown();
1128 }
1129 self.drop_without_shutdown();
1130 _result
1131 }
1132
1133 pub fn send_no_shutdown_on_err(
1135 self,
1136 mut result: Result<fidl_fuchsia_mem::Buffer, ErrorCode>,
1137 ) -> Result<(), fidl::Error> {
1138 let _result = self.send_raw(result);
1139 self.drop_without_shutdown();
1140 _result
1141 }
1142
1143 fn send_raw(
1144 &self,
1145 mut result: Result<fidl_fuchsia_mem::Buffer, ErrorCode>,
1146 ) -> Result<(), fidl::Error> {
1147 self.control_handle.inner.send::<fidl::encoding::ResultType<
1148 FactoryDataManagerGetWeaveCertificateResponse,
1149 ErrorCode,
1150 >>(
1151 result.as_mut().map_err(|e| *e).map(|certificate| (certificate,)),
1152 self.tx_id,
1153 0x1b4feca8bc141380,
1154 fidl::encoding::DynamicFlags::empty(),
1155 )
1156 }
1157}
1158
1159#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1160pub struct PairingStateWatcherMarker;
1161
1162impl fidl::endpoints::ProtocolMarker for PairingStateWatcherMarker {
1163 type Proxy = PairingStateWatcherProxy;
1164 type RequestStream = PairingStateWatcherRequestStream;
1165 #[cfg(target_os = "fuchsia")]
1166 type SynchronousProxy = PairingStateWatcherSynchronousProxy;
1167
1168 const DEBUG_NAME: &'static str = "(anonymous) PairingStateWatcher";
1169}
1170
1171pub trait PairingStateWatcherProxyInterface: Send + Sync {
1172 type WatchPairingStateResponseFut: std::future::Future<Output = Result<PairingState, fidl::Error>>
1173 + Send;
1174 fn r#watch_pairing_state(&self) -> Self::WatchPairingStateResponseFut;
1175}
1176#[derive(Debug)]
1177#[cfg(target_os = "fuchsia")]
1178pub struct PairingStateWatcherSynchronousProxy {
1179 client: fidl::client::sync::Client,
1180}
1181
1182#[cfg(target_os = "fuchsia")]
1183impl fidl::endpoints::SynchronousProxy for PairingStateWatcherSynchronousProxy {
1184 type Proxy = PairingStateWatcherProxy;
1185 type Protocol = PairingStateWatcherMarker;
1186
1187 fn from_channel(inner: fidl::Channel) -> Self {
1188 Self::new(inner)
1189 }
1190
1191 fn into_channel(self) -> fidl::Channel {
1192 self.client.into_channel()
1193 }
1194
1195 fn as_channel(&self) -> &fidl::Channel {
1196 self.client.as_channel()
1197 }
1198}
1199
1200#[cfg(target_os = "fuchsia")]
1201impl PairingStateWatcherSynchronousProxy {
1202 pub fn new(channel: fidl::Channel) -> Self {
1203 let protocol_name =
1204 <PairingStateWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1205 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1206 }
1207
1208 pub fn into_channel(self) -> fidl::Channel {
1209 self.client.into_channel()
1210 }
1211
1212 pub fn wait_for_event(
1215 &self,
1216 deadline: zx::MonotonicInstant,
1217 ) -> Result<PairingStateWatcherEvent, fidl::Error> {
1218 PairingStateWatcherEvent::decode(self.client.wait_for_event(deadline)?)
1219 }
1220
1221 pub fn r#watch_pairing_state(
1230 &self,
1231 ___deadline: zx::MonotonicInstant,
1232 ) -> Result<PairingState, fidl::Error> {
1233 let _response = self.client.send_query::<
1234 fidl::encoding::EmptyPayload,
1235 PairingStateWatcherWatchPairingStateResponse,
1236 >(
1237 (),
1238 0x1b3889b65cea014e,
1239 fidl::encoding::DynamicFlags::empty(),
1240 ___deadline,
1241 )?;
1242 Ok(_response.state)
1243 }
1244}
1245
1246#[cfg(target_os = "fuchsia")]
1247impl From<PairingStateWatcherSynchronousProxy> for zx::Handle {
1248 fn from(value: PairingStateWatcherSynchronousProxy) -> Self {
1249 value.into_channel().into()
1250 }
1251}
1252
1253#[cfg(target_os = "fuchsia")]
1254impl From<fidl::Channel> for PairingStateWatcherSynchronousProxy {
1255 fn from(value: fidl::Channel) -> Self {
1256 Self::new(value)
1257 }
1258}
1259
1260#[derive(Debug, Clone)]
1261pub struct PairingStateWatcherProxy {
1262 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1263}
1264
1265impl fidl::endpoints::Proxy for PairingStateWatcherProxy {
1266 type Protocol = PairingStateWatcherMarker;
1267
1268 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1269 Self::new(inner)
1270 }
1271
1272 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1273 self.client.into_channel().map_err(|client| Self { client })
1274 }
1275
1276 fn as_channel(&self) -> &::fidl::AsyncChannel {
1277 self.client.as_channel()
1278 }
1279}
1280
1281impl PairingStateWatcherProxy {
1282 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1284 let protocol_name =
1285 <PairingStateWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1286 Self { client: fidl::client::Client::new(channel, protocol_name) }
1287 }
1288
1289 pub fn take_event_stream(&self) -> PairingStateWatcherEventStream {
1295 PairingStateWatcherEventStream { event_receiver: self.client.take_event_receiver() }
1296 }
1297
1298 pub fn r#watch_pairing_state(
1307 &self,
1308 ) -> fidl::client::QueryResponseFut<PairingState, fidl::encoding::DefaultFuchsiaResourceDialect>
1309 {
1310 PairingStateWatcherProxyInterface::r#watch_pairing_state(self)
1311 }
1312}
1313
1314impl PairingStateWatcherProxyInterface for PairingStateWatcherProxy {
1315 type WatchPairingStateResponseFut =
1316 fidl::client::QueryResponseFut<PairingState, fidl::encoding::DefaultFuchsiaResourceDialect>;
1317 fn r#watch_pairing_state(&self) -> Self::WatchPairingStateResponseFut {
1318 fn _decode(
1319 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1320 ) -> Result<PairingState, fidl::Error> {
1321 let _response = fidl::client::decode_transaction_body::<
1322 PairingStateWatcherWatchPairingStateResponse,
1323 fidl::encoding::DefaultFuchsiaResourceDialect,
1324 0x1b3889b65cea014e,
1325 >(_buf?)?;
1326 Ok(_response.state)
1327 }
1328 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PairingState>(
1329 (),
1330 0x1b3889b65cea014e,
1331 fidl::encoding::DynamicFlags::empty(),
1332 _decode,
1333 )
1334 }
1335}
1336
1337pub struct PairingStateWatcherEventStream {
1338 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1339}
1340
1341impl std::marker::Unpin for PairingStateWatcherEventStream {}
1342
1343impl futures::stream::FusedStream for PairingStateWatcherEventStream {
1344 fn is_terminated(&self) -> bool {
1345 self.event_receiver.is_terminated()
1346 }
1347}
1348
1349impl futures::Stream for PairingStateWatcherEventStream {
1350 type Item = Result<PairingStateWatcherEvent, fidl::Error>;
1351
1352 fn poll_next(
1353 mut self: std::pin::Pin<&mut Self>,
1354 cx: &mut std::task::Context<'_>,
1355 ) -> std::task::Poll<Option<Self::Item>> {
1356 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1357 &mut self.event_receiver,
1358 cx
1359 )?) {
1360 Some(buf) => std::task::Poll::Ready(Some(PairingStateWatcherEvent::decode(buf))),
1361 None => std::task::Poll::Ready(None),
1362 }
1363 }
1364}
1365
1366#[derive(Debug)]
1367pub enum PairingStateWatcherEvent {}
1368
1369impl PairingStateWatcherEvent {
1370 fn decode(
1372 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1373 ) -> Result<PairingStateWatcherEvent, fidl::Error> {
1374 let (bytes, _handles) = buf.split_mut();
1375 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1376 debug_assert_eq!(tx_header.tx_id, 0);
1377 match tx_header.ordinal {
1378 _ => Err(fidl::Error::UnknownOrdinal {
1379 ordinal: tx_header.ordinal,
1380 protocol_name:
1381 <PairingStateWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1382 }),
1383 }
1384 }
1385}
1386
1387pub struct PairingStateWatcherRequestStream {
1389 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1390 is_terminated: bool,
1391}
1392
1393impl std::marker::Unpin for PairingStateWatcherRequestStream {}
1394
1395impl futures::stream::FusedStream for PairingStateWatcherRequestStream {
1396 fn is_terminated(&self) -> bool {
1397 self.is_terminated
1398 }
1399}
1400
1401impl fidl::endpoints::RequestStream for PairingStateWatcherRequestStream {
1402 type Protocol = PairingStateWatcherMarker;
1403 type ControlHandle = PairingStateWatcherControlHandle;
1404
1405 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1406 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1407 }
1408
1409 fn control_handle(&self) -> Self::ControlHandle {
1410 PairingStateWatcherControlHandle { inner: self.inner.clone() }
1411 }
1412
1413 fn into_inner(
1414 self,
1415 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1416 {
1417 (self.inner, self.is_terminated)
1418 }
1419
1420 fn from_inner(
1421 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1422 is_terminated: bool,
1423 ) -> Self {
1424 Self { inner, is_terminated }
1425 }
1426}
1427
1428impl futures::Stream for PairingStateWatcherRequestStream {
1429 type Item = Result<PairingStateWatcherRequest, fidl::Error>;
1430
1431 fn poll_next(
1432 mut self: std::pin::Pin<&mut Self>,
1433 cx: &mut std::task::Context<'_>,
1434 ) -> std::task::Poll<Option<Self::Item>> {
1435 let this = &mut *self;
1436 if this.inner.check_shutdown(cx) {
1437 this.is_terminated = true;
1438 return std::task::Poll::Ready(None);
1439 }
1440 if this.is_terminated {
1441 panic!("polled PairingStateWatcherRequestStream after completion");
1442 }
1443 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1444 |bytes, handles| {
1445 match this.inner.channel().read_etc(cx, bytes, handles) {
1446 std::task::Poll::Ready(Ok(())) => {}
1447 std::task::Poll::Pending => return std::task::Poll::Pending,
1448 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1449 this.is_terminated = true;
1450 return std::task::Poll::Ready(None);
1451 }
1452 std::task::Poll::Ready(Err(e)) => {
1453 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1454 e.into(),
1455 ))))
1456 }
1457 }
1458
1459 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1461
1462 std::task::Poll::Ready(Some(match header.ordinal {
1463 0x1b3889b65cea014e => {
1464 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1465 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1466 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1467 let control_handle = PairingStateWatcherControlHandle {
1468 inner: this.inner.clone(),
1469 };
1470 Ok(PairingStateWatcherRequest::WatchPairingState {
1471 responder: PairingStateWatcherWatchPairingStateResponder {
1472 control_handle: std::mem::ManuallyDrop::new(control_handle),
1473 tx_id: header.tx_id,
1474 },
1475 })
1476 }
1477 _ => Err(fidl::Error::UnknownOrdinal {
1478 ordinal: header.ordinal,
1479 protocol_name: <PairingStateWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1480 }),
1481 }))
1482 },
1483 )
1484 }
1485}
1486
1487#[derive(Debug)]
1490pub enum PairingStateWatcherRequest {
1491 WatchPairingState { responder: PairingStateWatcherWatchPairingStateResponder },
1500}
1501
1502impl PairingStateWatcherRequest {
1503 #[allow(irrefutable_let_patterns)]
1504 pub fn into_watch_pairing_state(
1505 self,
1506 ) -> Option<(PairingStateWatcherWatchPairingStateResponder)> {
1507 if let PairingStateWatcherRequest::WatchPairingState { responder } = self {
1508 Some((responder))
1509 } else {
1510 None
1511 }
1512 }
1513
1514 pub fn method_name(&self) -> &'static str {
1516 match *self {
1517 PairingStateWatcherRequest::WatchPairingState { .. } => "watch_pairing_state",
1518 }
1519 }
1520}
1521
1522#[derive(Debug, Clone)]
1523pub struct PairingStateWatcherControlHandle {
1524 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1525}
1526
1527impl fidl::endpoints::ControlHandle for PairingStateWatcherControlHandle {
1528 fn shutdown(&self) {
1529 self.inner.shutdown()
1530 }
1531 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1532 self.inner.shutdown_with_epitaph(status)
1533 }
1534
1535 fn is_closed(&self) -> bool {
1536 self.inner.channel().is_closed()
1537 }
1538 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1539 self.inner.channel().on_closed()
1540 }
1541
1542 #[cfg(target_os = "fuchsia")]
1543 fn signal_peer(
1544 &self,
1545 clear_mask: zx::Signals,
1546 set_mask: zx::Signals,
1547 ) -> Result<(), zx_status::Status> {
1548 use fidl::Peered;
1549 self.inner.channel().signal_peer(clear_mask, set_mask)
1550 }
1551}
1552
1553impl PairingStateWatcherControlHandle {}
1554
1555#[must_use = "FIDL methods require a response to be sent"]
1556#[derive(Debug)]
1557pub struct PairingStateWatcherWatchPairingStateResponder {
1558 control_handle: std::mem::ManuallyDrop<PairingStateWatcherControlHandle>,
1559 tx_id: u32,
1560}
1561
1562impl std::ops::Drop for PairingStateWatcherWatchPairingStateResponder {
1566 fn drop(&mut self) {
1567 self.control_handle.shutdown();
1568 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1570 }
1571}
1572
1573impl fidl::endpoints::Responder for PairingStateWatcherWatchPairingStateResponder {
1574 type ControlHandle = PairingStateWatcherControlHandle;
1575
1576 fn control_handle(&self) -> &PairingStateWatcherControlHandle {
1577 &self.control_handle
1578 }
1579
1580 fn drop_without_shutdown(mut self) {
1581 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1583 std::mem::forget(self);
1585 }
1586}
1587
1588impl PairingStateWatcherWatchPairingStateResponder {
1589 pub fn send(self, mut state: &PairingState) -> Result<(), fidl::Error> {
1593 let _result = self.send_raw(state);
1594 if _result.is_err() {
1595 self.control_handle.shutdown();
1596 }
1597 self.drop_without_shutdown();
1598 _result
1599 }
1600
1601 pub fn send_no_shutdown_on_err(self, mut state: &PairingState) -> Result<(), fidl::Error> {
1603 let _result = self.send_raw(state);
1604 self.drop_without_shutdown();
1605 _result
1606 }
1607
1608 fn send_raw(&self, mut state: &PairingState) -> Result<(), fidl::Error> {
1609 self.control_handle.inner.send::<PairingStateWatcherWatchPairingStateResponse>(
1610 (state,),
1611 self.tx_id,
1612 0x1b3889b65cea014e,
1613 fidl::encoding::DynamicFlags::empty(),
1614 )
1615 }
1616}
1617
1618#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1619pub struct ProvisionerMarker;
1620
1621impl fidl::endpoints::ProtocolMarker for ProvisionerMarker {
1622 type Proxy = ProvisionerProxy;
1623 type RequestStream = ProvisionerRequestStream;
1624 #[cfg(target_os = "fuchsia")]
1625 type SynchronousProxy = ProvisionerSynchronousProxy;
1626
1627 const DEBUG_NAME: &'static str = "fuchsia.weave.Provisioner";
1628}
1629impl fidl::endpoints::DiscoverableProtocolMarker for ProvisionerMarker {}
1630pub type ProvisionerGenerateKeyPairResult = Result<(Vec<u8>, Vec<u8>), ErrorCode>;
1631
1632pub trait ProvisionerProxyInterface: Send + Sync {
1633 type GenerateKeyPairResponseFut: std::future::Future<Output = Result<ProvisionerGenerateKeyPairResult, fidl::Error>>
1634 + Send;
1635 fn r#generate_key_pair(&self) -> Self::GenerateKeyPairResponseFut;
1636}
1637#[derive(Debug)]
1638#[cfg(target_os = "fuchsia")]
1639pub struct ProvisionerSynchronousProxy {
1640 client: fidl::client::sync::Client,
1641}
1642
1643#[cfg(target_os = "fuchsia")]
1644impl fidl::endpoints::SynchronousProxy for ProvisionerSynchronousProxy {
1645 type Proxy = ProvisionerProxy;
1646 type Protocol = ProvisionerMarker;
1647
1648 fn from_channel(inner: fidl::Channel) -> Self {
1649 Self::new(inner)
1650 }
1651
1652 fn into_channel(self) -> fidl::Channel {
1653 self.client.into_channel()
1654 }
1655
1656 fn as_channel(&self) -> &fidl::Channel {
1657 self.client.as_channel()
1658 }
1659}
1660
1661#[cfg(target_os = "fuchsia")]
1662impl ProvisionerSynchronousProxy {
1663 pub fn new(channel: fidl::Channel) -> Self {
1664 let protocol_name = <ProvisionerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1665 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1666 }
1667
1668 pub fn into_channel(self) -> fidl::Channel {
1669 self.client.into_channel()
1670 }
1671
1672 pub fn wait_for_event(
1675 &self,
1676 deadline: zx::MonotonicInstant,
1677 ) -> Result<ProvisionerEvent, fidl::Error> {
1678 ProvisionerEvent::decode(self.client.wait_for_event(deadline)?)
1679 }
1680
1681 pub fn r#generate_key_pair(
1690 &self,
1691 ___deadline: zx::MonotonicInstant,
1692 ) -> Result<ProvisionerGenerateKeyPairResult, fidl::Error> {
1693 let _response = self.client.send_query::<
1694 fidl::encoding::EmptyPayload,
1695 fidl::encoding::ResultType<ProvisionerGenerateKeyPairResponse, ErrorCode>,
1696 >(
1697 (),
1698 0x9ba1ad04f47bd9f,
1699 fidl::encoding::DynamicFlags::empty(),
1700 ___deadline,
1701 )?;
1702 Ok(_response.map(|x| (x.wrapped_private_key, x.public_key)))
1703 }
1704}
1705
1706#[cfg(target_os = "fuchsia")]
1707impl From<ProvisionerSynchronousProxy> for zx::Handle {
1708 fn from(value: ProvisionerSynchronousProxy) -> Self {
1709 value.into_channel().into()
1710 }
1711}
1712
1713#[cfg(target_os = "fuchsia")]
1714impl From<fidl::Channel> for ProvisionerSynchronousProxy {
1715 fn from(value: fidl::Channel) -> Self {
1716 Self::new(value)
1717 }
1718}
1719
1720#[derive(Debug, Clone)]
1721pub struct ProvisionerProxy {
1722 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1723}
1724
1725impl fidl::endpoints::Proxy for ProvisionerProxy {
1726 type Protocol = ProvisionerMarker;
1727
1728 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1729 Self::new(inner)
1730 }
1731
1732 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1733 self.client.into_channel().map_err(|client| Self { client })
1734 }
1735
1736 fn as_channel(&self) -> &::fidl::AsyncChannel {
1737 self.client.as_channel()
1738 }
1739}
1740
1741impl ProvisionerProxy {
1742 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1744 let protocol_name = <ProvisionerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1745 Self { client: fidl::client::Client::new(channel, protocol_name) }
1746 }
1747
1748 pub fn take_event_stream(&self) -> ProvisionerEventStream {
1754 ProvisionerEventStream { event_receiver: self.client.take_event_receiver() }
1755 }
1756
1757 pub fn r#generate_key_pair(
1766 &self,
1767 ) -> fidl::client::QueryResponseFut<
1768 ProvisionerGenerateKeyPairResult,
1769 fidl::encoding::DefaultFuchsiaResourceDialect,
1770 > {
1771 ProvisionerProxyInterface::r#generate_key_pair(self)
1772 }
1773}
1774
1775impl ProvisionerProxyInterface for ProvisionerProxy {
1776 type GenerateKeyPairResponseFut = fidl::client::QueryResponseFut<
1777 ProvisionerGenerateKeyPairResult,
1778 fidl::encoding::DefaultFuchsiaResourceDialect,
1779 >;
1780 fn r#generate_key_pair(&self) -> Self::GenerateKeyPairResponseFut {
1781 fn _decode(
1782 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1783 ) -> Result<ProvisionerGenerateKeyPairResult, fidl::Error> {
1784 let _response = fidl::client::decode_transaction_body::<
1785 fidl::encoding::ResultType<ProvisionerGenerateKeyPairResponse, ErrorCode>,
1786 fidl::encoding::DefaultFuchsiaResourceDialect,
1787 0x9ba1ad04f47bd9f,
1788 >(_buf?)?;
1789 Ok(_response.map(|x| (x.wrapped_private_key, x.public_key)))
1790 }
1791 self.client.send_query_and_decode::<
1792 fidl::encoding::EmptyPayload,
1793 ProvisionerGenerateKeyPairResult,
1794 >(
1795 (),
1796 0x9ba1ad04f47bd9f,
1797 fidl::encoding::DynamicFlags::empty(),
1798 _decode,
1799 )
1800 }
1801}
1802
1803pub struct ProvisionerEventStream {
1804 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1805}
1806
1807impl std::marker::Unpin for ProvisionerEventStream {}
1808
1809impl futures::stream::FusedStream for ProvisionerEventStream {
1810 fn is_terminated(&self) -> bool {
1811 self.event_receiver.is_terminated()
1812 }
1813}
1814
1815impl futures::Stream for ProvisionerEventStream {
1816 type Item = Result<ProvisionerEvent, fidl::Error>;
1817
1818 fn poll_next(
1819 mut self: std::pin::Pin<&mut Self>,
1820 cx: &mut std::task::Context<'_>,
1821 ) -> std::task::Poll<Option<Self::Item>> {
1822 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1823 &mut self.event_receiver,
1824 cx
1825 )?) {
1826 Some(buf) => std::task::Poll::Ready(Some(ProvisionerEvent::decode(buf))),
1827 None => std::task::Poll::Ready(None),
1828 }
1829 }
1830}
1831
1832#[derive(Debug)]
1833pub enum ProvisionerEvent {}
1834
1835impl ProvisionerEvent {
1836 fn decode(
1838 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1839 ) -> Result<ProvisionerEvent, fidl::Error> {
1840 let (bytes, _handles) = buf.split_mut();
1841 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1842 debug_assert_eq!(tx_header.tx_id, 0);
1843 match tx_header.ordinal {
1844 _ => Err(fidl::Error::UnknownOrdinal {
1845 ordinal: tx_header.ordinal,
1846 protocol_name: <ProvisionerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1847 }),
1848 }
1849 }
1850}
1851
1852pub struct ProvisionerRequestStream {
1854 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1855 is_terminated: bool,
1856}
1857
1858impl std::marker::Unpin for ProvisionerRequestStream {}
1859
1860impl futures::stream::FusedStream for ProvisionerRequestStream {
1861 fn is_terminated(&self) -> bool {
1862 self.is_terminated
1863 }
1864}
1865
1866impl fidl::endpoints::RequestStream for ProvisionerRequestStream {
1867 type Protocol = ProvisionerMarker;
1868 type ControlHandle = ProvisionerControlHandle;
1869
1870 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1871 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1872 }
1873
1874 fn control_handle(&self) -> Self::ControlHandle {
1875 ProvisionerControlHandle { inner: self.inner.clone() }
1876 }
1877
1878 fn into_inner(
1879 self,
1880 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1881 {
1882 (self.inner, self.is_terminated)
1883 }
1884
1885 fn from_inner(
1886 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1887 is_terminated: bool,
1888 ) -> Self {
1889 Self { inner, is_terminated }
1890 }
1891}
1892
1893impl futures::Stream for ProvisionerRequestStream {
1894 type Item = Result<ProvisionerRequest, fidl::Error>;
1895
1896 fn poll_next(
1897 mut self: std::pin::Pin<&mut Self>,
1898 cx: &mut std::task::Context<'_>,
1899 ) -> std::task::Poll<Option<Self::Item>> {
1900 let this = &mut *self;
1901 if this.inner.check_shutdown(cx) {
1902 this.is_terminated = true;
1903 return std::task::Poll::Ready(None);
1904 }
1905 if this.is_terminated {
1906 panic!("polled ProvisionerRequestStream after completion");
1907 }
1908 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1909 |bytes, handles| {
1910 match this.inner.channel().read_etc(cx, bytes, handles) {
1911 std::task::Poll::Ready(Ok(())) => {}
1912 std::task::Poll::Pending => return std::task::Poll::Pending,
1913 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1914 this.is_terminated = true;
1915 return std::task::Poll::Ready(None);
1916 }
1917 std::task::Poll::Ready(Err(e)) => {
1918 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1919 e.into(),
1920 ))))
1921 }
1922 }
1923
1924 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1926
1927 std::task::Poll::Ready(Some(match header.ordinal {
1928 0x9ba1ad04f47bd9f => {
1929 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1930 let mut req = fidl::new_empty!(
1931 fidl::encoding::EmptyPayload,
1932 fidl::encoding::DefaultFuchsiaResourceDialect
1933 );
1934 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1935 let control_handle = ProvisionerControlHandle { inner: this.inner.clone() };
1936 Ok(ProvisionerRequest::GenerateKeyPair {
1937 responder: ProvisionerGenerateKeyPairResponder {
1938 control_handle: std::mem::ManuallyDrop::new(control_handle),
1939 tx_id: header.tx_id,
1940 },
1941 })
1942 }
1943 _ => Err(fidl::Error::UnknownOrdinal {
1944 ordinal: header.ordinal,
1945 protocol_name:
1946 <ProvisionerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1947 }),
1948 }))
1949 },
1950 )
1951 }
1952}
1953
1954#[derive(Debug)]
1956pub enum ProvisionerRequest {
1957 GenerateKeyPair { responder: ProvisionerGenerateKeyPairResponder },
1966}
1967
1968impl ProvisionerRequest {
1969 #[allow(irrefutable_let_patterns)]
1970 pub fn into_generate_key_pair(self) -> Option<(ProvisionerGenerateKeyPairResponder)> {
1971 if let ProvisionerRequest::GenerateKeyPair { responder } = self {
1972 Some((responder))
1973 } else {
1974 None
1975 }
1976 }
1977
1978 pub fn method_name(&self) -> &'static str {
1980 match *self {
1981 ProvisionerRequest::GenerateKeyPair { .. } => "generate_key_pair",
1982 }
1983 }
1984}
1985
1986#[derive(Debug, Clone)]
1987pub struct ProvisionerControlHandle {
1988 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1989}
1990
1991impl fidl::endpoints::ControlHandle for ProvisionerControlHandle {
1992 fn shutdown(&self) {
1993 self.inner.shutdown()
1994 }
1995 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1996 self.inner.shutdown_with_epitaph(status)
1997 }
1998
1999 fn is_closed(&self) -> bool {
2000 self.inner.channel().is_closed()
2001 }
2002 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2003 self.inner.channel().on_closed()
2004 }
2005
2006 #[cfg(target_os = "fuchsia")]
2007 fn signal_peer(
2008 &self,
2009 clear_mask: zx::Signals,
2010 set_mask: zx::Signals,
2011 ) -> Result<(), zx_status::Status> {
2012 use fidl::Peered;
2013 self.inner.channel().signal_peer(clear_mask, set_mask)
2014 }
2015}
2016
2017impl ProvisionerControlHandle {}
2018
2019#[must_use = "FIDL methods require a response to be sent"]
2020#[derive(Debug)]
2021pub struct ProvisionerGenerateKeyPairResponder {
2022 control_handle: std::mem::ManuallyDrop<ProvisionerControlHandle>,
2023 tx_id: u32,
2024}
2025
2026impl std::ops::Drop for ProvisionerGenerateKeyPairResponder {
2030 fn drop(&mut self) {
2031 self.control_handle.shutdown();
2032 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2034 }
2035}
2036
2037impl fidl::endpoints::Responder for ProvisionerGenerateKeyPairResponder {
2038 type ControlHandle = ProvisionerControlHandle;
2039
2040 fn control_handle(&self) -> &ProvisionerControlHandle {
2041 &self.control_handle
2042 }
2043
2044 fn drop_without_shutdown(mut self) {
2045 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2047 std::mem::forget(self);
2049 }
2050}
2051
2052impl ProvisionerGenerateKeyPairResponder {
2053 pub fn send(self, mut result: Result<(&[u8], &[u8]), ErrorCode>) -> Result<(), fidl::Error> {
2057 let _result = self.send_raw(result);
2058 if _result.is_err() {
2059 self.control_handle.shutdown();
2060 }
2061 self.drop_without_shutdown();
2062 _result
2063 }
2064
2065 pub fn send_no_shutdown_on_err(
2067 self,
2068 mut result: Result<(&[u8], &[u8]), ErrorCode>,
2069 ) -> Result<(), fidl::Error> {
2070 let _result = self.send_raw(result);
2071 self.drop_without_shutdown();
2072 _result
2073 }
2074
2075 fn send_raw(&self, mut result: Result<(&[u8], &[u8]), ErrorCode>) -> Result<(), fidl::Error> {
2076 self.control_handle.inner.send::<fidl::encoding::ResultType<
2077 ProvisionerGenerateKeyPairResponse,
2078 ErrorCode,
2079 >>(
2080 result,
2081 self.tx_id,
2082 0x9ba1ad04f47bd9f,
2083 fidl::encoding::DynamicFlags::empty(),
2084 )
2085 }
2086}
2087
2088#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2089pub struct SignerMarker;
2090
2091impl fidl::endpoints::ProtocolMarker for SignerMarker {
2092 type Proxy = SignerProxy;
2093 type RequestStream = SignerRequestStream;
2094 #[cfg(target_os = "fuchsia")]
2095 type SynchronousProxy = SignerSynchronousProxy;
2096
2097 const DEBUG_NAME: &'static str = "fuchsia.weave.Signer";
2098}
2099impl fidl::endpoints::DiscoverableProtocolMarker for SignerMarker {}
2100pub type SignerSignHashResult = Result<Vec<u8>, ErrorCode>;
2101pub type SignerSignHashWithPrivateKeyResult = Result<Vec<u8>, ErrorCode>;
2102
2103pub trait SignerProxyInterface: Send + Sync {
2104 type SignHashResponseFut: std::future::Future<Output = Result<SignerSignHashResult, fidl::Error>>
2105 + Send;
2106 fn r#sign_hash(&self, hash: &[u8]) -> Self::SignHashResponseFut;
2107 type SignHashWithPrivateKeyResponseFut: std::future::Future<Output = Result<SignerSignHashWithPrivateKeyResult, fidl::Error>>
2108 + Send;
2109 fn r#sign_hash_with_private_key(
2110 &self,
2111 hash: &[u8],
2112 wrapped_private_key: &[u8],
2113 ) -> Self::SignHashWithPrivateKeyResponseFut;
2114}
2115#[derive(Debug)]
2116#[cfg(target_os = "fuchsia")]
2117pub struct SignerSynchronousProxy {
2118 client: fidl::client::sync::Client,
2119}
2120
2121#[cfg(target_os = "fuchsia")]
2122impl fidl::endpoints::SynchronousProxy for SignerSynchronousProxy {
2123 type Proxy = SignerProxy;
2124 type Protocol = SignerMarker;
2125
2126 fn from_channel(inner: fidl::Channel) -> Self {
2127 Self::new(inner)
2128 }
2129
2130 fn into_channel(self) -> fidl::Channel {
2131 self.client.into_channel()
2132 }
2133
2134 fn as_channel(&self) -> &fidl::Channel {
2135 self.client.as_channel()
2136 }
2137}
2138
2139#[cfg(target_os = "fuchsia")]
2140impl SignerSynchronousProxy {
2141 pub fn new(channel: fidl::Channel) -> Self {
2142 let protocol_name = <SignerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2143 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2144 }
2145
2146 pub fn into_channel(self) -> fidl::Channel {
2147 self.client.into_channel()
2148 }
2149
2150 pub fn wait_for_event(
2153 &self,
2154 deadline: zx::MonotonicInstant,
2155 ) -> Result<SignerEvent, fidl::Error> {
2156 SignerEvent::decode(self.client.wait_for_event(deadline)?)
2157 }
2158
2159 pub fn r#sign_hash(
2164 &self,
2165 mut hash: &[u8],
2166 ___deadline: zx::MonotonicInstant,
2167 ) -> Result<SignerSignHashResult, fidl::Error> {
2168 let _response = self.client.send_query::<
2169 SignerSignHashRequest,
2170 fidl::encoding::ResultType<SignerSignHashResponse, ErrorCode>,
2171 >(
2172 (hash,),
2173 0x3bfb1667fc4fe864,
2174 fidl::encoding::DynamicFlags::empty(),
2175 ___deadline,
2176 )?;
2177 Ok(_response.map(|x| x.signature))
2178 }
2179
2180 pub fn r#sign_hash_with_private_key(
2186 &self,
2187 mut hash: &[u8],
2188 mut wrapped_private_key: &[u8],
2189 ___deadline: zx::MonotonicInstant,
2190 ) -> Result<SignerSignHashWithPrivateKeyResult, fidl::Error> {
2191 let _response = self.client.send_query::<
2192 SignerSignHashWithPrivateKeyRequest,
2193 fidl::encoding::ResultType<SignerSignHashWithPrivateKeyResponse, ErrorCode>,
2194 >(
2195 (hash, wrapped_private_key,),
2196 0x23e8ae3490affc11,
2197 fidl::encoding::DynamicFlags::empty(),
2198 ___deadline,
2199 )?;
2200 Ok(_response.map(|x| x.signature))
2201 }
2202}
2203
2204#[cfg(target_os = "fuchsia")]
2205impl From<SignerSynchronousProxy> for zx::Handle {
2206 fn from(value: SignerSynchronousProxy) -> Self {
2207 value.into_channel().into()
2208 }
2209}
2210
2211#[cfg(target_os = "fuchsia")]
2212impl From<fidl::Channel> for SignerSynchronousProxy {
2213 fn from(value: fidl::Channel) -> Self {
2214 Self::new(value)
2215 }
2216}
2217
2218#[derive(Debug, Clone)]
2219pub struct SignerProxy {
2220 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2221}
2222
2223impl fidl::endpoints::Proxy for SignerProxy {
2224 type Protocol = SignerMarker;
2225
2226 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2227 Self::new(inner)
2228 }
2229
2230 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2231 self.client.into_channel().map_err(|client| Self { client })
2232 }
2233
2234 fn as_channel(&self) -> &::fidl::AsyncChannel {
2235 self.client.as_channel()
2236 }
2237}
2238
2239impl SignerProxy {
2240 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2242 let protocol_name = <SignerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2243 Self { client: fidl::client::Client::new(channel, protocol_name) }
2244 }
2245
2246 pub fn take_event_stream(&self) -> SignerEventStream {
2252 SignerEventStream { event_receiver: self.client.take_event_receiver() }
2253 }
2254
2255 pub fn r#sign_hash(
2260 &self,
2261 mut hash: &[u8],
2262 ) -> fidl::client::QueryResponseFut<
2263 SignerSignHashResult,
2264 fidl::encoding::DefaultFuchsiaResourceDialect,
2265 > {
2266 SignerProxyInterface::r#sign_hash(self, hash)
2267 }
2268
2269 pub fn r#sign_hash_with_private_key(
2275 &self,
2276 mut hash: &[u8],
2277 mut wrapped_private_key: &[u8],
2278 ) -> fidl::client::QueryResponseFut<
2279 SignerSignHashWithPrivateKeyResult,
2280 fidl::encoding::DefaultFuchsiaResourceDialect,
2281 > {
2282 SignerProxyInterface::r#sign_hash_with_private_key(self, hash, wrapped_private_key)
2283 }
2284}
2285
2286impl SignerProxyInterface for SignerProxy {
2287 type SignHashResponseFut = fidl::client::QueryResponseFut<
2288 SignerSignHashResult,
2289 fidl::encoding::DefaultFuchsiaResourceDialect,
2290 >;
2291 fn r#sign_hash(&self, mut hash: &[u8]) -> Self::SignHashResponseFut {
2292 fn _decode(
2293 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2294 ) -> Result<SignerSignHashResult, fidl::Error> {
2295 let _response = fidl::client::decode_transaction_body::<
2296 fidl::encoding::ResultType<SignerSignHashResponse, ErrorCode>,
2297 fidl::encoding::DefaultFuchsiaResourceDialect,
2298 0x3bfb1667fc4fe864,
2299 >(_buf?)?;
2300 Ok(_response.map(|x| x.signature))
2301 }
2302 self.client.send_query_and_decode::<SignerSignHashRequest, SignerSignHashResult>(
2303 (hash,),
2304 0x3bfb1667fc4fe864,
2305 fidl::encoding::DynamicFlags::empty(),
2306 _decode,
2307 )
2308 }
2309
2310 type SignHashWithPrivateKeyResponseFut = fidl::client::QueryResponseFut<
2311 SignerSignHashWithPrivateKeyResult,
2312 fidl::encoding::DefaultFuchsiaResourceDialect,
2313 >;
2314 fn r#sign_hash_with_private_key(
2315 &self,
2316 mut hash: &[u8],
2317 mut wrapped_private_key: &[u8],
2318 ) -> Self::SignHashWithPrivateKeyResponseFut {
2319 fn _decode(
2320 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2321 ) -> Result<SignerSignHashWithPrivateKeyResult, fidl::Error> {
2322 let _response = fidl::client::decode_transaction_body::<
2323 fidl::encoding::ResultType<SignerSignHashWithPrivateKeyResponse, ErrorCode>,
2324 fidl::encoding::DefaultFuchsiaResourceDialect,
2325 0x23e8ae3490affc11,
2326 >(_buf?)?;
2327 Ok(_response.map(|x| x.signature))
2328 }
2329 self.client.send_query_and_decode::<
2330 SignerSignHashWithPrivateKeyRequest,
2331 SignerSignHashWithPrivateKeyResult,
2332 >(
2333 (hash, wrapped_private_key,),
2334 0x23e8ae3490affc11,
2335 fidl::encoding::DynamicFlags::empty(),
2336 _decode,
2337 )
2338 }
2339}
2340
2341pub struct SignerEventStream {
2342 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2343}
2344
2345impl std::marker::Unpin for SignerEventStream {}
2346
2347impl futures::stream::FusedStream for SignerEventStream {
2348 fn is_terminated(&self) -> bool {
2349 self.event_receiver.is_terminated()
2350 }
2351}
2352
2353impl futures::Stream for SignerEventStream {
2354 type Item = Result<SignerEvent, fidl::Error>;
2355
2356 fn poll_next(
2357 mut self: std::pin::Pin<&mut Self>,
2358 cx: &mut std::task::Context<'_>,
2359 ) -> std::task::Poll<Option<Self::Item>> {
2360 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2361 &mut self.event_receiver,
2362 cx
2363 )?) {
2364 Some(buf) => std::task::Poll::Ready(Some(SignerEvent::decode(buf))),
2365 None => std::task::Poll::Ready(None),
2366 }
2367 }
2368}
2369
2370#[derive(Debug)]
2371pub enum SignerEvent {}
2372
2373impl SignerEvent {
2374 fn decode(
2376 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2377 ) -> Result<SignerEvent, fidl::Error> {
2378 let (bytes, _handles) = buf.split_mut();
2379 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2380 debug_assert_eq!(tx_header.tx_id, 0);
2381 match tx_header.ordinal {
2382 _ => Err(fidl::Error::UnknownOrdinal {
2383 ordinal: tx_header.ordinal,
2384 protocol_name: <SignerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2385 }),
2386 }
2387 }
2388}
2389
2390pub struct SignerRequestStream {
2392 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2393 is_terminated: bool,
2394}
2395
2396impl std::marker::Unpin for SignerRequestStream {}
2397
2398impl futures::stream::FusedStream for SignerRequestStream {
2399 fn is_terminated(&self) -> bool {
2400 self.is_terminated
2401 }
2402}
2403
2404impl fidl::endpoints::RequestStream for SignerRequestStream {
2405 type Protocol = SignerMarker;
2406 type ControlHandle = SignerControlHandle;
2407
2408 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2409 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2410 }
2411
2412 fn control_handle(&self) -> Self::ControlHandle {
2413 SignerControlHandle { inner: self.inner.clone() }
2414 }
2415
2416 fn into_inner(
2417 self,
2418 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2419 {
2420 (self.inner, self.is_terminated)
2421 }
2422
2423 fn from_inner(
2424 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2425 is_terminated: bool,
2426 ) -> Self {
2427 Self { inner, is_terminated }
2428 }
2429}
2430
2431impl futures::Stream for SignerRequestStream {
2432 type Item = Result<SignerRequest, fidl::Error>;
2433
2434 fn poll_next(
2435 mut self: std::pin::Pin<&mut Self>,
2436 cx: &mut std::task::Context<'_>,
2437 ) -> std::task::Poll<Option<Self::Item>> {
2438 let this = &mut *self;
2439 if this.inner.check_shutdown(cx) {
2440 this.is_terminated = true;
2441 return std::task::Poll::Ready(None);
2442 }
2443 if this.is_terminated {
2444 panic!("polled SignerRequestStream after completion");
2445 }
2446 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2447 |bytes, handles| {
2448 match this.inner.channel().read_etc(cx, bytes, handles) {
2449 std::task::Poll::Ready(Ok(())) => {}
2450 std::task::Poll::Pending => return std::task::Poll::Pending,
2451 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2452 this.is_terminated = true;
2453 return std::task::Poll::Ready(None);
2454 }
2455 std::task::Poll::Ready(Err(e)) => {
2456 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2457 e.into(),
2458 ))))
2459 }
2460 }
2461
2462 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2464
2465 std::task::Poll::Ready(Some(match header.ordinal {
2466 0x3bfb1667fc4fe864 => {
2467 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2468 let mut req = fidl::new_empty!(
2469 SignerSignHashRequest,
2470 fidl::encoding::DefaultFuchsiaResourceDialect
2471 );
2472 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SignerSignHashRequest>(&header, _body_bytes, handles, &mut req)?;
2473 let control_handle = SignerControlHandle { inner: this.inner.clone() };
2474 Ok(SignerRequest::SignHash {
2475 hash: req.hash,
2476
2477 responder: SignerSignHashResponder {
2478 control_handle: std::mem::ManuallyDrop::new(control_handle),
2479 tx_id: header.tx_id,
2480 },
2481 })
2482 }
2483 0x23e8ae3490affc11 => {
2484 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2485 let mut req = fidl::new_empty!(
2486 SignerSignHashWithPrivateKeyRequest,
2487 fidl::encoding::DefaultFuchsiaResourceDialect
2488 );
2489 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SignerSignHashWithPrivateKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2490 let control_handle = SignerControlHandle { inner: this.inner.clone() };
2491 Ok(SignerRequest::SignHashWithPrivateKey {
2492 hash: req.hash,
2493 wrapped_private_key: req.wrapped_private_key,
2494
2495 responder: SignerSignHashWithPrivateKeyResponder {
2496 control_handle: std::mem::ManuallyDrop::new(control_handle),
2497 tx_id: header.tx_id,
2498 },
2499 })
2500 }
2501 _ => Err(fidl::Error::UnknownOrdinal {
2502 ordinal: header.ordinal,
2503 protocol_name:
2504 <SignerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2505 }),
2506 }))
2507 },
2508 )
2509 }
2510}
2511
2512#[derive(Debug)]
2515pub enum SignerRequest {
2516 SignHash { hash: Vec<u8>, responder: SignerSignHashResponder },
2521 SignHashWithPrivateKey {
2527 hash: Vec<u8>,
2528 wrapped_private_key: Vec<u8>,
2529 responder: SignerSignHashWithPrivateKeyResponder,
2530 },
2531}
2532
2533impl SignerRequest {
2534 #[allow(irrefutable_let_patterns)]
2535 pub fn into_sign_hash(self) -> Option<(Vec<u8>, SignerSignHashResponder)> {
2536 if let SignerRequest::SignHash { hash, responder } = self {
2537 Some((hash, responder))
2538 } else {
2539 None
2540 }
2541 }
2542
2543 #[allow(irrefutable_let_patterns)]
2544 pub fn into_sign_hash_with_private_key(
2545 self,
2546 ) -> Option<(Vec<u8>, Vec<u8>, SignerSignHashWithPrivateKeyResponder)> {
2547 if let SignerRequest::SignHashWithPrivateKey { hash, wrapped_private_key, responder } = self
2548 {
2549 Some((hash, wrapped_private_key, responder))
2550 } else {
2551 None
2552 }
2553 }
2554
2555 pub fn method_name(&self) -> &'static str {
2557 match *self {
2558 SignerRequest::SignHash { .. } => "sign_hash",
2559 SignerRequest::SignHashWithPrivateKey { .. } => "sign_hash_with_private_key",
2560 }
2561 }
2562}
2563
2564#[derive(Debug, Clone)]
2565pub struct SignerControlHandle {
2566 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2567}
2568
2569impl fidl::endpoints::ControlHandle for SignerControlHandle {
2570 fn shutdown(&self) {
2571 self.inner.shutdown()
2572 }
2573 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2574 self.inner.shutdown_with_epitaph(status)
2575 }
2576
2577 fn is_closed(&self) -> bool {
2578 self.inner.channel().is_closed()
2579 }
2580 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2581 self.inner.channel().on_closed()
2582 }
2583
2584 #[cfg(target_os = "fuchsia")]
2585 fn signal_peer(
2586 &self,
2587 clear_mask: zx::Signals,
2588 set_mask: zx::Signals,
2589 ) -> Result<(), zx_status::Status> {
2590 use fidl::Peered;
2591 self.inner.channel().signal_peer(clear_mask, set_mask)
2592 }
2593}
2594
2595impl SignerControlHandle {}
2596
2597#[must_use = "FIDL methods require a response to be sent"]
2598#[derive(Debug)]
2599pub struct SignerSignHashResponder {
2600 control_handle: std::mem::ManuallyDrop<SignerControlHandle>,
2601 tx_id: u32,
2602}
2603
2604impl std::ops::Drop for SignerSignHashResponder {
2608 fn drop(&mut self) {
2609 self.control_handle.shutdown();
2610 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2612 }
2613}
2614
2615impl fidl::endpoints::Responder for SignerSignHashResponder {
2616 type ControlHandle = SignerControlHandle;
2617
2618 fn control_handle(&self) -> &SignerControlHandle {
2619 &self.control_handle
2620 }
2621
2622 fn drop_without_shutdown(mut self) {
2623 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2625 std::mem::forget(self);
2627 }
2628}
2629
2630impl SignerSignHashResponder {
2631 pub fn send(self, mut result: Result<&[u8], ErrorCode>) -> Result<(), fidl::Error> {
2635 let _result = self.send_raw(result);
2636 if _result.is_err() {
2637 self.control_handle.shutdown();
2638 }
2639 self.drop_without_shutdown();
2640 _result
2641 }
2642
2643 pub fn send_no_shutdown_on_err(
2645 self,
2646 mut result: Result<&[u8], ErrorCode>,
2647 ) -> Result<(), fidl::Error> {
2648 let _result = self.send_raw(result);
2649 self.drop_without_shutdown();
2650 _result
2651 }
2652
2653 fn send_raw(&self, mut result: Result<&[u8], ErrorCode>) -> Result<(), fidl::Error> {
2654 self.control_handle
2655 .inner
2656 .send::<fidl::encoding::ResultType<SignerSignHashResponse, ErrorCode>>(
2657 result.map(|signature| (signature,)),
2658 self.tx_id,
2659 0x3bfb1667fc4fe864,
2660 fidl::encoding::DynamicFlags::empty(),
2661 )
2662 }
2663}
2664
2665#[must_use = "FIDL methods require a response to be sent"]
2666#[derive(Debug)]
2667pub struct SignerSignHashWithPrivateKeyResponder {
2668 control_handle: std::mem::ManuallyDrop<SignerControlHandle>,
2669 tx_id: u32,
2670}
2671
2672impl std::ops::Drop for SignerSignHashWithPrivateKeyResponder {
2676 fn drop(&mut self) {
2677 self.control_handle.shutdown();
2678 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2680 }
2681}
2682
2683impl fidl::endpoints::Responder for SignerSignHashWithPrivateKeyResponder {
2684 type ControlHandle = SignerControlHandle;
2685
2686 fn control_handle(&self) -> &SignerControlHandle {
2687 &self.control_handle
2688 }
2689
2690 fn drop_without_shutdown(mut self) {
2691 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2693 std::mem::forget(self);
2695 }
2696}
2697
2698impl SignerSignHashWithPrivateKeyResponder {
2699 pub fn send(self, mut result: Result<&[u8], ErrorCode>) -> Result<(), fidl::Error> {
2703 let _result = self.send_raw(result);
2704 if _result.is_err() {
2705 self.control_handle.shutdown();
2706 }
2707 self.drop_without_shutdown();
2708 _result
2709 }
2710
2711 pub fn send_no_shutdown_on_err(
2713 self,
2714 mut result: Result<&[u8], ErrorCode>,
2715 ) -> Result<(), fidl::Error> {
2716 let _result = self.send_raw(result);
2717 self.drop_without_shutdown();
2718 _result
2719 }
2720
2721 fn send_raw(&self, mut result: Result<&[u8], ErrorCode>) -> Result<(), fidl::Error> {
2722 self.control_handle.inner.send::<fidl::encoding::ResultType<
2723 SignerSignHashWithPrivateKeyResponse,
2724 ErrorCode,
2725 >>(
2726 result.map(|signature| (signature,)),
2727 self.tx_id,
2728 0x23e8ae3490affc11,
2729 fidl::encoding::DynamicFlags::empty(),
2730 )
2731 }
2732}
2733
2734#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2735pub struct StackMarker;
2736
2737impl fidl::endpoints::ProtocolMarker for StackMarker {
2738 type Proxy = StackProxy;
2739 type RequestStream = StackRequestStream;
2740 #[cfg(target_os = "fuchsia")]
2741 type SynchronousProxy = StackSynchronousProxy;
2742
2743 const DEBUG_NAME: &'static str = "fuchsia.weave.Stack";
2744}
2745impl fidl::endpoints::DiscoverableProtocolMarker for StackMarker {}
2746pub type StackGetQrCodeResult = Result<QrCode, ErrorCode>;
2747pub type StackResetConfigResult = Result<(), ErrorCode>;
2748
2749pub trait StackProxyInterface: Send + Sync {
2750 fn r#get_pairing_state_watcher(
2751 &self,
2752 watcher: fidl::endpoints::ServerEnd<PairingStateWatcherMarker>,
2753 ) -> Result<(), fidl::Error>;
2754 fn r#get_svc_directory_watcher(
2755 &self,
2756 endpoint_id: u64,
2757 watcher: fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>,
2758 ) -> Result<(), fidl::Error>;
2759 type GetQrCodeResponseFut: std::future::Future<Output = Result<StackGetQrCodeResult, fidl::Error>>
2760 + Send;
2761 fn r#get_qr_code(&self) -> Self::GetQrCodeResponseFut;
2762 type ResetConfigResponseFut: std::future::Future<Output = Result<StackResetConfigResult, fidl::Error>>
2763 + Send;
2764 fn r#reset_config(&self, flags: ResetConfigFlags) -> Self::ResetConfigResponseFut;
2765}
2766#[derive(Debug)]
2767#[cfg(target_os = "fuchsia")]
2768pub struct StackSynchronousProxy {
2769 client: fidl::client::sync::Client,
2770}
2771
2772#[cfg(target_os = "fuchsia")]
2773impl fidl::endpoints::SynchronousProxy for StackSynchronousProxy {
2774 type Proxy = StackProxy;
2775 type Protocol = StackMarker;
2776
2777 fn from_channel(inner: fidl::Channel) -> Self {
2778 Self::new(inner)
2779 }
2780
2781 fn into_channel(self) -> fidl::Channel {
2782 self.client.into_channel()
2783 }
2784
2785 fn as_channel(&self) -> &fidl::Channel {
2786 self.client.as_channel()
2787 }
2788}
2789
2790#[cfg(target_os = "fuchsia")]
2791impl StackSynchronousProxy {
2792 pub fn new(channel: fidl::Channel) -> Self {
2793 let protocol_name = <StackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2794 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2795 }
2796
2797 pub fn into_channel(self) -> fidl::Channel {
2798 self.client.into_channel()
2799 }
2800
2801 pub fn wait_for_event(
2804 &self,
2805 deadline: zx::MonotonicInstant,
2806 ) -> Result<StackEvent, fidl::Error> {
2807 StackEvent::decode(self.client.wait_for_event(deadline)?)
2808 }
2809
2810 pub fn r#get_pairing_state_watcher(
2812 &self,
2813 mut watcher: fidl::endpoints::ServerEnd<PairingStateWatcherMarker>,
2814 ) -> Result<(), fidl::Error> {
2815 self.client.send::<StackGetPairingStateWatcherRequest>(
2816 (watcher,),
2817 0x674bbfa106efdc8d,
2818 fidl::encoding::DynamicFlags::empty(),
2819 )
2820 }
2821
2822 pub fn r#get_svc_directory_watcher(
2825 &self,
2826 mut endpoint_id: u64,
2827 mut watcher: fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>,
2828 ) -> Result<(), fidl::Error> {
2829 self.client.send::<StackGetSvcDirectoryWatcherRequest>(
2830 (endpoint_id, watcher),
2831 0x261fdbc7a8447180,
2832 fidl::encoding::DynamicFlags::empty(),
2833 )
2834 }
2835
2836 pub fn r#get_qr_code(
2838 &self,
2839 ___deadline: zx::MonotonicInstant,
2840 ) -> Result<StackGetQrCodeResult, fidl::Error> {
2841 let _response = self.client.send_query::<
2842 fidl::encoding::EmptyPayload,
2843 fidl::encoding::ResultType<StackGetQrCodeResponse, ErrorCode>,
2844 >(
2845 (),
2846 0x79e435f04eb8d342,
2847 fidl::encoding::DynamicFlags::empty(),
2848 ___deadline,
2849 )?;
2850 Ok(_response.map(|x| x.qr_code))
2851 }
2852
2853 pub fn r#reset_config(
2855 &self,
2856 mut flags: ResetConfigFlags,
2857 ___deadline: zx::MonotonicInstant,
2858 ) -> Result<StackResetConfigResult, fidl::Error> {
2859 let _response = self.client.send_query::<
2860 StackResetConfigRequest,
2861 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ErrorCode>,
2862 >(
2863 (flags,),
2864 0x7a009a9b62d35c10,
2865 fidl::encoding::DynamicFlags::empty(),
2866 ___deadline,
2867 )?;
2868 Ok(_response.map(|x| x))
2869 }
2870}
2871
2872#[cfg(target_os = "fuchsia")]
2873impl From<StackSynchronousProxy> for zx::Handle {
2874 fn from(value: StackSynchronousProxy) -> Self {
2875 value.into_channel().into()
2876 }
2877}
2878
2879#[cfg(target_os = "fuchsia")]
2880impl From<fidl::Channel> for StackSynchronousProxy {
2881 fn from(value: fidl::Channel) -> Self {
2882 Self::new(value)
2883 }
2884}
2885
2886#[derive(Debug, Clone)]
2887pub struct StackProxy {
2888 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2889}
2890
2891impl fidl::endpoints::Proxy for StackProxy {
2892 type Protocol = StackMarker;
2893
2894 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2895 Self::new(inner)
2896 }
2897
2898 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2899 self.client.into_channel().map_err(|client| Self { client })
2900 }
2901
2902 fn as_channel(&self) -> &::fidl::AsyncChannel {
2903 self.client.as_channel()
2904 }
2905}
2906
2907impl StackProxy {
2908 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2910 let protocol_name = <StackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2911 Self { client: fidl::client::Client::new(channel, protocol_name) }
2912 }
2913
2914 pub fn take_event_stream(&self) -> StackEventStream {
2920 StackEventStream { event_receiver: self.client.take_event_receiver() }
2921 }
2922
2923 pub fn r#get_pairing_state_watcher(
2925 &self,
2926 mut watcher: fidl::endpoints::ServerEnd<PairingStateWatcherMarker>,
2927 ) -> Result<(), fidl::Error> {
2928 StackProxyInterface::r#get_pairing_state_watcher(self, watcher)
2929 }
2930
2931 pub fn r#get_svc_directory_watcher(
2934 &self,
2935 mut endpoint_id: u64,
2936 mut watcher: fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>,
2937 ) -> Result<(), fidl::Error> {
2938 StackProxyInterface::r#get_svc_directory_watcher(self, endpoint_id, watcher)
2939 }
2940
2941 pub fn r#get_qr_code(
2943 &self,
2944 ) -> fidl::client::QueryResponseFut<
2945 StackGetQrCodeResult,
2946 fidl::encoding::DefaultFuchsiaResourceDialect,
2947 > {
2948 StackProxyInterface::r#get_qr_code(self)
2949 }
2950
2951 pub fn r#reset_config(
2953 &self,
2954 mut flags: ResetConfigFlags,
2955 ) -> fidl::client::QueryResponseFut<
2956 StackResetConfigResult,
2957 fidl::encoding::DefaultFuchsiaResourceDialect,
2958 > {
2959 StackProxyInterface::r#reset_config(self, flags)
2960 }
2961}
2962
2963impl StackProxyInterface for StackProxy {
2964 fn r#get_pairing_state_watcher(
2965 &self,
2966 mut watcher: fidl::endpoints::ServerEnd<PairingStateWatcherMarker>,
2967 ) -> Result<(), fidl::Error> {
2968 self.client.send::<StackGetPairingStateWatcherRequest>(
2969 (watcher,),
2970 0x674bbfa106efdc8d,
2971 fidl::encoding::DynamicFlags::empty(),
2972 )
2973 }
2974
2975 fn r#get_svc_directory_watcher(
2976 &self,
2977 mut endpoint_id: u64,
2978 mut watcher: fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>,
2979 ) -> Result<(), fidl::Error> {
2980 self.client.send::<StackGetSvcDirectoryWatcherRequest>(
2981 (endpoint_id, watcher),
2982 0x261fdbc7a8447180,
2983 fidl::encoding::DynamicFlags::empty(),
2984 )
2985 }
2986
2987 type GetQrCodeResponseFut = fidl::client::QueryResponseFut<
2988 StackGetQrCodeResult,
2989 fidl::encoding::DefaultFuchsiaResourceDialect,
2990 >;
2991 fn r#get_qr_code(&self) -> Self::GetQrCodeResponseFut {
2992 fn _decode(
2993 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2994 ) -> Result<StackGetQrCodeResult, fidl::Error> {
2995 let _response = fidl::client::decode_transaction_body::<
2996 fidl::encoding::ResultType<StackGetQrCodeResponse, ErrorCode>,
2997 fidl::encoding::DefaultFuchsiaResourceDialect,
2998 0x79e435f04eb8d342,
2999 >(_buf?)?;
3000 Ok(_response.map(|x| x.qr_code))
3001 }
3002 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StackGetQrCodeResult>(
3003 (),
3004 0x79e435f04eb8d342,
3005 fidl::encoding::DynamicFlags::empty(),
3006 _decode,
3007 )
3008 }
3009
3010 type ResetConfigResponseFut = fidl::client::QueryResponseFut<
3011 StackResetConfigResult,
3012 fidl::encoding::DefaultFuchsiaResourceDialect,
3013 >;
3014 fn r#reset_config(&self, mut flags: ResetConfigFlags) -> Self::ResetConfigResponseFut {
3015 fn _decode(
3016 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3017 ) -> Result<StackResetConfigResult, fidl::Error> {
3018 let _response = fidl::client::decode_transaction_body::<
3019 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ErrorCode>,
3020 fidl::encoding::DefaultFuchsiaResourceDialect,
3021 0x7a009a9b62d35c10,
3022 >(_buf?)?;
3023 Ok(_response.map(|x| x))
3024 }
3025 self.client.send_query_and_decode::<StackResetConfigRequest, StackResetConfigResult>(
3026 (flags,),
3027 0x7a009a9b62d35c10,
3028 fidl::encoding::DynamicFlags::empty(),
3029 _decode,
3030 )
3031 }
3032}
3033
3034pub struct StackEventStream {
3035 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3036}
3037
3038impl std::marker::Unpin for StackEventStream {}
3039
3040impl futures::stream::FusedStream for StackEventStream {
3041 fn is_terminated(&self) -> bool {
3042 self.event_receiver.is_terminated()
3043 }
3044}
3045
3046impl futures::Stream for StackEventStream {
3047 type Item = Result<StackEvent, fidl::Error>;
3048
3049 fn poll_next(
3050 mut self: std::pin::Pin<&mut Self>,
3051 cx: &mut std::task::Context<'_>,
3052 ) -> std::task::Poll<Option<Self::Item>> {
3053 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3054 &mut self.event_receiver,
3055 cx
3056 )?) {
3057 Some(buf) => std::task::Poll::Ready(Some(StackEvent::decode(buf))),
3058 None => std::task::Poll::Ready(None),
3059 }
3060 }
3061}
3062
3063#[derive(Debug)]
3064pub enum StackEvent {}
3065
3066impl StackEvent {
3067 fn decode(
3069 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3070 ) -> Result<StackEvent, fidl::Error> {
3071 let (bytes, _handles) = buf.split_mut();
3072 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3073 debug_assert_eq!(tx_header.tx_id, 0);
3074 match tx_header.ordinal {
3075 _ => Err(fidl::Error::UnknownOrdinal {
3076 ordinal: tx_header.ordinal,
3077 protocol_name: <StackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3078 }),
3079 }
3080 }
3081}
3082
3083pub struct StackRequestStream {
3085 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3086 is_terminated: bool,
3087}
3088
3089impl std::marker::Unpin for StackRequestStream {}
3090
3091impl futures::stream::FusedStream for StackRequestStream {
3092 fn is_terminated(&self) -> bool {
3093 self.is_terminated
3094 }
3095}
3096
3097impl fidl::endpoints::RequestStream for StackRequestStream {
3098 type Protocol = StackMarker;
3099 type ControlHandle = StackControlHandle;
3100
3101 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3102 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3103 }
3104
3105 fn control_handle(&self) -> Self::ControlHandle {
3106 StackControlHandle { inner: self.inner.clone() }
3107 }
3108
3109 fn into_inner(
3110 self,
3111 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3112 {
3113 (self.inner, self.is_terminated)
3114 }
3115
3116 fn from_inner(
3117 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3118 is_terminated: bool,
3119 ) -> Self {
3120 Self { inner, is_terminated }
3121 }
3122}
3123
3124impl futures::Stream for StackRequestStream {
3125 type Item = Result<StackRequest, fidl::Error>;
3126
3127 fn poll_next(
3128 mut self: std::pin::Pin<&mut Self>,
3129 cx: &mut std::task::Context<'_>,
3130 ) -> std::task::Poll<Option<Self::Item>> {
3131 let this = &mut *self;
3132 if this.inner.check_shutdown(cx) {
3133 this.is_terminated = true;
3134 return std::task::Poll::Ready(None);
3135 }
3136 if this.is_terminated {
3137 panic!("polled StackRequestStream after completion");
3138 }
3139 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3140 |bytes, handles| {
3141 match this.inner.channel().read_etc(cx, bytes, handles) {
3142 std::task::Poll::Ready(Ok(())) => {}
3143 std::task::Poll::Pending => return std::task::Poll::Pending,
3144 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3145 this.is_terminated = true;
3146 return std::task::Poll::Ready(None);
3147 }
3148 std::task::Poll::Ready(Err(e)) => {
3149 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3150 e.into(),
3151 ))))
3152 }
3153 }
3154
3155 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3157
3158 std::task::Poll::Ready(Some(match header.ordinal {
3159 0x674bbfa106efdc8d => {
3160 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3161 let mut req = fidl::new_empty!(
3162 StackGetPairingStateWatcherRequest,
3163 fidl::encoding::DefaultFuchsiaResourceDialect
3164 );
3165 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StackGetPairingStateWatcherRequest>(&header, _body_bytes, handles, &mut req)?;
3166 let control_handle = StackControlHandle { inner: this.inner.clone() };
3167 Ok(StackRequest::GetPairingStateWatcher {
3168 watcher: req.watcher,
3169
3170 control_handle,
3171 })
3172 }
3173 0x261fdbc7a8447180 => {
3174 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3175 let mut req = fidl::new_empty!(
3176 StackGetSvcDirectoryWatcherRequest,
3177 fidl::encoding::DefaultFuchsiaResourceDialect
3178 );
3179 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StackGetSvcDirectoryWatcherRequest>(&header, _body_bytes, handles, &mut req)?;
3180 let control_handle = StackControlHandle { inner: this.inner.clone() };
3181 Ok(StackRequest::GetSvcDirectoryWatcher {
3182 endpoint_id: req.endpoint_id,
3183 watcher: req.watcher,
3184
3185 control_handle,
3186 })
3187 }
3188 0x79e435f04eb8d342 => {
3189 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3190 let mut req = fidl::new_empty!(
3191 fidl::encoding::EmptyPayload,
3192 fidl::encoding::DefaultFuchsiaResourceDialect
3193 );
3194 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3195 let control_handle = StackControlHandle { inner: this.inner.clone() };
3196 Ok(StackRequest::GetQrCode {
3197 responder: StackGetQrCodeResponder {
3198 control_handle: std::mem::ManuallyDrop::new(control_handle),
3199 tx_id: header.tx_id,
3200 },
3201 })
3202 }
3203 0x7a009a9b62d35c10 => {
3204 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3205 let mut req = fidl::new_empty!(
3206 StackResetConfigRequest,
3207 fidl::encoding::DefaultFuchsiaResourceDialect
3208 );
3209 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StackResetConfigRequest>(&header, _body_bytes, handles, &mut req)?;
3210 let control_handle = StackControlHandle { inner: this.inner.clone() };
3211 Ok(StackRequest::ResetConfig {
3212 flags: req.flags,
3213
3214 responder: StackResetConfigResponder {
3215 control_handle: std::mem::ManuallyDrop::new(control_handle),
3216 tx_id: header.tx_id,
3217 },
3218 })
3219 }
3220 _ => Err(fidl::Error::UnknownOrdinal {
3221 ordinal: header.ordinal,
3222 protocol_name: <StackMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3223 }),
3224 }))
3225 },
3226 )
3227 }
3228}
3229
3230#[derive(Debug)]
3235pub enum StackRequest {
3236 GetPairingStateWatcher {
3238 watcher: fidl::endpoints::ServerEnd<PairingStateWatcherMarker>,
3239 control_handle: StackControlHandle,
3240 },
3241 GetSvcDirectoryWatcher {
3244 endpoint_id: u64,
3245 watcher: fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>,
3246 control_handle: StackControlHandle,
3247 },
3248 GetQrCode { responder: StackGetQrCodeResponder },
3250 ResetConfig { flags: ResetConfigFlags, responder: StackResetConfigResponder },
3252}
3253
3254impl StackRequest {
3255 #[allow(irrefutable_let_patterns)]
3256 pub fn into_get_pairing_state_watcher(
3257 self,
3258 ) -> Option<(fidl::endpoints::ServerEnd<PairingStateWatcherMarker>, StackControlHandle)> {
3259 if let StackRequest::GetPairingStateWatcher { watcher, control_handle } = self {
3260 Some((watcher, control_handle))
3261 } else {
3262 None
3263 }
3264 }
3265
3266 #[allow(irrefutable_let_patterns)]
3267 pub fn into_get_svc_directory_watcher(
3268 self,
3269 ) -> Option<(u64, fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>, StackControlHandle)>
3270 {
3271 if let StackRequest::GetSvcDirectoryWatcher { endpoint_id, watcher, control_handle } = self
3272 {
3273 Some((endpoint_id, watcher, control_handle))
3274 } else {
3275 None
3276 }
3277 }
3278
3279 #[allow(irrefutable_let_patterns)]
3280 pub fn into_get_qr_code(self) -> Option<(StackGetQrCodeResponder)> {
3281 if let StackRequest::GetQrCode { responder } = self {
3282 Some((responder))
3283 } else {
3284 None
3285 }
3286 }
3287
3288 #[allow(irrefutable_let_patterns)]
3289 pub fn into_reset_config(self) -> Option<(ResetConfigFlags, StackResetConfigResponder)> {
3290 if let StackRequest::ResetConfig { flags, responder } = self {
3291 Some((flags, responder))
3292 } else {
3293 None
3294 }
3295 }
3296
3297 pub fn method_name(&self) -> &'static str {
3299 match *self {
3300 StackRequest::GetPairingStateWatcher { .. } => "get_pairing_state_watcher",
3301 StackRequest::GetSvcDirectoryWatcher { .. } => "get_svc_directory_watcher",
3302 StackRequest::GetQrCode { .. } => "get_qr_code",
3303 StackRequest::ResetConfig { .. } => "reset_config",
3304 }
3305 }
3306}
3307
3308#[derive(Debug, Clone)]
3309pub struct StackControlHandle {
3310 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3311}
3312
3313impl fidl::endpoints::ControlHandle for StackControlHandle {
3314 fn shutdown(&self) {
3315 self.inner.shutdown()
3316 }
3317 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3318 self.inner.shutdown_with_epitaph(status)
3319 }
3320
3321 fn is_closed(&self) -> bool {
3322 self.inner.channel().is_closed()
3323 }
3324 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3325 self.inner.channel().on_closed()
3326 }
3327
3328 #[cfg(target_os = "fuchsia")]
3329 fn signal_peer(
3330 &self,
3331 clear_mask: zx::Signals,
3332 set_mask: zx::Signals,
3333 ) -> Result<(), zx_status::Status> {
3334 use fidl::Peered;
3335 self.inner.channel().signal_peer(clear_mask, set_mask)
3336 }
3337}
3338
3339impl StackControlHandle {}
3340
3341#[must_use = "FIDL methods require a response to be sent"]
3342#[derive(Debug)]
3343pub struct StackGetQrCodeResponder {
3344 control_handle: std::mem::ManuallyDrop<StackControlHandle>,
3345 tx_id: u32,
3346}
3347
3348impl std::ops::Drop for StackGetQrCodeResponder {
3352 fn drop(&mut self) {
3353 self.control_handle.shutdown();
3354 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3356 }
3357}
3358
3359impl fidl::endpoints::Responder for StackGetQrCodeResponder {
3360 type ControlHandle = StackControlHandle;
3361
3362 fn control_handle(&self) -> &StackControlHandle {
3363 &self.control_handle
3364 }
3365
3366 fn drop_without_shutdown(mut self) {
3367 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3369 std::mem::forget(self);
3371 }
3372}
3373
3374impl StackGetQrCodeResponder {
3375 pub fn send(self, mut result: Result<&QrCode, ErrorCode>) -> Result<(), fidl::Error> {
3379 let _result = self.send_raw(result);
3380 if _result.is_err() {
3381 self.control_handle.shutdown();
3382 }
3383 self.drop_without_shutdown();
3384 _result
3385 }
3386
3387 pub fn send_no_shutdown_on_err(
3389 self,
3390 mut result: Result<&QrCode, ErrorCode>,
3391 ) -> Result<(), fidl::Error> {
3392 let _result = self.send_raw(result);
3393 self.drop_without_shutdown();
3394 _result
3395 }
3396
3397 fn send_raw(&self, mut result: Result<&QrCode, ErrorCode>) -> Result<(), fidl::Error> {
3398 self.control_handle
3399 .inner
3400 .send::<fidl::encoding::ResultType<StackGetQrCodeResponse, ErrorCode>>(
3401 result.map(|qr_code| (qr_code,)),
3402 self.tx_id,
3403 0x79e435f04eb8d342,
3404 fidl::encoding::DynamicFlags::empty(),
3405 )
3406 }
3407}
3408
3409#[must_use = "FIDL methods require a response to be sent"]
3410#[derive(Debug)]
3411pub struct StackResetConfigResponder {
3412 control_handle: std::mem::ManuallyDrop<StackControlHandle>,
3413 tx_id: u32,
3414}
3415
3416impl std::ops::Drop for StackResetConfigResponder {
3420 fn drop(&mut self) {
3421 self.control_handle.shutdown();
3422 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3424 }
3425}
3426
3427impl fidl::endpoints::Responder for StackResetConfigResponder {
3428 type ControlHandle = StackControlHandle;
3429
3430 fn control_handle(&self) -> &StackControlHandle {
3431 &self.control_handle
3432 }
3433
3434 fn drop_without_shutdown(mut self) {
3435 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3437 std::mem::forget(self);
3439 }
3440}
3441
3442impl StackResetConfigResponder {
3443 pub fn send(self, mut result: Result<(), ErrorCode>) -> Result<(), fidl::Error> {
3447 let _result = self.send_raw(result);
3448 if _result.is_err() {
3449 self.control_handle.shutdown();
3450 }
3451 self.drop_without_shutdown();
3452 _result
3453 }
3454
3455 pub fn send_no_shutdown_on_err(
3457 self,
3458 mut result: Result<(), ErrorCode>,
3459 ) -> Result<(), fidl::Error> {
3460 let _result = self.send_raw(result);
3461 self.drop_without_shutdown();
3462 _result
3463 }
3464
3465 fn send_raw(&self, mut result: Result<(), ErrorCode>) -> Result<(), fidl::Error> {
3466 self.control_handle
3467 .inner
3468 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ErrorCode>>(
3469 result,
3470 self.tx_id,
3471 0x7a009a9b62d35c10,
3472 fidl::encoding::DynamicFlags::empty(),
3473 )
3474 }
3475}
3476
3477#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3478pub struct StackProviderMarker;
3479
3480impl fidl::endpoints::ProtocolMarker for StackProviderMarker {
3481 type Proxy = StackProviderProxy;
3482 type RequestStream = StackProviderRequestStream;
3483 #[cfg(target_os = "fuchsia")]
3484 type SynchronousProxy = StackProviderSynchronousProxy;
3485
3486 const DEBUG_NAME: &'static str = "fuchsia.weave.StackProvider";
3487}
3488impl fidl::endpoints::DiscoverableProtocolMarker for StackProviderMarker {}
3489
3490pub trait StackProviderProxyInterface: Send + Sync {
3491 fn r#set_wlan_network_config_provider(
3492 &self,
3493 provider: fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
3494 ) -> Result<(), fidl::Error>;
3495}
3496#[derive(Debug)]
3497#[cfg(target_os = "fuchsia")]
3498pub struct StackProviderSynchronousProxy {
3499 client: fidl::client::sync::Client,
3500}
3501
3502#[cfg(target_os = "fuchsia")]
3503impl fidl::endpoints::SynchronousProxy for StackProviderSynchronousProxy {
3504 type Proxy = StackProviderProxy;
3505 type Protocol = StackProviderMarker;
3506
3507 fn from_channel(inner: fidl::Channel) -> Self {
3508 Self::new(inner)
3509 }
3510
3511 fn into_channel(self) -> fidl::Channel {
3512 self.client.into_channel()
3513 }
3514
3515 fn as_channel(&self) -> &fidl::Channel {
3516 self.client.as_channel()
3517 }
3518}
3519
3520#[cfg(target_os = "fuchsia")]
3521impl StackProviderSynchronousProxy {
3522 pub fn new(channel: fidl::Channel) -> Self {
3523 let protocol_name = <StackProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3524 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3525 }
3526
3527 pub fn into_channel(self) -> fidl::Channel {
3528 self.client.into_channel()
3529 }
3530
3531 pub fn wait_for_event(
3534 &self,
3535 deadline: zx::MonotonicInstant,
3536 ) -> Result<StackProviderEvent, fidl::Error> {
3537 StackProviderEvent::decode(self.client.wait_for_event(deadline)?)
3538 }
3539
3540 pub fn r#set_wlan_network_config_provider(
3550 &self,
3551 mut provider: fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
3552 ) -> Result<(), fidl::Error> {
3553 self.client.send::<StackProviderSetWlanNetworkConfigProviderRequest>(
3554 (provider,),
3555 0x60f817738f6028b4,
3556 fidl::encoding::DynamicFlags::empty(),
3557 )
3558 }
3559}
3560
3561#[cfg(target_os = "fuchsia")]
3562impl From<StackProviderSynchronousProxy> for zx::Handle {
3563 fn from(value: StackProviderSynchronousProxy) -> Self {
3564 value.into_channel().into()
3565 }
3566}
3567
3568#[cfg(target_os = "fuchsia")]
3569impl From<fidl::Channel> for StackProviderSynchronousProxy {
3570 fn from(value: fidl::Channel) -> Self {
3571 Self::new(value)
3572 }
3573}
3574
3575#[derive(Debug, Clone)]
3576pub struct StackProviderProxy {
3577 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3578}
3579
3580impl fidl::endpoints::Proxy for StackProviderProxy {
3581 type Protocol = StackProviderMarker;
3582
3583 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3584 Self::new(inner)
3585 }
3586
3587 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3588 self.client.into_channel().map_err(|client| Self { client })
3589 }
3590
3591 fn as_channel(&self) -> &::fidl::AsyncChannel {
3592 self.client.as_channel()
3593 }
3594}
3595
3596impl StackProviderProxy {
3597 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3599 let protocol_name = <StackProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3600 Self { client: fidl::client::Client::new(channel, protocol_name) }
3601 }
3602
3603 pub fn take_event_stream(&self) -> StackProviderEventStream {
3609 StackProviderEventStream { event_receiver: self.client.take_event_receiver() }
3610 }
3611
3612 pub fn r#set_wlan_network_config_provider(
3622 &self,
3623 mut provider: fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
3624 ) -> Result<(), fidl::Error> {
3625 StackProviderProxyInterface::r#set_wlan_network_config_provider(self, provider)
3626 }
3627}
3628
3629impl StackProviderProxyInterface for StackProviderProxy {
3630 fn r#set_wlan_network_config_provider(
3631 &self,
3632 mut provider: fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
3633 ) -> Result<(), fidl::Error> {
3634 self.client.send::<StackProviderSetWlanNetworkConfigProviderRequest>(
3635 (provider,),
3636 0x60f817738f6028b4,
3637 fidl::encoding::DynamicFlags::empty(),
3638 )
3639 }
3640}
3641
3642pub struct StackProviderEventStream {
3643 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3644}
3645
3646impl std::marker::Unpin for StackProviderEventStream {}
3647
3648impl futures::stream::FusedStream for StackProviderEventStream {
3649 fn is_terminated(&self) -> bool {
3650 self.event_receiver.is_terminated()
3651 }
3652}
3653
3654impl futures::Stream for StackProviderEventStream {
3655 type Item = Result<StackProviderEvent, fidl::Error>;
3656
3657 fn poll_next(
3658 mut self: std::pin::Pin<&mut Self>,
3659 cx: &mut std::task::Context<'_>,
3660 ) -> std::task::Poll<Option<Self::Item>> {
3661 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3662 &mut self.event_receiver,
3663 cx
3664 )?) {
3665 Some(buf) => std::task::Poll::Ready(Some(StackProviderEvent::decode(buf))),
3666 None => std::task::Poll::Ready(None),
3667 }
3668 }
3669}
3670
3671#[derive(Debug)]
3672pub enum StackProviderEvent {}
3673
3674impl StackProviderEvent {
3675 fn decode(
3677 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3678 ) -> Result<StackProviderEvent, fidl::Error> {
3679 let (bytes, _handles) = buf.split_mut();
3680 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3681 debug_assert_eq!(tx_header.tx_id, 0);
3682 match tx_header.ordinal {
3683 _ => Err(fidl::Error::UnknownOrdinal {
3684 ordinal: tx_header.ordinal,
3685 protocol_name: <StackProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3686 }),
3687 }
3688 }
3689}
3690
3691pub struct StackProviderRequestStream {
3693 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3694 is_terminated: bool,
3695}
3696
3697impl std::marker::Unpin for StackProviderRequestStream {}
3698
3699impl futures::stream::FusedStream for StackProviderRequestStream {
3700 fn is_terminated(&self) -> bool {
3701 self.is_terminated
3702 }
3703}
3704
3705impl fidl::endpoints::RequestStream for StackProviderRequestStream {
3706 type Protocol = StackProviderMarker;
3707 type ControlHandle = StackProviderControlHandle;
3708
3709 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3710 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3711 }
3712
3713 fn control_handle(&self) -> Self::ControlHandle {
3714 StackProviderControlHandle { inner: self.inner.clone() }
3715 }
3716
3717 fn into_inner(
3718 self,
3719 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3720 {
3721 (self.inner, self.is_terminated)
3722 }
3723
3724 fn from_inner(
3725 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3726 is_terminated: bool,
3727 ) -> Self {
3728 Self { inner, is_terminated }
3729 }
3730}
3731
3732impl futures::Stream for StackProviderRequestStream {
3733 type Item = Result<StackProviderRequest, fidl::Error>;
3734
3735 fn poll_next(
3736 mut self: std::pin::Pin<&mut Self>,
3737 cx: &mut std::task::Context<'_>,
3738 ) -> std::task::Poll<Option<Self::Item>> {
3739 let this = &mut *self;
3740 if this.inner.check_shutdown(cx) {
3741 this.is_terminated = true;
3742 return std::task::Poll::Ready(None);
3743 }
3744 if this.is_terminated {
3745 panic!("polled StackProviderRequestStream after completion");
3746 }
3747 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3748 |bytes, handles| {
3749 match this.inner.channel().read_etc(cx, bytes, handles) {
3750 std::task::Poll::Ready(Ok(())) => {}
3751 std::task::Poll::Pending => return std::task::Poll::Pending,
3752 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3753 this.is_terminated = true;
3754 return std::task::Poll::Ready(None);
3755 }
3756 std::task::Poll::Ready(Err(e)) => {
3757 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3758 e.into(),
3759 ))))
3760 }
3761 }
3762
3763 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3765
3766 std::task::Poll::Ready(Some(match header.ordinal {
3767 0x60f817738f6028b4 => {
3768 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3769 let mut req = fidl::new_empty!(
3770 StackProviderSetWlanNetworkConfigProviderRequest,
3771 fidl::encoding::DefaultFuchsiaResourceDialect
3772 );
3773 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StackProviderSetWlanNetworkConfigProviderRequest>(&header, _body_bytes, handles, &mut req)?;
3774 let control_handle =
3775 StackProviderControlHandle { inner: this.inner.clone() };
3776 Ok(StackProviderRequest::SetWlanNetworkConfigProvider {
3777 provider: req.provider,
3778
3779 control_handle,
3780 })
3781 }
3782 _ => Err(fidl::Error::UnknownOrdinal {
3783 ordinal: header.ordinal,
3784 protocol_name:
3785 <StackProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3786 }),
3787 }))
3788 },
3789 )
3790 }
3791}
3792
3793#[derive(Debug)]
3795pub enum StackProviderRequest {
3796 SetWlanNetworkConfigProvider {
3806 provider: fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
3807 control_handle: StackProviderControlHandle,
3808 },
3809}
3810
3811impl StackProviderRequest {
3812 #[allow(irrefutable_let_patterns)]
3813 pub fn into_set_wlan_network_config_provider(
3814 self,
3815 ) -> Option<(
3816 fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
3817 StackProviderControlHandle,
3818 )> {
3819 if let StackProviderRequest::SetWlanNetworkConfigProvider { provider, control_handle } =
3820 self
3821 {
3822 Some((provider, control_handle))
3823 } else {
3824 None
3825 }
3826 }
3827
3828 pub fn method_name(&self) -> &'static str {
3830 match *self {
3831 StackProviderRequest::SetWlanNetworkConfigProvider { .. } => {
3832 "set_wlan_network_config_provider"
3833 }
3834 }
3835 }
3836}
3837
3838#[derive(Debug, Clone)]
3839pub struct StackProviderControlHandle {
3840 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3841}
3842
3843impl fidl::endpoints::ControlHandle for StackProviderControlHandle {
3844 fn shutdown(&self) {
3845 self.inner.shutdown()
3846 }
3847 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3848 self.inner.shutdown_with_epitaph(status)
3849 }
3850
3851 fn is_closed(&self) -> bool {
3852 self.inner.channel().is_closed()
3853 }
3854 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3855 self.inner.channel().on_closed()
3856 }
3857
3858 #[cfg(target_os = "fuchsia")]
3859 fn signal_peer(
3860 &self,
3861 clear_mask: zx::Signals,
3862 set_mask: zx::Signals,
3863 ) -> Result<(), zx_status::Status> {
3864 use fidl::Peered;
3865 self.inner.channel().signal_peer(clear_mask, set_mask)
3866 }
3867}
3868
3869impl StackProviderControlHandle {}
3870
3871#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3872pub struct SvcDirectoryWatcherMarker;
3873
3874impl fidl::endpoints::ProtocolMarker for SvcDirectoryWatcherMarker {
3875 type Proxy = SvcDirectoryWatcherProxy;
3876 type RequestStream = SvcDirectoryWatcherRequestStream;
3877 #[cfg(target_os = "fuchsia")]
3878 type SynchronousProxy = SvcDirectoryWatcherSynchronousProxy;
3879
3880 const DEBUG_NAME: &'static str = "(anonymous) SvcDirectoryWatcher";
3881}
3882
3883pub trait SvcDirectoryWatcherProxyInterface: Send + Sync {
3884 type WatchServiceDirectoryResponseFut: std::future::Future<Output = Result<Vec<HostPort>, fidl::Error>>
3885 + Send;
3886 fn r#watch_service_directory(&self) -> Self::WatchServiceDirectoryResponseFut;
3887}
3888#[derive(Debug)]
3889#[cfg(target_os = "fuchsia")]
3890pub struct SvcDirectoryWatcherSynchronousProxy {
3891 client: fidl::client::sync::Client,
3892}
3893
3894#[cfg(target_os = "fuchsia")]
3895impl fidl::endpoints::SynchronousProxy for SvcDirectoryWatcherSynchronousProxy {
3896 type Proxy = SvcDirectoryWatcherProxy;
3897 type Protocol = SvcDirectoryWatcherMarker;
3898
3899 fn from_channel(inner: fidl::Channel) -> Self {
3900 Self::new(inner)
3901 }
3902
3903 fn into_channel(self) -> fidl::Channel {
3904 self.client.into_channel()
3905 }
3906
3907 fn as_channel(&self) -> &fidl::Channel {
3908 self.client.as_channel()
3909 }
3910}
3911
3912#[cfg(target_os = "fuchsia")]
3913impl SvcDirectoryWatcherSynchronousProxy {
3914 pub fn new(channel: fidl::Channel) -> Self {
3915 let protocol_name =
3916 <SvcDirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3917 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3918 }
3919
3920 pub fn into_channel(self) -> fidl::Channel {
3921 self.client.into_channel()
3922 }
3923
3924 pub fn wait_for_event(
3927 &self,
3928 deadline: zx::MonotonicInstant,
3929 ) -> Result<SvcDirectoryWatcherEvent, fidl::Error> {
3930 SvcDirectoryWatcherEvent::decode(self.client.wait_for_event(deadline)?)
3931 }
3932
3933 pub fn r#watch_service_directory(
3943 &self,
3944 ___deadline: zx::MonotonicInstant,
3945 ) -> Result<Vec<HostPort>, fidl::Error> {
3946 let _response = self.client.send_query::<
3947 fidl::encoding::EmptyPayload,
3948 SvcDirectoryWatcherWatchServiceDirectoryResponse,
3949 >(
3950 (),
3951 0x4c1000286a01a142,
3952 fidl::encoding::DynamicFlags::empty(),
3953 ___deadline,
3954 )?;
3955 Ok(_response.host_port_list)
3956 }
3957}
3958
3959#[cfg(target_os = "fuchsia")]
3960impl From<SvcDirectoryWatcherSynchronousProxy> for zx::Handle {
3961 fn from(value: SvcDirectoryWatcherSynchronousProxy) -> Self {
3962 value.into_channel().into()
3963 }
3964}
3965
3966#[cfg(target_os = "fuchsia")]
3967impl From<fidl::Channel> for SvcDirectoryWatcherSynchronousProxy {
3968 fn from(value: fidl::Channel) -> Self {
3969 Self::new(value)
3970 }
3971}
3972
3973#[derive(Debug, Clone)]
3974pub struct SvcDirectoryWatcherProxy {
3975 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3976}
3977
3978impl fidl::endpoints::Proxy for SvcDirectoryWatcherProxy {
3979 type Protocol = SvcDirectoryWatcherMarker;
3980
3981 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3982 Self::new(inner)
3983 }
3984
3985 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3986 self.client.into_channel().map_err(|client| Self { client })
3987 }
3988
3989 fn as_channel(&self) -> &::fidl::AsyncChannel {
3990 self.client.as_channel()
3991 }
3992}
3993
3994impl SvcDirectoryWatcherProxy {
3995 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3997 let protocol_name =
3998 <SvcDirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3999 Self { client: fidl::client::Client::new(channel, protocol_name) }
4000 }
4001
4002 pub fn take_event_stream(&self) -> SvcDirectoryWatcherEventStream {
4008 SvcDirectoryWatcherEventStream { event_receiver: self.client.take_event_receiver() }
4009 }
4010
4011 pub fn r#watch_service_directory(
4021 &self,
4022 ) -> fidl::client::QueryResponseFut<Vec<HostPort>, fidl::encoding::DefaultFuchsiaResourceDialect>
4023 {
4024 SvcDirectoryWatcherProxyInterface::r#watch_service_directory(self)
4025 }
4026}
4027
4028impl SvcDirectoryWatcherProxyInterface for SvcDirectoryWatcherProxy {
4029 type WatchServiceDirectoryResponseFut = fidl::client::QueryResponseFut<
4030 Vec<HostPort>,
4031 fidl::encoding::DefaultFuchsiaResourceDialect,
4032 >;
4033 fn r#watch_service_directory(&self) -> Self::WatchServiceDirectoryResponseFut {
4034 fn _decode(
4035 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4036 ) -> Result<Vec<HostPort>, fidl::Error> {
4037 let _response = fidl::client::decode_transaction_body::<
4038 SvcDirectoryWatcherWatchServiceDirectoryResponse,
4039 fidl::encoding::DefaultFuchsiaResourceDialect,
4040 0x4c1000286a01a142,
4041 >(_buf?)?;
4042 Ok(_response.host_port_list)
4043 }
4044 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<HostPort>>(
4045 (),
4046 0x4c1000286a01a142,
4047 fidl::encoding::DynamicFlags::empty(),
4048 _decode,
4049 )
4050 }
4051}
4052
4053pub struct SvcDirectoryWatcherEventStream {
4054 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4055}
4056
4057impl std::marker::Unpin for SvcDirectoryWatcherEventStream {}
4058
4059impl futures::stream::FusedStream for SvcDirectoryWatcherEventStream {
4060 fn is_terminated(&self) -> bool {
4061 self.event_receiver.is_terminated()
4062 }
4063}
4064
4065impl futures::Stream for SvcDirectoryWatcherEventStream {
4066 type Item = Result<SvcDirectoryWatcherEvent, fidl::Error>;
4067
4068 fn poll_next(
4069 mut self: std::pin::Pin<&mut Self>,
4070 cx: &mut std::task::Context<'_>,
4071 ) -> std::task::Poll<Option<Self::Item>> {
4072 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4073 &mut self.event_receiver,
4074 cx
4075 )?) {
4076 Some(buf) => std::task::Poll::Ready(Some(SvcDirectoryWatcherEvent::decode(buf))),
4077 None => std::task::Poll::Ready(None),
4078 }
4079 }
4080}
4081
4082#[derive(Debug)]
4083pub enum SvcDirectoryWatcherEvent {}
4084
4085impl SvcDirectoryWatcherEvent {
4086 fn decode(
4088 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4089 ) -> Result<SvcDirectoryWatcherEvent, fidl::Error> {
4090 let (bytes, _handles) = buf.split_mut();
4091 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4092 debug_assert_eq!(tx_header.tx_id, 0);
4093 match tx_header.ordinal {
4094 _ => Err(fidl::Error::UnknownOrdinal {
4095 ordinal: tx_header.ordinal,
4096 protocol_name:
4097 <SvcDirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4098 }),
4099 }
4100 }
4101}
4102
4103pub struct SvcDirectoryWatcherRequestStream {
4105 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4106 is_terminated: bool,
4107}
4108
4109impl std::marker::Unpin for SvcDirectoryWatcherRequestStream {}
4110
4111impl futures::stream::FusedStream for SvcDirectoryWatcherRequestStream {
4112 fn is_terminated(&self) -> bool {
4113 self.is_terminated
4114 }
4115}
4116
4117impl fidl::endpoints::RequestStream for SvcDirectoryWatcherRequestStream {
4118 type Protocol = SvcDirectoryWatcherMarker;
4119 type ControlHandle = SvcDirectoryWatcherControlHandle;
4120
4121 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4122 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4123 }
4124
4125 fn control_handle(&self) -> Self::ControlHandle {
4126 SvcDirectoryWatcherControlHandle { inner: self.inner.clone() }
4127 }
4128
4129 fn into_inner(
4130 self,
4131 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4132 {
4133 (self.inner, self.is_terminated)
4134 }
4135
4136 fn from_inner(
4137 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4138 is_terminated: bool,
4139 ) -> Self {
4140 Self { inner, is_terminated }
4141 }
4142}
4143
4144impl futures::Stream for SvcDirectoryWatcherRequestStream {
4145 type Item = Result<SvcDirectoryWatcherRequest, fidl::Error>;
4146
4147 fn poll_next(
4148 mut self: std::pin::Pin<&mut Self>,
4149 cx: &mut std::task::Context<'_>,
4150 ) -> std::task::Poll<Option<Self::Item>> {
4151 let this = &mut *self;
4152 if this.inner.check_shutdown(cx) {
4153 this.is_terminated = true;
4154 return std::task::Poll::Ready(None);
4155 }
4156 if this.is_terminated {
4157 panic!("polled SvcDirectoryWatcherRequestStream after completion");
4158 }
4159 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4160 |bytes, handles| {
4161 match this.inner.channel().read_etc(cx, bytes, handles) {
4162 std::task::Poll::Ready(Ok(())) => {}
4163 std::task::Poll::Pending => return std::task::Poll::Pending,
4164 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4165 this.is_terminated = true;
4166 return std::task::Poll::Ready(None);
4167 }
4168 std::task::Poll::Ready(Err(e)) => {
4169 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4170 e.into(),
4171 ))))
4172 }
4173 }
4174
4175 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4177
4178 std::task::Poll::Ready(Some(match header.ordinal {
4179 0x4c1000286a01a142 => {
4180 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4181 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4182 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4183 let control_handle = SvcDirectoryWatcherControlHandle {
4184 inner: this.inner.clone(),
4185 };
4186 Ok(SvcDirectoryWatcherRequest::WatchServiceDirectory {
4187 responder: SvcDirectoryWatcherWatchServiceDirectoryResponder {
4188 control_handle: std::mem::ManuallyDrop::new(control_handle),
4189 tx_id: header.tx_id,
4190 },
4191 })
4192 }
4193 _ => Err(fidl::Error::UnknownOrdinal {
4194 ordinal: header.ordinal,
4195 protocol_name: <SvcDirectoryWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4196 }),
4197 }))
4198 },
4199 )
4200 }
4201}
4202
4203#[derive(Debug)]
4207pub enum SvcDirectoryWatcherRequest {
4208 WatchServiceDirectory { responder: SvcDirectoryWatcherWatchServiceDirectoryResponder },
4218}
4219
4220impl SvcDirectoryWatcherRequest {
4221 #[allow(irrefutable_let_patterns)]
4222 pub fn into_watch_service_directory(
4223 self,
4224 ) -> Option<(SvcDirectoryWatcherWatchServiceDirectoryResponder)> {
4225 if let SvcDirectoryWatcherRequest::WatchServiceDirectory { responder } = self {
4226 Some((responder))
4227 } else {
4228 None
4229 }
4230 }
4231
4232 pub fn method_name(&self) -> &'static str {
4234 match *self {
4235 SvcDirectoryWatcherRequest::WatchServiceDirectory { .. } => "watch_service_directory",
4236 }
4237 }
4238}
4239
4240#[derive(Debug, Clone)]
4241pub struct SvcDirectoryWatcherControlHandle {
4242 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4243}
4244
4245impl fidl::endpoints::ControlHandle for SvcDirectoryWatcherControlHandle {
4246 fn shutdown(&self) {
4247 self.inner.shutdown()
4248 }
4249 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4250 self.inner.shutdown_with_epitaph(status)
4251 }
4252
4253 fn is_closed(&self) -> bool {
4254 self.inner.channel().is_closed()
4255 }
4256 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4257 self.inner.channel().on_closed()
4258 }
4259
4260 #[cfg(target_os = "fuchsia")]
4261 fn signal_peer(
4262 &self,
4263 clear_mask: zx::Signals,
4264 set_mask: zx::Signals,
4265 ) -> Result<(), zx_status::Status> {
4266 use fidl::Peered;
4267 self.inner.channel().signal_peer(clear_mask, set_mask)
4268 }
4269}
4270
4271impl SvcDirectoryWatcherControlHandle {}
4272
4273#[must_use = "FIDL methods require a response to be sent"]
4274#[derive(Debug)]
4275pub struct SvcDirectoryWatcherWatchServiceDirectoryResponder {
4276 control_handle: std::mem::ManuallyDrop<SvcDirectoryWatcherControlHandle>,
4277 tx_id: u32,
4278}
4279
4280impl std::ops::Drop for SvcDirectoryWatcherWatchServiceDirectoryResponder {
4284 fn drop(&mut self) {
4285 self.control_handle.shutdown();
4286 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4288 }
4289}
4290
4291impl fidl::endpoints::Responder for SvcDirectoryWatcherWatchServiceDirectoryResponder {
4292 type ControlHandle = SvcDirectoryWatcherControlHandle;
4293
4294 fn control_handle(&self) -> &SvcDirectoryWatcherControlHandle {
4295 &self.control_handle
4296 }
4297
4298 fn drop_without_shutdown(mut self) {
4299 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4301 std::mem::forget(self);
4303 }
4304}
4305
4306impl SvcDirectoryWatcherWatchServiceDirectoryResponder {
4307 pub fn send(self, mut host_port_list: &[HostPort]) -> Result<(), fidl::Error> {
4311 let _result = self.send_raw(host_port_list);
4312 if _result.is_err() {
4313 self.control_handle.shutdown();
4314 }
4315 self.drop_without_shutdown();
4316 _result
4317 }
4318
4319 pub fn send_no_shutdown_on_err(
4321 self,
4322 mut host_port_list: &[HostPort],
4323 ) -> Result<(), fidl::Error> {
4324 let _result = self.send_raw(host_port_list);
4325 self.drop_without_shutdown();
4326 _result
4327 }
4328
4329 fn send_raw(&self, mut host_port_list: &[HostPort]) -> Result<(), fidl::Error> {
4330 self.control_handle.inner.send::<SvcDirectoryWatcherWatchServiceDirectoryResponse>(
4331 (host_port_list,),
4332 self.tx_id,
4333 0x4c1000286a01a142,
4334 fidl::encoding::DynamicFlags::empty(),
4335 )
4336 }
4337}
4338
4339#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4340pub struct WlanNetworkConfigProviderMarker;
4341
4342impl fidl::endpoints::ProtocolMarker for WlanNetworkConfigProviderMarker {
4343 type Proxy = WlanNetworkConfigProviderProxy;
4344 type RequestStream = WlanNetworkConfigProviderRequestStream;
4345 #[cfg(target_os = "fuchsia")]
4346 type SynchronousProxy = WlanNetworkConfigProviderSynchronousProxy;
4347
4348 const DEBUG_NAME: &'static str = "(anonymous) WlanNetworkConfigProvider";
4349}
4350
4351pub trait WlanNetworkConfigProviderProxyInterface: Send + Sync {
4352 type WatchConnectedNetworkResponseFut: std::future::Future<Output = Result<fidl_fuchsia_wlan_policy::NetworkConfig, fidl::Error>>
4353 + Send;
4354 fn r#watch_connected_network(&self) -> Self::WatchConnectedNetworkResponseFut;
4355}
4356#[derive(Debug)]
4357#[cfg(target_os = "fuchsia")]
4358pub struct WlanNetworkConfigProviderSynchronousProxy {
4359 client: fidl::client::sync::Client,
4360}
4361
4362#[cfg(target_os = "fuchsia")]
4363impl fidl::endpoints::SynchronousProxy for WlanNetworkConfigProviderSynchronousProxy {
4364 type Proxy = WlanNetworkConfigProviderProxy;
4365 type Protocol = WlanNetworkConfigProviderMarker;
4366
4367 fn from_channel(inner: fidl::Channel) -> Self {
4368 Self::new(inner)
4369 }
4370
4371 fn into_channel(self) -> fidl::Channel {
4372 self.client.into_channel()
4373 }
4374
4375 fn as_channel(&self) -> &fidl::Channel {
4376 self.client.as_channel()
4377 }
4378}
4379
4380#[cfg(target_os = "fuchsia")]
4381impl WlanNetworkConfigProviderSynchronousProxy {
4382 pub fn new(channel: fidl::Channel) -> Self {
4383 let protocol_name =
4384 <WlanNetworkConfigProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4385 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4386 }
4387
4388 pub fn into_channel(self) -> fidl::Channel {
4389 self.client.into_channel()
4390 }
4391
4392 pub fn wait_for_event(
4395 &self,
4396 deadline: zx::MonotonicInstant,
4397 ) -> Result<WlanNetworkConfigProviderEvent, fidl::Error> {
4398 WlanNetworkConfigProviderEvent::decode(self.client.wait_for_event(deadline)?)
4399 }
4400
4401 pub fn r#watch_connected_network(
4407 &self,
4408 ___deadline: zx::MonotonicInstant,
4409 ) -> Result<fidl_fuchsia_wlan_policy::NetworkConfig, fidl::Error> {
4410 let _response = self.client.send_query::<
4411 fidl::encoding::EmptyPayload,
4412 WlanNetworkConfigProviderWatchConnectedNetworkResponse,
4413 >(
4414 (),
4415 0x966c5bf4d6dfce1,
4416 fidl::encoding::DynamicFlags::empty(),
4417 ___deadline,
4418 )?;
4419 Ok(_response.network_config)
4420 }
4421}
4422
4423#[cfg(target_os = "fuchsia")]
4424impl From<WlanNetworkConfigProviderSynchronousProxy> for zx::Handle {
4425 fn from(value: WlanNetworkConfigProviderSynchronousProxy) -> Self {
4426 value.into_channel().into()
4427 }
4428}
4429
4430#[cfg(target_os = "fuchsia")]
4431impl From<fidl::Channel> for WlanNetworkConfigProviderSynchronousProxy {
4432 fn from(value: fidl::Channel) -> Self {
4433 Self::new(value)
4434 }
4435}
4436
4437#[derive(Debug, Clone)]
4438pub struct WlanNetworkConfigProviderProxy {
4439 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4440}
4441
4442impl fidl::endpoints::Proxy for WlanNetworkConfigProviderProxy {
4443 type Protocol = WlanNetworkConfigProviderMarker;
4444
4445 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4446 Self::new(inner)
4447 }
4448
4449 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4450 self.client.into_channel().map_err(|client| Self { client })
4451 }
4452
4453 fn as_channel(&self) -> &::fidl::AsyncChannel {
4454 self.client.as_channel()
4455 }
4456}
4457
4458impl WlanNetworkConfigProviderProxy {
4459 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4461 let protocol_name =
4462 <WlanNetworkConfigProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4463 Self { client: fidl::client::Client::new(channel, protocol_name) }
4464 }
4465
4466 pub fn take_event_stream(&self) -> WlanNetworkConfigProviderEventStream {
4472 WlanNetworkConfigProviderEventStream { event_receiver: self.client.take_event_receiver() }
4473 }
4474
4475 pub fn r#watch_connected_network(
4481 &self,
4482 ) -> fidl::client::QueryResponseFut<
4483 fidl_fuchsia_wlan_policy::NetworkConfig,
4484 fidl::encoding::DefaultFuchsiaResourceDialect,
4485 > {
4486 WlanNetworkConfigProviderProxyInterface::r#watch_connected_network(self)
4487 }
4488}
4489
4490impl WlanNetworkConfigProviderProxyInterface for WlanNetworkConfigProviderProxy {
4491 type WatchConnectedNetworkResponseFut = fidl::client::QueryResponseFut<
4492 fidl_fuchsia_wlan_policy::NetworkConfig,
4493 fidl::encoding::DefaultFuchsiaResourceDialect,
4494 >;
4495 fn r#watch_connected_network(&self) -> Self::WatchConnectedNetworkResponseFut {
4496 fn _decode(
4497 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4498 ) -> Result<fidl_fuchsia_wlan_policy::NetworkConfig, fidl::Error> {
4499 let _response = fidl::client::decode_transaction_body::<
4500 WlanNetworkConfigProviderWatchConnectedNetworkResponse,
4501 fidl::encoding::DefaultFuchsiaResourceDialect,
4502 0x966c5bf4d6dfce1,
4503 >(_buf?)?;
4504 Ok(_response.network_config)
4505 }
4506 self.client.send_query_and_decode::<
4507 fidl::encoding::EmptyPayload,
4508 fidl_fuchsia_wlan_policy::NetworkConfig,
4509 >(
4510 (),
4511 0x966c5bf4d6dfce1,
4512 fidl::encoding::DynamicFlags::empty(),
4513 _decode,
4514 )
4515 }
4516}
4517
4518pub struct WlanNetworkConfigProviderEventStream {
4519 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4520}
4521
4522impl std::marker::Unpin for WlanNetworkConfigProviderEventStream {}
4523
4524impl futures::stream::FusedStream for WlanNetworkConfigProviderEventStream {
4525 fn is_terminated(&self) -> bool {
4526 self.event_receiver.is_terminated()
4527 }
4528}
4529
4530impl futures::Stream for WlanNetworkConfigProviderEventStream {
4531 type Item = Result<WlanNetworkConfigProviderEvent, fidl::Error>;
4532
4533 fn poll_next(
4534 mut self: std::pin::Pin<&mut Self>,
4535 cx: &mut std::task::Context<'_>,
4536 ) -> std::task::Poll<Option<Self::Item>> {
4537 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4538 &mut self.event_receiver,
4539 cx
4540 )?) {
4541 Some(buf) => std::task::Poll::Ready(Some(WlanNetworkConfigProviderEvent::decode(buf))),
4542 None => std::task::Poll::Ready(None),
4543 }
4544 }
4545}
4546
4547#[derive(Debug)]
4548pub enum WlanNetworkConfigProviderEvent {}
4549
4550impl WlanNetworkConfigProviderEvent {
4551 fn decode(
4553 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4554 ) -> Result<WlanNetworkConfigProviderEvent, fidl::Error> {
4555 let (bytes, _handles) = buf.split_mut();
4556 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4557 debug_assert_eq!(tx_header.tx_id, 0);
4558 match tx_header.ordinal {
4559 _ => Err(fidl::Error::UnknownOrdinal {
4560 ordinal: tx_header.ordinal,
4561 protocol_name:
4562 <WlanNetworkConfigProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4563 }),
4564 }
4565 }
4566}
4567
4568pub struct WlanNetworkConfigProviderRequestStream {
4570 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4571 is_terminated: bool,
4572}
4573
4574impl std::marker::Unpin for WlanNetworkConfigProviderRequestStream {}
4575
4576impl futures::stream::FusedStream for WlanNetworkConfigProviderRequestStream {
4577 fn is_terminated(&self) -> bool {
4578 self.is_terminated
4579 }
4580}
4581
4582impl fidl::endpoints::RequestStream for WlanNetworkConfigProviderRequestStream {
4583 type Protocol = WlanNetworkConfigProviderMarker;
4584 type ControlHandle = WlanNetworkConfigProviderControlHandle;
4585
4586 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4587 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4588 }
4589
4590 fn control_handle(&self) -> Self::ControlHandle {
4591 WlanNetworkConfigProviderControlHandle { inner: self.inner.clone() }
4592 }
4593
4594 fn into_inner(
4595 self,
4596 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4597 {
4598 (self.inner, self.is_terminated)
4599 }
4600
4601 fn from_inner(
4602 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4603 is_terminated: bool,
4604 ) -> Self {
4605 Self { inner, is_terminated }
4606 }
4607}
4608
4609impl futures::Stream for WlanNetworkConfigProviderRequestStream {
4610 type Item = Result<WlanNetworkConfigProviderRequest, fidl::Error>;
4611
4612 fn poll_next(
4613 mut self: std::pin::Pin<&mut Self>,
4614 cx: &mut std::task::Context<'_>,
4615 ) -> std::task::Poll<Option<Self::Item>> {
4616 let this = &mut *self;
4617 if this.inner.check_shutdown(cx) {
4618 this.is_terminated = true;
4619 return std::task::Poll::Ready(None);
4620 }
4621 if this.is_terminated {
4622 panic!("polled WlanNetworkConfigProviderRequestStream after completion");
4623 }
4624 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4625 |bytes, handles| {
4626 match this.inner.channel().read_etc(cx, bytes, handles) {
4627 std::task::Poll::Ready(Ok(())) => {}
4628 std::task::Poll::Pending => return std::task::Poll::Pending,
4629 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4630 this.is_terminated = true;
4631 return std::task::Poll::Ready(None);
4632 }
4633 std::task::Poll::Ready(Err(e)) => {
4634 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4635 e.into(),
4636 ))))
4637 }
4638 }
4639
4640 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4642
4643 std::task::Poll::Ready(Some(match header.ordinal {
4644 0x966c5bf4d6dfce1 => {
4645 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4646 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4647 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4648 let control_handle = WlanNetworkConfigProviderControlHandle {
4649 inner: this.inner.clone(),
4650 };
4651 Ok(WlanNetworkConfigProviderRequest::WatchConnectedNetwork {
4652 responder: WlanNetworkConfigProviderWatchConnectedNetworkResponder {
4653 control_handle: std::mem::ManuallyDrop::new(control_handle),
4654 tx_id: header.tx_id,
4655 },
4656 })
4657 }
4658 _ => Err(fidl::Error::UnknownOrdinal {
4659 ordinal: header.ordinal,
4660 protocol_name: <WlanNetworkConfigProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4661 }),
4662 }))
4663 },
4664 )
4665 }
4666}
4667
4668#[derive(Debug)]
4671pub enum WlanNetworkConfigProviderRequest {
4672 WatchConnectedNetwork { responder: WlanNetworkConfigProviderWatchConnectedNetworkResponder },
4678}
4679
4680impl WlanNetworkConfigProviderRequest {
4681 #[allow(irrefutable_let_patterns)]
4682 pub fn into_watch_connected_network(
4683 self,
4684 ) -> Option<(WlanNetworkConfigProviderWatchConnectedNetworkResponder)> {
4685 if let WlanNetworkConfigProviderRequest::WatchConnectedNetwork { responder } = self {
4686 Some((responder))
4687 } else {
4688 None
4689 }
4690 }
4691
4692 pub fn method_name(&self) -> &'static str {
4694 match *self {
4695 WlanNetworkConfigProviderRequest::WatchConnectedNetwork { .. } => {
4696 "watch_connected_network"
4697 }
4698 }
4699 }
4700}
4701
4702#[derive(Debug, Clone)]
4703pub struct WlanNetworkConfigProviderControlHandle {
4704 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4705}
4706
4707impl fidl::endpoints::ControlHandle for WlanNetworkConfigProviderControlHandle {
4708 fn shutdown(&self) {
4709 self.inner.shutdown()
4710 }
4711 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4712 self.inner.shutdown_with_epitaph(status)
4713 }
4714
4715 fn is_closed(&self) -> bool {
4716 self.inner.channel().is_closed()
4717 }
4718 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4719 self.inner.channel().on_closed()
4720 }
4721
4722 #[cfg(target_os = "fuchsia")]
4723 fn signal_peer(
4724 &self,
4725 clear_mask: zx::Signals,
4726 set_mask: zx::Signals,
4727 ) -> Result<(), zx_status::Status> {
4728 use fidl::Peered;
4729 self.inner.channel().signal_peer(clear_mask, set_mask)
4730 }
4731}
4732
4733impl WlanNetworkConfigProviderControlHandle {}
4734
4735#[must_use = "FIDL methods require a response to be sent"]
4736#[derive(Debug)]
4737pub struct WlanNetworkConfigProviderWatchConnectedNetworkResponder {
4738 control_handle: std::mem::ManuallyDrop<WlanNetworkConfigProviderControlHandle>,
4739 tx_id: u32,
4740}
4741
4742impl std::ops::Drop for WlanNetworkConfigProviderWatchConnectedNetworkResponder {
4746 fn drop(&mut self) {
4747 self.control_handle.shutdown();
4748 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4750 }
4751}
4752
4753impl fidl::endpoints::Responder for WlanNetworkConfigProviderWatchConnectedNetworkResponder {
4754 type ControlHandle = WlanNetworkConfigProviderControlHandle;
4755
4756 fn control_handle(&self) -> &WlanNetworkConfigProviderControlHandle {
4757 &self.control_handle
4758 }
4759
4760 fn drop_without_shutdown(mut self) {
4761 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4763 std::mem::forget(self);
4765 }
4766}
4767
4768impl WlanNetworkConfigProviderWatchConnectedNetworkResponder {
4769 pub fn send(
4773 self,
4774 mut network_config: &fidl_fuchsia_wlan_policy::NetworkConfig,
4775 ) -> Result<(), fidl::Error> {
4776 let _result = self.send_raw(network_config);
4777 if _result.is_err() {
4778 self.control_handle.shutdown();
4779 }
4780 self.drop_without_shutdown();
4781 _result
4782 }
4783
4784 pub fn send_no_shutdown_on_err(
4786 self,
4787 mut network_config: &fidl_fuchsia_wlan_policy::NetworkConfig,
4788 ) -> Result<(), fidl::Error> {
4789 let _result = self.send_raw(network_config);
4790 self.drop_without_shutdown();
4791 _result
4792 }
4793
4794 fn send_raw(
4795 &self,
4796 mut network_config: &fidl_fuchsia_wlan_policy::NetworkConfig,
4797 ) -> Result<(), fidl::Error> {
4798 self.control_handle.inner.send::<WlanNetworkConfigProviderWatchConnectedNetworkResponse>(
4799 (network_config,),
4800 self.tx_id,
4801 0x966c5bf4d6dfce1,
4802 fidl::encoding::DynamicFlags::empty(),
4803 )
4804 }
4805}
4806
4807mod internal {
4808 use super::*;
4809
4810 impl fidl::encoding::ResourceTypeMarker for BootstrapImportWeaveConfigRequest {
4811 type Borrowed<'a> = &'a mut Self;
4812 fn take_or_borrow<'a>(
4813 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4814 ) -> Self::Borrowed<'a> {
4815 value
4816 }
4817 }
4818
4819 unsafe impl fidl::encoding::TypeMarker for BootstrapImportWeaveConfigRequest {
4820 type Owned = Self;
4821
4822 #[inline(always)]
4823 fn inline_align(_context: fidl::encoding::Context) -> usize {
4824 8
4825 }
4826
4827 #[inline(always)]
4828 fn inline_size(_context: fidl::encoding::Context) -> usize {
4829 16
4830 }
4831 }
4832
4833 unsafe impl
4834 fidl::encoding::Encode<
4835 BootstrapImportWeaveConfigRequest,
4836 fidl::encoding::DefaultFuchsiaResourceDialect,
4837 > for &mut BootstrapImportWeaveConfigRequest
4838 {
4839 #[inline]
4840 unsafe fn encode(
4841 self,
4842 encoder: &mut fidl::encoding::Encoder<
4843 '_,
4844 fidl::encoding::DefaultFuchsiaResourceDialect,
4845 >,
4846 offset: usize,
4847 _depth: fidl::encoding::Depth,
4848 ) -> fidl::Result<()> {
4849 encoder.debug_check_bounds::<BootstrapImportWeaveConfigRequest>(offset);
4850 fidl::encoding::Encode::<
4852 BootstrapImportWeaveConfigRequest,
4853 fidl::encoding::DefaultFuchsiaResourceDialect,
4854 >::encode(
4855 (<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4856 &mut self.config_json,
4857 ),),
4858 encoder,
4859 offset,
4860 _depth,
4861 )
4862 }
4863 }
4864 unsafe impl<
4865 T0: fidl::encoding::Encode<
4866 fidl_fuchsia_mem::Buffer,
4867 fidl::encoding::DefaultFuchsiaResourceDialect,
4868 >,
4869 >
4870 fidl::encoding::Encode<
4871 BootstrapImportWeaveConfigRequest,
4872 fidl::encoding::DefaultFuchsiaResourceDialect,
4873 > for (T0,)
4874 {
4875 #[inline]
4876 unsafe fn encode(
4877 self,
4878 encoder: &mut fidl::encoding::Encoder<
4879 '_,
4880 fidl::encoding::DefaultFuchsiaResourceDialect,
4881 >,
4882 offset: usize,
4883 depth: fidl::encoding::Depth,
4884 ) -> fidl::Result<()> {
4885 encoder.debug_check_bounds::<BootstrapImportWeaveConfigRequest>(offset);
4886 self.0.encode(encoder, offset + 0, depth)?;
4890 Ok(())
4891 }
4892 }
4893
4894 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4895 for BootstrapImportWeaveConfigRequest
4896 {
4897 #[inline(always)]
4898 fn new_empty() -> Self {
4899 Self {
4900 config_json: fidl::new_empty!(
4901 fidl_fuchsia_mem::Buffer,
4902 fidl::encoding::DefaultFuchsiaResourceDialect
4903 ),
4904 }
4905 }
4906
4907 #[inline]
4908 unsafe fn decode(
4909 &mut self,
4910 decoder: &mut fidl::encoding::Decoder<
4911 '_,
4912 fidl::encoding::DefaultFuchsiaResourceDialect,
4913 >,
4914 offset: usize,
4915 _depth: fidl::encoding::Depth,
4916 ) -> fidl::Result<()> {
4917 decoder.debug_check_bounds::<Self>(offset);
4918 fidl::decode!(
4920 fidl_fuchsia_mem::Buffer,
4921 fidl::encoding::DefaultFuchsiaResourceDialect,
4922 &mut self.config_json,
4923 decoder,
4924 offset + 0,
4925 _depth
4926 )?;
4927 Ok(())
4928 }
4929 }
4930
4931 impl fidl::encoding::ResourceTypeMarker for FactoryDataManagerGetWeaveCertificateResponse {
4932 type Borrowed<'a> = &'a mut Self;
4933 fn take_or_borrow<'a>(
4934 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4935 ) -> Self::Borrowed<'a> {
4936 value
4937 }
4938 }
4939
4940 unsafe impl fidl::encoding::TypeMarker for FactoryDataManagerGetWeaveCertificateResponse {
4941 type Owned = Self;
4942
4943 #[inline(always)]
4944 fn inline_align(_context: fidl::encoding::Context) -> usize {
4945 8
4946 }
4947
4948 #[inline(always)]
4949 fn inline_size(_context: fidl::encoding::Context) -> usize {
4950 16
4951 }
4952 }
4953
4954 unsafe impl
4955 fidl::encoding::Encode<
4956 FactoryDataManagerGetWeaveCertificateResponse,
4957 fidl::encoding::DefaultFuchsiaResourceDialect,
4958 > for &mut FactoryDataManagerGetWeaveCertificateResponse
4959 {
4960 #[inline]
4961 unsafe fn encode(
4962 self,
4963 encoder: &mut fidl::encoding::Encoder<
4964 '_,
4965 fidl::encoding::DefaultFuchsiaResourceDialect,
4966 >,
4967 offset: usize,
4968 _depth: fidl::encoding::Depth,
4969 ) -> fidl::Result<()> {
4970 encoder.debug_check_bounds::<FactoryDataManagerGetWeaveCertificateResponse>(offset);
4971 fidl::encoding::Encode::<
4973 FactoryDataManagerGetWeaveCertificateResponse,
4974 fidl::encoding::DefaultFuchsiaResourceDialect,
4975 >::encode(
4976 (<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4977 &mut self.certificate,
4978 ),),
4979 encoder,
4980 offset,
4981 _depth,
4982 )
4983 }
4984 }
4985 unsafe impl<
4986 T0: fidl::encoding::Encode<
4987 fidl_fuchsia_mem::Buffer,
4988 fidl::encoding::DefaultFuchsiaResourceDialect,
4989 >,
4990 >
4991 fidl::encoding::Encode<
4992 FactoryDataManagerGetWeaveCertificateResponse,
4993 fidl::encoding::DefaultFuchsiaResourceDialect,
4994 > for (T0,)
4995 {
4996 #[inline]
4997 unsafe fn encode(
4998 self,
4999 encoder: &mut fidl::encoding::Encoder<
5000 '_,
5001 fidl::encoding::DefaultFuchsiaResourceDialect,
5002 >,
5003 offset: usize,
5004 depth: fidl::encoding::Depth,
5005 ) -> fidl::Result<()> {
5006 encoder.debug_check_bounds::<FactoryDataManagerGetWeaveCertificateResponse>(offset);
5007 self.0.encode(encoder, offset + 0, depth)?;
5011 Ok(())
5012 }
5013 }
5014
5015 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5016 for FactoryDataManagerGetWeaveCertificateResponse
5017 {
5018 #[inline(always)]
5019 fn new_empty() -> Self {
5020 Self {
5021 certificate: fidl::new_empty!(
5022 fidl_fuchsia_mem::Buffer,
5023 fidl::encoding::DefaultFuchsiaResourceDialect
5024 ),
5025 }
5026 }
5027
5028 #[inline]
5029 unsafe fn decode(
5030 &mut self,
5031 decoder: &mut fidl::encoding::Decoder<
5032 '_,
5033 fidl::encoding::DefaultFuchsiaResourceDialect,
5034 >,
5035 offset: usize,
5036 _depth: fidl::encoding::Depth,
5037 ) -> fidl::Result<()> {
5038 decoder.debug_check_bounds::<Self>(offset);
5039 fidl::decode!(
5041 fidl_fuchsia_mem::Buffer,
5042 fidl::encoding::DefaultFuchsiaResourceDialect,
5043 &mut self.certificate,
5044 decoder,
5045 offset + 0,
5046 _depth
5047 )?;
5048 Ok(())
5049 }
5050 }
5051
5052 impl fidl::encoding::ResourceTypeMarker for StackGetPairingStateWatcherRequest {
5053 type Borrowed<'a> = &'a mut Self;
5054 fn take_or_borrow<'a>(
5055 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5056 ) -> Self::Borrowed<'a> {
5057 value
5058 }
5059 }
5060
5061 unsafe impl fidl::encoding::TypeMarker for StackGetPairingStateWatcherRequest {
5062 type Owned = Self;
5063
5064 #[inline(always)]
5065 fn inline_align(_context: fidl::encoding::Context) -> usize {
5066 4
5067 }
5068
5069 #[inline(always)]
5070 fn inline_size(_context: fidl::encoding::Context) -> usize {
5071 4
5072 }
5073 }
5074
5075 unsafe impl
5076 fidl::encoding::Encode<
5077 StackGetPairingStateWatcherRequest,
5078 fidl::encoding::DefaultFuchsiaResourceDialect,
5079 > for &mut StackGetPairingStateWatcherRequest
5080 {
5081 #[inline]
5082 unsafe fn encode(
5083 self,
5084 encoder: &mut fidl::encoding::Encoder<
5085 '_,
5086 fidl::encoding::DefaultFuchsiaResourceDialect,
5087 >,
5088 offset: usize,
5089 _depth: fidl::encoding::Depth,
5090 ) -> fidl::Result<()> {
5091 encoder.debug_check_bounds::<StackGetPairingStateWatcherRequest>(offset);
5092 fidl::encoding::Encode::<StackGetPairingStateWatcherRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5094 (
5095 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PairingStateWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
5096 ),
5097 encoder, offset, _depth
5098 )
5099 }
5100 }
5101 unsafe impl<
5102 T0: fidl::encoding::Encode<
5103 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PairingStateWatcherMarker>>,
5104 fidl::encoding::DefaultFuchsiaResourceDialect,
5105 >,
5106 >
5107 fidl::encoding::Encode<
5108 StackGetPairingStateWatcherRequest,
5109 fidl::encoding::DefaultFuchsiaResourceDialect,
5110 > for (T0,)
5111 {
5112 #[inline]
5113 unsafe fn encode(
5114 self,
5115 encoder: &mut fidl::encoding::Encoder<
5116 '_,
5117 fidl::encoding::DefaultFuchsiaResourceDialect,
5118 >,
5119 offset: usize,
5120 depth: fidl::encoding::Depth,
5121 ) -> fidl::Result<()> {
5122 encoder.debug_check_bounds::<StackGetPairingStateWatcherRequest>(offset);
5123 self.0.encode(encoder, offset + 0, depth)?;
5127 Ok(())
5128 }
5129 }
5130
5131 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5132 for StackGetPairingStateWatcherRequest
5133 {
5134 #[inline(always)]
5135 fn new_empty() -> Self {
5136 Self {
5137 watcher: fidl::new_empty!(
5138 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PairingStateWatcherMarker>>,
5139 fidl::encoding::DefaultFuchsiaResourceDialect
5140 ),
5141 }
5142 }
5143
5144 #[inline]
5145 unsafe fn decode(
5146 &mut self,
5147 decoder: &mut fidl::encoding::Decoder<
5148 '_,
5149 fidl::encoding::DefaultFuchsiaResourceDialect,
5150 >,
5151 offset: usize,
5152 _depth: fidl::encoding::Depth,
5153 ) -> fidl::Result<()> {
5154 decoder.debug_check_bounds::<Self>(offset);
5155 fidl::decode!(
5157 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PairingStateWatcherMarker>>,
5158 fidl::encoding::DefaultFuchsiaResourceDialect,
5159 &mut self.watcher,
5160 decoder,
5161 offset + 0,
5162 _depth
5163 )?;
5164 Ok(())
5165 }
5166 }
5167
5168 impl fidl::encoding::ResourceTypeMarker for StackGetSvcDirectoryWatcherRequest {
5169 type Borrowed<'a> = &'a mut Self;
5170 fn take_or_borrow<'a>(
5171 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5172 ) -> Self::Borrowed<'a> {
5173 value
5174 }
5175 }
5176
5177 unsafe impl fidl::encoding::TypeMarker for StackGetSvcDirectoryWatcherRequest {
5178 type Owned = Self;
5179
5180 #[inline(always)]
5181 fn inline_align(_context: fidl::encoding::Context) -> usize {
5182 8
5183 }
5184
5185 #[inline(always)]
5186 fn inline_size(_context: fidl::encoding::Context) -> usize {
5187 16
5188 }
5189 }
5190
5191 unsafe impl
5192 fidl::encoding::Encode<
5193 StackGetSvcDirectoryWatcherRequest,
5194 fidl::encoding::DefaultFuchsiaResourceDialect,
5195 > for &mut StackGetSvcDirectoryWatcherRequest
5196 {
5197 #[inline]
5198 unsafe fn encode(
5199 self,
5200 encoder: &mut fidl::encoding::Encoder<
5201 '_,
5202 fidl::encoding::DefaultFuchsiaResourceDialect,
5203 >,
5204 offset: usize,
5205 _depth: fidl::encoding::Depth,
5206 ) -> fidl::Result<()> {
5207 encoder.debug_check_bounds::<StackGetSvcDirectoryWatcherRequest>(offset);
5208 fidl::encoding::Encode::<StackGetSvcDirectoryWatcherRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5210 (
5211 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.endpoint_id),
5212 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
5213 ),
5214 encoder, offset, _depth
5215 )
5216 }
5217 }
5218 unsafe impl<
5219 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
5220 T1: fidl::encoding::Encode<
5221 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>>,
5222 fidl::encoding::DefaultFuchsiaResourceDialect,
5223 >,
5224 >
5225 fidl::encoding::Encode<
5226 StackGetSvcDirectoryWatcherRequest,
5227 fidl::encoding::DefaultFuchsiaResourceDialect,
5228 > for (T0, T1)
5229 {
5230 #[inline]
5231 unsafe fn encode(
5232 self,
5233 encoder: &mut fidl::encoding::Encoder<
5234 '_,
5235 fidl::encoding::DefaultFuchsiaResourceDialect,
5236 >,
5237 offset: usize,
5238 depth: fidl::encoding::Depth,
5239 ) -> fidl::Result<()> {
5240 encoder.debug_check_bounds::<StackGetSvcDirectoryWatcherRequest>(offset);
5241 unsafe {
5244 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
5245 (ptr as *mut u64).write_unaligned(0);
5246 }
5247 self.0.encode(encoder, offset + 0, depth)?;
5249 self.1.encode(encoder, offset + 8, depth)?;
5250 Ok(())
5251 }
5252 }
5253
5254 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5255 for StackGetSvcDirectoryWatcherRequest
5256 {
5257 #[inline(always)]
5258 fn new_empty() -> Self {
5259 Self {
5260 endpoint_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
5261 watcher: fidl::new_empty!(
5262 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>>,
5263 fidl::encoding::DefaultFuchsiaResourceDialect
5264 ),
5265 }
5266 }
5267
5268 #[inline]
5269 unsafe fn decode(
5270 &mut self,
5271 decoder: &mut fidl::encoding::Decoder<
5272 '_,
5273 fidl::encoding::DefaultFuchsiaResourceDialect,
5274 >,
5275 offset: usize,
5276 _depth: fidl::encoding::Depth,
5277 ) -> fidl::Result<()> {
5278 decoder.debug_check_bounds::<Self>(offset);
5279 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
5281 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5282 let mask = 0xffffffff00000000u64;
5283 let maskedval = padval & mask;
5284 if maskedval != 0 {
5285 return Err(fidl::Error::NonZeroPadding {
5286 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
5287 });
5288 }
5289 fidl::decode!(
5290 u64,
5291 fidl::encoding::DefaultFuchsiaResourceDialect,
5292 &mut self.endpoint_id,
5293 decoder,
5294 offset + 0,
5295 _depth
5296 )?;
5297 fidl::decode!(
5298 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcDirectoryWatcherMarker>>,
5299 fidl::encoding::DefaultFuchsiaResourceDialect,
5300 &mut self.watcher,
5301 decoder,
5302 offset + 8,
5303 _depth
5304 )?;
5305 Ok(())
5306 }
5307 }
5308
5309 impl fidl::encoding::ResourceTypeMarker for StackProviderSetWlanNetworkConfigProviderRequest {
5310 type Borrowed<'a> = &'a mut Self;
5311 fn take_or_borrow<'a>(
5312 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5313 ) -> Self::Borrowed<'a> {
5314 value
5315 }
5316 }
5317
5318 unsafe impl fidl::encoding::TypeMarker for StackProviderSetWlanNetworkConfigProviderRequest {
5319 type Owned = Self;
5320
5321 #[inline(always)]
5322 fn inline_align(_context: fidl::encoding::Context) -> usize {
5323 4
5324 }
5325
5326 #[inline(always)]
5327 fn inline_size(_context: fidl::encoding::Context) -> usize {
5328 4
5329 }
5330 }
5331
5332 unsafe impl
5333 fidl::encoding::Encode<
5334 StackProviderSetWlanNetworkConfigProviderRequest,
5335 fidl::encoding::DefaultFuchsiaResourceDialect,
5336 > for &mut StackProviderSetWlanNetworkConfigProviderRequest
5337 {
5338 #[inline]
5339 unsafe fn encode(
5340 self,
5341 encoder: &mut fidl::encoding::Encoder<
5342 '_,
5343 fidl::encoding::DefaultFuchsiaResourceDialect,
5344 >,
5345 offset: usize,
5346 _depth: fidl::encoding::Depth,
5347 ) -> fidl::Result<()> {
5348 encoder.debug_check_bounds::<StackProviderSetWlanNetworkConfigProviderRequest>(offset);
5349 fidl::encoding::Encode::<
5351 StackProviderSetWlanNetworkConfigProviderRequest,
5352 fidl::encoding::DefaultFuchsiaResourceDialect,
5353 >::encode(
5354 (<fidl::encoding::Endpoint<
5355 fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
5356 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5357 &mut self.provider
5358 ),),
5359 encoder,
5360 offset,
5361 _depth,
5362 )
5363 }
5364 }
5365 unsafe impl<
5366 T0: fidl::encoding::Encode<
5367 fidl::encoding::Endpoint<
5368 fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
5369 >,
5370 fidl::encoding::DefaultFuchsiaResourceDialect,
5371 >,
5372 >
5373 fidl::encoding::Encode<
5374 StackProviderSetWlanNetworkConfigProviderRequest,
5375 fidl::encoding::DefaultFuchsiaResourceDialect,
5376 > for (T0,)
5377 {
5378 #[inline]
5379 unsafe fn encode(
5380 self,
5381 encoder: &mut fidl::encoding::Encoder<
5382 '_,
5383 fidl::encoding::DefaultFuchsiaResourceDialect,
5384 >,
5385 offset: usize,
5386 depth: fidl::encoding::Depth,
5387 ) -> fidl::Result<()> {
5388 encoder.debug_check_bounds::<StackProviderSetWlanNetworkConfigProviderRequest>(offset);
5389 self.0.encode(encoder, offset + 0, depth)?;
5393 Ok(())
5394 }
5395 }
5396
5397 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5398 for StackProviderSetWlanNetworkConfigProviderRequest
5399 {
5400 #[inline(always)]
5401 fn new_empty() -> Self {
5402 Self {
5403 provider: fidl::new_empty!(
5404 fidl::encoding::Endpoint<
5405 fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
5406 >,
5407 fidl::encoding::DefaultFuchsiaResourceDialect
5408 ),
5409 }
5410 }
5411
5412 #[inline]
5413 unsafe fn decode(
5414 &mut self,
5415 decoder: &mut fidl::encoding::Decoder<
5416 '_,
5417 fidl::encoding::DefaultFuchsiaResourceDialect,
5418 >,
5419 offset: usize,
5420 _depth: fidl::encoding::Depth,
5421 ) -> fidl::Result<()> {
5422 decoder.debug_check_bounds::<Self>(offset);
5423 fidl::decode!(
5425 fidl::encoding::Endpoint<
5426 fidl::endpoints::ClientEnd<WlanNetworkConfigProviderMarker>,
5427 >,
5428 fidl::encoding::DefaultFuchsiaResourceDialect,
5429 &mut self.provider,
5430 decoder,
5431 offset + 0,
5432 _depth
5433 )?;
5434 Ok(())
5435 }
5436 }
5437}