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_time_alarms_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ClientSideBatonManagementSetAndWaitResponse {
16 pub keep_alive: fidl::EventPair,
19}
20
21impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
22 for ClientSideBatonManagementSetAndWaitResponse
23{
24}
25
26#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27pub struct SetAndWaitArgs {
28 pub deadline: fidl::BootInstant,
30 pub setup_done: fidl::Event,
34 pub alarm_id: String,
41}
42
43impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SetAndWaitArgs {}
44
45#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
46pub struct ClientSideBatonManagementMarker;
47
48impl fidl::endpoints::ProtocolMarker for ClientSideBatonManagementMarker {
49 type Proxy = ClientSideBatonManagementProxy;
50 type RequestStream = ClientSideBatonManagementRequestStream;
51 #[cfg(target_os = "fuchsia")]
52 type SynchronousProxy = ClientSideBatonManagementSynchronousProxy;
53
54 const DEBUG_NAME: &'static str = "(anonymous) ClientSideBatonManagement";
55}
56pub type ClientSideBatonManagementSetAndWaitResult = Result<fidl::EventPair, WakeError>;
57pub type ClientSideBatonManagementCancelSyncResult = Result<(), WakeError>;
58
59pub trait ClientSideBatonManagementProxyInterface: Send + Sync {
60 type SetAndWaitResponseFut: std::future::Future<Output = Result<ClientSideBatonManagementSetAndWaitResult, fidl::Error>>
61 + Send;
62 fn r#set_and_wait(
63 &self,
64 deadline: fidl::BootInstant,
65 setup_done: fidl::Event,
66 alarm_id: &str,
67 ) -> Self::SetAndWaitResponseFut;
68 fn r#cancel(&self, alarm_id: &str) -> Result<(), fidl::Error>;
69 type CancelSyncResponseFut: std::future::Future<Output = Result<ClientSideBatonManagementCancelSyncResult, fidl::Error>>
70 + Send;
71 fn r#cancel_sync(&self, alarm_id: &str) -> Self::CancelSyncResponseFut;
72}
73#[derive(Debug)]
74#[cfg(target_os = "fuchsia")]
75pub struct ClientSideBatonManagementSynchronousProxy {
76 client: fidl::client::sync::Client,
77}
78
79#[cfg(target_os = "fuchsia")]
80impl fidl::endpoints::SynchronousProxy for ClientSideBatonManagementSynchronousProxy {
81 type Proxy = ClientSideBatonManagementProxy;
82 type Protocol = ClientSideBatonManagementMarker;
83
84 fn from_channel(inner: fidl::Channel) -> Self {
85 Self::new(inner)
86 }
87
88 fn into_channel(self) -> fidl::Channel {
89 self.client.into_channel()
90 }
91
92 fn as_channel(&self) -> &fidl::Channel {
93 self.client.as_channel()
94 }
95}
96
97#[cfg(target_os = "fuchsia")]
98impl ClientSideBatonManagementSynchronousProxy {
99 pub fn new(channel: fidl::Channel) -> Self {
100 let protocol_name =
101 <ClientSideBatonManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
102 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
103 }
104
105 pub fn into_channel(self) -> fidl::Channel {
106 self.client.into_channel()
107 }
108
109 pub fn wait_for_event(
112 &self,
113 deadline: zx::MonotonicInstant,
114 ) -> Result<ClientSideBatonManagementEvent, fidl::Error> {
115 ClientSideBatonManagementEvent::decode(self.client.wait_for_event(deadline)?)
116 }
117
118 pub fn r#set_and_wait(
149 &self,
150 mut deadline: fidl::BootInstant,
151 mut setup_done: fidl::Event,
152 mut alarm_id: &str,
153 ___deadline: zx::MonotonicInstant,
154 ) -> Result<ClientSideBatonManagementSetAndWaitResult, fidl::Error> {
155 let _response = self
156 .client
157 .send_query::<SetAndWaitArgs, fidl::encoding::FlexibleResultType<
158 ClientSideBatonManagementSetAndWaitResponse,
159 WakeError,
160 >>(
161 (deadline, setup_done, alarm_id),
162 0x46ea462fcd0246c0,
163 fidl::encoding::DynamicFlags::FLEXIBLE,
164 ___deadline,
165 )?
166 .into_result::<ClientSideBatonManagementMarker>("set_and_wait")?;
167 Ok(_response.map(|x| x.keep_alive))
168 }
169
170 pub fn r#cancel(&self, mut alarm_id: &str) -> Result<(), fidl::Error> {
175 self.client.send::<ClientSideBatonManagementCancelRequest>(
176 (alarm_id,),
177 0x2d59ccae0bda24e3,
178 fidl::encoding::DynamicFlags::FLEXIBLE,
179 )
180 }
181
182 pub fn r#cancel_sync(
184 &self,
185 mut alarm_id: &str,
186 ___deadline: zx::MonotonicInstant,
187 ) -> Result<ClientSideBatonManagementCancelSyncResult, fidl::Error> {
188 let _response = self.client.send_query::<
189 ClientSideBatonManagementCancelSyncRequest,
190 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WakeError>,
191 >(
192 (alarm_id,),
193 0x397477d8067269c3,
194 fidl::encoding::DynamicFlags::FLEXIBLE,
195 ___deadline,
196 )?
197 .into_result::<ClientSideBatonManagementMarker>("cancel_sync")?;
198 Ok(_response.map(|x| x))
199 }
200}
201
202#[cfg(target_os = "fuchsia")]
203impl From<ClientSideBatonManagementSynchronousProxy> for zx::Handle {
204 fn from(value: ClientSideBatonManagementSynchronousProxy) -> Self {
205 value.into_channel().into()
206 }
207}
208
209#[cfg(target_os = "fuchsia")]
210impl From<fidl::Channel> for ClientSideBatonManagementSynchronousProxy {
211 fn from(value: fidl::Channel) -> Self {
212 Self::new(value)
213 }
214}
215
216#[derive(Debug, Clone)]
217pub struct ClientSideBatonManagementProxy {
218 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
219}
220
221impl fidl::endpoints::Proxy for ClientSideBatonManagementProxy {
222 type Protocol = ClientSideBatonManagementMarker;
223
224 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
225 Self::new(inner)
226 }
227
228 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
229 self.client.into_channel().map_err(|client| Self { client })
230 }
231
232 fn as_channel(&self) -> &::fidl::AsyncChannel {
233 self.client.as_channel()
234 }
235}
236
237impl ClientSideBatonManagementProxy {
238 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
240 let protocol_name =
241 <ClientSideBatonManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
242 Self { client: fidl::client::Client::new(channel, protocol_name) }
243 }
244
245 pub fn take_event_stream(&self) -> ClientSideBatonManagementEventStream {
251 ClientSideBatonManagementEventStream { event_receiver: self.client.take_event_receiver() }
252 }
253
254 pub fn r#set_and_wait(
285 &self,
286 mut deadline: fidl::BootInstant,
287 mut setup_done: fidl::Event,
288 mut alarm_id: &str,
289 ) -> fidl::client::QueryResponseFut<
290 ClientSideBatonManagementSetAndWaitResult,
291 fidl::encoding::DefaultFuchsiaResourceDialect,
292 > {
293 ClientSideBatonManagementProxyInterface::r#set_and_wait(
294 self, deadline, setup_done, alarm_id,
295 )
296 }
297
298 pub fn r#cancel(&self, mut alarm_id: &str) -> Result<(), fidl::Error> {
303 ClientSideBatonManagementProxyInterface::r#cancel(self, alarm_id)
304 }
305
306 pub fn r#cancel_sync(
308 &self,
309 mut alarm_id: &str,
310 ) -> fidl::client::QueryResponseFut<
311 ClientSideBatonManagementCancelSyncResult,
312 fidl::encoding::DefaultFuchsiaResourceDialect,
313 > {
314 ClientSideBatonManagementProxyInterface::r#cancel_sync(self, alarm_id)
315 }
316}
317
318impl ClientSideBatonManagementProxyInterface for ClientSideBatonManagementProxy {
319 type SetAndWaitResponseFut = fidl::client::QueryResponseFut<
320 ClientSideBatonManagementSetAndWaitResult,
321 fidl::encoding::DefaultFuchsiaResourceDialect,
322 >;
323 fn r#set_and_wait(
324 &self,
325 mut deadline: fidl::BootInstant,
326 mut setup_done: fidl::Event,
327 mut alarm_id: &str,
328 ) -> Self::SetAndWaitResponseFut {
329 fn _decode(
330 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
331 ) -> Result<ClientSideBatonManagementSetAndWaitResult, fidl::Error> {
332 let _response = fidl::client::decode_transaction_body::<
333 fidl::encoding::FlexibleResultType<
334 ClientSideBatonManagementSetAndWaitResponse,
335 WakeError,
336 >,
337 fidl::encoding::DefaultFuchsiaResourceDialect,
338 0x46ea462fcd0246c0,
339 >(_buf?)?
340 .into_result::<ClientSideBatonManagementMarker>("set_and_wait")?;
341 Ok(_response.map(|x| x.keep_alive))
342 }
343 self.client
344 .send_query_and_decode::<SetAndWaitArgs, ClientSideBatonManagementSetAndWaitResult>(
345 (deadline, setup_done, alarm_id),
346 0x46ea462fcd0246c0,
347 fidl::encoding::DynamicFlags::FLEXIBLE,
348 _decode,
349 )
350 }
351
352 fn r#cancel(&self, mut alarm_id: &str) -> Result<(), fidl::Error> {
353 self.client.send::<ClientSideBatonManagementCancelRequest>(
354 (alarm_id,),
355 0x2d59ccae0bda24e3,
356 fidl::encoding::DynamicFlags::FLEXIBLE,
357 )
358 }
359
360 type CancelSyncResponseFut = fidl::client::QueryResponseFut<
361 ClientSideBatonManagementCancelSyncResult,
362 fidl::encoding::DefaultFuchsiaResourceDialect,
363 >;
364 fn r#cancel_sync(&self, mut alarm_id: &str) -> Self::CancelSyncResponseFut {
365 fn _decode(
366 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
367 ) -> Result<ClientSideBatonManagementCancelSyncResult, fidl::Error> {
368 let _response = fidl::client::decode_transaction_body::<
369 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WakeError>,
370 fidl::encoding::DefaultFuchsiaResourceDialect,
371 0x397477d8067269c3,
372 >(_buf?)?
373 .into_result::<ClientSideBatonManagementMarker>("cancel_sync")?;
374 Ok(_response.map(|x| x))
375 }
376 self.client.send_query_and_decode::<
377 ClientSideBatonManagementCancelSyncRequest,
378 ClientSideBatonManagementCancelSyncResult,
379 >(
380 (alarm_id,),
381 0x397477d8067269c3,
382 fidl::encoding::DynamicFlags::FLEXIBLE,
383 _decode,
384 )
385 }
386}
387
388pub struct ClientSideBatonManagementEventStream {
389 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
390}
391
392impl std::marker::Unpin for ClientSideBatonManagementEventStream {}
393
394impl futures::stream::FusedStream for ClientSideBatonManagementEventStream {
395 fn is_terminated(&self) -> bool {
396 self.event_receiver.is_terminated()
397 }
398}
399
400impl futures::Stream for ClientSideBatonManagementEventStream {
401 type Item = Result<ClientSideBatonManagementEvent, fidl::Error>;
402
403 fn poll_next(
404 mut self: std::pin::Pin<&mut Self>,
405 cx: &mut std::task::Context<'_>,
406 ) -> std::task::Poll<Option<Self::Item>> {
407 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
408 &mut self.event_receiver,
409 cx
410 )?) {
411 Some(buf) => std::task::Poll::Ready(Some(ClientSideBatonManagementEvent::decode(buf))),
412 None => std::task::Poll::Ready(None),
413 }
414 }
415}
416
417#[derive(Debug)]
418pub enum ClientSideBatonManagementEvent {
419 #[non_exhaustive]
420 _UnknownEvent {
421 ordinal: u64,
423 },
424}
425
426impl ClientSideBatonManagementEvent {
427 fn decode(
429 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
430 ) -> Result<ClientSideBatonManagementEvent, fidl::Error> {
431 let (bytes, _handles) = buf.split_mut();
432 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
433 debug_assert_eq!(tx_header.tx_id, 0);
434 match tx_header.ordinal {
435 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
436 Ok(ClientSideBatonManagementEvent::_UnknownEvent { ordinal: tx_header.ordinal })
437 }
438 _ => Err(fidl::Error::UnknownOrdinal {
439 ordinal: tx_header.ordinal,
440 protocol_name:
441 <ClientSideBatonManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
442 }),
443 }
444 }
445}
446
447pub struct ClientSideBatonManagementRequestStream {
449 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
450 is_terminated: bool,
451}
452
453impl std::marker::Unpin for ClientSideBatonManagementRequestStream {}
454
455impl futures::stream::FusedStream for ClientSideBatonManagementRequestStream {
456 fn is_terminated(&self) -> bool {
457 self.is_terminated
458 }
459}
460
461impl fidl::endpoints::RequestStream for ClientSideBatonManagementRequestStream {
462 type Protocol = ClientSideBatonManagementMarker;
463 type ControlHandle = ClientSideBatonManagementControlHandle;
464
465 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
466 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
467 }
468
469 fn control_handle(&self) -> Self::ControlHandle {
470 ClientSideBatonManagementControlHandle { inner: self.inner.clone() }
471 }
472
473 fn into_inner(
474 self,
475 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
476 {
477 (self.inner, self.is_terminated)
478 }
479
480 fn from_inner(
481 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
482 is_terminated: bool,
483 ) -> Self {
484 Self { inner, is_terminated }
485 }
486}
487
488impl futures::Stream for ClientSideBatonManagementRequestStream {
489 type Item = Result<ClientSideBatonManagementRequest, fidl::Error>;
490
491 fn poll_next(
492 mut self: std::pin::Pin<&mut Self>,
493 cx: &mut std::task::Context<'_>,
494 ) -> std::task::Poll<Option<Self::Item>> {
495 let this = &mut *self;
496 if this.inner.check_shutdown(cx) {
497 this.is_terminated = true;
498 return std::task::Poll::Ready(None);
499 }
500 if this.is_terminated {
501 panic!("polled ClientSideBatonManagementRequestStream after completion");
502 }
503 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
504 |bytes, handles| {
505 match this.inner.channel().read_etc(cx, bytes, handles) {
506 std::task::Poll::Ready(Ok(())) => {}
507 std::task::Poll::Pending => return std::task::Poll::Pending,
508 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
509 this.is_terminated = true;
510 return std::task::Poll::Ready(None);
511 }
512 std::task::Poll::Ready(Err(e)) => {
513 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
514 e.into(),
515 ))))
516 }
517 }
518
519 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
521
522 std::task::Poll::Ready(Some(match header.ordinal {
523 0x46ea462fcd0246c0 => {
524 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
525 let mut req = fidl::new_empty!(SetAndWaitArgs, fidl::encoding::DefaultFuchsiaResourceDialect);
526 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SetAndWaitArgs>(&header, _body_bytes, handles, &mut req)?;
527 let control_handle = ClientSideBatonManagementControlHandle {
528 inner: this.inner.clone(),
529 };
530 Ok(ClientSideBatonManagementRequest::SetAndWait {deadline: req.deadline,
531setup_done: req.setup_done,
532alarm_id: req.alarm_id,
533
534 responder: ClientSideBatonManagementSetAndWaitResponder {
535 control_handle: std::mem::ManuallyDrop::new(control_handle),
536 tx_id: header.tx_id,
537 },
538 })
539 }
540 0x2d59ccae0bda24e3 => {
541 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
542 let mut req = fidl::new_empty!(ClientSideBatonManagementCancelRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
543 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSideBatonManagementCancelRequest>(&header, _body_bytes, handles, &mut req)?;
544 let control_handle = ClientSideBatonManagementControlHandle {
545 inner: this.inner.clone(),
546 };
547 Ok(ClientSideBatonManagementRequest::Cancel {alarm_id: req.alarm_id,
548
549 control_handle,
550 })
551 }
552 0x397477d8067269c3 => {
553 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
554 let mut req = fidl::new_empty!(ClientSideBatonManagementCancelSyncRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
555 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSideBatonManagementCancelSyncRequest>(&header, _body_bytes, handles, &mut req)?;
556 let control_handle = ClientSideBatonManagementControlHandle {
557 inner: this.inner.clone(),
558 };
559 Ok(ClientSideBatonManagementRequest::CancelSync {alarm_id: req.alarm_id,
560
561 responder: ClientSideBatonManagementCancelSyncResponder {
562 control_handle: std::mem::ManuallyDrop::new(control_handle),
563 tx_id: header.tx_id,
564 },
565 })
566 }
567 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
568 Ok(ClientSideBatonManagementRequest::_UnknownMethod {
569 ordinal: header.ordinal,
570 control_handle: ClientSideBatonManagementControlHandle { inner: this.inner.clone() },
571 method_type: fidl::MethodType::OneWay,
572 })
573 }
574 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
575 this.inner.send_framework_err(
576 fidl::encoding::FrameworkErr::UnknownMethod,
577 header.tx_id,
578 header.ordinal,
579 header.dynamic_flags(),
580 (bytes, handles),
581 )?;
582 Ok(ClientSideBatonManagementRequest::_UnknownMethod {
583 ordinal: header.ordinal,
584 control_handle: ClientSideBatonManagementControlHandle { inner: this.inner.clone() },
585 method_type: fidl::MethodType::TwoWay,
586 })
587 }
588 _ => Err(fidl::Error::UnknownOrdinal {
589 ordinal: header.ordinal,
590 protocol_name: <ClientSideBatonManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
591 }),
592 }))
593 },
594 )
595 }
596}
597
598#[derive(Debug)]
599pub enum ClientSideBatonManagementRequest {
600 SetAndWait {
631 deadline: fidl::BootInstant,
632 setup_done: fidl::Event,
633 alarm_id: String,
634 responder: ClientSideBatonManagementSetAndWaitResponder,
635 },
636 Cancel { alarm_id: String, control_handle: ClientSideBatonManagementControlHandle },
641 CancelSync { alarm_id: String, responder: ClientSideBatonManagementCancelSyncResponder },
643 #[non_exhaustive]
645 _UnknownMethod {
646 ordinal: u64,
648 control_handle: ClientSideBatonManagementControlHandle,
649 method_type: fidl::MethodType,
650 },
651}
652
653impl ClientSideBatonManagementRequest {
654 #[allow(irrefutable_let_patterns)]
655 pub fn into_set_and_wait(
656 self,
657 ) -> Option<(
658 fidl::BootInstant,
659 fidl::Event,
660 String,
661 ClientSideBatonManagementSetAndWaitResponder,
662 )> {
663 if let ClientSideBatonManagementRequest::SetAndWait {
664 deadline,
665 setup_done,
666 alarm_id,
667 responder,
668 } = self
669 {
670 Some((deadline, setup_done, alarm_id, responder))
671 } else {
672 None
673 }
674 }
675
676 #[allow(irrefutable_let_patterns)]
677 pub fn into_cancel(self) -> Option<(String, ClientSideBatonManagementControlHandle)> {
678 if let ClientSideBatonManagementRequest::Cancel { alarm_id, control_handle } = self {
679 Some((alarm_id, control_handle))
680 } else {
681 None
682 }
683 }
684
685 #[allow(irrefutable_let_patterns)]
686 pub fn into_cancel_sync(
687 self,
688 ) -> Option<(String, ClientSideBatonManagementCancelSyncResponder)> {
689 if let ClientSideBatonManagementRequest::CancelSync { alarm_id, responder } = self {
690 Some((alarm_id, responder))
691 } else {
692 None
693 }
694 }
695
696 pub fn method_name(&self) -> &'static str {
698 match *self {
699 ClientSideBatonManagementRequest::SetAndWait { .. } => "set_and_wait",
700 ClientSideBatonManagementRequest::Cancel { .. } => "cancel",
701 ClientSideBatonManagementRequest::CancelSync { .. } => "cancel_sync",
702 ClientSideBatonManagementRequest::_UnknownMethod {
703 method_type: fidl::MethodType::OneWay,
704 ..
705 } => "unknown one-way method",
706 ClientSideBatonManagementRequest::_UnknownMethod {
707 method_type: fidl::MethodType::TwoWay,
708 ..
709 } => "unknown two-way method",
710 }
711 }
712}
713
714#[derive(Debug, Clone)]
715pub struct ClientSideBatonManagementControlHandle {
716 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
717}
718
719impl fidl::endpoints::ControlHandle for ClientSideBatonManagementControlHandle {
720 fn shutdown(&self) {
721 self.inner.shutdown()
722 }
723 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
724 self.inner.shutdown_with_epitaph(status)
725 }
726
727 fn is_closed(&self) -> bool {
728 self.inner.channel().is_closed()
729 }
730 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
731 self.inner.channel().on_closed()
732 }
733
734 #[cfg(target_os = "fuchsia")]
735 fn signal_peer(
736 &self,
737 clear_mask: zx::Signals,
738 set_mask: zx::Signals,
739 ) -> Result<(), zx_status::Status> {
740 use fidl::Peered;
741 self.inner.channel().signal_peer(clear_mask, set_mask)
742 }
743}
744
745impl ClientSideBatonManagementControlHandle {}
746
747#[must_use = "FIDL methods require a response to be sent"]
748#[derive(Debug)]
749pub struct ClientSideBatonManagementSetAndWaitResponder {
750 control_handle: std::mem::ManuallyDrop<ClientSideBatonManagementControlHandle>,
751 tx_id: u32,
752}
753
754impl std::ops::Drop for ClientSideBatonManagementSetAndWaitResponder {
758 fn drop(&mut self) {
759 self.control_handle.shutdown();
760 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
762 }
763}
764
765impl fidl::endpoints::Responder for ClientSideBatonManagementSetAndWaitResponder {
766 type ControlHandle = ClientSideBatonManagementControlHandle;
767
768 fn control_handle(&self) -> &ClientSideBatonManagementControlHandle {
769 &self.control_handle
770 }
771
772 fn drop_without_shutdown(mut self) {
773 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
775 std::mem::forget(self);
777 }
778}
779
780impl ClientSideBatonManagementSetAndWaitResponder {
781 pub fn send(self, mut result: Result<fidl::EventPair, WakeError>) -> Result<(), fidl::Error> {
785 let _result = self.send_raw(result);
786 if _result.is_err() {
787 self.control_handle.shutdown();
788 }
789 self.drop_without_shutdown();
790 _result
791 }
792
793 pub fn send_no_shutdown_on_err(
795 self,
796 mut result: Result<fidl::EventPair, WakeError>,
797 ) -> Result<(), fidl::Error> {
798 let _result = self.send_raw(result);
799 self.drop_without_shutdown();
800 _result
801 }
802
803 fn send_raw(&self, mut result: Result<fidl::EventPair, WakeError>) -> Result<(), fidl::Error> {
804 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
805 ClientSideBatonManagementSetAndWaitResponse,
806 WakeError,
807 >>(
808 fidl::encoding::FlexibleResult::new(result.map(|keep_alive| (keep_alive,))),
809 self.tx_id,
810 0x46ea462fcd0246c0,
811 fidl::encoding::DynamicFlags::FLEXIBLE,
812 )
813 }
814}
815
816#[must_use = "FIDL methods require a response to be sent"]
817#[derive(Debug)]
818pub struct ClientSideBatonManagementCancelSyncResponder {
819 control_handle: std::mem::ManuallyDrop<ClientSideBatonManagementControlHandle>,
820 tx_id: u32,
821}
822
823impl std::ops::Drop for ClientSideBatonManagementCancelSyncResponder {
827 fn drop(&mut self) {
828 self.control_handle.shutdown();
829 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
831 }
832}
833
834impl fidl::endpoints::Responder for ClientSideBatonManagementCancelSyncResponder {
835 type ControlHandle = ClientSideBatonManagementControlHandle;
836
837 fn control_handle(&self) -> &ClientSideBatonManagementControlHandle {
838 &self.control_handle
839 }
840
841 fn drop_without_shutdown(mut self) {
842 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
844 std::mem::forget(self);
846 }
847}
848
849impl ClientSideBatonManagementCancelSyncResponder {
850 pub fn send(self, mut result: Result<(), WakeError>) -> Result<(), fidl::Error> {
854 let _result = self.send_raw(result);
855 if _result.is_err() {
856 self.control_handle.shutdown();
857 }
858 self.drop_without_shutdown();
859 _result
860 }
861
862 pub fn send_no_shutdown_on_err(
864 self,
865 mut result: Result<(), WakeError>,
866 ) -> Result<(), fidl::Error> {
867 let _result = self.send_raw(result);
868 self.drop_without_shutdown();
869 _result
870 }
871
872 fn send_raw(&self, mut result: Result<(), WakeError>) -> Result<(), fidl::Error> {
873 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
874 fidl::encoding::EmptyStruct,
875 WakeError,
876 >>(
877 fidl::encoding::FlexibleResult::new(result),
878 self.tx_id,
879 0x397477d8067269c3,
880 fidl::encoding::DynamicFlags::FLEXIBLE,
881 )
882 }
883}
884
885#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
886pub struct WakeMarker;
887
888impl fidl::endpoints::ProtocolMarker for WakeMarker {
889 type Proxy = WakeProxy;
890 type RequestStream = WakeRequestStream;
891 #[cfg(target_os = "fuchsia")]
892 type SynchronousProxy = WakeSynchronousProxy;
893
894 const DEBUG_NAME: &'static str = "fuchsia.time.alarms.Wake";
895}
896impl fidl::endpoints::DiscoverableProtocolMarker for WakeMarker {}
897
898pub trait WakeProxyInterface: Send + Sync {
899 type SetAndWaitResponseFut: std::future::Future<Output = Result<ClientSideBatonManagementSetAndWaitResult, fidl::Error>>
900 + Send;
901 fn r#set_and_wait(
902 &self,
903 deadline: fidl::BootInstant,
904 setup_done: fidl::Event,
905 alarm_id: &str,
906 ) -> Self::SetAndWaitResponseFut;
907 fn r#cancel(&self, alarm_id: &str) -> Result<(), fidl::Error>;
908 type CancelSyncResponseFut: std::future::Future<Output = Result<ClientSideBatonManagementCancelSyncResult, fidl::Error>>
909 + Send;
910 fn r#cancel_sync(&self, alarm_id: &str) -> Self::CancelSyncResponseFut;
911 type GetPropertiesResponseFut: std::future::Future<Output = Result<WakeGetPropertiesResponse, fidl::Error>>
912 + Send;
913 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
914}
915#[derive(Debug)]
916#[cfg(target_os = "fuchsia")]
917pub struct WakeSynchronousProxy {
918 client: fidl::client::sync::Client,
919}
920
921#[cfg(target_os = "fuchsia")]
922impl fidl::endpoints::SynchronousProxy for WakeSynchronousProxy {
923 type Proxy = WakeProxy;
924 type Protocol = WakeMarker;
925
926 fn from_channel(inner: fidl::Channel) -> Self {
927 Self::new(inner)
928 }
929
930 fn into_channel(self) -> fidl::Channel {
931 self.client.into_channel()
932 }
933
934 fn as_channel(&self) -> &fidl::Channel {
935 self.client.as_channel()
936 }
937}
938
939#[cfg(target_os = "fuchsia")]
940impl WakeSynchronousProxy {
941 pub fn new(channel: fidl::Channel) -> Self {
942 let protocol_name = <WakeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
943 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
944 }
945
946 pub fn into_channel(self) -> fidl::Channel {
947 self.client.into_channel()
948 }
949
950 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<WakeEvent, fidl::Error> {
953 WakeEvent::decode(self.client.wait_for_event(deadline)?)
954 }
955
956 pub fn r#set_and_wait(
987 &self,
988 mut deadline: fidl::BootInstant,
989 mut setup_done: fidl::Event,
990 mut alarm_id: &str,
991 ___deadline: zx::MonotonicInstant,
992 ) -> Result<ClientSideBatonManagementSetAndWaitResult, fidl::Error> {
993 let _response = self
994 .client
995 .send_query::<SetAndWaitArgs, fidl::encoding::FlexibleResultType<
996 ClientSideBatonManagementSetAndWaitResponse,
997 WakeError,
998 >>(
999 (deadline, setup_done, alarm_id),
1000 0x46ea462fcd0246c0,
1001 fidl::encoding::DynamicFlags::FLEXIBLE,
1002 ___deadline,
1003 )?
1004 .into_result::<WakeMarker>("set_and_wait")?;
1005 Ok(_response.map(|x| x.keep_alive))
1006 }
1007
1008 pub fn r#cancel(&self, mut alarm_id: &str) -> Result<(), fidl::Error> {
1013 self.client.send::<ClientSideBatonManagementCancelRequest>(
1014 (alarm_id,),
1015 0x2d59ccae0bda24e3,
1016 fidl::encoding::DynamicFlags::FLEXIBLE,
1017 )
1018 }
1019
1020 pub fn r#cancel_sync(
1022 &self,
1023 mut alarm_id: &str,
1024 ___deadline: zx::MonotonicInstant,
1025 ) -> Result<ClientSideBatonManagementCancelSyncResult, fidl::Error> {
1026 let _response = self.client.send_query::<
1027 ClientSideBatonManagementCancelSyncRequest,
1028 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WakeError>,
1029 >(
1030 (alarm_id,),
1031 0x397477d8067269c3,
1032 fidl::encoding::DynamicFlags::FLEXIBLE,
1033 ___deadline,
1034 )?
1035 .into_result::<WakeMarker>("cancel_sync")?;
1036 Ok(_response.map(|x| x))
1037 }
1038
1039 pub fn r#get_properties(
1042 &self,
1043 ___deadline: zx::MonotonicInstant,
1044 ) -> Result<WakeGetPropertiesResponse, fidl::Error> {
1045 let _response = self.client.send_query::<
1046 fidl::encoding::EmptyPayload,
1047 fidl::encoding::FlexibleType<WakeGetPropertiesResponse>,
1048 >(
1049 (),
1050 0x486a204b6463420,
1051 fidl::encoding::DynamicFlags::FLEXIBLE,
1052 ___deadline,
1053 )?
1054 .into_result::<WakeMarker>("get_properties")?;
1055 Ok(_response)
1056 }
1057}
1058
1059#[cfg(target_os = "fuchsia")]
1060impl From<WakeSynchronousProxy> for zx::Handle {
1061 fn from(value: WakeSynchronousProxy) -> Self {
1062 value.into_channel().into()
1063 }
1064}
1065
1066#[cfg(target_os = "fuchsia")]
1067impl From<fidl::Channel> for WakeSynchronousProxy {
1068 fn from(value: fidl::Channel) -> Self {
1069 Self::new(value)
1070 }
1071}
1072
1073#[derive(Debug, Clone)]
1074pub struct WakeProxy {
1075 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1076}
1077
1078impl fidl::endpoints::Proxy for WakeProxy {
1079 type Protocol = WakeMarker;
1080
1081 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1082 Self::new(inner)
1083 }
1084
1085 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1086 self.client.into_channel().map_err(|client| Self { client })
1087 }
1088
1089 fn as_channel(&self) -> &::fidl::AsyncChannel {
1090 self.client.as_channel()
1091 }
1092}
1093
1094impl WakeProxy {
1095 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1097 let protocol_name = <WakeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1098 Self { client: fidl::client::Client::new(channel, protocol_name) }
1099 }
1100
1101 pub fn take_event_stream(&self) -> WakeEventStream {
1107 WakeEventStream { event_receiver: self.client.take_event_receiver() }
1108 }
1109
1110 pub fn r#set_and_wait(
1141 &self,
1142 mut deadline: fidl::BootInstant,
1143 mut setup_done: fidl::Event,
1144 mut alarm_id: &str,
1145 ) -> fidl::client::QueryResponseFut<
1146 ClientSideBatonManagementSetAndWaitResult,
1147 fidl::encoding::DefaultFuchsiaResourceDialect,
1148 > {
1149 WakeProxyInterface::r#set_and_wait(self, deadline, setup_done, alarm_id)
1150 }
1151
1152 pub fn r#cancel(&self, mut alarm_id: &str) -> Result<(), fidl::Error> {
1157 WakeProxyInterface::r#cancel(self, alarm_id)
1158 }
1159
1160 pub fn r#cancel_sync(
1162 &self,
1163 mut alarm_id: &str,
1164 ) -> fidl::client::QueryResponseFut<
1165 ClientSideBatonManagementCancelSyncResult,
1166 fidl::encoding::DefaultFuchsiaResourceDialect,
1167 > {
1168 WakeProxyInterface::r#cancel_sync(self, alarm_id)
1169 }
1170
1171 pub fn r#get_properties(
1174 &self,
1175 ) -> fidl::client::QueryResponseFut<
1176 WakeGetPropertiesResponse,
1177 fidl::encoding::DefaultFuchsiaResourceDialect,
1178 > {
1179 WakeProxyInterface::r#get_properties(self)
1180 }
1181}
1182
1183impl WakeProxyInterface for WakeProxy {
1184 type SetAndWaitResponseFut = fidl::client::QueryResponseFut<
1185 ClientSideBatonManagementSetAndWaitResult,
1186 fidl::encoding::DefaultFuchsiaResourceDialect,
1187 >;
1188 fn r#set_and_wait(
1189 &self,
1190 mut deadline: fidl::BootInstant,
1191 mut setup_done: fidl::Event,
1192 mut alarm_id: &str,
1193 ) -> Self::SetAndWaitResponseFut {
1194 fn _decode(
1195 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1196 ) -> Result<ClientSideBatonManagementSetAndWaitResult, fidl::Error> {
1197 let _response = fidl::client::decode_transaction_body::<
1198 fidl::encoding::FlexibleResultType<
1199 ClientSideBatonManagementSetAndWaitResponse,
1200 WakeError,
1201 >,
1202 fidl::encoding::DefaultFuchsiaResourceDialect,
1203 0x46ea462fcd0246c0,
1204 >(_buf?)?
1205 .into_result::<WakeMarker>("set_and_wait")?;
1206 Ok(_response.map(|x| x.keep_alive))
1207 }
1208 self.client
1209 .send_query_and_decode::<SetAndWaitArgs, ClientSideBatonManagementSetAndWaitResult>(
1210 (deadline, setup_done, alarm_id),
1211 0x46ea462fcd0246c0,
1212 fidl::encoding::DynamicFlags::FLEXIBLE,
1213 _decode,
1214 )
1215 }
1216
1217 fn r#cancel(&self, mut alarm_id: &str) -> Result<(), fidl::Error> {
1218 self.client.send::<ClientSideBatonManagementCancelRequest>(
1219 (alarm_id,),
1220 0x2d59ccae0bda24e3,
1221 fidl::encoding::DynamicFlags::FLEXIBLE,
1222 )
1223 }
1224
1225 type CancelSyncResponseFut = fidl::client::QueryResponseFut<
1226 ClientSideBatonManagementCancelSyncResult,
1227 fidl::encoding::DefaultFuchsiaResourceDialect,
1228 >;
1229 fn r#cancel_sync(&self, mut alarm_id: &str) -> Self::CancelSyncResponseFut {
1230 fn _decode(
1231 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1232 ) -> Result<ClientSideBatonManagementCancelSyncResult, fidl::Error> {
1233 let _response = fidl::client::decode_transaction_body::<
1234 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, WakeError>,
1235 fidl::encoding::DefaultFuchsiaResourceDialect,
1236 0x397477d8067269c3,
1237 >(_buf?)?
1238 .into_result::<WakeMarker>("cancel_sync")?;
1239 Ok(_response.map(|x| x))
1240 }
1241 self.client.send_query_and_decode::<
1242 ClientSideBatonManagementCancelSyncRequest,
1243 ClientSideBatonManagementCancelSyncResult,
1244 >(
1245 (alarm_id,),
1246 0x397477d8067269c3,
1247 fidl::encoding::DynamicFlags::FLEXIBLE,
1248 _decode,
1249 )
1250 }
1251
1252 type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
1253 WakeGetPropertiesResponse,
1254 fidl::encoding::DefaultFuchsiaResourceDialect,
1255 >;
1256 fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
1257 fn _decode(
1258 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1259 ) -> Result<WakeGetPropertiesResponse, fidl::Error> {
1260 let _response = fidl::client::decode_transaction_body::<
1261 fidl::encoding::FlexibleType<WakeGetPropertiesResponse>,
1262 fidl::encoding::DefaultFuchsiaResourceDialect,
1263 0x486a204b6463420,
1264 >(_buf?)?
1265 .into_result::<WakeMarker>("get_properties")?;
1266 Ok(_response)
1267 }
1268 self.client
1269 .send_query_and_decode::<fidl::encoding::EmptyPayload, WakeGetPropertiesResponse>(
1270 (),
1271 0x486a204b6463420,
1272 fidl::encoding::DynamicFlags::FLEXIBLE,
1273 _decode,
1274 )
1275 }
1276}
1277
1278pub struct WakeEventStream {
1279 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1280}
1281
1282impl std::marker::Unpin for WakeEventStream {}
1283
1284impl futures::stream::FusedStream for WakeEventStream {
1285 fn is_terminated(&self) -> bool {
1286 self.event_receiver.is_terminated()
1287 }
1288}
1289
1290impl futures::Stream for WakeEventStream {
1291 type Item = Result<WakeEvent, fidl::Error>;
1292
1293 fn poll_next(
1294 mut self: std::pin::Pin<&mut Self>,
1295 cx: &mut std::task::Context<'_>,
1296 ) -> std::task::Poll<Option<Self::Item>> {
1297 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1298 &mut self.event_receiver,
1299 cx
1300 )?) {
1301 Some(buf) => std::task::Poll::Ready(Some(WakeEvent::decode(buf))),
1302 None => std::task::Poll::Ready(None),
1303 }
1304 }
1305}
1306
1307#[derive(Debug)]
1308pub enum WakeEvent {
1309 #[non_exhaustive]
1310 _UnknownEvent {
1311 ordinal: u64,
1313 },
1314}
1315
1316impl WakeEvent {
1317 fn decode(
1319 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1320 ) -> Result<WakeEvent, fidl::Error> {
1321 let (bytes, _handles) = buf.split_mut();
1322 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1323 debug_assert_eq!(tx_header.tx_id, 0);
1324 match tx_header.ordinal {
1325 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1326 Ok(WakeEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1327 }
1328 _ => Err(fidl::Error::UnknownOrdinal {
1329 ordinal: tx_header.ordinal,
1330 protocol_name: <WakeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1331 }),
1332 }
1333 }
1334}
1335
1336pub struct WakeRequestStream {
1338 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1339 is_terminated: bool,
1340}
1341
1342impl std::marker::Unpin for WakeRequestStream {}
1343
1344impl futures::stream::FusedStream for WakeRequestStream {
1345 fn is_terminated(&self) -> bool {
1346 self.is_terminated
1347 }
1348}
1349
1350impl fidl::endpoints::RequestStream for WakeRequestStream {
1351 type Protocol = WakeMarker;
1352 type ControlHandle = WakeControlHandle;
1353
1354 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1355 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1356 }
1357
1358 fn control_handle(&self) -> Self::ControlHandle {
1359 WakeControlHandle { inner: self.inner.clone() }
1360 }
1361
1362 fn into_inner(
1363 self,
1364 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1365 {
1366 (self.inner, self.is_terminated)
1367 }
1368
1369 fn from_inner(
1370 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1371 is_terminated: bool,
1372 ) -> Self {
1373 Self { inner, is_terminated }
1374 }
1375}
1376
1377impl futures::Stream for WakeRequestStream {
1378 type Item = Result<WakeRequest, fidl::Error>;
1379
1380 fn poll_next(
1381 mut self: std::pin::Pin<&mut Self>,
1382 cx: &mut std::task::Context<'_>,
1383 ) -> std::task::Poll<Option<Self::Item>> {
1384 let this = &mut *self;
1385 if this.inner.check_shutdown(cx) {
1386 this.is_terminated = true;
1387 return std::task::Poll::Ready(None);
1388 }
1389 if this.is_terminated {
1390 panic!("polled WakeRequestStream after completion");
1391 }
1392 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1393 |bytes, handles| {
1394 match this.inner.channel().read_etc(cx, bytes, handles) {
1395 std::task::Poll::Ready(Ok(())) => {}
1396 std::task::Poll::Pending => return std::task::Poll::Pending,
1397 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1398 this.is_terminated = true;
1399 return std::task::Poll::Ready(None);
1400 }
1401 std::task::Poll::Ready(Err(e)) => {
1402 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1403 e.into(),
1404 ))))
1405 }
1406 }
1407
1408 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1410
1411 std::task::Poll::Ready(Some(match header.ordinal {
1412 0x46ea462fcd0246c0 => {
1413 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1414 let mut req = fidl::new_empty!(
1415 SetAndWaitArgs,
1416 fidl::encoding::DefaultFuchsiaResourceDialect
1417 );
1418 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SetAndWaitArgs>(&header, _body_bytes, handles, &mut req)?;
1419 let control_handle = WakeControlHandle { inner: this.inner.clone() };
1420 Ok(WakeRequest::SetAndWait {
1421 deadline: req.deadline,
1422 setup_done: req.setup_done,
1423 alarm_id: req.alarm_id,
1424
1425 responder: WakeSetAndWaitResponder {
1426 control_handle: std::mem::ManuallyDrop::new(control_handle),
1427 tx_id: header.tx_id,
1428 },
1429 })
1430 }
1431 0x2d59ccae0bda24e3 => {
1432 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1433 let mut req = fidl::new_empty!(
1434 ClientSideBatonManagementCancelRequest,
1435 fidl::encoding::DefaultFuchsiaResourceDialect
1436 );
1437 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSideBatonManagementCancelRequest>(&header, _body_bytes, handles, &mut req)?;
1438 let control_handle = WakeControlHandle { inner: this.inner.clone() };
1439 Ok(WakeRequest::Cancel { alarm_id: req.alarm_id, control_handle })
1440 }
1441 0x397477d8067269c3 => {
1442 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1443 let mut req = fidl::new_empty!(
1444 ClientSideBatonManagementCancelSyncRequest,
1445 fidl::encoding::DefaultFuchsiaResourceDialect
1446 );
1447 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSideBatonManagementCancelSyncRequest>(&header, _body_bytes, handles, &mut req)?;
1448 let control_handle = WakeControlHandle { inner: this.inner.clone() };
1449 Ok(WakeRequest::CancelSync {
1450 alarm_id: req.alarm_id,
1451
1452 responder: WakeCancelSyncResponder {
1453 control_handle: std::mem::ManuallyDrop::new(control_handle),
1454 tx_id: header.tx_id,
1455 },
1456 })
1457 }
1458 0x486a204b6463420 => {
1459 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1460 let mut req = fidl::new_empty!(
1461 fidl::encoding::EmptyPayload,
1462 fidl::encoding::DefaultFuchsiaResourceDialect
1463 );
1464 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1465 let control_handle = WakeControlHandle { inner: this.inner.clone() };
1466 Ok(WakeRequest::GetProperties {
1467 responder: WakeGetPropertiesResponder {
1468 control_handle: std::mem::ManuallyDrop::new(control_handle),
1469 tx_id: header.tx_id,
1470 },
1471 })
1472 }
1473 _ if header.tx_id == 0
1474 && header
1475 .dynamic_flags()
1476 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1477 {
1478 Ok(WakeRequest::_UnknownMethod {
1479 ordinal: header.ordinal,
1480 control_handle: WakeControlHandle { inner: this.inner.clone() },
1481 method_type: fidl::MethodType::OneWay,
1482 })
1483 }
1484 _ if header
1485 .dynamic_flags()
1486 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1487 {
1488 this.inner.send_framework_err(
1489 fidl::encoding::FrameworkErr::UnknownMethod,
1490 header.tx_id,
1491 header.ordinal,
1492 header.dynamic_flags(),
1493 (bytes, handles),
1494 )?;
1495 Ok(WakeRequest::_UnknownMethod {
1496 ordinal: header.ordinal,
1497 control_handle: WakeControlHandle { inner: this.inner.clone() },
1498 method_type: fidl::MethodType::TwoWay,
1499 })
1500 }
1501 _ => Err(fidl::Error::UnknownOrdinal {
1502 ordinal: header.ordinal,
1503 protocol_name: <WakeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1504 }),
1505 }))
1506 },
1507 )
1508 }
1509}
1510
1511#[derive(Debug)]
1529pub enum WakeRequest {
1530 SetAndWait {
1561 deadline: fidl::BootInstant,
1562 setup_done: fidl::Event,
1563 alarm_id: String,
1564 responder: WakeSetAndWaitResponder,
1565 },
1566 Cancel { alarm_id: String, control_handle: WakeControlHandle },
1571 CancelSync { alarm_id: String, responder: WakeCancelSyncResponder },
1573 GetProperties { responder: WakeGetPropertiesResponder },
1576 #[non_exhaustive]
1578 _UnknownMethod {
1579 ordinal: u64,
1581 control_handle: WakeControlHandle,
1582 method_type: fidl::MethodType,
1583 },
1584}
1585
1586impl WakeRequest {
1587 #[allow(irrefutable_let_patterns)]
1588 pub fn into_set_and_wait(
1589 self,
1590 ) -> Option<(fidl::BootInstant, fidl::Event, String, WakeSetAndWaitResponder)> {
1591 if let WakeRequest::SetAndWait { deadline, setup_done, alarm_id, responder } = self {
1592 Some((deadline, setup_done, alarm_id, responder))
1593 } else {
1594 None
1595 }
1596 }
1597
1598 #[allow(irrefutable_let_patterns)]
1599 pub fn into_cancel(self) -> Option<(String, WakeControlHandle)> {
1600 if let WakeRequest::Cancel { alarm_id, control_handle } = self {
1601 Some((alarm_id, control_handle))
1602 } else {
1603 None
1604 }
1605 }
1606
1607 #[allow(irrefutable_let_patterns)]
1608 pub fn into_cancel_sync(self) -> Option<(String, WakeCancelSyncResponder)> {
1609 if let WakeRequest::CancelSync { alarm_id, responder } = self {
1610 Some((alarm_id, responder))
1611 } else {
1612 None
1613 }
1614 }
1615
1616 #[allow(irrefutable_let_patterns)]
1617 pub fn into_get_properties(self) -> Option<(WakeGetPropertiesResponder)> {
1618 if let WakeRequest::GetProperties { responder } = self {
1619 Some((responder))
1620 } else {
1621 None
1622 }
1623 }
1624
1625 pub fn method_name(&self) -> &'static str {
1627 match *self {
1628 WakeRequest::SetAndWait { .. } => "set_and_wait",
1629 WakeRequest::Cancel { .. } => "cancel",
1630 WakeRequest::CancelSync { .. } => "cancel_sync",
1631 WakeRequest::GetProperties { .. } => "get_properties",
1632 WakeRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1633 "unknown one-way method"
1634 }
1635 WakeRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1636 "unknown two-way method"
1637 }
1638 }
1639 }
1640}
1641
1642#[derive(Debug, Clone)]
1643pub struct WakeControlHandle {
1644 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1645}
1646
1647impl fidl::endpoints::ControlHandle for WakeControlHandle {
1648 fn shutdown(&self) {
1649 self.inner.shutdown()
1650 }
1651 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1652 self.inner.shutdown_with_epitaph(status)
1653 }
1654
1655 fn is_closed(&self) -> bool {
1656 self.inner.channel().is_closed()
1657 }
1658 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1659 self.inner.channel().on_closed()
1660 }
1661
1662 #[cfg(target_os = "fuchsia")]
1663 fn signal_peer(
1664 &self,
1665 clear_mask: zx::Signals,
1666 set_mask: zx::Signals,
1667 ) -> Result<(), zx_status::Status> {
1668 use fidl::Peered;
1669 self.inner.channel().signal_peer(clear_mask, set_mask)
1670 }
1671}
1672
1673impl WakeControlHandle {}
1674
1675#[must_use = "FIDL methods require a response to be sent"]
1676#[derive(Debug)]
1677pub struct WakeSetAndWaitResponder {
1678 control_handle: std::mem::ManuallyDrop<WakeControlHandle>,
1679 tx_id: u32,
1680}
1681
1682impl std::ops::Drop for WakeSetAndWaitResponder {
1686 fn drop(&mut self) {
1687 self.control_handle.shutdown();
1688 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1690 }
1691}
1692
1693impl fidl::endpoints::Responder for WakeSetAndWaitResponder {
1694 type ControlHandle = WakeControlHandle;
1695
1696 fn control_handle(&self) -> &WakeControlHandle {
1697 &self.control_handle
1698 }
1699
1700 fn drop_without_shutdown(mut self) {
1701 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1703 std::mem::forget(self);
1705 }
1706}
1707
1708impl WakeSetAndWaitResponder {
1709 pub fn send(self, mut result: Result<fidl::EventPair, WakeError>) -> Result<(), fidl::Error> {
1713 let _result = self.send_raw(result);
1714 if _result.is_err() {
1715 self.control_handle.shutdown();
1716 }
1717 self.drop_without_shutdown();
1718 _result
1719 }
1720
1721 pub fn send_no_shutdown_on_err(
1723 self,
1724 mut result: Result<fidl::EventPair, WakeError>,
1725 ) -> Result<(), fidl::Error> {
1726 let _result = self.send_raw(result);
1727 self.drop_without_shutdown();
1728 _result
1729 }
1730
1731 fn send_raw(&self, mut result: Result<fidl::EventPair, WakeError>) -> Result<(), fidl::Error> {
1732 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1733 ClientSideBatonManagementSetAndWaitResponse,
1734 WakeError,
1735 >>(
1736 fidl::encoding::FlexibleResult::new(result.map(|keep_alive| (keep_alive,))),
1737 self.tx_id,
1738 0x46ea462fcd0246c0,
1739 fidl::encoding::DynamicFlags::FLEXIBLE,
1740 )
1741 }
1742}
1743
1744#[must_use = "FIDL methods require a response to be sent"]
1745#[derive(Debug)]
1746pub struct WakeCancelSyncResponder {
1747 control_handle: std::mem::ManuallyDrop<WakeControlHandle>,
1748 tx_id: u32,
1749}
1750
1751impl std::ops::Drop for WakeCancelSyncResponder {
1755 fn drop(&mut self) {
1756 self.control_handle.shutdown();
1757 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1759 }
1760}
1761
1762impl fidl::endpoints::Responder for WakeCancelSyncResponder {
1763 type ControlHandle = WakeControlHandle;
1764
1765 fn control_handle(&self) -> &WakeControlHandle {
1766 &self.control_handle
1767 }
1768
1769 fn drop_without_shutdown(mut self) {
1770 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1772 std::mem::forget(self);
1774 }
1775}
1776
1777impl WakeCancelSyncResponder {
1778 pub fn send(self, mut result: Result<(), WakeError>) -> Result<(), fidl::Error> {
1782 let _result = self.send_raw(result);
1783 if _result.is_err() {
1784 self.control_handle.shutdown();
1785 }
1786 self.drop_without_shutdown();
1787 _result
1788 }
1789
1790 pub fn send_no_shutdown_on_err(
1792 self,
1793 mut result: Result<(), WakeError>,
1794 ) -> Result<(), fidl::Error> {
1795 let _result = self.send_raw(result);
1796 self.drop_without_shutdown();
1797 _result
1798 }
1799
1800 fn send_raw(&self, mut result: Result<(), WakeError>) -> Result<(), fidl::Error> {
1801 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1802 fidl::encoding::EmptyStruct,
1803 WakeError,
1804 >>(
1805 fidl::encoding::FlexibleResult::new(result),
1806 self.tx_id,
1807 0x397477d8067269c3,
1808 fidl::encoding::DynamicFlags::FLEXIBLE,
1809 )
1810 }
1811}
1812
1813#[must_use = "FIDL methods require a response to be sent"]
1814#[derive(Debug)]
1815pub struct WakeGetPropertiesResponder {
1816 control_handle: std::mem::ManuallyDrop<WakeControlHandle>,
1817 tx_id: u32,
1818}
1819
1820impl std::ops::Drop for WakeGetPropertiesResponder {
1824 fn drop(&mut self) {
1825 self.control_handle.shutdown();
1826 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1828 }
1829}
1830
1831impl fidl::endpoints::Responder for WakeGetPropertiesResponder {
1832 type ControlHandle = WakeControlHandle;
1833
1834 fn control_handle(&self) -> &WakeControlHandle {
1835 &self.control_handle
1836 }
1837
1838 fn drop_without_shutdown(mut self) {
1839 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1841 std::mem::forget(self);
1843 }
1844}
1845
1846impl WakeGetPropertiesResponder {
1847 pub fn send(self, mut payload: &WakeGetPropertiesResponse) -> Result<(), fidl::Error> {
1851 let _result = self.send_raw(payload);
1852 if _result.is_err() {
1853 self.control_handle.shutdown();
1854 }
1855 self.drop_without_shutdown();
1856 _result
1857 }
1858
1859 pub fn send_no_shutdown_on_err(
1861 self,
1862 mut payload: &WakeGetPropertiesResponse,
1863 ) -> Result<(), fidl::Error> {
1864 let _result = self.send_raw(payload);
1865 self.drop_without_shutdown();
1866 _result
1867 }
1868
1869 fn send_raw(&self, mut payload: &WakeGetPropertiesResponse) -> Result<(), fidl::Error> {
1870 self.control_handle.inner.send::<fidl::encoding::FlexibleType<WakeGetPropertiesResponse>>(
1871 fidl::encoding::Flexible::new(payload),
1872 self.tx_id,
1873 0x486a204b6463420,
1874 fidl::encoding::DynamicFlags::FLEXIBLE,
1875 )
1876 }
1877}
1878
1879mod internal {
1880 use super::*;
1881
1882 impl fidl::encoding::ResourceTypeMarker for ClientSideBatonManagementSetAndWaitResponse {
1883 type Borrowed<'a> = &'a mut Self;
1884 fn take_or_borrow<'a>(
1885 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1886 ) -> Self::Borrowed<'a> {
1887 value
1888 }
1889 }
1890
1891 unsafe impl fidl::encoding::TypeMarker for ClientSideBatonManagementSetAndWaitResponse {
1892 type Owned = Self;
1893
1894 #[inline(always)]
1895 fn inline_align(_context: fidl::encoding::Context) -> usize {
1896 4
1897 }
1898
1899 #[inline(always)]
1900 fn inline_size(_context: fidl::encoding::Context) -> usize {
1901 4
1902 }
1903 }
1904
1905 unsafe impl
1906 fidl::encoding::Encode<
1907 ClientSideBatonManagementSetAndWaitResponse,
1908 fidl::encoding::DefaultFuchsiaResourceDialect,
1909 > for &mut ClientSideBatonManagementSetAndWaitResponse
1910 {
1911 #[inline]
1912 unsafe fn encode(
1913 self,
1914 encoder: &mut fidl::encoding::Encoder<
1915 '_,
1916 fidl::encoding::DefaultFuchsiaResourceDialect,
1917 >,
1918 offset: usize,
1919 _depth: fidl::encoding::Depth,
1920 ) -> fidl::Result<()> {
1921 encoder.debug_check_bounds::<ClientSideBatonManagementSetAndWaitResponse>(offset);
1922 fidl::encoding::Encode::<
1924 ClientSideBatonManagementSetAndWaitResponse,
1925 fidl::encoding::DefaultFuchsiaResourceDialect,
1926 >::encode(
1927 (<fidl::encoding::HandleType<
1928 fidl::EventPair,
1929 { fidl::ObjectType::EVENTPAIR.into_raw() },
1930 16387,
1931 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1932 &mut self.keep_alive
1933 ),),
1934 encoder,
1935 offset,
1936 _depth,
1937 )
1938 }
1939 }
1940 unsafe impl<
1941 T0: fidl::encoding::Encode<
1942 fidl::encoding::HandleType<
1943 fidl::EventPair,
1944 { fidl::ObjectType::EVENTPAIR.into_raw() },
1945 16387,
1946 >,
1947 fidl::encoding::DefaultFuchsiaResourceDialect,
1948 >,
1949 >
1950 fidl::encoding::Encode<
1951 ClientSideBatonManagementSetAndWaitResponse,
1952 fidl::encoding::DefaultFuchsiaResourceDialect,
1953 > for (T0,)
1954 {
1955 #[inline]
1956 unsafe fn encode(
1957 self,
1958 encoder: &mut fidl::encoding::Encoder<
1959 '_,
1960 fidl::encoding::DefaultFuchsiaResourceDialect,
1961 >,
1962 offset: usize,
1963 depth: fidl::encoding::Depth,
1964 ) -> fidl::Result<()> {
1965 encoder.debug_check_bounds::<ClientSideBatonManagementSetAndWaitResponse>(offset);
1966 self.0.encode(encoder, offset + 0, depth)?;
1970 Ok(())
1971 }
1972 }
1973
1974 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1975 for ClientSideBatonManagementSetAndWaitResponse
1976 {
1977 #[inline(always)]
1978 fn new_empty() -> Self {
1979 Self {
1980 keep_alive: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 16387>, fidl::encoding::DefaultFuchsiaResourceDialect),
1981 }
1982 }
1983
1984 #[inline]
1985 unsafe fn decode(
1986 &mut self,
1987 decoder: &mut fidl::encoding::Decoder<
1988 '_,
1989 fidl::encoding::DefaultFuchsiaResourceDialect,
1990 >,
1991 offset: usize,
1992 _depth: fidl::encoding::Depth,
1993 ) -> fidl::Result<()> {
1994 decoder.debug_check_bounds::<Self>(offset);
1995 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 16387>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.keep_alive, decoder, offset + 0, _depth)?;
1997 Ok(())
1998 }
1999 }
2000
2001 impl fidl::encoding::ResourceTypeMarker for SetAndWaitArgs {
2002 type Borrowed<'a> = &'a mut Self;
2003 fn take_or_borrow<'a>(
2004 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2005 ) -> Self::Borrowed<'a> {
2006 value
2007 }
2008 }
2009
2010 unsafe impl fidl::encoding::TypeMarker for SetAndWaitArgs {
2011 type Owned = Self;
2012
2013 #[inline(always)]
2014 fn inline_align(_context: fidl::encoding::Context) -> usize {
2015 8
2016 }
2017
2018 #[inline(always)]
2019 fn inline_size(_context: fidl::encoding::Context) -> usize {
2020 32
2021 }
2022 }
2023
2024 unsafe impl
2025 fidl::encoding::Encode<SetAndWaitArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
2026 for &mut SetAndWaitArgs
2027 {
2028 #[inline]
2029 unsafe fn encode(
2030 self,
2031 encoder: &mut fidl::encoding::Encoder<
2032 '_,
2033 fidl::encoding::DefaultFuchsiaResourceDialect,
2034 >,
2035 offset: usize,
2036 _depth: fidl::encoding::Depth,
2037 ) -> fidl::Result<()> {
2038 encoder.debug_check_bounds::<SetAndWaitArgs>(offset);
2039 fidl::encoding::Encode::<SetAndWaitArgs, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2041 (
2042 <fidl::BootInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.deadline),
2043 <fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.setup_done),
2044 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.alarm_id),
2045 ),
2046 encoder, offset, _depth
2047 )
2048 }
2049 }
2050 unsafe impl<
2051 T0: fidl::encoding::Encode<
2052 fidl::BootInstant,
2053 fidl::encoding::DefaultFuchsiaResourceDialect,
2054 >,
2055 T1: fidl::encoding::Encode<
2056 fidl::encoding::HandleType<
2057 fidl::Event,
2058 { fidl::ObjectType::EVENT.into_raw() },
2059 2147483648,
2060 >,
2061 fidl::encoding::DefaultFuchsiaResourceDialect,
2062 >,
2063 T2: fidl::encoding::Encode<
2064 fidl::encoding::BoundedString<128>,
2065 fidl::encoding::DefaultFuchsiaResourceDialect,
2066 >,
2067 > fidl::encoding::Encode<SetAndWaitArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
2068 for (T0, T1, T2)
2069 {
2070 #[inline]
2071 unsafe fn encode(
2072 self,
2073 encoder: &mut fidl::encoding::Encoder<
2074 '_,
2075 fidl::encoding::DefaultFuchsiaResourceDialect,
2076 >,
2077 offset: usize,
2078 depth: fidl::encoding::Depth,
2079 ) -> fidl::Result<()> {
2080 encoder.debug_check_bounds::<SetAndWaitArgs>(offset);
2081 unsafe {
2084 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2085 (ptr as *mut u64).write_unaligned(0);
2086 }
2087 self.0.encode(encoder, offset + 0, depth)?;
2089 self.1.encode(encoder, offset + 8, depth)?;
2090 self.2.encode(encoder, offset + 16, depth)?;
2091 Ok(())
2092 }
2093 }
2094
2095 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2096 for SetAndWaitArgs
2097 {
2098 #[inline(always)]
2099 fn new_empty() -> Self {
2100 Self {
2101 deadline: fidl::new_empty!(
2102 fidl::BootInstant,
2103 fidl::encoding::DefaultFuchsiaResourceDialect
2104 ),
2105 setup_done: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2106 alarm_id: fidl::new_empty!(
2107 fidl::encoding::BoundedString<128>,
2108 fidl::encoding::DefaultFuchsiaResourceDialect
2109 ),
2110 }
2111 }
2112
2113 #[inline]
2114 unsafe fn decode(
2115 &mut self,
2116 decoder: &mut fidl::encoding::Decoder<
2117 '_,
2118 fidl::encoding::DefaultFuchsiaResourceDialect,
2119 >,
2120 offset: usize,
2121 _depth: fidl::encoding::Depth,
2122 ) -> fidl::Result<()> {
2123 decoder.debug_check_bounds::<Self>(offset);
2124 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2126 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2127 let mask = 0xffffffff00000000u64;
2128 let maskedval = padval & mask;
2129 if maskedval != 0 {
2130 return Err(fidl::Error::NonZeroPadding {
2131 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2132 });
2133 }
2134 fidl::decode!(
2135 fidl::BootInstant,
2136 fidl::encoding::DefaultFuchsiaResourceDialect,
2137 &mut self.deadline,
2138 decoder,
2139 offset + 0,
2140 _depth
2141 )?;
2142 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.setup_done, decoder, offset + 8, _depth)?;
2143 fidl::decode!(
2144 fidl::encoding::BoundedString<128>,
2145 fidl::encoding::DefaultFuchsiaResourceDialect,
2146 &mut self.alarm_id,
2147 decoder,
2148 offset + 16,
2149 _depth
2150 )?;
2151 Ok(())
2152 }
2153 }
2154}