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_archivist_test_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct InspectPuppetCreateInspectorResponse {
16 pub writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for InspectPuppetCreateInspectorResponse
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct PuppetRecordLazyValuesResponse {
26 pub client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for PuppetRecordLazyValuesResponse
31{
32}
33
34#[derive(Debug, PartialEq)]
35pub struct RealmFactoryCreateRealmRequest {
36 pub options: RealmOptions,
37 pub realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
41 for RealmFactoryCreateRealmRequest
42{
43}
44
45#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46pub struct StopWatcherWatchComponentResponse {
47 pub client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
51 for StopWatcherWatchComponentResponse
52{
53}
54
55#[derive(Debug, Default, PartialEq)]
56pub struct InspectWriterEscrowAndExitResponse {
57 pub token: Option<fidl_fuchsia_inspect::EscrowToken>,
58 #[doc(hidden)]
59 pub __source_breaking: fidl::marker::SourceBreaking,
60}
61
62impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
63 for InspectWriterEscrowAndExitResponse
64{
65}
66
67#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
68pub struct InspectPuppetMarker;
69
70impl fidl::endpoints::ProtocolMarker for InspectPuppetMarker {
71 type Proxy = InspectPuppetProxy;
72 type RequestStream = InspectPuppetRequestStream;
73 #[cfg(target_os = "fuchsia")]
74 type SynchronousProxy = InspectPuppetSynchronousProxy;
75
76 const DEBUG_NAME: &'static str = "fuchsia.archivist.test.InspectPuppet";
77}
78impl fidl::endpoints::DiscoverableProtocolMarker for InspectPuppetMarker {}
79
80pub trait InspectPuppetProxyInterface: Send + Sync {
81 type CreateInspectorResponseFut: std::future::Future<
82 Output = Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error>,
83 > + Send;
84 fn r#create_inspector(
85 &self,
86 payload: &InspectPuppetCreateInspectorRequest,
87 ) -> Self::CreateInspectorResponseFut;
88}
89#[derive(Debug)]
90#[cfg(target_os = "fuchsia")]
91pub struct InspectPuppetSynchronousProxy {
92 client: fidl::client::sync::Client,
93}
94
95#[cfg(target_os = "fuchsia")]
96impl fidl::endpoints::SynchronousProxy for InspectPuppetSynchronousProxy {
97 type Proxy = InspectPuppetProxy;
98 type Protocol = InspectPuppetMarker;
99
100 fn from_channel(inner: fidl::Channel) -> Self {
101 Self::new(inner)
102 }
103
104 fn into_channel(self) -> fidl::Channel {
105 self.client.into_channel()
106 }
107
108 fn as_channel(&self) -> &fidl::Channel {
109 self.client.as_channel()
110 }
111}
112
113#[cfg(target_os = "fuchsia")]
114impl InspectPuppetSynchronousProxy {
115 pub fn new(channel: fidl::Channel) -> Self {
116 let protocol_name = <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
117 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
118 }
119
120 pub fn into_channel(self) -> fidl::Channel {
121 self.client.into_channel()
122 }
123
124 pub fn wait_for_event(
127 &self,
128 deadline: zx::MonotonicInstant,
129 ) -> Result<InspectPuppetEvent, fidl::Error> {
130 InspectPuppetEvent::decode(self.client.wait_for_event(deadline)?)
131 }
132
133 pub fn r#create_inspector(
136 &self,
137 mut payload: &InspectPuppetCreateInspectorRequest,
138 ___deadline: zx::MonotonicInstant,
139 ) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
140 let _response = self.client.send_query::<
141 InspectPuppetCreateInspectorRequest,
142 fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
143 >(
144 payload,
145 0x2c0f807d7d159bb,
146 fidl::encoding::DynamicFlags::FLEXIBLE,
147 ___deadline,
148 )?
149 .into_result::<InspectPuppetMarker>("create_inspector")?;
150 Ok(_response.writer)
151 }
152}
153
154#[cfg(target_os = "fuchsia")]
155impl From<InspectPuppetSynchronousProxy> for zx::Handle {
156 fn from(value: InspectPuppetSynchronousProxy) -> Self {
157 value.into_channel().into()
158 }
159}
160
161#[cfg(target_os = "fuchsia")]
162impl From<fidl::Channel> for InspectPuppetSynchronousProxy {
163 fn from(value: fidl::Channel) -> Self {
164 Self::new(value)
165 }
166}
167
168#[derive(Debug, Clone)]
169pub struct InspectPuppetProxy {
170 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
171}
172
173impl fidl::endpoints::Proxy for InspectPuppetProxy {
174 type Protocol = InspectPuppetMarker;
175
176 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
177 Self::new(inner)
178 }
179
180 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
181 self.client.into_channel().map_err(|client| Self { client })
182 }
183
184 fn as_channel(&self) -> &::fidl::AsyncChannel {
185 self.client.as_channel()
186 }
187}
188
189impl InspectPuppetProxy {
190 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
192 let protocol_name = <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
193 Self { client: fidl::client::Client::new(channel, protocol_name) }
194 }
195
196 pub fn take_event_stream(&self) -> InspectPuppetEventStream {
202 InspectPuppetEventStream { event_receiver: self.client.take_event_receiver() }
203 }
204
205 pub fn r#create_inspector(
208 &self,
209 mut payload: &InspectPuppetCreateInspectorRequest,
210 ) -> fidl::client::QueryResponseFut<
211 fidl::endpoints::ClientEnd<InspectWriterMarker>,
212 fidl::encoding::DefaultFuchsiaResourceDialect,
213 > {
214 InspectPuppetProxyInterface::r#create_inspector(self, payload)
215 }
216}
217
218impl InspectPuppetProxyInterface for InspectPuppetProxy {
219 type CreateInspectorResponseFut = fidl::client::QueryResponseFut<
220 fidl::endpoints::ClientEnd<InspectWriterMarker>,
221 fidl::encoding::DefaultFuchsiaResourceDialect,
222 >;
223 fn r#create_inspector(
224 &self,
225 mut payload: &InspectPuppetCreateInspectorRequest,
226 ) -> Self::CreateInspectorResponseFut {
227 fn _decode(
228 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
229 ) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
230 let _response = fidl::client::decode_transaction_body::<
231 fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
232 fidl::encoding::DefaultFuchsiaResourceDialect,
233 0x2c0f807d7d159bb,
234 >(_buf?)?
235 .into_result::<InspectPuppetMarker>("create_inspector")?;
236 Ok(_response.writer)
237 }
238 self.client.send_query_and_decode::<
239 InspectPuppetCreateInspectorRequest,
240 fidl::endpoints::ClientEnd<InspectWriterMarker>,
241 >(
242 payload,
243 0x2c0f807d7d159bb,
244 fidl::encoding::DynamicFlags::FLEXIBLE,
245 _decode,
246 )
247 }
248}
249
250pub struct InspectPuppetEventStream {
251 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
252}
253
254impl std::marker::Unpin for InspectPuppetEventStream {}
255
256impl futures::stream::FusedStream for InspectPuppetEventStream {
257 fn is_terminated(&self) -> bool {
258 self.event_receiver.is_terminated()
259 }
260}
261
262impl futures::Stream for InspectPuppetEventStream {
263 type Item = Result<InspectPuppetEvent, fidl::Error>;
264
265 fn poll_next(
266 mut self: std::pin::Pin<&mut Self>,
267 cx: &mut std::task::Context<'_>,
268 ) -> std::task::Poll<Option<Self::Item>> {
269 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
270 &mut self.event_receiver,
271 cx
272 )?) {
273 Some(buf) => std::task::Poll::Ready(Some(InspectPuppetEvent::decode(buf))),
274 None => std::task::Poll::Ready(None),
275 }
276 }
277}
278
279#[derive(Debug)]
280pub enum InspectPuppetEvent {
281 #[non_exhaustive]
282 _UnknownEvent {
283 ordinal: u64,
285 },
286}
287
288impl InspectPuppetEvent {
289 fn decode(
291 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
292 ) -> Result<InspectPuppetEvent, fidl::Error> {
293 let (bytes, _handles) = buf.split_mut();
294 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
295 debug_assert_eq!(tx_header.tx_id, 0);
296 match tx_header.ordinal {
297 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
298 Ok(InspectPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
299 }
300 _ => Err(fidl::Error::UnknownOrdinal {
301 ordinal: tx_header.ordinal,
302 protocol_name: <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
303 }),
304 }
305 }
306}
307
308pub struct InspectPuppetRequestStream {
310 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
311 is_terminated: bool,
312}
313
314impl std::marker::Unpin for InspectPuppetRequestStream {}
315
316impl futures::stream::FusedStream for InspectPuppetRequestStream {
317 fn is_terminated(&self) -> bool {
318 self.is_terminated
319 }
320}
321
322impl fidl::endpoints::RequestStream for InspectPuppetRequestStream {
323 type Protocol = InspectPuppetMarker;
324 type ControlHandle = InspectPuppetControlHandle;
325
326 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
327 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
328 }
329
330 fn control_handle(&self) -> Self::ControlHandle {
331 InspectPuppetControlHandle { inner: self.inner.clone() }
332 }
333
334 fn into_inner(
335 self,
336 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
337 {
338 (self.inner, self.is_terminated)
339 }
340
341 fn from_inner(
342 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
343 is_terminated: bool,
344 ) -> Self {
345 Self { inner, is_terminated }
346 }
347}
348
349impl futures::Stream for InspectPuppetRequestStream {
350 type Item = Result<InspectPuppetRequest, fidl::Error>;
351
352 fn poll_next(
353 mut self: std::pin::Pin<&mut Self>,
354 cx: &mut std::task::Context<'_>,
355 ) -> std::task::Poll<Option<Self::Item>> {
356 let this = &mut *self;
357 if this.inner.check_shutdown(cx) {
358 this.is_terminated = true;
359 return std::task::Poll::Ready(None);
360 }
361 if this.is_terminated {
362 panic!("polled InspectPuppetRequestStream after completion");
363 }
364 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
365 |bytes, handles| {
366 match this.inner.channel().read_etc(cx, bytes, handles) {
367 std::task::Poll::Ready(Ok(())) => {}
368 std::task::Poll::Pending => return std::task::Poll::Pending,
369 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
370 this.is_terminated = true;
371 return std::task::Poll::Ready(None);
372 }
373 std::task::Poll::Ready(Err(e)) => {
374 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
375 e.into(),
376 ))))
377 }
378 }
379
380 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
382
383 std::task::Poll::Ready(Some(match header.ordinal {
384 0x2c0f807d7d159bb => {
385 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
386 let mut req = fidl::new_empty!(
387 InspectPuppetCreateInspectorRequest,
388 fidl::encoding::DefaultFuchsiaResourceDialect
389 );
390 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetCreateInspectorRequest>(&header, _body_bytes, handles, &mut req)?;
391 let control_handle =
392 InspectPuppetControlHandle { inner: this.inner.clone() };
393 Ok(InspectPuppetRequest::CreateInspector {
394 payload: req,
395 responder: InspectPuppetCreateInspectorResponder {
396 control_handle: std::mem::ManuallyDrop::new(control_handle),
397 tx_id: header.tx_id,
398 },
399 })
400 }
401 _ if header.tx_id == 0
402 && header
403 .dynamic_flags()
404 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
405 {
406 Ok(InspectPuppetRequest::_UnknownMethod {
407 ordinal: header.ordinal,
408 control_handle: InspectPuppetControlHandle {
409 inner: this.inner.clone(),
410 },
411 method_type: fidl::MethodType::OneWay,
412 })
413 }
414 _ if header
415 .dynamic_flags()
416 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
417 {
418 this.inner.send_framework_err(
419 fidl::encoding::FrameworkErr::UnknownMethod,
420 header.tx_id,
421 header.ordinal,
422 header.dynamic_flags(),
423 (bytes, handles),
424 )?;
425 Ok(InspectPuppetRequest::_UnknownMethod {
426 ordinal: header.ordinal,
427 control_handle: InspectPuppetControlHandle {
428 inner: this.inner.clone(),
429 },
430 method_type: fidl::MethodType::TwoWay,
431 })
432 }
433 _ => Err(fidl::Error::UnknownOrdinal {
434 ordinal: header.ordinal,
435 protocol_name:
436 <InspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
437 }),
438 }))
439 },
440 )
441 }
442}
443
444#[derive(Debug)]
446pub enum InspectPuppetRequest {
447 CreateInspector {
450 payload: InspectPuppetCreateInspectorRequest,
451 responder: InspectPuppetCreateInspectorResponder,
452 },
453 #[non_exhaustive]
455 _UnknownMethod {
456 ordinal: u64,
458 control_handle: InspectPuppetControlHandle,
459 method_type: fidl::MethodType,
460 },
461}
462
463impl InspectPuppetRequest {
464 #[allow(irrefutable_let_patterns)]
465 pub fn into_create_inspector(
466 self,
467 ) -> Option<(InspectPuppetCreateInspectorRequest, InspectPuppetCreateInspectorResponder)> {
468 if let InspectPuppetRequest::CreateInspector { payload, responder } = self {
469 Some((payload, responder))
470 } else {
471 None
472 }
473 }
474
475 pub fn method_name(&self) -> &'static str {
477 match *self {
478 InspectPuppetRequest::CreateInspector { .. } => "create_inspector",
479 InspectPuppetRequest::_UnknownMethod {
480 method_type: fidl::MethodType::OneWay, ..
481 } => "unknown one-way method",
482 InspectPuppetRequest::_UnknownMethod {
483 method_type: fidl::MethodType::TwoWay, ..
484 } => "unknown two-way method",
485 }
486 }
487}
488
489#[derive(Debug, Clone)]
490pub struct InspectPuppetControlHandle {
491 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
492}
493
494impl fidl::endpoints::ControlHandle for InspectPuppetControlHandle {
495 fn shutdown(&self) {
496 self.inner.shutdown()
497 }
498 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
499 self.inner.shutdown_with_epitaph(status)
500 }
501
502 fn is_closed(&self) -> bool {
503 self.inner.channel().is_closed()
504 }
505 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
506 self.inner.channel().on_closed()
507 }
508
509 #[cfg(target_os = "fuchsia")]
510 fn signal_peer(
511 &self,
512 clear_mask: zx::Signals,
513 set_mask: zx::Signals,
514 ) -> Result<(), zx_status::Status> {
515 use fidl::Peered;
516 self.inner.channel().signal_peer(clear_mask, set_mask)
517 }
518}
519
520impl InspectPuppetControlHandle {}
521
522#[must_use = "FIDL methods require a response to be sent"]
523#[derive(Debug)]
524pub struct InspectPuppetCreateInspectorResponder {
525 control_handle: std::mem::ManuallyDrop<InspectPuppetControlHandle>,
526 tx_id: u32,
527}
528
529impl std::ops::Drop for InspectPuppetCreateInspectorResponder {
533 fn drop(&mut self) {
534 self.control_handle.shutdown();
535 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
537 }
538}
539
540impl fidl::endpoints::Responder for InspectPuppetCreateInspectorResponder {
541 type ControlHandle = InspectPuppetControlHandle;
542
543 fn control_handle(&self) -> &InspectPuppetControlHandle {
544 &self.control_handle
545 }
546
547 fn drop_without_shutdown(mut self) {
548 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
550 std::mem::forget(self);
552 }
553}
554
555impl InspectPuppetCreateInspectorResponder {
556 pub fn send(
560 self,
561 mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
562 ) -> Result<(), fidl::Error> {
563 let _result = self.send_raw(writer);
564 if _result.is_err() {
565 self.control_handle.shutdown();
566 }
567 self.drop_without_shutdown();
568 _result
569 }
570
571 pub fn send_no_shutdown_on_err(
573 self,
574 mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
575 ) -> Result<(), fidl::Error> {
576 let _result = self.send_raw(writer);
577 self.drop_without_shutdown();
578 _result
579 }
580
581 fn send_raw(
582 &self,
583 mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
584 ) -> Result<(), fidl::Error> {
585 self.control_handle
586 .inner
587 .send::<fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>>(
588 fidl::encoding::Flexible::new((writer,)),
589 self.tx_id,
590 0x2c0f807d7d159bb,
591 fidl::encoding::DynamicFlags::FLEXIBLE,
592 )
593 }
594}
595
596#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
597pub struct InspectWriterMarker;
598
599impl fidl::endpoints::ProtocolMarker for InspectWriterMarker {
600 type Proxy = InspectWriterProxy;
601 type RequestStream = InspectWriterRequestStream;
602 #[cfg(target_os = "fuchsia")]
603 type SynchronousProxy = InspectWriterSynchronousProxy;
604
605 const DEBUG_NAME: &'static str = "(anonymous) InspectWriter";
606}
607
608pub trait InspectWriterProxyInterface: Send + Sync {
609 type SetHealthOkResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
610 fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut;
611 type RecordStringResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
612 fn r#record_string(&self, key: &str, value: &str) -> Self::RecordStringResponseFut;
613 type RecordIntResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
614 fn r#record_int(&self, key: &str, value: i64) -> Self::RecordIntResponseFut;
615 type EmitExampleInspectDataResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
616 + Send;
617 fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut;
618 type EscrowAndExitResponseFut: std::future::Future<Output = Result<InspectWriterEscrowAndExitResponse, fidl::Error>>
619 + Send;
620 fn r#escrow_and_exit(
621 &self,
622 payload: &InspectWriterEscrowAndExitRequest,
623 ) -> Self::EscrowAndExitResponseFut;
624}
625#[derive(Debug)]
626#[cfg(target_os = "fuchsia")]
627pub struct InspectWriterSynchronousProxy {
628 client: fidl::client::sync::Client,
629}
630
631#[cfg(target_os = "fuchsia")]
632impl fidl::endpoints::SynchronousProxy for InspectWriterSynchronousProxy {
633 type Proxy = InspectWriterProxy;
634 type Protocol = InspectWriterMarker;
635
636 fn from_channel(inner: fidl::Channel) -> Self {
637 Self::new(inner)
638 }
639
640 fn into_channel(self) -> fidl::Channel {
641 self.client.into_channel()
642 }
643
644 fn as_channel(&self) -> &fidl::Channel {
645 self.client.as_channel()
646 }
647}
648
649#[cfg(target_os = "fuchsia")]
650impl InspectWriterSynchronousProxy {
651 pub fn new(channel: fidl::Channel) -> Self {
652 let protocol_name = <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
653 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
654 }
655
656 pub fn into_channel(self) -> fidl::Channel {
657 self.client.into_channel()
658 }
659
660 pub fn wait_for_event(
663 &self,
664 deadline: zx::MonotonicInstant,
665 ) -> Result<InspectWriterEvent, fidl::Error> {
666 InspectWriterEvent::decode(self.client.wait_for_event(deadline)?)
667 }
668
669 pub fn r#set_health_ok(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
671 let _response = self.client.send_query::<
672 fidl::encoding::EmptyPayload,
673 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
674 >(
675 (),
676 0xe7510549d99075e,
677 fidl::encoding::DynamicFlags::FLEXIBLE,
678 ___deadline,
679 )?
680 .into_result::<InspectWriterMarker>("set_health_ok")?;
681 Ok(_response)
682 }
683
684 pub fn r#record_string(
686 &self,
687 mut key: &str,
688 mut value: &str,
689 ___deadline: zx::MonotonicInstant,
690 ) -> Result<(), fidl::Error> {
691 let _response = self.client.send_query::<
692 InspectWriterRecordStringRequest,
693 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
694 >(
695 (key, value,),
696 0x195be230721d712b,
697 fidl::encoding::DynamicFlags::FLEXIBLE,
698 ___deadline,
699 )?
700 .into_result::<InspectWriterMarker>("record_string")?;
701 Ok(_response)
702 }
703
704 pub fn r#record_int(
706 &self,
707 mut key: &str,
708 mut value: i64,
709 ___deadline: zx::MonotonicInstant,
710 ) -> Result<(), fidl::Error> {
711 let _response = self.client.send_query::<
712 InspectWriterRecordIntRequest,
713 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
714 >(
715 (key, value,),
716 0xa2c6cbf0df0949,
717 fidl::encoding::DynamicFlags::FLEXIBLE,
718 ___deadline,
719 )?
720 .into_result::<InspectWriterMarker>("record_int")?;
721 Ok(_response)
722 }
723
724 pub fn r#emit_example_inspect_data(
729 &self,
730 ___deadline: zx::MonotonicInstant,
731 ) -> Result<(), fidl::Error> {
732 let _response = self.client.send_query::<
733 fidl::encoding::EmptyPayload,
734 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
735 >(
736 (),
737 0x228ae4647773fd94,
738 fidl::encoding::DynamicFlags::FLEXIBLE,
739 ___deadline,
740 )?
741 .into_result::<InspectWriterMarker>("emit_example_inspect_data")?;
742 Ok(_response)
743 }
744
745 pub fn r#escrow_and_exit(
747 &self,
748 mut payload: &InspectWriterEscrowAndExitRequest,
749 ___deadline: zx::MonotonicInstant,
750 ) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
751 let _response = self.client.send_query::<
752 InspectWriterEscrowAndExitRequest,
753 fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
754 >(
755 payload,
756 0x60e24adbd0e588ff,
757 fidl::encoding::DynamicFlags::FLEXIBLE,
758 ___deadline,
759 )?
760 .into_result::<InspectWriterMarker>("escrow_and_exit")?;
761 Ok(_response)
762 }
763}
764
765#[cfg(target_os = "fuchsia")]
766impl From<InspectWriterSynchronousProxy> for zx::Handle {
767 fn from(value: InspectWriterSynchronousProxy) -> Self {
768 value.into_channel().into()
769 }
770}
771
772#[cfg(target_os = "fuchsia")]
773impl From<fidl::Channel> for InspectWriterSynchronousProxy {
774 fn from(value: fidl::Channel) -> Self {
775 Self::new(value)
776 }
777}
778
779#[derive(Debug, Clone)]
780pub struct InspectWriterProxy {
781 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
782}
783
784impl fidl::endpoints::Proxy for InspectWriterProxy {
785 type Protocol = InspectWriterMarker;
786
787 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
788 Self::new(inner)
789 }
790
791 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
792 self.client.into_channel().map_err(|client| Self { client })
793 }
794
795 fn as_channel(&self) -> &::fidl::AsyncChannel {
796 self.client.as_channel()
797 }
798}
799
800impl InspectWriterProxy {
801 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
803 let protocol_name = <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
804 Self { client: fidl::client::Client::new(channel, protocol_name) }
805 }
806
807 pub fn take_event_stream(&self) -> InspectWriterEventStream {
813 InspectWriterEventStream { event_receiver: self.client.take_event_receiver() }
814 }
815
816 pub fn r#set_health_ok(
818 &self,
819 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
820 InspectWriterProxyInterface::r#set_health_ok(self)
821 }
822
823 pub fn r#record_string(
825 &self,
826 mut key: &str,
827 mut value: &str,
828 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
829 InspectWriterProxyInterface::r#record_string(self, key, value)
830 }
831
832 pub fn r#record_int(
834 &self,
835 mut key: &str,
836 mut value: i64,
837 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
838 InspectWriterProxyInterface::r#record_int(self, key, value)
839 }
840
841 pub fn r#emit_example_inspect_data(
846 &self,
847 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
848 InspectWriterProxyInterface::r#emit_example_inspect_data(self)
849 }
850
851 pub fn r#escrow_and_exit(
853 &self,
854 mut payload: &InspectWriterEscrowAndExitRequest,
855 ) -> fidl::client::QueryResponseFut<
856 InspectWriterEscrowAndExitResponse,
857 fidl::encoding::DefaultFuchsiaResourceDialect,
858 > {
859 InspectWriterProxyInterface::r#escrow_and_exit(self, payload)
860 }
861}
862
863impl InspectWriterProxyInterface for InspectWriterProxy {
864 type SetHealthOkResponseFut =
865 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
866 fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut {
867 fn _decode(
868 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
869 ) -> Result<(), fidl::Error> {
870 let _response = fidl::client::decode_transaction_body::<
871 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
872 fidl::encoding::DefaultFuchsiaResourceDialect,
873 0xe7510549d99075e,
874 >(_buf?)?
875 .into_result::<InspectWriterMarker>("set_health_ok")?;
876 Ok(_response)
877 }
878 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
879 (),
880 0xe7510549d99075e,
881 fidl::encoding::DynamicFlags::FLEXIBLE,
882 _decode,
883 )
884 }
885
886 type RecordStringResponseFut =
887 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
888 fn r#record_string(&self, mut key: &str, mut value: &str) -> Self::RecordStringResponseFut {
889 fn _decode(
890 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
891 ) -> Result<(), fidl::Error> {
892 let _response = fidl::client::decode_transaction_body::<
893 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
894 fidl::encoding::DefaultFuchsiaResourceDialect,
895 0x195be230721d712b,
896 >(_buf?)?
897 .into_result::<InspectWriterMarker>("record_string")?;
898 Ok(_response)
899 }
900 self.client.send_query_and_decode::<InspectWriterRecordStringRequest, ()>(
901 (key, value),
902 0x195be230721d712b,
903 fidl::encoding::DynamicFlags::FLEXIBLE,
904 _decode,
905 )
906 }
907
908 type RecordIntResponseFut =
909 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
910 fn r#record_int(&self, mut key: &str, mut value: i64) -> Self::RecordIntResponseFut {
911 fn _decode(
912 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
913 ) -> Result<(), fidl::Error> {
914 let _response = fidl::client::decode_transaction_body::<
915 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
916 fidl::encoding::DefaultFuchsiaResourceDialect,
917 0xa2c6cbf0df0949,
918 >(_buf?)?
919 .into_result::<InspectWriterMarker>("record_int")?;
920 Ok(_response)
921 }
922 self.client.send_query_and_decode::<InspectWriterRecordIntRequest, ()>(
923 (key, value),
924 0xa2c6cbf0df0949,
925 fidl::encoding::DynamicFlags::FLEXIBLE,
926 _decode,
927 )
928 }
929
930 type EmitExampleInspectDataResponseFut =
931 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
932 fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut {
933 fn _decode(
934 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
935 ) -> Result<(), fidl::Error> {
936 let _response = fidl::client::decode_transaction_body::<
937 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
938 fidl::encoding::DefaultFuchsiaResourceDialect,
939 0x228ae4647773fd94,
940 >(_buf?)?
941 .into_result::<InspectWriterMarker>("emit_example_inspect_data")?;
942 Ok(_response)
943 }
944 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
945 (),
946 0x228ae4647773fd94,
947 fidl::encoding::DynamicFlags::FLEXIBLE,
948 _decode,
949 )
950 }
951
952 type EscrowAndExitResponseFut = fidl::client::QueryResponseFut<
953 InspectWriterEscrowAndExitResponse,
954 fidl::encoding::DefaultFuchsiaResourceDialect,
955 >;
956 fn r#escrow_and_exit(
957 &self,
958 mut payload: &InspectWriterEscrowAndExitRequest,
959 ) -> Self::EscrowAndExitResponseFut {
960 fn _decode(
961 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
962 ) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
963 let _response = fidl::client::decode_transaction_body::<
964 fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
965 fidl::encoding::DefaultFuchsiaResourceDialect,
966 0x60e24adbd0e588ff,
967 >(_buf?)?
968 .into_result::<InspectWriterMarker>("escrow_and_exit")?;
969 Ok(_response)
970 }
971 self.client.send_query_and_decode::<
972 InspectWriterEscrowAndExitRequest,
973 InspectWriterEscrowAndExitResponse,
974 >(
975 payload,
976 0x60e24adbd0e588ff,
977 fidl::encoding::DynamicFlags::FLEXIBLE,
978 _decode,
979 )
980 }
981}
982
983pub struct InspectWriterEventStream {
984 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
985}
986
987impl std::marker::Unpin for InspectWriterEventStream {}
988
989impl futures::stream::FusedStream for InspectWriterEventStream {
990 fn is_terminated(&self) -> bool {
991 self.event_receiver.is_terminated()
992 }
993}
994
995impl futures::Stream for InspectWriterEventStream {
996 type Item = Result<InspectWriterEvent, fidl::Error>;
997
998 fn poll_next(
999 mut self: std::pin::Pin<&mut Self>,
1000 cx: &mut std::task::Context<'_>,
1001 ) -> std::task::Poll<Option<Self::Item>> {
1002 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1003 &mut self.event_receiver,
1004 cx
1005 )?) {
1006 Some(buf) => std::task::Poll::Ready(Some(InspectWriterEvent::decode(buf))),
1007 None => std::task::Poll::Ready(None),
1008 }
1009 }
1010}
1011
1012#[derive(Debug)]
1013pub enum InspectWriterEvent {
1014 #[non_exhaustive]
1015 _UnknownEvent {
1016 ordinal: u64,
1018 },
1019}
1020
1021impl InspectWriterEvent {
1022 fn decode(
1024 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1025 ) -> Result<InspectWriterEvent, fidl::Error> {
1026 let (bytes, _handles) = buf.split_mut();
1027 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1028 debug_assert_eq!(tx_header.tx_id, 0);
1029 match tx_header.ordinal {
1030 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1031 Ok(InspectWriterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1032 }
1033 _ => Err(fidl::Error::UnknownOrdinal {
1034 ordinal: tx_header.ordinal,
1035 protocol_name: <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1036 }),
1037 }
1038 }
1039}
1040
1041pub struct InspectWriterRequestStream {
1043 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1044 is_terminated: bool,
1045}
1046
1047impl std::marker::Unpin for InspectWriterRequestStream {}
1048
1049impl futures::stream::FusedStream for InspectWriterRequestStream {
1050 fn is_terminated(&self) -> bool {
1051 self.is_terminated
1052 }
1053}
1054
1055impl fidl::endpoints::RequestStream for InspectWriterRequestStream {
1056 type Protocol = InspectWriterMarker;
1057 type ControlHandle = InspectWriterControlHandle;
1058
1059 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1060 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1061 }
1062
1063 fn control_handle(&self) -> Self::ControlHandle {
1064 InspectWriterControlHandle { inner: self.inner.clone() }
1065 }
1066
1067 fn into_inner(
1068 self,
1069 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1070 {
1071 (self.inner, self.is_terminated)
1072 }
1073
1074 fn from_inner(
1075 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1076 is_terminated: bool,
1077 ) -> Self {
1078 Self { inner, is_terminated }
1079 }
1080}
1081
1082impl futures::Stream for InspectWriterRequestStream {
1083 type Item = Result<InspectWriterRequest, fidl::Error>;
1084
1085 fn poll_next(
1086 mut self: std::pin::Pin<&mut Self>,
1087 cx: &mut std::task::Context<'_>,
1088 ) -> std::task::Poll<Option<Self::Item>> {
1089 let this = &mut *self;
1090 if this.inner.check_shutdown(cx) {
1091 this.is_terminated = true;
1092 return std::task::Poll::Ready(None);
1093 }
1094 if this.is_terminated {
1095 panic!("polled InspectWriterRequestStream after completion");
1096 }
1097 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1098 |bytes, handles| {
1099 match this.inner.channel().read_etc(cx, bytes, handles) {
1100 std::task::Poll::Ready(Ok(())) => {}
1101 std::task::Poll::Pending => return std::task::Poll::Pending,
1102 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1103 this.is_terminated = true;
1104 return std::task::Poll::Ready(None);
1105 }
1106 std::task::Poll::Ready(Err(e)) => {
1107 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1108 e.into(),
1109 ))))
1110 }
1111 }
1112
1113 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1115
1116 std::task::Poll::Ready(Some(match header.ordinal {
1117 0xe7510549d99075e => {
1118 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1119 let mut req = fidl::new_empty!(
1120 fidl::encoding::EmptyPayload,
1121 fidl::encoding::DefaultFuchsiaResourceDialect
1122 );
1123 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1124 let control_handle =
1125 InspectWriterControlHandle { inner: this.inner.clone() };
1126 Ok(InspectWriterRequest::SetHealthOk {
1127 responder: InspectWriterSetHealthOkResponder {
1128 control_handle: std::mem::ManuallyDrop::new(control_handle),
1129 tx_id: header.tx_id,
1130 },
1131 })
1132 }
1133 0x195be230721d712b => {
1134 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1135 let mut req = fidl::new_empty!(
1136 InspectWriterRecordStringRequest,
1137 fidl::encoding::DefaultFuchsiaResourceDialect
1138 );
1139 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordStringRequest>(&header, _body_bytes, handles, &mut req)?;
1140 let control_handle =
1141 InspectWriterControlHandle { inner: this.inner.clone() };
1142 Ok(InspectWriterRequest::RecordString {
1143 key: req.key,
1144 value: req.value,
1145
1146 responder: InspectWriterRecordStringResponder {
1147 control_handle: std::mem::ManuallyDrop::new(control_handle),
1148 tx_id: header.tx_id,
1149 },
1150 })
1151 }
1152 0xa2c6cbf0df0949 => {
1153 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1154 let mut req = fidl::new_empty!(
1155 InspectWriterRecordIntRequest,
1156 fidl::encoding::DefaultFuchsiaResourceDialect
1157 );
1158 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordIntRequest>(&header, _body_bytes, handles, &mut req)?;
1159 let control_handle =
1160 InspectWriterControlHandle { inner: this.inner.clone() };
1161 Ok(InspectWriterRequest::RecordInt {
1162 key: req.key,
1163 value: req.value,
1164
1165 responder: InspectWriterRecordIntResponder {
1166 control_handle: std::mem::ManuallyDrop::new(control_handle),
1167 tx_id: header.tx_id,
1168 },
1169 })
1170 }
1171 0x228ae4647773fd94 => {
1172 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1173 let mut req = fidl::new_empty!(
1174 fidl::encoding::EmptyPayload,
1175 fidl::encoding::DefaultFuchsiaResourceDialect
1176 );
1177 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1178 let control_handle =
1179 InspectWriterControlHandle { inner: this.inner.clone() };
1180 Ok(InspectWriterRequest::EmitExampleInspectData {
1181 responder: InspectWriterEmitExampleInspectDataResponder {
1182 control_handle: std::mem::ManuallyDrop::new(control_handle),
1183 tx_id: header.tx_id,
1184 },
1185 })
1186 }
1187 0x60e24adbd0e588ff => {
1188 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1189 let mut req = fidl::new_empty!(
1190 InspectWriterEscrowAndExitRequest,
1191 fidl::encoding::DefaultFuchsiaResourceDialect
1192 );
1193 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterEscrowAndExitRequest>(&header, _body_bytes, handles, &mut req)?;
1194 let control_handle =
1195 InspectWriterControlHandle { inner: this.inner.clone() };
1196 Ok(InspectWriterRequest::EscrowAndExit {
1197 payload: req,
1198 responder: InspectWriterEscrowAndExitResponder {
1199 control_handle: std::mem::ManuallyDrop::new(control_handle),
1200 tx_id: header.tx_id,
1201 },
1202 })
1203 }
1204 _ if header.tx_id == 0
1205 && header
1206 .dynamic_flags()
1207 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1208 {
1209 Ok(InspectWriterRequest::_UnknownMethod {
1210 ordinal: header.ordinal,
1211 control_handle: InspectWriterControlHandle {
1212 inner: this.inner.clone(),
1213 },
1214 method_type: fidl::MethodType::OneWay,
1215 })
1216 }
1217 _ if header
1218 .dynamic_flags()
1219 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1220 {
1221 this.inner.send_framework_err(
1222 fidl::encoding::FrameworkErr::UnknownMethod,
1223 header.tx_id,
1224 header.ordinal,
1225 header.dynamic_flags(),
1226 (bytes, handles),
1227 )?;
1228 Ok(InspectWriterRequest::_UnknownMethod {
1229 ordinal: header.ordinal,
1230 control_handle: InspectWriterControlHandle {
1231 inner: this.inner.clone(),
1232 },
1233 method_type: fidl::MethodType::TwoWay,
1234 })
1235 }
1236 _ => Err(fidl::Error::UnknownOrdinal {
1237 ordinal: header.ordinal,
1238 protocol_name:
1239 <InspectWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1240 }),
1241 }))
1242 },
1243 )
1244 }
1245}
1246
1247#[derive(Debug)]
1251pub enum InspectWriterRequest {
1252 SetHealthOk { responder: InspectWriterSetHealthOkResponder },
1254 RecordString { key: String, value: String, responder: InspectWriterRecordStringResponder },
1256 RecordInt { key: String, value: i64, responder: InspectWriterRecordIntResponder },
1258 EmitExampleInspectData { responder: InspectWriterEmitExampleInspectDataResponder },
1263 EscrowAndExit {
1265 payload: InspectWriterEscrowAndExitRequest,
1266 responder: InspectWriterEscrowAndExitResponder,
1267 },
1268 #[non_exhaustive]
1270 _UnknownMethod {
1271 ordinal: u64,
1273 control_handle: InspectWriterControlHandle,
1274 method_type: fidl::MethodType,
1275 },
1276}
1277
1278impl InspectWriterRequest {
1279 #[allow(irrefutable_let_patterns)]
1280 pub fn into_set_health_ok(self) -> Option<(InspectWriterSetHealthOkResponder)> {
1281 if let InspectWriterRequest::SetHealthOk { responder } = self {
1282 Some((responder))
1283 } else {
1284 None
1285 }
1286 }
1287
1288 #[allow(irrefutable_let_patterns)]
1289 pub fn into_record_string(
1290 self,
1291 ) -> Option<(String, String, InspectWriterRecordStringResponder)> {
1292 if let InspectWriterRequest::RecordString { key, value, responder } = self {
1293 Some((key, value, responder))
1294 } else {
1295 None
1296 }
1297 }
1298
1299 #[allow(irrefutable_let_patterns)]
1300 pub fn into_record_int(self) -> Option<(String, i64, InspectWriterRecordIntResponder)> {
1301 if let InspectWriterRequest::RecordInt { key, value, responder } = self {
1302 Some((key, value, responder))
1303 } else {
1304 None
1305 }
1306 }
1307
1308 #[allow(irrefutable_let_patterns)]
1309 pub fn into_emit_example_inspect_data(
1310 self,
1311 ) -> Option<(InspectWriterEmitExampleInspectDataResponder)> {
1312 if let InspectWriterRequest::EmitExampleInspectData { responder } = self {
1313 Some((responder))
1314 } else {
1315 None
1316 }
1317 }
1318
1319 #[allow(irrefutable_let_patterns)]
1320 pub fn into_escrow_and_exit(
1321 self,
1322 ) -> Option<(InspectWriterEscrowAndExitRequest, InspectWriterEscrowAndExitResponder)> {
1323 if let InspectWriterRequest::EscrowAndExit { payload, responder } = self {
1324 Some((payload, responder))
1325 } else {
1326 None
1327 }
1328 }
1329
1330 pub fn method_name(&self) -> &'static str {
1332 match *self {
1333 InspectWriterRequest::SetHealthOk { .. } => "set_health_ok",
1334 InspectWriterRequest::RecordString { .. } => "record_string",
1335 InspectWriterRequest::RecordInt { .. } => "record_int",
1336 InspectWriterRequest::EmitExampleInspectData { .. } => "emit_example_inspect_data",
1337 InspectWriterRequest::EscrowAndExit { .. } => "escrow_and_exit",
1338 InspectWriterRequest::_UnknownMethod {
1339 method_type: fidl::MethodType::OneWay, ..
1340 } => "unknown one-way method",
1341 InspectWriterRequest::_UnknownMethod {
1342 method_type: fidl::MethodType::TwoWay, ..
1343 } => "unknown two-way method",
1344 }
1345 }
1346}
1347
1348#[derive(Debug, Clone)]
1349pub struct InspectWriterControlHandle {
1350 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1351}
1352
1353impl fidl::endpoints::ControlHandle for InspectWriterControlHandle {
1354 fn shutdown(&self) {
1355 self.inner.shutdown()
1356 }
1357 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1358 self.inner.shutdown_with_epitaph(status)
1359 }
1360
1361 fn is_closed(&self) -> bool {
1362 self.inner.channel().is_closed()
1363 }
1364 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1365 self.inner.channel().on_closed()
1366 }
1367
1368 #[cfg(target_os = "fuchsia")]
1369 fn signal_peer(
1370 &self,
1371 clear_mask: zx::Signals,
1372 set_mask: zx::Signals,
1373 ) -> Result<(), zx_status::Status> {
1374 use fidl::Peered;
1375 self.inner.channel().signal_peer(clear_mask, set_mask)
1376 }
1377}
1378
1379impl InspectWriterControlHandle {}
1380
1381#[must_use = "FIDL methods require a response to be sent"]
1382#[derive(Debug)]
1383pub struct InspectWriterSetHealthOkResponder {
1384 control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
1385 tx_id: u32,
1386}
1387
1388impl std::ops::Drop for InspectWriterSetHealthOkResponder {
1392 fn drop(&mut self) {
1393 self.control_handle.shutdown();
1394 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1396 }
1397}
1398
1399impl fidl::endpoints::Responder for InspectWriterSetHealthOkResponder {
1400 type ControlHandle = InspectWriterControlHandle;
1401
1402 fn control_handle(&self) -> &InspectWriterControlHandle {
1403 &self.control_handle
1404 }
1405
1406 fn drop_without_shutdown(mut self) {
1407 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1409 std::mem::forget(self);
1411 }
1412}
1413
1414impl InspectWriterSetHealthOkResponder {
1415 pub fn send(self) -> Result<(), fidl::Error> {
1419 let _result = self.send_raw();
1420 if _result.is_err() {
1421 self.control_handle.shutdown();
1422 }
1423 self.drop_without_shutdown();
1424 _result
1425 }
1426
1427 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1429 let _result = self.send_raw();
1430 self.drop_without_shutdown();
1431 _result
1432 }
1433
1434 fn send_raw(&self) -> Result<(), fidl::Error> {
1435 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
1436 fidl::encoding::Flexible::new(()),
1437 self.tx_id,
1438 0xe7510549d99075e,
1439 fidl::encoding::DynamicFlags::FLEXIBLE,
1440 )
1441 }
1442}
1443
1444#[must_use = "FIDL methods require a response to be sent"]
1445#[derive(Debug)]
1446pub struct InspectWriterRecordStringResponder {
1447 control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
1448 tx_id: u32,
1449}
1450
1451impl std::ops::Drop for InspectWriterRecordStringResponder {
1455 fn drop(&mut self) {
1456 self.control_handle.shutdown();
1457 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1459 }
1460}
1461
1462impl fidl::endpoints::Responder for InspectWriterRecordStringResponder {
1463 type ControlHandle = InspectWriterControlHandle;
1464
1465 fn control_handle(&self) -> &InspectWriterControlHandle {
1466 &self.control_handle
1467 }
1468
1469 fn drop_without_shutdown(mut self) {
1470 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1472 std::mem::forget(self);
1474 }
1475}
1476
1477impl InspectWriterRecordStringResponder {
1478 pub fn send(self) -> Result<(), fidl::Error> {
1482 let _result = self.send_raw();
1483 if _result.is_err() {
1484 self.control_handle.shutdown();
1485 }
1486 self.drop_without_shutdown();
1487 _result
1488 }
1489
1490 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1492 let _result = self.send_raw();
1493 self.drop_without_shutdown();
1494 _result
1495 }
1496
1497 fn send_raw(&self) -> Result<(), fidl::Error> {
1498 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
1499 fidl::encoding::Flexible::new(()),
1500 self.tx_id,
1501 0x195be230721d712b,
1502 fidl::encoding::DynamicFlags::FLEXIBLE,
1503 )
1504 }
1505}
1506
1507#[must_use = "FIDL methods require a response to be sent"]
1508#[derive(Debug)]
1509pub struct InspectWriterRecordIntResponder {
1510 control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
1511 tx_id: u32,
1512}
1513
1514impl std::ops::Drop for InspectWriterRecordIntResponder {
1518 fn drop(&mut self) {
1519 self.control_handle.shutdown();
1520 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1522 }
1523}
1524
1525impl fidl::endpoints::Responder for InspectWriterRecordIntResponder {
1526 type ControlHandle = InspectWriterControlHandle;
1527
1528 fn control_handle(&self) -> &InspectWriterControlHandle {
1529 &self.control_handle
1530 }
1531
1532 fn drop_without_shutdown(mut self) {
1533 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1535 std::mem::forget(self);
1537 }
1538}
1539
1540impl InspectWriterRecordIntResponder {
1541 pub fn send(self) -> Result<(), fidl::Error> {
1545 let _result = self.send_raw();
1546 if _result.is_err() {
1547 self.control_handle.shutdown();
1548 }
1549 self.drop_without_shutdown();
1550 _result
1551 }
1552
1553 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1555 let _result = self.send_raw();
1556 self.drop_without_shutdown();
1557 _result
1558 }
1559
1560 fn send_raw(&self) -> Result<(), fidl::Error> {
1561 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
1562 fidl::encoding::Flexible::new(()),
1563 self.tx_id,
1564 0xa2c6cbf0df0949,
1565 fidl::encoding::DynamicFlags::FLEXIBLE,
1566 )
1567 }
1568}
1569
1570#[must_use = "FIDL methods require a response to be sent"]
1571#[derive(Debug)]
1572pub struct InspectWriterEmitExampleInspectDataResponder {
1573 control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
1574 tx_id: u32,
1575}
1576
1577impl std::ops::Drop for InspectWriterEmitExampleInspectDataResponder {
1581 fn drop(&mut self) {
1582 self.control_handle.shutdown();
1583 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1585 }
1586}
1587
1588impl fidl::endpoints::Responder for InspectWriterEmitExampleInspectDataResponder {
1589 type ControlHandle = InspectWriterControlHandle;
1590
1591 fn control_handle(&self) -> &InspectWriterControlHandle {
1592 &self.control_handle
1593 }
1594
1595 fn drop_without_shutdown(mut self) {
1596 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1598 std::mem::forget(self);
1600 }
1601}
1602
1603impl InspectWriterEmitExampleInspectDataResponder {
1604 pub fn send(self) -> Result<(), fidl::Error> {
1608 let _result = self.send_raw();
1609 if _result.is_err() {
1610 self.control_handle.shutdown();
1611 }
1612 self.drop_without_shutdown();
1613 _result
1614 }
1615
1616 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1618 let _result = self.send_raw();
1619 self.drop_without_shutdown();
1620 _result
1621 }
1622
1623 fn send_raw(&self) -> Result<(), fidl::Error> {
1624 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
1625 fidl::encoding::Flexible::new(()),
1626 self.tx_id,
1627 0x228ae4647773fd94,
1628 fidl::encoding::DynamicFlags::FLEXIBLE,
1629 )
1630 }
1631}
1632
1633#[must_use = "FIDL methods require a response to be sent"]
1634#[derive(Debug)]
1635pub struct InspectWriterEscrowAndExitResponder {
1636 control_handle: std::mem::ManuallyDrop<InspectWriterControlHandle>,
1637 tx_id: u32,
1638}
1639
1640impl std::ops::Drop for InspectWriterEscrowAndExitResponder {
1644 fn drop(&mut self) {
1645 self.control_handle.shutdown();
1646 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1648 }
1649}
1650
1651impl fidl::endpoints::Responder for InspectWriterEscrowAndExitResponder {
1652 type ControlHandle = InspectWriterControlHandle;
1653
1654 fn control_handle(&self) -> &InspectWriterControlHandle {
1655 &self.control_handle
1656 }
1657
1658 fn drop_without_shutdown(mut self) {
1659 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1661 std::mem::forget(self);
1663 }
1664}
1665
1666impl InspectWriterEscrowAndExitResponder {
1667 pub fn send(self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
1671 let _result = self.send_raw(payload);
1672 if _result.is_err() {
1673 self.control_handle.shutdown();
1674 }
1675 self.drop_without_shutdown();
1676 _result
1677 }
1678
1679 pub fn send_no_shutdown_on_err(
1681 self,
1682 mut payload: InspectWriterEscrowAndExitResponse,
1683 ) -> Result<(), fidl::Error> {
1684 let _result = self.send_raw(payload);
1685 self.drop_without_shutdown();
1686 _result
1687 }
1688
1689 fn send_raw(&self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
1690 self.control_handle
1691 .inner
1692 .send::<fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>>(
1693 fidl::encoding::Flexible::new(&mut payload),
1694 self.tx_id,
1695 0x60e24adbd0e588ff,
1696 fidl::encoding::DynamicFlags::FLEXIBLE,
1697 )
1698 }
1699}
1700
1701#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1702pub struct LazyInspectPuppetMarker;
1703
1704impl fidl::endpoints::ProtocolMarker for LazyInspectPuppetMarker {
1705 type Proxy = LazyInspectPuppetProxy;
1706 type RequestStream = LazyInspectPuppetRequestStream;
1707 #[cfg(target_os = "fuchsia")]
1708 type SynchronousProxy = LazyInspectPuppetSynchronousProxy;
1709
1710 const DEBUG_NAME: &'static str = "(anonymous) LazyInspectPuppet";
1711}
1712
1713pub trait LazyInspectPuppetProxyInterface: Send + Sync {
1714 type SetHealthOkResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1715 fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut;
1716 type RecordStringResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1717 fn r#record_string(&self, key: &str, value: &str) -> Self::RecordStringResponseFut;
1718 type RecordIntResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1719 fn r#record_int(&self, key: &str, value: i64) -> Self::RecordIntResponseFut;
1720 type EmitExampleInspectDataResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
1721 + Send;
1722 fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut;
1723 type EscrowAndExitResponseFut: std::future::Future<Output = Result<InspectWriterEscrowAndExitResponse, fidl::Error>>
1724 + Send;
1725 fn r#escrow_and_exit(
1726 &self,
1727 payload: &InspectWriterEscrowAndExitRequest,
1728 ) -> Self::EscrowAndExitResponseFut;
1729 type CommitResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1730 fn r#commit(&self, options: &CommitOptions) -> Self::CommitResponseFut;
1731}
1732#[derive(Debug)]
1733#[cfg(target_os = "fuchsia")]
1734pub struct LazyInspectPuppetSynchronousProxy {
1735 client: fidl::client::sync::Client,
1736}
1737
1738#[cfg(target_os = "fuchsia")]
1739impl fidl::endpoints::SynchronousProxy for LazyInspectPuppetSynchronousProxy {
1740 type Proxy = LazyInspectPuppetProxy;
1741 type Protocol = LazyInspectPuppetMarker;
1742
1743 fn from_channel(inner: fidl::Channel) -> Self {
1744 Self::new(inner)
1745 }
1746
1747 fn into_channel(self) -> fidl::Channel {
1748 self.client.into_channel()
1749 }
1750
1751 fn as_channel(&self) -> &fidl::Channel {
1752 self.client.as_channel()
1753 }
1754}
1755
1756#[cfg(target_os = "fuchsia")]
1757impl LazyInspectPuppetSynchronousProxy {
1758 pub fn new(channel: fidl::Channel) -> Self {
1759 let protocol_name =
1760 <LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1761 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1762 }
1763
1764 pub fn into_channel(self) -> fidl::Channel {
1765 self.client.into_channel()
1766 }
1767
1768 pub fn wait_for_event(
1771 &self,
1772 deadline: zx::MonotonicInstant,
1773 ) -> Result<LazyInspectPuppetEvent, fidl::Error> {
1774 LazyInspectPuppetEvent::decode(self.client.wait_for_event(deadline)?)
1775 }
1776
1777 pub fn r#set_health_ok(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
1779 let _response = self.client.send_query::<
1780 fidl::encoding::EmptyPayload,
1781 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1782 >(
1783 (),
1784 0xe7510549d99075e,
1785 fidl::encoding::DynamicFlags::FLEXIBLE,
1786 ___deadline,
1787 )?
1788 .into_result::<LazyInspectPuppetMarker>("set_health_ok")?;
1789 Ok(_response)
1790 }
1791
1792 pub fn r#record_string(
1794 &self,
1795 mut key: &str,
1796 mut value: &str,
1797 ___deadline: zx::MonotonicInstant,
1798 ) -> Result<(), fidl::Error> {
1799 let _response = self.client.send_query::<
1800 InspectWriterRecordStringRequest,
1801 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1802 >(
1803 (key, value,),
1804 0x195be230721d712b,
1805 fidl::encoding::DynamicFlags::FLEXIBLE,
1806 ___deadline,
1807 )?
1808 .into_result::<LazyInspectPuppetMarker>("record_string")?;
1809 Ok(_response)
1810 }
1811
1812 pub fn r#record_int(
1814 &self,
1815 mut key: &str,
1816 mut value: i64,
1817 ___deadline: zx::MonotonicInstant,
1818 ) -> Result<(), fidl::Error> {
1819 let _response = self.client.send_query::<
1820 InspectWriterRecordIntRequest,
1821 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1822 >(
1823 (key, value,),
1824 0xa2c6cbf0df0949,
1825 fidl::encoding::DynamicFlags::FLEXIBLE,
1826 ___deadline,
1827 )?
1828 .into_result::<LazyInspectPuppetMarker>("record_int")?;
1829 Ok(_response)
1830 }
1831
1832 pub fn r#emit_example_inspect_data(
1837 &self,
1838 ___deadline: zx::MonotonicInstant,
1839 ) -> Result<(), fidl::Error> {
1840 let _response = self.client.send_query::<
1841 fidl::encoding::EmptyPayload,
1842 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1843 >(
1844 (),
1845 0x228ae4647773fd94,
1846 fidl::encoding::DynamicFlags::FLEXIBLE,
1847 ___deadline,
1848 )?
1849 .into_result::<LazyInspectPuppetMarker>("emit_example_inspect_data")?;
1850 Ok(_response)
1851 }
1852
1853 pub fn r#escrow_and_exit(
1855 &self,
1856 mut payload: &InspectWriterEscrowAndExitRequest,
1857 ___deadline: zx::MonotonicInstant,
1858 ) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
1859 let _response = self.client.send_query::<
1860 InspectWriterEscrowAndExitRequest,
1861 fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
1862 >(
1863 payload,
1864 0x60e24adbd0e588ff,
1865 fidl::encoding::DynamicFlags::FLEXIBLE,
1866 ___deadline,
1867 )?
1868 .into_result::<LazyInspectPuppetMarker>("escrow_and_exit")?;
1869 Ok(_response)
1870 }
1871
1872 pub fn r#commit(
1876 &self,
1877 mut options: &CommitOptions,
1878 ___deadline: zx::MonotonicInstant,
1879 ) -> Result<(), fidl::Error> {
1880 let _response = self.client.send_query::<
1881 LazyInspectPuppetCommitRequest,
1882 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
1883 >(
1884 (options,),
1885 0x79524e5e00cbf03f,
1886 fidl::encoding::DynamicFlags::FLEXIBLE,
1887 ___deadline,
1888 )?
1889 .into_result::<LazyInspectPuppetMarker>("commit")?;
1890 Ok(_response)
1891 }
1892}
1893
1894#[cfg(target_os = "fuchsia")]
1895impl From<LazyInspectPuppetSynchronousProxy> for zx::Handle {
1896 fn from(value: LazyInspectPuppetSynchronousProxy) -> Self {
1897 value.into_channel().into()
1898 }
1899}
1900
1901#[cfg(target_os = "fuchsia")]
1902impl From<fidl::Channel> for LazyInspectPuppetSynchronousProxy {
1903 fn from(value: fidl::Channel) -> Self {
1904 Self::new(value)
1905 }
1906}
1907
1908#[derive(Debug, Clone)]
1909pub struct LazyInspectPuppetProxy {
1910 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1911}
1912
1913impl fidl::endpoints::Proxy for LazyInspectPuppetProxy {
1914 type Protocol = LazyInspectPuppetMarker;
1915
1916 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1917 Self::new(inner)
1918 }
1919
1920 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1921 self.client.into_channel().map_err(|client| Self { client })
1922 }
1923
1924 fn as_channel(&self) -> &::fidl::AsyncChannel {
1925 self.client.as_channel()
1926 }
1927}
1928
1929impl LazyInspectPuppetProxy {
1930 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1932 let protocol_name =
1933 <LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1934 Self { client: fidl::client::Client::new(channel, protocol_name) }
1935 }
1936
1937 pub fn take_event_stream(&self) -> LazyInspectPuppetEventStream {
1943 LazyInspectPuppetEventStream { event_receiver: self.client.take_event_receiver() }
1944 }
1945
1946 pub fn r#set_health_ok(
1948 &self,
1949 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1950 LazyInspectPuppetProxyInterface::r#set_health_ok(self)
1951 }
1952
1953 pub fn r#record_string(
1955 &self,
1956 mut key: &str,
1957 mut value: &str,
1958 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1959 LazyInspectPuppetProxyInterface::r#record_string(self, key, value)
1960 }
1961
1962 pub fn r#record_int(
1964 &self,
1965 mut key: &str,
1966 mut value: i64,
1967 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1968 LazyInspectPuppetProxyInterface::r#record_int(self, key, value)
1969 }
1970
1971 pub fn r#emit_example_inspect_data(
1976 &self,
1977 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1978 LazyInspectPuppetProxyInterface::r#emit_example_inspect_data(self)
1979 }
1980
1981 pub fn r#escrow_and_exit(
1983 &self,
1984 mut payload: &InspectWriterEscrowAndExitRequest,
1985 ) -> fidl::client::QueryResponseFut<
1986 InspectWriterEscrowAndExitResponse,
1987 fidl::encoding::DefaultFuchsiaResourceDialect,
1988 > {
1989 LazyInspectPuppetProxyInterface::r#escrow_and_exit(self, payload)
1990 }
1991
1992 pub fn r#commit(
1996 &self,
1997 mut options: &CommitOptions,
1998 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1999 LazyInspectPuppetProxyInterface::r#commit(self, options)
2000 }
2001}
2002
2003impl LazyInspectPuppetProxyInterface for LazyInspectPuppetProxy {
2004 type SetHealthOkResponseFut =
2005 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2006 fn r#set_health_ok(&self) -> Self::SetHealthOkResponseFut {
2007 fn _decode(
2008 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2009 ) -> Result<(), fidl::Error> {
2010 let _response = fidl::client::decode_transaction_body::<
2011 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2012 fidl::encoding::DefaultFuchsiaResourceDialect,
2013 0xe7510549d99075e,
2014 >(_buf?)?
2015 .into_result::<LazyInspectPuppetMarker>("set_health_ok")?;
2016 Ok(_response)
2017 }
2018 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2019 (),
2020 0xe7510549d99075e,
2021 fidl::encoding::DynamicFlags::FLEXIBLE,
2022 _decode,
2023 )
2024 }
2025
2026 type RecordStringResponseFut =
2027 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2028 fn r#record_string(&self, mut key: &str, mut value: &str) -> Self::RecordStringResponseFut {
2029 fn _decode(
2030 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2031 ) -> Result<(), fidl::Error> {
2032 let _response = fidl::client::decode_transaction_body::<
2033 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2034 fidl::encoding::DefaultFuchsiaResourceDialect,
2035 0x195be230721d712b,
2036 >(_buf?)?
2037 .into_result::<LazyInspectPuppetMarker>("record_string")?;
2038 Ok(_response)
2039 }
2040 self.client.send_query_and_decode::<InspectWriterRecordStringRequest, ()>(
2041 (key, value),
2042 0x195be230721d712b,
2043 fidl::encoding::DynamicFlags::FLEXIBLE,
2044 _decode,
2045 )
2046 }
2047
2048 type RecordIntResponseFut =
2049 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2050 fn r#record_int(&self, mut key: &str, mut value: i64) -> Self::RecordIntResponseFut {
2051 fn _decode(
2052 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2053 ) -> Result<(), fidl::Error> {
2054 let _response = fidl::client::decode_transaction_body::<
2055 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2056 fidl::encoding::DefaultFuchsiaResourceDialect,
2057 0xa2c6cbf0df0949,
2058 >(_buf?)?
2059 .into_result::<LazyInspectPuppetMarker>("record_int")?;
2060 Ok(_response)
2061 }
2062 self.client.send_query_and_decode::<InspectWriterRecordIntRequest, ()>(
2063 (key, value),
2064 0xa2c6cbf0df0949,
2065 fidl::encoding::DynamicFlags::FLEXIBLE,
2066 _decode,
2067 )
2068 }
2069
2070 type EmitExampleInspectDataResponseFut =
2071 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2072 fn r#emit_example_inspect_data(&self) -> Self::EmitExampleInspectDataResponseFut {
2073 fn _decode(
2074 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2075 ) -> Result<(), fidl::Error> {
2076 let _response = fidl::client::decode_transaction_body::<
2077 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2078 fidl::encoding::DefaultFuchsiaResourceDialect,
2079 0x228ae4647773fd94,
2080 >(_buf?)?
2081 .into_result::<LazyInspectPuppetMarker>("emit_example_inspect_data")?;
2082 Ok(_response)
2083 }
2084 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2085 (),
2086 0x228ae4647773fd94,
2087 fidl::encoding::DynamicFlags::FLEXIBLE,
2088 _decode,
2089 )
2090 }
2091
2092 type EscrowAndExitResponseFut = fidl::client::QueryResponseFut<
2093 InspectWriterEscrowAndExitResponse,
2094 fidl::encoding::DefaultFuchsiaResourceDialect,
2095 >;
2096 fn r#escrow_and_exit(
2097 &self,
2098 mut payload: &InspectWriterEscrowAndExitRequest,
2099 ) -> Self::EscrowAndExitResponseFut {
2100 fn _decode(
2101 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2102 ) -> Result<InspectWriterEscrowAndExitResponse, fidl::Error> {
2103 let _response = fidl::client::decode_transaction_body::<
2104 fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>,
2105 fidl::encoding::DefaultFuchsiaResourceDialect,
2106 0x60e24adbd0e588ff,
2107 >(_buf?)?
2108 .into_result::<LazyInspectPuppetMarker>("escrow_and_exit")?;
2109 Ok(_response)
2110 }
2111 self.client.send_query_and_decode::<
2112 InspectWriterEscrowAndExitRequest,
2113 InspectWriterEscrowAndExitResponse,
2114 >(
2115 payload,
2116 0x60e24adbd0e588ff,
2117 fidl::encoding::DynamicFlags::FLEXIBLE,
2118 _decode,
2119 )
2120 }
2121
2122 type CommitResponseFut =
2123 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2124 fn r#commit(&self, mut options: &CommitOptions) -> Self::CommitResponseFut {
2125 fn _decode(
2126 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2127 ) -> Result<(), fidl::Error> {
2128 let _response = fidl::client::decode_transaction_body::<
2129 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
2130 fidl::encoding::DefaultFuchsiaResourceDialect,
2131 0x79524e5e00cbf03f,
2132 >(_buf?)?
2133 .into_result::<LazyInspectPuppetMarker>("commit")?;
2134 Ok(_response)
2135 }
2136 self.client.send_query_and_decode::<LazyInspectPuppetCommitRequest, ()>(
2137 (options,),
2138 0x79524e5e00cbf03f,
2139 fidl::encoding::DynamicFlags::FLEXIBLE,
2140 _decode,
2141 )
2142 }
2143}
2144
2145pub struct LazyInspectPuppetEventStream {
2146 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2147}
2148
2149impl std::marker::Unpin for LazyInspectPuppetEventStream {}
2150
2151impl futures::stream::FusedStream for LazyInspectPuppetEventStream {
2152 fn is_terminated(&self) -> bool {
2153 self.event_receiver.is_terminated()
2154 }
2155}
2156
2157impl futures::Stream for LazyInspectPuppetEventStream {
2158 type Item = Result<LazyInspectPuppetEvent, fidl::Error>;
2159
2160 fn poll_next(
2161 mut self: std::pin::Pin<&mut Self>,
2162 cx: &mut std::task::Context<'_>,
2163 ) -> std::task::Poll<Option<Self::Item>> {
2164 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2165 &mut self.event_receiver,
2166 cx
2167 )?) {
2168 Some(buf) => std::task::Poll::Ready(Some(LazyInspectPuppetEvent::decode(buf))),
2169 None => std::task::Poll::Ready(None),
2170 }
2171 }
2172}
2173
2174#[derive(Debug)]
2175pub enum LazyInspectPuppetEvent {
2176 #[non_exhaustive]
2177 _UnknownEvent {
2178 ordinal: u64,
2180 },
2181}
2182
2183impl LazyInspectPuppetEvent {
2184 fn decode(
2186 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2187 ) -> Result<LazyInspectPuppetEvent, fidl::Error> {
2188 let (bytes, _handles) = buf.split_mut();
2189 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2190 debug_assert_eq!(tx_header.tx_id, 0);
2191 match tx_header.ordinal {
2192 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2193 Ok(LazyInspectPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2194 }
2195 _ => Err(fidl::Error::UnknownOrdinal {
2196 ordinal: tx_header.ordinal,
2197 protocol_name:
2198 <LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2199 }),
2200 }
2201 }
2202}
2203
2204pub struct LazyInspectPuppetRequestStream {
2206 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2207 is_terminated: bool,
2208}
2209
2210impl std::marker::Unpin for LazyInspectPuppetRequestStream {}
2211
2212impl futures::stream::FusedStream for LazyInspectPuppetRequestStream {
2213 fn is_terminated(&self) -> bool {
2214 self.is_terminated
2215 }
2216}
2217
2218impl fidl::endpoints::RequestStream for LazyInspectPuppetRequestStream {
2219 type Protocol = LazyInspectPuppetMarker;
2220 type ControlHandle = LazyInspectPuppetControlHandle;
2221
2222 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2223 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2224 }
2225
2226 fn control_handle(&self) -> Self::ControlHandle {
2227 LazyInspectPuppetControlHandle { inner: self.inner.clone() }
2228 }
2229
2230 fn into_inner(
2231 self,
2232 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2233 {
2234 (self.inner, self.is_terminated)
2235 }
2236
2237 fn from_inner(
2238 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2239 is_terminated: bool,
2240 ) -> Self {
2241 Self { inner, is_terminated }
2242 }
2243}
2244
2245impl futures::Stream for LazyInspectPuppetRequestStream {
2246 type Item = Result<LazyInspectPuppetRequest, fidl::Error>;
2247
2248 fn poll_next(
2249 mut self: std::pin::Pin<&mut Self>,
2250 cx: &mut std::task::Context<'_>,
2251 ) -> std::task::Poll<Option<Self::Item>> {
2252 let this = &mut *self;
2253 if this.inner.check_shutdown(cx) {
2254 this.is_terminated = true;
2255 return std::task::Poll::Ready(None);
2256 }
2257 if this.is_terminated {
2258 panic!("polled LazyInspectPuppetRequestStream after completion");
2259 }
2260 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2261 |bytes, handles| {
2262 match this.inner.channel().read_etc(cx, bytes, handles) {
2263 std::task::Poll::Ready(Ok(())) => {}
2264 std::task::Poll::Pending => return std::task::Poll::Pending,
2265 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2266 this.is_terminated = true;
2267 return std::task::Poll::Ready(None);
2268 }
2269 std::task::Poll::Ready(Err(e)) => {
2270 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2271 e.into(),
2272 ))))
2273 }
2274 }
2275
2276 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2278
2279 std::task::Poll::Ready(Some(match header.ordinal {
2280 0xe7510549d99075e => {
2281 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2282 let mut req = fidl::new_empty!(
2283 fidl::encoding::EmptyPayload,
2284 fidl::encoding::DefaultFuchsiaResourceDialect
2285 );
2286 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2287 let control_handle =
2288 LazyInspectPuppetControlHandle { inner: this.inner.clone() };
2289 Ok(LazyInspectPuppetRequest::SetHealthOk {
2290 responder: LazyInspectPuppetSetHealthOkResponder {
2291 control_handle: std::mem::ManuallyDrop::new(control_handle),
2292 tx_id: header.tx_id,
2293 },
2294 })
2295 }
2296 0x195be230721d712b => {
2297 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2298 let mut req = fidl::new_empty!(
2299 InspectWriterRecordStringRequest,
2300 fidl::encoding::DefaultFuchsiaResourceDialect
2301 );
2302 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordStringRequest>(&header, _body_bytes, handles, &mut req)?;
2303 let control_handle =
2304 LazyInspectPuppetControlHandle { inner: this.inner.clone() };
2305 Ok(LazyInspectPuppetRequest::RecordString {
2306 key: req.key,
2307 value: req.value,
2308
2309 responder: LazyInspectPuppetRecordStringResponder {
2310 control_handle: std::mem::ManuallyDrop::new(control_handle),
2311 tx_id: header.tx_id,
2312 },
2313 })
2314 }
2315 0xa2c6cbf0df0949 => {
2316 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2317 let mut req = fidl::new_empty!(
2318 InspectWriterRecordIntRequest,
2319 fidl::encoding::DefaultFuchsiaResourceDialect
2320 );
2321 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterRecordIntRequest>(&header, _body_bytes, handles, &mut req)?;
2322 let control_handle =
2323 LazyInspectPuppetControlHandle { inner: this.inner.clone() };
2324 Ok(LazyInspectPuppetRequest::RecordInt {
2325 key: req.key,
2326 value: req.value,
2327
2328 responder: LazyInspectPuppetRecordIntResponder {
2329 control_handle: std::mem::ManuallyDrop::new(control_handle),
2330 tx_id: header.tx_id,
2331 },
2332 })
2333 }
2334 0x228ae4647773fd94 => {
2335 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2336 let mut req = fidl::new_empty!(
2337 fidl::encoding::EmptyPayload,
2338 fidl::encoding::DefaultFuchsiaResourceDialect
2339 );
2340 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2341 let control_handle =
2342 LazyInspectPuppetControlHandle { inner: this.inner.clone() };
2343 Ok(LazyInspectPuppetRequest::EmitExampleInspectData {
2344 responder: LazyInspectPuppetEmitExampleInspectDataResponder {
2345 control_handle: std::mem::ManuallyDrop::new(control_handle),
2346 tx_id: header.tx_id,
2347 },
2348 })
2349 }
2350 0x60e24adbd0e588ff => {
2351 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2352 let mut req = fidl::new_empty!(
2353 InspectWriterEscrowAndExitRequest,
2354 fidl::encoding::DefaultFuchsiaResourceDialect
2355 );
2356 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectWriterEscrowAndExitRequest>(&header, _body_bytes, handles, &mut req)?;
2357 let control_handle =
2358 LazyInspectPuppetControlHandle { inner: this.inner.clone() };
2359 Ok(LazyInspectPuppetRequest::EscrowAndExit {
2360 payload: req,
2361 responder: LazyInspectPuppetEscrowAndExitResponder {
2362 control_handle: std::mem::ManuallyDrop::new(control_handle),
2363 tx_id: header.tx_id,
2364 },
2365 })
2366 }
2367 0x79524e5e00cbf03f => {
2368 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2369 let mut req = fidl::new_empty!(
2370 LazyInspectPuppetCommitRequest,
2371 fidl::encoding::DefaultFuchsiaResourceDialect
2372 );
2373 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LazyInspectPuppetCommitRequest>(&header, _body_bytes, handles, &mut req)?;
2374 let control_handle =
2375 LazyInspectPuppetControlHandle { inner: this.inner.clone() };
2376 Ok(LazyInspectPuppetRequest::Commit {
2377 options: req.options,
2378
2379 responder: LazyInspectPuppetCommitResponder {
2380 control_handle: std::mem::ManuallyDrop::new(control_handle),
2381 tx_id: header.tx_id,
2382 },
2383 })
2384 }
2385 _ if header.tx_id == 0
2386 && header
2387 .dynamic_flags()
2388 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2389 {
2390 Ok(LazyInspectPuppetRequest::_UnknownMethod {
2391 ordinal: header.ordinal,
2392 control_handle: LazyInspectPuppetControlHandle {
2393 inner: this.inner.clone(),
2394 },
2395 method_type: fidl::MethodType::OneWay,
2396 })
2397 }
2398 _ if header
2399 .dynamic_flags()
2400 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2401 {
2402 this.inner.send_framework_err(
2403 fidl::encoding::FrameworkErr::UnknownMethod,
2404 header.tx_id,
2405 header.ordinal,
2406 header.dynamic_flags(),
2407 (bytes, handles),
2408 )?;
2409 Ok(LazyInspectPuppetRequest::_UnknownMethod {
2410 ordinal: header.ordinal,
2411 control_handle: LazyInspectPuppetControlHandle {
2412 inner: this.inner.clone(),
2413 },
2414 method_type: fidl::MethodType::TwoWay,
2415 })
2416 }
2417 _ => Err(fidl::Error::UnknownOrdinal {
2418 ordinal: header.ordinal,
2419 protocol_name:
2420 <LazyInspectPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2421 }),
2422 }))
2423 },
2424 )
2425 }
2426}
2427
2428#[derive(Debug)]
2435pub enum LazyInspectPuppetRequest {
2436 SetHealthOk { responder: LazyInspectPuppetSetHealthOkResponder },
2438 RecordString { key: String, value: String, responder: LazyInspectPuppetRecordStringResponder },
2440 RecordInt { key: String, value: i64, responder: LazyInspectPuppetRecordIntResponder },
2442 EmitExampleInspectData { responder: LazyInspectPuppetEmitExampleInspectDataResponder },
2447 EscrowAndExit {
2449 payload: InspectWriterEscrowAndExitRequest,
2450 responder: LazyInspectPuppetEscrowAndExitResponder,
2451 },
2452 Commit { options: CommitOptions, responder: LazyInspectPuppetCommitResponder },
2456 #[non_exhaustive]
2458 _UnknownMethod {
2459 ordinal: u64,
2461 control_handle: LazyInspectPuppetControlHandle,
2462 method_type: fidl::MethodType,
2463 },
2464}
2465
2466impl LazyInspectPuppetRequest {
2467 #[allow(irrefutable_let_patterns)]
2468 pub fn into_set_health_ok(self) -> Option<(LazyInspectPuppetSetHealthOkResponder)> {
2469 if let LazyInspectPuppetRequest::SetHealthOk { responder } = self {
2470 Some((responder))
2471 } else {
2472 None
2473 }
2474 }
2475
2476 #[allow(irrefutable_let_patterns)]
2477 pub fn into_record_string(
2478 self,
2479 ) -> Option<(String, String, LazyInspectPuppetRecordStringResponder)> {
2480 if let LazyInspectPuppetRequest::RecordString { key, value, responder } = self {
2481 Some((key, value, responder))
2482 } else {
2483 None
2484 }
2485 }
2486
2487 #[allow(irrefutable_let_patterns)]
2488 pub fn into_record_int(self) -> Option<(String, i64, LazyInspectPuppetRecordIntResponder)> {
2489 if let LazyInspectPuppetRequest::RecordInt { key, value, responder } = self {
2490 Some((key, value, responder))
2491 } else {
2492 None
2493 }
2494 }
2495
2496 #[allow(irrefutable_let_patterns)]
2497 pub fn into_emit_example_inspect_data(
2498 self,
2499 ) -> Option<(LazyInspectPuppetEmitExampleInspectDataResponder)> {
2500 if let LazyInspectPuppetRequest::EmitExampleInspectData { responder } = self {
2501 Some((responder))
2502 } else {
2503 None
2504 }
2505 }
2506
2507 #[allow(irrefutable_let_patterns)]
2508 pub fn into_escrow_and_exit(
2509 self,
2510 ) -> Option<(InspectWriterEscrowAndExitRequest, LazyInspectPuppetEscrowAndExitResponder)> {
2511 if let LazyInspectPuppetRequest::EscrowAndExit { payload, responder } = self {
2512 Some((payload, responder))
2513 } else {
2514 None
2515 }
2516 }
2517
2518 #[allow(irrefutable_let_patterns)]
2519 pub fn into_commit(self) -> Option<(CommitOptions, LazyInspectPuppetCommitResponder)> {
2520 if let LazyInspectPuppetRequest::Commit { options, responder } = self {
2521 Some((options, responder))
2522 } else {
2523 None
2524 }
2525 }
2526
2527 pub fn method_name(&self) -> &'static str {
2529 match *self {
2530 LazyInspectPuppetRequest::SetHealthOk { .. } => "set_health_ok",
2531 LazyInspectPuppetRequest::RecordString { .. } => "record_string",
2532 LazyInspectPuppetRequest::RecordInt { .. } => "record_int",
2533 LazyInspectPuppetRequest::EmitExampleInspectData { .. } => "emit_example_inspect_data",
2534 LazyInspectPuppetRequest::EscrowAndExit { .. } => "escrow_and_exit",
2535 LazyInspectPuppetRequest::Commit { .. } => "commit",
2536 LazyInspectPuppetRequest::_UnknownMethod {
2537 method_type: fidl::MethodType::OneWay,
2538 ..
2539 } => "unknown one-way method",
2540 LazyInspectPuppetRequest::_UnknownMethod {
2541 method_type: fidl::MethodType::TwoWay,
2542 ..
2543 } => "unknown two-way method",
2544 }
2545 }
2546}
2547
2548#[derive(Debug, Clone)]
2549pub struct LazyInspectPuppetControlHandle {
2550 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2551}
2552
2553impl fidl::endpoints::ControlHandle for LazyInspectPuppetControlHandle {
2554 fn shutdown(&self) {
2555 self.inner.shutdown()
2556 }
2557 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2558 self.inner.shutdown_with_epitaph(status)
2559 }
2560
2561 fn is_closed(&self) -> bool {
2562 self.inner.channel().is_closed()
2563 }
2564 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2565 self.inner.channel().on_closed()
2566 }
2567
2568 #[cfg(target_os = "fuchsia")]
2569 fn signal_peer(
2570 &self,
2571 clear_mask: zx::Signals,
2572 set_mask: zx::Signals,
2573 ) -> Result<(), zx_status::Status> {
2574 use fidl::Peered;
2575 self.inner.channel().signal_peer(clear_mask, set_mask)
2576 }
2577}
2578
2579impl LazyInspectPuppetControlHandle {}
2580
2581#[must_use = "FIDL methods require a response to be sent"]
2582#[derive(Debug)]
2583pub struct LazyInspectPuppetSetHealthOkResponder {
2584 control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
2585 tx_id: u32,
2586}
2587
2588impl std::ops::Drop for LazyInspectPuppetSetHealthOkResponder {
2592 fn drop(&mut self) {
2593 self.control_handle.shutdown();
2594 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2596 }
2597}
2598
2599impl fidl::endpoints::Responder for LazyInspectPuppetSetHealthOkResponder {
2600 type ControlHandle = LazyInspectPuppetControlHandle;
2601
2602 fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
2603 &self.control_handle
2604 }
2605
2606 fn drop_without_shutdown(mut self) {
2607 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2609 std::mem::forget(self);
2611 }
2612}
2613
2614impl LazyInspectPuppetSetHealthOkResponder {
2615 pub fn send(self) -> Result<(), fidl::Error> {
2619 let _result = self.send_raw();
2620 if _result.is_err() {
2621 self.control_handle.shutdown();
2622 }
2623 self.drop_without_shutdown();
2624 _result
2625 }
2626
2627 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2629 let _result = self.send_raw();
2630 self.drop_without_shutdown();
2631 _result
2632 }
2633
2634 fn send_raw(&self) -> Result<(), fidl::Error> {
2635 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2636 fidl::encoding::Flexible::new(()),
2637 self.tx_id,
2638 0xe7510549d99075e,
2639 fidl::encoding::DynamicFlags::FLEXIBLE,
2640 )
2641 }
2642}
2643
2644#[must_use = "FIDL methods require a response to be sent"]
2645#[derive(Debug)]
2646pub struct LazyInspectPuppetRecordStringResponder {
2647 control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
2648 tx_id: u32,
2649}
2650
2651impl std::ops::Drop for LazyInspectPuppetRecordStringResponder {
2655 fn drop(&mut self) {
2656 self.control_handle.shutdown();
2657 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2659 }
2660}
2661
2662impl fidl::endpoints::Responder for LazyInspectPuppetRecordStringResponder {
2663 type ControlHandle = LazyInspectPuppetControlHandle;
2664
2665 fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
2666 &self.control_handle
2667 }
2668
2669 fn drop_without_shutdown(mut self) {
2670 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2672 std::mem::forget(self);
2674 }
2675}
2676
2677impl LazyInspectPuppetRecordStringResponder {
2678 pub fn send(self) -> Result<(), fidl::Error> {
2682 let _result = self.send_raw();
2683 if _result.is_err() {
2684 self.control_handle.shutdown();
2685 }
2686 self.drop_without_shutdown();
2687 _result
2688 }
2689
2690 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2692 let _result = self.send_raw();
2693 self.drop_without_shutdown();
2694 _result
2695 }
2696
2697 fn send_raw(&self) -> Result<(), fidl::Error> {
2698 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2699 fidl::encoding::Flexible::new(()),
2700 self.tx_id,
2701 0x195be230721d712b,
2702 fidl::encoding::DynamicFlags::FLEXIBLE,
2703 )
2704 }
2705}
2706
2707#[must_use = "FIDL methods require a response to be sent"]
2708#[derive(Debug)]
2709pub struct LazyInspectPuppetRecordIntResponder {
2710 control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
2711 tx_id: u32,
2712}
2713
2714impl std::ops::Drop for LazyInspectPuppetRecordIntResponder {
2718 fn drop(&mut self) {
2719 self.control_handle.shutdown();
2720 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2722 }
2723}
2724
2725impl fidl::endpoints::Responder for LazyInspectPuppetRecordIntResponder {
2726 type ControlHandle = LazyInspectPuppetControlHandle;
2727
2728 fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
2729 &self.control_handle
2730 }
2731
2732 fn drop_without_shutdown(mut self) {
2733 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2735 std::mem::forget(self);
2737 }
2738}
2739
2740impl LazyInspectPuppetRecordIntResponder {
2741 pub fn send(self) -> Result<(), fidl::Error> {
2745 let _result = self.send_raw();
2746 if _result.is_err() {
2747 self.control_handle.shutdown();
2748 }
2749 self.drop_without_shutdown();
2750 _result
2751 }
2752
2753 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2755 let _result = self.send_raw();
2756 self.drop_without_shutdown();
2757 _result
2758 }
2759
2760 fn send_raw(&self) -> Result<(), fidl::Error> {
2761 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2762 fidl::encoding::Flexible::new(()),
2763 self.tx_id,
2764 0xa2c6cbf0df0949,
2765 fidl::encoding::DynamicFlags::FLEXIBLE,
2766 )
2767 }
2768}
2769
2770#[must_use = "FIDL methods require a response to be sent"]
2771#[derive(Debug)]
2772pub struct LazyInspectPuppetEmitExampleInspectDataResponder {
2773 control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
2774 tx_id: u32,
2775}
2776
2777impl std::ops::Drop for LazyInspectPuppetEmitExampleInspectDataResponder {
2781 fn drop(&mut self) {
2782 self.control_handle.shutdown();
2783 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2785 }
2786}
2787
2788impl fidl::endpoints::Responder for LazyInspectPuppetEmitExampleInspectDataResponder {
2789 type ControlHandle = LazyInspectPuppetControlHandle;
2790
2791 fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
2792 &self.control_handle
2793 }
2794
2795 fn drop_without_shutdown(mut self) {
2796 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2798 std::mem::forget(self);
2800 }
2801}
2802
2803impl LazyInspectPuppetEmitExampleInspectDataResponder {
2804 pub fn send(self) -> Result<(), fidl::Error> {
2808 let _result = self.send_raw();
2809 if _result.is_err() {
2810 self.control_handle.shutdown();
2811 }
2812 self.drop_without_shutdown();
2813 _result
2814 }
2815
2816 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2818 let _result = self.send_raw();
2819 self.drop_without_shutdown();
2820 _result
2821 }
2822
2823 fn send_raw(&self) -> Result<(), fidl::Error> {
2824 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2825 fidl::encoding::Flexible::new(()),
2826 self.tx_id,
2827 0x228ae4647773fd94,
2828 fidl::encoding::DynamicFlags::FLEXIBLE,
2829 )
2830 }
2831}
2832
2833#[must_use = "FIDL methods require a response to be sent"]
2834#[derive(Debug)]
2835pub struct LazyInspectPuppetEscrowAndExitResponder {
2836 control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
2837 tx_id: u32,
2838}
2839
2840impl std::ops::Drop for LazyInspectPuppetEscrowAndExitResponder {
2844 fn drop(&mut self) {
2845 self.control_handle.shutdown();
2846 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2848 }
2849}
2850
2851impl fidl::endpoints::Responder for LazyInspectPuppetEscrowAndExitResponder {
2852 type ControlHandle = LazyInspectPuppetControlHandle;
2853
2854 fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
2855 &self.control_handle
2856 }
2857
2858 fn drop_without_shutdown(mut self) {
2859 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2861 std::mem::forget(self);
2863 }
2864}
2865
2866impl LazyInspectPuppetEscrowAndExitResponder {
2867 pub fn send(self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
2871 let _result = self.send_raw(payload);
2872 if _result.is_err() {
2873 self.control_handle.shutdown();
2874 }
2875 self.drop_without_shutdown();
2876 _result
2877 }
2878
2879 pub fn send_no_shutdown_on_err(
2881 self,
2882 mut payload: InspectWriterEscrowAndExitResponse,
2883 ) -> Result<(), fidl::Error> {
2884 let _result = self.send_raw(payload);
2885 self.drop_without_shutdown();
2886 _result
2887 }
2888
2889 fn send_raw(&self, mut payload: InspectWriterEscrowAndExitResponse) -> Result<(), fidl::Error> {
2890 self.control_handle
2891 .inner
2892 .send::<fidl::encoding::FlexibleType<InspectWriterEscrowAndExitResponse>>(
2893 fidl::encoding::Flexible::new(&mut payload),
2894 self.tx_id,
2895 0x60e24adbd0e588ff,
2896 fidl::encoding::DynamicFlags::FLEXIBLE,
2897 )
2898 }
2899}
2900
2901#[must_use = "FIDL methods require a response to be sent"]
2902#[derive(Debug)]
2903pub struct LazyInspectPuppetCommitResponder {
2904 control_handle: std::mem::ManuallyDrop<LazyInspectPuppetControlHandle>,
2905 tx_id: u32,
2906}
2907
2908impl std::ops::Drop for LazyInspectPuppetCommitResponder {
2912 fn drop(&mut self) {
2913 self.control_handle.shutdown();
2914 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2916 }
2917}
2918
2919impl fidl::endpoints::Responder for LazyInspectPuppetCommitResponder {
2920 type ControlHandle = LazyInspectPuppetControlHandle;
2921
2922 fn control_handle(&self) -> &LazyInspectPuppetControlHandle {
2923 &self.control_handle
2924 }
2925
2926 fn drop_without_shutdown(mut self) {
2927 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2929 std::mem::forget(self);
2931 }
2932}
2933
2934impl LazyInspectPuppetCommitResponder {
2935 pub fn send(self) -> Result<(), fidl::Error> {
2939 let _result = self.send_raw();
2940 if _result.is_err() {
2941 self.control_handle.shutdown();
2942 }
2943 self.drop_without_shutdown();
2944 _result
2945 }
2946
2947 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2949 let _result = self.send_raw();
2950 self.drop_without_shutdown();
2951 _result
2952 }
2953
2954 fn send_raw(&self) -> Result<(), fidl::Error> {
2955 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
2956 fidl::encoding::Flexible::new(()),
2957 self.tx_id,
2958 0x79524e5e00cbf03f,
2959 fidl::encoding::DynamicFlags::FLEXIBLE,
2960 )
2961 }
2962}
2963
2964#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2965pub struct LogPuppetMarker;
2966
2967impl fidl::endpoints::ProtocolMarker for LogPuppetMarker {
2968 type Proxy = LogPuppetProxy;
2969 type RequestStream = LogPuppetRequestStream;
2970 #[cfg(target_os = "fuchsia")]
2971 type SynchronousProxy = LogPuppetSynchronousProxy;
2972
2973 const DEBUG_NAME: &'static str = "(anonymous) LogPuppet";
2974}
2975
2976pub trait LogPuppetProxyInterface: Send + Sync {
2977 type PrintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2978 fn r#println(&self, message: &str) -> Self::PrintlnResponseFut;
2979 type EprintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2980 fn r#eprintln(&self, message: &str) -> Self::EprintlnResponseFut;
2981 type LogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2982 fn r#log(&self, payload: &LogPuppetLogRequest) -> Self::LogResponseFut;
2983 type WaitForInterestChangeResponseFut: std::future::Future<Output = Result<LogPuppetWaitForInterestChangeResponse, fidl::Error>>
2984 + Send;
2985 fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut;
2986}
2987#[derive(Debug)]
2988#[cfg(target_os = "fuchsia")]
2989pub struct LogPuppetSynchronousProxy {
2990 client: fidl::client::sync::Client,
2991}
2992
2993#[cfg(target_os = "fuchsia")]
2994impl fidl::endpoints::SynchronousProxy for LogPuppetSynchronousProxy {
2995 type Proxy = LogPuppetProxy;
2996 type Protocol = LogPuppetMarker;
2997
2998 fn from_channel(inner: fidl::Channel) -> Self {
2999 Self::new(inner)
3000 }
3001
3002 fn into_channel(self) -> fidl::Channel {
3003 self.client.into_channel()
3004 }
3005
3006 fn as_channel(&self) -> &fidl::Channel {
3007 self.client.as_channel()
3008 }
3009}
3010
3011#[cfg(target_os = "fuchsia")]
3012impl LogPuppetSynchronousProxy {
3013 pub fn new(channel: fidl::Channel) -> Self {
3014 let protocol_name = <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3015 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3016 }
3017
3018 pub fn into_channel(self) -> fidl::Channel {
3019 self.client.into_channel()
3020 }
3021
3022 pub fn wait_for_event(
3025 &self,
3026 deadline: zx::MonotonicInstant,
3027 ) -> Result<LogPuppetEvent, fidl::Error> {
3028 LogPuppetEvent::decode(self.client.wait_for_event(deadline)?)
3029 }
3030
3031 pub fn r#println(
3033 &self,
3034 mut message: &str,
3035 ___deadline: zx::MonotonicInstant,
3036 ) -> Result<(), fidl::Error> {
3037 let _response = self.client.send_query::<
3038 LogPuppetPrintlnRequest,
3039 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3040 >(
3041 (message,),
3042 0x6584cb93e1978da0,
3043 fidl::encoding::DynamicFlags::FLEXIBLE,
3044 ___deadline,
3045 )?
3046 .into_result::<LogPuppetMarker>("println")?;
3047 Ok(_response)
3048 }
3049
3050 pub fn r#eprintln(
3052 &self,
3053 mut message: &str,
3054 ___deadline: zx::MonotonicInstant,
3055 ) -> Result<(), fidl::Error> {
3056 let _response = self.client.send_query::<
3057 LogPuppetEprintlnRequest,
3058 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3059 >(
3060 (message,),
3061 0x770e4524f6b093ef,
3062 fidl::encoding::DynamicFlags::FLEXIBLE,
3063 ___deadline,
3064 )?
3065 .into_result::<LogPuppetMarker>("eprintln")?;
3066 Ok(_response)
3067 }
3068
3069 pub fn r#log(
3071 &self,
3072 mut payload: &LogPuppetLogRequest,
3073 ___deadline: zx::MonotonicInstant,
3074 ) -> Result<(), fidl::Error> {
3075 let _response = self.client.send_query::<
3076 LogPuppetLogRequest,
3077 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3078 >(
3079 payload,
3080 0x34d3dd4225e79a8b,
3081 fidl::encoding::DynamicFlags::FLEXIBLE,
3082 ___deadline,
3083 )?
3084 .into_result::<LogPuppetMarker>("log")?;
3085 Ok(_response)
3086 }
3087
3088 pub fn r#wait_for_interest_change(
3092 &self,
3093 ___deadline: zx::MonotonicInstant,
3094 ) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
3095 let _response = self.client.send_query::<
3096 fidl::encoding::EmptyPayload,
3097 fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
3098 >(
3099 (),
3100 0x3645d3ad544bc546,
3101 fidl::encoding::DynamicFlags::FLEXIBLE,
3102 ___deadline,
3103 )?
3104 .into_result::<LogPuppetMarker>("wait_for_interest_change")?;
3105 Ok(_response)
3106 }
3107}
3108
3109#[cfg(target_os = "fuchsia")]
3110impl From<LogPuppetSynchronousProxy> for zx::Handle {
3111 fn from(value: LogPuppetSynchronousProxy) -> Self {
3112 value.into_channel().into()
3113 }
3114}
3115
3116#[cfg(target_os = "fuchsia")]
3117impl From<fidl::Channel> for LogPuppetSynchronousProxy {
3118 fn from(value: fidl::Channel) -> Self {
3119 Self::new(value)
3120 }
3121}
3122
3123#[derive(Debug, Clone)]
3124pub struct LogPuppetProxy {
3125 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3126}
3127
3128impl fidl::endpoints::Proxy for LogPuppetProxy {
3129 type Protocol = LogPuppetMarker;
3130
3131 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3132 Self::new(inner)
3133 }
3134
3135 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3136 self.client.into_channel().map_err(|client| Self { client })
3137 }
3138
3139 fn as_channel(&self) -> &::fidl::AsyncChannel {
3140 self.client.as_channel()
3141 }
3142}
3143
3144impl LogPuppetProxy {
3145 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3147 let protocol_name = <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3148 Self { client: fidl::client::Client::new(channel, protocol_name) }
3149 }
3150
3151 pub fn take_event_stream(&self) -> LogPuppetEventStream {
3157 LogPuppetEventStream { event_receiver: self.client.take_event_receiver() }
3158 }
3159
3160 pub fn r#println(
3162 &self,
3163 mut message: &str,
3164 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
3165 LogPuppetProxyInterface::r#println(self, message)
3166 }
3167
3168 pub fn r#eprintln(
3170 &self,
3171 mut message: &str,
3172 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
3173 LogPuppetProxyInterface::r#eprintln(self, message)
3174 }
3175
3176 pub fn r#log(
3178 &self,
3179 mut payload: &LogPuppetLogRequest,
3180 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
3181 LogPuppetProxyInterface::r#log(self, payload)
3182 }
3183
3184 pub fn r#wait_for_interest_change(
3188 &self,
3189 ) -> fidl::client::QueryResponseFut<
3190 LogPuppetWaitForInterestChangeResponse,
3191 fidl::encoding::DefaultFuchsiaResourceDialect,
3192 > {
3193 LogPuppetProxyInterface::r#wait_for_interest_change(self)
3194 }
3195}
3196
3197impl LogPuppetProxyInterface for LogPuppetProxy {
3198 type PrintlnResponseFut =
3199 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
3200 fn r#println(&self, mut message: &str) -> Self::PrintlnResponseFut {
3201 fn _decode(
3202 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3203 ) -> Result<(), fidl::Error> {
3204 let _response = fidl::client::decode_transaction_body::<
3205 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3206 fidl::encoding::DefaultFuchsiaResourceDialect,
3207 0x6584cb93e1978da0,
3208 >(_buf?)?
3209 .into_result::<LogPuppetMarker>("println")?;
3210 Ok(_response)
3211 }
3212 self.client.send_query_and_decode::<LogPuppetPrintlnRequest, ()>(
3213 (message,),
3214 0x6584cb93e1978da0,
3215 fidl::encoding::DynamicFlags::FLEXIBLE,
3216 _decode,
3217 )
3218 }
3219
3220 type EprintlnResponseFut =
3221 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
3222 fn r#eprintln(&self, mut message: &str) -> Self::EprintlnResponseFut {
3223 fn _decode(
3224 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3225 ) -> Result<(), fidl::Error> {
3226 let _response = fidl::client::decode_transaction_body::<
3227 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3228 fidl::encoding::DefaultFuchsiaResourceDialect,
3229 0x770e4524f6b093ef,
3230 >(_buf?)?
3231 .into_result::<LogPuppetMarker>("eprintln")?;
3232 Ok(_response)
3233 }
3234 self.client.send_query_and_decode::<LogPuppetEprintlnRequest, ()>(
3235 (message,),
3236 0x770e4524f6b093ef,
3237 fidl::encoding::DynamicFlags::FLEXIBLE,
3238 _decode,
3239 )
3240 }
3241
3242 type LogResponseFut =
3243 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
3244 fn r#log(&self, mut payload: &LogPuppetLogRequest) -> Self::LogResponseFut {
3245 fn _decode(
3246 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3247 ) -> Result<(), fidl::Error> {
3248 let _response = fidl::client::decode_transaction_body::<
3249 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
3250 fidl::encoding::DefaultFuchsiaResourceDialect,
3251 0x34d3dd4225e79a8b,
3252 >(_buf?)?
3253 .into_result::<LogPuppetMarker>("log")?;
3254 Ok(_response)
3255 }
3256 self.client.send_query_and_decode::<LogPuppetLogRequest, ()>(
3257 payload,
3258 0x34d3dd4225e79a8b,
3259 fidl::encoding::DynamicFlags::FLEXIBLE,
3260 _decode,
3261 )
3262 }
3263
3264 type WaitForInterestChangeResponseFut = fidl::client::QueryResponseFut<
3265 LogPuppetWaitForInterestChangeResponse,
3266 fidl::encoding::DefaultFuchsiaResourceDialect,
3267 >;
3268 fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut {
3269 fn _decode(
3270 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3271 ) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
3272 let _response = fidl::client::decode_transaction_body::<
3273 fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
3274 fidl::encoding::DefaultFuchsiaResourceDialect,
3275 0x3645d3ad544bc546,
3276 >(_buf?)?
3277 .into_result::<LogPuppetMarker>("wait_for_interest_change")?;
3278 Ok(_response)
3279 }
3280 self.client.send_query_and_decode::<
3281 fidl::encoding::EmptyPayload,
3282 LogPuppetWaitForInterestChangeResponse,
3283 >(
3284 (),
3285 0x3645d3ad544bc546,
3286 fidl::encoding::DynamicFlags::FLEXIBLE,
3287 _decode,
3288 )
3289 }
3290}
3291
3292pub struct LogPuppetEventStream {
3293 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3294}
3295
3296impl std::marker::Unpin for LogPuppetEventStream {}
3297
3298impl futures::stream::FusedStream for LogPuppetEventStream {
3299 fn is_terminated(&self) -> bool {
3300 self.event_receiver.is_terminated()
3301 }
3302}
3303
3304impl futures::Stream for LogPuppetEventStream {
3305 type Item = Result<LogPuppetEvent, fidl::Error>;
3306
3307 fn poll_next(
3308 mut self: std::pin::Pin<&mut Self>,
3309 cx: &mut std::task::Context<'_>,
3310 ) -> std::task::Poll<Option<Self::Item>> {
3311 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3312 &mut self.event_receiver,
3313 cx
3314 )?) {
3315 Some(buf) => std::task::Poll::Ready(Some(LogPuppetEvent::decode(buf))),
3316 None => std::task::Poll::Ready(None),
3317 }
3318 }
3319}
3320
3321#[derive(Debug)]
3322pub enum LogPuppetEvent {
3323 #[non_exhaustive]
3324 _UnknownEvent {
3325 ordinal: u64,
3327 },
3328}
3329
3330impl LogPuppetEvent {
3331 fn decode(
3333 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3334 ) -> Result<LogPuppetEvent, fidl::Error> {
3335 let (bytes, _handles) = buf.split_mut();
3336 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3337 debug_assert_eq!(tx_header.tx_id, 0);
3338 match tx_header.ordinal {
3339 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3340 Ok(LogPuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3341 }
3342 _ => Err(fidl::Error::UnknownOrdinal {
3343 ordinal: tx_header.ordinal,
3344 protocol_name: <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3345 }),
3346 }
3347 }
3348}
3349
3350pub struct LogPuppetRequestStream {
3352 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3353 is_terminated: bool,
3354}
3355
3356impl std::marker::Unpin for LogPuppetRequestStream {}
3357
3358impl futures::stream::FusedStream for LogPuppetRequestStream {
3359 fn is_terminated(&self) -> bool {
3360 self.is_terminated
3361 }
3362}
3363
3364impl fidl::endpoints::RequestStream for LogPuppetRequestStream {
3365 type Protocol = LogPuppetMarker;
3366 type ControlHandle = LogPuppetControlHandle;
3367
3368 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3369 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3370 }
3371
3372 fn control_handle(&self) -> Self::ControlHandle {
3373 LogPuppetControlHandle { inner: self.inner.clone() }
3374 }
3375
3376 fn into_inner(
3377 self,
3378 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3379 {
3380 (self.inner, self.is_terminated)
3381 }
3382
3383 fn from_inner(
3384 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3385 is_terminated: bool,
3386 ) -> Self {
3387 Self { inner, is_terminated }
3388 }
3389}
3390
3391impl futures::Stream for LogPuppetRequestStream {
3392 type Item = Result<LogPuppetRequest, fidl::Error>;
3393
3394 fn poll_next(
3395 mut self: std::pin::Pin<&mut Self>,
3396 cx: &mut std::task::Context<'_>,
3397 ) -> std::task::Poll<Option<Self::Item>> {
3398 let this = &mut *self;
3399 if this.inner.check_shutdown(cx) {
3400 this.is_terminated = true;
3401 return std::task::Poll::Ready(None);
3402 }
3403 if this.is_terminated {
3404 panic!("polled LogPuppetRequestStream after completion");
3405 }
3406 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3407 |bytes, handles| {
3408 match this.inner.channel().read_etc(cx, bytes, handles) {
3409 std::task::Poll::Ready(Ok(())) => {}
3410 std::task::Poll::Pending => return std::task::Poll::Pending,
3411 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3412 this.is_terminated = true;
3413 return std::task::Poll::Ready(None);
3414 }
3415 std::task::Poll::Ready(Err(e)) => {
3416 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3417 e.into(),
3418 ))))
3419 }
3420 }
3421
3422 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3424
3425 std::task::Poll::Ready(Some(match header.ordinal {
3426 0x6584cb93e1978da0 => {
3427 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3428 let mut req = fidl::new_empty!(
3429 LogPuppetPrintlnRequest,
3430 fidl::encoding::DefaultFuchsiaResourceDialect
3431 );
3432 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetPrintlnRequest>(&header, _body_bytes, handles, &mut req)?;
3433 let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
3434 Ok(LogPuppetRequest::Println {
3435 message: req.message,
3436
3437 responder: LogPuppetPrintlnResponder {
3438 control_handle: std::mem::ManuallyDrop::new(control_handle),
3439 tx_id: header.tx_id,
3440 },
3441 })
3442 }
3443 0x770e4524f6b093ef => {
3444 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3445 let mut req = fidl::new_empty!(
3446 LogPuppetEprintlnRequest,
3447 fidl::encoding::DefaultFuchsiaResourceDialect
3448 );
3449 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetEprintlnRequest>(&header, _body_bytes, handles, &mut req)?;
3450 let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
3451 Ok(LogPuppetRequest::Eprintln {
3452 message: req.message,
3453
3454 responder: LogPuppetEprintlnResponder {
3455 control_handle: std::mem::ManuallyDrop::new(control_handle),
3456 tx_id: header.tx_id,
3457 },
3458 })
3459 }
3460 0x34d3dd4225e79a8b => {
3461 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3462 let mut req = fidl::new_empty!(
3463 LogPuppetLogRequest,
3464 fidl::encoding::DefaultFuchsiaResourceDialect
3465 );
3466 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetLogRequest>(&header, _body_bytes, handles, &mut req)?;
3467 let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
3468 Ok(LogPuppetRequest::Log {
3469 payload: req,
3470 responder: LogPuppetLogResponder {
3471 control_handle: std::mem::ManuallyDrop::new(control_handle),
3472 tx_id: header.tx_id,
3473 },
3474 })
3475 }
3476 0x3645d3ad544bc546 => {
3477 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3478 let mut req = fidl::new_empty!(
3479 fidl::encoding::EmptyPayload,
3480 fidl::encoding::DefaultFuchsiaResourceDialect
3481 );
3482 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3483 let control_handle = LogPuppetControlHandle { inner: this.inner.clone() };
3484 Ok(LogPuppetRequest::WaitForInterestChange {
3485 responder: LogPuppetWaitForInterestChangeResponder {
3486 control_handle: std::mem::ManuallyDrop::new(control_handle),
3487 tx_id: header.tx_id,
3488 },
3489 })
3490 }
3491 _ if header.tx_id == 0
3492 && header
3493 .dynamic_flags()
3494 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3495 {
3496 Ok(LogPuppetRequest::_UnknownMethod {
3497 ordinal: header.ordinal,
3498 control_handle: LogPuppetControlHandle { inner: this.inner.clone() },
3499 method_type: fidl::MethodType::OneWay,
3500 })
3501 }
3502 _ if header
3503 .dynamic_flags()
3504 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3505 {
3506 this.inner.send_framework_err(
3507 fidl::encoding::FrameworkErr::UnknownMethod,
3508 header.tx_id,
3509 header.ordinal,
3510 header.dynamic_flags(),
3511 (bytes, handles),
3512 )?;
3513 Ok(LogPuppetRequest::_UnknownMethod {
3514 ordinal: header.ordinal,
3515 control_handle: LogPuppetControlHandle { inner: this.inner.clone() },
3516 method_type: fidl::MethodType::TwoWay,
3517 })
3518 }
3519 _ => Err(fidl::Error::UnknownOrdinal {
3520 ordinal: header.ordinal,
3521 protocol_name:
3522 <LogPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3523 }),
3524 }))
3525 },
3526 )
3527 }
3528}
3529
3530#[derive(Debug)]
3532pub enum LogPuppetRequest {
3533 Println { message: String, responder: LogPuppetPrintlnResponder },
3535 Eprintln { message: String, responder: LogPuppetEprintlnResponder },
3537 Log { payload: LogPuppetLogRequest, responder: LogPuppetLogResponder },
3539 WaitForInterestChange { responder: LogPuppetWaitForInterestChangeResponder },
3543 #[non_exhaustive]
3545 _UnknownMethod {
3546 ordinal: u64,
3548 control_handle: LogPuppetControlHandle,
3549 method_type: fidl::MethodType,
3550 },
3551}
3552
3553impl LogPuppetRequest {
3554 #[allow(irrefutable_let_patterns)]
3555 pub fn into_println(self) -> Option<(String, LogPuppetPrintlnResponder)> {
3556 if let LogPuppetRequest::Println { message, responder } = self {
3557 Some((message, responder))
3558 } else {
3559 None
3560 }
3561 }
3562
3563 #[allow(irrefutable_let_patterns)]
3564 pub fn into_eprintln(self) -> Option<(String, LogPuppetEprintlnResponder)> {
3565 if let LogPuppetRequest::Eprintln { message, responder } = self {
3566 Some((message, responder))
3567 } else {
3568 None
3569 }
3570 }
3571
3572 #[allow(irrefutable_let_patterns)]
3573 pub fn into_log(self) -> Option<(LogPuppetLogRequest, LogPuppetLogResponder)> {
3574 if let LogPuppetRequest::Log { payload, responder } = self {
3575 Some((payload, responder))
3576 } else {
3577 None
3578 }
3579 }
3580
3581 #[allow(irrefutable_let_patterns)]
3582 pub fn into_wait_for_interest_change(
3583 self,
3584 ) -> Option<(LogPuppetWaitForInterestChangeResponder)> {
3585 if let LogPuppetRequest::WaitForInterestChange { responder } = self {
3586 Some((responder))
3587 } else {
3588 None
3589 }
3590 }
3591
3592 pub fn method_name(&self) -> &'static str {
3594 match *self {
3595 LogPuppetRequest::Println { .. } => "println",
3596 LogPuppetRequest::Eprintln { .. } => "eprintln",
3597 LogPuppetRequest::Log { .. } => "log",
3598 LogPuppetRequest::WaitForInterestChange { .. } => "wait_for_interest_change",
3599 LogPuppetRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3600 "unknown one-way method"
3601 }
3602 LogPuppetRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3603 "unknown two-way method"
3604 }
3605 }
3606 }
3607}
3608
3609#[derive(Debug, Clone)]
3610pub struct LogPuppetControlHandle {
3611 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3612}
3613
3614impl fidl::endpoints::ControlHandle for LogPuppetControlHandle {
3615 fn shutdown(&self) {
3616 self.inner.shutdown()
3617 }
3618 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3619 self.inner.shutdown_with_epitaph(status)
3620 }
3621
3622 fn is_closed(&self) -> bool {
3623 self.inner.channel().is_closed()
3624 }
3625 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3626 self.inner.channel().on_closed()
3627 }
3628
3629 #[cfg(target_os = "fuchsia")]
3630 fn signal_peer(
3631 &self,
3632 clear_mask: zx::Signals,
3633 set_mask: zx::Signals,
3634 ) -> Result<(), zx_status::Status> {
3635 use fidl::Peered;
3636 self.inner.channel().signal_peer(clear_mask, set_mask)
3637 }
3638}
3639
3640impl LogPuppetControlHandle {}
3641
3642#[must_use = "FIDL methods require a response to be sent"]
3643#[derive(Debug)]
3644pub struct LogPuppetPrintlnResponder {
3645 control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
3646 tx_id: u32,
3647}
3648
3649impl std::ops::Drop for LogPuppetPrintlnResponder {
3653 fn drop(&mut self) {
3654 self.control_handle.shutdown();
3655 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3657 }
3658}
3659
3660impl fidl::endpoints::Responder for LogPuppetPrintlnResponder {
3661 type ControlHandle = LogPuppetControlHandle;
3662
3663 fn control_handle(&self) -> &LogPuppetControlHandle {
3664 &self.control_handle
3665 }
3666
3667 fn drop_without_shutdown(mut self) {
3668 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3670 std::mem::forget(self);
3672 }
3673}
3674
3675impl LogPuppetPrintlnResponder {
3676 pub fn send(self) -> Result<(), fidl::Error> {
3680 let _result = self.send_raw();
3681 if _result.is_err() {
3682 self.control_handle.shutdown();
3683 }
3684 self.drop_without_shutdown();
3685 _result
3686 }
3687
3688 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3690 let _result = self.send_raw();
3691 self.drop_without_shutdown();
3692 _result
3693 }
3694
3695 fn send_raw(&self) -> Result<(), fidl::Error> {
3696 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3697 fidl::encoding::Flexible::new(()),
3698 self.tx_id,
3699 0x6584cb93e1978da0,
3700 fidl::encoding::DynamicFlags::FLEXIBLE,
3701 )
3702 }
3703}
3704
3705#[must_use = "FIDL methods require a response to be sent"]
3706#[derive(Debug)]
3707pub struct LogPuppetEprintlnResponder {
3708 control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
3709 tx_id: u32,
3710}
3711
3712impl std::ops::Drop for LogPuppetEprintlnResponder {
3716 fn drop(&mut self) {
3717 self.control_handle.shutdown();
3718 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3720 }
3721}
3722
3723impl fidl::endpoints::Responder for LogPuppetEprintlnResponder {
3724 type ControlHandle = LogPuppetControlHandle;
3725
3726 fn control_handle(&self) -> &LogPuppetControlHandle {
3727 &self.control_handle
3728 }
3729
3730 fn drop_without_shutdown(mut self) {
3731 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3733 std::mem::forget(self);
3735 }
3736}
3737
3738impl LogPuppetEprintlnResponder {
3739 pub fn send(self) -> Result<(), fidl::Error> {
3743 let _result = self.send_raw();
3744 if _result.is_err() {
3745 self.control_handle.shutdown();
3746 }
3747 self.drop_without_shutdown();
3748 _result
3749 }
3750
3751 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3753 let _result = self.send_raw();
3754 self.drop_without_shutdown();
3755 _result
3756 }
3757
3758 fn send_raw(&self) -> Result<(), fidl::Error> {
3759 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3760 fidl::encoding::Flexible::new(()),
3761 self.tx_id,
3762 0x770e4524f6b093ef,
3763 fidl::encoding::DynamicFlags::FLEXIBLE,
3764 )
3765 }
3766}
3767
3768#[must_use = "FIDL methods require a response to be sent"]
3769#[derive(Debug)]
3770pub struct LogPuppetLogResponder {
3771 control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
3772 tx_id: u32,
3773}
3774
3775impl std::ops::Drop for LogPuppetLogResponder {
3779 fn drop(&mut self) {
3780 self.control_handle.shutdown();
3781 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3783 }
3784}
3785
3786impl fidl::endpoints::Responder for LogPuppetLogResponder {
3787 type ControlHandle = LogPuppetControlHandle;
3788
3789 fn control_handle(&self) -> &LogPuppetControlHandle {
3790 &self.control_handle
3791 }
3792
3793 fn drop_without_shutdown(mut self) {
3794 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3796 std::mem::forget(self);
3798 }
3799}
3800
3801impl LogPuppetLogResponder {
3802 pub fn send(self) -> Result<(), fidl::Error> {
3806 let _result = self.send_raw();
3807 if _result.is_err() {
3808 self.control_handle.shutdown();
3809 }
3810 self.drop_without_shutdown();
3811 _result
3812 }
3813
3814 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3816 let _result = self.send_raw();
3817 self.drop_without_shutdown();
3818 _result
3819 }
3820
3821 fn send_raw(&self) -> Result<(), fidl::Error> {
3822 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
3823 fidl::encoding::Flexible::new(()),
3824 self.tx_id,
3825 0x34d3dd4225e79a8b,
3826 fidl::encoding::DynamicFlags::FLEXIBLE,
3827 )
3828 }
3829}
3830
3831#[must_use = "FIDL methods require a response to be sent"]
3832#[derive(Debug)]
3833pub struct LogPuppetWaitForInterestChangeResponder {
3834 control_handle: std::mem::ManuallyDrop<LogPuppetControlHandle>,
3835 tx_id: u32,
3836}
3837
3838impl std::ops::Drop for LogPuppetWaitForInterestChangeResponder {
3842 fn drop(&mut self) {
3843 self.control_handle.shutdown();
3844 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3846 }
3847}
3848
3849impl fidl::endpoints::Responder for LogPuppetWaitForInterestChangeResponder {
3850 type ControlHandle = LogPuppetControlHandle;
3851
3852 fn control_handle(&self) -> &LogPuppetControlHandle {
3853 &self.control_handle
3854 }
3855
3856 fn drop_without_shutdown(mut self) {
3857 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3859 std::mem::forget(self);
3861 }
3862}
3863
3864impl LogPuppetWaitForInterestChangeResponder {
3865 pub fn send(
3869 self,
3870 mut payload: &LogPuppetWaitForInterestChangeResponse,
3871 ) -> Result<(), fidl::Error> {
3872 let _result = self.send_raw(payload);
3873 if _result.is_err() {
3874 self.control_handle.shutdown();
3875 }
3876 self.drop_without_shutdown();
3877 _result
3878 }
3879
3880 pub fn send_no_shutdown_on_err(
3882 self,
3883 mut payload: &LogPuppetWaitForInterestChangeResponse,
3884 ) -> Result<(), fidl::Error> {
3885 let _result = self.send_raw(payload);
3886 self.drop_without_shutdown();
3887 _result
3888 }
3889
3890 fn send_raw(
3891 &self,
3892 mut payload: &LogPuppetWaitForInterestChangeResponse,
3893 ) -> Result<(), fidl::Error> {
3894 self.control_handle.inner.send::<fidl::encoding::FlexibleType<
3895 LogPuppetWaitForInterestChangeResponse,
3896 >>(
3897 fidl::encoding::Flexible::new(payload),
3898 self.tx_id,
3899 0x3645d3ad544bc546,
3900 fidl::encoding::DynamicFlags::FLEXIBLE,
3901 )
3902 }
3903}
3904
3905#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3906pub struct PuppetMarker;
3907
3908impl fidl::endpoints::ProtocolMarker for PuppetMarker {
3909 type Proxy = PuppetProxy;
3910 type RequestStream = PuppetRequestStream;
3911 #[cfg(target_os = "fuchsia")]
3912 type SynchronousProxy = PuppetSynchronousProxy;
3913
3914 const DEBUG_NAME: &'static str = "fuchsia.archivist.test.Puppet";
3915}
3916impl fidl::endpoints::DiscoverableProtocolMarker for PuppetMarker {}
3917
3918pub trait PuppetProxyInterface: Send + Sync {
3919 type CreateInspectorResponseFut: std::future::Future<
3920 Output = Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error>,
3921 > + Send;
3922 fn r#create_inspector(
3923 &self,
3924 payload: &InspectPuppetCreateInspectorRequest,
3925 ) -> Self::CreateInspectorResponseFut;
3926 type PrintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
3927 fn r#println(&self, message: &str) -> Self::PrintlnResponseFut;
3928 type EprintlnResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
3929 fn r#eprintln(&self, message: &str) -> Self::EprintlnResponseFut;
3930 type LogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
3931 fn r#log(&self, payload: &LogPuppetLogRequest) -> Self::LogResponseFut;
3932 type WaitForInterestChangeResponseFut: std::future::Future<Output = Result<LogPuppetWaitForInterestChangeResponse, fidl::Error>>
3933 + Send;
3934 fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut;
3935 type RecordLazyValuesResponseFut: std::future::Future<
3936 Output = Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error>,
3937 > + Send;
3938 fn r#record_lazy_values(&self, key: &str) -> Self::RecordLazyValuesResponseFut;
3939 fn r#crash(&self, message: &str) -> Result<(), fidl::Error>;
3940}
3941#[derive(Debug)]
3942#[cfg(target_os = "fuchsia")]
3943pub struct PuppetSynchronousProxy {
3944 client: fidl::client::sync::Client,
3945}
3946
3947#[cfg(target_os = "fuchsia")]
3948impl fidl::endpoints::SynchronousProxy for PuppetSynchronousProxy {
3949 type Proxy = PuppetProxy;
3950 type Protocol = PuppetMarker;
3951
3952 fn from_channel(inner: fidl::Channel) -> Self {
3953 Self::new(inner)
3954 }
3955
3956 fn into_channel(self) -> fidl::Channel {
3957 self.client.into_channel()
3958 }
3959
3960 fn as_channel(&self) -> &fidl::Channel {
3961 self.client.as_channel()
3962 }
3963}
3964
3965#[cfg(target_os = "fuchsia")]
3966impl PuppetSynchronousProxy {
3967 pub fn new(channel: fidl::Channel) -> Self {
3968 let protocol_name = <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3969 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3970 }
3971
3972 pub fn into_channel(self) -> fidl::Channel {
3973 self.client.into_channel()
3974 }
3975
3976 pub fn wait_for_event(
3979 &self,
3980 deadline: zx::MonotonicInstant,
3981 ) -> Result<PuppetEvent, fidl::Error> {
3982 PuppetEvent::decode(self.client.wait_for_event(deadline)?)
3983 }
3984
3985 pub fn r#create_inspector(
3988 &self,
3989 mut payload: &InspectPuppetCreateInspectorRequest,
3990 ___deadline: zx::MonotonicInstant,
3991 ) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
3992 let _response = self.client.send_query::<
3993 InspectPuppetCreateInspectorRequest,
3994 fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
3995 >(
3996 payload,
3997 0x2c0f807d7d159bb,
3998 fidl::encoding::DynamicFlags::FLEXIBLE,
3999 ___deadline,
4000 )?
4001 .into_result::<PuppetMarker>("create_inspector")?;
4002 Ok(_response.writer)
4003 }
4004
4005 pub fn r#println(
4007 &self,
4008 mut message: &str,
4009 ___deadline: zx::MonotonicInstant,
4010 ) -> Result<(), fidl::Error> {
4011 let _response = self.client.send_query::<
4012 LogPuppetPrintlnRequest,
4013 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4014 >(
4015 (message,),
4016 0x6584cb93e1978da0,
4017 fidl::encoding::DynamicFlags::FLEXIBLE,
4018 ___deadline,
4019 )?
4020 .into_result::<PuppetMarker>("println")?;
4021 Ok(_response)
4022 }
4023
4024 pub fn r#eprintln(
4026 &self,
4027 mut message: &str,
4028 ___deadline: zx::MonotonicInstant,
4029 ) -> Result<(), fidl::Error> {
4030 let _response = self.client.send_query::<
4031 LogPuppetEprintlnRequest,
4032 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4033 >(
4034 (message,),
4035 0x770e4524f6b093ef,
4036 fidl::encoding::DynamicFlags::FLEXIBLE,
4037 ___deadline,
4038 )?
4039 .into_result::<PuppetMarker>("eprintln")?;
4040 Ok(_response)
4041 }
4042
4043 pub fn r#log(
4045 &self,
4046 mut payload: &LogPuppetLogRequest,
4047 ___deadline: zx::MonotonicInstant,
4048 ) -> Result<(), fidl::Error> {
4049 let _response = self.client.send_query::<
4050 LogPuppetLogRequest,
4051 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4052 >(
4053 payload,
4054 0x34d3dd4225e79a8b,
4055 fidl::encoding::DynamicFlags::FLEXIBLE,
4056 ___deadline,
4057 )?
4058 .into_result::<PuppetMarker>("log")?;
4059 Ok(_response)
4060 }
4061
4062 pub fn r#wait_for_interest_change(
4066 &self,
4067 ___deadline: zx::MonotonicInstant,
4068 ) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
4069 let _response = self.client.send_query::<
4070 fidl::encoding::EmptyPayload,
4071 fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
4072 >(
4073 (),
4074 0x3645d3ad544bc546,
4075 fidl::encoding::DynamicFlags::FLEXIBLE,
4076 ___deadline,
4077 )?
4078 .into_result::<PuppetMarker>("wait_for_interest_change")?;
4079 Ok(_response)
4080 }
4081
4082 pub fn r#record_lazy_values(
4084 &self,
4085 mut key: &str,
4086 ___deadline: zx::MonotonicInstant,
4087 ) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
4088 let _response = self.client.send_query::<
4089 PuppetRecordLazyValuesRequest,
4090 fidl::encoding::FlexibleType<PuppetRecordLazyValuesResponse>,
4091 >(
4092 (key,),
4093 0x339951b623dc9d7d,
4094 fidl::encoding::DynamicFlags::FLEXIBLE,
4095 ___deadline,
4096 )?
4097 .into_result::<PuppetMarker>("record_lazy_values")?;
4098 Ok(_response.client)
4099 }
4100
4101 pub fn r#crash(&self, mut message: &str) -> Result<(), fidl::Error> {
4105 self.client.send::<PuppetCrashRequest>(
4106 (message,),
4107 0x2aeef488fb79c9db,
4108 fidl::encoding::DynamicFlags::FLEXIBLE,
4109 )
4110 }
4111}
4112
4113#[cfg(target_os = "fuchsia")]
4114impl From<PuppetSynchronousProxy> for zx::Handle {
4115 fn from(value: PuppetSynchronousProxy) -> Self {
4116 value.into_channel().into()
4117 }
4118}
4119
4120#[cfg(target_os = "fuchsia")]
4121impl From<fidl::Channel> for PuppetSynchronousProxy {
4122 fn from(value: fidl::Channel) -> Self {
4123 Self::new(value)
4124 }
4125}
4126
4127#[derive(Debug, Clone)]
4128pub struct PuppetProxy {
4129 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4130}
4131
4132impl fidl::endpoints::Proxy for PuppetProxy {
4133 type Protocol = PuppetMarker;
4134
4135 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4136 Self::new(inner)
4137 }
4138
4139 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4140 self.client.into_channel().map_err(|client| Self { client })
4141 }
4142
4143 fn as_channel(&self) -> &::fidl::AsyncChannel {
4144 self.client.as_channel()
4145 }
4146}
4147
4148impl PuppetProxy {
4149 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4151 let protocol_name = <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4152 Self { client: fidl::client::Client::new(channel, protocol_name) }
4153 }
4154
4155 pub fn take_event_stream(&self) -> PuppetEventStream {
4161 PuppetEventStream { event_receiver: self.client.take_event_receiver() }
4162 }
4163
4164 pub fn r#create_inspector(
4167 &self,
4168 mut payload: &InspectPuppetCreateInspectorRequest,
4169 ) -> fidl::client::QueryResponseFut<
4170 fidl::endpoints::ClientEnd<InspectWriterMarker>,
4171 fidl::encoding::DefaultFuchsiaResourceDialect,
4172 > {
4173 PuppetProxyInterface::r#create_inspector(self, payload)
4174 }
4175
4176 pub fn r#println(
4178 &self,
4179 mut message: &str,
4180 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4181 PuppetProxyInterface::r#println(self, message)
4182 }
4183
4184 pub fn r#eprintln(
4186 &self,
4187 mut message: &str,
4188 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4189 PuppetProxyInterface::r#eprintln(self, message)
4190 }
4191
4192 pub fn r#log(
4194 &self,
4195 mut payload: &LogPuppetLogRequest,
4196 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
4197 PuppetProxyInterface::r#log(self, payload)
4198 }
4199
4200 pub fn r#wait_for_interest_change(
4204 &self,
4205 ) -> fidl::client::QueryResponseFut<
4206 LogPuppetWaitForInterestChangeResponse,
4207 fidl::encoding::DefaultFuchsiaResourceDialect,
4208 > {
4209 PuppetProxyInterface::r#wait_for_interest_change(self)
4210 }
4211
4212 pub fn r#record_lazy_values(
4214 &self,
4215 mut key: &str,
4216 ) -> fidl::client::QueryResponseFut<
4217 fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
4218 fidl::encoding::DefaultFuchsiaResourceDialect,
4219 > {
4220 PuppetProxyInterface::r#record_lazy_values(self, key)
4221 }
4222
4223 pub fn r#crash(&self, mut message: &str) -> Result<(), fidl::Error> {
4227 PuppetProxyInterface::r#crash(self, message)
4228 }
4229}
4230
4231impl PuppetProxyInterface for PuppetProxy {
4232 type CreateInspectorResponseFut = fidl::client::QueryResponseFut<
4233 fidl::endpoints::ClientEnd<InspectWriterMarker>,
4234 fidl::encoding::DefaultFuchsiaResourceDialect,
4235 >;
4236 fn r#create_inspector(
4237 &self,
4238 mut payload: &InspectPuppetCreateInspectorRequest,
4239 ) -> Self::CreateInspectorResponseFut {
4240 fn _decode(
4241 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4242 ) -> Result<fidl::endpoints::ClientEnd<InspectWriterMarker>, fidl::Error> {
4243 let _response = fidl::client::decode_transaction_body::<
4244 fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>,
4245 fidl::encoding::DefaultFuchsiaResourceDialect,
4246 0x2c0f807d7d159bb,
4247 >(_buf?)?
4248 .into_result::<PuppetMarker>("create_inspector")?;
4249 Ok(_response.writer)
4250 }
4251 self.client.send_query_and_decode::<
4252 InspectPuppetCreateInspectorRequest,
4253 fidl::endpoints::ClientEnd<InspectWriterMarker>,
4254 >(
4255 payload,
4256 0x2c0f807d7d159bb,
4257 fidl::encoding::DynamicFlags::FLEXIBLE,
4258 _decode,
4259 )
4260 }
4261
4262 type PrintlnResponseFut =
4263 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4264 fn r#println(&self, mut message: &str) -> Self::PrintlnResponseFut {
4265 fn _decode(
4266 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4267 ) -> Result<(), fidl::Error> {
4268 let _response = fidl::client::decode_transaction_body::<
4269 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4270 fidl::encoding::DefaultFuchsiaResourceDialect,
4271 0x6584cb93e1978da0,
4272 >(_buf?)?
4273 .into_result::<PuppetMarker>("println")?;
4274 Ok(_response)
4275 }
4276 self.client.send_query_and_decode::<LogPuppetPrintlnRequest, ()>(
4277 (message,),
4278 0x6584cb93e1978da0,
4279 fidl::encoding::DynamicFlags::FLEXIBLE,
4280 _decode,
4281 )
4282 }
4283
4284 type EprintlnResponseFut =
4285 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4286 fn r#eprintln(&self, mut message: &str) -> Self::EprintlnResponseFut {
4287 fn _decode(
4288 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4289 ) -> Result<(), fidl::Error> {
4290 let _response = fidl::client::decode_transaction_body::<
4291 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4292 fidl::encoding::DefaultFuchsiaResourceDialect,
4293 0x770e4524f6b093ef,
4294 >(_buf?)?
4295 .into_result::<PuppetMarker>("eprintln")?;
4296 Ok(_response)
4297 }
4298 self.client.send_query_and_decode::<LogPuppetEprintlnRequest, ()>(
4299 (message,),
4300 0x770e4524f6b093ef,
4301 fidl::encoding::DynamicFlags::FLEXIBLE,
4302 _decode,
4303 )
4304 }
4305
4306 type LogResponseFut =
4307 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
4308 fn r#log(&self, mut payload: &LogPuppetLogRequest) -> Self::LogResponseFut {
4309 fn _decode(
4310 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4311 ) -> Result<(), fidl::Error> {
4312 let _response = fidl::client::decode_transaction_body::<
4313 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
4314 fidl::encoding::DefaultFuchsiaResourceDialect,
4315 0x34d3dd4225e79a8b,
4316 >(_buf?)?
4317 .into_result::<PuppetMarker>("log")?;
4318 Ok(_response)
4319 }
4320 self.client.send_query_and_decode::<LogPuppetLogRequest, ()>(
4321 payload,
4322 0x34d3dd4225e79a8b,
4323 fidl::encoding::DynamicFlags::FLEXIBLE,
4324 _decode,
4325 )
4326 }
4327
4328 type WaitForInterestChangeResponseFut = fidl::client::QueryResponseFut<
4329 LogPuppetWaitForInterestChangeResponse,
4330 fidl::encoding::DefaultFuchsiaResourceDialect,
4331 >;
4332 fn r#wait_for_interest_change(&self) -> Self::WaitForInterestChangeResponseFut {
4333 fn _decode(
4334 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4335 ) -> Result<LogPuppetWaitForInterestChangeResponse, fidl::Error> {
4336 let _response = fidl::client::decode_transaction_body::<
4337 fidl::encoding::FlexibleType<LogPuppetWaitForInterestChangeResponse>,
4338 fidl::encoding::DefaultFuchsiaResourceDialect,
4339 0x3645d3ad544bc546,
4340 >(_buf?)?
4341 .into_result::<PuppetMarker>("wait_for_interest_change")?;
4342 Ok(_response)
4343 }
4344 self.client.send_query_and_decode::<
4345 fidl::encoding::EmptyPayload,
4346 LogPuppetWaitForInterestChangeResponse,
4347 >(
4348 (),
4349 0x3645d3ad544bc546,
4350 fidl::encoding::DynamicFlags::FLEXIBLE,
4351 _decode,
4352 )
4353 }
4354
4355 type RecordLazyValuesResponseFut = fidl::client::QueryResponseFut<
4356 fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
4357 fidl::encoding::DefaultFuchsiaResourceDialect,
4358 >;
4359 fn r#record_lazy_values(&self, mut key: &str) -> Self::RecordLazyValuesResponseFut {
4360 fn _decode(
4361 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4362 ) -> Result<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>, fidl::Error> {
4363 let _response = fidl::client::decode_transaction_body::<
4364 fidl::encoding::FlexibleType<PuppetRecordLazyValuesResponse>,
4365 fidl::encoding::DefaultFuchsiaResourceDialect,
4366 0x339951b623dc9d7d,
4367 >(_buf?)?
4368 .into_result::<PuppetMarker>("record_lazy_values")?;
4369 Ok(_response.client)
4370 }
4371 self.client.send_query_and_decode::<
4372 PuppetRecordLazyValuesRequest,
4373 fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
4374 >(
4375 (key,),
4376 0x339951b623dc9d7d,
4377 fidl::encoding::DynamicFlags::FLEXIBLE,
4378 _decode,
4379 )
4380 }
4381
4382 fn r#crash(&self, mut message: &str) -> Result<(), fidl::Error> {
4383 self.client.send::<PuppetCrashRequest>(
4384 (message,),
4385 0x2aeef488fb79c9db,
4386 fidl::encoding::DynamicFlags::FLEXIBLE,
4387 )
4388 }
4389}
4390
4391pub struct PuppetEventStream {
4392 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4393}
4394
4395impl std::marker::Unpin for PuppetEventStream {}
4396
4397impl futures::stream::FusedStream for PuppetEventStream {
4398 fn is_terminated(&self) -> bool {
4399 self.event_receiver.is_terminated()
4400 }
4401}
4402
4403impl futures::Stream for PuppetEventStream {
4404 type Item = Result<PuppetEvent, fidl::Error>;
4405
4406 fn poll_next(
4407 mut self: std::pin::Pin<&mut Self>,
4408 cx: &mut std::task::Context<'_>,
4409 ) -> std::task::Poll<Option<Self::Item>> {
4410 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4411 &mut self.event_receiver,
4412 cx
4413 )?) {
4414 Some(buf) => std::task::Poll::Ready(Some(PuppetEvent::decode(buf))),
4415 None => std::task::Poll::Ready(None),
4416 }
4417 }
4418}
4419
4420#[derive(Debug)]
4421pub enum PuppetEvent {
4422 #[non_exhaustive]
4423 _UnknownEvent {
4424 ordinal: u64,
4426 },
4427}
4428
4429impl PuppetEvent {
4430 fn decode(
4432 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4433 ) -> Result<PuppetEvent, fidl::Error> {
4434 let (bytes, _handles) = buf.split_mut();
4435 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4436 debug_assert_eq!(tx_header.tx_id, 0);
4437 match tx_header.ordinal {
4438 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4439 Ok(PuppetEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4440 }
4441 _ => Err(fidl::Error::UnknownOrdinal {
4442 ordinal: tx_header.ordinal,
4443 protocol_name: <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4444 }),
4445 }
4446 }
4447}
4448
4449pub struct PuppetRequestStream {
4451 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4452 is_terminated: bool,
4453}
4454
4455impl std::marker::Unpin for PuppetRequestStream {}
4456
4457impl futures::stream::FusedStream for PuppetRequestStream {
4458 fn is_terminated(&self) -> bool {
4459 self.is_terminated
4460 }
4461}
4462
4463impl fidl::endpoints::RequestStream for PuppetRequestStream {
4464 type Protocol = PuppetMarker;
4465 type ControlHandle = PuppetControlHandle;
4466
4467 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4468 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4469 }
4470
4471 fn control_handle(&self) -> Self::ControlHandle {
4472 PuppetControlHandle { inner: self.inner.clone() }
4473 }
4474
4475 fn into_inner(
4476 self,
4477 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4478 {
4479 (self.inner, self.is_terminated)
4480 }
4481
4482 fn from_inner(
4483 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4484 is_terminated: bool,
4485 ) -> Self {
4486 Self { inner, is_terminated }
4487 }
4488}
4489
4490impl futures::Stream for PuppetRequestStream {
4491 type Item = Result<PuppetRequest, fidl::Error>;
4492
4493 fn poll_next(
4494 mut self: std::pin::Pin<&mut Self>,
4495 cx: &mut std::task::Context<'_>,
4496 ) -> std::task::Poll<Option<Self::Item>> {
4497 let this = &mut *self;
4498 if this.inner.check_shutdown(cx) {
4499 this.is_terminated = true;
4500 return std::task::Poll::Ready(None);
4501 }
4502 if this.is_terminated {
4503 panic!("polled PuppetRequestStream after completion");
4504 }
4505 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4506 |bytes, handles| {
4507 match this.inner.channel().read_etc(cx, bytes, handles) {
4508 std::task::Poll::Ready(Ok(())) => {}
4509 std::task::Poll::Pending => return std::task::Poll::Pending,
4510 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4511 this.is_terminated = true;
4512 return std::task::Poll::Ready(None);
4513 }
4514 std::task::Poll::Ready(Err(e)) => {
4515 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4516 e.into(),
4517 ))))
4518 }
4519 }
4520
4521 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4523
4524 std::task::Poll::Ready(Some(match header.ordinal {
4525 0x2c0f807d7d159bb => {
4526 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4527 let mut req = fidl::new_empty!(
4528 InspectPuppetCreateInspectorRequest,
4529 fidl::encoding::DefaultFuchsiaResourceDialect
4530 );
4531 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InspectPuppetCreateInspectorRequest>(&header, _body_bytes, handles, &mut req)?;
4532 let control_handle = PuppetControlHandle { inner: this.inner.clone() };
4533 Ok(PuppetRequest::CreateInspector {
4534 payload: req,
4535 responder: PuppetCreateInspectorResponder {
4536 control_handle: std::mem::ManuallyDrop::new(control_handle),
4537 tx_id: header.tx_id,
4538 },
4539 })
4540 }
4541 0x6584cb93e1978da0 => {
4542 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4543 let mut req = fidl::new_empty!(
4544 LogPuppetPrintlnRequest,
4545 fidl::encoding::DefaultFuchsiaResourceDialect
4546 );
4547 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetPrintlnRequest>(&header, _body_bytes, handles, &mut req)?;
4548 let control_handle = PuppetControlHandle { inner: this.inner.clone() };
4549 Ok(PuppetRequest::Println {
4550 message: req.message,
4551
4552 responder: PuppetPrintlnResponder {
4553 control_handle: std::mem::ManuallyDrop::new(control_handle),
4554 tx_id: header.tx_id,
4555 },
4556 })
4557 }
4558 0x770e4524f6b093ef => {
4559 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4560 let mut req = fidl::new_empty!(
4561 LogPuppetEprintlnRequest,
4562 fidl::encoding::DefaultFuchsiaResourceDialect
4563 );
4564 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetEprintlnRequest>(&header, _body_bytes, handles, &mut req)?;
4565 let control_handle = PuppetControlHandle { inner: this.inner.clone() };
4566 Ok(PuppetRequest::Eprintln {
4567 message: req.message,
4568
4569 responder: PuppetEprintlnResponder {
4570 control_handle: std::mem::ManuallyDrop::new(control_handle),
4571 tx_id: header.tx_id,
4572 },
4573 })
4574 }
4575 0x34d3dd4225e79a8b => {
4576 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4577 let mut req = fidl::new_empty!(
4578 LogPuppetLogRequest,
4579 fidl::encoding::DefaultFuchsiaResourceDialect
4580 );
4581 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogPuppetLogRequest>(&header, _body_bytes, handles, &mut req)?;
4582 let control_handle = PuppetControlHandle { inner: this.inner.clone() };
4583 Ok(PuppetRequest::Log {
4584 payload: req,
4585 responder: PuppetLogResponder {
4586 control_handle: std::mem::ManuallyDrop::new(control_handle),
4587 tx_id: header.tx_id,
4588 },
4589 })
4590 }
4591 0x3645d3ad544bc546 => {
4592 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4593 let mut req = fidl::new_empty!(
4594 fidl::encoding::EmptyPayload,
4595 fidl::encoding::DefaultFuchsiaResourceDialect
4596 );
4597 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4598 let control_handle = PuppetControlHandle { inner: this.inner.clone() };
4599 Ok(PuppetRequest::WaitForInterestChange {
4600 responder: PuppetWaitForInterestChangeResponder {
4601 control_handle: std::mem::ManuallyDrop::new(control_handle),
4602 tx_id: header.tx_id,
4603 },
4604 })
4605 }
4606 0x339951b623dc9d7d => {
4607 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4608 let mut req = fidl::new_empty!(
4609 PuppetRecordLazyValuesRequest,
4610 fidl::encoding::DefaultFuchsiaResourceDialect
4611 );
4612 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PuppetRecordLazyValuesRequest>(&header, _body_bytes, handles, &mut req)?;
4613 let control_handle = PuppetControlHandle { inner: this.inner.clone() };
4614 Ok(PuppetRequest::RecordLazyValues {
4615 key: req.key,
4616
4617 responder: PuppetRecordLazyValuesResponder {
4618 control_handle: std::mem::ManuallyDrop::new(control_handle),
4619 tx_id: header.tx_id,
4620 },
4621 })
4622 }
4623 0x2aeef488fb79c9db => {
4624 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4625 let mut req = fidl::new_empty!(
4626 PuppetCrashRequest,
4627 fidl::encoding::DefaultFuchsiaResourceDialect
4628 );
4629 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PuppetCrashRequest>(&header, _body_bytes, handles, &mut req)?;
4630 let control_handle = PuppetControlHandle { inner: this.inner.clone() };
4631 Ok(PuppetRequest::Crash { message: req.message, control_handle })
4632 }
4633 _ if header.tx_id == 0
4634 && header
4635 .dynamic_flags()
4636 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4637 {
4638 Ok(PuppetRequest::_UnknownMethod {
4639 ordinal: header.ordinal,
4640 control_handle: PuppetControlHandle { inner: this.inner.clone() },
4641 method_type: fidl::MethodType::OneWay,
4642 })
4643 }
4644 _ if header
4645 .dynamic_flags()
4646 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4647 {
4648 this.inner.send_framework_err(
4649 fidl::encoding::FrameworkErr::UnknownMethod,
4650 header.tx_id,
4651 header.ordinal,
4652 header.dynamic_flags(),
4653 (bytes, handles),
4654 )?;
4655 Ok(PuppetRequest::_UnknownMethod {
4656 ordinal: header.ordinal,
4657 control_handle: PuppetControlHandle { inner: this.inner.clone() },
4658 method_type: fidl::MethodType::TwoWay,
4659 })
4660 }
4661 _ => Err(fidl::Error::UnknownOrdinal {
4662 ordinal: header.ordinal,
4663 protocol_name:
4664 <PuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4665 }),
4666 }))
4667 },
4668 )
4669 }
4670}
4671
4672#[derive(Debug)]
4676pub enum PuppetRequest {
4677 CreateInspector {
4680 payload: InspectPuppetCreateInspectorRequest,
4681 responder: PuppetCreateInspectorResponder,
4682 },
4683 Println { message: String, responder: PuppetPrintlnResponder },
4685 Eprintln { message: String, responder: PuppetEprintlnResponder },
4687 Log { payload: LogPuppetLogRequest, responder: PuppetLogResponder },
4689 WaitForInterestChange { responder: PuppetWaitForInterestChangeResponder },
4693 RecordLazyValues { key: String, responder: PuppetRecordLazyValuesResponder },
4695 Crash { message: String, control_handle: PuppetControlHandle },
4699 #[non_exhaustive]
4701 _UnknownMethod {
4702 ordinal: u64,
4704 control_handle: PuppetControlHandle,
4705 method_type: fidl::MethodType,
4706 },
4707}
4708
4709impl PuppetRequest {
4710 #[allow(irrefutable_let_patterns)]
4711 pub fn into_create_inspector(
4712 self,
4713 ) -> Option<(InspectPuppetCreateInspectorRequest, PuppetCreateInspectorResponder)> {
4714 if let PuppetRequest::CreateInspector { payload, responder } = self {
4715 Some((payload, responder))
4716 } else {
4717 None
4718 }
4719 }
4720
4721 #[allow(irrefutable_let_patterns)]
4722 pub fn into_println(self) -> Option<(String, PuppetPrintlnResponder)> {
4723 if let PuppetRequest::Println { message, responder } = self {
4724 Some((message, responder))
4725 } else {
4726 None
4727 }
4728 }
4729
4730 #[allow(irrefutable_let_patterns)]
4731 pub fn into_eprintln(self) -> Option<(String, PuppetEprintlnResponder)> {
4732 if let PuppetRequest::Eprintln { message, responder } = self {
4733 Some((message, responder))
4734 } else {
4735 None
4736 }
4737 }
4738
4739 #[allow(irrefutable_let_patterns)]
4740 pub fn into_log(self) -> Option<(LogPuppetLogRequest, PuppetLogResponder)> {
4741 if let PuppetRequest::Log { payload, responder } = self {
4742 Some((payload, responder))
4743 } else {
4744 None
4745 }
4746 }
4747
4748 #[allow(irrefutable_let_patterns)]
4749 pub fn into_wait_for_interest_change(self) -> Option<(PuppetWaitForInterestChangeResponder)> {
4750 if let PuppetRequest::WaitForInterestChange { responder } = self {
4751 Some((responder))
4752 } else {
4753 None
4754 }
4755 }
4756
4757 #[allow(irrefutable_let_patterns)]
4758 pub fn into_record_lazy_values(self) -> Option<(String, PuppetRecordLazyValuesResponder)> {
4759 if let PuppetRequest::RecordLazyValues { key, responder } = self {
4760 Some((key, responder))
4761 } else {
4762 None
4763 }
4764 }
4765
4766 #[allow(irrefutable_let_patterns)]
4767 pub fn into_crash(self) -> Option<(String, PuppetControlHandle)> {
4768 if let PuppetRequest::Crash { message, control_handle } = self {
4769 Some((message, control_handle))
4770 } else {
4771 None
4772 }
4773 }
4774
4775 pub fn method_name(&self) -> &'static str {
4777 match *self {
4778 PuppetRequest::CreateInspector { .. } => "create_inspector",
4779 PuppetRequest::Println { .. } => "println",
4780 PuppetRequest::Eprintln { .. } => "eprintln",
4781 PuppetRequest::Log { .. } => "log",
4782 PuppetRequest::WaitForInterestChange { .. } => "wait_for_interest_change",
4783 PuppetRequest::RecordLazyValues { .. } => "record_lazy_values",
4784 PuppetRequest::Crash { .. } => "crash",
4785 PuppetRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4786 "unknown one-way method"
4787 }
4788 PuppetRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4789 "unknown two-way method"
4790 }
4791 }
4792 }
4793}
4794
4795#[derive(Debug, Clone)]
4796pub struct PuppetControlHandle {
4797 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4798}
4799
4800impl fidl::endpoints::ControlHandle for PuppetControlHandle {
4801 fn shutdown(&self) {
4802 self.inner.shutdown()
4803 }
4804 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4805 self.inner.shutdown_with_epitaph(status)
4806 }
4807
4808 fn is_closed(&self) -> bool {
4809 self.inner.channel().is_closed()
4810 }
4811 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4812 self.inner.channel().on_closed()
4813 }
4814
4815 #[cfg(target_os = "fuchsia")]
4816 fn signal_peer(
4817 &self,
4818 clear_mask: zx::Signals,
4819 set_mask: zx::Signals,
4820 ) -> Result<(), zx_status::Status> {
4821 use fidl::Peered;
4822 self.inner.channel().signal_peer(clear_mask, set_mask)
4823 }
4824}
4825
4826impl PuppetControlHandle {}
4827
4828#[must_use = "FIDL methods require a response to be sent"]
4829#[derive(Debug)]
4830pub struct PuppetCreateInspectorResponder {
4831 control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
4832 tx_id: u32,
4833}
4834
4835impl std::ops::Drop for PuppetCreateInspectorResponder {
4839 fn drop(&mut self) {
4840 self.control_handle.shutdown();
4841 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4843 }
4844}
4845
4846impl fidl::endpoints::Responder for PuppetCreateInspectorResponder {
4847 type ControlHandle = PuppetControlHandle;
4848
4849 fn control_handle(&self) -> &PuppetControlHandle {
4850 &self.control_handle
4851 }
4852
4853 fn drop_without_shutdown(mut self) {
4854 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4856 std::mem::forget(self);
4858 }
4859}
4860
4861impl PuppetCreateInspectorResponder {
4862 pub fn send(
4866 self,
4867 mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
4868 ) -> Result<(), fidl::Error> {
4869 let _result = self.send_raw(writer);
4870 if _result.is_err() {
4871 self.control_handle.shutdown();
4872 }
4873 self.drop_without_shutdown();
4874 _result
4875 }
4876
4877 pub fn send_no_shutdown_on_err(
4879 self,
4880 mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
4881 ) -> Result<(), fidl::Error> {
4882 let _result = self.send_raw(writer);
4883 self.drop_without_shutdown();
4884 _result
4885 }
4886
4887 fn send_raw(
4888 &self,
4889 mut writer: fidl::endpoints::ClientEnd<InspectWriterMarker>,
4890 ) -> Result<(), fidl::Error> {
4891 self.control_handle
4892 .inner
4893 .send::<fidl::encoding::FlexibleType<InspectPuppetCreateInspectorResponse>>(
4894 fidl::encoding::Flexible::new((writer,)),
4895 self.tx_id,
4896 0x2c0f807d7d159bb,
4897 fidl::encoding::DynamicFlags::FLEXIBLE,
4898 )
4899 }
4900}
4901
4902#[must_use = "FIDL methods require a response to be sent"]
4903#[derive(Debug)]
4904pub struct PuppetPrintlnResponder {
4905 control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
4906 tx_id: u32,
4907}
4908
4909impl std::ops::Drop for PuppetPrintlnResponder {
4913 fn drop(&mut self) {
4914 self.control_handle.shutdown();
4915 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4917 }
4918}
4919
4920impl fidl::endpoints::Responder for PuppetPrintlnResponder {
4921 type ControlHandle = PuppetControlHandle;
4922
4923 fn control_handle(&self) -> &PuppetControlHandle {
4924 &self.control_handle
4925 }
4926
4927 fn drop_without_shutdown(mut self) {
4928 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4930 std::mem::forget(self);
4932 }
4933}
4934
4935impl PuppetPrintlnResponder {
4936 pub fn send(self) -> Result<(), fidl::Error> {
4940 let _result = self.send_raw();
4941 if _result.is_err() {
4942 self.control_handle.shutdown();
4943 }
4944 self.drop_without_shutdown();
4945 _result
4946 }
4947
4948 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
4950 let _result = self.send_raw();
4951 self.drop_without_shutdown();
4952 _result
4953 }
4954
4955 fn send_raw(&self) -> Result<(), fidl::Error> {
4956 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
4957 fidl::encoding::Flexible::new(()),
4958 self.tx_id,
4959 0x6584cb93e1978da0,
4960 fidl::encoding::DynamicFlags::FLEXIBLE,
4961 )
4962 }
4963}
4964
4965#[must_use = "FIDL methods require a response to be sent"]
4966#[derive(Debug)]
4967pub struct PuppetEprintlnResponder {
4968 control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
4969 tx_id: u32,
4970}
4971
4972impl std::ops::Drop for PuppetEprintlnResponder {
4976 fn drop(&mut self) {
4977 self.control_handle.shutdown();
4978 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4980 }
4981}
4982
4983impl fidl::endpoints::Responder for PuppetEprintlnResponder {
4984 type ControlHandle = PuppetControlHandle;
4985
4986 fn control_handle(&self) -> &PuppetControlHandle {
4987 &self.control_handle
4988 }
4989
4990 fn drop_without_shutdown(mut self) {
4991 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4993 std::mem::forget(self);
4995 }
4996}
4997
4998impl PuppetEprintlnResponder {
4999 pub fn send(self) -> Result<(), fidl::Error> {
5003 let _result = self.send_raw();
5004 if _result.is_err() {
5005 self.control_handle.shutdown();
5006 }
5007 self.drop_without_shutdown();
5008 _result
5009 }
5010
5011 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5013 let _result = self.send_raw();
5014 self.drop_without_shutdown();
5015 _result
5016 }
5017
5018 fn send_raw(&self) -> Result<(), fidl::Error> {
5019 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
5020 fidl::encoding::Flexible::new(()),
5021 self.tx_id,
5022 0x770e4524f6b093ef,
5023 fidl::encoding::DynamicFlags::FLEXIBLE,
5024 )
5025 }
5026}
5027
5028#[must_use = "FIDL methods require a response to be sent"]
5029#[derive(Debug)]
5030pub struct PuppetLogResponder {
5031 control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
5032 tx_id: u32,
5033}
5034
5035impl std::ops::Drop for PuppetLogResponder {
5039 fn drop(&mut self) {
5040 self.control_handle.shutdown();
5041 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5043 }
5044}
5045
5046impl fidl::endpoints::Responder for PuppetLogResponder {
5047 type ControlHandle = PuppetControlHandle;
5048
5049 fn control_handle(&self) -> &PuppetControlHandle {
5050 &self.control_handle
5051 }
5052
5053 fn drop_without_shutdown(mut self) {
5054 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5056 std::mem::forget(self);
5058 }
5059}
5060
5061impl PuppetLogResponder {
5062 pub fn send(self) -> Result<(), fidl::Error> {
5066 let _result = self.send_raw();
5067 if _result.is_err() {
5068 self.control_handle.shutdown();
5069 }
5070 self.drop_without_shutdown();
5071 _result
5072 }
5073
5074 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
5076 let _result = self.send_raw();
5077 self.drop_without_shutdown();
5078 _result
5079 }
5080
5081 fn send_raw(&self) -> Result<(), fidl::Error> {
5082 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
5083 fidl::encoding::Flexible::new(()),
5084 self.tx_id,
5085 0x34d3dd4225e79a8b,
5086 fidl::encoding::DynamicFlags::FLEXIBLE,
5087 )
5088 }
5089}
5090
5091#[must_use = "FIDL methods require a response to be sent"]
5092#[derive(Debug)]
5093pub struct PuppetWaitForInterestChangeResponder {
5094 control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
5095 tx_id: u32,
5096}
5097
5098impl std::ops::Drop for PuppetWaitForInterestChangeResponder {
5102 fn drop(&mut self) {
5103 self.control_handle.shutdown();
5104 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5106 }
5107}
5108
5109impl fidl::endpoints::Responder for PuppetWaitForInterestChangeResponder {
5110 type ControlHandle = PuppetControlHandle;
5111
5112 fn control_handle(&self) -> &PuppetControlHandle {
5113 &self.control_handle
5114 }
5115
5116 fn drop_without_shutdown(mut self) {
5117 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5119 std::mem::forget(self);
5121 }
5122}
5123
5124impl PuppetWaitForInterestChangeResponder {
5125 pub fn send(
5129 self,
5130 mut payload: &LogPuppetWaitForInterestChangeResponse,
5131 ) -> Result<(), fidl::Error> {
5132 let _result = self.send_raw(payload);
5133 if _result.is_err() {
5134 self.control_handle.shutdown();
5135 }
5136 self.drop_without_shutdown();
5137 _result
5138 }
5139
5140 pub fn send_no_shutdown_on_err(
5142 self,
5143 mut payload: &LogPuppetWaitForInterestChangeResponse,
5144 ) -> Result<(), fidl::Error> {
5145 let _result = self.send_raw(payload);
5146 self.drop_without_shutdown();
5147 _result
5148 }
5149
5150 fn send_raw(
5151 &self,
5152 mut payload: &LogPuppetWaitForInterestChangeResponse,
5153 ) -> Result<(), fidl::Error> {
5154 self.control_handle.inner.send::<fidl::encoding::FlexibleType<
5155 LogPuppetWaitForInterestChangeResponse,
5156 >>(
5157 fidl::encoding::Flexible::new(payload),
5158 self.tx_id,
5159 0x3645d3ad544bc546,
5160 fidl::encoding::DynamicFlags::FLEXIBLE,
5161 )
5162 }
5163}
5164
5165#[must_use = "FIDL methods require a response to be sent"]
5166#[derive(Debug)]
5167pub struct PuppetRecordLazyValuesResponder {
5168 control_handle: std::mem::ManuallyDrop<PuppetControlHandle>,
5169 tx_id: u32,
5170}
5171
5172impl std::ops::Drop for PuppetRecordLazyValuesResponder {
5176 fn drop(&mut self) {
5177 self.control_handle.shutdown();
5178 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5180 }
5181}
5182
5183impl fidl::endpoints::Responder for PuppetRecordLazyValuesResponder {
5184 type ControlHandle = PuppetControlHandle;
5185
5186 fn control_handle(&self) -> &PuppetControlHandle {
5187 &self.control_handle
5188 }
5189
5190 fn drop_without_shutdown(mut self) {
5191 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5193 std::mem::forget(self);
5195 }
5196}
5197
5198impl PuppetRecordLazyValuesResponder {
5199 pub fn send(
5203 self,
5204 mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
5205 ) -> Result<(), fidl::Error> {
5206 let _result = self.send_raw(client);
5207 if _result.is_err() {
5208 self.control_handle.shutdown();
5209 }
5210 self.drop_without_shutdown();
5211 _result
5212 }
5213
5214 pub fn send_no_shutdown_on_err(
5216 self,
5217 mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
5218 ) -> Result<(), fidl::Error> {
5219 let _result = self.send_raw(client);
5220 self.drop_without_shutdown();
5221 _result
5222 }
5223
5224 fn send_raw(
5225 &self,
5226 mut client: fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>,
5227 ) -> Result<(), fidl::Error> {
5228 self.control_handle
5229 .inner
5230 .send::<fidl::encoding::FlexibleType<PuppetRecordLazyValuesResponse>>(
5231 fidl::encoding::Flexible::new((client,)),
5232 self.tx_id,
5233 0x339951b623dc9d7d,
5234 fidl::encoding::DynamicFlags::FLEXIBLE,
5235 )
5236 }
5237}
5238
5239#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5240pub struct RealmFactoryMarker;
5241
5242impl fidl::endpoints::ProtocolMarker for RealmFactoryMarker {
5243 type Proxy = RealmFactoryProxy;
5244 type RequestStream = RealmFactoryRequestStream;
5245 #[cfg(target_os = "fuchsia")]
5246 type SynchronousProxy = RealmFactorySynchronousProxy;
5247
5248 const DEBUG_NAME: &'static str = "fuchsia.archivist.test.RealmFactory";
5249}
5250impl fidl::endpoints::DiscoverableProtocolMarker for RealmFactoryMarker {}
5251pub type RealmFactoryCreateRealmResult = Result<(), fidl_fuchsia_testing_harness::OperationError>;
5252
5253pub trait RealmFactoryProxyInterface: Send + Sync {
5254 type CreateRealmResponseFut: std::future::Future<Output = Result<RealmFactoryCreateRealmResult, fidl::Error>>
5255 + Send;
5256 fn r#create_realm(
5257 &self,
5258 options: &RealmOptions,
5259 realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
5260 ) -> Self::CreateRealmResponseFut;
5261}
5262#[derive(Debug)]
5263#[cfg(target_os = "fuchsia")]
5264pub struct RealmFactorySynchronousProxy {
5265 client: fidl::client::sync::Client,
5266}
5267
5268#[cfg(target_os = "fuchsia")]
5269impl fidl::endpoints::SynchronousProxy for RealmFactorySynchronousProxy {
5270 type Proxy = RealmFactoryProxy;
5271 type Protocol = RealmFactoryMarker;
5272
5273 fn from_channel(inner: fidl::Channel) -> Self {
5274 Self::new(inner)
5275 }
5276
5277 fn into_channel(self) -> fidl::Channel {
5278 self.client.into_channel()
5279 }
5280
5281 fn as_channel(&self) -> &fidl::Channel {
5282 self.client.as_channel()
5283 }
5284}
5285
5286#[cfg(target_os = "fuchsia")]
5287impl RealmFactorySynchronousProxy {
5288 pub fn new(channel: fidl::Channel) -> Self {
5289 let protocol_name = <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5290 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5291 }
5292
5293 pub fn into_channel(self) -> fidl::Channel {
5294 self.client.into_channel()
5295 }
5296
5297 pub fn wait_for_event(
5300 &self,
5301 deadline: zx::MonotonicInstant,
5302 ) -> Result<RealmFactoryEvent, fidl::Error> {
5303 RealmFactoryEvent::decode(self.client.wait_for_event(deadline)?)
5304 }
5305
5306 pub fn r#create_realm(
5310 &self,
5311 mut options: &RealmOptions,
5312 mut realm_server: fidl::endpoints::ServerEnd<
5313 fidl_fuchsia_testing_harness::RealmProxy_Marker,
5314 >,
5315 ___deadline: zx::MonotonicInstant,
5316 ) -> Result<RealmFactoryCreateRealmResult, fidl::Error> {
5317 let _response = self
5318 .client
5319 .send_query::<RealmFactoryCreateRealmRequest, fidl::encoding::FlexibleResultType<
5320 fidl::encoding::EmptyStruct,
5321 fidl_fuchsia_testing_harness::OperationError,
5322 >>(
5323 (options, realm_server),
5324 0x176832ac7263ab99,
5325 fidl::encoding::DynamicFlags::FLEXIBLE,
5326 ___deadline,
5327 )?
5328 .into_result::<RealmFactoryMarker>("create_realm")?;
5329 Ok(_response.map(|x| x))
5330 }
5331}
5332
5333#[cfg(target_os = "fuchsia")]
5334impl From<RealmFactorySynchronousProxy> for zx::Handle {
5335 fn from(value: RealmFactorySynchronousProxy) -> Self {
5336 value.into_channel().into()
5337 }
5338}
5339
5340#[cfg(target_os = "fuchsia")]
5341impl From<fidl::Channel> for RealmFactorySynchronousProxy {
5342 fn from(value: fidl::Channel) -> Self {
5343 Self::new(value)
5344 }
5345}
5346
5347#[derive(Debug, Clone)]
5348pub struct RealmFactoryProxy {
5349 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5350}
5351
5352impl fidl::endpoints::Proxy for RealmFactoryProxy {
5353 type Protocol = RealmFactoryMarker;
5354
5355 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5356 Self::new(inner)
5357 }
5358
5359 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5360 self.client.into_channel().map_err(|client| Self { client })
5361 }
5362
5363 fn as_channel(&self) -> &::fidl::AsyncChannel {
5364 self.client.as_channel()
5365 }
5366}
5367
5368impl RealmFactoryProxy {
5369 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5371 let protocol_name = <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5372 Self { client: fidl::client::Client::new(channel, protocol_name) }
5373 }
5374
5375 pub fn take_event_stream(&self) -> RealmFactoryEventStream {
5381 RealmFactoryEventStream { event_receiver: self.client.take_event_receiver() }
5382 }
5383
5384 pub fn r#create_realm(
5388 &self,
5389 mut options: &RealmOptions,
5390 mut realm_server: fidl::endpoints::ServerEnd<
5391 fidl_fuchsia_testing_harness::RealmProxy_Marker,
5392 >,
5393 ) -> fidl::client::QueryResponseFut<
5394 RealmFactoryCreateRealmResult,
5395 fidl::encoding::DefaultFuchsiaResourceDialect,
5396 > {
5397 RealmFactoryProxyInterface::r#create_realm(self, options, realm_server)
5398 }
5399}
5400
5401impl RealmFactoryProxyInterface for RealmFactoryProxy {
5402 type CreateRealmResponseFut = fidl::client::QueryResponseFut<
5403 RealmFactoryCreateRealmResult,
5404 fidl::encoding::DefaultFuchsiaResourceDialect,
5405 >;
5406 fn r#create_realm(
5407 &self,
5408 mut options: &RealmOptions,
5409 mut realm_server: fidl::endpoints::ServerEnd<
5410 fidl_fuchsia_testing_harness::RealmProxy_Marker,
5411 >,
5412 ) -> Self::CreateRealmResponseFut {
5413 fn _decode(
5414 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5415 ) -> Result<RealmFactoryCreateRealmResult, fidl::Error> {
5416 let _response = fidl::client::decode_transaction_body::<
5417 fidl::encoding::FlexibleResultType<
5418 fidl::encoding::EmptyStruct,
5419 fidl_fuchsia_testing_harness::OperationError,
5420 >,
5421 fidl::encoding::DefaultFuchsiaResourceDialect,
5422 0x176832ac7263ab99,
5423 >(_buf?)?
5424 .into_result::<RealmFactoryMarker>("create_realm")?;
5425 Ok(_response.map(|x| x))
5426 }
5427 self.client
5428 .send_query_and_decode::<RealmFactoryCreateRealmRequest, RealmFactoryCreateRealmResult>(
5429 (options, realm_server),
5430 0x176832ac7263ab99,
5431 fidl::encoding::DynamicFlags::FLEXIBLE,
5432 _decode,
5433 )
5434 }
5435}
5436
5437pub struct RealmFactoryEventStream {
5438 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5439}
5440
5441impl std::marker::Unpin for RealmFactoryEventStream {}
5442
5443impl futures::stream::FusedStream for RealmFactoryEventStream {
5444 fn is_terminated(&self) -> bool {
5445 self.event_receiver.is_terminated()
5446 }
5447}
5448
5449impl futures::Stream for RealmFactoryEventStream {
5450 type Item = Result<RealmFactoryEvent, fidl::Error>;
5451
5452 fn poll_next(
5453 mut self: std::pin::Pin<&mut Self>,
5454 cx: &mut std::task::Context<'_>,
5455 ) -> std::task::Poll<Option<Self::Item>> {
5456 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5457 &mut self.event_receiver,
5458 cx
5459 )?) {
5460 Some(buf) => std::task::Poll::Ready(Some(RealmFactoryEvent::decode(buf))),
5461 None => std::task::Poll::Ready(None),
5462 }
5463 }
5464}
5465
5466#[derive(Debug)]
5467pub enum RealmFactoryEvent {
5468 #[non_exhaustive]
5469 _UnknownEvent {
5470 ordinal: u64,
5472 },
5473}
5474
5475impl RealmFactoryEvent {
5476 fn decode(
5478 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5479 ) -> Result<RealmFactoryEvent, fidl::Error> {
5480 let (bytes, _handles) = buf.split_mut();
5481 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5482 debug_assert_eq!(tx_header.tx_id, 0);
5483 match tx_header.ordinal {
5484 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5485 Ok(RealmFactoryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5486 }
5487 _ => Err(fidl::Error::UnknownOrdinal {
5488 ordinal: tx_header.ordinal,
5489 protocol_name: <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5490 }),
5491 }
5492 }
5493}
5494
5495pub struct RealmFactoryRequestStream {
5497 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5498 is_terminated: bool,
5499}
5500
5501impl std::marker::Unpin for RealmFactoryRequestStream {}
5502
5503impl futures::stream::FusedStream for RealmFactoryRequestStream {
5504 fn is_terminated(&self) -> bool {
5505 self.is_terminated
5506 }
5507}
5508
5509impl fidl::endpoints::RequestStream for RealmFactoryRequestStream {
5510 type Protocol = RealmFactoryMarker;
5511 type ControlHandle = RealmFactoryControlHandle;
5512
5513 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5514 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5515 }
5516
5517 fn control_handle(&self) -> Self::ControlHandle {
5518 RealmFactoryControlHandle { inner: self.inner.clone() }
5519 }
5520
5521 fn into_inner(
5522 self,
5523 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5524 {
5525 (self.inner, self.is_terminated)
5526 }
5527
5528 fn from_inner(
5529 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5530 is_terminated: bool,
5531 ) -> Self {
5532 Self { inner, is_terminated }
5533 }
5534}
5535
5536impl futures::Stream for RealmFactoryRequestStream {
5537 type Item = Result<RealmFactoryRequest, fidl::Error>;
5538
5539 fn poll_next(
5540 mut self: std::pin::Pin<&mut Self>,
5541 cx: &mut std::task::Context<'_>,
5542 ) -> std::task::Poll<Option<Self::Item>> {
5543 let this = &mut *self;
5544 if this.inner.check_shutdown(cx) {
5545 this.is_terminated = true;
5546 return std::task::Poll::Ready(None);
5547 }
5548 if this.is_terminated {
5549 panic!("polled RealmFactoryRequestStream after completion");
5550 }
5551 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5552 |bytes, handles| {
5553 match this.inner.channel().read_etc(cx, bytes, handles) {
5554 std::task::Poll::Ready(Ok(())) => {}
5555 std::task::Poll::Pending => return std::task::Poll::Pending,
5556 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5557 this.is_terminated = true;
5558 return std::task::Poll::Ready(None);
5559 }
5560 std::task::Poll::Ready(Err(e)) => {
5561 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5562 e.into(),
5563 ))))
5564 }
5565 }
5566
5567 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5569
5570 std::task::Poll::Ready(Some(match header.ordinal {
5571 0x176832ac7263ab99 => {
5572 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5573 let mut req = fidl::new_empty!(
5574 RealmFactoryCreateRealmRequest,
5575 fidl::encoding::DefaultFuchsiaResourceDialect
5576 );
5577 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmFactoryCreateRealmRequest>(&header, _body_bytes, handles, &mut req)?;
5578 let control_handle =
5579 RealmFactoryControlHandle { inner: this.inner.clone() };
5580 Ok(RealmFactoryRequest::CreateRealm {
5581 options: req.options,
5582 realm_server: req.realm_server,
5583
5584 responder: RealmFactoryCreateRealmResponder {
5585 control_handle: std::mem::ManuallyDrop::new(control_handle),
5586 tx_id: header.tx_id,
5587 },
5588 })
5589 }
5590 _ if header.tx_id == 0
5591 && header
5592 .dynamic_flags()
5593 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5594 {
5595 Ok(RealmFactoryRequest::_UnknownMethod {
5596 ordinal: header.ordinal,
5597 control_handle: RealmFactoryControlHandle { inner: this.inner.clone() },
5598 method_type: fidl::MethodType::OneWay,
5599 })
5600 }
5601 _ if header
5602 .dynamic_flags()
5603 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5604 {
5605 this.inner.send_framework_err(
5606 fidl::encoding::FrameworkErr::UnknownMethod,
5607 header.tx_id,
5608 header.ordinal,
5609 header.dynamic_flags(),
5610 (bytes, handles),
5611 )?;
5612 Ok(RealmFactoryRequest::_UnknownMethod {
5613 ordinal: header.ordinal,
5614 control_handle: RealmFactoryControlHandle { inner: this.inner.clone() },
5615 method_type: fidl::MethodType::TwoWay,
5616 })
5617 }
5618 _ => Err(fidl::Error::UnknownOrdinal {
5619 ordinal: header.ordinal,
5620 protocol_name:
5621 <RealmFactoryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5622 }),
5623 }))
5624 },
5625 )
5626 }
5627}
5628
5629#[derive(Debug)]
5636pub enum RealmFactoryRequest {
5637 CreateRealm {
5641 options: RealmOptions,
5642 realm_server: fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
5643 responder: RealmFactoryCreateRealmResponder,
5644 },
5645 #[non_exhaustive]
5647 _UnknownMethod {
5648 ordinal: u64,
5650 control_handle: RealmFactoryControlHandle,
5651 method_type: fidl::MethodType,
5652 },
5653}
5654
5655impl RealmFactoryRequest {
5656 #[allow(irrefutable_let_patterns)]
5657 pub fn into_create_realm(
5658 self,
5659 ) -> Option<(
5660 RealmOptions,
5661 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
5662 RealmFactoryCreateRealmResponder,
5663 )> {
5664 if let RealmFactoryRequest::CreateRealm { options, realm_server, responder } = self {
5665 Some((options, realm_server, responder))
5666 } else {
5667 None
5668 }
5669 }
5670
5671 pub fn method_name(&self) -> &'static str {
5673 match *self {
5674 RealmFactoryRequest::CreateRealm { .. } => "create_realm",
5675 RealmFactoryRequest::_UnknownMethod {
5676 method_type: fidl::MethodType::OneWay, ..
5677 } => "unknown one-way method",
5678 RealmFactoryRequest::_UnknownMethod {
5679 method_type: fidl::MethodType::TwoWay, ..
5680 } => "unknown two-way method",
5681 }
5682 }
5683}
5684
5685#[derive(Debug, Clone)]
5686pub struct RealmFactoryControlHandle {
5687 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5688}
5689
5690impl fidl::endpoints::ControlHandle for RealmFactoryControlHandle {
5691 fn shutdown(&self) {
5692 self.inner.shutdown()
5693 }
5694 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5695 self.inner.shutdown_with_epitaph(status)
5696 }
5697
5698 fn is_closed(&self) -> bool {
5699 self.inner.channel().is_closed()
5700 }
5701 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5702 self.inner.channel().on_closed()
5703 }
5704
5705 #[cfg(target_os = "fuchsia")]
5706 fn signal_peer(
5707 &self,
5708 clear_mask: zx::Signals,
5709 set_mask: zx::Signals,
5710 ) -> Result<(), zx_status::Status> {
5711 use fidl::Peered;
5712 self.inner.channel().signal_peer(clear_mask, set_mask)
5713 }
5714}
5715
5716impl RealmFactoryControlHandle {}
5717
5718#[must_use = "FIDL methods require a response to be sent"]
5719#[derive(Debug)]
5720pub struct RealmFactoryCreateRealmResponder {
5721 control_handle: std::mem::ManuallyDrop<RealmFactoryControlHandle>,
5722 tx_id: u32,
5723}
5724
5725impl std::ops::Drop for RealmFactoryCreateRealmResponder {
5729 fn drop(&mut self) {
5730 self.control_handle.shutdown();
5731 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5733 }
5734}
5735
5736impl fidl::endpoints::Responder for RealmFactoryCreateRealmResponder {
5737 type ControlHandle = RealmFactoryControlHandle;
5738
5739 fn control_handle(&self) -> &RealmFactoryControlHandle {
5740 &self.control_handle
5741 }
5742
5743 fn drop_without_shutdown(mut self) {
5744 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5746 std::mem::forget(self);
5748 }
5749}
5750
5751impl RealmFactoryCreateRealmResponder {
5752 pub fn send(
5756 self,
5757 mut result: Result<(), fidl_fuchsia_testing_harness::OperationError>,
5758 ) -> Result<(), fidl::Error> {
5759 let _result = self.send_raw(result);
5760 if _result.is_err() {
5761 self.control_handle.shutdown();
5762 }
5763 self.drop_without_shutdown();
5764 _result
5765 }
5766
5767 pub fn send_no_shutdown_on_err(
5769 self,
5770 mut result: Result<(), fidl_fuchsia_testing_harness::OperationError>,
5771 ) -> Result<(), fidl::Error> {
5772 let _result = self.send_raw(result);
5773 self.drop_without_shutdown();
5774 _result
5775 }
5776
5777 fn send_raw(
5778 &self,
5779 mut result: Result<(), fidl_fuchsia_testing_harness::OperationError>,
5780 ) -> Result<(), fidl::Error> {
5781 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5782 fidl::encoding::EmptyStruct,
5783 fidl_fuchsia_testing_harness::OperationError,
5784 >>(
5785 fidl::encoding::FlexibleResult::new(result),
5786 self.tx_id,
5787 0x176832ac7263ab99,
5788 fidl::encoding::DynamicFlags::FLEXIBLE,
5789 )
5790 }
5791}
5792
5793#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5794pub struct StopWaiterMarker;
5795
5796impl fidl::endpoints::ProtocolMarker for StopWaiterMarker {
5797 type Proxy = StopWaiterProxy;
5798 type RequestStream = StopWaiterRequestStream;
5799 #[cfg(target_os = "fuchsia")]
5800 type SynchronousProxy = StopWaiterSynchronousProxy;
5801
5802 const DEBUG_NAME: &'static str = "(anonymous) StopWaiter";
5803}
5804
5805pub trait StopWaiterProxyInterface: Send + Sync {
5806 type WaitResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
5807 fn r#wait(&self) -> Self::WaitResponseFut;
5808}
5809#[derive(Debug)]
5810#[cfg(target_os = "fuchsia")]
5811pub struct StopWaiterSynchronousProxy {
5812 client: fidl::client::sync::Client,
5813}
5814
5815#[cfg(target_os = "fuchsia")]
5816impl fidl::endpoints::SynchronousProxy for StopWaiterSynchronousProxy {
5817 type Proxy = StopWaiterProxy;
5818 type Protocol = StopWaiterMarker;
5819
5820 fn from_channel(inner: fidl::Channel) -> Self {
5821 Self::new(inner)
5822 }
5823
5824 fn into_channel(self) -> fidl::Channel {
5825 self.client.into_channel()
5826 }
5827
5828 fn as_channel(&self) -> &fidl::Channel {
5829 self.client.as_channel()
5830 }
5831}
5832
5833#[cfg(target_os = "fuchsia")]
5834impl StopWaiterSynchronousProxy {
5835 pub fn new(channel: fidl::Channel) -> Self {
5836 let protocol_name = <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5837 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5838 }
5839
5840 pub fn into_channel(self) -> fidl::Channel {
5841 self.client.into_channel()
5842 }
5843
5844 pub fn wait_for_event(
5847 &self,
5848 deadline: zx::MonotonicInstant,
5849 ) -> Result<StopWaiterEvent, fidl::Error> {
5850 StopWaiterEvent::decode(self.client.wait_for_event(deadline)?)
5851 }
5852
5853 pub fn r#wait(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
5856 let _response = self.client.send_query::<
5857 fidl::encoding::EmptyPayload,
5858 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
5859 >(
5860 (),
5861 0x12d62812fe8aa263,
5862 fidl::encoding::DynamicFlags::FLEXIBLE,
5863 ___deadline,
5864 )?
5865 .into_result::<StopWaiterMarker>("wait")?;
5866 Ok(_response)
5867 }
5868}
5869
5870#[cfg(target_os = "fuchsia")]
5871impl From<StopWaiterSynchronousProxy> for zx::Handle {
5872 fn from(value: StopWaiterSynchronousProxy) -> Self {
5873 value.into_channel().into()
5874 }
5875}
5876
5877#[cfg(target_os = "fuchsia")]
5878impl From<fidl::Channel> for StopWaiterSynchronousProxy {
5879 fn from(value: fidl::Channel) -> Self {
5880 Self::new(value)
5881 }
5882}
5883
5884#[derive(Debug, Clone)]
5885pub struct StopWaiterProxy {
5886 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5887}
5888
5889impl fidl::endpoints::Proxy for StopWaiterProxy {
5890 type Protocol = StopWaiterMarker;
5891
5892 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5893 Self::new(inner)
5894 }
5895
5896 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5897 self.client.into_channel().map_err(|client| Self { client })
5898 }
5899
5900 fn as_channel(&self) -> &::fidl::AsyncChannel {
5901 self.client.as_channel()
5902 }
5903}
5904
5905impl StopWaiterProxy {
5906 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5908 let protocol_name = <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5909 Self { client: fidl::client::Client::new(channel, protocol_name) }
5910 }
5911
5912 pub fn take_event_stream(&self) -> StopWaiterEventStream {
5918 StopWaiterEventStream { event_receiver: self.client.take_event_receiver() }
5919 }
5920
5921 pub fn r#wait(
5924 &self,
5925 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
5926 StopWaiterProxyInterface::r#wait(self)
5927 }
5928}
5929
5930impl StopWaiterProxyInterface for StopWaiterProxy {
5931 type WaitResponseFut =
5932 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
5933 fn r#wait(&self) -> Self::WaitResponseFut {
5934 fn _decode(
5935 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5936 ) -> Result<(), fidl::Error> {
5937 let _response = fidl::client::decode_transaction_body::<
5938 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
5939 fidl::encoding::DefaultFuchsiaResourceDialect,
5940 0x12d62812fe8aa263,
5941 >(_buf?)?
5942 .into_result::<StopWaiterMarker>("wait")?;
5943 Ok(_response)
5944 }
5945 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
5946 (),
5947 0x12d62812fe8aa263,
5948 fidl::encoding::DynamicFlags::FLEXIBLE,
5949 _decode,
5950 )
5951 }
5952}
5953
5954pub struct StopWaiterEventStream {
5955 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5956}
5957
5958impl std::marker::Unpin for StopWaiterEventStream {}
5959
5960impl futures::stream::FusedStream for StopWaiterEventStream {
5961 fn is_terminated(&self) -> bool {
5962 self.event_receiver.is_terminated()
5963 }
5964}
5965
5966impl futures::Stream for StopWaiterEventStream {
5967 type Item = Result<StopWaiterEvent, fidl::Error>;
5968
5969 fn poll_next(
5970 mut self: std::pin::Pin<&mut Self>,
5971 cx: &mut std::task::Context<'_>,
5972 ) -> std::task::Poll<Option<Self::Item>> {
5973 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5974 &mut self.event_receiver,
5975 cx
5976 )?) {
5977 Some(buf) => std::task::Poll::Ready(Some(StopWaiterEvent::decode(buf))),
5978 None => std::task::Poll::Ready(None),
5979 }
5980 }
5981}
5982
5983#[derive(Debug)]
5984pub enum StopWaiterEvent {
5985 #[non_exhaustive]
5986 _UnknownEvent {
5987 ordinal: u64,
5989 },
5990}
5991
5992impl StopWaiterEvent {
5993 fn decode(
5995 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5996 ) -> Result<StopWaiterEvent, fidl::Error> {
5997 let (bytes, _handles) = buf.split_mut();
5998 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5999 debug_assert_eq!(tx_header.tx_id, 0);
6000 match tx_header.ordinal {
6001 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6002 Ok(StopWaiterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6003 }
6004 _ => Err(fidl::Error::UnknownOrdinal {
6005 ordinal: tx_header.ordinal,
6006 protocol_name: <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6007 }),
6008 }
6009 }
6010}
6011
6012pub struct StopWaiterRequestStream {
6014 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6015 is_terminated: bool,
6016}
6017
6018impl std::marker::Unpin for StopWaiterRequestStream {}
6019
6020impl futures::stream::FusedStream for StopWaiterRequestStream {
6021 fn is_terminated(&self) -> bool {
6022 self.is_terminated
6023 }
6024}
6025
6026impl fidl::endpoints::RequestStream for StopWaiterRequestStream {
6027 type Protocol = StopWaiterMarker;
6028 type ControlHandle = StopWaiterControlHandle;
6029
6030 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6031 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6032 }
6033
6034 fn control_handle(&self) -> Self::ControlHandle {
6035 StopWaiterControlHandle { inner: self.inner.clone() }
6036 }
6037
6038 fn into_inner(
6039 self,
6040 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6041 {
6042 (self.inner, self.is_terminated)
6043 }
6044
6045 fn from_inner(
6046 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6047 is_terminated: bool,
6048 ) -> Self {
6049 Self { inner, is_terminated }
6050 }
6051}
6052
6053impl futures::Stream for StopWaiterRequestStream {
6054 type Item = Result<StopWaiterRequest, fidl::Error>;
6055
6056 fn poll_next(
6057 mut self: std::pin::Pin<&mut Self>,
6058 cx: &mut std::task::Context<'_>,
6059 ) -> std::task::Poll<Option<Self::Item>> {
6060 let this = &mut *self;
6061 if this.inner.check_shutdown(cx) {
6062 this.is_terminated = true;
6063 return std::task::Poll::Ready(None);
6064 }
6065 if this.is_terminated {
6066 panic!("polled StopWaiterRequestStream after completion");
6067 }
6068 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6069 |bytes, handles| {
6070 match this.inner.channel().read_etc(cx, bytes, handles) {
6071 std::task::Poll::Ready(Ok(())) => {}
6072 std::task::Poll::Pending => return std::task::Poll::Pending,
6073 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6074 this.is_terminated = true;
6075 return std::task::Poll::Ready(None);
6076 }
6077 std::task::Poll::Ready(Err(e)) => {
6078 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6079 e.into(),
6080 ))))
6081 }
6082 }
6083
6084 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6086
6087 std::task::Poll::Ready(Some(match header.ordinal {
6088 0x12d62812fe8aa263 => {
6089 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6090 let mut req = fidl::new_empty!(
6091 fidl::encoding::EmptyPayload,
6092 fidl::encoding::DefaultFuchsiaResourceDialect
6093 );
6094 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6095 let control_handle = StopWaiterControlHandle { inner: this.inner.clone() };
6096 Ok(StopWaiterRequest::Wait {
6097 responder: StopWaiterWaitResponder {
6098 control_handle: std::mem::ManuallyDrop::new(control_handle),
6099 tx_id: header.tx_id,
6100 },
6101 })
6102 }
6103 _ if header.tx_id == 0
6104 && header
6105 .dynamic_flags()
6106 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6107 {
6108 Ok(StopWaiterRequest::_UnknownMethod {
6109 ordinal: header.ordinal,
6110 control_handle: StopWaiterControlHandle { inner: this.inner.clone() },
6111 method_type: fidl::MethodType::OneWay,
6112 })
6113 }
6114 _ if header
6115 .dynamic_flags()
6116 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6117 {
6118 this.inner.send_framework_err(
6119 fidl::encoding::FrameworkErr::UnknownMethod,
6120 header.tx_id,
6121 header.ordinal,
6122 header.dynamic_flags(),
6123 (bytes, handles),
6124 )?;
6125 Ok(StopWaiterRequest::_UnknownMethod {
6126 ordinal: header.ordinal,
6127 control_handle: StopWaiterControlHandle { inner: this.inner.clone() },
6128 method_type: fidl::MethodType::TwoWay,
6129 })
6130 }
6131 _ => Err(fidl::Error::UnknownOrdinal {
6132 ordinal: header.ordinal,
6133 protocol_name:
6134 <StopWaiterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6135 }),
6136 }))
6137 },
6138 )
6139 }
6140}
6141
6142#[derive(Debug)]
6144pub enum StopWaiterRequest {
6145 Wait { responder: StopWaiterWaitResponder },
6148 #[non_exhaustive]
6150 _UnknownMethod {
6151 ordinal: u64,
6153 control_handle: StopWaiterControlHandle,
6154 method_type: fidl::MethodType,
6155 },
6156}
6157
6158impl StopWaiterRequest {
6159 #[allow(irrefutable_let_patterns)]
6160 pub fn into_wait(self) -> Option<(StopWaiterWaitResponder)> {
6161 if let StopWaiterRequest::Wait { responder } = self {
6162 Some((responder))
6163 } else {
6164 None
6165 }
6166 }
6167
6168 pub fn method_name(&self) -> &'static str {
6170 match *self {
6171 StopWaiterRequest::Wait { .. } => "wait",
6172 StopWaiterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
6173 "unknown one-way method"
6174 }
6175 StopWaiterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
6176 "unknown two-way method"
6177 }
6178 }
6179 }
6180}
6181
6182#[derive(Debug, Clone)]
6183pub struct StopWaiterControlHandle {
6184 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6185}
6186
6187impl fidl::endpoints::ControlHandle for StopWaiterControlHandle {
6188 fn shutdown(&self) {
6189 self.inner.shutdown()
6190 }
6191 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6192 self.inner.shutdown_with_epitaph(status)
6193 }
6194
6195 fn is_closed(&self) -> bool {
6196 self.inner.channel().is_closed()
6197 }
6198 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6199 self.inner.channel().on_closed()
6200 }
6201
6202 #[cfg(target_os = "fuchsia")]
6203 fn signal_peer(
6204 &self,
6205 clear_mask: zx::Signals,
6206 set_mask: zx::Signals,
6207 ) -> Result<(), zx_status::Status> {
6208 use fidl::Peered;
6209 self.inner.channel().signal_peer(clear_mask, set_mask)
6210 }
6211}
6212
6213impl StopWaiterControlHandle {}
6214
6215#[must_use = "FIDL methods require a response to be sent"]
6216#[derive(Debug)]
6217pub struct StopWaiterWaitResponder {
6218 control_handle: std::mem::ManuallyDrop<StopWaiterControlHandle>,
6219 tx_id: u32,
6220}
6221
6222impl std::ops::Drop for StopWaiterWaitResponder {
6226 fn drop(&mut self) {
6227 self.control_handle.shutdown();
6228 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6230 }
6231}
6232
6233impl fidl::endpoints::Responder for StopWaiterWaitResponder {
6234 type ControlHandle = StopWaiterControlHandle;
6235
6236 fn control_handle(&self) -> &StopWaiterControlHandle {
6237 &self.control_handle
6238 }
6239
6240 fn drop_without_shutdown(mut self) {
6241 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6243 std::mem::forget(self);
6245 }
6246}
6247
6248impl StopWaiterWaitResponder {
6249 pub fn send(self) -> Result<(), fidl::Error> {
6253 let _result = self.send_raw();
6254 if _result.is_err() {
6255 self.control_handle.shutdown();
6256 }
6257 self.drop_without_shutdown();
6258 _result
6259 }
6260
6261 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
6263 let _result = self.send_raw();
6264 self.drop_without_shutdown();
6265 _result
6266 }
6267
6268 fn send_raw(&self) -> Result<(), fidl::Error> {
6269 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
6270 fidl::encoding::Flexible::new(()),
6271 self.tx_id,
6272 0x12d62812fe8aa263,
6273 fidl::encoding::DynamicFlags::FLEXIBLE,
6274 )
6275 }
6276}
6277
6278#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6279pub struct StopWatcherMarker;
6280
6281impl fidl::endpoints::ProtocolMarker for StopWatcherMarker {
6282 type Proxy = StopWatcherProxy;
6283 type RequestStream = StopWatcherRequestStream;
6284 #[cfg(target_os = "fuchsia")]
6285 type SynchronousProxy = StopWatcherSynchronousProxy;
6286
6287 const DEBUG_NAME: &'static str = "fuchsia.archivist.test.StopWatcher";
6288}
6289impl fidl::endpoints::DiscoverableProtocolMarker for StopWatcherMarker {}
6290
6291pub trait StopWatcherProxyInterface: Send + Sync {
6292 type WatchComponentResponseFut: std::future::Future<
6293 Output = Result<fidl::endpoints::ClientEnd<StopWaiterMarker>, fidl::Error>,
6294 > + Send;
6295 fn r#watch_component(
6296 &self,
6297 moniker: &str,
6298 expected_exit: ExitStatus,
6299 ) -> Self::WatchComponentResponseFut;
6300}
6301#[derive(Debug)]
6302#[cfg(target_os = "fuchsia")]
6303pub struct StopWatcherSynchronousProxy {
6304 client: fidl::client::sync::Client,
6305}
6306
6307#[cfg(target_os = "fuchsia")]
6308impl fidl::endpoints::SynchronousProxy for StopWatcherSynchronousProxy {
6309 type Proxy = StopWatcherProxy;
6310 type Protocol = StopWatcherMarker;
6311
6312 fn from_channel(inner: fidl::Channel) -> Self {
6313 Self::new(inner)
6314 }
6315
6316 fn into_channel(self) -> fidl::Channel {
6317 self.client.into_channel()
6318 }
6319
6320 fn as_channel(&self) -> &fidl::Channel {
6321 self.client.as_channel()
6322 }
6323}
6324
6325#[cfg(target_os = "fuchsia")]
6326impl StopWatcherSynchronousProxy {
6327 pub fn new(channel: fidl::Channel) -> Self {
6328 let protocol_name = <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6329 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6330 }
6331
6332 pub fn into_channel(self) -> fidl::Channel {
6333 self.client.into_channel()
6334 }
6335
6336 pub fn wait_for_event(
6339 &self,
6340 deadline: zx::MonotonicInstant,
6341 ) -> Result<StopWatcherEvent, fidl::Error> {
6342 StopWatcherEvent::decode(self.client.wait_for_event(deadline)?)
6343 }
6344
6345 pub fn r#watch_component(
6353 &self,
6354 mut moniker: &str,
6355 mut expected_exit: ExitStatus,
6356 ___deadline: zx::MonotonicInstant,
6357 ) -> Result<fidl::endpoints::ClientEnd<StopWaiterMarker>, fidl::Error> {
6358 let _response = self.client.send_query::<
6359 StopWatcherWatchComponentRequest,
6360 fidl::encoding::FlexibleType<StopWatcherWatchComponentResponse>,
6361 >(
6362 (moniker, expected_exit,),
6363 0x844f88ddd954e8e,
6364 fidl::encoding::DynamicFlags::FLEXIBLE,
6365 ___deadline,
6366 )?
6367 .into_result::<StopWatcherMarker>("watch_component")?;
6368 Ok(_response.client)
6369 }
6370}
6371
6372#[cfg(target_os = "fuchsia")]
6373impl From<StopWatcherSynchronousProxy> for zx::Handle {
6374 fn from(value: StopWatcherSynchronousProxy) -> Self {
6375 value.into_channel().into()
6376 }
6377}
6378
6379#[cfg(target_os = "fuchsia")]
6380impl From<fidl::Channel> for StopWatcherSynchronousProxy {
6381 fn from(value: fidl::Channel) -> Self {
6382 Self::new(value)
6383 }
6384}
6385
6386#[derive(Debug, Clone)]
6387pub struct StopWatcherProxy {
6388 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6389}
6390
6391impl fidl::endpoints::Proxy for StopWatcherProxy {
6392 type Protocol = StopWatcherMarker;
6393
6394 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6395 Self::new(inner)
6396 }
6397
6398 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6399 self.client.into_channel().map_err(|client| Self { client })
6400 }
6401
6402 fn as_channel(&self) -> &::fidl::AsyncChannel {
6403 self.client.as_channel()
6404 }
6405}
6406
6407impl StopWatcherProxy {
6408 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6410 let protocol_name = <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6411 Self { client: fidl::client::Client::new(channel, protocol_name) }
6412 }
6413
6414 pub fn take_event_stream(&self) -> StopWatcherEventStream {
6420 StopWatcherEventStream { event_receiver: self.client.take_event_receiver() }
6421 }
6422
6423 pub fn r#watch_component(
6431 &self,
6432 mut moniker: &str,
6433 mut expected_exit: ExitStatus,
6434 ) -> fidl::client::QueryResponseFut<
6435 fidl::endpoints::ClientEnd<StopWaiterMarker>,
6436 fidl::encoding::DefaultFuchsiaResourceDialect,
6437 > {
6438 StopWatcherProxyInterface::r#watch_component(self, moniker, expected_exit)
6439 }
6440}
6441
6442impl StopWatcherProxyInterface for StopWatcherProxy {
6443 type WatchComponentResponseFut = fidl::client::QueryResponseFut<
6444 fidl::endpoints::ClientEnd<StopWaiterMarker>,
6445 fidl::encoding::DefaultFuchsiaResourceDialect,
6446 >;
6447 fn r#watch_component(
6448 &self,
6449 mut moniker: &str,
6450 mut expected_exit: ExitStatus,
6451 ) -> Self::WatchComponentResponseFut {
6452 fn _decode(
6453 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6454 ) -> Result<fidl::endpoints::ClientEnd<StopWaiterMarker>, fidl::Error> {
6455 let _response = fidl::client::decode_transaction_body::<
6456 fidl::encoding::FlexibleType<StopWatcherWatchComponentResponse>,
6457 fidl::encoding::DefaultFuchsiaResourceDialect,
6458 0x844f88ddd954e8e,
6459 >(_buf?)?
6460 .into_result::<StopWatcherMarker>("watch_component")?;
6461 Ok(_response.client)
6462 }
6463 self.client.send_query_and_decode::<
6464 StopWatcherWatchComponentRequest,
6465 fidl::endpoints::ClientEnd<StopWaiterMarker>,
6466 >(
6467 (moniker, expected_exit,),
6468 0x844f88ddd954e8e,
6469 fidl::encoding::DynamicFlags::FLEXIBLE,
6470 _decode,
6471 )
6472 }
6473}
6474
6475pub struct StopWatcherEventStream {
6476 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6477}
6478
6479impl std::marker::Unpin for StopWatcherEventStream {}
6480
6481impl futures::stream::FusedStream for StopWatcherEventStream {
6482 fn is_terminated(&self) -> bool {
6483 self.event_receiver.is_terminated()
6484 }
6485}
6486
6487impl futures::Stream for StopWatcherEventStream {
6488 type Item = Result<StopWatcherEvent, fidl::Error>;
6489
6490 fn poll_next(
6491 mut self: std::pin::Pin<&mut Self>,
6492 cx: &mut std::task::Context<'_>,
6493 ) -> std::task::Poll<Option<Self::Item>> {
6494 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6495 &mut self.event_receiver,
6496 cx
6497 )?) {
6498 Some(buf) => std::task::Poll::Ready(Some(StopWatcherEvent::decode(buf))),
6499 None => std::task::Poll::Ready(None),
6500 }
6501 }
6502}
6503
6504#[derive(Debug)]
6505pub enum StopWatcherEvent {
6506 #[non_exhaustive]
6507 _UnknownEvent {
6508 ordinal: u64,
6510 },
6511}
6512
6513impl StopWatcherEvent {
6514 fn decode(
6516 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6517 ) -> Result<StopWatcherEvent, fidl::Error> {
6518 let (bytes, _handles) = buf.split_mut();
6519 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6520 debug_assert_eq!(tx_header.tx_id, 0);
6521 match tx_header.ordinal {
6522 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6523 Ok(StopWatcherEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6524 }
6525 _ => Err(fidl::Error::UnknownOrdinal {
6526 ordinal: tx_header.ordinal,
6527 protocol_name: <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6528 }),
6529 }
6530 }
6531}
6532
6533pub struct StopWatcherRequestStream {
6535 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6536 is_terminated: bool,
6537}
6538
6539impl std::marker::Unpin for StopWatcherRequestStream {}
6540
6541impl futures::stream::FusedStream for StopWatcherRequestStream {
6542 fn is_terminated(&self) -> bool {
6543 self.is_terminated
6544 }
6545}
6546
6547impl fidl::endpoints::RequestStream for StopWatcherRequestStream {
6548 type Protocol = StopWatcherMarker;
6549 type ControlHandle = StopWatcherControlHandle;
6550
6551 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6552 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6553 }
6554
6555 fn control_handle(&self) -> Self::ControlHandle {
6556 StopWatcherControlHandle { inner: self.inner.clone() }
6557 }
6558
6559 fn into_inner(
6560 self,
6561 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6562 {
6563 (self.inner, self.is_terminated)
6564 }
6565
6566 fn from_inner(
6567 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6568 is_terminated: bool,
6569 ) -> Self {
6570 Self { inner, is_terminated }
6571 }
6572}
6573
6574impl futures::Stream for StopWatcherRequestStream {
6575 type Item = Result<StopWatcherRequest, fidl::Error>;
6576
6577 fn poll_next(
6578 mut self: std::pin::Pin<&mut Self>,
6579 cx: &mut std::task::Context<'_>,
6580 ) -> std::task::Poll<Option<Self::Item>> {
6581 let this = &mut *self;
6582 if this.inner.check_shutdown(cx) {
6583 this.is_terminated = true;
6584 return std::task::Poll::Ready(None);
6585 }
6586 if this.is_terminated {
6587 panic!("polled StopWatcherRequestStream after completion");
6588 }
6589 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6590 |bytes, handles| {
6591 match this.inner.channel().read_etc(cx, bytes, handles) {
6592 std::task::Poll::Ready(Ok(())) => {}
6593 std::task::Poll::Pending => return std::task::Poll::Pending,
6594 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6595 this.is_terminated = true;
6596 return std::task::Poll::Ready(None);
6597 }
6598 std::task::Poll::Ready(Err(e)) => {
6599 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6600 e.into(),
6601 ))))
6602 }
6603 }
6604
6605 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6607
6608 std::task::Poll::Ready(Some(match header.ordinal {
6609 0x844f88ddd954e8e => {
6610 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6611 let mut req = fidl::new_empty!(
6612 StopWatcherWatchComponentRequest,
6613 fidl::encoding::DefaultFuchsiaResourceDialect
6614 );
6615 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StopWatcherWatchComponentRequest>(&header, _body_bytes, handles, &mut req)?;
6616 let control_handle = StopWatcherControlHandle { inner: this.inner.clone() };
6617 Ok(StopWatcherRequest::WatchComponent {
6618 moniker: req.moniker,
6619 expected_exit: req.expected_exit,
6620
6621 responder: StopWatcherWatchComponentResponder {
6622 control_handle: std::mem::ManuallyDrop::new(control_handle),
6623 tx_id: header.tx_id,
6624 },
6625 })
6626 }
6627 _ if header.tx_id == 0
6628 && header
6629 .dynamic_flags()
6630 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6631 {
6632 Ok(StopWatcherRequest::_UnknownMethod {
6633 ordinal: header.ordinal,
6634 control_handle: StopWatcherControlHandle { inner: this.inner.clone() },
6635 method_type: fidl::MethodType::OneWay,
6636 })
6637 }
6638 _ if header
6639 .dynamic_flags()
6640 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
6641 {
6642 this.inner.send_framework_err(
6643 fidl::encoding::FrameworkErr::UnknownMethod,
6644 header.tx_id,
6645 header.ordinal,
6646 header.dynamic_flags(),
6647 (bytes, handles),
6648 )?;
6649 Ok(StopWatcherRequest::_UnknownMethod {
6650 ordinal: header.ordinal,
6651 control_handle: StopWatcherControlHandle { inner: this.inner.clone() },
6652 method_type: fidl::MethodType::TwoWay,
6653 })
6654 }
6655 _ => Err(fidl::Error::UnknownOrdinal {
6656 ordinal: header.ordinal,
6657 protocol_name:
6658 <StopWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6659 }),
6660 }))
6661 },
6662 )
6663 }
6664}
6665
6666#[derive(Debug)]
6668pub enum StopWatcherRequest {
6669 WatchComponent {
6677 moniker: String,
6678 expected_exit: ExitStatus,
6679 responder: StopWatcherWatchComponentResponder,
6680 },
6681 #[non_exhaustive]
6683 _UnknownMethod {
6684 ordinal: u64,
6686 control_handle: StopWatcherControlHandle,
6687 method_type: fidl::MethodType,
6688 },
6689}
6690
6691impl StopWatcherRequest {
6692 #[allow(irrefutable_let_patterns)]
6693 pub fn into_watch_component(
6694 self,
6695 ) -> Option<(String, ExitStatus, StopWatcherWatchComponentResponder)> {
6696 if let StopWatcherRequest::WatchComponent { moniker, expected_exit, responder } = self {
6697 Some((moniker, expected_exit, responder))
6698 } else {
6699 None
6700 }
6701 }
6702
6703 pub fn method_name(&self) -> &'static str {
6705 match *self {
6706 StopWatcherRequest::WatchComponent { .. } => "watch_component",
6707 StopWatcherRequest::_UnknownMethod {
6708 method_type: fidl::MethodType::OneWay, ..
6709 } => "unknown one-way method",
6710 StopWatcherRequest::_UnknownMethod {
6711 method_type: fidl::MethodType::TwoWay, ..
6712 } => "unknown two-way method",
6713 }
6714 }
6715}
6716
6717#[derive(Debug, Clone)]
6718pub struct StopWatcherControlHandle {
6719 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6720}
6721
6722impl fidl::endpoints::ControlHandle for StopWatcherControlHandle {
6723 fn shutdown(&self) {
6724 self.inner.shutdown()
6725 }
6726 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6727 self.inner.shutdown_with_epitaph(status)
6728 }
6729
6730 fn is_closed(&self) -> bool {
6731 self.inner.channel().is_closed()
6732 }
6733 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6734 self.inner.channel().on_closed()
6735 }
6736
6737 #[cfg(target_os = "fuchsia")]
6738 fn signal_peer(
6739 &self,
6740 clear_mask: zx::Signals,
6741 set_mask: zx::Signals,
6742 ) -> Result<(), zx_status::Status> {
6743 use fidl::Peered;
6744 self.inner.channel().signal_peer(clear_mask, set_mask)
6745 }
6746}
6747
6748impl StopWatcherControlHandle {}
6749
6750#[must_use = "FIDL methods require a response to be sent"]
6751#[derive(Debug)]
6752pub struct StopWatcherWatchComponentResponder {
6753 control_handle: std::mem::ManuallyDrop<StopWatcherControlHandle>,
6754 tx_id: u32,
6755}
6756
6757impl std::ops::Drop for StopWatcherWatchComponentResponder {
6761 fn drop(&mut self) {
6762 self.control_handle.shutdown();
6763 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6765 }
6766}
6767
6768impl fidl::endpoints::Responder for StopWatcherWatchComponentResponder {
6769 type ControlHandle = StopWatcherControlHandle;
6770
6771 fn control_handle(&self) -> &StopWatcherControlHandle {
6772 &self.control_handle
6773 }
6774
6775 fn drop_without_shutdown(mut self) {
6776 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6778 std::mem::forget(self);
6780 }
6781}
6782
6783impl StopWatcherWatchComponentResponder {
6784 pub fn send(
6788 self,
6789 mut client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
6790 ) -> Result<(), fidl::Error> {
6791 let _result = self.send_raw(client);
6792 if _result.is_err() {
6793 self.control_handle.shutdown();
6794 }
6795 self.drop_without_shutdown();
6796 _result
6797 }
6798
6799 pub fn send_no_shutdown_on_err(
6801 self,
6802 mut client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
6803 ) -> Result<(), fidl::Error> {
6804 let _result = self.send_raw(client);
6805 self.drop_without_shutdown();
6806 _result
6807 }
6808
6809 fn send_raw(
6810 &self,
6811 mut client: fidl::endpoints::ClientEnd<StopWaiterMarker>,
6812 ) -> Result<(), fidl::Error> {
6813 self.control_handle
6814 .inner
6815 .send::<fidl::encoding::FlexibleType<StopWatcherWatchComponentResponse>>(
6816 fidl::encoding::Flexible::new((client,)),
6817 self.tx_id,
6818 0x844f88ddd954e8e,
6819 fidl::encoding::DynamicFlags::FLEXIBLE,
6820 )
6821 }
6822}
6823
6824mod internal {
6825 use super::*;
6826
6827 impl fidl::encoding::ResourceTypeMarker for InspectPuppetCreateInspectorResponse {
6828 type Borrowed<'a> = &'a mut Self;
6829 fn take_or_borrow<'a>(
6830 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6831 ) -> Self::Borrowed<'a> {
6832 value
6833 }
6834 }
6835
6836 unsafe impl fidl::encoding::TypeMarker for InspectPuppetCreateInspectorResponse {
6837 type Owned = Self;
6838
6839 #[inline(always)]
6840 fn inline_align(_context: fidl::encoding::Context) -> usize {
6841 4
6842 }
6843
6844 #[inline(always)]
6845 fn inline_size(_context: fidl::encoding::Context) -> usize {
6846 4
6847 }
6848 }
6849
6850 unsafe impl
6851 fidl::encoding::Encode<
6852 InspectPuppetCreateInspectorResponse,
6853 fidl::encoding::DefaultFuchsiaResourceDialect,
6854 > for &mut InspectPuppetCreateInspectorResponse
6855 {
6856 #[inline]
6857 unsafe fn encode(
6858 self,
6859 encoder: &mut fidl::encoding::Encoder<
6860 '_,
6861 fidl::encoding::DefaultFuchsiaResourceDialect,
6862 >,
6863 offset: usize,
6864 _depth: fidl::encoding::Depth,
6865 ) -> fidl::Result<()> {
6866 encoder.debug_check_bounds::<InspectPuppetCreateInspectorResponse>(offset);
6867 fidl::encoding::Encode::<InspectPuppetCreateInspectorResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6869 (
6870 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
6871 ),
6872 encoder, offset, _depth
6873 )
6874 }
6875 }
6876 unsafe impl<
6877 T0: fidl::encoding::Encode<
6878 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
6879 fidl::encoding::DefaultFuchsiaResourceDialect,
6880 >,
6881 >
6882 fidl::encoding::Encode<
6883 InspectPuppetCreateInspectorResponse,
6884 fidl::encoding::DefaultFuchsiaResourceDialect,
6885 > for (T0,)
6886 {
6887 #[inline]
6888 unsafe fn encode(
6889 self,
6890 encoder: &mut fidl::encoding::Encoder<
6891 '_,
6892 fidl::encoding::DefaultFuchsiaResourceDialect,
6893 >,
6894 offset: usize,
6895 depth: fidl::encoding::Depth,
6896 ) -> fidl::Result<()> {
6897 encoder.debug_check_bounds::<InspectPuppetCreateInspectorResponse>(offset);
6898 self.0.encode(encoder, offset + 0, depth)?;
6902 Ok(())
6903 }
6904 }
6905
6906 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6907 for InspectPuppetCreateInspectorResponse
6908 {
6909 #[inline(always)]
6910 fn new_empty() -> Self {
6911 Self {
6912 writer: fidl::new_empty!(
6913 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
6914 fidl::encoding::DefaultFuchsiaResourceDialect
6915 ),
6916 }
6917 }
6918
6919 #[inline]
6920 unsafe fn decode(
6921 &mut self,
6922 decoder: &mut fidl::encoding::Decoder<
6923 '_,
6924 fidl::encoding::DefaultFuchsiaResourceDialect,
6925 >,
6926 offset: usize,
6927 _depth: fidl::encoding::Depth,
6928 ) -> fidl::Result<()> {
6929 decoder.debug_check_bounds::<Self>(offset);
6930 fidl::decode!(
6932 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InspectWriterMarker>>,
6933 fidl::encoding::DefaultFuchsiaResourceDialect,
6934 &mut self.writer,
6935 decoder,
6936 offset + 0,
6937 _depth
6938 )?;
6939 Ok(())
6940 }
6941 }
6942
6943 impl fidl::encoding::ResourceTypeMarker for PuppetRecordLazyValuesResponse {
6944 type Borrowed<'a> = &'a mut Self;
6945 fn take_or_borrow<'a>(
6946 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6947 ) -> Self::Borrowed<'a> {
6948 value
6949 }
6950 }
6951
6952 unsafe impl fidl::encoding::TypeMarker for PuppetRecordLazyValuesResponse {
6953 type Owned = Self;
6954
6955 #[inline(always)]
6956 fn inline_align(_context: fidl::encoding::Context) -> usize {
6957 4
6958 }
6959
6960 #[inline(always)]
6961 fn inline_size(_context: fidl::encoding::Context) -> usize {
6962 4
6963 }
6964 }
6965
6966 unsafe impl
6967 fidl::encoding::Encode<
6968 PuppetRecordLazyValuesResponse,
6969 fidl::encoding::DefaultFuchsiaResourceDialect,
6970 > for &mut PuppetRecordLazyValuesResponse
6971 {
6972 #[inline]
6973 unsafe fn encode(
6974 self,
6975 encoder: &mut fidl::encoding::Encoder<
6976 '_,
6977 fidl::encoding::DefaultFuchsiaResourceDialect,
6978 >,
6979 offset: usize,
6980 _depth: fidl::encoding::Depth,
6981 ) -> fidl::Result<()> {
6982 encoder.debug_check_bounds::<PuppetRecordLazyValuesResponse>(offset);
6983 fidl::encoding::Encode::<PuppetRecordLazyValuesResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6985 (
6986 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
6987 ),
6988 encoder, offset, _depth
6989 )
6990 }
6991 }
6992 unsafe impl<
6993 T0: fidl::encoding::Encode<
6994 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
6995 fidl::encoding::DefaultFuchsiaResourceDialect,
6996 >,
6997 >
6998 fidl::encoding::Encode<
6999 PuppetRecordLazyValuesResponse,
7000 fidl::encoding::DefaultFuchsiaResourceDialect,
7001 > for (T0,)
7002 {
7003 #[inline]
7004 unsafe fn encode(
7005 self,
7006 encoder: &mut fidl::encoding::Encoder<
7007 '_,
7008 fidl::encoding::DefaultFuchsiaResourceDialect,
7009 >,
7010 offset: usize,
7011 depth: fidl::encoding::Depth,
7012 ) -> fidl::Result<()> {
7013 encoder.debug_check_bounds::<PuppetRecordLazyValuesResponse>(offset);
7014 self.0.encode(encoder, offset + 0, depth)?;
7018 Ok(())
7019 }
7020 }
7021
7022 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7023 for PuppetRecordLazyValuesResponse
7024 {
7025 #[inline(always)]
7026 fn new_empty() -> Self {
7027 Self {
7028 client: fidl::new_empty!(
7029 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
7030 fidl::encoding::DefaultFuchsiaResourceDialect
7031 ),
7032 }
7033 }
7034
7035 #[inline]
7036 unsafe fn decode(
7037 &mut self,
7038 decoder: &mut fidl::encoding::Decoder<
7039 '_,
7040 fidl::encoding::DefaultFuchsiaResourceDialect,
7041 >,
7042 offset: usize,
7043 _depth: fidl::encoding::Depth,
7044 ) -> fidl::Result<()> {
7045 decoder.debug_check_bounds::<Self>(offset);
7046 fidl::decode!(
7048 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<LazyInspectPuppetMarker>>,
7049 fidl::encoding::DefaultFuchsiaResourceDialect,
7050 &mut self.client,
7051 decoder,
7052 offset + 0,
7053 _depth
7054 )?;
7055 Ok(())
7056 }
7057 }
7058
7059 impl fidl::encoding::ResourceTypeMarker for RealmFactoryCreateRealmRequest {
7060 type Borrowed<'a> = &'a mut Self;
7061 fn take_or_borrow<'a>(
7062 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7063 ) -> Self::Borrowed<'a> {
7064 value
7065 }
7066 }
7067
7068 unsafe impl fidl::encoding::TypeMarker for RealmFactoryCreateRealmRequest {
7069 type Owned = Self;
7070
7071 #[inline(always)]
7072 fn inline_align(_context: fidl::encoding::Context) -> usize {
7073 8
7074 }
7075
7076 #[inline(always)]
7077 fn inline_size(_context: fidl::encoding::Context) -> usize {
7078 24
7079 }
7080 }
7081
7082 unsafe impl
7083 fidl::encoding::Encode<
7084 RealmFactoryCreateRealmRequest,
7085 fidl::encoding::DefaultFuchsiaResourceDialect,
7086 > for &mut RealmFactoryCreateRealmRequest
7087 {
7088 #[inline]
7089 unsafe fn encode(
7090 self,
7091 encoder: &mut fidl::encoding::Encoder<
7092 '_,
7093 fidl::encoding::DefaultFuchsiaResourceDialect,
7094 >,
7095 offset: usize,
7096 _depth: fidl::encoding::Depth,
7097 ) -> fidl::Result<()> {
7098 encoder.debug_check_bounds::<RealmFactoryCreateRealmRequest>(offset);
7099 fidl::encoding::Encode::<
7101 RealmFactoryCreateRealmRequest,
7102 fidl::encoding::DefaultFuchsiaResourceDialect,
7103 >::encode(
7104 (
7105 <RealmOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
7106 <fidl::encoding::Endpoint<
7107 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
7108 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7109 &mut self.realm_server,
7110 ),
7111 ),
7112 encoder,
7113 offset,
7114 _depth,
7115 )
7116 }
7117 }
7118 unsafe impl<
7119 T0: fidl::encoding::Encode<RealmOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
7120 T1: fidl::encoding::Encode<
7121 fidl::encoding::Endpoint<
7122 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
7123 >,
7124 fidl::encoding::DefaultFuchsiaResourceDialect,
7125 >,
7126 >
7127 fidl::encoding::Encode<
7128 RealmFactoryCreateRealmRequest,
7129 fidl::encoding::DefaultFuchsiaResourceDialect,
7130 > for (T0, T1)
7131 {
7132 #[inline]
7133 unsafe fn encode(
7134 self,
7135 encoder: &mut fidl::encoding::Encoder<
7136 '_,
7137 fidl::encoding::DefaultFuchsiaResourceDialect,
7138 >,
7139 offset: usize,
7140 depth: fidl::encoding::Depth,
7141 ) -> fidl::Result<()> {
7142 encoder.debug_check_bounds::<RealmFactoryCreateRealmRequest>(offset);
7143 unsafe {
7146 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7147 (ptr as *mut u64).write_unaligned(0);
7148 }
7149 self.0.encode(encoder, offset + 0, depth)?;
7151 self.1.encode(encoder, offset + 16, depth)?;
7152 Ok(())
7153 }
7154 }
7155
7156 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7157 for RealmFactoryCreateRealmRequest
7158 {
7159 #[inline(always)]
7160 fn new_empty() -> Self {
7161 Self {
7162 options: fidl::new_empty!(
7163 RealmOptions,
7164 fidl::encoding::DefaultFuchsiaResourceDialect
7165 ),
7166 realm_server: fidl::new_empty!(
7167 fidl::encoding::Endpoint<
7168 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
7169 >,
7170 fidl::encoding::DefaultFuchsiaResourceDialect
7171 ),
7172 }
7173 }
7174
7175 #[inline]
7176 unsafe fn decode(
7177 &mut self,
7178 decoder: &mut fidl::encoding::Decoder<
7179 '_,
7180 fidl::encoding::DefaultFuchsiaResourceDialect,
7181 >,
7182 offset: usize,
7183 _depth: fidl::encoding::Depth,
7184 ) -> fidl::Result<()> {
7185 decoder.debug_check_bounds::<Self>(offset);
7186 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7188 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7189 let mask = 0xffffffff00000000u64;
7190 let maskedval = padval & mask;
7191 if maskedval != 0 {
7192 return Err(fidl::Error::NonZeroPadding {
7193 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7194 });
7195 }
7196 fidl::decode!(
7197 RealmOptions,
7198 fidl::encoding::DefaultFuchsiaResourceDialect,
7199 &mut self.options,
7200 decoder,
7201 offset + 0,
7202 _depth
7203 )?;
7204 fidl::decode!(
7205 fidl::encoding::Endpoint<
7206 fidl::endpoints::ServerEnd<fidl_fuchsia_testing_harness::RealmProxy_Marker>,
7207 >,
7208 fidl::encoding::DefaultFuchsiaResourceDialect,
7209 &mut self.realm_server,
7210 decoder,
7211 offset + 16,
7212 _depth
7213 )?;
7214 Ok(())
7215 }
7216 }
7217
7218 impl fidl::encoding::ResourceTypeMarker for StopWatcherWatchComponentResponse {
7219 type Borrowed<'a> = &'a mut Self;
7220 fn take_or_borrow<'a>(
7221 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7222 ) -> Self::Borrowed<'a> {
7223 value
7224 }
7225 }
7226
7227 unsafe impl fidl::encoding::TypeMarker for StopWatcherWatchComponentResponse {
7228 type Owned = Self;
7229
7230 #[inline(always)]
7231 fn inline_align(_context: fidl::encoding::Context) -> usize {
7232 4
7233 }
7234
7235 #[inline(always)]
7236 fn inline_size(_context: fidl::encoding::Context) -> usize {
7237 4
7238 }
7239 }
7240
7241 unsafe impl
7242 fidl::encoding::Encode<
7243 StopWatcherWatchComponentResponse,
7244 fidl::encoding::DefaultFuchsiaResourceDialect,
7245 > for &mut StopWatcherWatchComponentResponse
7246 {
7247 #[inline]
7248 unsafe fn encode(
7249 self,
7250 encoder: &mut fidl::encoding::Encoder<
7251 '_,
7252 fidl::encoding::DefaultFuchsiaResourceDialect,
7253 >,
7254 offset: usize,
7255 _depth: fidl::encoding::Depth,
7256 ) -> fidl::Result<()> {
7257 encoder.debug_check_bounds::<StopWatcherWatchComponentResponse>(offset);
7258 fidl::encoding::Encode::<StopWatcherWatchComponentResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7260 (
7261 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
7262 ),
7263 encoder, offset, _depth
7264 )
7265 }
7266 }
7267 unsafe impl<
7268 T0: fidl::encoding::Encode<
7269 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>>,
7270 fidl::encoding::DefaultFuchsiaResourceDialect,
7271 >,
7272 >
7273 fidl::encoding::Encode<
7274 StopWatcherWatchComponentResponse,
7275 fidl::encoding::DefaultFuchsiaResourceDialect,
7276 > for (T0,)
7277 {
7278 #[inline]
7279 unsafe fn encode(
7280 self,
7281 encoder: &mut fidl::encoding::Encoder<
7282 '_,
7283 fidl::encoding::DefaultFuchsiaResourceDialect,
7284 >,
7285 offset: usize,
7286 depth: fidl::encoding::Depth,
7287 ) -> fidl::Result<()> {
7288 encoder.debug_check_bounds::<StopWatcherWatchComponentResponse>(offset);
7289 self.0.encode(encoder, offset + 0, depth)?;
7293 Ok(())
7294 }
7295 }
7296
7297 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7298 for StopWatcherWatchComponentResponse
7299 {
7300 #[inline(always)]
7301 fn new_empty() -> Self {
7302 Self {
7303 client: fidl::new_empty!(
7304 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>>,
7305 fidl::encoding::DefaultFuchsiaResourceDialect
7306 ),
7307 }
7308 }
7309
7310 #[inline]
7311 unsafe fn decode(
7312 &mut self,
7313 decoder: &mut fidl::encoding::Decoder<
7314 '_,
7315 fidl::encoding::DefaultFuchsiaResourceDialect,
7316 >,
7317 offset: usize,
7318 _depth: fidl::encoding::Depth,
7319 ) -> fidl::Result<()> {
7320 decoder.debug_check_bounds::<Self>(offset);
7321 fidl::decode!(
7323 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<StopWaiterMarker>>,
7324 fidl::encoding::DefaultFuchsiaResourceDialect,
7325 &mut self.client,
7326 decoder,
7327 offset + 0,
7328 _depth
7329 )?;
7330 Ok(())
7331 }
7332 }
7333
7334 impl InspectWriterEscrowAndExitResponse {
7335 #[inline(always)]
7336 fn max_ordinal_present(&self) -> u64 {
7337 if let Some(_) = self.token {
7338 return 1;
7339 }
7340 0
7341 }
7342 }
7343
7344 impl fidl::encoding::ResourceTypeMarker for InspectWriterEscrowAndExitResponse {
7345 type Borrowed<'a> = &'a mut Self;
7346 fn take_or_borrow<'a>(
7347 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7348 ) -> Self::Borrowed<'a> {
7349 value
7350 }
7351 }
7352
7353 unsafe impl fidl::encoding::TypeMarker for InspectWriterEscrowAndExitResponse {
7354 type Owned = Self;
7355
7356 #[inline(always)]
7357 fn inline_align(_context: fidl::encoding::Context) -> usize {
7358 8
7359 }
7360
7361 #[inline(always)]
7362 fn inline_size(_context: fidl::encoding::Context) -> usize {
7363 16
7364 }
7365 }
7366
7367 unsafe impl
7368 fidl::encoding::Encode<
7369 InspectWriterEscrowAndExitResponse,
7370 fidl::encoding::DefaultFuchsiaResourceDialect,
7371 > for &mut InspectWriterEscrowAndExitResponse
7372 {
7373 unsafe fn encode(
7374 self,
7375 encoder: &mut fidl::encoding::Encoder<
7376 '_,
7377 fidl::encoding::DefaultFuchsiaResourceDialect,
7378 >,
7379 offset: usize,
7380 mut depth: fidl::encoding::Depth,
7381 ) -> fidl::Result<()> {
7382 encoder.debug_check_bounds::<InspectWriterEscrowAndExitResponse>(offset);
7383 let max_ordinal: u64 = self.max_ordinal_present();
7385 encoder.write_num(max_ordinal, offset);
7386 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7387 if max_ordinal == 0 {
7389 return Ok(());
7390 }
7391 depth.increment()?;
7392 let envelope_size = 8;
7393 let bytes_len = max_ordinal as usize * envelope_size;
7394 #[allow(unused_variables)]
7395 let offset = encoder.out_of_line_offset(bytes_len);
7396 let mut _prev_end_offset: usize = 0;
7397 if 1 > max_ordinal {
7398 return Ok(());
7399 }
7400
7401 let cur_offset: usize = (1 - 1) * envelope_size;
7404
7405 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7407
7408 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_inspect::EscrowToken, fidl::encoding::DefaultFuchsiaResourceDialect>(
7413 self.token.as_mut().map(<fidl_fuchsia_inspect::EscrowToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
7414 encoder, offset + cur_offset, depth
7415 )?;
7416
7417 _prev_end_offset = cur_offset + envelope_size;
7418
7419 Ok(())
7420 }
7421 }
7422
7423 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7424 for InspectWriterEscrowAndExitResponse
7425 {
7426 #[inline(always)]
7427 fn new_empty() -> Self {
7428 Self::default()
7429 }
7430
7431 unsafe fn decode(
7432 &mut self,
7433 decoder: &mut fidl::encoding::Decoder<
7434 '_,
7435 fidl::encoding::DefaultFuchsiaResourceDialect,
7436 >,
7437 offset: usize,
7438 mut depth: fidl::encoding::Depth,
7439 ) -> fidl::Result<()> {
7440 decoder.debug_check_bounds::<Self>(offset);
7441 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7442 None => return Err(fidl::Error::NotNullable),
7443 Some(len) => len,
7444 };
7445 if len == 0 {
7447 return Ok(());
7448 };
7449 depth.increment()?;
7450 let envelope_size = 8;
7451 let bytes_len = len * envelope_size;
7452 let offset = decoder.out_of_line_offset(bytes_len)?;
7453 let mut _next_ordinal_to_read = 0;
7455 let mut next_offset = offset;
7456 let end_offset = offset + bytes_len;
7457 _next_ordinal_to_read += 1;
7458 if next_offset >= end_offset {
7459 return Ok(());
7460 }
7461
7462 while _next_ordinal_to_read < 1 {
7464 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7465 _next_ordinal_to_read += 1;
7466 next_offset += envelope_size;
7467 }
7468
7469 let next_out_of_line = decoder.next_out_of_line();
7470 let handles_before = decoder.remaining_handles();
7471 if let Some((inlined, num_bytes, num_handles)) =
7472 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7473 {
7474 let member_inline_size =
7475 <fidl_fuchsia_inspect::EscrowToken as fidl::encoding::TypeMarker>::inline_size(
7476 decoder.context,
7477 );
7478 if inlined != (member_inline_size <= 4) {
7479 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7480 }
7481 let inner_offset;
7482 let mut inner_depth = depth.clone();
7483 if inlined {
7484 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7485 inner_offset = next_offset;
7486 } else {
7487 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7488 inner_depth.increment()?;
7489 }
7490 let val_ref = self.token.get_or_insert_with(|| {
7491 fidl::new_empty!(
7492 fidl_fuchsia_inspect::EscrowToken,
7493 fidl::encoding::DefaultFuchsiaResourceDialect
7494 )
7495 });
7496 fidl::decode!(
7497 fidl_fuchsia_inspect::EscrowToken,
7498 fidl::encoding::DefaultFuchsiaResourceDialect,
7499 val_ref,
7500 decoder,
7501 inner_offset,
7502 inner_depth
7503 )?;
7504 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7505 {
7506 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7507 }
7508 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7509 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7510 }
7511 }
7512
7513 next_offset += envelope_size;
7514
7515 while next_offset < end_offset {
7517 _next_ordinal_to_read += 1;
7518 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7519 next_offset += envelope_size;
7520 }
7521
7522 Ok(())
7523 }
7524 }
7525}