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_testing_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct FakeClockCancelEventRequest {
16 pub event: fidl::EventPair,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for FakeClockCancelEventRequest
21{
22}
23
24#[derive(Debug, PartialEq)]
25pub struct FakeClockControlAddStopPointRequest {
26 pub deadline_id: fidl_fuchsia_testing_deadline::DeadlineId,
27 pub event_type: DeadlineEventType,
28 pub on_stop: fidl::EventPair,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32 for FakeClockControlAddStopPointRequest
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37pub struct FakeClockRegisterEventRequest {
38 pub event: fidl::EventPair,
39 pub time: i64,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for FakeClockRegisterEventRequest
44{
45}
46
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct FakeClockRescheduleEventRequest {
49 pub event: fidl::EventPair,
50 pub time: i64,
51}
52
53impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
54 for FakeClockRescheduleEventRequest
55{
56}
57
58#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
59pub struct FakeClockMarker;
60
61impl fidl::endpoints::ProtocolMarker for FakeClockMarker {
62 type Proxy = FakeClockProxy;
63 type RequestStream = FakeClockRequestStream;
64 #[cfg(target_os = "fuchsia")]
65 type SynchronousProxy = FakeClockSynchronousProxy;
66
67 const DEBUG_NAME: &'static str = "fuchsia.testing.FakeClock";
68}
69impl fidl::endpoints::DiscoverableProtocolMarker for FakeClockMarker {}
70
71pub trait FakeClockProxyInterface: Send + Sync {
72 type GetResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
73 fn r#get(&self) -> Self::GetResponseFut;
74 fn r#register_event(&self, event: fidl::EventPair, time: i64) -> Result<(), fidl::Error>;
75 type RescheduleEventResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
76 fn r#reschedule_event(
77 &self,
78 event: fidl::EventPair,
79 time: i64,
80 ) -> Self::RescheduleEventResponseFut;
81 type CancelEventResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
82 fn r#cancel_event(&self, event: fidl::EventPair) -> Self::CancelEventResponseFut;
83 type CreateNamedDeadlineResponseFut: std::future::Future<Output = Result<i64, fidl::Error>>
84 + Send;
85 fn r#create_named_deadline(
86 &self,
87 id: &fidl_fuchsia_testing_deadline::DeadlineId,
88 duration: i64,
89 ) -> Self::CreateNamedDeadlineResponseFut;
90}
91#[derive(Debug)]
92#[cfg(target_os = "fuchsia")]
93pub struct FakeClockSynchronousProxy {
94 client: fidl::client::sync::Client,
95}
96
97#[cfg(target_os = "fuchsia")]
98impl fidl::endpoints::SynchronousProxy for FakeClockSynchronousProxy {
99 type Proxy = FakeClockProxy;
100 type Protocol = FakeClockMarker;
101
102 fn from_channel(inner: fidl::Channel) -> Self {
103 Self::new(inner)
104 }
105
106 fn into_channel(self) -> fidl::Channel {
107 self.client.into_channel()
108 }
109
110 fn as_channel(&self) -> &fidl::Channel {
111 self.client.as_channel()
112 }
113}
114
115#[cfg(target_os = "fuchsia")]
116impl FakeClockSynchronousProxy {
117 pub fn new(channel: fidl::Channel) -> Self {
118 let protocol_name = <FakeClockMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
119 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
120 }
121
122 pub fn into_channel(self) -> fidl::Channel {
123 self.client.into_channel()
124 }
125
126 pub fn wait_for_event(
129 &self,
130 deadline: zx::MonotonicInstant,
131 ) -> Result<FakeClockEvent, fidl::Error> {
132 FakeClockEvent::decode(self.client.wait_for_event(deadline)?)
133 }
134
135 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<i64, fidl::Error> {
137 let _response =
138 self.client.send_query::<fidl::encoding::EmptyPayload, FakeClockGetResponse>(
139 (),
140 0x2a08c060e0b95e7c,
141 fidl::encoding::DynamicFlags::empty(),
142 ___deadline,
143 )?;
144 Ok(_response.time)
145 }
146
147 pub fn r#register_event(
152 &self,
153 mut event: fidl::EventPair,
154 mut time: i64,
155 ) -> Result<(), fidl::Error> {
156 self.client.send::<FakeClockRegisterEventRequest>(
157 (event, time),
158 0x79917345514b5f95,
159 fidl::encoding::DynamicFlags::empty(),
160 )
161 }
162
163 pub fn r#reschedule_event(
168 &self,
169 mut event: fidl::EventPair,
170 mut time: i64,
171 ___deadline: zx::MonotonicInstant,
172 ) -> Result<(), fidl::Error> {
173 let _response = self
174 .client
175 .send_query::<FakeClockRescheduleEventRequest, fidl::encoding::EmptyPayload>(
176 (event, time),
177 0x4e5207df2b0dba46,
178 fidl::encoding::DynamicFlags::empty(),
179 ___deadline,
180 )?;
181 Ok(_response)
182 }
183
184 pub fn r#cancel_event(
188 &self,
189 mut event: fidl::EventPair,
190 ___deadline: zx::MonotonicInstant,
191 ) -> Result<(), fidl::Error> {
192 let _response =
193 self.client.send_query::<FakeClockCancelEventRequest, fidl::encoding::EmptyPayload>(
194 (event,),
195 0x18bbdb18faa6cac0,
196 fidl::encoding::DynamicFlags::empty(),
197 ___deadline,
198 )?;
199 Ok(_response)
200 }
201
202 pub fn r#create_named_deadline(
209 &self,
210 mut id: &fidl_fuchsia_testing_deadline::DeadlineId,
211 mut duration: i64,
212 ___deadline: zx::MonotonicInstant,
213 ) -> Result<i64, fidl::Error> {
214 let _response = self.client.send_query::<
215 FakeClockCreateNamedDeadlineRequest,
216 FakeClockCreateNamedDeadlineResponse,
217 >(
218 (id, duration,),
219 0xf7a02c2ac2d116c,
220 fidl::encoding::DynamicFlags::empty(),
221 ___deadline,
222 )?;
223 Ok(_response.deadline)
224 }
225}
226
227#[cfg(target_os = "fuchsia")]
228impl From<FakeClockSynchronousProxy> for zx::Handle {
229 fn from(value: FakeClockSynchronousProxy) -> Self {
230 value.into_channel().into()
231 }
232}
233
234#[cfg(target_os = "fuchsia")]
235impl From<fidl::Channel> for FakeClockSynchronousProxy {
236 fn from(value: fidl::Channel) -> Self {
237 Self::new(value)
238 }
239}
240
241#[derive(Debug, Clone)]
242pub struct FakeClockProxy {
243 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
244}
245
246impl fidl::endpoints::Proxy for FakeClockProxy {
247 type Protocol = FakeClockMarker;
248
249 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
250 Self::new(inner)
251 }
252
253 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
254 self.client.into_channel().map_err(|client| Self { client })
255 }
256
257 fn as_channel(&self) -> &::fidl::AsyncChannel {
258 self.client.as_channel()
259 }
260}
261
262impl FakeClockProxy {
263 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
265 let protocol_name = <FakeClockMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
266 Self { client: fidl::client::Client::new(channel, protocol_name) }
267 }
268
269 pub fn take_event_stream(&self) -> FakeClockEventStream {
275 FakeClockEventStream { event_receiver: self.client.take_event_receiver() }
276 }
277
278 pub fn r#get(
280 &self,
281 ) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
282 FakeClockProxyInterface::r#get(self)
283 }
284
285 pub fn r#register_event(
290 &self,
291 mut event: fidl::EventPair,
292 mut time: i64,
293 ) -> Result<(), fidl::Error> {
294 FakeClockProxyInterface::r#register_event(self, event, time)
295 }
296
297 pub fn r#reschedule_event(
302 &self,
303 mut event: fidl::EventPair,
304 mut time: i64,
305 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
306 FakeClockProxyInterface::r#reschedule_event(self, event, time)
307 }
308
309 pub fn r#cancel_event(
313 &self,
314 mut event: fidl::EventPair,
315 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
316 FakeClockProxyInterface::r#cancel_event(self, event)
317 }
318
319 pub fn r#create_named_deadline(
326 &self,
327 mut id: &fidl_fuchsia_testing_deadline::DeadlineId,
328 mut duration: i64,
329 ) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
330 FakeClockProxyInterface::r#create_named_deadline(self, id, duration)
331 }
332}
333
334impl FakeClockProxyInterface for FakeClockProxy {
335 type GetResponseFut =
336 fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
337 fn r#get(&self) -> Self::GetResponseFut {
338 fn _decode(
339 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
340 ) -> Result<i64, fidl::Error> {
341 let _response = fidl::client::decode_transaction_body::<
342 FakeClockGetResponse,
343 fidl::encoding::DefaultFuchsiaResourceDialect,
344 0x2a08c060e0b95e7c,
345 >(_buf?)?;
346 Ok(_response.time)
347 }
348 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i64>(
349 (),
350 0x2a08c060e0b95e7c,
351 fidl::encoding::DynamicFlags::empty(),
352 _decode,
353 )
354 }
355
356 fn r#register_event(
357 &self,
358 mut event: fidl::EventPair,
359 mut time: i64,
360 ) -> Result<(), fidl::Error> {
361 self.client.send::<FakeClockRegisterEventRequest>(
362 (event, time),
363 0x79917345514b5f95,
364 fidl::encoding::DynamicFlags::empty(),
365 )
366 }
367
368 type RescheduleEventResponseFut =
369 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
370 fn r#reschedule_event(
371 &self,
372 mut event: fidl::EventPair,
373 mut time: i64,
374 ) -> Self::RescheduleEventResponseFut {
375 fn _decode(
376 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
377 ) -> Result<(), fidl::Error> {
378 let _response = fidl::client::decode_transaction_body::<
379 fidl::encoding::EmptyPayload,
380 fidl::encoding::DefaultFuchsiaResourceDialect,
381 0x4e5207df2b0dba46,
382 >(_buf?)?;
383 Ok(_response)
384 }
385 self.client.send_query_and_decode::<FakeClockRescheduleEventRequest, ()>(
386 (event, time),
387 0x4e5207df2b0dba46,
388 fidl::encoding::DynamicFlags::empty(),
389 _decode,
390 )
391 }
392
393 type CancelEventResponseFut =
394 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
395 fn r#cancel_event(&self, mut event: fidl::EventPair) -> Self::CancelEventResponseFut {
396 fn _decode(
397 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
398 ) -> Result<(), fidl::Error> {
399 let _response = fidl::client::decode_transaction_body::<
400 fidl::encoding::EmptyPayload,
401 fidl::encoding::DefaultFuchsiaResourceDialect,
402 0x18bbdb18faa6cac0,
403 >(_buf?)?;
404 Ok(_response)
405 }
406 self.client.send_query_and_decode::<FakeClockCancelEventRequest, ()>(
407 (event,),
408 0x18bbdb18faa6cac0,
409 fidl::encoding::DynamicFlags::empty(),
410 _decode,
411 )
412 }
413
414 type CreateNamedDeadlineResponseFut =
415 fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
416 fn r#create_named_deadline(
417 &self,
418 mut id: &fidl_fuchsia_testing_deadline::DeadlineId,
419 mut duration: i64,
420 ) -> Self::CreateNamedDeadlineResponseFut {
421 fn _decode(
422 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
423 ) -> Result<i64, fidl::Error> {
424 let _response = fidl::client::decode_transaction_body::<
425 FakeClockCreateNamedDeadlineResponse,
426 fidl::encoding::DefaultFuchsiaResourceDialect,
427 0xf7a02c2ac2d116c,
428 >(_buf?)?;
429 Ok(_response.deadline)
430 }
431 self.client.send_query_and_decode::<FakeClockCreateNamedDeadlineRequest, i64>(
432 (id, duration),
433 0xf7a02c2ac2d116c,
434 fidl::encoding::DynamicFlags::empty(),
435 _decode,
436 )
437 }
438}
439
440pub struct FakeClockEventStream {
441 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
442}
443
444impl std::marker::Unpin for FakeClockEventStream {}
445
446impl futures::stream::FusedStream for FakeClockEventStream {
447 fn is_terminated(&self) -> bool {
448 self.event_receiver.is_terminated()
449 }
450}
451
452impl futures::Stream for FakeClockEventStream {
453 type Item = Result<FakeClockEvent, fidl::Error>;
454
455 fn poll_next(
456 mut self: std::pin::Pin<&mut Self>,
457 cx: &mut std::task::Context<'_>,
458 ) -> std::task::Poll<Option<Self::Item>> {
459 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
460 &mut self.event_receiver,
461 cx
462 )?) {
463 Some(buf) => std::task::Poll::Ready(Some(FakeClockEvent::decode(buf))),
464 None => std::task::Poll::Ready(None),
465 }
466 }
467}
468
469#[derive(Debug)]
470pub enum FakeClockEvent {}
471
472impl FakeClockEvent {
473 fn decode(
475 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
476 ) -> Result<FakeClockEvent, fidl::Error> {
477 let (bytes, _handles) = buf.split_mut();
478 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
479 debug_assert_eq!(tx_header.tx_id, 0);
480 match tx_header.ordinal {
481 _ => Err(fidl::Error::UnknownOrdinal {
482 ordinal: tx_header.ordinal,
483 protocol_name: <FakeClockMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
484 }),
485 }
486 }
487}
488
489pub struct FakeClockRequestStream {
491 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
492 is_terminated: bool,
493}
494
495impl std::marker::Unpin for FakeClockRequestStream {}
496
497impl futures::stream::FusedStream for FakeClockRequestStream {
498 fn is_terminated(&self) -> bool {
499 self.is_terminated
500 }
501}
502
503impl fidl::endpoints::RequestStream for FakeClockRequestStream {
504 type Protocol = FakeClockMarker;
505 type ControlHandle = FakeClockControlHandle;
506
507 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
508 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
509 }
510
511 fn control_handle(&self) -> Self::ControlHandle {
512 FakeClockControlHandle { inner: self.inner.clone() }
513 }
514
515 fn into_inner(
516 self,
517 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
518 {
519 (self.inner, self.is_terminated)
520 }
521
522 fn from_inner(
523 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
524 is_terminated: bool,
525 ) -> Self {
526 Self { inner, is_terminated }
527 }
528}
529
530impl futures::Stream for FakeClockRequestStream {
531 type Item = Result<FakeClockRequest, fidl::Error>;
532
533 fn poll_next(
534 mut self: std::pin::Pin<&mut Self>,
535 cx: &mut std::task::Context<'_>,
536 ) -> std::task::Poll<Option<Self::Item>> {
537 let this = &mut *self;
538 if this.inner.check_shutdown(cx) {
539 this.is_terminated = true;
540 return std::task::Poll::Ready(None);
541 }
542 if this.is_terminated {
543 panic!("polled FakeClockRequestStream after completion");
544 }
545 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
546 |bytes, handles| {
547 match this.inner.channel().read_etc(cx, bytes, handles) {
548 std::task::Poll::Ready(Ok(())) => {}
549 std::task::Poll::Pending => return std::task::Poll::Pending,
550 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
551 this.is_terminated = true;
552 return std::task::Poll::Ready(None);
553 }
554 std::task::Poll::Ready(Err(e)) => {
555 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
556 e.into(),
557 ))))
558 }
559 }
560
561 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
563
564 std::task::Poll::Ready(Some(match header.ordinal {
565 0x2a08c060e0b95e7c => {
566 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
567 let mut req = fidl::new_empty!(
568 fidl::encoding::EmptyPayload,
569 fidl::encoding::DefaultFuchsiaResourceDialect
570 );
571 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
572 let control_handle = FakeClockControlHandle { inner: this.inner.clone() };
573 Ok(FakeClockRequest::Get {
574 responder: FakeClockGetResponder {
575 control_handle: std::mem::ManuallyDrop::new(control_handle),
576 tx_id: header.tx_id,
577 },
578 })
579 }
580 0x79917345514b5f95 => {
581 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
582 let mut req = fidl::new_empty!(
583 FakeClockRegisterEventRequest,
584 fidl::encoding::DefaultFuchsiaResourceDialect
585 );
586 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FakeClockRegisterEventRequest>(&header, _body_bytes, handles, &mut req)?;
587 let control_handle = FakeClockControlHandle { inner: this.inner.clone() };
588 Ok(FakeClockRequest::RegisterEvent {
589 event: req.event,
590 time: req.time,
591
592 control_handle,
593 })
594 }
595 0x4e5207df2b0dba46 => {
596 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
597 let mut req = fidl::new_empty!(
598 FakeClockRescheduleEventRequest,
599 fidl::encoding::DefaultFuchsiaResourceDialect
600 );
601 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FakeClockRescheduleEventRequest>(&header, _body_bytes, handles, &mut req)?;
602 let control_handle = FakeClockControlHandle { inner: this.inner.clone() };
603 Ok(FakeClockRequest::RescheduleEvent {
604 event: req.event,
605 time: req.time,
606
607 responder: FakeClockRescheduleEventResponder {
608 control_handle: std::mem::ManuallyDrop::new(control_handle),
609 tx_id: header.tx_id,
610 },
611 })
612 }
613 0x18bbdb18faa6cac0 => {
614 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
615 let mut req = fidl::new_empty!(
616 FakeClockCancelEventRequest,
617 fidl::encoding::DefaultFuchsiaResourceDialect
618 );
619 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FakeClockCancelEventRequest>(&header, _body_bytes, handles, &mut req)?;
620 let control_handle = FakeClockControlHandle { inner: this.inner.clone() };
621 Ok(FakeClockRequest::CancelEvent {
622 event: req.event,
623
624 responder: FakeClockCancelEventResponder {
625 control_handle: std::mem::ManuallyDrop::new(control_handle),
626 tx_id: header.tx_id,
627 },
628 })
629 }
630 0xf7a02c2ac2d116c => {
631 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
632 let mut req = fidl::new_empty!(
633 FakeClockCreateNamedDeadlineRequest,
634 fidl::encoding::DefaultFuchsiaResourceDialect
635 );
636 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FakeClockCreateNamedDeadlineRequest>(&header, _body_bytes, handles, &mut req)?;
637 let control_handle = FakeClockControlHandle { inner: this.inner.clone() };
638 Ok(FakeClockRequest::CreateNamedDeadline {
639 id: req.id,
640 duration: req.duration,
641
642 responder: FakeClockCreateNamedDeadlineResponder {
643 control_handle: std::mem::ManuallyDrop::new(control_handle),
644 tx_id: header.tx_id,
645 },
646 })
647 }
648 _ => Err(fidl::Error::UnknownOrdinal {
649 ordinal: header.ordinal,
650 protocol_name:
651 <FakeClockMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
652 }),
653 }))
654 },
655 )
656 }
657}
658
659#[derive(Debug)]
661pub enum FakeClockRequest {
662 Get { responder: FakeClockGetResponder },
664 RegisterEvent { event: fidl::EventPair, time: i64, control_handle: FakeClockControlHandle },
669 RescheduleEvent {
674 event: fidl::EventPair,
675 time: i64,
676 responder: FakeClockRescheduleEventResponder,
677 },
678 CancelEvent { event: fidl::EventPair, responder: FakeClockCancelEventResponder },
682 CreateNamedDeadline {
689 id: fidl_fuchsia_testing_deadline::DeadlineId,
690 duration: i64,
691 responder: FakeClockCreateNamedDeadlineResponder,
692 },
693}
694
695impl FakeClockRequest {
696 #[allow(irrefutable_let_patterns)]
697 pub fn into_get(self) -> Option<(FakeClockGetResponder)> {
698 if let FakeClockRequest::Get { responder } = self {
699 Some((responder))
700 } else {
701 None
702 }
703 }
704
705 #[allow(irrefutable_let_patterns)]
706 pub fn into_register_event(self) -> Option<(fidl::EventPair, i64, FakeClockControlHandle)> {
707 if let FakeClockRequest::RegisterEvent { event, time, control_handle } = self {
708 Some((event, time, control_handle))
709 } else {
710 None
711 }
712 }
713
714 #[allow(irrefutable_let_patterns)]
715 pub fn into_reschedule_event(
716 self,
717 ) -> Option<(fidl::EventPair, i64, FakeClockRescheduleEventResponder)> {
718 if let FakeClockRequest::RescheduleEvent { event, time, responder } = self {
719 Some((event, time, responder))
720 } else {
721 None
722 }
723 }
724
725 #[allow(irrefutable_let_patterns)]
726 pub fn into_cancel_event(self) -> Option<(fidl::EventPair, FakeClockCancelEventResponder)> {
727 if let FakeClockRequest::CancelEvent { event, responder } = self {
728 Some((event, responder))
729 } else {
730 None
731 }
732 }
733
734 #[allow(irrefutable_let_patterns)]
735 pub fn into_create_named_deadline(
736 self,
737 ) -> Option<(
738 fidl_fuchsia_testing_deadline::DeadlineId,
739 i64,
740 FakeClockCreateNamedDeadlineResponder,
741 )> {
742 if let FakeClockRequest::CreateNamedDeadline { id, duration, responder } = self {
743 Some((id, duration, responder))
744 } else {
745 None
746 }
747 }
748
749 pub fn method_name(&self) -> &'static str {
751 match *self {
752 FakeClockRequest::Get { .. } => "get",
753 FakeClockRequest::RegisterEvent { .. } => "register_event",
754 FakeClockRequest::RescheduleEvent { .. } => "reschedule_event",
755 FakeClockRequest::CancelEvent { .. } => "cancel_event",
756 FakeClockRequest::CreateNamedDeadline { .. } => "create_named_deadline",
757 }
758 }
759}
760
761#[derive(Debug, Clone)]
762pub struct FakeClockControlHandle {
763 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
764}
765
766impl fidl::endpoints::ControlHandle for FakeClockControlHandle {
767 fn shutdown(&self) {
768 self.inner.shutdown()
769 }
770 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
771 self.inner.shutdown_with_epitaph(status)
772 }
773
774 fn is_closed(&self) -> bool {
775 self.inner.channel().is_closed()
776 }
777 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
778 self.inner.channel().on_closed()
779 }
780
781 #[cfg(target_os = "fuchsia")]
782 fn signal_peer(
783 &self,
784 clear_mask: zx::Signals,
785 set_mask: zx::Signals,
786 ) -> Result<(), zx_status::Status> {
787 use fidl::Peered;
788 self.inner.channel().signal_peer(clear_mask, set_mask)
789 }
790}
791
792impl FakeClockControlHandle {}
793
794#[must_use = "FIDL methods require a response to be sent"]
795#[derive(Debug)]
796pub struct FakeClockGetResponder {
797 control_handle: std::mem::ManuallyDrop<FakeClockControlHandle>,
798 tx_id: u32,
799}
800
801impl std::ops::Drop for FakeClockGetResponder {
805 fn drop(&mut self) {
806 self.control_handle.shutdown();
807 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
809 }
810}
811
812impl fidl::endpoints::Responder for FakeClockGetResponder {
813 type ControlHandle = FakeClockControlHandle;
814
815 fn control_handle(&self) -> &FakeClockControlHandle {
816 &self.control_handle
817 }
818
819 fn drop_without_shutdown(mut self) {
820 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
822 std::mem::forget(self);
824 }
825}
826
827impl FakeClockGetResponder {
828 pub fn send(self, mut time: i64) -> Result<(), fidl::Error> {
832 let _result = self.send_raw(time);
833 if _result.is_err() {
834 self.control_handle.shutdown();
835 }
836 self.drop_without_shutdown();
837 _result
838 }
839
840 pub fn send_no_shutdown_on_err(self, mut time: i64) -> Result<(), fidl::Error> {
842 let _result = self.send_raw(time);
843 self.drop_without_shutdown();
844 _result
845 }
846
847 fn send_raw(&self, mut time: i64) -> Result<(), fidl::Error> {
848 self.control_handle.inner.send::<FakeClockGetResponse>(
849 (time,),
850 self.tx_id,
851 0x2a08c060e0b95e7c,
852 fidl::encoding::DynamicFlags::empty(),
853 )
854 }
855}
856
857#[must_use = "FIDL methods require a response to be sent"]
858#[derive(Debug)]
859pub struct FakeClockRescheduleEventResponder {
860 control_handle: std::mem::ManuallyDrop<FakeClockControlHandle>,
861 tx_id: u32,
862}
863
864impl std::ops::Drop for FakeClockRescheduleEventResponder {
868 fn drop(&mut self) {
869 self.control_handle.shutdown();
870 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
872 }
873}
874
875impl fidl::endpoints::Responder for FakeClockRescheduleEventResponder {
876 type ControlHandle = FakeClockControlHandle;
877
878 fn control_handle(&self) -> &FakeClockControlHandle {
879 &self.control_handle
880 }
881
882 fn drop_without_shutdown(mut self) {
883 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
885 std::mem::forget(self);
887 }
888}
889
890impl FakeClockRescheduleEventResponder {
891 pub fn send(self) -> Result<(), fidl::Error> {
895 let _result = self.send_raw();
896 if _result.is_err() {
897 self.control_handle.shutdown();
898 }
899 self.drop_without_shutdown();
900 _result
901 }
902
903 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
905 let _result = self.send_raw();
906 self.drop_without_shutdown();
907 _result
908 }
909
910 fn send_raw(&self) -> Result<(), fidl::Error> {
911 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
912 (),
913 self.tx_id,
914 0x4e5207df2b0dba46,
915 fidl::encoding::DynamicFlags::empty(),
916 )
917 }
918}
919
920#[must_use = "FIDL methods require a response to be sent"]
921#[derive(Debug)]
922pub struct FakeClockCancelEventResponder {
923 control_handle: std::mem::ManuallyDrop<FakeClockControlHandle>,
924 tx_id: u32,
925}
926
927impl std::ops::Drop for FakeClockCancelEventResponder {
931 fn drop(&mut self) {
932 self.control_handle.shutdown();
933 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
935 }
936}
937
938impl fidl::endpoints::Responder for FakeClockCancelEventResponder {
939 type ControlHandle = FakeClockControlHandle;
940
941 fn control_handle(&self) -> &FakeClockControlHandle {
942 &self.control_handle
943 }
944
945 fn drop_without_shutdown(mut self) {
946 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
948 std::mem::forget(self);
950 }
951}
952
953impl FakeClockCancelEventResponder {
954 pub fn send(self) -> Result<(), fidl::Error> {
958 let _result = self.send_raw();
959 if _result.is_err() {
960 self.control_handle.shutdown();
961 }
962 self.drop_without_shutdown();
963 _result
964 }
965
966 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
968 let _result = self.send_raw();
969 self.drop_without_shutdown();
970 _result
971 }
972
973 fn send_raw(&self) -> Result<(), fidl::Error> {
974 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
975 (),
976 self.tx_id,
977 0x18bbdb18faa6cac0,
978 fidl::encoding::DynamicFlags::empty(),
979 )
980 }
981}
982
983#[must_use = "FIDL methods require a response to be sent"]
984#[derive(Debug)]
985pub struct FakeClockCreateNamedDeadlineResponder {
986 control_handle: std::mem::ManuallyDrop<FakeClockControlHandle>,
987 tx_id: u32,
988}
989
990impl std::ops::Drop for FakeClockCreateNamedDeadlineResponder {
994 fn drop(&mut self) {
995 self.control_handle.shutdown();
996 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
998 }
999}
1000
1001impl fidl::endpoints::Responder for FakeClockCreateNamedDeadlineResponder {
1002 type ControlHandle = FakeClockControlHandle;
1003
1004 fn control_handle(&self) -> &FakeClockControlHandle {
1005 &self.control_handle
1006 }
1007
1008 fn drop_without_shutdown(mut self) {
1009 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1011 std::mem::forget(self);
1013 }
1014}
1015
1016impl FakeClockCreateNamedDeadlineResponder {
1017 pub fn send(self, mut deadline: i64) -> Result<(), fidl::Error> {
1021 let _result = self.send_raw(deadline);
1022 if _result.is_err() {
1023 self.control_handle.shutdown();
1024 }
1025 self.drop_without_shutdown();
1026 _result
1027 }
1028
1029 pub fn send_no_shutdown_on_err(self, mut deadline: i64) -> Result<(), fidl::Error> {
1031 let _result = self.send_raw(deadline);
1032 self.drop_without_shutdown();
1033 _result
1034 }
1035
1036 fn send_raw(&self, mut deadline: i64) -> Result<(), fidl::Error> {
1037 self.control_handle.inner.send::<FakeClockCreateNamedDeadlineResponse>(
1038 (deadline,),
1039 self.tx_id,
1040 0xf7a02c2ac2d116c,
1041 fidl::encoding::DynamicFlags::empty(),
1042 )
1043 }
1044}
1045
1046#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1047pub struct FakeClockControlMarker;
1048
1049impl fidl::endpoints::ProtocolMarker for FakeClockControlMarker {
1050 type Proxy = FakeClockControlProxy;
1051 type RequestStream = FakeClockControlRequestStream;
1052 #[cfg(target_os = "fuchsia")]
1053 type SynchronousProxy = FakeClockControlSynchronousProxy;
1054
1055 const DEBUG_NAME: &'static str = "fuchsia.testing.FakeClockControl";
1056}
1057impl fidl::endpoints::DiscoverableProtocolMarker for FakeClockControlMarker {}
1058pub type FakeClockControlAdvanceResult = Result<(), i32>;
1059pub type FakeClockControlResumeWithIncrementsResult = Result<(), i32>;
1060pub type FakeClockControlAddStopPointResult = Result<(), i32>;
1061
1062pub trait FakeClockControlProxyInterface: Send + Sync {
1063 type AdvanceResponseFut: std::future::Future<Output = Result<FakeClockControlAdvanceResult, fidl::Error>>
1064 + Send;
1065 fn r#advance(&self, increment: &Increment) -> Self::AdvanceResponseFut;
1066 type ResumeWithIncrementsResponseFut: std::future::Future<
1067 Output = Result<FakeClockControlResumeWithIncrementsResult, fidl::Error>,
1068 > + Send;
1069 fn r#resume_with_increments(
1070 &self,
1071 real: i64,
1072 increment: &Increment,
1073 ) -> Self::ResumeWithIncrementsResponseFut;
1074 type AddStopPointResponseFut: std::future::Future<Output = Result<FakeClockControlAddStopPointResult, fidl::Error>>
1075 + Send;
1076 fn r#add_stop_point(
1077 &self,
1078 deadline_id: &fidl_fuchsia_testing_deadline::DeadlineId,
1079 event_type: DeadlineEventType,
1080 on_stop: fidl::EventPair,
1081 ) -> Self::AddStopPointResponseFut;
1082 type PauseResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1083 fn r#pause(&self) -> Self::PauseResponseFut;
1084 type IgnoreNamedDeadlineResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1085 + Send;
1086 fn r#ignore_named_deadline(
1087 &self,
1088 deadline_id: &fidl_fuchsia_testing_deadline::DeadlineId,
1089 ) -> Self::IgnoreNamedDeadlineResponseFut;
1090}
1091#[derive(Debug)]
1092#[cfg(target_os = "fuchsia")]
1093pub struct FakeClockControlSynchronousProxy {
1094 client: fidl::client::sync::Client,
1095}
1096
1097#[cfg(target_os = "fuchsia")]
1098impl fidl::endpoints::SynchronousProxy for FakeClockControlSynchronousProxy {
1099 type Proxy = FakeClockControlProxy;
1100 type Protocol = FakeClockControlMarker;
1101
1102 fn from_channel(inner: fidl::Channel) -> Self {
1103 Self::new(inner)
1104 }
1105
1106 fn into_channel(self) -> fidl::Channel {
1107 self.client.into_channel()
1108 }
1109
1110 fn as_channel(&self) -> &fidl::Channel {
1111 self.client.as_channel()
1112 }
1113}
1114
1115#[cfg(target_os = "fuchsia")]
1116impl FakeClockControlSynchronousProxy {
1117 pub fn new(channel: fidl::Channel) -> Self {
1118 let protocol_name = <FakeClockControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1119 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1120 }
1121
1122 pub fn into_channel(self) -> fidl::Channel {
1123 self.client.into_channel()
1124 }
1125
1126 pub fn wait_for_event(
1129 &self,
1130 deadline: zx::MonotonicInstant,
1131 ) -> Result<FakeClockControlEvent, fidl::Error> {
1132 FakeClockControlEvent::decode(self.client.wait_for_event(deadline)?)
1133 }
1134
1135 pub fn r#advance(
1139 &self,
1140 mut increment: &Increment,
1141 ___deadline: zx::MonotonicInstant,
1142 ) -> Result<FakeClockControlAdvanceResult, fidl::Error> {
1143 let _response = self.client.send_query::<
1144 FakeClockControlAdvanceRequest,
1145 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1146 >(
1147 (increment,),
1148 0x42f2265fb495497a,
1149 fidl::encoding::DynamicFlags::empty(),
1150 ___deadline,
1151 )?;
1152 Ok(_response.map(|x| x))
1153 }
1154
1155 pub fn r#resume_with_increments(
1160 &self,
1161 mut real: i64,
1162 mut increment: &Increment,
1163 ___deadline: zx::MonotonicInstant,
1164 ) -> Result<FakeClockControlResumeWithIncrementsResult, fidl::Error> {
1165 let _response = self.client.send_query::<
1166 FakeClockControlResumeWithIncrementsRequest,
1167 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1168 >(
1169 (real, increment,),
1170 0x259be1eeba0bdd4a,
1171 fidl::encoding::DynamicFlags::empty(),
1172 ___deadline,
1173 )?;
1174 Ok(_response.map(|x| x))
1175 }
1176
1177 pub fn r#add_stop_point(
1193 &self,
1194 mut deadline_id: &fidl_fuchsia_testing_deadline::DeadlineId,
1195 mut event_type: DeadlineEventType,
1196 mut on_stop: fidl::EventPair,
1197 ___deadline: zx::MonotonicInstant,
1198 ) -> Result<FakeClockControlAddStopPointResult, fidl::Error> {
1199 let _response = self.client.send_query::<
1200 FakeClockControlAddStopPointRequest,
1201 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1202 >(
1203 (deadline_id, event_type, on_stop,),
1204 0x3b52fe2cba8c4245,
1205 fidl::encoding::DynamicFlags::empty(),
1206 ___deadline,
1207 )?;
1208 Ok(_response.map(|x| x))
1209 }
1210
1211 pub fn r#pause(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
1213 let _response =
1214 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
1215 (),
1216 0x260df03b49199ba4,
1217 fidl::encoding::DynamicFlags::empty(),
1218 ___deadline,
1219 )?;
1220 Ok(_response)
1221 }
1222
1223 pub fn r#ignore_named_deadline(
1226 &self,
1227 mut deadline_id: &fidl_fuchsia_testing_deadline::DeadlineId,
1228 ___deadline: zx::MonotonicInstant,
1229 ) -> Result<(), fidl::Error> {
1230 let _response = self
1231 .client
1232 .send_query::<FakeClockControlIgnoreNamedDeadlineRequest, fidl::encoding::EmptyPayload>(
1233 (deadline_id,),
1234 0x2e445152a80d44aa,
1235 fidl::encoding::DynamicFlags::empty(),
1236 ___deadline,
1237 )?;
1238 Ok(_response)
1239 }
1240}
1241
1242#[cfg(target_os = "fuchsia")]
1243impl From<FakeClockControlSynchronousProxy> for zx::Handle {
1244 fn from(value: FakeClockControlSynchronousProxy) -> Self {
1245 value.into_channel().into()
1246 }
1247}
1248
1249#[cfg(target_os = "fuchsia")]
1250impl From<fidl::Channel> for FakeClockControlSynchronousProxy {
1251 fn from(value: fidl::Channel) -> Self {
1252 Self::new(value)
1253 }
1254}
1255
1256#[derive(Debug, Clone)]
1257pub struct FakeClockControlProxy {
1258 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1259}
1260
1261impl fidl::endpoints::Proxy for FakeClockControlProxy {
1262 type Protocol = FakeClockControlMarker;
1263
1264 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1265 Self::new(inner)
1266 }
1267
1268 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1269 self.client.into_channel().map_err(|client| Self { client })
1270 }
1271
1272 fn as_channel(&self) -> &::fidl::AsyncChannel {
1273 self.client.as_channel()
1274 }
1275}
1276
1277impl FakeClockControlProxy {
1278 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1280 let protocol_name = <FakeClockControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1281 Self { client: fidl::client::Client::new(channel, protocol_name) }
1282 }
1283
1284 pub fn take_event_stream(&self) -> FakeClockControlEventStream {
1290 FakeClockControlEventStream { event_receiver: self.client.take_event_receiver() }
1291 }
1292
1293 pub fn r#advance(
1297 &self,
1298 mut increment: &Increment,
1299 ) -> fidl::client::QueryResponseFut<
1300 FakeClockControlAdvanceResult,
1301 fidl::encoding::DefaultFuchsiaResourceDialect,
1302 > {
1303 FakeClockControlProxyInterface::r#advance(self, increment)
1304 }
1305
1306 pub fn r#resume_with_increments(
1311 &self,
1312 mut real: i64,
1313 mut increment: &Increment,
1314 ) -> fidl::client::QueryResponseFut<
1315 FakeClockControlResumeWithIncrementsResult,
1316 fidl::encoding::DefaultFuchsiaResourceDialect,
1317 > {
1318 FakeClockControlProxyInterface::r#resume_with_increments(self, real, increment)
1319 }
1320
1321 pub fn r#add_stop_point(
1337 &self,
1338 mut deadline_id: &fidl_fuchsia_testing_deadline::DeadlineId,
1339 mut event_type: DeadlineEventType,
1340 mut on_stop: fidl::EventPair,
1341 ) -> fidl::client::QueryResponseFut<
1342 FakeClockControlAddStopPointResult,
1343 fidl::encoding::DefaultFuchsiaResourceDialect,
1344 > {
1345 FakeClockControlProxyInterface::r#add_stop_point(self, deadline_id, event_type, on_stop)
1346 }
1347
1348 pub fn r#pause(
1350 &self,
1351 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1352 FakeClockControlProxyInterface::r#pause(self)
1353 }
1354
1355 pub fn r#ignore_named_deadline(
1358 &self,
1359 mut deadline_id: &fidl_fuchsia_testing_deadline::DeadlineId,
1360 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1361 FakeClockControlProxyInterface::r#ignore_named_deadline(self, deadline_id)
1362 }
1363}
1364
1365impl FakeClockControlProxyInterface for FakeClockControlProxy {
1366 type AdvanceResponseFut = fidl::client::QueryResponseFut<
1367 FakeClockControlAdvanceResult,
1368 fidl::encoding::DefaultFuchsiaResourceDialect,
1369 >;
1370 fn r#advance(&self, mut increment: &Increment) -> Self::AdvanceResponseFut {
1371 fn _decode(
1372 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1373 ) -> Result<FakeClockControlAdvanceResult, fidl::Error> {
1374 let _response = fidl::client::decode_transaction_body::<
1375 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1376 fidl::encoding::DefaultFuchsiaResourceDialect,
1377 0x42f2265fb495497a,
1378 >(_buf?)?;
1379 Ok(_response.map(|x| x))
1380 }
1381 self.client
1382 .send_query_and_decode::<FakeClockControlAdvanceRequest, FakeClockControlAdvanceResult>(
1383 (increment,),
1384 0x42f2265fb495497a,
1385 fidl::encoding::DynamicFlags::empty(),
1386 _decode,
1387 )
1388 }
1389
1390 type ResumeWithIncrementsResponseFut = fidl::client::QueryResponseFut<
1391 FakeClockControlResumeWithIncrementsResult,
1392 fidl::encoding::DefaultFuchsiaResourceDialect,
1393 >;
1394 fn r#resume_with_increments(
1395 &self,
1396 mut real: i64,
1397 mut increment: &Increment,
1398 ) -> Self::ResumeWithIncrementsResponseFut {
1399 fn _decode(
1400 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1401 ) -> Result<FakeClockControlResumeWithIncrementsResult, fidl::Error> {
1402 let _response = fidl::client::decode_transaction_body::<
1403 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1404 fidl::encoding::DefaultFuchsiaResourceDialect,
1405 0x259be1eeba0bdd4a,
1406 >(_buf?)?;
1407 Ok(_response.map(|x| x))
1408 }
1409 self.client.send_query_and_decode::<
1410 FakeClockControlResumeWithIncrementsRequest,
1411 FakeClockControlResumeWithIncrementsResult,
1412 >(
1413 (real, increment,),
1414 0x259be1eeba0bdd4a,
1415 fidl::encoding::DynamicFlags::empty(),
1416 _decode,
1417 )
1418 }
1419
1420 type AddStopPointResponseFut = fidl::client::QueryResponseFut<
1421 FakeClockControlAddStopPointResult,
1422 fidl::encoding::DefaultFuchsiaResourceDialect,
1423 >;
1424 fn r#add_stop_point(
1425 &self,
1426 mut deadline_id: &fidl_fuchsia_testing_deadline::DeadlineId,
1427 mut event_type: DeadlineEventType,
1428 mut on_stop: fidl::EventPair,
1429 ) -> Self::AddStopPointResponseFut {
1430 fn _decode(
1431 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1432 ) -> Result<FakeClockControlAddStopPointResult, fidl::Error> {
1433 let _response = fidl::client::decode_transaction_body::<
1434 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1435 fidl::encoding::DefaultFuchsiaResourceDialect,
1436 0x3b52fe2cba8c4245,
1437 >(_buf?)?;
1438 Ok(_response.map(|x| x))
1439 }
1440 self.client.send_query_and_decode::<
1441 FakeClockControlAddStopPointRequest,
1442 FakeClockControlAddStopPointResult,
1443 >(
1444 (deadline_id, event_type, on_stop,),
1445 0x3b52fe2cba8c4245,
1446 fidl::encoding::DynamicFlags::empty(),
1447 _decode,
1448 )
1449 }
1450
1451 type PauseResponseFut =
1452 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1453 fn r#pause(&self) -> Self::PauseResponseFut {
1454 fn _decode(
1455 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1456 ) -> Result<(), fidl::Error> {
1457 let _response = fidl::client::decode_transaction_body::<
1458 fidl::encoding::EmptyPayload,
1459 fidl::encoding::DefaultFuchsiaResourceDialect,
1460 0x260df03b49199ba4,
1461 >(_buf?)?;
1462 Ok(_response)
1463 }
1464 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1465 (),
1466 0x260df03b49199ba4,
1467 fidl::encoding::DynamicFlags::empty(),
1468 _decode,
1469 )
1470 }
1471
1472 type IgnoreNamedDeadlineResponseFut =
1473 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1474 fn r#ignore_named_deadline(
1475 &self,
1476 mut deadline_id: &fidl_fuchsia_testing_deadline::DeadlineId,
1477 ) -> Self::IgnoreNamedDeadlineResponseFut {
1478 fn _decode(
1479 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1480 ) -> Result<(), fidl::Error> {
1481 let _response = fidl::client::decode_transaction_body::<
1482 fidl::encoding::EmptyPayload,
1483 fidl::encoding::DefaultFuchsiaResourceDialect,
1484 0x2e445152a80d44aa,
1485 >(_buf?)?;
1486 Ok(_response)
1487 }
1488 self.client.send_query_and_decode::<FakeClockControlIgnoreNamedDeadlineRequest, ()>(
1489 (deadline_id,),
1490 0x2e445152a80d44aa,
1491 fidl::encoding::DynamicFlags::empty(),
1492 _decode,
1493 )
1494 }
1495}
1496
1497pub struct FakeClockControlEventStream {
1498 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1499}
1500
1501impl std::marker::Unpin for FakeClockControlEventStream {}
1502
1503impl futures::stream::FusedStream for FakeClockControlEventStream {
1504 fn is_terminated(&self) -> bool {
1505 self.event_receiver.is_terminated()
1506 }
1507}
1508
1509impl futures::Stream for FakeClockControlEventStream {
1510 type Item = Result<FakeClockControlEvent, fidl::Error>;
1511
1512 fn poll_next(
1513 mut self: std::pin::Pin<&mut Self>,
1514 cx: &mut std::task::Context<'_>,
1515 ) -> std::task::Poll<Option<Self::Item>> {
1516 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1517 &mut self.event_receiver,
1518 cx
1519 )?) {
1520 Some(buf) => std::task::Poll::Ready(Some(FakeClockControlEvent::decode(buf))),
1521 None => std::task::Poll::Ready(None),
1522 }
1523 }
1524}
1525
1526#[derive(Debug)]
1527pub enum FakeClockControlEvent {}
1528
1529impl FakeClockControlEvent {
1530 fn decode(
1532 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1533 ) -> Result<FakeClockControlEvent, fidl::Error> {
1534 let (bytes, _handles) = buf.split_mut();
1535 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1536 debug_assert_eq!(tx_header.tx_id, 0);
1537 match tx_header.ordinal {
1538 _ => Err(fidl::Error::UnknownOrdinal {
1539 ordinal: tx_header.ordinal,
1540 protocol_name:
1541 <FakeClockControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1542 }),
1543 }
1544 }
1545}
1546
1547pub struct FakeClockControlRequestStream {
1549 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1550 is_terminated: bool,
1551}
1552
1553impl std::marker::Unpin for FakeClockControlRequestStream {}
1554
1555impl futures::stream::FusedStream for FakeClockControlRequestStream {
1556 fn is_terminated(&self) -> bool {
1557 self.is_terminated
1558 }
1559}
1560
1561impl fidl::endpoints::RequestStream for FakeClockControlRequestStream {
1562 type Protocol = FakeClockControlMarker;
1563 type ControlHandle = FakeClockControlControlHandle;
1564
1565 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1566 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1567 }
1568
1569 fn control_handle(&self) -> Self::ControlHandle {
1570 FakeClockControlControlHandle { inner: self.inner.clone() }
1571 }
1572
1573 fn into_inner(
1574 self,
1575 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1576 {
1577 (self.inner, self.is_terminated)
1578 }
1579
1580 fn from_inner(
1581 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1582 is_terminated: bool,
1583 ) -> Self {
1584 Self { inner, is_terminated }
1585 }
1586}
1587
1588impl futures::Stream for FakeClockControlRequestStream {
1589 type Item = Result<FakeClockControlRequest, fidl::Error>;
1590
1591 fn poll_next(
1592 mut self: std::pin::Pin<&mut Self>,
1593 cx: &mut std::task::Context<'_>,
1594 ) -> std::task::Poll<Option<Self::Item>> {
1595 let this = &mut *self;
1596 if this.inner.check_shutdown(cx) {
1597 this.is_terminated = true;
1598 return std::task::Poll::Ready(None);
1599 }
1600 if this.is_terminated {
1601 panic!("polled FakeClockControlRequestStream after completion");
1602 }
1603 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1604 |bytes, handles| {
1605 match this.inner.channel().read_etc(cx, bytes, handles) {
1606 std::task::Poll::Ready(Ok(())) => {}
1607 std::task::Poll::Pending => return std::task::Poll::Pending,
1608 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1609 this.is_terminated = true;
1610 return std::task::Poll::Ready(None);
1611 }
1612 std::task::Poll::Ready(Err(e)) => {
1613 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1614 e.into(),
1615 ))))
1616 }
1617 }
1618
1619 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1621
1622 std::task::Poll::Ready(Some(match header.ordinal {
1623 0x42f2265fb495497a => {
1624 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1625 let mut req = fidl::new_empty!(
1626 FakeClockControlAdvanceRequest,
1627 fidl::encoding::DefaultFuchsiaResourceDialect
1628 );
1629 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FakeClockControlAdvanceRequest>(&header, _body_bytes, handles, &mut req)?;
1630 let control_handle =
1631 FakeClockControlControlHandle { inner: this.inner.clone() };
1632 Ok(FakeClockControlRequest::Advance {
1633 increment: req.increment,
1634
1635 responder: FakeClockControlAdvanceResponder {
1636 control_handle: std::mem::ManuallyDrop::new(control_handle),
1637 tx_id: header.tx_id,
1638 },
1639 })
1640 }
1641 0x259be1eeba0bdd4a => {
1642 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1643 let mut req = fidl::new_empty!(
1644 FakeClockControlResumeWithIncrementsRequest,
1645 fidl::encoding::DefaultFuchsiaResourceDialect
1646 );
1647 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FakeClockControlResumeWithIncrementsRequest>(&header, _body_bytes, handles, &mut req)?;
1648 let control_handle =
1649 FakeClockControlControlHandle { inner: this.inner.clone() };
1650 Ok(FakeClockControlRequest::ResumeWithIncrements {
1651 real: req.real,
1652 increment: req.increment,
1653
1654 responder: FakeClockControlResumeWithIncrementsResponder {
1655 control_handle: std::mem::ManuallyDrop::new(control_handle),
1656 tx_id: header.tx_id,
1657 },
1658 })
1659 }
1660 0x3b52fe2cba8c4245 => {
1661 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1662 let mut req = fidl::new_empty!(
1663 FakeClockControlAddStopPointRequest,
1664 fidl::encoding::DefaultFuchsiaResourceDialect
1665 );
1666 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FakeClockControlAddStopPointRequest>(&header, _body_bytes, handles, &mut req)?;
1667 let control_handle =
1668 FakeClockControlControlHandle { inner: this.inner.clone() };
1669 Ok(FakeClockControlRequest::AddStopPoint {
1670 deadline_id: req.deadline_id,
1671 event_type: req.event_type,
1672 on_stop: req.on_stop,
1673
1674 responder: FakeClockControlAddStopPointResponder {
1675 control_handle: std::mem::ManuallyDrop::new(control_handle),
1676 tx_id: header.tx_id,
1677 },
1678 })
1679 }
1680 0x260df03b49199ba4 => {
1681 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1682 let mut req = fidl::new_empty!(
1683 fidl::encoding::EmptyPayload,
1684 fidl::encoding::DefaultFuchsiaResourceDialect
1685 );
1686 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1687 let control_handle =
1688 FakeClockControlControlHandle { inner: this.inner.clone() };
1689 Ok(FakeClockControlRequest::Pause {
1690 responder: FakeClockControlPauseResponder {
1691 control_handle: std::mem::ManuallyDrop::new(control_handle),
1692 tx_id: header.tx_id,
1693 },
1694 })
1695 }
1696 0x2e445152a80d44aa => {
1697 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1698 let mut req = fidl::new_empty!(
1699 FakeClockControlIgnoreNamedDeadlineRequest,
1700 fidl::encoding::DefaultFuchsiaResourceDialect
1701 );
1702 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FakeClockControlIgnoreNamedDeadlineRequest>(&header, _body_bytes, handles, &mut req)?;
1703 let control_handle =
1704 FakeClockControlControlHandle { inner: this.inner.clone() };
1705 Ok(FakeClockControlRequest::IgnoreNamedDeadline {
1706 deadline_id: req.deadline_id,
1707
1708 responder: FakeClockControlIgnoreNamedDeadlineResponder {
1709 control_handle: std::mem::ManuallyDrop::new(control_handle),
1710 tx_id: header.tx_id,
1711 },
1712 })
1713 }
1714 _ => Err(fidl::Error::UnknownOrdinal {
1715 ordinal: header.ordinal,
1716 protocol_name:
1717 <FakeClockControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1718 }),
1719 }))
1720 },
1721 )
1722 }
1723}
1724
1725#[derive(Debug)]
1737pub enum FakeClockControlRequest {
1738 Advance { increment: Increment, responder: FakeClockControlAdvanceResponder },
1742 ResumeWithIncrements {
1747 real: i64,
1748 increment: Increment,
1749 responder: FakeClockControlResumeWithIncrementsResponder,
1750 },
1751 AddStopPoint {
1767 deadline_id: fidl_fuchsia_testing_deadline::DeadlineId,
1768 event_type: DeadlineEventType,
1769 on_stop: fidl::EventPair,
1770 responder: FakeClockControlAddStopPointResponder,
1771 },
1772 Pause { responder: FakeClockControlPauseResponder },
1774 IgnoreNamedDeadline {
1777 deadline_id: fidl_fuchsia_testing_deadline::DeadlineId,
1778 responder: FakeClockControlIgnoreNamedDeadlineResponder,
1779 },
1780}
1781
1782impl FakeClockControlRequest {
1783 #[allow(irrefutable_let_patterns)]
1784 pub fn into_advance(self) -> Option<(Increment, FakeClockControlAdvanceResponder)> {
1785 if let FakeClockControlRequest::Advance { increment, responder } = self {
1786 Some((increment, responder))
1787 } else {
1788 None
1789 }
1790 }
1791
1792 #[allow(irrefutable_let_patterns)]
1793 pub fn into_resume_with_increments(
1794 self,
1795 ) -> Option<(i64, Increment, FakeClockControlResumeWithIncrementsResponder)> {
1796 if let FakeClockControlRequest::ResumeWithIncrements { real, increment, responder } = self {
1797 Some((real, increment, responder))
1798 } else {
1799 None
1800 }
1801 }
1802
1803 #[allow(irrefutable_let_patterns)]
1804 pub fn into_add_stop_point(
1805 self,
1806 ) -> Option<(
1807 fidl_fuchsia_testing_deadline::DeadlineId,
1808 DeadlineEventType,
1809 fidl::EventPair,
1810 FakeClockControlAddStopPointResponder,
1811 )> {
1812 if let FakeClockControlRequest::AddStopPoint {
1813 deadline_id,
1814 event_type,
1815 on_stop,
1816 responder,
1817 } = self
1818 {
1819 Some((deadline_id, event_type, on_stop, responder))
1820 } else {
1821 None
1822 }
1823 }
1824
1825 #[allow(irrefutable_let_patterns)]
1826 pub fn into_pause(self) -> Option<(FakeClockControlPauseResponder)> {
1827 if let FakeClockControlRequest::Pause { responder } = self {
1828 Some((responder))
1829 } else {
1830 None
1831 }
1832 }
1833
1834 #[allow(irrefutable_let_patterns)]
1835 pub fn into_ignore_named_deadline(
1836 self,
1837 ) -> Option<(
1838 fidl_fuchsia_testing_deadline::DeadlineId,
1839 FakeClockControlIgnoreNamedDeadlineResponder,
1840 )> {
1841 if let FakeClockControlRequest::IgnoreNamedDeadline { deadline_id, responder } = self {
1842 Some((deadline_id, responder))
1843 } else {
1844 None
1845 }
1846 }
1847
1848 pub fn method_name(&self) -> &'static str {
1850 match *self {
1851 FakeClockControlRequest::Advance { .. } => "advance",
1852 FakeClockControlRequest::ResumeWithIncrements { .. } => "resume_with_increments",
1853 FakeClockControlRequest::AddStopPoint { .. } => "add_stop_point",
1854 FakeClockControlRequest::Pause { .. } => "pause",
1855 FakeClockControlRequest::IgnoreNamedDeadline { .. } => "ignore_named_deadline",
1856 }
1857 }
1858}
1859
1860#[derive(Debug, Clone)]
1861pub struct FakeClockControlControlHandle {
1862 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1863}
1864
1865impl fidl::endpoints::ControlHandle for FakeClockControlControlHandle {
1866 fn shutdown(&self) {
1867 self.inner.shutdown()
1868 }
1869 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1870 self.inner.shutdown_with_epitaph(status)
1871 }
1872
1873 fn is_closed(&self) -> bool {
1874 self.inner.channel().is_closed()
1875 }
1876 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1877 self.inner.channel().on_closed()
1878 }
1879
1880 #[cfg(target_os = "fuchsia")]
1881 fn signal_peer(
1882 &self,
1883 clear_mask: zx::Signals,
1884 set_mask: zx::Signals,
1885 ) -> Result<(), zx_status::Status> {
1886 use fidl::Peered;
1887 self.inner.channel().signal_peer(clear_mask, set_mask)
1888 }
1889}
1890
1891impl FakeClockControlControlHandle {}
1892
1893#[must_use = "FIDL methods require a response to be sent"]
1894#[derive(Debug)]
1895pub struct FakeClockControlAdvanceResponder {
1896 control_handle: std::mem::ManuallyDrop<FakeClockControlControlHandle>,
1897 tx_id: u32,
1898}
1899
1900impl std::ops::Drop for FakeClockControlAdvanceResponder {
1904 fn drop(&mut self) {
1905 self.control_handle.shutdown();
1906 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1908 }
1909}
1910
1911impl fidl::endpoints::Responder for FakeClockControlAdvanceResponder {
1912 type ControlHandle = FakeClockControlControlHandle;
1913
1914 fn control_handle(&self) -> &FakeClockControlControlHandle {
1915 &self.control_handle
1916 }
1917
1918 fn drop_without_shutdown(mut self) {
1919 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1921 std::mem::forget(self);
1923 }
1924}
1925
1926impl FakeClockControlAdvanceResponder {
1927 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1931 let _result = self.send_raw(result);
1932 if _result.is_err() {
1933 self.control_handle.shutdown();
1934 }
1935 self.drop_without_shutdown();
1936 _result
1937 }
1938
1939 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1941 let _result = self.send_raw(result);
1942 self.drop_without_shutdown();
1943 _result
1944 }
1945
1946 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1947 self.control_handle
1948 .inner
1949 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1950 result,
1951 self.tx_id,
1952 0x42f2265fb495497a,
1953 fidl::encoding::DynamicFlags::empty(),
1954 )
1955 }
1956}
1957
1958#[must_use = "FIDL methods require a response to be sent"]
1959#[derive(Debug)]
1960pub struct FakeClockControlResumeWithIncrementsResponder {
1961 control_handle: std::mem::ManuallyDrop<FakeClockControlControlHandle>,
1962 tx_id: u32,
1963}
1964
1965impl std::ops::Drop for FakeClockControlResumeWithIncrementsResponder {
1969 fn drop(&mut self) {
1970 self.control_handle.shutdown();
1971 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1973 }
1974}
1975
1976impl fidl::endpoints::Responder for FakeClockControlResumeWithIncrementsResponder {
1977 type ControlHandle = FakeClockControlControlHandle;
1978
1979 fn control_handle(&self) -> &FakeClockControlControlHandle {
1980 &self.control_handle
1981 }
1982
1983 fn drop_without_shutdown(mut self) {
1984 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1986 std::mem::forget(self);
1988 }
1989}
1990
1991impl FakeClockControlResumeWithIncrementsResponder {
1992 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1996 let _result = self.send_raw(result);
1997 if _result.is_err() {
1998 self.control_handle.shutdown();
1999 }
2000 self.drop_without_shutdown();
2001 _result
2002 }
2003
2004 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2006 let _result = self.send_raw(result);
2007 self.drop_without_shutdown();
2008 _result
2009 }
2010
2011 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2012 self.control_handle
2013 .inner
2014 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2015 result,
2016 self.tx_id,
2017 0x259be1eeba0bdd4a,
2018 fidl::encoding::DynamicFlags::empty(),
2019 )
2020 }
2021}
2022
2023#[must_use = "FIDL methods require a response to be sent"]
2024#[derive(Debug)]
2025pub struct FakeClockControlAddStopPointResponder {
2026 control_handle: std::mem::ManuallyDrop<FakeClockControlControlHandle>,
2027 tx_id: u32,
2028}
2029
2030impl std::ops::Drop for FakeClockControlAddStopPointResponder {
2034 fn drop(&mut self) {
2035 self.control_handle.shutdown();
2036 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2038 }
2039}
2040
2041impl fidl::endpoints::Responder for FakeClockControlAddStopPointResponder {
2042 type ControlHandle = FakeClockControlControlHandle;
2043
2044 fn control_handle(&self) -> &FakeClockControlControlHandle {
2045 &self.control_handle
2046 }
2047
2048 fn drop_without_shutdown(mut self) {
2049 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2051 std::mem::forget(self);
2053 }
2054}
2055
2056impl FakeClockControlAddStopPointResponder {
2057 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2061 let _result = self.send_raw(result);
2062 if _result.is_err() {
2063 self.control_handle.shutdown();
2064 }
2065 self.drop_without_shutdown();
2066 _result
2067 }
2068
2069 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2071 let _result = self.send_raw(result);
2072 self.drop_without_shutdown();
2073 _result
2074 }
2075
2076 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2077 self.control_handle
2078 .inner
2079 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2080 result,
2081 self.tx_id,
2082 0x3b52fe2cba8c4245,
2083 fidl::encoding::DynamicFlags::empty(),
2084 )
2085 }
2086}
2087
2088#[must_use = "FIDL methods require a response to be sent"]
2089#[derive(Debug)]
2090pub struct FakeClockControlPauseResponder {
2091 control_handle: std::mem::ManuallyDrop<FakeClockControlControlHandle>,
2092 tx_id: u32,
2093}
2094
2095impl std::ops::Drop for FakeClockControlPauseResponder {
2099 fn drop(&mut self) {
2100 self.control_handle.shutdown();
2101 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2103 }
2104}
2105
2106impl fidl::endpoints::Responder for FakeClockControlPauseResponder {
2107 type ControlHandle = FakeClockControlControlHandle;
2108
2109 fn control_handle(&self) -> &FakeClockControlControlHandle {
2110 &self.control_handle
2111 }
2112
2113 fn drop_without_shutdown(mut self) {
2114 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2116 std::mem::forget(self);
2118 }
2119}
2120
2121impl FakeClockControlPauseResponder {
2122 pub fn send(self) -> Result<(), fidl::Error> {
2126 let _result = self.send_raw();
2127 if _result.is_err() {
2128 self.control_handle.shutdown();
2129 }
2130 self.drop_without_shutdown();
2131 _result
2132 }
2133
2134 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2136 let _result = self.send_raw();
2137 self.drop_without_shutdown();
2138 _result
2139 }
2140
2141 fn send_raw(&self) -> Result<(), fidl::Error> {
2142 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2143 (),
2144 self.tx_id,
2145 0x260df03b49199ba4,
2146 fidl::encoding::DynamicFlags::empty(),
2147 )
2148 }
2149}
2150
2151#[must_use = "FIDL methods require a response to be sent"]
2152#[derive(Debug)]
2153pub struct FakeClockControlIgnoreNamedDeadlineResponder {
2154 control_handle: std::mem::ManuallyDrop<FakeClockControlControlHandle>,
2155 tx_id: u32,
2156}
2157
2158impl std::ops::Drop for FakeClockControlIgnoreNamedDeadlineResponder {
2162 fn drop(&mut self) {
2163 self.control_handle.shutdown();
2164 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2166 }
2167}
2168
2169impl fidl::endpoints::Responder for FakeClockControlIgnoreNamedDeadlineResponder {
2170 type ControlHandle = FakeClockControlControlHandle;
2171
2172 fn control_handle(&self) -> &FakeClockControlControlHandle {
2173 &self.control_handle
2174 }
2175
2176 fn drop_without_shutdown(mut self) {
2177 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2179 std::mem::forget(self);
2181 }
2182}
2183
2184impl FakeClockControlIgnoreNamedDeadlineResponder {
2185 pub fn send(self) -> Result<(), fidl::Error> {
2189 let _result = self.send_raw();
2190 if _result.is_err() {
2191 self.control_handle.shutdown();
2192 }
2193 self.drop_without_shutdown();
2194 _result
2195 }
2196
2197 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2199 let _result = self.send_raw();
2200 self.drop_without_shutdown();
2201 _result
2202 }
2203
2204 fn send_raw(&self) -> Result<(), fidl::Error> {
2205 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2206 (),
2207 self.tx_id,
2208 0x2e445152a80d44aa,
2209 fidl::encoding::DynamicFlags::empty(),
2210 )
2211 }
2212}
2213
2214mod internal {
2215 use super::*;
2216
2217 impl fidl::encoding::ResourceTypeMarker for FakeClockCancelEventRequest {
2218 type Borrowed<'a> = &'a mut Self;
2219 fn take_or_borrow<'a>(
2220 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2221 ) -> Self::Borrowed<'a> {
2222 value
2223 }
2224 }
2225
2226 unsafe impl fidl::encoding::TypeMarker for FakeClockCancelEventRequest {
2227 type Owned = Self;
2228
2229 #[inline(always)]
2230 fn inline_align(_context: fidl::encoding::Context) -> usize {
2231 4
2232 }
2233
2234 #[inline(always)]
2235 fn inline_size(_context: fidl::encoding::Context) -> usize {
2236 4
2237 }
2238 }
2239
2240 unsafe impl
2241 fidl::encoding::Encode<
2242 FakeClockCancelEventRequest,
2243 fidl::encoding::DefaultFuchsiaResourceDialect,
2244 > for &mut FakeClockCancelEventRequest
2245 {
2246 #[inline]
2247 unsafe fn encode(
2248 self,
2249 encoder: &mut fidl::encoding::Encoder<
2250 '_,
2251 fidl::encoding::DefaultFuchsiaResourceDialect,
2252 >,
2253 offset: usize,
2254 _depth: fidl::encoding::Depth,
2255 ) -> fidl::Result<()> {
2256 encoder.debug_check_bounds::<FakeClockCancelEventRequest>(offset);
2257 fidl::encoding::Encode::<
2259 FakeClockCancelEventRequest,
2260 fidl::encoding::DefaultFuchsiaResourceDialect,
2261 >::encode(
2262 (<fidl::encoding::HandleType<
2263 fidl::EventPair,
2264 { fidl::ObjectType::EVENTPAIR.into_raw() },
2265 2147483648,
2266 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2267 &mut self.event
2268 ),),
2269 encoder,
2270 offset,
2271 _depth,
2272 )
2273 }
2274 }
2275 unsafe impl<
2276 T0: fidl::encoding::Encode<
2277 fidl::encoding::HandleType<
2278 fidl::EventPair,
2279 { fidl::ObjectType::EVENTPAIR.into_raw() },
2280 2147483648,
2281 >,
2282 fidl::encoding::DefaultFuchsiaResourceDialect,
2283 >,
2284 >
2285 fidl::encoding::Encode<
2286 FakeClockCancelEventRequest,
2287 fidl::encoding::DefaultFuchsiaResourceDialect,
2288 > for (T0,)
2289 {
2290 #[inline]
2291 unsafe fn encode(
2292 self,
2293 encoder: &mut fidl::encoding::Encoder<
2294 '_,
2295 fidl::encoding::DefaultFuchsiaResourceDialect,
2296 >,
2297 offset: usize,
2298 depth: fidl::encoding::Depth,
2299 ) -> fidl::Result<()> {
2300 encoder.debug_check_bounds::<FakeClockCancelEventRequest>(offset);
2301 self.0.encode(encoder, offset + 0, depth)?;
2305 Ok(())
2306 }
2307 }
2308
2309 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2310 for FakeClockCancelEventRequest
2311 {
2312 #[inline(always)]
2313 fn new_empty() -> Self {
2314 Self {
2315 event: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2316 }
2317 }
2318
2319 #[inline]
2320 unsafe fn decode(
2321 &mut self,
2322 decoder: &mut fidl::encoding::Decoder<
2323 '_,
2324 fidl::encoding::DefaultFuchsiaResourceDialect,
2325 >,
2326 offset: usize,
2327 _depth: fidl::encoding::Depth,
2328 ) -> fidl::Result<()> {
2329 decoder.debug_check_bounds::<Self>(offset);
2330 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.event, decoder, offset + 0, _depth)?;
2332 Ok(())
2333 }
2334 }
2335
2336 impl fidl::encoding::ResourceTypeMarker for FakeClockControlAddStopPointRequest {
2337 type Borrowed<'a> = &'a mut Self;
2338 fn take_or_borrow<'a>(
2339 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2340 ) -> Self::Borrowed<'a> {
2341 value
2342 }
2343 }
2344
2345 unsafe impl fidl::encoding::TypeMarker for FakeClockControlAddStopPointRequest {
2346 type Owned = Self;
2347
2348 #[inline(always)]
2349 fn inline_align(_context: fidl::encoding::Context) -> usize {
2350 8
2351 }
2352
2353 #[inline(always)]
2354 fn inline_size(_context: fidl::encoding::Context) -> usize {
2355 40
2356 }
2357 }
2358
2359 unsafe impl
2360 fidl::encoding::Encode<
2361 FakeClockControlAddStopPointRequest,
2362 fidl::encoding::DefaultFuchsiaResourceDialect,
2363 > for &mut FakeClockControlAddStopPointRequest
2364 {
2365 #[inline]
2366 unsafe fn encode(
2367 self,
2368 encoder: &mut fidl::encoding::Encoder<
2369 '_,
2370 fidl::encoding::DefaultFuchsiaResourceDialect,
2371 >,
2372 offset: usize,
2373 _depth: fidl::encoding::Depth,
2374 ) -> fidl::Result<()> {
2375 encoder.debug_check_bounds::<FakeClockControlAddStopPointRequest>(offset);
2376 fidl::encoding::Encode::<FakeClockControlAddStopPointRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
2378 (
2379 <fidl_fuchsia_testing_deadline::DeadlineId as fidl::encoding::ValueTypeMarker>::borrow(&self.deadline_id),
2380 <DeadlineEventType as fidl::encoding::ValueTypeMarker>::borrow(&self.event_type),
2381 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.on_stop),
2382 ),
2383 encoder, offset, _depth
2384 )
2385 }
2386 }
2387 unsafe impl<
2388 T0: fidl::encoding::Encode<
2389 fidl_fuchsia_testing_deadline::DeadlineId,
2390 fidl::encoding::DefaultFuchsiaResourceDialect,
2391 >,
2392 T1: fidl::encoding::Encode<
2393 DeadlineEventType,
2394 fidl::encoding::DefaultFuchsiaResourceDialect,
2395 >,
2396 T2: fidl::encoding::Encode<
2397 fidl::encoding::HandleType<
2398 fidl::EventPair,
2399 { fidl::ObjectType::EVENTPAIR.into_raw() },
2400 2147483648,
2401 >,
2402 fidl::encoding::DefaultFuchsiaResourceDialect,
2403 >,
2404 >
2405 fidl::encoding::Encode<
2406 FakeClockControlAddStopPointRequest,
2407 fidl::encoding::DefaultFuchsiaResourceDialect,
2408 > for (T0, T1, T2)
2409 {
2410 #[inline]
2411 unsafe fn encode(
2412 self,
2413 encoder: &mut fidl::encoding::Encoder<
2414 '_,
2415 fidl::encoding::DefaultFuchsiaResourceDialect,
2416 >,
2417 offset: usize,
2418 depth: fidl::encoding::Depth,
2419 ) -> fidl::Result<()> {
2420 encoder.debug_check_bounds::<FakeClockControlAddStopPointRequest>(offset);
2421 self.0.encode(encoder, offset + 0, depth)?;
2425 self.1.encode(encoder, offset + 32, depth)?;
2426 self.2.encode(encoder, offset + 36, depth)?;
2427 Ok(())
2428 }
2429 }
2430
2431 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2432 for FakeClockControlAddStopPointRequest
2433 {
2434 #[inline(always)]
2435 fn new_empty() -> Self {
2436 Self {
2437 deadline_id: fidl::new_empty!(
2438 fidl_fuchsia_testing_deadline::DeadlineId,
2439 fidl::encoding::DefaultFuchsiaResourceDialect
2440 ),
2441 event_type: fidl::new_empty!(
2442 DeadlineEventType,
2443 fidl::encoding::DefaultFuchsiaResourceDialect
2444 ),
2445 on_stop: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2446 }
2447 }
2448
2449 #[inline]
2450 unsafe fn decode(
2451 &mut self,
2452 decoder: &mut fidl::encoding::Decoder<
2453 '_,
2454 fidl::encoding::DefaultFuchsiaResourceDialect,
2455 >,
2456 offset: usize,
2457 _depth: fidl::encoding::Depth,
2458 ) -> fidl::Result<()> {
2459 decoder.debug_check_bounds::<Self>(offset);
2460 fidl::decode!(
2462 fidl_fuchsia_testing_deadline::DeadlineId,
2463 fidl::encoding::DefaultFuchsiaResourceDialect,
2464 &mut self.deadline_id,
2465 decoder,
2466 offset + 0,
2467 _depth
2468 )?;
2469 fidl::decode!(
2470 DeadlineEventType,
2471 fidl::encoding::DefaultFuchsiaResourceDialect,
2472 &mut self.event_type,
2473 decoder,
2474 offset + 32,
2475 _depth
2476 )?;
2477 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.on_stop, decoder, offset + 36, _depth)?;
2478 Ok(())
2479 }
2480 }
2481
2482 impl fidl::encoding::ResourceTypeMarker for FakeClockRegisterEventRequest {
2483 type Borrowed<'a> = &'a mut Self;
2484 fn take_or_borrow<'a>(
2485 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2486 ) -> Self::Borrowed<'a> {
2487 value
2488 }
2489 }
2490
2491 unsafe impl fidl::encoding::TypeMarker for FakeClockRegisterEventRequest {
2492 type Owned = Self;
2493
2494 #[inline(always)]
2495 fn inline_align(_context: fidl::encoding::Context) -> usize {
2496 8
2497 }
2498
2499 #[inline(always)]
2500 fn inline_size(_context: fidl::encoding::Context) -> usize {
2501 16
2502 }
2503 }
2504
2505 unsafe impl
2506 fidl::encoding::Encode<
2507 FakeClockRegisterEventRequest,
2508 fidl::encoding::DefaultFuchsiaResourceDialect,
2509 > for &mut FakeClockRegisterEventRequest
2510 {
2511 #[inline]
2512 unsafe fn encode(
2513 self,
2514 encoder: &mut fidl::encoding::Encoder<
2515 '_,
2516 fidl::encoding::DefaultFuchsiaResourceDialect,
2517 >,
2518 offset: usize,
2519 _depth: fidl::encoding::Depth,
2520 ) -> fidl::Result<()> {
2521 encoder.debug_check_bounds::<FakeClockRegisterEventRequest>(offset);
2522 fidl::encoding::Encode::<
2524 FakeClockRegisterEventRequest,
2525 fidl::encoding::DefaultFuchsiaResourceDialect,
2526 >::encode(
2527 (
2528 <fidl::encoding::HandleType<
2529 fidl::EventPair,
2530 { fidl::ObjectType::EVENTPAIR.into_raw() },
2531 2147483648,
2532 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2533 &mut self.event
2534 ),
2535 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.time),
2536 ),
2537 encoder,
2538 offset,
2539 _depth,
2540 )
2541 }
2542 }
2543 unsafe impl<
2544 T0: fidl::encoding::Encode<
2545 fidl::encoding::HandleType<
2546 fidl::EventPair,
2547 { fidl::ObjectType::EVENTPAIR.into_raw() },
2548 2147483648,
2549 >,
2550 fidl::encoding::DefaultFuchsiaResourceDialect,
2551 >,
2552 T1: fidl::encoding::Encode<i64, fidl::encoding::DefaultFuchsiaResourceDialect>,
2553 >
2554 fidl::encoding::Encode<
2555 FakeClockRegisterEventRequest,
2556 fidl::encoding::DefaultFuchsiaResourceDialect,
2557 > for (T0, T1)
2558 {
2559 #[inline]
2560 unsafe fn encode(
2561 self,
2562 encoder: &mut fidl::encoding::Encoder<
2563 '_,
2564 fidl::encoding::DefaultFuchsiaResourceDialect,
2565 >,
2566 offset: usize,
2567 depth: fidl::encoding::Depth,
2568 ) -> fidl::Result<()> {
2569 encoder.debug_check_bounds::<FakeClockRegisterEventRequest>(offset);
2570 unsafe {
2573 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2574 (ptr as *mut u64).write_unaligned(0);
2575 }
2576 self.0.encode(encoder, offset + 0, depth)?;
2578 self.1.encode(encoder, offset + 8, depth)?;
2579 Ok(())
2580 }
2581 }
2582
2583 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2584 for FakeClockRegisterEventRequest
2585 {
2586 #[inline(always)]
2587 fn new_empty() -> Self {
2588 Self {
2589 event: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2590 time: fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect),
2591 }
2592 }
2593
2594 #[inline]
2595 unsafe fn decode(
2596 &mut self,
2597 decoder: &mut fidl::encoding::Decoder<
2598 '_,
2599 fidl::encoding::DefaultFuchsiaResourceDialect,
2600 >,
2601 offset: usize,
2602 _depth: fidl::encoding::Depth,
2603 ) -> fidl::Result<()> {
2604 decoder.debug_check_bounds::<Self>(offset);
2605 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2607 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2608 let mask = 0xffffffff00000000u64;
2609 let maskedval = padval & mask;
2610 if maskedval != 0 {
2611 return Err(fidl::Error::NonZeroPadding {
2612 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2613 });
2614 }
2615 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.event, decoder, offset + 0, _depth)?;
2616 fidl::decode!(
2617 i64,
2618 fidl::encoding::DefaultFuchsiaResourceDialect,
2619 &mut self.time,
2620 decoder,
2621 offset + 8,
2622 _depth
2623 )?;
2624 Ok(())
2625 }
2626 }
2627
2628 impl fidl::encoding::ResourceTypeMarker for FakeClockRescheduleEventRequest {
2629 type Borrowed<'a> = &'a mut Self;
2630 fn take_or_borrow<'a>(
2631 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2632 ) -> Self::Borrowed<'a> {
2633 value
2634 }
2635 }
2636
2637 unsafe impl fidl::encoding::TypeMarker for FakeClockRescheduleEventRequest {
2638 type Owned = Self;
2639
2640 #[inline(always)]
2641 fn inline_align(_context: fidl::encoding::Context) -> usize {
2642 8
2643 }
2644
2645 #[inline(always)]
2646 fn inline_size(_context: fidl::encoding::Context) -> usize {
2647 16
2648 }
2649 }
2650
2651 unsafe impl
2652 fidl::encoding::Encode<
2653 FakeClockRescheduleEventRequest,
2654 fidl::encoding::DefaultFuchsiaResourceDialect,
2655 > for &mut FakeClockRescheduleEventRequest
2656 {
2657 #[inline]
2658 unsafe fn encode(
2659 self,
2660 encoder: &mut fidl::encoding::Encoder<
2661 '_,
2662 fidl::encoding::DefaultFuchsiaResourceDialect,
2663 >,
2664 offset: usize,
2665 _depth: fidl::encoding::Depth,
2666 ) -> fidl::Result<()> {
2667 encoder.debug_check_bounds::<FakeClockRescheduleEventRequest>(offset);
2668 fidl::encoding::Encode::<
2670 FakeClockRescheduleEventRequest,
2671 fidl::encoding::DefaultFuchsiaResourceDialect,
2672 >::encode(
2673 (
2674 <fidl::encoding::HandleType<
2675 fidl::EventPair,
2676 { fidl::ObjectType::EVENTPAIR.into_raw() },
2677 2147483648,
2678 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2679 &mut self.event
2680 ),
2681 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.time),
2682 ),
2683 encoder,
2684 offset,
2685 _depth,
2686 )
2687 }
2688 }
2689 unsafe impl<
2690 T0: fidl::encoding::Encode<
2691 fidl::encoding::HandleType<
2692 fidl::EventPair,
2693 { fidl::ObjectType::EVENTPAIR.into_raw() },
2694 2147483648,
2695 >,
2696 fidl::encoding::DefaultFuchsiaResourceDialect,
2697 >,
2698 T1: fidl::encoding::Encode<i64, fidl::encoding::DefaultFuchsiaResourceDialect>,
2699 >
2700 fidl::encoding::Encode<
2701 FakeClockRescheduleEventRequest,
2702 fidl::encoding::DefaultFuchsiaResourceDialect,
2703 > for (T0, T1)
2704 {
2705 #[inline]
2706 unsafe fn encode(
2707 self,
2708 encoder: &mut fidl::encoding::Encoder<
2709 '_,
2710 fidl::encoding::DefaultFuchsiaResourceDialect,
2711 >,
2712 offset: usize,
2713 depth: fidl::encoding::Depth,
2714 ) -> fidl::Result<()> {
2715 encoder.debug_check_bounds::<FakeClockRescheduleEventRequest>(offset);
2716 unsafe {
2719 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
2720 (ptr as *mut u64).write_unaligned(0);
2721 }
2722 self.0.encode(encoder, offset + 0, depth)?;
2724 self.1.encode(encoder, offset + 8, depth)?;
2725 Ok(())
2726 }
2727 }
2728
2729 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2730 for FakeClockRescheduleEventRequest
2731 {
2732 #[inline(always)]
2733 fn new_empty() -> Self {
2734 Self {
2735 event: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
2736 time: fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect),
2737 }
2738 }
2739
2740 #[inline]
2741 unsafe fn decode(
2742 &mut self,
2743 decoder: &mut fidl::encoding::Decoder<
2744 '_,
2745 fidl::encoding::DefaultFuchsiaResourceDialect,
2746 >,
2747 offset: usize,
2748 _depth: fidl::encoding::Depth,
2749 ) -> fidl::Result<()> {
2750 decoder.debug_check_bounds::<Self>(offset);
2751 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
2753 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2754 let mask = 0xffffffff00000000u64;
2755 let maskedval = padval & mask;
2756 if maskedval != 0 {
2757 return Err(fidl::Error::NonZeroPadding {
2758 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2759 });
2760 }
2761 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.event, decoder, offset + 0, _depth)?;
2762 fidl::decode!(
2763 i64,
2764 fidl::encoding::DefaultFuchsiaResourceDialect,
2765 &mut self.time,
2766 decoder,
2767 offset + 8,
2768 _depth
2769 )?;
2770 Ok(())
2771 }
2772 }
2773}