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_test_sagcontrol__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct StateMarker;
16
17impl fidl::endpoints::ProtocolMarker for StateMarker {
18 type Proxy = StateProxy;
19 type RequestStream = StateRequestStream;
20 #[cfg(target_os = "fuchsia")]
21 type SynchronousProxy = StateSynchronousProxy;
22
23 const DEBUG_NAME: &'static str = "test.sagcontrol.State";
24}
25impl fidl::endpoints::DiscoverableProtocolMarker for StateMarker {}
26pub type StateSetResult = Result<(), SetSystemActivityGovernorStateError>;
27
28pub trait StateProxyInterface: Send + Sync {
29 type SetResponseFut: std::future::Future<Output = Result<StateSetResult, fidl::Error>> + Send;
30 fn r#set(&self, payload: &SystemActivityGovernorState) -> Self::SetResponseFut;
31 type GetResponseFut: std::future::Future<Output = Result<SystemActivityGovernorState, fidl::Error>>
32 + Send;
33 fn r#get(&self) -> Self::GetResponseFut;
34 type SetBootCompleteResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
35 fn r#set_boot_complete(&self) -> Self::SetBootCompleteResponseFut;
36 type WatchResponseFut: std::future::Future<Output = Result<SystemActivityGovernorState, fidl::Error>>
37 + Send;
38 fn r#watch(&self) -> Self::WatchResponseFut;
39}
40#[derive(Debug)]
41#[cfg(target_os = "fuchsia")]
42pub struct StateSynchronousProxy {
43 client: fidl::client::sync::Client,
44}
45
46#[cfg(target_os = "fuchsia")]
47impl fidl::endpoints::SynchronousProxy for StateSynchronousProxy {
48 type Proxy = StateProxy;
49 type Protocol = StateMarker;
50
51 fn from_channel(inner: fidl::Channel) -> Self {
52 Self::new(inner)
53 }
54
55 fn into_channel(self) -> fidl::Channel {
56 self.client.into_channel()
57 }
58
59 fn as_channel(&self) -> &fidl::Channel {
60 self.client.as_channel()
61 }
62}
63
64#[cfg(target_os = "fuchsia")]
65impl StateSynchronousProxy {
66 pub fn new(channel: fidl::Channel) -> Self {
67 Self { client: fidl::client::sync::Client::new(channel) }
68 }
69
70 pub fn into_channel(self) -> fidl::Channel {
71 self.client.into_channel()
72 }
73
74 pub fn wait_for_event(
77 &self,
78 deadline: zx::MonotonicInstant,
79 ) -> Result<StateEvent, fidl::Error> {
80 StateEvent::decode(self.client.wait_for_event::<StateMarker>(deadline)?)
81 }
82
83 pub fn r#set(
90 &self,
91 mut payload: &SystemActivityGovernorState,
92 ___deadline: zx::MonotonicInstant,
93 ) -> Result<StateSetResult, fidl::Error> {
94 let _response =
95 self.client.send_query::<SystemActivityGovernorState, fidl::encoding::ResultType<
96 fidl::encoding::EmptyStruct,
97 SetSystemActivityGovernorStateError,
98 >, StateMarker>(
99 payload,
100 0x212842d46b8459f8,
101 fidl::encoding::DynamicFlags::empty(),
102 ___deadline,
103 )?;
104 Ok(_response.map(|x| x))
105 }
106
107 pub fn r#get(
109 &self,
110 ___deadline: zx::MonotonicInstant,
111 ) -> Result<SystemActivityGovernorState, fidl::Error> {
112 let _response = self
113 .client
114 .send_query::<fidl::encoding::EmptyPayload, SystemActivityGovernorState, StateMarker>(
115 (),
116 0x65b19621b5644fdb,
117 fidl::encoding::DynamicFlags::empty(),
118 ___deadline,
119 )?;
120 Ok(_response)
121 }
122
123 pub fn r#set_boot_complete(
125 &self,
126 ___deadline: zx::MonotonicInstant,
127 ) -> Result<(), fidl::Error> {
128 let _response = self
129 .client
130 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload, StateMarker>(
131 (),
132 0x7dded2028ad39365,
133 fidl::encoding::DynamicFlags::empty(),
134 ___deadline,
135 )?;
136 Ok(_response)
137 }
138
139 pub fn r#watch(
153 &self,
154 ___deadline: zx::MonotonicInstant,
155 ) -> Result<SystemActivityGovernorState, fidl::Error> {
156 let _response = self
157 .client
158 .send_query::<fidl::encoding::EmptyPayload, SystemActivityGovernorState, StateMarker>(
159 (),
160 0x434b0aa4bbac7965,
161 fidl::encoding::DynamicFlags::empty(),
162 ___deadline,
163 )?;
164 Ok(_response)
165 }
166}
167
168#[cfg(target_os = "fuchsia")]
169impl From<StateSynchronousProxy> for zx::NullableHandle {
170 fn from(value: StateSynchronousProxy) -> Self {
171 value.into_channel().into()
172 }
173}
174
175#[cfg(target_os = "fuchsia")]
176impl From<fidl::Channel> for StateSynchronousProxy {
177 fn from(value: fidl::Channel) -> Self {
178 Self::new(value)
179 }
180}
181
182#[cfg(target_os = "fuchsia")]
183impl fidl::endpoints::FromClient for StateSynchronousProxy {
184 type Protocol = StateMarker;
185
186 fn from_client(value: fidl::endpoints::ClientEnd<StateMarker>) -> Self {
187 Self::new(value.into_channel())
188 }
189}
190
191#[derive(Debug, Clone)]
192pub struct StateProxy {
193 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
194}
195
196impl fidl::endpoints::Proxy for StateProxy {
197 type Protocol = StateMarker;
198
199 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
200 Self::new(inner)
201 }
202
203 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
204 self.client.into_channel().map_err(|client| Self { client })
205 }
206
207 fn as_channel(&self) -> &::fidl::AsyncChannel {
208 self.client.as_channel()
209 }
210}
211
212impl StateProxy {
213 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
215 let protocol_name = <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
216 Self { client: fidl::client::Client::new(channel, protocol_name) }
217 }
218
219 pub fn take_event_stream(&self) -> StateEventStream {
225 StateEventStream { event_receiver: self.client.take_event_receiver() }
226 }
227
228 pub fn r#set(
235 &self,
236 mut payload: &SystemActivityGovernorState,
237 ) -> fidl::client::QueryResponseFut<StateSetResult, fidl::encoding::DefaultFuchsiaResourceDialect>
238 {
239 StateProxyInterface::r#set(self, payload)
240 }
241
242 pub fn r#get(
244 &self,
245 ) -> fidl::client::QueryResponseFut<
246 SystemActivityGovernorState,
247 fidl::encoding::DefaultFuchsiaResourceDialect,
248 > {
249 StateProxyInterface::r#get(self)
250 }
251
252 pub fn r#set_boot_complete(
254 &self,
255 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
256 StateProxyInterface::r#set_boot_complete(self)
257 }
258
259 pub fn r#watch(
273 &self,
274 ) -> fidl::client::QueryResponseFut<
275 SystemActivityGovernorState,
276 fidl::encoding::DefaultFuchsiaResourceDialect,
277 > {
278 StateProxyInterface::r#watch(self)
279 }
280}
281
282impl StateProxyInterface for StateProxy {
283 type SetResponseFut = fidl::client::QueryResponseFut<
284 StateSetResult,
285 fidl::encoding::DefaultFuchsiaResourceDialect,
286 >;
287 fn r#set(&self, mut payload: &SystemActivityGovernorState) -> Self::SetResponseFut {
288 fn _decode(
289 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
290 ) -> Result<StateSetResult, fidl::Error> {
291 let _response = fidl::client::decode_transaction_body::<
292 fidl::encoding::ResultType<
293 fidl::encoding::EmptyStruct,
294 SetSystemActivityGovernorStateError,
295 >,
296 fidl::encoding::DefaultFuchsiaResourceDialect,
297 0x212842d46b8459f8,
298 >(_buf?)?;
299 Ok(_response.map(|x| x))
300 }
301 self.client.send_query_and_decode::<SystemActivityGovernorState, StateSetResult>(
302 payload,
303 0x212842d46b8459f8,
304 fidl::encoding::DynamicFlags::empty(),
305 _decode,
306 )
307 }
308
309 type GetResponseFut = fidl::client::QueryResponseFut<
310 SystemActivityGovernorState,
311 fidl::encoding::DefaultFuchsiaResourceDialect,
312 >;
313 fn r#get(&self) -> Self::GetResponseFut {
314 fn _decode(
315 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
316 ) -> Result<SystemActivityGovernorState, fidl::Error> {
317 let _response = fidl::client::decode_transaction_body::<
318 SystemActivityGovernorState,
319 fidl::encoding::DefaultFuchsiaResourceDialect,
320 0x65b19621b5644fdb,
321 >(_buf?)?;
322 Ok(_response)
323 }
324 self.client
325 .send_query_and_decode::<fidl::encoding::EmptyPayload, SystemActivityGovernorState>(
326 (),
327 0x65b19621b5644fdb,
328 fidl::encoding::DynamicFlags::empty(),
329 _decode,
330 )
331 }
332
333 type SetBootCompleteResponseFut =
334 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
335 fn r#set_boot_complete(&self) -> Self::SetBootCompleteResponseFut {
336 fn _decode(
337 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
338 ) -> Result<(), fidl::Error> {
339 let _response = fidl::client::decode_transaction_body::<
340 fidl::encoding::EmptyPayload,
341 fidl::encoding::DefaultFuchsiaResourceDialect,
342 0x7dded2028ad39365,
343 >(_buf?)?;
344 Ok(_response)
345 }
346 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
347 (),
348 0x7dded2028ad39365,
349 fidl::encoding::DynamicFlags::empty(),
350 _decode,
351 )
352 }
353
354 type WatchResponseFut = fidl::client::QueryResponseFut<
355 SystemActivityGovernorState,
356 fidl::encoding::DefaultFuchsiaResourceDialect,
357 >;
358 fn r#watch(&self) -> Self::WatchResponseFut {
359 fn _decode(
360 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
361 ) -> Result<SystemActivityGovernorState, fidl::Error> {
362 let _response = fidl::client::decode_transaction_body::<
363 SystemActivityGovernorState,
364 fidl::encoding::DefaultFuchsiaResourceDialect,
365 0x434b0aa4bbac7965,
366 >(_buf?)?;
367 Ok(_response)
368 }
369 self.client
370 .send_query_and_decode::<fidl::encoding::EmptyPayload, SystemActivityGovernorState>(
371 (),
372 0x434b0aa4bbac7965,
373 fidl::encoding::DynamicFlags::empty(),
374 _decode,
375 )
376 }
377}
378
379pub struct StateEventStream {
380 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
381}
382
383impl std::marker::Unpin for StateEventStream {}
384
385impl futures::stream::FusedStream for StateEventStream {
386 fn is_terminated(&self) -> bool {
387 self.event_receiver.is_terminated()
388 }
389}
390
391impl futures::Stream for StateEventStream {
392 type Item = Result<StateEvent, fidl::Error>;
393
394 fn poll_next(
395 mut self: std::pin::Pin<&mut Self>,
396 cx: &mut std::task::Context<'_>,
397 ) -> std::task::Poll<Option<Self::Item>> {
398 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
399 &mut self.event_receiver,
400 cx
401 )?) {
402 Some(buf) => std::task::Poll::Ready(Some(StateEvent::decode(buf))),
403 None => std::task::Poll::Ready(None),
404 }
405 }
406}
407
408#[derive(Debug)]
409pub enum StateEvent {
410 #[non_exhaustive]
411 _UnknownEvent {
412 ordinal: u64,
414 },
415}
416
417impl StateEvent {
418 fn decode(
420 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
421 ) -> Result<StateEvent, fidl::Error> {
422 let (bytes, _handles) = buf.split_mut();
423 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
424 debug_assert_eq!(tx_header.tx_id, 0);
425 match tx_header.ordinal {
426 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
427 Ok(StateEvent::_UnknownEvent { ordinal: tx_header.ordinal })
428 }
429 _ => Err(fidl::Error::UnknownOrdinal {
430 ordinal: tx_header.ordinal,
431 protocol_name: <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
432 }),
433 }
434 }
435}
436
437pub struct StateRequestStream {
439 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
440 is_terminated: bool,
441}
442
443impl std::marker::Unpin for StateRequestStream {}
444
445impl futures::stream::FusedStream for StateRequestStream {
446 fn is_terminated(&self) -> bool {
447 self.is_terminated
448 }
449}
450
451impl fidl::endpoints::RequestStream for StateRequestStream {
452 type Protocol = StateMarker;
453 type ControlHandle = StateControlHandle;
454
455 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
456 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
457 }
458
459 fn control_handle(&self) -> Self::ControlHandle {
460 StateControlHandle { inner: self.inner.clone() }
461 }
462
463 fn into_inner(
464 self,
465 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
466 {
467 (self.inner, self.is_terminated)
468 }
469
470 fn from_inner(
471 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
472 is_terminated: bool,
473 ) -> Self {
474 Self { inner, is_terminated }
475 }
476}
477
478impl futures::Stream for StateRequestStream {
479 type Item = Result<StateRequest, fidl::Error>;
480
481 fn poll_next(
482 mut self: std::pin::Pin<&mut Self>,
483 cx: &mut std::task::Context<'_>,
484 ) -> std::task::Poll<Option<Self::Item>> {
485 let this = &mut *self;
486 if this.inner.check_shutdown(cx) {
487 this.is_terminated = true;
488 return std::task::Poll::Ready(None);
489 }
490 if this.is_terminated {
491 panic!("polled StateRequestStream after completion");
492 }
493 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
494 |bytes, handles| {
495 match this.inner.channel().read_etc(cx, bytes, handles) {
496 std::task::Poll::Ready(Ok(())) => {}
497 std::task::Poll::Pending => return std::task::Poll::Pending,
498 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
499 this.is_terminated = true;
500 return std::task::Poll::Ready(None);
501 }
502 std::task::Poll::Ready(Err(e)) => {
503 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
504 e.into(),
505 ))));
506 }
507 }
508
509 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
511
512 std::task::Poll::Ready(Some(match header.ordinal {
513 0x212842d46b8459f8 => {
514 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
515 let mut req = fidl::new_empty!(
516 SystemActivityGovernorState,
517 fidl::encoding::DefaultFuchsiaResourceDialect
518 );
519 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SystemActivityGovernorState>(&header, _body_bytes, handles, &mut req)?;
520 let control_handle = StateControlHandle { inner: this.inner.clone() };
521 Ok(StateRequest::Set {
522 payload: req,
523 responder: StateSetResponder {
524 control_handle: std::mem::ManuallyDrop::new(control_handle),
525 tx_id: header.tx_id,
526 },
527 })
528 }
529 0x65b19621b5644fdb => {
530 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
531 let mut req = fidl::new_empty!(
532 fidl::encoding::EmptyPayload,
533 fidl::encoding::DefaultFuchsiaResourceDialect
534 );
535 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
536 let control_handle = StateControlHandle { inner: this.inner.clone() };
537 Ok(StateRequest::Get {
538 responder: StateGetResponder {
539 control_handle: std::mem::ManuallyDrop::new(control_handle),
540 tx_id: header.tx_id,
541 },
542 })
543 }
544 0x7dded2028ad39365 => {
545 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
546 let mut req = fidl::new_empty!(
547 fidl::encoding::EmptyPayload,
548 fidl::encoding::DefaultFuchsiaResourceDialect
549 );
550 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
551 let control_handle = StateControlHandle { inner: this.inner.clone() };
552 Ok(StateRequest::SetBootComplete {
553 responder: StateSetBootCompleteResponder {
554 control_handle: std::mem::ManuallyDrop::new(control_handle),
555 tx_id: header.tx_id,
556 },
557 })
558 }
559 0x434b0aa4bbac7965 => {
560 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
561 let mut req = fidl::new_empty!(
562 fidl::encoding::EmptyPayload,
563 fidl::encoding::DefaultFuchsiaResourceDialect
564 );
565 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
566 let control_handle = StateControlHandle { inner: this.inner.clone() };
567 Ok(StateRequest::Watch {
568 responder: StateWatchResponder {
569 control_handle: std::mem::ManuallyDrop::new(control_handle),
570 tx_id: header.tx_id,
571 },
572 })
573 }
574 _ if header.tx_id == 0
575 && header
576 .dynamic_flags()
577 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
578 {
579 Ok(StateRequest::_UnknownMethod {
580 ordinal: header.ordinal,
581 control_handle: StateControlHandle { inner: this.inner.clone() },
582 method_type: fidl::MethodType::OneWay,
583 })
584 }
585 _ if header
586 .dynamic_flags()
587 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
588 {
589 this.inner.send_framework_err(
590 fidl::encoding::FrameworkErr::UnknownMethod,
591 header.tx_id,
592 header.ordinal,
593 header.dynamic_flags(),
594 (bytes, handles),
595 )?;
596 Ok(StateRequest::_UnknownMethod {
597 ordinal: header.ordinal,
598 control_handle: StateControlHandle { inner: this.inner.clone() },
599 method_type: fidl::MethodType::TwoWay,
600 })
601 }
602 _ => Err(fidl::Error::UnknownOrdinal {
603 ordinal: header.ordinal,
604 protocol_name: <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
605 }),
606 }))
607 },
608 )
609 }
610}
611
612#[derive(Debug)]
613pub enum StateRequest {
614 Set { payload: SystemActivityGovernorState, responder: StateSetResponder },
621 Get { responder: StateGetResponder },
623 SetBootComplete { responder: StateSetBootCompleteResponder },
625 Watch { responder: StateWatchResponder },
639 #[non_exhaustive]
641 _UnknownMethod {
642 ordinal: u64,
644 control_handle: StateControlHandle,
645 method_type: fidl::MethodType,
646 },
647}
648
649impl StateRequest {
650 #[allow(irrefutable_let_patterns)]
651 pub fn into_set(self) -> Option<(SystemActivityGovernorState, StateSetResponder)> {
652 if let StateRequest::Set { payload, responder } = self {
653 Some((payload, responder))
654 } else {
655 None
656 }
657 }
658
659 #[allow(irrefutable_let_patterns)]
660 pub fn into_get(self) -> Option<(StateGetResponder)> {
661 if let StateRequest::Get { responder } = self { Some((responder)) } else { None }
662 }
663
664 #[allow(irrefutable_let_patterns)]
665 pub fn into_set_boot_complete(self) -> Option<(StateSetBootCompleteResponder)> {
666 if let StateRequest::SetBootComplete { responder } = self {
667 Some((responder))
668 } else {
669 None
670 }
671 }
672
673 #[allow(irrefutable_let_patterns)]
674 pub fn into_watch(self) -> Option<(StateWatchResponder)> {
675 if let StateRequest::Watch { responder } = self { Some((responder)) } else { None }
676 }
677
678 pub fn method_name(&self) -> &'static str {
680 match *self {
681 StateRequest::Set { .. } => "set",
682 StateRequest::Get { .. } => "get",
683 StateRequest::SetBootComplete { .. } => "set_boot_complete",
684 StateRequest::Watch { .. } => "watch",
685 StateRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
686 "unknown one-way method"
687 }
688 StateRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
689 "unknown two-way method"
690 }
691 }
692 }
693}
694
695#[derive(Debug, Clone)]
696pub struct StateControlHandle {
697 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
698}
699
700impl fidl::endpoints::ControlHandle for StateControlHandle {
701 fn shutdown(&self) {
702 self.inner.shutdown()
703 }
704
705 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
706 self.inner.shutdown_with_epitaph(status)
707 }
708
709 fn is_closed(&self) -> bool {
710 self.inner.channel().is_closed()
711 }
712 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
713 self.inner.channel().on_closed()
714 }
715
716 #[cfg(target_os = "fuchsia")]
717 fn signal_peer(
718 &self,
719 clear_mask: zx::Signals,
720 set_mask: zx::Signals,
721 ) -> Result<(), zx_status::Status> {
722 use fidl::Peered;
723 self.inner.channel().signal_peer(clear_mask, set_mask)
724 }
725}
726
727impl StateControlHandle {}
728
729#[must_use = "FIDL methods require a response to be sent"]
730#[derive(Debug)]
731pub struct StateSetResponder {
732 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
733 tx_id: u32,
734}
735
736impl std::ops::Drop for StateSetResponder {
740 fn drop(&mut self) {
741 self.control_handle.shutdown();
742 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
744 }
745}
746
747impl fidl::endpoints::Responder for StateSetResponder {
748 type ControlHandle = StateControlHandle;
749
750 fn control_handle(&self) -> &StateControlHandle {
751 &self.control_handle
752 }
753
754 fn drop_without_shutdown(mut self) {
755 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
757 std::mem::forget(self);
759 }
760}
761
762impl StateSetResponder {
763 pub fn send(
767 self,
768 mut result: Result<(), SetSystemActivityGovernorStateError>,
769 ) -> Result<(), fidl::Error> {
770 let _result = self.send_raw(result);
771 if _result.is_err() {
772 self.control_handle.shutdown();
773 }
774 self.drop_without_shutdown();
775 _result
776 }
777
778 pub fn send_no_shutdown_on_err(
780 self,
781 mut result: Result<(), SetSystemActivityGovernorStateError>,
782 ) -> Result<(), fidl::Error> {
783 let _result = self.send_raw(result);
784 self.drop_without_shutdown();
785 _result
786 }
787
788 fn send_raw(
789 &self,
790 mut result: Result<(), SetSystemActivityGovernorStateError>,
791 ) -> Result<(), fidl::Error> {
792 self.control_handle.inner.send::<fidl::encoding::ResultType<
793 fidl::encoding::EmptyStruct,
794 SetSystemActivityGovernorStateError,
795 >>(
796 result,
797 self.tx_id,
798 0x212842d46b8459f8,
799 fidl::encoding::DynamicFlags::empty(),
800 )
801 }
802}
803
804#[must_use = "FIDL methods require a response to be sent"]
805#[derive(Debug)]
806pub struct StateGetResponder {
807 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
808 tx_id: u32,
809}
810
811impl std::ops::Drop for StateGetResponder {
815 fn drop(&mut self) {
816 self.control_handle.shutdown();
817 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
819 }
820}
821
822impl fidl::endpoints::Responder for StateGetResponder {
823 type ControlHandle = StateControlHandle;
824
825 fn control_handle(&self) -> &StateControlHandle {
826 &self.control_handle
827 }
828
829 fn drop_without_shutdown(mut self) {
830 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
832 std::mem::forget(self);
834 }
835}
836
837impl StateGetResponder {
838 pub fn send(self, mut payload: &SystemActivityGovernorState) -> Result<(), fidl::Error> {
842 let _result = self.send_raw(payload);
843 if _result.is_err() {
844 self.control_handle.shutdown();
845 }
846 self.drop_without_shutdown();
847 _result
848 }
849
850 pub fn send_no_shutdown_on_err(
852 self,
853 mut payload: &SystemActivityGovernorState,
854 ) -> Result<(), fidl::Error> {
855 let _result = self.send_raw(payload);
856 self.drop_without_shutdown();
857 _result
858 }
859
860 fn send_raw(&self, mut payload: &SystemActivityGovernorState) -> Result<(), fidl::Error> {
861 self.control_handle.inner.send::<SystemActivityGovernorState>(
862 payload,
863 self.tx_id,
864 0x65b19621b5644fdb,
865 fidl::encoding::DynamicFlags::empty(),
866 )
867 }
868}
869
870#[must_use = "FIDL methods require a response to be sent"]
871#[derive(Debug)]
872pub struct StateSetBootCompleteResponder {
873 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
874 tx_id: u32,
875}
876
877impl std::ops::Drop for StateSetBootCompleteResponder {
881 fn drop(&mut self) {
882 self.control_handle.shutdown();
883 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
885 }
886}
887
888impl fidl::endpoints::Responder for StateSetBootCompleteResponder {
889 type ControlHandle = StateControlHandle;
890
891 fn control_handle(&self) -> &StateControlHandle {
892 &self.control_handle
893 }
894
895 fn drop_without_shutdown(mut self) {
896 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
898 std::mem::forget(self);
900 }
901}
902
903impl StateSetBootCompleteResponder {
904 pub fn send(self) -> Result<(), fidl::Error> {
908 let _result = self.send_raw();
909 if _result.is_err() {
910 self.control_handle.shutdown();
911 }
912 self.drop_without_shutdown();
913 _result
914 }
915
916 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
918 let _result = self.send_raw();
919 self.drop_without_shutdown();
920 _result
921 }
922
923 fn send_raw(&self) -> Result<(), fidl::Error> {
924 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
925 (),
926 self.tx_id,
927 0x7dded2028ad39365,
928 fidl::encoding::DynamicFlags::empty(),
929 )
930 }
931}
932
933#[must_use = "FIDL methods require a response to be sent"]
934#[derive(Debug)]
935pub struct StateWatchResponder {
936 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
937 tx_id: u32,
938}
939
940impl std::ops::Drop for StateWatchResponder {
944 fn drop(&mut self) {
945 self.control_handle.shutdown();
946 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
948 }
949}
950
951impl fidl::endpoints::Responder for StateWatchResponder {
952 type ControlHandle = StateControlHandle;
953
954 fn control_handle(&self) -> &StateControlHandle {
955 &self.control_handle
956 }
957
958 fn drop_without_shutdown(mut self) {
959 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
961 std::mem::forget(self);
963 }
964}
965
966impl StateWatchResponder {
967 pub fn send(self, mut payload: &SystemActivityGovernorState) -> Result<(), fidl::Error> {
971 let _result = self.send_raw(payload);
972 if _result.is_err() {
973 self.control_handle.shutdown();
974 }
975 self.drop_without_shutdown();
976 _result
977 }
978
979 pub fn send_no_shutdown_on_err(
981 self,
982 mut payload: &SystemActivityGovernorState,
983 ) -> Result<(), fidl::Error> {
984 let _result = self.send_raw(payload);
985 self.drop_without_shutdown();
986 _result
987 }
988
989 fn send_raw(&self, mut payload: &SystemActivityGovernorState) -> Result<(), fidl::Error> {
990 self.control_handle.inner.send::<SystemActivityGovernorState>(
991 payload,
992 self.tx_id,
993 0x434b0aa4bbac7965,
994 fidl::encoding::DynamicFlags::empty(),
995 )
996 }
997}
998
999mod internal {
1000 use super::*;
1001}