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_validate_logs_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct EncodingPuppetEncodeResponse {
16 pub result: fidl_fuchsia_mem::Buffer,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for EncodingPuppetEncodeResponse
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct EncodingValidatorValidateRequest {
26 pub results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
27}
28
29impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
30 for EncodingValidatorValidateRequest
31{
32}
33
34#[derive(Debug, Default, PartialEq)]
35pub struct ValidateResultsIteratorGetNextResponse {
36 pub result: Option<ValidateResult>,
37 #[doc(hidden)]
38 pub __source_breaking: fidl::marker::SourceBreaking,
39}
40
41impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
42 for ValidateResultsIteratorGetNextResponse
43{
44}
45
46#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
47pub struct EncodingPuppetMarker;
48
49impl fidl::endpoints::ProtocolMarker for EncodingPuppetMarker {
50 type Proxy = EncodingPuppetProxy;
51 type RequestStream = EncodingPuppetRequestStream;
52 #[cfg(target_os = "fuchsia")]
53 type SynchronousProxy = EncodingPuppetSynchronousProxy;
54
55 const DEBUG_NAME: &'static str = "fuchsia.validate.logs.EncodingPuppet";
56}
57impl fidl::endpoints::DiscoverableProtocolMarker for EncodingPuppetMarker {}
58pub type EncodingPuppetEncodeResult = Result<fidl_fuchsia_mem::Buffer, PuppetError>;
59
60pub trait EncodingPuppetProxyInterface: Send + Sync {
61 type EncodeResponseFut: std::future::Future<Output = Result<EncodingPuppetEncodeResult, fidl::Error>>
62 + Send;
63 fn r#encode(&self, record: &Record) -> Self::EncodeResponseFut;
64}
65#[derive(Debug)]
66#[cfg(target_os = "fuchsia")]
67pub struct EncodingPuppetSynchronousProxy {
68 client: fidl::client::sync::Client,
69}
70
71#[cfg(target_os = "fuchsia")]
72impl fidl::endpoints::SynchronousProxy for EncodingPuppetSynchronousProxy {
73 type Proxy = EncodingPuppetProxy;
74 type Protocol = EncodingPuppetMarker;
75
76 fn from_channel(inner: fidl::Channel) -> Self {
77 Self::new(inner)
78 }
79
80 fn into_channel(self) -> fidl::Channel {
81 self.client.into_channel()
82 }
83
84 fn as_channel(&self) -> &fidl::Channel {
85 self.client.as_channel()
86 }
87}
88
89#[cfg(target_os = "fuchsia")]
90impl EncodingPuppetSynchronousProxy {
91 pub fn new(channel: fidl::Channel) -> Self {
92 let protocol_name = <EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
93 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
94 }
95
96 pub fn into_channel(self) -> fidl::Channel {
97 self.client.into_channel()
98 }
99
100 pub fn wait_for_event(
103 &self,
104 deadline: zx::MonotonicInstant,
105 ) -> Result<EncodingPuppetEvent, fidl::Error> {
106 EncodingPuppetEvent::decode(self.client.wait_for_event(deadline)?)
107 }
108
109 pub fn r#encode(
112 &self,
113 mut record: &Record,
114 ___deadline: zx::MonotonicInstant,
115 ) -> Result<EncodingPuppetEncodeResult, fidl::Error> {
116 let _response = self.client.send_query::<
117 EncodingPuppetEncodeRequest,
118 fidl::encoding::ResultType<EncodingPuppetEncodeResponse, PuppetError>,
119 >(
120 (record,),
121 0x4486ab9d1bb462f8,
122 fidl::encoding::DynamicFlags::empty(),
123 ___deadline,
124 )?;
125 Ok(_response.map(|x| x.result))
126 }
127}
128
129#[cfg(target_os = "fuchsia")]
130impl From<EncodingPuppetSynchronousProxy> for zx::Handle {
131 fn from(value: EncodingPuppetSynchronousProxy) -> Self {
132 value.into_channel().into()
133 }
134}
135
136#[cfg(target_os = "fuchsia")]
137impl From<fidl::Channel> for EncodingPuppetSynchronousProxy {
138 fn from(value: fidl::Channel) -> Self {
139 Self::new(value)
140 }
141}
142
143#[derive(Debug, Clone)]
144pub struct EncodingPuppetProxy {
145 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
146}
147
148impl fidl::endpoints::Proxy for EncodingPuppetProxy {
149 type Protocol = EncodingPuppetMarker;
150
151 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
152 Self::new(inner)
153 }
154
155 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
156 self.client.into_channel().map_err(|client| Self { client })
157 }
158
159 fn as_channel(&self) -> &::fidl::AsyncChannel {
160 self.client.as_channel()
161 }
162}
163
164impl EncodingPuppetProxy {
165 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
167 let protocol_name = <EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
168 Self { client: fidl::client::Client::new(channel, protocol_name) }
169 }
170
171 pub fn take_event_stream(&self) -> EncodingPuppetEventStream {
177 EncodingPuppetEventStream { event_receiver: self.client.take_event_receiver() }
178 }
179
180 pub fn r#encode(
183 &self,
184 mut record: &Record,
185 ) -> fidl::client::QueryResponseFut<
186 EncodingPuppetEncodeResult,
187 fidl::encoding::DefaultFuchsiaResourceDialect,
188 > {
189 EncodingPuppetProxyInterface::r#encode(self, record)
190 }
191}
192
193impl EncodingPuppetProxyInterface for EncodingPuppetProxy {
194 type EncodeResponseFut = fidl::client::QueryResponseFut<
195 EncodingPuppetEncodeResult,
196 fidl::encoding::DefaultFuchsiaResourceDialect,
197 >;
198 fn r#encode(&self, mut record: &Record) -> Self::EncodeResponseFut {
199 fn _decode(
200 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
201 ) -> Result<EncodingPuppetEncodeResult, fidl::Error> {
202 let _response = fidl::client::decode_transaction_body::<
203 fidl::encoding::ResultType<EncodingPuppetEncodeResponse, PuppetError>,
204 fidl::encoding::DefaultFuchsiaResourceDialect,
205 0x4486ab9d1bb462f8,
206 >(_buf?)?;
207 Ok(_response.map(|x| x.result))
208 }
209 self.client
210 .send_query_and_decode::<EncodingPuppetEncodeRequest, EncodingPuppetEncodeResult>(
211 (record,),
212 0x4486ab9d1bb462f8,
213 fidl::encoding::DynamicFlags::empty(),
214 _decode,
215 )
216 }
217}
218
219pub struct EncodingPuppetEventStream {
220 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
221}
222
223impl std::marker::Unpin for EncodingPuppetEventStream {}
224
225impl futures::stream::FusedStream for EncodingPuppetEventStream {
226 fn is_terminated(&self) -> bool {
227 self.event_receiver.is_terminated()
228 }
229}
230
231impl futures::Stream for EncodingPuppetEventStream {
232 type Item = Result<EncodingPuppetEvent, fidl::Error>;
233
234 fn poll_next(
235 mut self: std::pin::Pin<&mut Self>,
236 cx: &mut std::task::Context<'_>,
237 ) -> std::task::Poll<Option<Self::Item>> {
238 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
239 &mut self.event_receiver,
240 cx
241 )?) {
242 Some(buf) => std::task::Poll::Ready(Some(EncodingPuppetEvent::decode(buf))),
243 None => std::task::Poll::Ready(None),
244 }
245 }
246}
247
248#[derive(Debug)]
249pub enum EncodingPuppetEvent {}
250
251impl EncodingPuppetEvent {
252 fn decode(
254 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
255 ) -> Result<EncodingPuppetEvent, fidl::Error> {
256 let (bytes, _handles) = buf.split_mut();
257 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
258 debug_assert_eq!(tx_header.tx_id, 0);
259 match tx_header.ordinal {
260 _ => Err(fidl::Error::UnknownOrdinal {
261 ordinal: tx_header.ordinal,
262 protocol_name:
263 <EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
264 }),
265 }
266 }
267}
268
269pub struct EncodingPuppetRequestStream {
271 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
272 is_terminated: bool,
273}
274
275impl std::marker::Unpin for EncodingPuppetRequestStream {}
276
277impl futures::stream::FusedStream for EncodingPuppetRequestStream {
278 fn is_terminated(&self) -> bool {
279 self.is_terminated
280 }
281}
282
283impl fidl::endpoints::RequestStream for EncodingPuppetRequestStream {
284 type Protocol = EncodingPuppetMarker;
285 type ControlHandle = EncodingPuppetControlHandle;
286
287 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
288 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
289 }
290
291 fn control_handle(&self) -> Self::ControlHandle {
292 EncodingPuppetControlHandle { inner: self.inner.clone() }
293 }
294
295 fn into_inner(
296 self,
297 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
298 {
299 (self.inner, self.is_terminated)
300 }
301
302 fn from_inner(
303 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
304 is_terminated: bool,
305 ) -> Self {
306 Self { inner, is_terminated }
307 }
308}
309
310impl futures::Stream for EncodingPuppetRequestStream {
311 type Item = Result<EncodingPuppetRequest, fidl::Error>;
312
313 fn poll_next(
314 mut self: std::pin::Pin<&mut Self>,
315 cx: &mut std::task::Context<'_>,
316 ) -> std::task::Poll<Option<Self::Item>> {
317 let this = &mut *self;
318 if this.inner.check_shutdown(cx) {
319 this.is_terminated = true;
320 return std::task::Poll::Ready(None);
321 }
322 if this.is_terminated {
323 panic!("polled EncodingPuppetRequestStream after completion");
324 }
325 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
326 |bytes, handles| {
327 match this.inner.channel().read_etc(cx, bytes, handles) {
328 std::task::Poll::Ready(Ok(())) => {}
329 std::task::Poll::Pending => return std::task::Poll::Pending,
330 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
331 this.is_terminated = true;
332 return std::task::Poll::Ready(None);
333 }
334 std::task::Poll::Ready(Err(e)) => {
335 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
336 e.into(),
337 ))))
338 }
339 }
340
341 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
343
344 std::task::Poll::Ready(Some(match header.ordinal {
345 0x4486ab9d1bb462f8 => {
346 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
347 let mut req = fidl::new_empty!(
348 EncodingPuppetEncodeRequest,
349 fidl::encoding::DefaultFuchsiaResourceDialect
350 );
351 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EncodingPuppetEncodeRequest>(&header, _body_bytes, handles, &mut req)?;
352 let control_handle =
353 EncodingPuppetControlHandle { inner: this.inner.clone() };
354 Ok(EncodingPuppetRequest::Encode {
355 record: req.record,
356
357 responder: EncodingPuppetEncodeResponder {
358 control_handle: std::mem::ManuallyDrop::new(control_handle),
359 tx_id: header.tx_id,
360 },
361 })
362 }
363 _ => Err(fidl::Error::UnknownOrdinal {
364 ordinal: header.ordinal,
365 protocol_name:
366 <EncodingPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
367 }),
368 }))
369 },
370 )
371 }
372}
373
374#[derive(Debug)]
375pub enum EncodingPuppetRequest {
376 Encode { record: Record, responder: EncodingPuppetEncodeResponder },
379}
380
381impl EncodingPuppetRequest {
382 #[allow(irrefutable_let_patterns)]
383 pub fn into_encode(self) -> Option<(Record, EncodingPuppetEncodeResponder)> {
384 if let EncodingPuppetRequest::Encode { record, responder } = self {
385 Some((record, responder))
386 } else {
387 None
388 }
389 }
390
391 pub fn method_name(&self) -> &'static str {
393 match *self {
394 EncodingPuppetRequest::Encode { .. } => "encode",
395 }
396 }
397}
398
399#[derive(Debug, Clone)]
400pub struct EncodingPuppetControlHandle {
401 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
402}
403
404impl fidl::endpoints::ControlHandle for EncodingPuppetControlHandle {
405 fn shutdown(&self) {
406 self.inner.shutdown()
407 }
408 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
409 self.inner.shutdown_with_epitaph(status)
410 }
411
412 fn is_closed(&self) -> bool {
413 self.inner.channel().is_closed()
414 }
415 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
416 self.inner.channel().on_closed()
417 }
418
419 #[cfg(target_os = "fuchsia")]
420 fn signal_peer(
421 &self,
422 clear_mask: zx::Signals,
423 set_mask: zx::Signals,
424 ) -> Result<(), zx_status::Status> {
425 use fidl::Peered;
426 self.inner.channel().signal_peer(clear_mask, set_mask)
427 }
428}
429
430impl EncodingPuppetControlHandle {}
431
432#[must_use = "FIDL methods require a response to be sent"]
433#[derive(Debug)]
434pub struct EncodingPuppetEncodeResponder {
435 control_handle: std::mem::ManuallyDrop<EncodingPuppetControlHandle>,
436 tx_id: u32,
437}
438
439impl std::ops::Drop for EncodingPuppetEncodeResponder {
443 fn drop(&mut self) {
444 self.control_handle.shutdown();
445 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
447 }
448}
449
450impl fidl::endpoints::Responder for EncodingPuppetEncodeResponder {
451 type ControlHandle = EncodingPuppetControlHandle;
452
453 fn control_handle(&self) -> &EncodingPuppetControlHandle {
454 &self.control_handle
455 }
456
457 fn drop_without_shutdown(mut self) {
458 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
460 std::mem::forget(self);
462 }
463}
464
465impl EncodingPuppetEncodeResponder {
466 pub fn send(
470 self,
471 mut result: Result<fidl_fuchsia_mem::Buffer, PuppetError>,
472 ) -> Result<(), fidl::Error> {
473 let _result = self.send_raw(result);
474 if _result.is_err() {
475 self.control_handle.shutdown();
476 }
477 self.drop_without_shutdown();
478 _result
479 }
480
481 pub fn send_no_shutdown_on_err(
483 self,
484 mut result: Result<fidl_fuchsia_mem::Buffer, PuppetError>,
485 ) -> Result<(), fidl::Error> {
486 let _result = self.send_raw(result);
487 self.drop_without_shutdown();
488 _result
489 }
490
491 fn send_raw(
492 &self,
493 mut result: Result<fidl_fuchsia_mem::Buffer, PuppetError>,
494 ) -> Result<(), fidl::Error> {
495 self.control_handle.inner.send::<fidl::encoding::ResultType<
496 EncodingPuppetEncodeResponse,
497 PuppetError,
498 >>(
499 result.as_mut().map_err(|e| *e).map(|result| (result,)),
500 self.tx_id,
501 0x4486ab9d1bb462f8,
502 fidl::encoding::DynamicFlags::empty(),
503 )
504 }
505}
506
507#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
508pub struct EncodingValidatorMarker;
509
510impl fidl::endpoints::ProtocolMarker for EncodingValidatorMarker {
511 type Proxy = EncodingValidatorProxy;
512 type RequestStream = EncodingValidatorRequestStream;
513 #[cfg(target_os = "fuchsia")]
514 type SynchronousProxy = EncodingValidatorSynchronousProxy;
515
516 const DEBUG_NAME: &'static str = "fuchsia.validate.logs.EncodingValidator";
517}
518impl fidl::endpoints::DiscoverableProtocolMarker for EncodingValidatorMarker {}
519
520pub trait EncodingValidatorProxyInterface: Send + Sync {
521 fn r#validate(
522 &self,
523 results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
524 ) -> Result<(), fidl::Error>;
525}
526#[derive(Debug)]
527#[cfg(target_os = "fuchsia")]
528pub struct EncodingValidatorSynchronousProxy {
529 client: fidl::client::sync::Client,
530}
531
532#[cfg(target_os = "fuchsia")]
533impl fidl::endpoints::SynchronousProxy for EncodingValidatorSynchronousProxy {
534 type Proxy = EncodingValidatorProxy;
535 type Protocol = EncodingValidatorMarker;
536
537 fn from_channel(inner: fidl::Channel) -> Self {
538 Self::new(inner)
539 }
540
541 fn into_channel(self) -> fidl::Channel {
542 self.client.into_channel()
543 }
544
545 fn as_channel(&self) -> &fidl::Channel {
546 self.client.as_channel()
547 }
548}
549
550#[cfg(target_os = "fuchsia")]
551impl EncodingValidatorSynchronousProxy {
552 pub fn new(channel: fidl::Channel) -> Self {
553 let protocol_name =
554 <EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
555 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
556 }
557
558 pub fn into_channel(self) -> fidl::Channel {
559 self.client.into_channel()
560 }
561
562 pub fn wait_for_event(
565 &self,
566 deadline: zx::MonotonicInstant,
567 ) -> Result<EncodingValidatorEvent, fidl::Error> {
568 EncodingValidatorEvent::decode(self.client.wait_for_event(deadline)?)
569 }
570
571 pub fn r#validate(
574 &self,
575 mut results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
576 ) -> Result<(), fidl::Error> {
577 self.client.send::<EncodingValidatorValidateRequest>(
578 (results,),
579 0x1ac204a62465f23c,
580 fidl::encoding::DynamicFlags::empty(),
581 )
582 }
583}
584
585#[cfg(target_os = "fuchsia")]
586impl From<EncodingValidatorSynchronousProxy> for zx::Handle {
587 fn from(value: EncodingValidatorSynchronousProxy) -> Self {
588 value.into_channel().into()
589 }
590}
591
592#[cfg(target_os = "fuchsia")]
593impl From<fidl::Channel> for EncodingValidatorSynchronousProxy {
594 fn from(value: fidl::Channel) -> Self {
595 Self::new(value)
596 }
597}
598
599#[derive(Debug, Clone)]
600pub struct EncodingValidatorProxy {
601 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
602}
603
604impl fidl::endpoints::Proxy for EncodingValidatorProxy {
605 type Protocol = EncodingValidatorMarker;
606
607 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
608 Self::new(inner)
609 }
610
611 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
612 self.client.into_channel().map_err(|client| Self { client })
613 }
614
615 fn as_channel(&self) -> &::fidl::AsyncChannel {
616 self.client.as_channel()
617 }
618}
619
620impl EncodingValidatorProxy {
621 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
623 let protocol_name =
624 <EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
625 Self { client: fidl::client::Client::new(channel, protocol_name) }
626 }
627
628 pub fn take_event_stream(&self) -> EncodingValidatorEventStream {
634 EncodingValidatorEventStream { event_receiver: self.client.take_event_receiver() }
635 }
636
637 pub fn r#validate(
640 &self,
641 mut results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
642 ) -> Result<(), fidl::Error> {
643 EncodingValidatorProxyInterface::r#validate(self, results)
644 }
645}
646
647impl EncodingValidatorProxyInterface for EncodingValidatorProxy {
648 fn r#validate(
649 &self,
650 mut results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
651 ) -> Result<(), fidl::Error> {
652 self.client.send::<EncodingValidatorValidateRequest>(
653 (results,),
654 0x1ac204a62465f23c,
655 fidl::encoding::DynamicFlags::empty(),
656 )
657 }
658}
659
660pub struct EncodingValidatorEventStream {
661 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
662}
663
664impl std::marker::Unpin for EncodingValidatorEventStream {}
665
666impl futures::stream::FusedStream for EncodingValidatorEventStream {
667 fn is_terminated(&self) -> bool {
668 self.event_receiver.is_terminated()
669 }
670}
671
672impl futures::Stream for EncodingValidatorEventStream {
673 type Item = Result<EncodingValidatorEvent, fidl::Error>;
674
675 fn poll_next(
676 mut self: std::pin::Pin<&mut Self>,
677 cx: &mut std::task::Context<'_>,
678 ) -> std::task::Poll<Option<Self::Item>> {
679 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
680 &mut self.event_receiver,
681 cx
682 )?) {
683 Some(buf) => std::task::Poll::Ready(Some(EncodingValidatorEvent::decode(buf))),
684 None => std::task::Poll::Ready(None),
685 }
686 }
687}
688
689#[derive(Debug)]
690pub enum EncodingValidatorEvent {}
691
692impl EncodingValidatorEvent {
693 fn decode(
695 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
696 ) -> Result<EncodingValidatorEvent, fidl::Error> {
697 let (bytes, _handles) = buf.split_mut();
698 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
699 debug_assert_eq!(tx_header.tx_id, 0);
700 match tx_header.ordinal {
701 _ => Err(fidl::Error::UnknownOrdinal {
702 ordinal: tx_header.ordinal,
703 protocol_name:
704 <EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
705 }),
706 }
707 }
708}
709
710pub struct EncodingValidatorRequestStream {
712 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
713 is_terminated: bool,
714}
715
716impl std::marker::Unpin for EncodingValidatorRequestStream {}
717
718impl futures::stream::FusedStream for EncodingValidatorRequestStream {
719 fn is_terminated(&self) -> bool {
720 self.is_terminated
721 }
722}
723
724impl fidl::endpoints::RequestStream for EncodingValidatorRequestStream {
725 type Protocol = EncodingValidatorMarker;
726 type ControlHandle = EncodingValidatorControlHandle;
727
728 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
729 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
730 }
731
732 fn control_handle(&self) -> Self::ControlHandle {
733 EncodingValidatorControlHandle { inner: self.inner.clone() }
734 }
735
736 fn into_inner(
737 self,
738 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
739 {
740 (self.inner, self.is_terminated)
741 }
742
743 fn from_inner(
744 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
745 is_terminated: bool,
746 ) -> Self {
747 Self { inner, is_terminated }
748 }
749}
750
751impl futures::Stream for EncodingValidatorRequestStream {
752 type Item = Result<EncodingValidatorRequest, fidl::Error>;
753
754 fn poll_next(
755 mut self: std::pin::Pin<&mut Self>,
756 cx: &mut std::task::Context<'_>,
757 ) -> std::task::Poll<Option<Self::Item>> {
758 let this = &mut *self;
759 if this.inner.check_shutdown(cx) {
760 this.is_terminated = true;
761 return std::task::Poll::Ready(None);
762 }
763 if this.is_terminated {
764 panic!("polled EncodingValidatorRequestStream after completion");
765 }
766 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
767 |bytes, handles| {
768 match this.inner.channel().read_etc(cx, bytes, handles) {
769 std::task::Poll::Ready(Ok(())) => {}
770 std::task::Poll::Pending => return std::task::Poll::Pending,
771 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
772 this.is_terminated = true;
773 return std::task::Poll::Ready(None);
774 }
775 std::task::Poll::Ready(Err(e)) => {
776 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
777 e.into(),
778 ))))
779 }
780 }
781
782 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
784
785 std::task::Poll::Ready(Some(match header.ordinal {
786 0x1ac204a62465f23c => {
787 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
788 let mut req = fidl::new_empty!(
789 EncodingValidatorValidateRequest,
790 fidl::encoding::DefaultFuchsiaResourceDialect
791 );
792 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EncodingValidatorValidateRequest>(&header, _body_bytes, handles, &mut req)?;
793 let control_handle =
794 EncodingValidatorControlHandle { inner: this.inner.clone() };
795 Ok(EncodingValidatorRequest::Validate {
796 results: req.results,
797
798 control_handle,
799 })
800 }
801 _ => Err(fidl::Error::UnknownOrdinal {
802 ordinal: header.ordinal,
803 protocol_name:
804 <EncodingValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
805 }),
806 }))
807 },
808 )
809 }
810}
811
812#[derive(Debug)]
813pub enum EncodingValidatorRequest {
814 Validate {
817 results: fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
818 control_handle: EncodingValidatorControlHandle,
819 },
820}
821
822impl EncodingValidatorRequest {
823 #[allow(irrefutable_let_patterns)]
824 pub fn into_validate(
825 self,
826 ) -> Option<(
827 fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
828 EncodingValidatorControlHandle,
829 )> {
830 if let EncodingValidatorRequest::Validate { results, control_handle } = self {
831 Some((results, control_handle))
832 } else {
833 None
834 }
835 }
836
837 pub fn method_name(&self) -> &'static str {
839 match *self {
840 EncodingValidatorRequest::Validate { .. } => "validate",
841 }
842 }
843}
844
845#[derive(Debug, Clone)]
846pub struct EncodingValidatorControlHandle {
847 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
848}
849
850impl fidl::endpoints::ControlHandle for EncodingValidatorControlHandle {
851 fn shutdown(&self) {
852 self.inner.shutdown()
853 }
854 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
855 self.inner.shutdown_with_epitaph(status)
856 }
857
858 fn is_closed(&self) -> bool {
859 self.inner.channel().is_closed()
860 }
861 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
862 self.inner.channel().on_closed()
863 }
864
865 #[cfg(target_os = "fuchsia")]
866 fn signal_peer(
867 &self,
868 clear_mask: zx::Signals,
869 set_mask: zx::Signals,
870 ) -> Result<(), zx_status::Status> {
871 use fidl::Peered;
872 self.inner.channel().signal_peer(clear_mask, set_mask)
873 }
874}
875
876impl EncodingValidatorControlHandle {}
877
878#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
879pub struct LogSinkPuppetMarker;
880
881impl fidl::endpoints::ProtocolMarker for LogSinkPuppetMarker {
882 type Proxy = LogSinkPuppetProxy;
883 type RequestStream = LogSinkPuppetRequestStream;
884 #[cfg(target_os = "fuchsia")]
885 type SynchronousProxy = LogSinkPuppetSynchronousProxy;
886
887 const DEBUG_NAME: &'static str = "fuchsia.validate.logs.LogSinkPuppet";
888}
889impl fidl::endpoints::DiscoverableProtocolMarker for LogSinkPuppetMarker {}
890
891pub trait LogSinkPuppetProxyInterface: Send + Sync {
892 type GetInfoResponseFut: std::future::Future<Output = Result<PuppetInfo, fidl::Error>> + Send;
893 fn r#get_info(&self) -> Self::GetInfoResponseFut;
894 type EmitLogResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
895 fn r#emit_log(&self, spec: &RecordSpec) -> Self::EmitLogResponseFut;
896 type StopInterestListenerResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
897 + Send;
898 fn r#stop_interest_listener(&self) -> Self::StopInterestListenerResponseFut;
899}
900#[derive(Debug)]
901#[cfg(target_os = "fuchsia")]
902pub struct LogSinkPuppetSynchronousProxy {
903 client: fidl::client::sync::Client,
904}
905
906#[cfg(target_os = "fuchsia")]
907impl fidl::endpoints::SynchronousProxy for LogSinkPuppetSynchronousProxy {
908 type Proxy = LogSinkPuppetProxy;
909 type Protocol = LogSinkPuppetMarker;
910
911 fn from_channel(inner: fidl::Channel) -> Self {
912 Self::new(inner)
913 }
914
915 fn into_channel(self) -> fidl::Channel {
916 self.client.into_channel()
917 }
918
919 fn as_channel(&self) -> &fidl::Channel {
920 self.client.as_channel()
921 }
922}
923
924#[cfg(target_os = "fuchsia")]
925impl LogSinkPuppetSynchronousProxy {
926 pub fn new(channel: fidl::Channel) -> Self {
927 let protocol_name = <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
928 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
929 }
930
931 pub fn into_channel(self) -> fidl::Channel {
932 self.client.into_channel()
933 }
934
935 pub fn wait_for_event(
938 &self,
939 deadline: zx::MonotonicInstant,
940 ) -> Result<LogSinkPuppetEvent, fidl::Error> {
941 LogSinkPuppetEvent::decode(self.client.wait_for_event(deadline)?)
942 }
943
944 pub fn r#get_info(&self, ___deadline: zx::MonotonicInstant) -> Result<PuppetInfo, fidl::Error> {
946 let _response =
947 self.client.send_query::<fidl::encoding::EmptyPayload, LogSinkPuppetGetInfoResponse>(
948 (),
949 0x5b1c3dac76c26425,
950 fidl::encoding::DynamicFlags::empty(),
951 ___deadline,
952 )?;
953 Ok(_response.info)
954 }
955
956 pub fn r#emit_log(
958 &self,
959 mut spec: &RecordSpec,
960 ___deadline: zx::MonotonicInstant,
961 ) -> Result<(), fidl::Error> {
962 let _response =
963 self.client.send_query::<LogSinkPuppetEmitLogRequest, fidl::encoding::EmptyPayload>(
964 (spec,),
965 0x58b64b6672ed66de,
966 fidl::encoding::DynamicFlags::empty(),
967 ___deadline,
968 )?;
969 Ok(_response)
970 }
971
972 pub fn r#stop_interest_listener(
974 &self,
975 ___deadline: zx::MonotonicInstant,
976 ) -> Result<(), fidl::Error> {
977 let _response =
978 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
979 (),
980 0x4c69520a50828cbd,
981 fidl::encoding::DynamicFlags::empty(),
982 ___deadline,
983 )?;
984 Ok(_response)
985 }
986}
987
988#[cfg(target_os = "fuchsia")]
989impl From<LogSinkPuppetSynchronousProxy> for zx::Handle {
990 fn from(value: LogSinkPuppetSynchronousProxy) -> Self {
991 value.into_channel().into()
992 }
993}
994
995#[cfg(target_os = "fuchsia")]
996impl From<fidl::Channel> for LogSinkPuppetSynchronousProxy {
997 fn from(value: fidl::Channel) -> Self {
998 Self::new(value)
999 }
1000}
1001
1002#[derive(Debug, Clone)]
1003pub struct LogSinkPuppetProxy {
1004 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1005}
1006
1007impl fidl::endpoints::Proxy for LogSinkPuppetProxy {
1008 type Protocol = LogSinkPuppetMarker;
1009
1010 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1011 Self::new(inner)
1012 }
1013
1014 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1015 self.client.into_channel().map_err(|client| Self { client })
1016 }
1017
1018 fn as_channel(&self) -> &::fidl::AsyncChannel {
1019 self.client.as_channel()
1020 }
1021}
1022
1023impl LogSinkPuppetProxy {
1024 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1026 let protocol_name = <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1027 Self { client: fidl::client::Client::new(channel, protocol_name) }
1028 }
1029
1030 pub fn take_event_stream(&self) -> LogSinkPuppetEventStream {
1036 LogSinkPuppetEventStream { event_receiver: self.client.take_event_receiver() }
1037 }
1038
1039 pub fn r#get_info(
1041 &self,
1042 ) -> fidl::client::QueryResponseFut<PuppetInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
1043 {
1044 LogSinkPuppetProxyInterface::r#get_info(self)
1045 }
1046
1047 pub fn r#emit_log(
1049 &self,
1050 mut spec: &RecordSpec,
1051 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1052 LogSinkPuppetProxyInterface::r#emit_log(self, spec)
1053 }
1054
1055 pub fn r#stop_interest_listener(
1057 &self,
1058 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1059 LogSinkPuppetProxyInterface::r#stop_interest_listener(self)
1060 }
1061}
1062
1063impl LogSinkPuppetProxyInterface for LogSinkPuppetProxy {
1064 type GetInfoResponseFut =
1065 fidl::client::QueryResponseFut<PuppetInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
1066 fn r#get_info(&self) -> Self::GetInfoResponseFut {
1067 fn _decode(
1068 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1069 ) -> Result<PuppetInfo, fidl::Error> {
1070 let _response = fidl::client::decode_transaction_body::<
1071 LogSinkPuppetGetInfoResponse,
1072 fidl::encoding::DefaultFuchsiaResourceDialect,
1073 0x5b1c3dac76c26425,
1074 >(_buf?)?;
1075 Ok(_response.info)
1076 }
1077 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PuppetInfo>(
1078 (),
1079 0x5b1c3dac76c26425,
1080 fidl::encoding::DynamicFlags::empty(),
1081 _decode,
1082 )
1083 }
1084
1085 type EmitLogResponseFut =
1086 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1087 fn r#emit_log(&self, mut spec: &RecordSpec) -> Self::EmitLogResponseFut {
1088 fn _decode(
1089 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1090 ) -> Result<(), fidl::Error> {
1091 let _response = fidl::client::decode_transaction_body::<
1092 fidl::encoding::EmptyPayload,
1093 fidl::encoding::DefaultFuchsiaResourceDialect,
1094 0x58b64b6672ed66de,
1095 >(_buf?)?;
1096 Ok(_response)
1097 }
1098 self.client.send_query_and_decode::<LogSinkPuppetEmitLogRequest, ()>(
1099 (spec,),
1100 0x58b64b6672ed66de,
1101 fidl::encoding::DynamicFlags::empty(),
1102 _decode,
1103 )
1104 }
1105
1106 type StopInterestListenerResponseFut =
1107 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1108 fn r#stop_interest_listener(&self) -> Self::StopInterestListenerResponseFut {
1109 fn _decode(
1110 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1111 ) -> Result<(), fidl::Error> {
1112 let _response = fidl::client::decode_transaction_body::<
1113 fidl::encoding::EmptyPayload,
1114 fidl::encoding::DefaultFuchsiaResourceDialect,
1115 0x4c69520a50828cbd,
1116 >(_buf?)?;
1117 Ok(_response)
1118 }
1119 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1120 (),
1121 0x4c69520a50828cbd,
1122 fidl::encoding::DynamicFlags::empty(),
1123 _decode,
1124 )
1125 }
1126}
1127
1128pub struct LogSinkPuppetEventStream {
1129 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1130}
1131
1132impl std::marker::Unpin for LogSinkPuppetEventStream {}
1133
1134impl futures::stream::FusedStream for LogSinkPuppetEventStream {
1135 fn is_terminated(&self) -> bool {
1136 self.event_receiver.is_terminated()
1137 }
1138}
1139
1140impl futures::Stream for LogSinkPuppetEventStream {
1141 type Item = Result<LogSinkPuppetEvent, fidl::Error>;
1142
1143 fn poll_next(
1144 mut self: std::pin::Pin<&mut Self>,
1145 cx: &mut std::task::Context<'_>,
1146 ) -> std::task::Poll<Option<Self::Item>> {
1147 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1148 &mut self.event_receiver,
1149 cx
1150 )?) {
1151 Some(buf) => std::task::Poll::Ready(Some(LogSinkPuppetEvent::decode(buf))),
1152 None => std::task::Poll::Ready(None),
1153 }
1154 }
1155}
1156
1157#[derive(Debug)]
1158pub enum LogSinkPuppetEvent {}
1159
1160impl LogSinkPuppetEvent {
1161 fn decode(
1163 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1164 ) -> Result<LogSinkPuppetEvent, fidl::Error> {
1165 let (bytes, _handles) = buf.split_mut();
1166 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1167 debug_assert_eq!(tx_header.tx_id, 0);
1168 match tx_header.ordinal {
1169 _ => Err(fidl::Error::UnknownOrdinal {
1170 ordinal: tx_header.ordinal,
1171 protocol_name: <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1172 }),
1173 }
1174 }
1175}
1176
1177pub struct LogSinkPuppetRequestStream {
1179 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1180 is_terminated: bool,
1181}
1182
1183impl std::marker::Unpin for LogSinkPuppetRequestStream {}
1184
1185impl futures::stream::FusedStream for LogSinkPuppetRequestStream {
1186 fn is_terminated(&self) -> bool {
1187 self.is_terminated
1188 }
1189}
1190
1191impl fidl::endpoints::RequestStream for LogSinkPuppetRequestStream {
1192 type Protocol = LogSinkPuppetMarker;
1193 type ControlHandle = LogSinkPuppetControlHandle;
1194
1195 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1196 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1197 }
1198
1199 fn control_handle(&self) -> Self::ControlHandle {
1200 LogSinkPuppetControlHandle { inner: self.inner.clone() }
1201 }
1202
1203 fn into_inner(
1204 self,
1205 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1206 {
1207 (self.inner, self.is_terminated)
1208 }
1209
1210 fn from_inner(
1211 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1212 is_terminated: bool,
1213 ) -> Self {
1214 Self { inner, is_terminated }
1215 }
1216}
1217
1218impl futures::Stream for LogSinkPuppetRequestStream {
1219 type Item = Result<LogSinkPuppetRequest, fidl::Error>;
1220
1221 fn poll_next(
1222 mut self: std::pin::Pin<&mut Self>,
1223 cx: &mut std::task::Context<'_>,
1224 ) -> std::task::Poll<Option<Self::Item>> {
1225 let this = &mut *self;
1226 if this.inner.check_shutdown(cx) {
1227 this.is_terminated = true;
1228 return std::task::Poll::Ready(None);
1229 }
1230 if this.is_terminated {
1231 panic!("polled LogSinkPuppetRequestStream after completion");
1232 }
1233 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1234 |bytes, handles| {
1235 match this.inner.channel().read_etc(cx, bytes, handles) {
1236 std::task::Poll::Ready(Ok(())) => {}
1237 std::task::Poll::Pending => return std::task::Poll::Pending,
1238 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1239 this.is_terminated = true;
1240 return std::task::Poll::Ready(None);
1241 }
1242 std::task::Poll::Ready(Err(e)) => {
1243 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1244 e.into(),
1245 ))))
1246 }
1247 }
1248
1249 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1251
1252 std::task::Poll::Ready(Some(match header.ordinal {
1253 0x5b1c3dac76c26425 => {
1254 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1255 let mut req = fidl::new_empty!(
1256 fidl::encoding::EmptyPayload,
1257 fidl::encoding::DefaultFuchsiaResourceDialect
1258 );
1259 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1260 let control_handle =
1261 LogSinkPuppetControlHandle { inner: this.inner.clone() };
1262 Ok(LogSinkPuppetRequest::GetInfo {
1263 responder: LogSinkPuppetGetInfoResponder {
1264 control_handle: std::mem::ManuallyDrop::new(control_handle),
1265 tx_id: header.tx_id,
1266 },
1267 })
1268 }
1269 0x58b64b6672ed66de => {
1270 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1271 let mut req = fidl::new_empty!(
1272 LogSinkPuppetEmitLogRequest,
1273 fidl::encoding::DefaultFuchsiaResourceDialect
1274 );
1275 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LogSinkPuppetEmitLogRequest>(&header, _body_bytes, handles, &mut req)?;
1276 let control_handle =
1277 LogSinkPuppetControlHandle { inner: this.inner.clone() };
1278 Ok(LogSinkPuppetRequest::EmitLog {
1279 spec: req.spec,
1280
1281 responder: LogSinkPuppetEmitLogResponder {
1282 control_handle: std::mem::ManuallyDrop::new(control_handle),
1283 tx_id: header.tx_id,
1284 },
1285 })
1286 }
1287 0x4c69520a50828cbd => {
1288 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1289 let mut req = fidl::new_empty!(
1290 fidl::encoding::EmptyPayload,
1291 fidl::encoding::DefaultFuchsiaResourceDialect
1292 );
1293 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1294 let control_handle =
1295 LogSinkPuppetControlHandle { inner: this.inner.clone() };
1296 Ok(LogSinkPuppetRequest::StopInterestListener {
1297 responder: LogSinkPuppetStopInterestListenerResponder {
1298 control_handle: std::mem::ManuallyDrop::new(control_handle),
1299 tx_id: header.tx_id,
1300 },
1301 })
1302 }
1303 _ => Err(fidl::Error::UnknownOrdinal {
1304 ordinal: header.ordinal,
1305 protocol_name:
1306 <LogSinkPuppetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1307 }),
1308 }))
1309 },
1310 )
1311 }
1312}
1313
1314#[derive(Debug)]
1315pub enum LogSinkPuppetRequest {
1316 GetInfo { responder: LogSinkPuppetGetInfoResponder },
1318 EmitLog { spec: RecordSpec, responder: LogSinkPuppetEmitLogResponder },
1320 StopInterestListener { responder: LogSinkPuppetStopInterestListenerResponder },
1322}
1323
1324impl LogSinkPuppetRequest {
1325 #[allow(irrefutable_let_patterns)]
1326 pub fn into_get_info(self) -> Option<(LogSinkPuppetGetInfoResponder)> {
1327 if let LogSinkPuppetRequest::GetInfo { responder } = self {
1328 Some((responder))
1329 } else {
1330 None
1331 }
1332 }
1333
1334 #[allow(irrefutable_let_patterns)]
1335 pub fn into_emit_log(self) -> Option<(RecordSpec, LogSinkPuppetEmitLogResponder)> {
1336 if let LogSinkPuppetRequest::EmitLog { spec, responder } = self {
1337 Some((spec, responder))
1338 } else {
1339 None
1340 }
1341 }
1342
1343 #[allow(irrefutable_let_patterns)]
1344 pub fn into_stop_interest_listener(
1345 self,
1346 ) -> Option<(LogSinkPuppetStopInterestListenerResponder)> {
1347 if let LogSinkPuppetRequest::StopInterestListener { responder } = self {
1348 Some((responder))
1349 } else {
1350 None
1351 }
1352 }
1353
1354 pub fn method_name(&self) -> &'static str {
1356 match *self {
1357 LogSinkPuppetRequest::GetInfo { .. } => "get_info",
1358 LogSinkPuppetRequest::EmitLog { .. } => "emit_log",
1359 LogSinkPuppetRequest::StopInterestListener { .. } => "stop_interest_listener",
1360 }
1361 }
1362}
1363
1364#[derive(Debug, Clone)]
1365pub struct LogSinkPuppetControlHandle {
1366 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1367}
1368
1369impl fidl::endpoints::ControlHandle for LogSinkPuppetControlHandle {
1370 fn shutdown(&self) {
1371 self.inner.shutdown()
1372 }
1373 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1374 self.inner.shutdown_with_epitaph(status)
1375 }
1376
1377 fn is_closed(&self) -> bool {
1378 self.inner.channel().is_closed()
1379 }
1380 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1381 self.inner.channel().on_closed()
1382 }
1383
1384 #[cfg(target_os = "fuchsia")]
1385 fn signal_peer(
1386 &self,
1387 clear_mask: zx::Signals,
1388 set_mask: zx::Signals,
1389 ) -> Result<(), zx_status::Status> {
1390 use fidl::Peered;
1391 self.inner.channel().signal_peer(clear_mask, set_mask)
1392 }
1393}
1394
1395impl LogSinkPuppetControlHandle {}
1396
1397#[must_use = "FIDL methods require a response to be sent"]
1398#[derive(Debug)]
1399pub struct LogSinkPuppetGetInfoResponder {
1400 control_handle: std::mem::ManuallyDrop<LogSinkPuppetControlHandle>,
1401 tx_id: u32,
1402}
1403
1404impl std::ops::Drop for LogSinkPuppetGetInfoResponder {
1408 fn drop(&mut self) {
1409 self.control_handle.shutdown();
1410 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1412 }
1413}
1414
1415impl fidl::endpoints::Responder for LogSinkPuppetGetInfoResponder {
1416 type ControlHandle = LogSinkPuppetControlHandle;
1417
1418 fn control_handle(&self) -> &LogSinkPuppetControlHandle {
1419 &self.control_handle
1420 }
1421
1422 fn drop_without_shutdown(mut self) {
1423 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1425 std::mem::forget(self);
1427 }
1428}
1429
1430impl LogSinkPuppetGetInfoResponder {
1431 pub fn send(self, mut info: &PuppetInfo) -> Result<(), fidl::Error> {
1435 let _result = self.send_raw(info);
1436 if _result.is_err() {
1437 self.control_handle.shutdown();
1438 }
1439 self.drop_without_shutdown();
1440 _result
1441 }
1442
1443 pub fn send_no_shutdown_on_err(self, mut info: &PuppetInfo) -> Result<(), fidl::Error> {
1445 let _result = self.send_raw(info);
1446 self.drop_without_shutdown();
1447 _result
1448 }
1449
1450 fn send_raw(&self, mut info: &PuppetInfo) -> Result<(), fidl::Error> {
1451 self.control_handle.inner.send::<LogSinkPuppetGetInfoResponse>(
1452 (info,),
1453 self.tx_id,
1454 0x5b1c3dac76c26425,
1455 fidl::encoding::DynamicFlags::empty(),
1456 )
1457 }
1458}
1459
1460#[must_use = "FIDL methods require a response to be sent"]
1461#[derive(Debug)]
1462pub struct LogSinkPuppetEmitLogResponder {
1463 control_handle: std::mem::ManuallyDrop<LogSinkPuppetControlHandle>,
1464 tx_id: u32,
1465}
1466
1467impl std::ops::Drop for LogSinkPuppetEmitLogResponder {
1471 fn drop(&mut self) {
1472 self.control_handle.shutdown();
1473 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1475 }
1476}
1477
1478impl fidl::endpoints::Responder for LogSinkPuppetEmitLogResponder {
1479 type ControlHandle = LogSinkPuppetControlHandle;
1480
1481 fn control_handle(&self) -> &LogSinkPuppetControlHandle {
1482 &self.control_handle
1483 }
1484
1485 fn drop_without_shutdown(mut self) {
1486 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1488 std::mem::forget(self);
1490 }
1491}
1492
1493impl LogSinkPuppetEmitLogResponder {
1494 pub fn send(self) -> Result<(), fidl::Error> {
1498 let _result = self.send_raw();
1499 if _result.is_err() {
1500 self.control_handle.shutdown();
1501 }
1502 self.drop_without_shutdown();
1503 _result
1504 }
1505
1506 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1508 let _result = self.send_raw();
1509 self.drop_without_shutdown();
1510 _result
1511 }
1512
1513 fn send_raw(&self) -> Result<(), fidl::Error> {
1514 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1515 (),
1516 self.tx_id,
1517 0x58b64b6672ed66de,
1518 fidl::encoding::DynamicFlags::empty(),
1519 )
1520 }
1521}
1522
1523#[must_use = "FIDL methods require a response to be sent"]
1524#[derive(Debug)]
1525pub struct LogSinkPuppetStopInterestListenerResponder {
1526 control_handle: std::mem::ManuallyDrop<LogSinkPuppetControlHandle>,
1527 tx_id: u32,
1528}
1529
1530impl std::ops::Drop for LogSinkPuppetStopInterestListenerResponder {
1534 fn drop(&mut self) {
1535 self.control_handle.shutdown();
1536 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1538 }
1539}
1540
1541impl fidl::endpoints::Responder for LogSinkPuppetStopInterestListenerResponder {
1542 type ControlHandle = LogSinkPuppetControlHandle;
1543
1544 fn control_handle(&self) -> &LogSinkPuppetControlHandle {
1545 &self.control_handle
1546 }
1547
1548 fn drop_without_shutdown(mut self) {
1549 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1551 std::mem::forget(self);
1553 }
1554}
1555
1556impl LogSinkPuppetStopInterestListenerResponder {
1557 pub fn send(self) -> Result<(), fidl::Error> {
1561 let _result = self.send_raw();
1562 if _result.is_err() {
1563 self.control_handle.shutdown();
1564 }
1565 self.drop_without_shutdown();
1566 _result
1567 }
1568
1569 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1571 let _result = self.send_raw();
1572 self.drop_without_shutdown();
1573 _result
1574 }
1575
1576 fn send_raw(&self) -> Result<(), fidl::Error> {
1577 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1578 (),
1579 self.tx_id,
1580 0x4c69520a50828cbd,
1581 fidl::encoding::DynamicFlags::empty(),
1582 )
1583 }
1584}
1585
1586#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1587pub struct ValidateResultsIteratorMarker;
1588
1589impl fidl::endpoints::ProtocolMarker for ValidateResultsIteratorMarker {
1590 type Proxy = ValidateResultsIteratorProxy;
1591 type RequestStream = ValidateResultsIteratorRequestStream;
1592 #[cfg(target_os = "fuchsia")]
1593 type SynchronousProxy = ValidateResultsIteratorSynchronousProxy;
1594
1595 const DEBUG_NAME: &'static str = "(anonymous) ValidateResultsIterator";
1596}
1597
1598pub trait ValidateResultsIteratorProxyInterface: Send + Sync {
1599 type GetNextResponseFut: std::future::Future<Output = Result<ValidateResultsIteratorGetNextResponse, fidl::Error>>
1600 + Send;
1601 fn r#get_next(&self) -> Self::GetNextResponseFut;
1602}
1603#[derive(Debug)]
1604#[cfg(target_os = "fuchsia")]
1605pub struct ValidateResultsIteratorSynchronousProxy {
1606 client: fidl::client::sync::Client,
1607}
1608
1609#[cfg(target_os = "fuchsia")]
1610impl fidl::endpoints::SynchronousProxy for ValidateResultsIteratorSynchronousProxy {
1611 type Proxy = ValidateResultsIteratorProxy;
1612 type Protocol = ValidateResultsIteratorMarker;
1613
1614 fn from_channel(inner: fidl::Channel) -> Self {
1615 Self::new(inner)
1616 }
1617
1618 fn into_channel(self) -> fidl::Channel {
1619 self.client.into_channel()
1620 }
1621
1622 fn as_channel(&self) -> &fidl::Channel {
1623 self.client.as_channel()
1624 }
1625}
1626
1627#[cfg(target_os = "fuchsia")]
1628impl ValidateResultsIteratorSynchronousProxy {
1629 pub fn new(channel: fidl::Channel) -> Self {
1630 let protocol_name =
1631 <ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1632 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1633 }
1634
1635 pub fn into_channel(self) -> fidl::Channel {
1636 self.client.into_channel()
1637 }
1638
1639 pub fn wait_for_event(
1642 &self,
1643 deadline: zx::MonotonicInstant,
1644 ) -> Result<ValidateResultsIteratorEvent, fidl::Error> {
1645 ValidateResultsIteratorEvent::decode(self.client.wait_for_event(deadline)?)
1646 }
1647
1648 pub fn r#get_next(
1650 &self,
1651 ___deadline: zx::MonotonicInstant,
1652 ) -> Result<ValidateResultsIteratorGetNextResponse, fidl::Error> {
1653 let _response = self
1654 .client
1655 .send_query::<fidl::encoding::EmptyPayload, ValidateResultsIteratorGetNextResponse>(
1656 (),
1657 0x1b1573e93311e8b7,
1658 fidl::encoding::DynamicFlags::empty(),
1659 ___deadline,
1660 )?;
1661 Ok(_response)
1662 }
1663}
1664
1665#[cfg(target_os = "fuchsia")]
1666impl From<ValidateResultsIteratorSynchronousProxy> for zx::Handle {
1667 fn from(value: ValidateResultsIteratorSynchronousProxy) -> Self {
1668 value.into_channel().into()
1669 }
1670}
1671
1672#[cfg(target_os = "fuchsia")]
1673impl From<fidl::Channel> for ValidateResultsIteratorSynchronousProxy {
1674 fn from(value: fidl::Channel) -> Self {
1675 Self::new(value)
1676 }
1677}
1678
1679#[derive(Debug, Clone)]
1680pub struct ValidateResultsIteratorProxy {
1681 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1682}
1683
1684impl fidl::endpoints::Proxy for ValidateResultsIteratorProxy {
1685 type Protocol = ValidateResultsIteratorMarker;
1686
1687 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1688 Self::new(inner)
1689 }
1690
1691 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1692 self.client.into_channel().map_err(|client| Self { client })
1693 }
1694
1695 fn as_channel(&self) -> &::fidl::AsyncChannel {
1696 self.client.as_channel()
1697 }
1698}
1699
1700impl ValidateResultsIteratorProxy {
1701 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1703 let protocol_name =
1704 <ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1705 Self { client: fidl::client::Client::new(channel, protocol_name) }
1706 }
1707
1708 pub fn take_event_stream(&self) -> ValidateResultsIteratorEventStream {
1714 ValidateResultsIteratorEventStream { event_receiver: self.client.take_event_receiver() }
1715 }
1716
1717 pub fn r#get_next(
1719 &self,
1720 ) -> fidl::client::QueryResponseFut<
1721 ValidateResultsIteratorGetNextResponse,
1722 fidl::encoding::DefaultFuchsiaResourceDialect,
1723 > {
1724 ValidateResultsIteratorProxyInterface::r#get_next(self)
1725 }
1726}
1727
1728impl ValidateResultsIteratorProxyInterface for ValidateResultsIteratorProxy {
1729 type GetNextResponseFut = fidl::client::QueryResponseFut<
1730 ValidateResultsIteratorGetNextResponse,
1731 fidl::encoding::DefaultFuchsiaResourceDialect,
1732 >;
1733 fn r#get_next(&self) -> Self::GetNextResponseFut {
1734 fn _decode(
1735 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1736 ) -> Result<ValidateResultsIteratorGetNextResponse, fidl::Error> {
1737 let _response = fidl::client::decode_transaction_body::<
1738 ValidateResultsIteratorGetNextResponse,
1739 fidl::encoding::DefaultFuchsiaResourceDialect,
1740 0x1b1573e93311e8b7,
1741 >(_buf?)?;
1742 Ok(_response)
1743 }
1744 self.client.send_query_and_decode::<
1745 fidl::encoding::EmptyPayload,
1746 ValidateResultsIteratorGetNextResponse,
1747 >(
1748 (),
1749 0x1b1573e93311e8b7,
1750 fidl::encoding::DynamicFlags::empty(),
1751 _decode,
1752 )
1753 }
1754}
1755
1756pub struct ValidateResultsIteratorEventStream {
1757 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1758}
1759
1760impl std::marker::Unpin for ValidateResultsIteratorEventStream {}
1761
1762impl futures::stream::FusedStream for ValidateResultsIteratorEventStream {
1763 fn is_terminated(&self) -> bool {
1764 self.event_receiver.is_terminated()
1765 }
1766}
1767
1768impl futures::Stream for ValidateResultsIteratorEventStream {
1769 type Item = Result<ValidateResultsIteratorEvent, fidl::Error>;
1770
1771 fn poll_next(
1772 mut self: std::pin::Pin<&mut Self>,
1773 cx: &mut std::task::Context<'_>,
1774 ) -> std::task::Poll<Option<Self::Item>> {
1775 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1776 &mut self.event_receiver,
1777 cx
1778 )?) {
1779 Some(buf) => std::task::Poll::Ready(Some(ValidateResultsIteratorEvent::decode(buf))),
1780 None => std::task::Poll::Ready(None),
1781 }
1782 }
1783}
1784
1785#[derive(Debug)]
1786pub enum ValidateResultsIteratorEvent {}
1787
1788impl ValidateResultsIteratorEvent {
1789 fn decode(
1791 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1792 ) -> Result<ValidateResultsIteratorEvent, fidl::Error> {
1793 let (bytes, _handles) = buf.split_mut();
1794 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1795 debug_assert_eq!(tx_header.tx_id, 0);
1796 match tx_header.ordinal {
1797 _ => Err(fidl::Error::UnknownOrdinal {
1798 ordinal: tx_header.ordinal,
1799 protocol_name:
1800 <ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1801 }),
1802 }
1803 }
1804}
1805
1806pub struct ValidateResultsIteratorRequestStream {
1808 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1809 is_terminated: bool,
1810}
1811
1812impl std::marker::Unpin for ValidateResultsIteratorRequestStream {}
1813
1814impl futures::stream::FusedStream for ValidateResultsIteratorRequestStream {
1815 fn is_terminated(&self) -> bool {
1816 self.is_terminated
1817 }
1818}
1819
1820impl fidl::endpoints::RequestStream for ValidateResultsIteratorRequestStream {
1821 type Protocol = ValidateResultsIteratorMarker;
1822 type ControlHandle = ValidateResultsIteratorControlHandle;
1823
1824 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1825 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1826 }
1827
1828 fn control_handle(&self) -> Self::ControlHandle {
1829 ValidateResultsIteratorControlHandle { inner: self.inner.clone() }
1830 }
1831
1832 fn into_inner(
1833 self,
1834 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1835 {
1836 (self.inner, self.is_terminated)
1837 }
1838
1839 fn from_inner(
1840 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1841 is_terminated: bool,
1842 ) -> Self {
1843 Self { inner, is_terminated }
1844 }
1845}
1846
1847impl futures::Stream for ValidateResultsIteratorRequestStream {
1848 type Item = Result<ValidateResultsIteratorRequest, fidl::Error>;
1849
1850 fn poll_next(
1851 mut self: std::pin::Pin<&mut Self>,
1852 cx: &mut std::task::Context<'_>,
1853 ) -> std::task::Poll<Option<Self::Item>> {
1854 let this = &mut *self;
1855 if this.inner.check_shutdown(cx) {
1856 this.is_terminated = true;
1857 return std::task::Poll::Ready(None);
1858 }
1859 if this.is_terminated {
1860 panic!("polled ValidateResultsIteratorRequestStream after completion");
1861 }
1862 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1863 |bytes, handles| {
1864 match this.inner.channel().read_etc(cx, bytes, handles) {
1865 std::task::Poll::Ready(Ok(())) => {}
1866 std::task::Poll::Pending => return std::task::Poll::Pending,
1867 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1868 this.is_terminated = true;
1869 return std::task::Poll::Ready(None);
1870 }
1871 std::task::Poll::Ready(Err(e)) => {
1872 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1873 e.into(),
1874 ))))
1875 }
1876 }
1877
1878 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1880
1881 std::task::Poll::Ready(Some(match header.ordinal {
1882 0x1b1573e93311e8b7 => {
1883 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1884 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
1885 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1886 let control_handle = ValidateResultsIteratorControlHandle {
1887 inner: this.inner.clone(),
1888 };
1889 Ok(ValidateResultsIteratorRequest::GetNext {
1890 responder: ValidateResultsIteratorGetNextResponder {
1891 control_handle: std::mem::ManuallyDrop::new(control_handle),
1892 tx_id: header.tx_id,
1893 },
1894 })
1895 }
1896 _ => Err(fidl::Error::UnknownOrdinal {
1897 ordinal: header.ordinal,
1898 protocol_name: <ValidateResultsIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1899 }),
1900 }))
1901 },
1902 )
1903 }
1904}
1905
1906#[derive(Debug)]
1907pub enum ValidateResultsIteratorRequest {
1908 GetNext { responder: ValidateResultsIteratorGetNextResponder },
1910}
1911
1912impl ValidateResultsIteratorRequest {
1913 #[allow(irrefutable_let_patterns)]
1914 pub fn into_get_next(self) -> Option<(ValidateResultsIteratorGetNextResponder)> {
1915 if let ValidateResultsIteratorRequest::GetNext { responder } = self {
1916 Some((responder))
1917 } else {
1918 None
1919 }
1920 }
1921
1922 pub fn method_name(&self) -> &'static str {
1924 match *self {
1925 ValidateResultsIteratorRequest::GetNext { .. } => "get_next",
1926 }
1927 }
1928}
1929
1930#[derive(Debug, Clone)]
1931pub struct ValidateResultsIteratorControlHandle {
1932 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1933}
1934
1935impl fidl::endpoints::ControlHandle for ValidateResultsIteratorControlHandle {
1936 fn shutdown(&self) {
1937 self.inner.shutdown()
1938 }
1939 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1940 self.inner.shutdown_with_epitaph(status)
1941 }
1942
1943 fn is_closed(&self) -> bool {
1944 self.inner.channel().is_closed()
1945 }
1946 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1947 self.inner.channel().on_closed()
1948 }
1949
1950 #[cfg(target_os = "fuchsia")]
1951 fn signal_peer(
1952 &self,
1953 clear_mask: zx::Signals,
1954 set_mask: zx::Signals,
1955 ) -> Result<(), zx_status::Status> {
1956 use fidl::Peered;
1957 self.inner.channel().signal_peer(clear_mask, set_mask)
1958 }
1959}
1960
1961impl ValidateResultsIteratorControlHandle {}
1962
1963#[must_use = "FIDL methods require a response to be sent"]
1964#[derive(Debug)]
1965pub struct ValidateResultsIteratorGetNextResponder {
1966 control_handle: std::mem::ManuallyDrop<ValidateResultsIteratorControlHandle>,
1967 tx_id: u32,
1968}
1969
1970impl std::ops::Drop for ValidateResultsIteratorGetNextResponder {
1974 fn drop(&mut self) {
1975 self.control_handle.shutdown();
1976 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1978 }
1979}
1980
1981impl fidl::endpoints::Responder for ValidateResultsIteratorGetNextResponder {
1982 type ControlHandle = ValidateResultsIteratorControlHandle;
1983
1984 fn control_handle(&self) -> &ValidateResultsIteratorControlHandle {
1985 &self.control_handle
1986 }
1987
1988 fn drop_without_shutdown(mut self) {
1989 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1991 std::mem::forget(self);
1993 }
1994}
1995
1996impl ValidateResultsIteratorGetNextResponder {
1997 pub fn send(
2001 self,
2002 mut payload: ValidateResultsIteratorGetNextResponse,
2003 ) -> Result<(), fidl::Error> {
2004 let _result = self.send_raw(payload);
2005 if _result.is_err() {
2006 self.control_handle.shutdown();
2007 }
2008 self.drop_without_shutdown();
2009 _result
2010 }
2011
2012 pub fn send_no_shutdown_on_err(
2014 self,
2015 mut payload: ValidateResultsIteratorGetNextResponse,
2016 ) -> Result<(), fidl::Error> {
2017 let _result = self.send_raw(payload);
2018 self.drop_without_shutdown();
2019 _result
2020 }
2021
2022 fn send_raw(
2023 &self,
2024 mut payload: ValidateResultsIteratorGetNextResponse,
2025 ) -> Result<(), fidl::Error> {
2026 self.control_handle.inner.send::<ValidateResultsIteratorGetNextResponse>(
2027 &mut payload,
2028 self.tx_id,
2029 0x1b1573e93311e8b7,
2030 fidl::encoding::DynamicFlags::empty(),
2031 )
2032 }
2033}
2034
2035mod internal {
2036 use super::*;
2037
2038 impl fidl::encoding::ResourceTypeMarker for EncodingPuppetEncodeResponse {
2039 type Borrowed<'a> = &'a mut Self;
2040 fn take_or_borrow<'a>(
2041 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2042 ) -> Self::Borrowed<'a> {
2043 value
2044 }
2045 }
2046
2047 unsafe impl fidl::encoding::TypeMarker for EncodingPuppetEncodeResponse {
2048 type Owned = Self;
2049
2050 #[inline(always)]
2051 fn inline_align(_context: fidl::encoding::Context) -> usize {
2052 8
2053 }
2054
2055 #[inline(always)]
2056 fn inline_size(_context: fidl::encoding::Context) -> usize {
2057 16
2058 }
2059 }
2060
2061 unsafe impl
2062 fidl::encoding::Encode<
2063 EncodingPuppetEncodeResponse,
2064 fidl::encoding::DefaultFuchsiaResourceDialect,
2065 > for &mut EncodingPuppetEncodeResponse
2066 {
2067 #[inline]
2068 unsafe fn encode(
2069 self,
2070 encoder: &mut fidl::encoding::Encoder<
2071 '_,
2072 fidl::encoding::DefaultFuchsiaResourceDialect,
2073 >,
2074 offset: usize,
2075 _depth: fidl::encoding::Depth,
2076 ) -> fidl::Result<()> {
2077 encoder.debug_check_bounds::<EncodingPuppetEncodeResponse>(offset);
2078 fidl::encoding::Encode::<
2080 EncodingPuppetEncodeResponse,
2081 fidl::encoding::DefaultFuchsiaResourceDialect,
2082 >::encode(
2083 (<fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2084 &mut self.result,
2085 ),),
2086 encoder,
2087 offset,
2088 _depth,
2089 )
2090 }
2091 }
2092 unsafe impl<
2093 T0: fidl::encoding::Encode<
2094 fidl_fuchsia_mem::Buffer,
2095 fidl::encoding::DefaultFuchsiaResourceDialect,
2096 >,
2097 >
2098 fidl::encoding::Encode<
2099 EncodingPuppetEncodeResponse,
2100 fidl::encoding::DefaultFuchsiaResourceDialect,
2101 > for (T0,)
2102 {
2103 #[inline]
2104 unsafe fn encode(
2105 self,
2106 encoder: &mut fidl::encoding::Encoder<
2107 '_,
2108 fidl::encoding::DefaultFuchsiaResourceDialect,
2109 >,
2110 offset: usize,
2111 depth: fidl::encoding::Depth,
2112 ) -> fidl::Result<()> {
2113 encoder.debug_check_bounds::<EncodingPuppetEncodeResponse>(offset);
2114 self.0.encode(encoder, offset + 0, depth)?;
2118 Ok(())
2119 }
2120 }
2121
2122 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2123 for EncodingPuppetEncodeResponse
2124 {
2125 #[inline(always)]
2126 fn new_empty() -> Self {
2127 Self {
2128 result: fidl::new_empty!(
2129 fidl_fuchsia_mem::Buffer,
2130 fidl::encoding::DefaultFuchsiaResourceDialect
2131 ),
2132 }
2133 }
2134
2135 #[inline]
2136 unsafe fn decode(
2137 &mut self,
2138 decoder: &mut fidl::encoding::Decoder<
2139 '_,
2140 fidl::encoding::DefaultFuchsiaResourceDialect,
2141 >,
2142 offset: usize,
2143 _depth: fidl::encoding::Depth,
2144 ) -> fidl::Result<()> {
2145 decoder.debug_check_bounds::<Self>(offset);
2146 fidl::decode!(
2148 fidl_fuchsia_mem::Buffer,
2149 fidl::encoding::DefaultFuchsiaResourceDialect,
2150 &mut self.result,
2151 decoder,
2152 offset + 0,
2153 _depth
2154 )?;
2155 Ok(())
2156 }
2157 }
2158
2159 impl fidl::encoding::ResourceTypeMarker for EncodingValidatorValidateRequest {
2160 type Borrowed<'a> = &'a mut Self;
2161 fn take_or_borrow<'a>(
2162 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2163 ) -> Self::Borrowed<'a> {
2164 value
2165 }
2166 }
2167
2168 unsafe impl fidl::encoding::TypeMarker for EncodingValidatorValidateRequest {
2169 type Owned = Self;
2170
2171 #[inline(always)]
2172 fn inline_align(_context: fidl::encoding::Context) -> usize {
2173 4
2174 }
2175
2176 #[inline(always)]
2177 fn inline_size(_context: fidl::encoding::Context) -> usize {
2178 4
2179 }
2180 }
2181
2182 unsafe impl
2183 fidl::encoding::Encode<
2184 EncodingValidatorValidateRequest,
2185 fidl::encoding::DefaultFuchsiaResourceDialect,
2186 > for &mut EncodingValidatorValidateRequest
2187 {
2188 #[inline]
2189 unsafe fn encode(
2190 self,
2191 encoder: &mut fidl::encoding::Encoder<
2192 '_,
2193 fidl::encoding::DefaultFuchsiaResourceDialect,
2194 >,
2195 offset: usize,
2196 _depth: fidl::encoding::Depth,
2197 ) -> fidl::Result<()> {
2198 encoder.debug_check_bounds::<EncodingValidatorValidateRequest>(offset);
2199 fidl::encoding::Encode::<
2201 EncodingValidatorValidateRequest,
2202 fidl::encoding::DefaultFuchsiaResourceDialect,
2203 >::encode(
2204 (<fidl::encoding::Endpoint<
2205 fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
2206 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2207 &mut self.results
2208 ),),
2209 encoder,
2210 offset,
2211 _depth,
2212 )
2213 }
2214 }
2215 unsafe impl<
2216 T0: fidl::encoding::Encode<
2217 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>>,
2218 fidl::encoding::DefaultFuchsiaResourceDialect,
2219 >,
2220 >
2221 fidl::encoding::Encode<
2222 EncodingValidatorValidateRequest,
2223 fidl::encoding::DefaultFuchsiaResourceDialect,
2224 > for (T0,)
2225 {
2226 #[inline]
2227 unsafe fn encode(
2228 self,
2229 encoder: &mut fidl::encoding::Encoder<
2230 '_,
2231 fidl::encoding::DefaultFuchsiaResourceDialect,
2232 >,
2233 offset: usize,
2234 depth: fidl::encoding::Depth,
2235 ) -> fidl::Result<()> {
2236 encoder.debug_check_bounds::<EncodingValidatorValidateRequest>(offset);
2237 self.0.encode(encoder, offset + 0, depth)?;
2241 Ok(())
2242 }
2243 }
2244
2245 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2246 for EncodingValidatorValidateRequest
2247 {
2248 #[inline(always)]
2249 fn new_empty() -> Self {
2250 Self {
2251 results: fidl::new_empty!(
2252 fidl::encoding::Endpoint<
2253 fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>,
2254 >,
2255 fidl::encoding::DefaultFuchsiaResourceDialect
2256 ),
2257 }
2258 }
2259
2260 #[inline]
2261 unsafe fn decode(
2262 &mut self,
2263 decoder: &mut fidl::encoding::Decoder<
2264 '_,
2265 fidl::encoding::DefaultFuchsiaResourceDialect,
2266 >,
2267 offset: usize,
2268 _depth: fidl::encoding::Depth,
2269 ) -> fidl::Result<()> {
2270 decoder.debug_check_bounds::<Self>(offset);
2271 fidl::decode!(
2273 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ValidateResultsIteratorMarker>>,
2274 fidl::encoding::DefaultFuchsiaResourceDialect,
2275 &mut self.results,
2276 decoder,
2277 offset + 0,
2278 _depth
2279 )?;
2280 Ok(())
2281 }
2282 }
2283
2284 impl ValidateResultsIteratorGetNextResponse {
2285 #[inline(always)]
2286 fn max_ordinal_present(&self) -> u64 {
2287 if let Some(_) = self.result {
2288 return 1;
2289 }
2290 0
2291 }
2292 }
2293
2294 impl fidl::encoding::ResourceTypeMarker for ValidateResultsIteratorGetNextResponse {
2295 type Borrowed<'a> = &'a mut Self;
2296 fn take_or_borrow<'a>(
2297 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2298 ) -> Self::Borrowed<'a> {
2299 value
2300 }
2301 }
2302
2303 unsafe impl fidl::encoding::TypeMarker for ValidateResultsIteratorGetNextResponse {
2304 type Owned = Self;
2305
2306 #[inline(always)]
2307 fn inline_align(_context: fidl::encoding::Context) -> usize {
2308 8
2309 }
2310
2311 #[inline(always)]
2312 fn inline_size(_context: fidl::encoding::Context) -> usize {
2313 16
2314 }
2315 }
2316
2317 unsafe impl
2318 fidl::encoding::Encode<
2319 ValidateResultsIteratorGetNextResponse,
2320 fidl::encoding::DefaultFuchsiaResourceDialect,
2321 > for &mut ValidateResultsIteratorGetNextResponse
2322 {
2323 unsafe fn encode(
2324 self,
2325 encoder: &mut fidl::encoding::Encoder<
2326 '_,
2327 fidl::encoding::DefaultFuchsiaResourceDialect,
2328 >,
2329 offset: usize,
2330 mut depth: fidl::encoding::Depth,
2331 ) -> fidl::Result<()> {
2332 encoder.debug_check_bounds::<ValidateResultsIteratorGetNextResponse>(offset);
2333 let max_ordinal: u64 = self.max_ordinal_present();
2335 encoder.write_num(max_ordinal, offset);
2336 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2337 if max_ordinal == 0 {
2339 return Ok(());
2340 }
2341 depth.increment()?;
2342 let envelope_size = 8;
2343 let bytes_len = max_ordinal as usize * envelope_size;
2344 #[allow(unused_variables)]
2345 let offset = encoder.out_of_line_offset(bytes_len);
2346 let mut _prev_end_offset: usize = 0;
2347 if 1 > max_ordinal {
2348 return Ok(());
2349 }
2350
2351 let cur_offset: usize = (1 - 1) * envelope_size;
2354
2355 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2357
2358 fidl::encoding::encode_in_envelope_optional::<
2363 ValidateResult,
2364 fidl::encoding::DefaultFuchsiaResourceDialect,
2365 >(
2366 self.result
2367 .as_ref()
2368 .map(<ValidateResult as fidl::encoding::ValueTypeMarker>::borrow),
2369 encoder,
2370 offset + cur_offset,
2371 depth,
2372 )?;
2373
2374 _prev_end_offset = cur_offset + envelope_size;
2375
2376 Ok(())
2377 }
2378 }
2379
2380 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2381 for ValidateResultsIteratorGetNextResponse
2382 {
2383 #[inline(always)]
2384 fn new_empty() -> Self {
2385 Self::default()
2386 }
2387
2388 unsafe fn decode(
2389 &mut self,
2390 decoder: &mut fidl::encoding::Decoder<
2391 '_,
2392 fidl::encoding::DefaultFuchsiaResourceDialect,
2393 >,
2394 offset: usize,
2395 mut depth: fidl::encoding::Depth,
2396 ) -> fidl::Result<()> {
2397 decoder.debug_check_bounds::<Self>(offset);
2398 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2399 None => return Err(fidl::Error::NotNullable),
2400 Some(len) => len,
2401 };
2402 if len == 0 {
2404 return Ok(());
2405 };
2406 depth.increment()?;
2407 let envelope_size = 8;
2408 let bytes_len = len * envelope_size;
2409 let offset = decoder.out_of_line_offset(bytes_len)?;
2410 let mut _next_ordinal_to_read = 0;
2412 let mut next_offset = offset;
2413 let end_offset = offset + bytes_len;
2414 _next_ordinal_to_read += 1;
2415 if next_offset >= end_offset {
2416 return Ok(());
2417 }
2418
2419 while _next_ordinal_to_read < 1 {
2421 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2422 _next_ordinal_to_read += 1;
2423 next_offset += envelope_size;
2424 }
2425
2426 let next_out_of_line = decoder.next_out_of_line();
2427 let handles_before = decoder.remaining_handles();
2428 if let Some((inlined, num_bytes, num_handles)) =
2429 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2430 {
2431 let member_inline_size =
2432 <ValidateResult as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2433 if inlined != (member_inline_size <= 4) {
2434 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2435 }
2436 let inner_offset;
2437 let mut inner_depth = depth.clone();
2438 if inlined {
2439 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2440 inner_offset = next_offset;
2441 } else {
2442 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2443 inner_depth.increment()?;
2444 }
2445 let val_ref = self.result.get_or_insert_with(|| {
2446 fidl::new_empty!(ValidateResult, fidl::encoding::DefaultFuchsiaResourceDialect)
2447 });
2448 fidl::decode!(
2449 ValidateResult,
2450 fidl::encoding::DefaultFuchsiaResourceDialect,
2451 val_ref,
2452 decoder,
2453 inner_offset,
2454 inner_depth
2455 )?;
2456 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2457 {
2458 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2459 }
2460 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2461 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2462 }
2463 }
2464
2465 next_offset += envelope_size;
2466
2467 while next_offset < end_offset {
2469 _next_ordinal_to_read += 1;
2470 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2471 next_offset += envelope_size;
2472 }
2473
2474 Ok(())
2475 }
2476 }
2477}