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