1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fdomain_client::fidl::{ControlHandle as _, FDomainFlexibleIntoResult as _, Responder as _};
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9pub use fidl_fuchsia_net_debug_common::*;
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14pub struct DiagnosticsGetProcessHandleForInspectionResponse {
15 pub process: fdomain_client::Process,
16}
17
18impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
19 for DiagnosticsGetProcessHandleForInspectionResponse
20{
21}
22
23#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
24pub struct InterfacesGetPortRequest {
25 pub id: u64,
26 pub port: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_hardware_network::PortMarker>,
27}
28
29impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for InterfacesGetPortRequest {}
30
31#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
32pub struct PacketCaptureProviderReconnectRollingRequest {
33 pub name: String,
36}
37
38impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
39 for PacketCaptureProviderReconnectRollingRequest
40{
41}
42
43#[derive(Debug, PartialEq)]
44pub struct PacketCaptureProviderStartRollingRequest {
45 pub common_params: CommonPacketCaptureParams,
46 pub params: RollingPacketCaptureParams,
47}
48
49impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
50 for PacketCaptureProviderStartRollingRequest
51{
52}
53
54#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
55pub struct PacketCaptureProviderReconnectRollingResponse {
56 pub channel: fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
57}
58
59impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
60 for PacketCaptureProviderReconnectRollingResponse
61{
62}
63
64#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
65pub struct PacketCaptureProviderStartRollingResponse {
66 pub channel: fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
67}
68
69impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
70 for PacketCaptureProviderStartRollingResponse
71{
72}
73
74#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
75pub struct RollingPacketCaptureStopAndDownloadRequest {
76 pub channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
79}
80
81impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
82 for RollingPacketCaptureStopAndDownloadRequest
83{
84}
85
86#[derive(Debug, Default, PartialEq)]
88pub struct CommonPacketCaptureParams {
89 pub interfaces: Option<InterfaceSpecifier>,
93 pub bpf_program: Option<fdomain_fuchsia_ebpf::VerifiedProgram>,
100 pub snap_len: Option<u32>,
105 #[doc(hidden)]
106 pub __source_breaking: fidl::marker::SourceBreaking,
107}
108
109impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for CommonPacketCaptureParams {}
110
111#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
112pub struct DiagnosticsMarker;
113
114impl fdomain_client::fidl::ProtocolMarker for DiagnosticsMarker {
115 type Proxy = DiagnosticsProxy;
116 type RequestStream = DiagnosticsRequestStream;
117
118 const DEBUG_NAME: &'static str = "fuchsia.net.debug.Diagnostics";
119}
120impl fdomain_client::fidl::DiscoverableProtocolMarker for DiagnosticsMarker {}
121
122pub trait DiagnosticsProxyInterface: Send + Sync {
123 type LogDebugInfoToSyslogResponseFut: std::future::Future<Output = Result<(), fidl::Error>>
124 + Send;
125 fn r#log_debug_info_to_syslog(&self) -> Self::LogDebugInfoToSyslogResponseFut;
126 type GetProcessHandleForInspectionResponseFut: std::future::Future<Output = Result<fdomain_client::Process, fidl::Error>>
127 + Send;
128 fn r#get_process_handle_for_inspection(&self)
129 -> Self::GetProcessHandleForInspectionResponseFut;
130}
131
132#[derive(Debug, Clone)]
133pub struct DiagnosticsProxy {
134 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
135}
136
137impl fdomain_client::fidl::Proxy for DiagnosticsProxy {
138 type Protocol = DiagnosticsMarker;
139
140 fn from_channel(inner: fdomain_client::Channel) -> Self {
141 Self::new(inner)
142 }
143
144 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
145 self.client.into_channel().map_err(|client| Self { client })
146 }
147
148 fn as_channel(&self) -> &fdomain_client::Channel {
149 self.client.as_channel()
150 }
151}
152
153impl DiagnosticsProxy {
154 pub fn new(channel: fdomain_client::Channel) -> Self {
156 let protocol_name = <DiagnosticsMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
157 Self { client: fidl::client::Client::new(channel, protocol_name) }
158 }
159
160 pub fn take_event_stream(&self) -> DiagnosticsEventStream {
166 DiagnosticsEventStream { event_receiver: self.client.take_event_receiver() }
167 }
168
169 pub fn r#log_debug_info_to_syslog(
174 &self,
175 ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
176 DiagnosticsProxyInterface::r#log_debug_info_to_syslog(self)
177 }
178
179 pub fn r#get_process_handle_for_inspection(
184 &self,
185 ) -> fidl::client::QueryResponseFut<
186 fdomain_client::Process,
187 fdomain_client::fidl::FDomainResourceDialect,
188 > {
189 DiagnosticsProxyInterface::r#get_process_handle_for_inspection(self)
190 }
191}
192
193impl DiagnosticsProxyInterface for DiagnosticsProxy {
194 type LogDebugInfoToSyslogResponseFut =
195 fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
196 fn r#log_debug_info_to_syslog(&self) -> Self::LogDebugInfoToSyslogResponseFut {
197 fn _decode(
198 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
199 ) -> Result<(), fidl::Error> {
200 let _response = fidl::client::decode_transaction_body::<
201 fidl::encoding::EmptyPayload,
202 fdomain_client::fidl::FDomainResourceDialect,
203 0x336c39330bd8e1ac,
204 >(_buf?)?;
205 Ok(_response)
206 }
207 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
208 (),
209 0x336c39330bd8e1ac,
210 fidl::encoding::DynamicFlags::empty(),
211 _decode,
212 )
213 }
214
215 type GetProcessHandleForInspectionResponseFut = fidl::client::QueryResponseFut<
216 fdomain_client::Process,
217 fdomain_client::fidl::FDomainResourceDialect,
218 >;
219 fn r#get_process_handle_for_inspection(
220 &self,
221 ) -> Self::GetProcessHandleForInspectionResponseFut {
222 fn _decode(
223 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
224 ) -> Result<fdomain_client::Process, fidl::Error> {
225 let _response = fidl::client::decode_transaction_body::<
226 DiagnosticsGetProcessHandleForInspectionResponse,
227 fdomain_client::fidl::FDomainResourceDialect,
228 0x563e5df030f2f4d5,
229 >(_buf?)?;
230 Ok(_response.process)
231 }
232 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fdomain_client::Process>(
233 (),
234 0x563e5df030f2f4d5,
235 fidl::encoding::DynamicFlags::empty(),
236 _decode,
237 )
238 }
239}
240
241pub struct DiagnosticsEventStream {
242 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
243}
244
245impl std::marker::Unpin for DiagnosticsEventStream {}
246
247impl futures::stream::FusedStream for DiagnosticsEventStream {
248 fn is_terminated(&self) -> bool {
249 self.event_receiver.is_terminated()
250 }
251}
252
253impl futures::Stream for DiagnosticsEventStream {
254 type Item = Result<DiagnosticsEvent, fidl::Error>;
255
256 fn poll_next(
257 mut self: std::pin::Pin<&mut Self>,
258 cx: &mut std::task::Context<'_>,
259 ) -> std::task::Poll<Option<Self::Item>> {
260 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
261 &mut self.event_receiver,
262 cx
263 )?) {
264 Some(buf) => std::task::Poll::Ready(Some(DiagnosticsEvent::decode(buf))),
265 None => std::task::Poll::Ready(None),
266 }
267 }
268}
269
270#[derive(Debug)]
271pub enum DiagnosticsEvent {}
272
273impl DiagnosticsEvent {
274 fn decode(
276 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
277 ) -> Result<DiagnosticsEvent, fidl::Error> {
278 let (bytes, _handles) = buf.split_mut();
279 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
280 debug_assert_eq!(tx_header.tx_id, 0);
281 match tx_header.ordinal {
282 _ => Err(fidl::Error::UnknownOrdinal {
283 ordinal: tx_header.ordinal,
284 protocol_name:
285 <DiagnosticsMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
286 }),
287 }
288 }
289}
290
291pub struct DiagnosticsRequestStream {
293 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
294 is_terminated: bool,
295}
296
297impl std::marker::Unpin for DiagnosticsRequestStream {}
298
299impl futures::stream::FusedStream for DiagnosticsRequestStream {
300 fn is_terminated(&self) -> bool {
301 self.is_terminated
302 }
303}
304
305impl fdomain_client::fidl::RequestStream for DiagnosticsRequestStream {
306 type Protocol = DiagnosticsMarker;
307 type ControlHandle = DiagnosticsControlHandle;
308
309 fn from_channel(channel: fdomain_client::Channel) -> Self {
310 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
311 }
312
313 fn control_handle(&self) -> Self::ControlHandle {
314 DiagnosticsControlHandle { inner: self.inner.clone() }
315 }
316
317 fn into_inner(
318 self,
319 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
320 {
321 (self.inner, self.is_terminated)
322 }
323
324 fn from_inner(
325 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
326 is_terminated: bool,
327 ) -> Self {
328 Self { inner, is_terminated }
329 }
330}
331
332impl futures::Stream for DiagnosticsRequestStream {
333 type Item = Result<DiagnosticsRequest, fidl::Error>;
334
335 fn poll_next(
336 mut self: std::pin::Pin<&mut Self>,
337 cx: &mut std::task::Context<'_>,
338 ) -> std::task::Poll<Option<Self::Item>> {
339 let this = &mut *self;
340 if this.inner.check_shutdown(cx) {
341 this.is_terminated = true;
342 return std::task::Poll::Ready(None);
343 }
344 if this.is_terminated {
345 panic!("polled DiagnosticsRequestStream after completion");
346 }
347 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
348 |bytes, handles| {
349 match this.inner.channel().read_etc(cx, bytes, handles) {
350 std::task::Poll::Ready(Ok(())) => {}
351 std::task::Poll::Pending => return std::task::Poll::Pending,
352 std::task::Poll::Ready(Err(None)) => {
353 this.is_terminated = true;
354 return std::task::Poll::Ready(None);
355 }
356 std::task::Poll::Ready(Err(Some(e))) => {
357 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
358 e.into(),
359 ))));
360 }
361 }
362
363 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
365
366 std::task::Poll::Ready(Some(match header.ordinal {
367 0x336c39330bd8e1ac => {
368 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
369 let mut req = fidl::new_empty!(
370 fidl::encoding::EmptyPayload,
371 fdomain_client::fidl::FDomainResourceDialect
372 );
373 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
374 let control_handle = DiagnosticsControlHandle { inner: this.inner.clone() };
375 Ok(DiagnosticsRequest::LogDebugInfoToSyslog {
376 responder: DiagnosticsLogDebugInfoToSyslogResponder {
377 control_handle: std::mem::ManuallyDrop::new(control_handle),
378 tx_id: header.tx_id,
379 },
380 })
381 }
382 0x563e5df030f2f4d5 => {
383 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
384 let mut req = fidl::new_empty!(
385 fidl::encoding::EmptyPayload,
386 fdomain_client::fidl::FDomainResourceDialect
387 );
388 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
389 let control_handle = DiagnosticsControlHandle { inner: this.inner.clone() };
390 Ok(DiagnosticsRequest::GetProcessHandleForInspection {
391 responder: DiagnosticsGetProcessHandleForInspectionResponder {
392 control_handle: std::mem::ManuallyDrop::new(control_handle),
393 tx_id: header.tx_id,
394 },
395 })
396 }
397 _ => Err(fidl::Error::UnknownOrdinal {
398 ordinal: header.ordinal,
399 protocol_name:
400 <DiagnosticsMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
401 }),
402 }))
403 },
404 )
405 }
406}
407
408#[derive(Debug)]
410pub enum DiagnosticsRequest {
411 LogDebugInfoToSyslog { responder: DiagnosticsLogDebugInfoToSyslogResponder },
416 GetProcessHandleForInspection { responder: DiagnosticsGetProcessHandleForInspectionResponder },
421}
422
423impl DiagnosticsRequest {
424 #[allow(irrefutable_let_patterns)]
425 pub fn into_log_debug_info_to_syslog(
426 self,
427 ) -> Option<(DiagnosticsLogDebugInfoToSyslogResponder)> {
428 if let DiagnosticsRequest::LogDebugInfoToSyslog { responder } = self {
429 Some((responder))
430 } else {
431 None
432 }
433 }
434
435 #[allow(irrefutable_let_patterns)]
436 pub fn into_get_process_handle_for_inspection(
437 self,
438 ) -> Option<(DiagnosticsGetProcessHandleForInspectionResponder)> {
439 if let DiagnosticsRequest::GetProcessHandleForInspection { responder } = self {
440 Some((responder))
441 } else {
442 None
443 }
444 }
445
446 pub fn method_name(&self) -> &'static str {
448 match *self {
449 DiagnosticsRequest::LogDebugInfoToSyslog { .. } => "log_debug_info_to_syslog",
450 DiagnosticsRequest::GetProcessHandleForInspection { .. } => {
451 "get_process_handle_for_inspection"
452 }
453 }
454 }
455}
456
457#[derive(Debug, Clone)]
458pub struct DiagnosticsControlHandle {
459 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
460}
461
462impl fdomain_client::fidl::ControlHandle for DiagnosticsControlHandle {
463 fn shutdown(&self) {
464 self.inner.shutdown()
465 }
466
467 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
468 self.inner.shutdown_with_epitaph(status)
469 }
470
471 fn is_closed(&self) -> bool {
472 self.inner.channel().is_closed()
473 }
474 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
475 self.inner.channel().on_closed()
476 }
477}
478
479impl DiagnosticsControlHandle {}
480
481#[must_use = "FIDL methods require a response to be sent"]
482#[derive(Debug)]
483pub struct DiagnosticsLogDebugInfoToSyslogResponder {
484 control_handle: std::mem::ManuallyDrop<DiagnosticsControlHandle>,
485 tx_id: u32,
486}
487
488impl std::ops::Drop for DiagnosticsLogDebugInfoToSyslogResponder {
492 fn drop(&mut self) {
493 self.control_handle.shutdown();
494 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
496 }
497}
498
499impl fdomain_client::fidl::Responder for DiagnosticsLogDebugInfoToSyslogResponder {
500 type ControlHandle = DiagnosticsControlHandle;
501
502 fn control_handle(&self) -> &DiagnosticsControlHandle {
503 &self.control_handle
504 }
505
506 fn drop_without_shutdown(mut self) {
507 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
509 std::mem::forget(self);
511 }
512}
513
514impl DiagnosticsLogDebugInfoToSyslogResponder {
515 pub fn send(self) -> Result<(), fidl::Error> {
519 let _result = self.send_raw();
520 if _result.is_err() {
521 self.control_handle.shutdown();
522 }
523 self.drop_without_shutdown();
524 _result
525 }
526
527 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
529 let _result = self.send_raw();
530 self.drop_without_shutdown();
531 _result
532 }
533
534 fn send_raw(&self) -> Result<(), fidl::Error> {
535 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
536 (),
537 self.tx_id,
538 0x336c39330bd8e1ac,
539 fidl::encoding::DynamicFlags::empty(),
540 )
541 }
542}
543
544#[must_use = "FIDL methods require a response to be sent"]
545#[derive(Debug)]
546pub struct DiagnosticsGetProcessHandleForInspectionResponder {
547 control_handle: std::mem::ManuallyDrop<DiagnosticsControlHandle>,
548 tx_id: u32,
549}
550
551impl std::ops::Drop for DiagnosticsGetProcessHandleForInspectionResponder {
555 fn drop(&mut self) {
556 self.control_handle.shutdown();
557 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
559 }
560}
561
562impl fdomain_client::fidl::Responder for DiagnosticsGetProcessHandleForInspectionResponder {
563 type ControlHandle = DiagnosticsControlHandle;
564
565 fn control_handle(&self) -> &DiagnosticsControlHandle {
566 &self.control_handle
567 }
568
569 fn drop_without_shutdown(mut self) {
570 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
572 std::mem::forget(self);
574 }
575}
576
577impl DiagnosticsGetProcessHandleForInspectionResponder {
578 pub fn send(self, mut process: fdomain_client::Process) -> Result<(), fidl::Error> {
582 let _result = self.send_raw(process);
583 if _result.is_err() {
584 self.control_handle.shutdown();
585 }
586 self.drop_without_shutdown();
587 _result
588 }
589
590 pub fn send_no_shutdown_on_err(
592 self,
593 mut process: fdomain_client::Process,
594 ) -> Result<(), fidl::Error> {
595 let _result = self.send_raw(process);
596 self.drop_without_shutdown();
597 _result
598 }
599
600 fn send_raw(&self, mut process: fdomain_client::Process) -> Result<(), fidl::Error> {
601 self.control_handle.inner.send::<DiagnosticsGetProcessHandleForInspectionResponse>(
602 (process,),
603 self.tx_id,
604 0x563e5df030f2f4d5,
605 fidl::encoding::DynamicFlags::empty(),
606 )
607 }
608}
609
610#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
611pub struct InterfacesMarker;
612
613impl fdomain_client::fidl::ProtocolMarker for InterfacesMarker {
614 type Proxy = InterfacesProxy;
615 type RequestStream = InterfacesRequestStream;
616
617 const DEBUG_NAME: &'static str = "fuchsia.net.debug.Interfaces";
618}
619impl fdomain_client::fidl::DiscoverableProtocolMarker for InterfacesMarker {}
620pub type InterfacesCloseBackingSessionResult = Result<(), CloseSessionError>;
621
622pub trait InterfacesProxyInterface: Send + Sync {
623 fn r#get_port(
624 &self,
625 id: u64,
626 port: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_hardware_network::PortMarker>,
627 ) -> Result<(), fidl::Error>;
628 type CloseBackingSessionResponseFut: std::future::Future<Output = Result<InterfacesCloseBackingSessionResult, fidl::Error>>
629 + Send;
630 fn r#close_backing_session(&self, id: u64) -> Self::CloseBackingSessionResponseFut;
631}
632
633#[derive(Debug, Clone)]
634pub struct InterfacesProxy {
635 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
636}
637
638impl fdomain_client::fidl::Proxy for InterfacesProxy {
639 type Protocol = InterfacesMarker;
640
641 fn from_channel(inner: fdomain_client::Channel) -> Self {
642 Self::new(inner)
643 }
644
645 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
646 self.client.into_channel().map_err(|client| Self { client })
647 }
648
649 fn as_channel(&self) -> &fdomain_client::Channel {
650 self.client.as_channel()
651 }
652}
653
654impl InterfacesProxy {
655 pub fn new(channel: fdomain_client::Channel) -> Self {
657 let protocol_name = <InterfacesMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
658 Self { client: fidl::client::Client::new(channel, protocol_name) }
659 }
660
661 pub fn take_event_stream(&self) -> InterfacesEventStream {
667 InterfacesEventStream { event_receiver: self.client.take_event_receiver() }
668 }
669
670 pub fn r#get_port(
679 &self,
680 mut id: u64,
681 mut port: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_hardware_network::PortMarker>,
682 ) -> Result<(), fidl::Error> {
683 InterfacesProxyInterface::r#get_port(self, id, port)
684 }
685
686 pub fn r#close_backing_session(
700 &self,
701 mut id: u64,
702 ) -> fidl::client::QueryResponseFut<
703 InterfacesCloseBackingSessionResult,
704 fdomain_client::fidl::FDomainResourceDialect,
705 > {
706 InterfacesProxyInterface::r#close_backing_session(self, id)
707 }
708}
709
710impl InterfacesProxyInterface for InterfacesProxy {
711 fn r#get_port(
712 &self,
713 mut id: u64,
714 mut port: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_hardware_network::PortMarker>,
715 ) -> Result<(), fidl::Error> {
716 self.client.send::<InterfacesGetPortRequest>(
717 (id, port),
718 0xdd15c4df17fb148,
719 fidl::encoding::DynamicFlags::empty(),
720 )
721 }
722
723 type CloseBackingSessionResponseFut = fidl::client::QueryResponseFut<
724 InterfacesCloseBackingSessionResult,
725 fdomain_client::fidl::FDomainResourceDialect,
726 >;
727 fn r#close_backing_session(&self, mut id: u64) -> Self::CloseBackingSessionResponseFut {
728 fn _decode(
729 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
730 ) -> Result<InterfacesCloseBackingSessionResult, fidl::Error> {
731 let _response = fidl::client::decode_transaction_body::<
732 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, CloseSessionError>,
733 fdomain_client::fidl::FDomainResourceDialect,
734 0x57da4d8a53ac6d0c,
735 >(_buf?)?;
736 Ok(_response.map(|x| x))
737 }
738 self.client.send_query_and_decode::<
739 InterfacesCloseBackingSessionRequest,
740 InterfacesCloseBackingSessionResult,
741 >(
742 (id,),
743 0x57da4d8a53ac6d0c,
744 fidl::encoding::DynamicFlags::empty(),
745 _decode,
746 )
747 }
748}
749
750pub struct InterfacesEventStream {
751 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
752}
753
754impl std::marker::Unpin for InterfacesEventStream {}
755
756impl futures::stream::FusedStream for InterfacesEventStream {
757 fn is_terminated(&self) -> bool {
758 self.event_receiver.is_terminated()
759 }
760}
761
762impl futures::Stream for InterfacesEventStream {
763 type Item = Result<InterfacesEvent, fidl::Error>;
764
765 fn poll_next(
766 mut self: std::pin::Pin<&mut Self>,
767 cx: &mut std::task::Context<'_>,
768 ) -> std::task::Poll<Option<Self::Item>> {
769 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
770 &mut self.event_receiver,
771 cx
772 )?) {
773 Some(buf) => std::task::Poll::Ready(Some(InterfacesEvent::decode(buf))),
774 None => std::task::Poll::Ready(None),
775 }
776 }
777}
778
779#[derive(Debug)]
780pub enum InterfacesEvent {}
781
782impl InterfacesEvent {
783 fn decode(
785 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
786 ) -> Result<InterfacesEvent, fidl::Error> {
787 let (bytes, _handles) = buf.split_mut();
788 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
789 debug_assert_eq!(tx_header.tx_id, 0);
790 match tx_header.ordinal {
791 _ => Err(fidl::Error::UnknownOrdinal {
792 ordinal: tx_header.ordinal,
793 protocol_name:
794 <InterfacesMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
795 }),
796 }
797 }
798}
799
800pub struct InterfacesRequestStream {
802 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
803 is_terminated: bool,
804}
805
806impl std::marker::Unpin for InterfacesRequestStream {}
807
808impl futures::stream::FusedStream for InterfacesRequestStream {
809 fn is_terminated(&self) -> bool {
810 self.is_terminated
811 }
812}
813
814impl fdomain_client::fidl::RequestStream for InterfacesRequestStream {
815 type Protocol = InterfacesMarker;
816 type ControlHandle = InterfacesControlHandle;
817
818 fn from_channel(channel: fdomain_client::Channel) -> Self {
819 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
820 }
821
822 fn control_handle(&self) -> Self::ControlHandle {
823 InterfacesControlHandle { inner: self.inner.clone() }
824 }
825
826 fn into_inner(
827 self,
828 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
829 {
830 (self.inner, self.is_terminated)
831 }
832
833 fn from_inner(
834 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
835 is_terminated: bool,
836 ) -> Self {
837 Self { inner, is_terminated }
838 }
839}
840
841impl futures::Stream for InterfacesRequestStream {
842 type Item = Result<InterfacesRequest, fidl::Error>;
843
844 fn poll_next(
845 mut self: std::pin::Pin<&mut Self>,
846 cx: &mut std::task::Context<'_>,
847 ) -> std::task::Poll<Option<Self::Item>> {
848 let this = &mut *self;
849 if this.inner.check_shutdown(cx) {
850 this.is_terminated = true;
851 return std::task::Poll::Ready(None);
852 }
853 if this.is_terminated {
854 panic!("polled InterfacesRequestStream after completion");
855 }
856 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
857 |bytes, handles| {
858 match this.inner.channel().read_etc(cx, bytes, handles) {
859 std::task::Poll::Ready(Ok(())) => {}
860 std::task::Poll::Pending => return std::task::Poll::Pending,
861 std::task::Poll::Ready(Err(None)) => {
862 this.is_terminated = true;
863 return std::task::Poll::Ready(None);
864 }
865 std::task::Poll::Ready(Err(Some(e))) => {
866 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
867 e.into(),
868 ))));
869 }
870 }
871
872 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
874
875 std::task::Poll::Ready(Some(match header.ordinal {
876 0xdd15c4df17fb148 => {
877 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
878 let mut req = fidl::new_empty!(
879 InterfacesGetPortRequest,
880 fdomain_client::fidl::FDomainResourceDialect
881 );
882 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<InterfacesGetPortRequest>(&header, _body_bytes, handles, &mut req)?;
883 let control_handle = InterfacesControlHandle { inner: this.inner.clone() };
884 Ok(InterfacesRequest::GetPort {
885 id: req.id,
886 port: req.port,
887
888 control_handle,
889 })
890 }
891 0x57da4d8a53ac6d0c => {
892 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
893 let mut req = fidl::new_empty!(
894 InterfacesCloseBackingSessionRequest,
895 fdomain_client::fidl::FDomainResourceDialect
896 );
897 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<InterfacesCloseBackingSessionRequest>(&header, _body_bytes, handles, &mut req)?;
898 let control_handle = InterfacesControlHandle { inner: this.inner.clone() };
899 Ok(InterfacesRequest::CloseBackingSession {
900 id: req.id,
901
902 responder: InterfacesCloseBackingSessionResponder {
903 control_handle: std::mem::ManuallyDrop::new(control_handle),
904 tx_id: header.tx_id,
905 },
906 })
907 }
908 _ => Err(fidl::Error::UnknownOrdinal {
909 ordinal: header.ordinal,
910 protocol_name:
911 <InterfacesMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
912 }),
913 }))
914 },
915 )
916 }
917}
918
919#[derive(Debug)]
924pub enum InterfacesRequest {
925 GetPort {
934 id: u64,
935 port: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_hardware_network::PortMarker>,
936 control_handle: InterfacesControlHandle,
937 },
938 CloseBackingSession { id: u64, responder: InterfacesCloseBackingSessionResponder },
952}
953
954impl InterfacesRequest {
955 #[allow(irrefutable_let_patterns)]
956 pub fn into_get_port(
957 self,
958 ) -> Option<(
959 u64,
960 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_hardware_network::PortMarker>,
961 InterfacesControlHandle,
962 )> {
963 if let InterfacesRequest::GetPort { id, port, control_handle } = self {
964 Some((id, port, control_handle))
965 } else {
966 None
967 }
968 }
969
970 #[allow(irrefutable_let_patterns)]
971 pub fn into_close_backing_session(
972 self,
973 ) -> Option<(u64, InterfacesCloseBackingSessionResponder)> {
974 if let InterfacesRequest::CloseBackingSession { id, responder } = self {
975 Some((id, responder))
976 } else {
977 None
978 }
979 }
980
981 pub fn method_name(&self) -> &'static str {
983 match *self {
984 InterfacesRequest::GetPort { .. } => "get_port",
985 InterfacesRequest::CloseBackingSession { .. } => "close_backing_session",
986 }
987 }
988}
989
990#[derive(Debug, Clone)]
991pub struct InterfacesControlHandle {
992 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
993}
994
995impl fdomain_client::fidl::ControlHandle for InterfacesControlHandle {
996 fn shutdown(&self) {
997 self.inner.shutdown()
998 }
999
1000 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1001 self.inner.shutdown_with_epitaph(status)
1002 }
1003
1004 fn is_closed(&self) -> bool {
1005 self.inner.channel().is_closed()
1006 }
1007 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1008 self.inner.channel().on_closed()
1009 }
1010}
1011
1012impl InterfacesControlHandle {}
1013
1014#[must_use = "FIDL methods require a response to be sent"]
1015#[derive(Debug)]
1016pub struct InterfacesCloseBackingSessionResponder {
1017 control_handle: std::mem::ManuallyDrop<InterfacesControlHandle>,
1018 tx_id: u32,
1019}
1020
1021impl std::ops::Drop for InterfacesCloseBackingSessionResponder {
1025 fn drop(&mut self) {
1026 self.control_handle.shutdown();
1027 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1029 }
1030}
1031
1032impl fdomain_client::fidl::Responder for InterfacesCloseBackingSessionResponder {
1033 type ControlHandle = InterfacesControlHandle;
1034
1035 fn control_handle(&self) -> &InterfacesControlHandle {
1036 &self.control_handle
1037 }
1038
1039 fn drop_without_shutdown(mut self) {
1040 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1042 std::mem::forget(self);
1044 }
1045}
1046
1047impl InterfacesCloseBackingSessionResponder {
1048 pub fn send(self, mut result: Result<(), CloseSessionError>) -> Result<(), fidl::Error> {
1052 let _result = self.send_raw(result);
1053 if _result.is_err() {
1054 self.control_handle.shutdown();
1055 }
1056 self.drop_without_shutdown();
1057 _result
1058 }
1059
1060 pub fn send_no_shutdown_on_err(
1062 self,
1063 mut result: Result<(), CloseSessionError>,
1064 ) -> Result<(), fidl::Error> {
1065 let _result = self.send_raw(result);
1066 self.drop_without_shutdown();
1067 _result
1068 }
1069
1070 fn send_raw(&self, mut result: Result<(), CloseSessionError>) -> Result<(), fidl::Error> {
1071 self.control_handle.inner.send::<fidl::encoding::ResultType<
1072 fidl::encoding::EmptyStruct,
1073 CloseSessionError,
1074 >>(
1075 result,
1076 self.tx_id,
1077 0x57da4d8a53ac6d0c,
1078 fidl::encoding::DynamicFlags::empty(),
1079 )
1080 }
1081}
1082
1083#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1084pub struct PacketCaptureProviderMarker;
1085
1086impl fdomain_client::fidl::ProtocolMarker for PacketCaptureProviderMarker {
1087 type Proxy = PacketCaptureProviderProxy;
1088 type RequestStream = PacketCaptureProviderRequestStream;
1089
1090 const DEBUG_NAME: &'static str = "fuchsia.net.debug.PacketCaptureProvider";
1091}
1092impl fdomain_client::fidl::DiscoverableProtocolMarker for PacketCaptureProviderMarker {}
1093pub type PacketCaptureProviderStartRollingResult =
1094 Result<fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>, PacketCaptureStartError>;
1095pub type PacketCaptureProviderReconnectRollingResult = Result<
1096 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
1097 PacketCaptureReconnectError,
1098>;
1099
1100pub trait PacketCaptureProviderProxyInterface: Send + Sync {
1101 type StartRollingResponseFut: std::future::Future<Output = Result<PacketCaptureProviderStartRollingResult, fidl::Error>>
1102 + Send;
1103 fn r#start_rolling(
1104 &self,
1105 common_params: CommonPacketCaptureParams,
1106 params: &RollingPacketCaptureParams,
1107 ) -> Self::StartRollingResponseFut;
1108 type ReconnectRollingResponseFut: std::future::Future<
1109 Output = Result<PacketCaptureProviderReconnectRollingResult, fidl::Error>,
1110 > + Send;
1111 fn r#reconnect_rolling(&self, name: &str) -> Self::ReconnectRollingResponseFut;
1112}
1113
1114#[derive(Debug, Clone)]
1115pub struct PacketCaptureProviderProxy {
1116 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1117}
1118
1119impl fdomain_client::fidl::Proxy for PacketCaptureProviderProxy {
1120 type Protocol = PacketCaptureProviderMarker;
1121
1122 fn from_channel(inner: fdomain_client::Channel) -> Self {
1123 Self::new(inner)
1124 }
1125
1126 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1127 self.client.into_channel().map_err(|client| Self { client })
1128 }
1129
1130 fn as_channel(&self) -> &fdomain_client::Channel {
1131 self.client.as_channel()
1132 }
1133}
1134
1135impl PacketCaptureProviderProxy {
1136 pub fn new(channel: fdomain_client::Channel) -> Self {
1138 let protocol_name =
1139 <PacketCaptureProviderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1140 Self { client: fidl::client::Client::new(channel, protocol_name) }
1141 }
1142
1143 pub fn take_event_stream(&self) -> PacketCaptureProviderEventStream {
1149 PacketCaptureProviderEventStream { event_receiver: self.client.take_event_receiver() }
1150 }
1151
1152 pub fn r#start_rolling(
1162 &self,
1163 mut common_params: CommonPacketCaptureParams,
1164 mut params: &RollingPacketCaptureParams,
1165 ) -> fidl::client::QueryResponseFut<
1166 PacketCaptureProviderStartRollingResult,
1167 fdomain_client::fidl::FDomainResourceDialect,
1168 > {
1169 PacketCaptureProviderProxyInterface::r#start_rolling(self, common_params, params)
1170 }
1171
1172 pub fn r#reconnect_rolling(
1181 &self,
1182 mut name: &str,
1183 ) -> fidl::client::QueryResponseFut<
1184 PacketCaptureProviderReconnectRollingResult,
1185 fdomain_client::fidl::FDomainResourceDialect,
1186 > {
1187 PacketCaptureProviderProxyInterface::r#reconnect_rolling(self, name)
1188 }
1189}
1190
1191impl PacketCaptureProviderProxyInterface for PacketCaptureProviderProxy {
1192 type StartRollingResponseFut = fidl::client::QueryResponseFut<
1193 PacketCaptureProviderStartRollingResult,
1194 fdomain_client::fidl::FDomainResourceDialect,
1195 >;
1196 fn r#start_rolling(
1197 &self,
1198 mut common_params: CommonPacketCaptureParams,
1199 mut params: &RollingPacketCaptureParams,
1200 ) -> Self::StartRollingResponseFut {
1201 fn _decode(
1202 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1203 ) -> Result<PacketCaptureProviderStartRollingResult, fidl::Error> {
1204 let _response = fidl::client::decode_transaction_body::<
1205 fidl::encoding::ResultType<
1206 PacketCaptureProviderStartRollingResponse,
1207 PacketCaptureStartError,
1208 >,
1209 fdomain_client::fidl::FDomainResourceDialect,
1210 0x4a5b2305ea27e845,
1211 >(_buf?)?;
1212 Ok(_response.map(|x| x.channel))
1213 }
1214 self.client.send_query_and_decode::<
1215 PacketCaptureProviderStartRollingRequest,
1216 PacketCaptureProviderStartRollingResult,
1217 >(
1218 (&mut common_params, params,),
1219 0x4a5b2305ea27e845,
1220 fidl::encoding::DynamicFlags::empty(),
1221 _decode,
1222 )
1223 }
1224
1225 type ReconnectRollingResponseFut = fidl::client::QueryResponseFut<
1226 PacketCaptureProviderReconnectRollingResult,
1227 fdomain_client::fidl::FDomainResourceDialect,
1228 >;
1229 fn r#reconnect_rolling(&self, mut name: &str) -> Self::ReconnectRollingResponseFut {
1230 fn _decode(
1231 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1232 ) -> Result<PacketCaptureProviderReconnectRollingResult, fidl::Error> {
1233 let _response = fidl::client::decode_transaction_body::<
1234 fidl::encoding::ResultType<
1235 PacketCaptureProviderReconnectRollingResponse,
1236 PacketCaptureReconnectError,
1237 >,
1238 fdomain_client::fidl::FDomainResourceDialect,
1239 0x57828e9ed034a522,
1240 >(_buf?)?;
1241 Ok(_response.map(|x| x.channel))
1242 }
1243 self.client.send_query_and_decode::<
1244 PacketCaptureProviderReconnectRollingRequest,
1245 PacketCaptureProviderReconnectRollingResult,
1246 >(
1247 (name,),
1248 0x57828e9ed034a522,
1249 fidl::encoding::DynamicFlags::empty(),
1250 _decode,
1251 )
1252 }
1253}
1254
1255pub struct PacketCaptureProviderEventStream {
1256 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1257}
1258
1259impl std::marker::Unpin for PacketCaptureProviderEventStream {}
1260
1261impl futures::stream::FusedStream for PacketCaptureProviderEventStream {
1262 fn is_terminated(&self) -> bool {
1263 self.event_receiver.is_terminated()
1264 }
1265}
1266
1267impl futures::Stream for PacketCaptureProviderEventStream {
1268 type Item = Result<PacketCaptureProviderEvent, fidl::Error>;
1269
1270 fn poll_next(
1271 mut self: std::pin::Pin<&mut Self>,
1272 cx: &mut std::task::Context<'_>,
1273 ) -> std::task::Poll<Option<Self::Item>> {
1274 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1275 &mut self.event_receiver,
1276 cx
1277 )?) {
1278 Some(buf) => std::task::Poll::Ready(Some(PacketCaptureProviderEvent::decode(buf))),
1279 None => std::task::Poll::Ready(None),
1280 }
1281 }
1282}
1283
1284#[derive(Debug)]
1285pub enum PacketCaptureProviderEvent {}
1286
1287impl PacketCaptureProviderEvent {
1288 fn decode(
1290 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1291 ) -> Result<PacketCaptureProviderEvent, fidl::Error> {
1292 let (bytes, _handles) = buf.split_mut();
1293 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1294 debug_assert_eq!(tx_header.tx_id, 0);
1295 match tx_header.ordinal {
1296 _ => Err(fidl::Error::UnknownOrdinal {
1297 ordinal: tx_header.ordinal,
1298 protocol_name: <PacketCaptureProviderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1299 })
1300 }
1301 }
1302}
1303
1304pub struct PacketCaptureProviderRequestStream {
1306 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1307 is_terminated: bool,
1308}
1309
1310impl std::marker::Unpin for PacketCaptureProviderRequestStream {}
1311
1312impl futures::stream::FusedStream for PacketCaptureProviderRequestStream {
1313 fn is_terminated(&self) -> bool {
1314 self.is_terminated
1315 }
1316}
1317
1318impl fdomain_client::fidl::RequestStream for PacketCaptureProviderRequestStream {
1319 type Protocol = PacketCaptureProviderMarker;
1320 type ControlHandle = PacketCaptureProviderControlHandle;
1321
1322 fn from_channel(channel: fdomain_client::Channel) -> Self {
1323 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1324 }
1325
1326 fn control_handle(&self) -> Self::ControlHandle {
1327 PacketCaptureProviderControlHandle { inner: self.inner.clone() }
1328 }
1329
1330 fn into_inner(
1331 self,
1332 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1333 {
1334 (self.inner, self.is_terminated)
1335 }
1336
1337 fn from_inner(
1338 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1339 is_terminated: bool,
1340 ) -> Self {
1341 Self { inner, is_terminated }
1342 }
1343}
1344
1345impl futures::Stream for PacketCaptureProviderRequestStream {
1346 type Item = Result<PacketCaptureProviderRequest, fidl::Error>;
1347
1348 fn poll_next(
1349 mut self: std::pin::Pin<&mut Self>,
1350 cx: &mut std::task::Context<'_>,
1351 ) -> std::task::Poll<Option<Self::Item>> {
1352 let this = &mut *self;
1353 if this.inner.check_shutdown(cx) {
1354 this.is_terminated = true;
1355 return std::task::Poll::Ready(None);
1356 }
1357 if this.is_terminated {
1358 panic!("polled PacketCaptureProviderRequestStream after completion");
1359 }
1360 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1361 |bytes, handles| {
1362 match this.inner.channel().read_etc(cx, bytes, handles) {
1363 std::task::Poll::Ready(Ok(())) => {}
1364 std::task::Poll::Pending => return std::task::Poll::Pending,
1365 std::task::Poll::Ready(Err(None)) => {
1366 this.is_terminated = true;
1367 return std::task::Poll::Ready(None);
1368 }
1369 std::task::Poll::Ready(Err(Some(e))) => {
1370 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1371 e.into(),
1372 ))));
1373 }
1374 }
1375
1376 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1378
1379 std::task::Poll::Ready(Some(match header.ordinal {
1380 0x4a5b2305ea27e845 => {
1381 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1382 let mut req = fidl::new_empty!(PacketCaptureProviderStartRollingRequest, fdomain_client::fidl::FDomainResourceDialect);
1383 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<PacketCaptureProviderStartRollingRequest>(&header, _body_bytes, handles, &mut req)?;
1384 let control_handle = PacketCaptureProviderControlHandle {
1385 inner: this.inner.clone(),
1386 };
1387 Ok(PacketCaptureProviderRequest::StartRolling {common_params: req.common_params,
1388params: req.params,
1389
1390 responder: PacketCaptureProviderStartRollingResponder {
1391 control_handle: std::mem::ManuallyDrop::new(control_handle),
1392 tx_id: header.tx_id,
1393 },
1394 })
1395 }
1396 0x57828e9ed034a522 => {
1397 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1398 let mut req = fidl::new_empty!(PacketCaptureProviderReconnectRollingRequest, fdomain_client::fidl::FDomainResourceDialect);
1399 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<PacketCaptureProviderReconnectRollingRequest>(&header, _body_bytes, handles, &mut req)?;
1400 let control_handle = PacketCaptureProviderControlHandle {
1401 inner: this.inner.clone(),
1402 };
1403 Ok(PacketCaptureProviderRequest::ReconnectRolling {name: req.name,
1404
1405 responder: PacketCaptureProviderReconnectRollingResponder {
1406 control_handle: std::mem::ManuallyDrop::new(control_handle),
1407 tx_id: header.tx_id,
1408 },
1409 })
1410 }
1411 _ => Err(fidl::Error::UnknownOrdinal {
1412 ordinal: header.ordinal,
1413 protocol_name: <PacketCaptureProviderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1414 }),
1415 }))
1416 },
1417 )
1418 }
1419}
1420
1421#[derive(Debug)]
1443pub enum PacketCaptureProviderRequest {
1444 StartRolling {
1454 common_params: CommonPacketCaptureParams,
1455 params: RollingPacketCaptureParams,
1456 responder: PacketCaptureProviderStartRollingResponder,
1457 },
1458 ReconnectRolling { name: String, responder: PacketCaptureProviderReconnectRollingResponder },
1467}
1468
1469impl PacketCaptureProviderRequest {
1470 #[allow(irrefutable_let_patterns)]
1471 pub fn into_start_rolling(
1472 self,
1473 ) -> Option<(
1474 CommonPacketCaptureParams,
1475 RollingPacketCaptureParams,
1476 PacketCaptureProviderStartRollingResponder,
1477 )> {
1478 if let PacketCaptureProviderRequest::StartRolling { common_params, params, responder } =
1479 self
1480 {
1481 Some((common_params, params, responder))
1482 } else {
1483 None
1484 }
1485 }
1486
1487 #[allow(irrefutable_let_patterns)]
1488 pub fn into_reconnect_rolling(
1489 self,
1490 ) -> Option<(String, PacketCaptureProviderReconnectRollingResponder)> {
1491 if let PacketCaptureProviderRequest::ReconnectRolling { name, responder } = self {
1492 Some((name, responder))
1493 } else {
1494 None
1495 }
1496 }
1497
1498 pub fn method_name(&self) -> &'static str {
1500 match *self {
1501 PacketCaptureProviderRequest::StartRolling { .. } => "start_rolling",
1502 PacketCaptureProviderRequest::ReconnectRolling { .. } => "reconnect_rolling",
1503 }
1504 }
1505}
1506
1507#[derive(Debug, Clone)]
1508pub struct PacketCaptureProviderControlHandle {
1509 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1510}
1511
1512impl fdomain_client::fidl::ControlHandle for PacketCaptureProviderControlHandle {
1513 fn shutdown(&self) {
1514 self.inner.shutdown()
1515 }
1516
1517 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1518 self.inner.shutdown_with_epitaph(status)
1519 }
1520
1521 fn is_closed(&self) -> bool {
1522 self.inner.channel().is_closed()
1523 }
1524 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1525 self.inner.channel().on_closed()
1526 }
1527}
1528
1529impl PacketCaptureProviderControlHandle {}
1530
1531#[must_use = "FIDL methods require a response to be sent"]
1532#[derive(Debug)]
1533pub struct PacketCaptureProviderStartRollingResponder {
1534 control_handle: std::mem::ManuallyDrop<PacketCaptureProviderControlHandle>,
1535 tx_id: u32,
1536}
1537
1538impl std::ops::Drop for PacketCaptureProviderStartRollingResponder {
1542 fn drop(&mut self) {
1543 self.control_handle.shutdown();
1544 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1546 }
1547}
1548
1549impl fdomain_client::fidl::Responder for PacketCaptureProviderStartRollingResponder {
1550 type ControlHandle = PacketCaptureProviderControlHandle;
1551
1552 fn control_handle(&self) -> &PacketCaptureProviderControlHandle {
1553 &self.control_handle
1554 }
1555
1556 fn drop_without_shutdown(mut self) {
1557 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1559 std::mem::forget(self);
1561 }
1562}
1563
1564impl PacketCaptureProviderStartRollingResponder {
1565 pub fn send(
1569 self,
1570 mut result: Result<
1571 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
1572 PacketCaptureStartError,
1573 >,
1574 ) -> Result<(), fidl::Error> {
1575 let _result = self.send_raw(result);
1576 if _result.is_err() {
1577 self.control_handle.shutdown();
1578 }
1579 self.drop_without_shutdown();
1580 _result
1581 }
1582
1583 pub fn send_no_shutdown_on_err(
1585 self,
1586 mut result: Result<
1587 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
1588 PacketCaptureStartError,
1589 >,
1590 ) -> Result<(), fidl::Error> {
1591 let _result = self.send_raw(result);
1592 self.drop_without_shutdown();
1593 _result
1594 }
1595
1596 fn send_raw(
1597 &self,
1598 mut result: Result<
1599 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
1600 PacketCaptureStartError,
1601 >,
1602 ) -> Result<(), fidl::Error> {
1603 self.control_handle.inner.send::<fidl::encoding::ResultType<
1604 PacketCaptureProviderStartRollingResponse,
1605 PacketCaptureStartError,
1606 >>(
1607 result.map(|channel| (channel,)),
1608 self.tx_id,
1609 0x4a5b2305ea27e845,
1610 fidl::encoding::DynamicFlags::empty(),
1611 )
1612 }
1613}
1614
1615#[must_use = "FIDL methods require a response to be sent"]
1616#[derive(Debug)]
1617pub struct PacketCaptureProviderReconnectRollingResponder {
1618 control_handle: std::mem::ManuallyDrop<PacketCaptureProviderControlHandle>,
1619 tx_id: u32,
1620}
1621
1622impl std::ops::Drop for PacketCaptureProviderReconnectRollingResponder {
1626 fn drop(&mut self) {
1627 self.control_handle.shutdown();
1628 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1630 }
1631}
1632
1633impl fdomain_client::fidl::Responder for PacketCaptureProviderReconnectRollingResponder {
1634 type ControlHandle = PacketCaptureProviderControlHandle;
1635
1636 fn control_handle(&self) -> &PacketCaptureProviderControlHandle {
1637 &self.control_handle
1638 }
1639
1640 fn drop_without_shutdown(mut self) {
1641 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1643 std::mem::forget(self);
1645 }
1646}
1647
1648impl PacketCaptureProviderReconnectRollingResponder {
1649 pub fn send(
1653 self,
1654 mut result: Result<
1655 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
1656 PacketCaptureReconnectError,
1657 >,
1658 ) -> Result<(), fidl::Error> {
1659 let _result = self.send_raw(result);
1660 if _result.is_err() {
1661 self.control_handle.shutdown();
1662 }
1663 self.drop_without_shutdown();
1664 _result
1665 }
1666
1667 pub fn send_no_shutdown_on_err(
1669 self,
1670 mut result: Result<
1671 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
1672 PacketCaptureReconnectError,
1673 >,
1674 ) -> Result<(), fidl::Error> {
1675 let _result = self.send_raw(result);
1676 self.drop_without_shutdown();
1677 _result
1678 }
1679
1680 fn send_raw(
1681 &self,
1682 mut result: Result<
1683 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
1684 PacketCaptureReconnectError,
1685 >,
1686 ) -> Result<(), fidl::Error> {
1687 self.control_handle.inner.send::<fidl::encoding::ResultType<
1688 PacketCaptureProviderReconnectRollingResponse,
1689 PacketCaptureReconnectError,
1690 >>(
1691 result.map(|channel| (channel,)),
1692 self.tx_id,
1693 0x57828e9ed034a522,
1694 fidl::encoding::DynamicFlags::empty(),
1695 )
1696 }
1697}
1698
1699#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1700pub struct RollingPacketCaptureMarker;
1701
1702impl fdomain_client::fidl::ProtocolMarker for RollingPacketCaptureMarker {
1703 type Proxy = RollingPacketCaptureProxy;
1704 type RequestStream = RollingPacketCaptureRequestStream;
1705
1706 const DEBUG_NAME: &'static str = "(anonymous) RollingPacketCapture";
1707}
1708pub type RollingPacketCaptureDetachResult = Result<(), RollingPacketCaptureDetachError>;
1709
1710pub trait RollingPacketCaptureProxyInterface: Send + Sync {
1711 type DetachResponseFut: std::future::Future<Output = Result<RollingPacketCaptureDetachResult, fidl::Error>>
1712 + Send;
1713 fn r#detach(&self, name: &str) -> Self::DetachResponseFut;
1714 fn r#stop_and_download(
1715 &self,
1716 channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
1717 ) -> Result<(), fidl::Error>;
1718 type DiscardResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1719 fn r#discard(&self) -> Self::DiscardResponseFut;
1720}
1721
1722#[derive(Debug, Clone)]
1723pub struct RollingPacketCaptureProxy {
1724 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1725}
1726
1727impl fdomain_client::fidl::Proxy for RollingPacketCaptureProxy {
1728 type Protocol = RollingPacketCaptureMarker;
1729
1730 fn from_channel(inner: fdomain_client::Channel) -> Self {
1731 Self::new(inner)
1732 }
1733
1734 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1735 self.client.into_channel().map_err(|client| Self { client })
1736 }
1737
1738 fn as_channel(&self) -> &fdomain_client::Channel {
1739 self.client.as_channel()
1740 }
1741}
1742
1743impl RollingPacketCaptureProxy {
1744 pub fn new(channel: fdomain_client::Channel) -> Self {
1746 let protocol_name =
1747 <RollingPacketCaptureMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1748 Self { client: fidl::client::Client::new(channel, protocol_name) }
1749 }
1750
1751 pub fn take_event_stream(&self) -> RollingPacketCaptureEventStream {
1757 RollingPacketCaptureEventStream { event_receiver: self.client.take_event_receiver() }
1758 }
1759
1760 pub fn r#detach(
1778 &self,
1779 mut name: &str,
1780 ) -> fidl::client::QueryResponseFut<
1781 RollingPacketCaptureDetachResult,
1782 fdomain_client::fidl::FDomainResourceDialect,
1783 > {
1784 RollingPacketCaptureProxyInterface::r#detach(self, name)
1785 }
1786
1787 pub fn r#stop_and_download(
1801 &self,
1802 mut channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
1803 ) -> Result<(), fidl::Error> {
1804 RollingPacketCaptureProxyInterface::r#stop_and_download(self, channel)
1805 }
1806
1807 pub fn r#discard(
1817 &self,
1818 ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
1819 RollingPacketCaptureProxyInterface::r#discard(self)
1820 }
1821}
1822
1823impl RollingPacketCaptureProxyInterface for RollingPacketCaptureProxy {
1824 type DetachResponseFut = fidl::client::QueryResponseFut<
1825 RollingPacketCaptureDetachResult,
1826 fdomain_client::fidl::FDomainResourceDialect,
1827 >;
1828 fn r#detach(&self, mut name: &str) -> Self::DetachResponseFut {
1829 fn _decode(
1830 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1831 ) -> Result<RollingPacketCaptureDetachResult, fidl::Error> {
1832 let _response = fidl::client::decode_transaction_body::<
1833 fidl::encoding::ResultType<
1834 fidl::encoding::EmptyStruct,
1835 RollingPacketCaptureDetachError,
1836 >,
1837 fdomain_client::fidl::FDomainResourceDialect,
1838 0xb3d28b9518e7db0,
1839 >(_buf?)?;
1840 Ok(_response.map(|x| x))
1841 }
1842 self.client.send_query_and_decode::<
1843 RollingPacketCaptureDetachRequest,
1844 RollingPacketCaptureDetachResult,
1845 >(
1846 (name,),
1847 0xb3d28b9518e7db0,
1848 fidl::encoding::DynamicFlags::empty(),
1849 _decode,
1850 )
1851 }
1852
1853 fn r#stop_and_download(
1854 &self,
1855 mut channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
1856 ) -> Result<(), fidl::Error> {
1857 self.client.send::<RollingPacketCaptureStopAndDownloadRequest>(
1858 (channel,),
1859 0x268270260a49e2ea,
1860 fidl::encoding::DynamicFlags::empty(),
1861 )
1862 }
1863
1864 type DiscardResponseFut =
1865 fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
1866 fn r#discard(&self) -> Self::DiscardResponseFut {
1867 fn _decode(
1868 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1869 ) -> Result<(), fidl::Error> {
1870 let _response = fidl::client::decode_transaction_body::<
1871 fidl::encoding::EmptyPayload,
1872 fdomain_client::fidl::FDomainResourceDialect,
1873 0x89e60c428d47a1,
1874 >(_buf?)?;
1875 Ok(_response)
1876 }
1877 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1878 (),
1879 0x89e60c428d47a1,
1880 fidl::encoding::DynamicFlags::empty(),
1881 _decode,
1882 )
1883 }
1884}
1885
1886pub struct RollingPacketCaptureEventStream {
1887 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1888}
1889
1890impl std::marker::Unpin for RollingPacketCaptureEventStream {}
1891
1892impl futures::stream::FusedStream for RollingPacketCaptureEventStream {
1893 fn is_terminated(&self) -> bool {
1894 self.event_receiver.is_terminated()
1895 }
1896}
1897
1898impl futures::Stream for RollingPacketCaptureEventStream {
1899 type Item = Result<RollingPacketCaptureEvent, fidl::Error>;
1900
1901 fn poll_next(
1902 mut self: std::pin::Pin<&mut Self>,
1903 cx: &mut std::task::Context<'_>,
1904 ) -> std::task::Poll<Option<Self::Item>> {
1905 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1906 &mut self.event_receiver,
1907 cx
1908 )?) {
1909 Some(buf) => std::task::Poll::Ready(Some(RollingPacketCaptureEvent::decode(buf))),
1910 None => std::task::Poll::Ready(None),
1911 }
1912 }
1913}
1914
1915#[derive(Debug)]
1916pub enum RollingPacketCaptureEvent {
1917 OnEnded { reason: PacketCaptureEndReason },
1918}
1919
1920impl RollingPacketCaptureEvent {
1921 #[allow(irrefutable_let_patterns)]
1922 pub fn into_on_ended(self) -> Option<PacketCaptureEndReason> {
1923 if let RollingPacketCaptureEvent::OnEnded { reason } = self { Some((reason)) } else { None }
1924 }
1925
1926 fn decode(
1928 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1929 ) -> Result<RollingPacketCaptureEvent, fidl::Error> {
1930 let (bytes, _handles) = buf.split_mut();
1931 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1932 debug_assert_eq!(tx_header.tx_id, 0);
1933 match tx_header.ordinal {
1934 0x74690c9d4f59f506 => {
1935 let mut out = fidl::new_empty!(
1936 RollingPacketCaptureOnEndedRequest,
1937 fdomain_client::fidl::FDomainResourceDialect
1938 );
1939 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RollingPacketCaptureOnEndedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1940 Ok((RollingPacketCaptureEvent::OnEnded { reason: out.reason }))
1941 }
1942 _ => Err(fidl::Error::UnknownOrdinal {
1943 ordinal: tx_header.ordinal,
1944 protocol_name:
1945 <RollingPacketCaptureMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1946 }),
1947 }
1948 }
1949}
1950
1951pub struct RollingPacketCaptureRequestStream {
1953 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1954 is_terminated: bool,
1955}
1956
1957impl std::marker::Unpin for RollingPacketCaptureRequestStream {}
1958
1959impl futures::stream::FusedStream for RollingPacketCaptureRequestStream {
1960 fn is_terminated(&self) -> bool {
1961 self.is_terminated
1962 }
1963}
1964
1965impl fdomain_client::fidl::RequestStream for RollingPacketCaptureRequestStream {
1966 type Protocol = RollingPacketCaptureMarker;
1967 type ControlHandle = RollingPacketCaptureControlHandle;
1968
1969 fn from_channel(channel: fdomain_client::Channel) -> Self {
1970 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1971 }
1972
1973 fn control_handle(&self) -> Self::ControlHandle {
1974 RollingPacketCaptureControlHandle { inner: self.inner.clone() }
1975 }
1976
1977 fn into_inner(
1978 self,
1979 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1980 {
1981 (self.inner, self.is_terminated)
1982 }
1983
1984 fn from_inner(
1985 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1986 is_terminated: bool,
1987 ) -> Self {
1988 Self { inner, is_terminated }
1989 }
1990}
1991
1992impl futures::Stream for RollingPacketCaptureRequestStream {
1993 type Item = Result<RollingPacketCaptureRequest, fidl::Error>;
1994
1995 fn poll_next(
1996 mut self: std::pin::Pin<&mut Self>,
1997 cx: &mut std::task::Context<'_>,
1998 ) -> std::task::Poll<Option<Self::Item>> {
1999 let this = &mut *self;
2000 if this.inner.check_shutdown(cx) {
2001 this.is_terminated = true;
2002 return std::task::Poll::Ready(None);
2003 }
2004 if this.is_terminated {
2005 panic!("polled RollingPacketCaptureRequestStream after completion");
2006 }
2007 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2008 |bytes, handles| {
2009 match this.inner.channel().read_etc(cx, bytes, handles) {
2010 std::task::Poll::Ready(Ok(())) => {}
2011 std::task::Poll::Pending => return std::task::Poll::Pending,
2012 std::task::Poll::Ready(Err(None)) => {
2013 this.is_terminated = true;
2014 return std::task::Poll::Ready(None);
2015 }
2016 std::task::Poll::Ready(Err(Some(e))) => {
2017 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2018 e.into(),
2019 ))));
2020 }
2021 }
2022
2023 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2025
2026 std::task::Poll::Ready(Some(match header.ordinal {
2027 0xb3d28b9518e7db0 => {
2028 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2029 let mut req = fidl::new_empty!(RollingPacketCaptureDetachRequest, fdomain_client::fidl::FDomainResourceDialect);
2030 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RollingPacketCaptureDetachRequest>(&header, _body_bytes, handles, &mut req)?;
2031 let control_handle = RollingPacketCaptureControlHandle {
2032 inner: this.inner.clone(),
2033 };
2034 Ok(RollingPacketCaptureRequest::Detach {name: req.name,
2035
2036 responder: RollingPacketCaptureDetachResponder {
2037 control_handle: std::mem::ManuallyDrop::new(control_handle),
2038 tx_id: header.tx_id,
2039 },
2040 })
2041 }
2042 0x268270260a49e2ea => {
2043 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2044 let mut req = fidl::new_empty!(RollingPacketCaptureStopAndDownloadRequest, fdomain_client::fidl::FDomainResourceDialect);
2045 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RollingPacketCaptureStopAndDownloadRequest>(&header, _body_bytes, handles, &mut req)?;
2046 let control_handle = RollingPacketCaptureControlHandle {
2047 inner: this.inner.clone(),
2048 };
2049 Ok(RollingPacketCaptureRequest::StopAndDownload {channel: req.channel,
2050
2051 control_handle,
2052 })
2053 }
2054 0x89e60c428d47a1 => {
2055 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2056 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
2057 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2058 let control_handle = RollingPacketCaptureControlHandle {
2059 inner: this.inner.clone(),
2060 };
2061 Ok(RollingPacketCaptureRequest::Discard {
2062 responder: RollingPacketCaptureDiscardResponder {
2063 control_handle: std::mem::ManuallyDrop::new(control_handle),
2064 tx_id: header.tx_id,
2065 },
2066 })
2067 }
2068 _ => Err(fidl::Error::UnknownOrdinal {
2069 ordinal: header.ordinal,
2070 protocol_name: <RollingPacketCaptureMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2071 }),
2072 }))
2073 },
2074 )
2075 }
2076}
2077
2078#[derive(Debug)]
2087pub enum RollingPacketCaptureRequest {
2088 Detach { name: String, responder: RollingPacketCaptureDetachResponder },
2106 StopAndDownload {
2120 channel: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
2121 control_handle: RollingPacketCaptureControlHandle,
2122 },
2123 Discard { responder: RollingPacketCaptureDiscardResponder },
2133}
2134
2135impl RollingPacketCaptureRequest {
2136 #[allow(irrefutable_let_patterns)]
2137 pub fn into_detach(self) -> Option<(String, RollingPacketCaptureDetachResponder)> {
2138 if let RollingPacketCaptureRequest::Detach { name, responder } = self {
2139 Some((name, responder))
2140 } else {
2141 None
2142 }
2143 }
2144
2145 #[allow(irrefutable_let_patterns)]
2146 pub fn into_stop_and_download(
2147 self,
2148 ) -> Option<(
2149 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
2150 RollingPacketCaptureControlHandle,
2151 )> {
2152 if let RollingPacketCaptureRequest::StopAndDownload { channel, control_handle } = self {
2153 Some((channel, control_handle))
2154 } else {
2155 None
2156 }
2157 }
2158
2159 #[allow(irrefutable_let_patterns)]
2160 pub fn into_discard(self) -> Option<(RollingPacketCaptureDiscardResponder)> {
2161 if let RollingPacketCaptureRequest::Discard { responder } = self {
2162 Some((responder))
2163 } else {
2164 None
2165 }
2166 }
2167
2168 pub fn method_name(&self) -> &'static str {
2170 match *self {
2171 RollingPacketCaptureRequest::Detach { .. } => "detach",
2172 RollingPacketCaptureRequest::StopAndDownload { .. } => "stop_and_download",
2173 RollingPacketCaptureRequest::Discard { .. } => "discard",
2174 }
2175 }
2176}
2177
2178#[derive(Debug, Clone)]
2179pub struct RollingPacketCaptureControlHandle {
2180 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2181}
2182
2183impl fdomain_client::fidl::ControlHandle for RollingPacketCaptureControlHandle {
2184 fn shutdown(&self) {
2185 self.inner.shutdown()
2186 }
2187
2188 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2189 self.inner.shutdown_with_epitaph(status)
2190 }
2191
2192 fn is_closed(&self) -> bool {
2193 self.inner.channel().is_closed()
2194 }
2195 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2196 self.inner.channel().on_closed()
2197 }
2198}
2199
2200impl RollingPacketCaptureControlHandle {
2201 pub fn send_on_ended(&self, mut reason: PacketCaptureEndReason) -> Result<(), fidl::Error> {
2202 self.inner.send::<RollingPacketCaptureOnEndedRequest>(
2203 (reason,),
2204 0,
2205 0x74690c9d4f59f506,
2206 fidl::encoding::DynamicFlags::empty(),
2207 )
2208 }
2209}
2210
2211#[must_use = "FIDL methods require a response to be sent"]
2212#[derive(Debug)]
2213pub struct RollingPacketCaptureDetachResponder {
2214 control_handle: std::mem::ManuallyDrop<RollingPacketCaptureControlHandle>,
2215 tx_id: u32,
2216}
2217
2218impl std::ops::Drop for RollingPacketCaptureDetachResponder {
2222 fn drop(&mut self) {
2223 self.control_handle.shutdown();
2224 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2226 }
2227}
2228
2229impl fdomain_client::fidl::Responder for RollingPacketCaptureDetachResponder {
2230 type ControlHandle = RollingPacketCaptureControlHandle;
2231
2232 fn control_handle(&self) -> &RollingPacketCaptureControlHandle {
2233 &self.control_handle
2234 }
2235
2236 fn drop_without_shutdown(mut self) {
2237 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2239 std::mem::forget(self);
2241 }
2242}
2243
2244impl RollingPacketCaptureDetachResponder {
2245 pub fn send(
2249 self,
2250 mut result: Result<(), RollingPacketCaptureDetachError>,
2251 ) -> Result<(), fidl::Error> {
2252 let _result = self.send_raw(result);
2253 if _result.is_err() {
2254 self.control_handle.shutdown();
2255 }
2256 self.drop_without_shutdown();
2257 _result
2258 }
2259
2260 pub fn send_no_shutdown_on_err(
2262 self,
2263 mut result: Result<(), RollingPacketCaptureDetachError>,
2264 ) -> Result<(), fidl::Error> {
2265 let _result = self.send_raw(result);
2266 self.drop_without_shutdown();
2267 _result
2268 }
2269
2270 fn send_raw(
2271 &self,
2272 mut result: Result<(), RollingPacketCaptureDetachError>,
2273 ) -> Result<(), fidl::Error> {
2274 self.control_handle.inner.send::<fidl::encoding::ResultType<
2275 fidl::encoding::EmptyStruct,
2276 RollingPacketCaptureDetachError,
2277 >>(
2278 result,
2279 self.tx_id,
2280 0xb3d28b9518e7db0,
2281 fidl::encoding::DynamicFlags::empty(),
2282 )
2283 }
2284}
2285
2286#[must_use = "FIDL methods require a response to be sent"]
2287#[derive(Debug)]
2288pub struct RollingPacketCaptureDiscardResponder {
2289 control_handle: std::mem::ManuallyDrop<RollingPacketCaptureControlHandle>,
2290 tx_id: u32,
2291}
2292
2293impl std::ops::Drop for RollingPacketCaptureDiscardResponder {
2297 fn drop(&mut self) {
2298 self.control_handle.shutdown();
2299 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2301 }
2302}
2303
2304impl fdomain_client::fidl::Responder for RollingPacketCaptureDiscardResponder {
2305 type ControlHandle = RollingPacketCaptureControlHandle;
2306
2307 fn control_handle(&self) -> &RollingPacketCaptureControlHandle {
2308 &self.control_handle
2309 }
2310
2311 fn drop_without_shutdown(mut self) {
2312 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2314 std::mem::forget(self);
2316 }
2317}
2318
2319impl RollingPacketCaptureDiscardResponder {
2320 pub fn send(self) -> Result<(), fidl::Error> {
2324 let _result = self.send_raw();
2325 if _result.is_err() {
2326 self.control_handle.shutdown();
2327 }
2328 self.drop_without_shutdown();
2329 _result
2330 }
2331
2332 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2334 let _result = self.send_raw();
2335 self.drop_without_shutdown();
2336 _result
2337 }
2338
2339 fn send_raw(&self) -> Result<(), fidl::Error> {
2340 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2341 (),
2342 self.tx_id,
2343 0x89e60c428d47a1,
2344 fidl::encoding::DynamicFlags::empty(),
2345 )
2346 }
2347}
2348
2349mod internal {
2350 use super::*;
2351
2352 impl fidl::encoding::ResourceTypeMarker for DiagnosticsGetProcessHandleForInspectionResponse {
2353 type Borrowed<'a> = &'a mut Self;
2354 fn take_or_borrow<'a>(
2355 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2356 ) -> Self::Borrowed<'a> {
2357 value
2358 }
2359 }
2360
2361 unsafe impl fidl::encoding::TypeMarker for DiagnosticsGetProcessHandleForInspectionResponse {
2362 type Owned = Self;
2363
2364 #[inline(always)]
2365 fn inline_align(_context: fidl::encoding::Context) -> usize {
2366 4
2367 }
2368
2369 #[inline(always)]
2370 fn inline_size(_context: fidl::encoding::Context) -> usize {
2371 4
2372 }
2373 }
2374
2375 unsafe impl
2376 fidl::encoding::Encode<
2377 DiagnosticsGetProcessHandleForInspectionResponse,
2378 fdomain_client::fidl::FDomainResourceDialect,
2379 > for &mut DiagnosticsGetProcessHandleForInspectionResponse
2380 {
2381 #[inline]
2382 unsafe fn encode(
2383 self,
2384 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2385 offset: usize,
2386 _depth: fidl::encoding::Depth,
2387 ) -> fidl::Result<()> {
2388 encoder.debug_check_bounds::<DiagnosticsGetProcessHandleForInspectionResponse>(offset);
2389 fidl::encoding::Encode::<
2391 DiagnosticsGetProcessHandleForInspectionResponse,
2392 fdomain_client::fidl::FDomainResourceDialect,
2393 >::encode(
2394 (<fidl::encoding::HandleType<
2395 fdomain_client::Process,
2396 { fidl::ObjectType::PROCESS.into_raw() },
2397 32768,
2398 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2399 &mut self.process
2400 ),),
2401 encoder,
2402 offset,
2403 _depth,
2404 )
2405 }
2406 }
2407 unsafe impl<
2408 T0: fidl::encoding::Encode<
2409 fidl::encoding::HandleType<
2410 fdomain_client::Process,
2411 { fidl::ObjectType::PROCESS.into_raw() },
2412 32768,
2413 >,
2414 fdomain_client::fidl::FDomainResourceDialect,
2415 >,
2416 >
2417 fidl::encoding::Encode<
2418 DiagnosticsGetProcessHandleForInspectionResponse,
2419 fdomain_client::fidl::FDomainResourceDialect,
2420 > for (T0,)
2421 {
2422 #[inline]
2423 unsafe fn encode(
2424 self,
2425 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2426 offset: usize,
2427 depth: fidl::encoding::Depth,
2428 ) -> fidl::Result<()> {
2429 encoder.debug_check_bounds::<DiagnosticsGetProcessHandleForInspectionResponse>(offset);
2430 self.0.encode(encoder, offset + 0, depth)?;
2434 Ok(())
2435 }
2436 }
2437
2438 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
2439 for DiagnosticsGetProcessHandleForInspectionResponse
2440 {
2441 #[inline(always)]
2442 fn new_empty() -> Self {
2443 Self {
2444 process: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Process, { fidl::ObjectType::PROCESS.into_raw() }, 32768>, fdomain_client::fidl::FDomainResourceDialect),
2445 }
2446 }
2447
2448 #[inline]
2449 unsafe fn decode(
2450 &mut self,
2451 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2452 offset: usize,
2453 _depth: fidl::encoding::Depth,
2454 ) -> fidl::Result<()> {
2455 decoder.debug_check_bounds::<Self>(offset);
2456 fidl::decode!(fidl::encoding::HandleType<fdomain_client::Process, { fidl::ObjectType::PROCESS.into_raw() }, 32768>, fdomain_client::fidl::FDomainResourceDialect, &mut self.process, decoder, offset + 0, _depth)?;
2458 Ok(())
2459 }
2460 }
2461
2462 impl fidl::encoding::ResourceTypeMarker for InterfacesGetPortRequest {
2463 type Borrowed<'a> = &'a mut Self;
2464 fn take_or_borrow<'a>(
2465 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2466 ) -> Self::Borrowed<'a> {
2467 value
2468 }
2469 }
2470
2471 unsafe impl fidl::encoding::TypeMarker for InterfacesGetPortRequest {
2472 type Owned = Self;
2473
2474 #[inline(always)]
2475 fn inline_align(_context: fidl::encoding::Context) -> usize {
2476 8
2477 }
2478
2479 #[inline(always)]
2480 fn inline_size(_context: fidl::encoding::Context) -> usize {
2481 16
2482 }
2483 }
2484
2485 unsafe impl
2486 fidl::encoding::Encode<
2487 InterfacesGetPortRequest,
2488 fdomain_client::fidl::FDomainResourceDialect,
2489 > for &mut InterfacesGetPortRequest
2490 {
2491 #[inline]
2492 unsafe fn encode(
2493 self,
2494 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2495 offset: usize,
2496 _depth: fidl::encoding::Depth,
2497 ) -> fidl::Result<()> {
2498 encoder.debug_check_bounds::<InterfacesGetPortRequest>(offset);
2499 fidl::encoding::Encode::<
2501 InterfacesGetPortRequest,
2502 fdomain_client::fidl::FDomainResourceDialect,
2503 >::encode(
2504 (
2505 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
2506 <fidl::encoding::Endpoint<
2507 fdomain_client::fidl::ServerEnd<
2508 fdomain_fuchsia_hardware_network::PortMarker,
2509 >,
2510 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2511 &mut self.port
2512 ),
2513 ),
2514 encoder,
2515 offset,
2516 _depth,
2517 )
2518 }
2519 }
2520 unsafe impl<
2521 T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>,
2522 T1: fidl::encoding::Encode<
2523 fidl::encoding::Endpoint<
2524 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_hardware_network::PortMarker>,
2525 >,
2526 fdomain_client::fidl::FDomainResourceDialect,
2527 >,
2528 >
2529 fidl::encoding::Encode<
2530 InterfacesGetPortRequest,
2531 fdomain_client::fidl::FDomainResourceDialect,
2532 > for (T0, T1)
2533 {
2534 #[inline]
2535 unsafe fn encode(
2536 self,
2537 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2538 offset: usize,
2539 depth: fidl::encoding::Depth,
2540 ) -> fidl::Result<()> {
2541 encoder.debug_check_bounds::<InterfacesGetPortRequest>(offset);
2542 unsafe {
2545 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2546 (ptr as *mut u64).write_unaligned(0);
2547 }
2548 self.0.encode(encoder, offset + 0, depth)?;
2550 self.1.encode(encoder, offset + 8, depth)?;
2551 Ok(())
2552 }
2553 }
2554
2555 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
2556 for InterfacesGetPortRequest
2557 {
2558 #[inline(always)]
2559 fn new_empty() -> Self {
2560 Self {
2561 id: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
2562 port: fidl::new_empty!(
2563 fidl::encoding::Endpoint<
2564 fdomain_client::fidl::ServerEnd<
2565 fdomain_fuchsia_hardware_network::PortMarker,
2566 >,
2567 >,
2568 fdomain_client::fidl::FDomainResourceDialect
2569 ),
2570 }
2571 }
2572
2573 #[inline]
2574 unsafe fn decode(
2575 &mut self,
2576 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2577 offset: usize,
2578 _depth: fidl::encoding::Depth,
2579 ) -> fidl::Result<()> {
2580 decoder.debug_check_bounds::<Self>(offset);
2581 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2583 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2584 let mask = 0xffffffff00000000u64;
2585 let maskedval = padval & mask;
2586 if maskedval != 0 {
2587 return Err(fidl::Error::NonZeroPadding {
2588 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2589 });
2590 }
2591 fidl::decode!(
2592 u64,
2593 fdomain_client::fidl::FDomainResourceDialect,
2594 &mut self.id,
2595 decoder,
2596 offset + 0,
2597 _depth
2598 )?;
2599 fidl::decode!(
2600 fidl::encoding::Endpoint<
2601 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_hardware_network::PortMarker>,
2602 >,
2603 fdomain_client::fidl::FDomainResourceDialect,
2604 &mut self.port,
2605 decoder,
2606 offset + 8,
2607 _depth
2608 )?;
2609 Ok(())
2610 }
2611 }
2612
2613 impl fidl::encoding::ResourceTypeMarker for PacketCaptureProviderReconnectRollingRequest {
2614 type Borrowed<'a> = &'a mut Self;
2615 fn take_or_borrow<'a>(
2616 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2617 ) -> Self::Borrowed<'a> {
2618 value
2619 }
2620 }
2621
2622 unsafe impl fidl::encoding::TypeMarker for PacketCaptureProviderReconnectRollingRequest {
2623 type Owned = Self;
2624
2625 #[inline(always)]
2626 fn inline_align(_context: fidl::encoding::Context) -> usize {
2627 8
2628 }
2629
2630 #[inline(always)]
2631 fn inline_size(_context: fidl::encoding::Context) -> usize {
2632 16
2633 }
2634 }
2635
2636 unsafe impl
2637 fidl::encoding::Encode<
2638 PacketCaptureProviderReconnectRollingRequest,
2639 fdomain_client::fidl::FDomainResourceDialect,
2640 > for &mut PacketCaptureProviderReconnectRollingRequest
2641 {
2642 #[inline]
2643 unsafe fn encode(
2644 self,
2645 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2646 offset: usize,
2647 _depth: fidl::encoding::Depth,
2648 ) -> fidl::Result<()> {
2649 encoder.debug_check_bounds::<PacketCaptureProviderReconnectRollingRequest>(offset);
2650 fidl::encoding::Encode::<
2652 PacketCaptureProviderReconnectRollingRequest,
2653 fdomain_client::fidl::FDomainResourceDialect,
2654 >::encode(
2655 (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
2656 &self.name,
2657 ),),
2658 encoder,
2659 offset,
2660 _depth,
2661 )
2662 }
2663 }
2664 unsafe impl<
2665 T0: fidl::encoding::Encode<
2666 fidl::encoding::BoundedString<64>,
2667 fdomain_client::fidl::FDomainResourceDialect,
2668 >,
2669 >
2670 fidl::encoding::Encode<
2671 PacketCaptureProviderReconnectRollingRequest,
2672 fdomain_client::fidl::FDomainResourceDialect,
2673 > for (T0,)
2674 {
2675 #[inline]
2676 unsafe fn encode(
2677 self,
2678 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2679 offset: usize,
2680 depth: fidl::encoding::Depth,
2681 ) -> fidl::Result<()> {
2682 encoder.debug_check_bounds::<PacketCaptureProviderReconnectRollingRequest>(offset);
2683 self.0.encode(encoder, offset + 0, depth)?;
2687 Ok(())
2688 }
2689 }
2690
2691 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
2692 for PacketCaptureProviderReconnectRollingRequest
2693 {
2694 #[inline(always)]
2695 fn new_empty() -> Self {
2696 Self {
2697 name: fidl::new_empty!(
2698 fidl::encoding::BoundedString<64>,
2699 fdomain_client::fidl::FDomainResourceDialect
2700 ),
2701 }
2702 }
2703
2704 #[inline]
2705 unsafe fn decode(
2706 &mut self,
2707 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2708 offset: usize,
2709 _depth: fidl::encoding::Depth,
2710 ) -> fidl::Result<()> {
2711 decoder.debug_check_bounds::<Self>(offset);
2712 fidl::decode!(
2714 fidl::encoding::BoundedString<64>,
2715 fdomain_client::fidl::FDomainResourceDialect,
2716 &mut self.name,
2717 decoder,
2718 offset + 0,
2719 _depth
2720 )?;
2721 Ok(())
2722 }
2723 }
2724
2725 impl fidl::encoding::ResourceTypeMarker for PacketCaptureProviderStartRollingRequest {
2726 type Borrowed<'a> = &'a mut Self;
2727 fn take_or_borrow<'a>(
2728 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2729 ) -> Self::Borrowed<'a> {
2730 value
2731 }
2732 }
2733
2734 unsafe impl fidl::encoding::TypeMarker for PacketCaptureProviderStartRollingRequest {
2735 type Owned = Self;
2736
2737 #[inline(always)]
2738 fn inline_align(_context: fidl::encoding::Context) -> usize {
2739 8
2740 }
2741
2742 #[inline(always)]
2743 fn inline_size(_context: fidl::encoding::Context) -> usize {
2744 32
2745 }
2746 }
2747
2748 unsafe impl
2749 fidl::encoding::Encode<
2750 PacketCaptureProviderStartRollingRequest,
2751 fdomain_client::fidl::FDomainResourceDialect,
2752 > for &mut PacketCaptureProviderStartRollingRequest
2753 {
2754 #[inline]
2755 unsafe fn encode(
2756 self,
2757 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2758 offset: usize,
2759 _depth: fidl::encoding::Depth,
2760 ) -> fidl::Result<()> {
2761 encoder.debug_check_bounds::<PacketCaptureProviderStartRollingRequest>(offset);
2762 fidl::encoding::Encode::<PacketCaptureProviderStartRollingRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
2764 (
2765 <CommonPacketCaptureParams as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.common_params),
2766 <RollingPacketCaptureParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
2767 ),
2768 encoder, offset, _depth
2769 )
2770 }
2771 }
2772 unsafe impl<
2773 T0: fidl::encoding::Encode<
2774 CommonPacketCaptureParams,
2775 fdomain_client::fidl::FDomainResourceDialect,
2776 >,
2777 T1: fidl::encoding::Encode<
2778 RollingPacketCaptureParams,
2779 fdomain_client::fidl::FDomainResourceDialect,
2780 >,
2781 >
2782 fidl::encoding::Encode<
2783 PacketCaptureProviderStartRollingRequest,
2784 fdomain_client::fidl::FDomainResourceDialect,
2785 > for (T0, T1)
2786 {
2787 #[inline]
2788 unsafe fn encode(
2789 self,
2790 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2791 offset: usize,
2792 depth: fidl::encoding::Depth,
2793 ) -> fidl::Result<()> {
2794 encoder.debug_check_bounds::<PacketCaptureProviderStartRollingRequest>(offset);
2795 self.0.encode(encoder, offset + 0, depth)?;
2799 self.1.encode(encoder, offset + 16, depth)?;
2800 Ok(())
2801 }
2802 }
2803
2804 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
2805 for PacketCaptureProviderStartRollingRequest
2806 {
2807 #[inline(always)]
2808 fn new_empty() -> Self {
2809 Self {
2810 common_params: fidl::new_empty!(
2811 CommonPacketCaptureParams,
2812 fdomain_client::fidl::FDomainResourceDialect
2813 ),
2814 params: fidl::new_empty!(
2815 RollingPacketCaptureParams,
2816 fdomain_client::fidl::FDomainResourceDialect
2817 ),
2818 }
2819 }
2820
2821 #[inline]
2822 unsafe fn decode(
2823 &mut self,
2824 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2825 offset: usize,
2826 _depth: fidl::encoding::Depth,
2827 ) -> fidl::Result<()> {
2828 decoder.debug_check_bounds::<Self>(offset);
2829 fidl::decode!(
2831 CommonPacketCaptureParams,
2832 fdomain_client::fidl::FDomainResourceDialect,
2833 &mut self.common_params,
2834 decoder,
2835 offset + 0,
2836 _depth
2837 )?;
2838 fidl::decode!(
2839 RollingPacketCaptureParams,
2840 fdomain_client::fidl::FDomainResourceDialect,
2841 &mut self.params,
2842 decoder,
2843 offset + 16,
2844 _depth
2845 )?;
2846 Ok(())
2847 }
2848 }
2849
2850 impl fidl::encoding::ResourceTypeMarker for PacketCaptureProviderReconnectRollingResponse {
2851 type Borrowed<'a> = &'a mut Self;
2852 fn take_or_borrow<'a>(
2853 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2854 ) -> Self::Borrowed<'a> {
2855 value
2856 }
2857 }
2858
2859 unsafe impl fidl::encoding::TypeMarker for PacketCaptureProviderReconnectRollingResponse {
2860 type Owned = Self;
2861
2862 #[inline(always)]
2863 fn inline_align(_context: fidl::encoding::Context) -> usize {
2864 4
2865 }
2866
2867 #[inline(always)]
2868 fn inline_size(_context: fidl::encoding::Context) -> usize {
2869 4
2870 }
2871 }
2872
2873 unsafe impl
2874 fidl::encoding::Encode<
2875 PacketCaptureProviderReconnectRollingResponse,
2876 fdomain_client::fidl::FDomainResourceDialect,
2877 > for &mut PacketCaptureProviderReconnectRollingResponse
2878 {
2879 #[inline]
2880 unsafe fn encode(
2881 self,
2882 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2883 offset: usize,
2884 _depth: fidl::encoding::Depth,
2885 ) -> fidl::Result<()> {
2886 encoder.debug_check_bounds::<PacketCaptureProviderReconnectRollingResponse>(offset);
2887 fidl::encoding::Encode::<
2889 PacketCaptureProviderReconnectRollingResponse,
2890 fdomain_client::fidl::FDomainResourceDialect,
2891 >::encode(
2892 (<fidl::encoding::Endpoint<
2893 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
2894 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2895 &mut self.channel
2896 ),),
2897 encoder,
2898 offset,
2899 _depth,
2900 )
2901 }
2902 }
2903 unsafe impl<
2904 T0: fidl::encoding::Encode<
2905 fidl::encoding::Endpoint<
2906 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
2907 >,
2908 fdomain_client::fidl::FDomainResourceDialect,
2909 >,
2910 >
2911 fidl::encoding::Encode<
2912 PacketCaptureProviderReconnectRollingResponse,
2913 fdomain_client::fidl::FDomainResourceDialect,
2914 > for (T0,)
2915 {
2916 #[inline]
2917 unsafe fn encode(
2918 self,
2919 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2920 offset: usize,
2921 depth: fidl::encoding::Depth,
2922 ) -> fidl::Result<()> {
2923 encoder.debug_check_bounds::<PacketCaptureProviderReconnectRollingResponse>(offset);
2924 self.0.encode(encoder, offset + 0, depth)?;
2928 Ok(())
2929 }
2930 }
2931
2932 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
2933 for PacketCaptureProviderReconnectRollingResponse
2934 {
2935 #[inline(always)]
2936 fn new_empty() -> Self {
2937 Self {
2938 channel: fidl::new_empty!(
2939 fidl::encoding::Endpoint<
2940 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
2941 >,
2942 fdomain_client::fidl::FDomainResourceDialect
2943 ),
2944 }
2945 }
2946
2947 #[inline]
2948 unsafe fn decode(
2949 &mut self,
2950 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
2951 offset: usize,
2952 _depth: fidl::encoding::Depth,
2953 ) -> fidl::Result<()> {
2954 decoder.debug_check_bounds::<Self>(offset);
2955 fidl::decode!(
2957 fidl::encoding::Endpoint<
2958 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
2959 >,
2960 fdomain_client::fidl::FDomainResourceDialect,
2961 &mut self.channel,
2962 decoder,
2963 offset + 0,
2964 _depth
2965 )?;
2966 Ok(())
2967 }
2968 }
2969
2970 impl fidl::encoding::ResourceTypeMarker for PacketCaptureProviderStartRollingResponse {
2971 type Borrowed<'a> = &'a mut Self;
2972 fn take_or_borrow<'a>(
2973 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2974 ) -> Self::Borrowed<'a> {
2975 value
2976 }
2977 }
2978
2979 unsafe impl fidl::encoding::TypeMarker for PacketCaptureProviderStartRollingResponse {
2980 type Owned = Self;
2981
2982 #[inline(always)]
2983 fn inline_align(_context: fidl::encoding::Context) -> usize {
2984 4
2985 }
2986
2987 #[inline(always)]
2988 fn inline_size(_context: fidl::encoding::Context) -> usize {
2989 4
2990 }
2991 }
2992
2993 unsafe impl
2994 fidl::encoding::Encode<
2995 PacketCaptureProviderStartRollingResponse,
2996 fdomain_client::fidl::FDomainResourceDialect,
2997 > for &mut PacketCaptureProviderStartRollingResponse
2998 {
2999 #[inline]
3000 unsafe fn encode(
3001 self,
3002 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3003 offset: usize,
3004 _depth: fidl::encoding::Depth,
3005 ) -> fidl::Result<()> {
3006 encoder.debug_check_bounds::<PacketCaptureProviderStartRollingResponse>(offset);
3007 fidl::encoding::Encode::<
3009 PacketCaptureProviderStartRollingResponse,
3010 fdomain_client::fidl::FDomainResourceDialect,
3011 >::encode(
3012 (<fidl::encoding::Endpoint<
3013 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
3014 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3015 &mut self.channel
3016 ),),
3017 encoder,
3018 offset,
3019 _depth,
3020 )
3021 }
3022 }
3023 unsafe impl<
3024 T0: fidl::encoding::Encode<
3025 fidl::encoding::Endpoint<
3026 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
3027 >,
3028 fdomain_client::fidl::FDomainResourceDialect,
3029 >,
3030 >
3031 fidl::encoding::Encode<
3032 PacketCaptureProviderStartRollingResponse,
3033 fdomain_client::fidl::FDomainResourceDialect,
3034 > for (T0,)
3035 {
3036 #[inline]
3037 unsafe fn encode(
3038 self,
3039 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3040 offset: usize,
3041 depth: fidl::encoding::Depth,
3042 ) -> fidl::Result<()> {
3043 encoder.debug_check_bounds::<PacketCaptureProviderStartRollingResponse>(offset);
3044 self.0.encode(encoder, offset + 0, depth)?;
3048 Ok(())
3049 }
3050 }
3051
3052 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
3053 for PacketCaptureProviderStartRollingResponse
3054 {
3055 #[inline(always)]
3056 fn new_empty() -> Self {
3057 Self {
3058 channel: fidl::new_empty!(
3059 fidl::encoding::Endpoint<
3060 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
3061 >,
3062 fdomain_client::fidl::FDomainResourceDialect
3063 ),
3064 }
3065 }
3066
3067 #[inline]
3068 unsafe fn decode(
3069 &mut self,
3070 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3071 offset: usize,
3072 _depth: fidl::encoding::Depth,
3073 ) -> fidl::Result<()> {
3074 decoder.debug_check_bounds::<Self>(offset);
3075 fidl::decode!(
3077 fidl::encoding::Endpoint<
3078 fdomain_client::fidl::ClientEnd<RollingPacketCaptureMarker>,
3079 >,
3080 fdomain_client::fidl::FDomainResourceDialect,
3081 &mut self.channel,
3082 decoder,
3083 offset + 0,
3084 _depth
3085 )?;
3086 Ok(())
3087 }
3088 }
3089
3090 impl fidl::encoding::ResourceTypeMarker for RollingPacketCaptureStopAndDownloadRequest {
3091 type Borrowed<'a> = &'a mut Self;
3092 fn take_or_borrow<'a>(
3093 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3094 ) -> Self::Borrowed<'a> {
3095 value
3096 }
3097 }
3098
3099 unsafe impl fidl::encoding::TypeMarker for RollingPacketCaptureStopAndDownloadRequest {
3100 type Owned = Self;
3101
3102 #[inline(always)]
3103 fn inline_align(_context: fidl::encoding::Context) -> usize {
3104 4
3105 }
3106
3107 #[inline(always)]
3108 fn inline_size(_context: fidl::encoding::Context) -> usize {
3109 4
3110 }
3111 }
3112
3113 unsafe impl
3114 fidl::encoding::Encode<
3115 RollingPacketCaptureStopAndDownloadRequest,
3116 fdomain_client::fidl::FDomainResourceDialect,
3117 > for &mut RollingPacketCaptureStopAndDownloadRequest
3118 {
3119 #[inline]
3120 unsafe fn encode(
3121 self,
3122 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3123 offset: usize,
3124 _depth: fidl::encoding::Depth,
3125 ) -> fidl::Result<()> {
3126 encoder.debug_check_bounds::<RollingPacketCaptureStopAndDownloadRequest>(offset);
3127 fidl::encoding::Encode::<
3129 RollingPacketCaptureStopAndDownloadRequest,
3130 fdomain_client::fidl::FDomainResourceDialect,
3131 >::encode(
3132 (<fidl::encoding::Endpoint<
3133 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
3134 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3135 &mut self.channel
3136 ),),
3137 encoder,
3138 offset,
3139 _depth,
3140 )
3141 }
3142 }
3143 unsafe impl<
3144 T0: fidl::encoding::Encode<
3145 fidl::encoding::Endpoint<
3146 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
3147 >,
3148 fdomain_client::fidl::FDomainResourceDialect,
3149 >,
3150 >
3151 fidl::encoding::Encode<
3152 RollingPacketCaptureStopAndDownloadRequest,
3153 fdomain_client::fidl::FDomainResourceDialect,
3154 > for (T0,)
3155 {
3156 #[inline]
3157 unsafe fn encode(
3158 self,
3159 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3160 offset: usize,
3161 depth: fidl::encoding::Depth,
3162 ) -> fidl::Result<()> {
3163 encoder.debug_check_bounds::<RollingPacketCaptureStopAndDownloadRequest>(offset);
3164 self.0.encode(encoder, offset + 0, depth)?;
3168 Ok(())
3169 }
3170 }
3171
3172 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
3173 for RollingPacketCaptureStopAndDownloadRequest
3174 {
3175 #[inline(always)]
3176 fn new_empty() -> Self {
3177 Self {
3178 channel: fidl::new_empty!(
3179 fidl::encoding::Endpoint<
3180 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
3181 >,
3182 fdomain_client::fidl::FDomainResourceDialect
3183 ),
3184 }
3185 }
3186
3187 #[inline]
3188 unsafe fn decode(
3189 &mut self,
3190 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3191 offset: usize,
3192 _depth: fidl::encoding::Depth,
3193 ) -> fidl::Result<()> {
3194 decoder.debug_check_bounds::<Self>(offset);
3195 fidl::decode!(
3197 fidl::encoding::Endpoint<
3198 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::FileMarker>,
3199 >,
3200 fdomain_client::fidl::FDomainResourceDialect,
3201 &mut self.channel,
3202 decoder,
3203 offset + 0,
3204 _depth
3205 )?;
3206 Ok(())
3207 }
3208 }
3209
3210 impl CommonPacketCaptureParams {
3211 #[inline(always)]
3212 fn max_ordinal_present(&self) -> u64 {
3213 if let Some(_) = self.snap_len {
3214 return 3;
3215 }
3216 if let Some(_) = self.bpf_program {
3217 return 2;
3218 }
3219 if let Some(_) = self.interfaces {
3220 return 1;
3221 }
3222 0
3223 }
3224 }
3225
3226 impl fidl::encoding::ResourceTypeMarker for CommonPacketCaptureParams {
3227 type Borrowed<'a> = &'a mut Self;
3228 fn take_or_borrow<'a>(
3229 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3230 ) -> Self::Borrowed<'a> {
3231 value
3232 }
3233 }
3234
3235 unsafe impl fidl::encoding::TypeMarker for CommonPacketCaptureParams {
3236 type Owned = Self;
3237
3238 #[inline(always)]
3239 fn inline_align(_context: fidl::encoding::Context) -> usize {
3240 8
3241 }
3242
3243 #[inline(always)]
3244 fn inline_size(_context: fidl::encoding::Context) -> usize {
3245 16
3246 }
3247 }
3248
3249 unsafe impl
3250 fidl::encoding::Encode<
3251 CommonPacketCaptureParams,
3252 fdomain_client::fidl::FDomainResourceDialect,
3253 > for &mut CommonPacketCaptureParams
3254 {
3255 unsafe fn encode(
3256 self,
3257 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3258 offset: usize,
3259 mut depth: fidl::encoding::Depth,
3260 ) -> fidl::Result<()> {
3261 encoder.debug_check_bounds::<CommonPacketCaptureParams>(offset);
3262 let max_ordinal: u64 = self.max_ordinal_present();
3264 encoder.write_num(max_ordinal, offset);
3265 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3266 if max_ordinal == 0 {
3268 return Ok(());
3269 }
3270 depth.increment()?;
3271 let envelope_size = 8;
3272 let bytes_len = max_ordinal as usize * envelope_size;
3273 #[allow(unused_variables)]
3274 let offset = encoder.out_of_line_offset(bytes_len);
3275 let mut _prev_end_offset: usize = 0;
3276 if 1 > max_ordinal {
3277 return Ok(());
3278 }
3279
3280 let cur_offset: usize = (1 - 1) * envelope_size;
3283
3284 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3286
3287 fidl::encoding::encode_in_envelope_optional::<
3292 InterfaceSpecifier,
3293 fdomain_client::fidl::FDomainResourceDialect,
3294 >(
3295 self.interfaces
3296 .as_ref()
3297 .map(<InterfaceSpecifier as fidl::encoding::ValueTypeMarker>::borrow),
3298 encoder,
3299 offset + cur_offset,
3300 depth,
3301 )?;
3302
3303 _prev_end_offset = cur_offset + envelope_size;
3304 if 2 > max_ordinal {
3305 return Ok(());
3306 }
3307
3308 let cur_offset: usize = (2 - 1) * envelope_size;
3311
3312 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3314
3315 fidl::encoding::encode_in_envelope_optional::<fdomain_fuchsia_ebpf::VerifiedProgram, fdomain_client::fidl::FDomainResourceDialect>(
3320 self.bpf_program.as_mut().map(<fdomain_fuchsia_ebpf::VerifiedProgram as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
3321 encoder, offset + cur_offset, depth
3322 )?;
3323
3324 _prev_end_offset = cur_offset + envelope_size;
3325 if 3 > max_ordinal {
3326 return Ok(());
3327 }
3328
3329 let cur_offset: usize = (3 - 1) * envelope_size;
3332
3333 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3335
3336 fidl::encoding::encode_in_envelope_optional::<
3341 u32,
3342 fdomain_client::fidl::FDomainResourceDialect,
3343 >(
3344 self.snap_len.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
3345 encoder,
3346 offset + cur_offset,
3347 depth,
3348 )?;
3349
3350 _prev_end_offset = cur_offset + envelope_size;
3351
3352 Ok(())
3353 }
3354 }
3355
3356 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
3357 for CommonPacketCaptureParams
3358 {
3359 #[inline(always)]
3360 fn new_empty() -> Self {
3361 Self::default()
3362 }
3363
3364 unsafe fn decode(
3365 &mut self,
3366 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
3367 offset: usize,
3368 mut depth: fidl::encoding::Depth,
3369 ) -> fidl::Result<()> {
3370 decoder.debug_check_bounds::<Self>(offset);
3371 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3372 None => return Err(fidl::Error::NotNullable),
3373 Some(len) => len,
3374 };
3375 if len == 0 {
3377 return Ok(());
3378 };
3379 depth.increment()?;
3380 let envelope_size = 8;
3381 let bytes_len = len * envelope_size;
3382 let offset = decoder.out_of_line_offset(bytes_len)?;
3383 let mut _next_ordinal_to_read = 0;
3385 let mut next_offset = offset;
3386 let end_offset = offset + bytes_len;
3387 _next_ordinal_to_read += 1;
3388 if next_offset >= end_offset {
3389 return Ok(());
3390 }
3391
3392 while _next_ordinal_to_read < 1 {
3394 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3395 _next_ordinal_to_read += 1;
3396 next_offset += envelope_size;
3397 }
3398
3399 let next_out_of_line = decoder.next_out_of_line();
3400 let handles_before = decoder.remaining_handles();
3401 if let Some((inlined, num_bytes, num_handles)) =
3402 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3403 {
3404 let member_inline_size =
3405 <InterfaceSpecifier as fidl::encoding::TypeMarker>::inline_size(
3406 decoder.context,
3407 );
3408 if inlined != (member_inline_size <= 4) {
3409 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3410 }
3411 let inner_offset;
3412 let mut inner_depth = depth.clone();
3413 if inlined {
3414 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3415 inner_offset = next_offset;
3416 } else {
3417 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3418 inner_depth.increment()?;
3419 }
3420 let val_ref = self.interfaces.get_or_insert_with(|| {
3421 fidl::new_empty!(
3422 InterfaceSpecifier,
3423 fdomain_client::fidl::FDomainResourceDialect
3424 )
3425 });
3426 fidl::decode!(
3427 InterfaceSpecifier,
3428 fdomain_client::fidl::FDomainResourceDialect,
3429 val_ref,
3430 decoder,
3431 inner_offset,
3432 inner_depth
3433 )?;
3434 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3435 {
3436 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3437 }
3438 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3439 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3440 }
3441 }
3442
3443 next_offset += envelope_size;
3444 _next_ordinal_to_read += 1;
3445 if next_offset >= end_offset {
3446 return Ok(());
3447 }
3448
3449 while _next_ordinal_to_read < 2 {
3451 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3452 _next_ordinal_to_read += 1;
3453 next_offset += envelope_size;
3454 }
3455
3456 let next_out_of_line = decoder.next_out_of_line();
3457 let handles_before = decoder.remaining_handles();
3458 if let Some((inlined, num_bytes, num_handles)) =
3459 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3460 {
3461 let member_inline_size = <fdomain_fuchsia_ebpf::VerifiedProgram as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3462 if inlined != (member_inline_size <= 4) {
3463 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3464 }
3465 let inner_offset;
3466 let mut inner_depth = depth.clone();
3467 if inlined {
3468 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3469 inner_offset = next_offset;
3470 } else {
3471 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3472 inner_depth.increment()?;
3473 }
3474 let val_ref = self.bpf_program.get_or_insert_with(|| {
3475 fidl::new_empty!(
3476 fdomain_fuchsia_ebpf::VerifiedProgram,
3477 fdomain_client::fidl::FDomainResourceDialect
3478 )
3479 });
3480 fidl::decode!(
3481 fdomain_fuchsia_ebpf::VerifiedProgram,
3482 fdomain_client::fidl::FDomainResourceDialect,
3483 val_ref,
3484 decoder,
3485 inner_offset,
3486 inner_depth
3487 )?;
3488 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3489 {
3490 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3491 }
3492 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3493 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3494 }
3495 }
3496
3497 next_offset += envelope_size;
3498 _next_ordinal_to_read += 1;
3499 if next_offset >= end_offset {
3500 return Ok(());
3501 }
3502
3503 while _next_ordinal_to_read < 3 {
3505 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3506 _next_ordinal_to_read += 1;
3507 next_offset += envelope_size;
3508 }
3509
3510 let next_out_of_line = decoder.next_out_of_line();
3511 let handles_before = decoder.remaining_handles();
3512 if let Some((inlined, num_bytes, num_handles)) =
3513 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3514 {
3515 let member_inline_size =
3516 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3517 if inlined != (member_inline_size <= 4) {
3518 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3519 }
3520 let inner_offset;
3521 let mut inner_depth = depth.clone();
3522 if inlined {
3523 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3524 inner_offset = next_offset;
3525 } else {
3526 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3527 inner_depth.increment()?;
3528 }
3529 let val_ref = self.snap_len.get_or_insert_with(|| {
3530 fidl::new_empty!(u32, fdomain_client::fidl::FDomainResourceDialect)
3531 });
3532 fidl::decode!(
3533 u32,
3534 fdomain_client::fidl::FDomainResourceDialect,
3535 val_ref,
3536 decoder,
3537 inner_offset,
3538 inner_depth
3539 )?;
3540 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3541 {
3542 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3543 }
3544 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3545 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3546 }
3547 }
3548
3549 next_offset += envelope_size;
3550
3551 while next_offset < end_offset {
3553 _next_ordinal_to_read += 1;
3554 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3555 next_offset += envelope_size;
3556 }
3557
3558 Ok(())
3559 }
3560 }
3561}