1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_net_routes_admin_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct BaseRouteTableGetAuthorizationForRouteTableResponse {
16 pub credential: GrantForRouteTableAuthorization,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for BaseRouteTableGetAuthorizationForRouteTableResponse
21{
22}
23
24#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
25pub struct GrantForRouteTableAuthorization {
26 pub table_id: u32,
28 pub token: fidl::Event,
30}
31
32impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
33 for GrantForRouteTableAuthorization
34{
35}
36
37#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
38pub struct ProofOfRouteTableAuthorization {
39 pub table: u32,
40 pub token: fidl::Event,
41}
42
43impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
44 for ProofOfRouteTableAuthorization
45{
46}
47
48#[derive(Debug, PartialEq)]
49pub struct RouteSetV4AddRouteRequest {
50 pub route: fidl_fuchsia_net_routes::RouteV4,
51}
52
53impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RouteSetV4AddRouteRequest {}
54
55#[derive(Debug, PartialEq)]
56pub struct RouteSetV4AuthenticateForInterfaceRequest {
57 pub credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
58}
59
60impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
61 for RouteSetV4AuthenticateForInterfaceRequest
62{
63}
64
65#[derive(Debug, PartialEq)]
66pub struct RouteSetV4RemoveRouteRequest {
67 pub route: fidl_fuchsia_net_routes::RouteV4,
68}
69
70impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
71 for RouteSetV4RemoveRouteRequest
72{
73}
74
75#[derive(Debug, PartialEq)]
76pub struct RouteSetV6AddRouteRequest {
77 pub route: fidl_fuchsia_net_routes::RouteV6,
78}
79
80impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RouteSetV6AddRouteRequest {}
81
82#[derive(Debug, PartialEq)]
83pub struct RouteSetV6AuthenticateForInterfaceRequest {
84 pub credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
85}
86
87impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
88 for RouteSetV6AuthenticateForInterfaceRequest
89{
90}
91
92#[derive(Debug, PartialEq)]
93pub struct RouteSetV6RemoveRouteRequest {
94 pub route: fidl_fuchsia_net_routes::RouteV6,
95}
96
97impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
98 for RouteSetV6RemoveRouteRequest
99{
100}
101
102#[derive(Debug, PartialEq)]
103pub struct RouteTableProviderV4NewRouteTableRequest {
104 pub provider: fidl::endpoints::ServerEnd<RouteTableV4Marker>,
105 pub options: RouteTableOptionsV4,
106}
107
108impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
109 for RouteTableProviderV4NewRouteTableRequest
110{
111}
112
113#[derive(Debug, PartialEq)]
114pub struct RouteTableProviderV6NewRouteTableRequest {
115 pub provider: fidl::endpoints::ServerEnd<RouteTableV6Marker>,
116 pub options: RouteTableOptionsV6,
117}
118
119impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
120 for RouteTableProviderV6NewRouteTableRequest
121{
122}
123
124#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
125pub struct RouteTableV4NewRouteSetRequest {
126 pub route_set: fidl::endpoints::ServerEnd<RouteSetV4Marker>,
127}
128
129impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
130 for RouteTableV4NewRouteSetRequest
131{
132}
133
134#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135pub struct RouteTableV6NewRouteSetRequest {
136 pub route_set: fidl::endpoints::ServerEnd<RouteSetV6Marker>,
137}
138
139impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
140 for RouteTableV6NewRouteSetRequest
141{
142}
143
144#[derive(Debug, PartialEq)]
145pub struct RuleSetV4AddRuleRequest {
146 pub index: u32,
147 pub matcher: fidl_fuchsia_net_routes::RuleMatcherV4,
148 pub action: fidl_fuchsia_net_routes::RuleAction,
149}
150
151impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RuleSetV4AddRuleRequest {}
152
153#[derive(Debug, PartialEq)]
154pub struct RuleSetV6AddRuleRequest {
155 pub index: u32,
156 pub matcher: fidl_fuchsia_net_routes::RuleMatcherV6,
157 pub action: fidl_fuchsia_net_routes::RuleAction,
158}
159
160impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RuleSetV6AddRuleRequest {}
161
162#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
163pub struct RuleTableV4NewRuleSetRequest {
164 pub priority: u32,
165 pub rule_set: fidl::endpoints::ServerEnd<RuleSetV4Marker>,
166}
167
168impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
169 for RuleTableV4NewRuleSetRequest
170{
171}
172
173#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
174pub struct RuleTableV6NewRuleSetRequest {
175 pub priority: u32,
176 pub rule_set: fidl::endpoints::ServerEnd<RuleSetV6Marker>,
177}
178
179impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
180 for RuleTableV6NewRuleSetRequest
181{
182}
183
184#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
185pub struct BaseRouteTableMarker;
186
187impl fidl::endpoints::ProtocolMarker for BaseRouteTableMarker {
188 type Proxy = BaseRouteTableProxy;
189 type RequestStream = BaseRouteTableRequestStream;
190 #[cfg(target_os = "fuchsia")]
191 type SynchronousProxy = BaseRouteTableSynchronousProxy;
192
193 const DEBUG_NAME: &'static str = "(anonymous) BaseRouteTable";
194}
195pub type BaseRouteTableRemoveResult = Result<(), BaseRouteTableRemoveError>;
196
197pub trait BaseRouteTableProxyInterface: Send + Sync {
198 type GetTableIdResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
199 fn r#get_table_id(&self) -> Self::GetTableIdResponseFut;
200 fn r#detach(&self) -> Result<(), fidl::Error>;
201 type RemoveResponseFut: std::future::Future<Output = Result<BaseRouteTableRemoveResult, fidl::Error>>
202 + Send;
203 fn r#remove(&self) -> Self::RemoveResponseFut;
204 type GetAuthorizationForRouteTableResponseFut: std::future::Future<Output = Result<GrantForRouteTableAuthorization, fidl::Error>>
205 + Send;
206 fn r#get_authorization_for_route_table(&self)
207 -> Self::GetAuthorizationForRouteTableResponseFut;
208}
209#[derive(Debug)]
210#[cfg(target_os = "fuchsia")]
211pub struct BaseRouteTableSynchronousProxy {
212 client: fidl::client::sync::Client,
213}
214
215#[cfg(target_os = "fuchsia")]
216impl fidl::endpoints::SynchronousProxy for BaseRouteTableSynchronousProxy {
217 type Proxy = BaseRouteTableProxy;
218 type Protocol = BaseRouteTableMarker;
219
220 fn from_channel(inner: fidl::Channel) -> Self {
221 Self::new(inner)
222 }
223
224 fn into_channel(self) -> fidl::Channel {
225 self.client.into_channel()
226 }
227
228 fn as_channel(&self) -> &fidl::Channel {
229 self.client.as_channel()
230 }
231}
232
233#[cfg(target_os = "fuchsia")]
234impl BaseRouteTableSynchronousProxy {
235 pub fn new(channel: fidl::Channel) -> Self {
236 let protocol_name = <BaseRouteTableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
237 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
238 }
239
240 pub fn into_channel(self) -> fidl::Channel {
241 self.client.into_channel()
242 }
243
244 pub fn wait_for_event(
247 &self,
248 deadline: zx::MonotonicInstant,
249 ) -> Result<BaseRouteTableEvent, fidl::Error> {
250 BaseRouteTableEvent::decode(self.client.wait_for_event(deadline)?)
251 }
252
253 pub fn r#get_table_id(&self, ___deadline: zx::MonotonicInstant) -> Result<u32, fidl::Error> {
255 let _response = self
256 .client
257 .send_query::<fidl::encoding::EmptyPayload, BaseRouteTableGetTableIdResponse>(
258 (),
259 0x7eab30c55edbfc15,
260 fidl::encoding::DynamicFlags::empty(),
261 ___deadline,
262 )?;
263 Ok(_response.table_id)
264 }
265
266 pub fn r#detach(&self) -> Result<(), fidl::Error> {
272 self.client.send::<fidl::encoding::EmptyPayload>(
273 (),
274 0x2853ab157285b384,
275 fidl::encoding::DynamicFlags::empty(),
276 )
277 }
278
279 pub fn r#remove(
285 &self,
286 ___deadline: zx::MonotonicInstant,
287 ) -> Result<BaseRouteTableRemoveResult, fidl::Error> {
288 let _response =
289 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
290 fidl::encoding::EmptyStruct,
291 BaseRouteTableRemoveError,
292 >>(
293 (),
294 0xc42e58a5fc79426,
295 fidl::encoding::DynamicFlags::empty(),
296 ___deadline,
297 )?;
298 Ok(_response.map(|x| x))
299 }
300
301 pub fn r#get_authorization_for_route_table(
312 &self,
313 ___deadline: zx::MonotonicInstant,
314 ) -> Result<GrantForRouteTableAuthorization, fidl::Error> {
315 let _response = self.client.send_query::<
316 fidl::encoding::EmptyPayload,
317 BaseRouteTableGetAuthorizationForRouteTableResponse,
318 >(
319 (),
320 0x56a48c921ff3b6eb,
321 fidl::encoding::DynamicFlags::empty(),
322 ___deadline,
323 )?;
324 Ok(_response.credential)
325 }
326}
327
328#[cfg(target_os = "fuchsia")]
329impl From<BaseRouteTableSynchronousProxy> for zx::Handle {
330 fn from(value: BaseRouteTableSynchronousProxy) -> Self {
331 value.into_channel().into()
332 }
333}
334
335#[cfg(target_os = "fuchsia")]
336impl From<fidl::Channel> for BaseRouteTableSynchronousProxy {
337 fn from(value: fidl::Channel) -> Self {
338 Self::new(value)
339 }
340}
341
342#[derive(Debug, Clone)]
343pub struct BaseRouteTableProxy {
344 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
345}
346
347impl fidl::endpoints::Proxy for BaseRouteTableProxy {
348 type Protocol = BaseRouteTableMarker;
349
350 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
351 Self::new(inner)
352 }
353
354 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
355 self.client.into_channel().map_err(|client| Self { client })
356 }
357
358 fn as_channel(&self) -> &::fidl::AsyncChannel {
359 self.client.as_channel()
360 }
361}
362
363impl BaseRouteTableProxy {
364 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
366 let protocol_name = <BaseRouteTableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
367 Self { client: fidl::client::Client::new(channel, protocol_name) }
368 }
369
370 pub fn take_event_stream(&self) -> BaseRouteTableEventStream {
376 BaseRouteTableEventStream { event_receiver: self.client.take_event_receiver() }
377 }
378
379 pub fn r#get_table_id(
381 &self,
382 ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
383 BaseRouteTableProxyInterface::r#get_table_id(self)
384 }
385
386 pub fn r#detach(&self) -> Result<(), fidl::Error> {
392 BaseRouteTableProxyInterface::r#detach(self)
393 }
394
395 pub fn r#remove(
401 &self,
402 ) -> fidl::client::QueryResponseFut<
403 BaseRouteTableRemoveResult,
404 fidl::encoding::DefaultFuchsiaResourceDialect,
405 > {
406 BaseRouteTableProxyInterface::r#remove(self)
407 }
408
409 pub fn r#get_authorization_for_route_table(
420 &self,
421 ) -> fidl::client::QueryResponseFut<
422 GrantForRouteTableAuthorization,
423 fidl::encoding::DefaultFuchsiaResourceDialect,
424 > {
425 BaseRouteTableProxyInterface::r#get_authorization_for_route_table(self)
426 }
427}
428
429impl BaseRouteTableProxyInterface for BaseRouteTableProxy {
430 type GetTableIdResponseFut =
431 fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
432 fn r#get_table_id(&self) -> Self::GetTableIdResponseFut {
433 fn _decode(
434 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
435 ) -> Result<u32, fidl::Error> {
436 let _response = fidl::client::decode_transaction_body::<
437 BaseRouteTableGetTableIdResponse,
438 fidl::encoding::DefaultFuchsiaResourceDialect,
439 0x7eab30c55edbfc15,
440 >(_buf?)?;
441 Ok(_response.table_id)
442 }
443 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
444 (),
445 0x7eab30c55edbfc15,
446 fidl::encoding::DynamicFlags::empty(),
447 _decode,
448 )
449 }
450
451 fn r#detach(&self) -> Result<(), fidl::Error> {
452 self.client.send::<fidl::encoding::EmptyPayload>(
453 (),
454 0x2853ab157285b384,
455 fidl::encoding::DynamicFlags::empty(),
456 )
457 }
458
459 type RemoveResponseFut = fidl::client::QueryResponseFut<
460 BaseRouteTableRemoveResult,
461 fidl::encoding::DefaultFuchsiaResourceDialect,
462 >;
463 fn r#remove(&self) -> Self::RemoveResponseFut {
464 fn _decode(
465 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
466 ) -> Result<BaseRouteTableRemoveResult, fidl::Error> {
467 let _response = fidl::client::decode_transaction_body::<
468 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BaseRouteTableRemoveError>,
469 fidl::encoding::DefaultFuchsiaResourceDialect,
470 0xc42e58a5fc79426,
471 >(_buf?)?;
472 Ok(_response.map(|x| x))
473 }
474 self.client
475 .send_query_and_decode::<fidl::encoding::EmptyPayload, BaseRouteTableRemoveResult>(
476 (),
477 0xc42e58a5fc79426,
478 fidl::encoding::DynamicFlags::empty(),
479 _decode,
480 )
481 }
482
483 type GetAuthorizationForRouteTableResponseFut = fidl::client::QueryResponseFut<
484 GrantForRouteTableAuthorization,
485 fidl::encoding::DefaultFuchsiaResourceDialect,
486 >;
487 fn r#get_authorization_for_route_table(
488 &self,
489 ) -> Self::GetAuthorizationForRouteTableResponseFut {
490 fn _decode(
491 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
492 ) -> Result<GrantForRouteTableAuthorization, fidl::Error> {
493 let _response = fidl::client::decode_transaction_body::<
494 BaseRouteTableGetAuthorizationForRouteTableResponse,
495 fidl::encoding::DefaultFuchsiaResourceDialect,
496 0x56a48c921ff3b6eb,
497 >(_buf?)?;
498 Ok(_response.credential)
499 }
500 self.client
501 .send_query_and_decode::<fidl::encoding::EmptyPayload, GrantForRouteTableAuthorization>(
502 (),
503 0x56a48c921ff3b6eb,
504 fidl::encoding::DynamicFlags::empty(),
505 _decode,
506 )
507 }
508}
509
510pub struct BaseRouteTableEventStream {
511 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
512}
513
514impl std::marker::Unpin for BaseRouteTableEventStream {}
515
516impl futures::stream::FusedStream for BaseRouteTableEventStream {
517 fn is_terminated(&self) -> bool {
518 self.event_receiver.is_terminated()
519 }
520}
521
522impl futures::Stream for BaseRouteTableEventStream {
523 type Item = Result<BaseRouteTableEvent, fidl::Error>;
524
525 fn poll_next(
526 mut self: std::pin::Pin<&mut Self>,
527 cx: &mut std::task::Context<'_>,
528 ) -> std::task::Poll<Option<Self::Item>> {
529 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
530 &mut self.event_receiver,
531 cx
532 )?) {
533 Some(buf) => std::task::Poll::Ready(Some(BaseRouteTableEvent::decode(buf))),
534 None => std::task::Poll::Ready(None),
535 }
536 }
537}
538
539#[derive(Debug)]
540pub enum BaseRouteTableEvent {}
541
542impl BaseRouteTableEvent {
543 fn decode(
545 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
546 ) -> Result<BaseRouteTableEvent, fidl::Error> {
547 let (bytes, _handles) = buf.split_mut();
548 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
549 debug_assert_eq!(tx_header.tx_id, 0);
550 match tx_header.ordinal {
551 _ => Err(fidl::Error::UnknownOrdinal {
552 ordinal: tx_header.ordinal,
553 protocol_name:
554 <BaseRouteTableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
555 }),
556 }
557 }
558}
559
560pub struct BaseRouteTableRequestStream {
562 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
563 is_terminated: bool,
564}
565
566impl std::marker::Unpin for BaseRouteTableRequestStream {}
567
568impl futures::stream::FusedStream for BaseRouteTableRequestStream {
569 fn is_terminated(&self) -> bool {
570 self.is_terminated
571 }
572}
573
574impl fidl::endpoints::RequestStream for BaseRouteTableRequestStream {
575 type Protocol = BaseRouteTableMarker;
576 type ControlHandle = BaseRouteTableControlHandle;
577
578 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
579 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
580 }
581
582 fn control_handle(&self) -> Self::ControlHandle {
583 BaseRouteTableControlHandle { inner: self.inner.clone() }
584 }
585
586 fn into_inner(
587 self,
588 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
589 {
590 (self.inner, self.is_terminated)
591 }
592
593 fn from_inner(
594 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
595 is_terminated: bool,
596 ) -> Self {
597 Self { inner, is_terminated }
598 }
599}
600
601impl futures::Stream for BaseRouteTableRequestStream {
602 type Item = Result<BaseRouteTableRequest, fidl::Error>;
603
604 fn poll_next(
605 mut self: std::pin::Pin<&mut Self>,
606 cx: &mut std::task::Context<'_>,
607 ) -> std::task::Poll<Option<Self::Item>> {
608 let this = &mut *self;
609 if this.inner.check_shutdown(cx) {
610 this.is_terminated = true;
611 return std::task::Poll::Ready(None);
612 }
613 if this.is_terminated {
614 panic!("polled BaseRouteTableRequestStream after completion");
615 }
616 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
617 |bytes, handles| {
618 match this.inner.channel().read_etc(cx, bytes, handles) {
619 std::task::Poll::Ready(Ok(())) => {}
620 std::task::Poll::Pending => return std::task::Poll::Pending,
621 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
622 this.is_terminated = true;
623 return std::task::Poll::Ready(None);
624 }
625 std::task::Poll::Ready(Err(e)) => {
626 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
627 e.into(),
628 ))))
629 }
630 }
631
632 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
634
635 std::task::Poll::Ready(Some(match header.ordinal {
636 0x7eab30c55edbfc15 => {
637 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
638 let mut req = fidl::new_empty!(
639 fidl::encoding::EmptyPayload,
640 fidl::encoding::DefaultFuchsiaResourceDialect
641 );
642 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
643 let control_handle =
644 BaseRouteTableControlHandle { inner: this.inner.clone() };
645 Ok(BaseRouteTableRequest::GetTableId {
646 responder: BaseRouteTableGetTableIdResponder {
647 control_handle: std::mem::ManuallyDrop::new(control_handle),
648 tx_id: header.tx_id,
649 },
650 })
651 }
652 0x2853ab157285b384 => {
653 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
654 let mut req = fidl::new_empty!(
655 fidl::encoding::EmptyPayload,
656 fidl::encoding::DefaultFuchsiaResourceDialect
657 );
658 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
659 let control_handle =
660 BaseRouteTableControlHandle { inner: this.inner.clone() };
661 Ok(BaseRouteTableRequest::Detach { control_handle })
662 }
663 0xc42e58a5fc79426 => {
664 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
665 let mut req = fidl::new_empty!(
666 fidl::encoding::EmptyPayload,
667 fidl::encoding::DefaultFuchsiaResourceDialect
668 );
669 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
670 let control_handle =
671 BaseRouteTableControlHandle { inner: this.inner.clone() };
672 Ok(BaseRouteTableRequest::Remove {
673 responder: BaseRouteTableRemoveResponder {
674 control_handle: std::mem::ManuallyDrop::new(control_handle),
675 tx_id: header.tx_id,
676 },
677 })
678 }
679 0x56a48c921ff3b6eb => {
680 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
681 let mut req = fidl::new_empty!(
682 fidl::encoding::EmptyPayload,
683 fidl::encoding::DefaultFuchsiaResourceDialect
684 );
685 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
686 let control_handle =
687 BaseRouteTableControlHandle { inner: this.inner.clone() };
688 Ok(BaseRouteTableRequest::GetAuthorizationForRouteTable {
689 responder: BaseRouteTableGetAuthorizationForRouteTableResponder {
690 control_handle: std::mem::ManuallyDrop::new(control_handle),
691 tx_id: header.tx_id,
692 },
693 })
694 }
695 _ => Err(fidl::Error::UnknownOrdinal {
696 ordinal: header.ordinal,
697 protocol_name:
698 <BaseRouteTableMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
699 }),
700 }))
701 },
702 )
703 }
704}
705
706#[derive(Debug)]
709pub enum BaseRouteTableRequest {
710 GetTableId { responder: BaseRouteTableGetTableIdResponder },
712 Detach { control_handle: BaseRouteTableControlHandle },
718 Remove { responder: BaseRouteTableRemoveResponder },
724 GetAuthorizationForRouteTable {
735 responder: BaseRouteTableGetAuthorizationForRouteTableResponder,
736 },
737}
738
739impl BaseRouteTableRequest {
740 #[allow(irrefutable_let_patterns)]
741 pub fn into_get_table_id(self) -> Option<(BaseRouteTableGetTableIdResponder)> {
742 if let BaseRouteTableRequest::GetTableId { responder } = self {
743 Some((responder))
744 } else {
745 None
746 }
747 }
748
749 #[allow(irrefutable_let_patterns)]
750 pub fn into_detach(self) -> Option<(BaseRouteTableControlHandle)> {
751 if let BaseRouteTableRequest::Detach { control_handle } = self {
752 Some((control_handle))
753 } else {
754 None
755 }
756 }
757
758 #[allow(irrefutable_let_patterns)]
759 pub fn into_remove(self) -> Option<(BaseRouteTableRemoveResponder)> {
760 if let BaseRouteTableRequest::Remove { responder } = self {
761 Some((responder))
762 } else {
763 None
764 }
765 }
766
767 #[allow(irrefutable_let_patterns)]
768 pub fn into_get_authorization_for_route_table(
769 self,
770 ) -> Option<(BaseRouteTableGetAuthorizationForRouteTableResponder)> {
771 if let BaseRouteTableRequest::GetAuthorizationForRouteTable { responder } = self {
772 Some((responder))
773 } else {
774 None
775 }
776 }
777
778 pub fn method_name(&self) -> &'static str {
780 match *self {
781 BaseRouteTableRequest::GetTableId { .. } => "get_table_id",
782 BaseRouteTableRequest::Detach { .. } => "detach",
783 BaseRouteTableRequest::Remove { .. } => "remove",
784 BaseRouteTableRequest::GetAuthorizationForRouteTable { .. } => {
785 "get_authorization_for_route_table"
786 }
787 }
788 }
789}
790
791#[derive(Debug, Clone)]
792pub struct BaseRouteTableControlHandle {
793 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
794}
795
796impl fidl::endpoints::ControlHandle for BaseRouteTableControlHandle {
797 fn shutdown(&self) {
798 self.inner.shutdown()
799 }
800 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
801 self.inner.shutdown_with_epitaph(status)
802 }
803
804 fn is_closed(&self) -> bool {
805 self.inner.channel().is_closed()
806 }
807 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
808 self.inner.channel().on_closed()
809 }
810
811 #[cfg(target_os = "fuchsia")]
812 fn signal_peer(
813 &self,
814 clear_mask: zx::Signals,
815 set_mask: zx::Signals,
816 ) -> Result<(), zx_status::Status> {
817 use fidl::Peered;
818 self.inner.channel().signal_peer(clear_mask, set_mask)
819 }
820}
821
822impl BaseRouteTableControlHandle {}
823
824#[must_use = "FIDL methods require a response to be sent"]
825#[derive(Debug)]
826pub struct BaseRouteTableGetTableIdResponder {
827 control_handle: std::mem::ManuallyDrop<BaseRouteTableControlHandle>,
828 tx_id: u32,
829}
830
831impl std::ops::Drop for BaseRouteTableGetTableIdResponder {
835 fn drop(&mut self) {
836 self.control_handle.shutdown();
837 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
839 }
840}
841
842impl fidl::endpoints::Responder for BaseRouteTableGetTableIdResponder {
843 type ControlHandle = BaseRouteTableControlHandle;
844
845 fn control_handle(&self) -> &BaseRouteTableControlHandle {
846 &self.control_handle
847 }
848
849 fn drop_without_shutdown(mut self) {
850 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
852 std::mem::forget(self);
854 }
855}
856
857impl BaseRouteTableGetTableIdResponder {
858 pub fn send(self, mut table_id: u32) -> Result<(), fidl::Error> {
862 let _result = self.send_raw(table_id);
863 if _result.is_err() {
864 self.control_handle.shutdown();
865 }
866 self.drop_without_shutdown();
867 _result
868 }
869
870 pub fn send_no_shutdown_on_err(self, mut table_id: u32) -> Result<(), fidl::Error> {
872 let _result = self.send_raw(table_id);
873 self.drop_without_shutdown();
874 _result
875 }
876
877 fn send_raw(&self, mut table_id: u32) -> Result<(), fidl::Error> {
878 self.control_handle.inner.send::<BaseRouteTableGetTableIdResponse>(
879 (table_id,),
880 self.tx_id,
881 0x7eab30c55edbfc15,
882 fidl::encoding::DynamicFlags::empty(),
883 )
884 }
885}
886
887#[must_use = "FIDL methods require a response to be sent"]
888#[derive(Debug)]
889pub struct BaseRouteTableRemoveResponder {
890 control_handle: std::mem::ManuallyDrop<BaseRouteTableControlHandle>,
891 tx_id: u32,
892}
893
894impl std::ops::Drop for BaseRouteTableRemoveResponder {
898 fn drop(&mut self) {
899 self.control_handle.shutdown();
900 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
902 }
903}
904
905impl fidl::endpoints::Responder for BaseRouteTableRemoveResponder {
906 type ControlHandle = BaseRouteTableControlHandle;
907
908 fn control_handle(&self) -> &BaseRouteTableControlHandle {
909 &self.control_handle
910 }
911
912 fn drop_without_shutdown(mut self) {
913 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
915 std::mem::forget(self);
917 }
918}
919
920impl BaseRouteTableRemoveResponder {
921 pub fn send(
925 self,
926 mut result: Result<(), BaseRouteTableRemoveError>,
927 ) -> Result<(), fidl::Error> {
928 let _result = self.send_raw(result);
929 if _result.is_err() {
930 self.control_handle.shutdown();
931 }
932 self.drop_without_shutdown();
933 _result
934 }
935
936 pub fn send_no_shutdown_on_err(
938 self,
939 mut result: Result<(), BaseRouteTableRemoveError>,
940 ) -> Result<(), fidl::Error> {
941 let _result = self.send_raw(result);
942 self.drop_without_shutdown();
943 _result
944 }
945
946 fn send_raw(
947 &self,
948 mut result: Result<(), BaseRouteTableRemoveError>,
949 ) -> Result<(), fidl::Error> {
950 self.control_handle.inner.send::<fidl::encoding::ResultType<
951 fidl::encoding::EmptyStruct,
952 BaseRouteTableRemoveError,
953 >>(
954 result,
955 self.tx_id,
956 0xc42e58a5fc79426,
957 fidl::encoding::DynamicFlags::empty(),
958 )
959 }
960}
961
962#[must_use = "FIDL methods require a response to be sent"]
963#[derive(Debug)]
964pub struct BaseRouteTableGetAuthorizationForRouteTableResponder {
965 control_handle: std::mem::ManuallyDrop<BaseRouteTableControlHandle>,
966 tx_id: u32,
967}
968
969impl std::ops::Drop for BaseRouteTableGetAuthorizationForRouteTableResponder {
973 fn drop(&mut self) {
974 self.control_handle.shutdown();
975 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
977 }
978}
979
980impl fidl::endpoints::Responder for BaseRouteTableGetAuthorizationForRouteTableResponder {
981 type ControlHandle = BaseRouteTableControlHandle;
982
983 fn control_handle(&self) -> &BaseRouteTableControlHandle {
984 &self.control_handle
985 }
986
987 fn drop_without_shutdown(mut self) {
988 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
990 std::mem::forget(self);
992 }
993}
994
995impl BaseRouteTableGetAuthorizationForRouteTableResponder {
996 pub fn send(self, mut credential: GrantForRouteTableAuthorization) -> Result<(), fidl::Error> {
1000 let _result = self.send_raw(credential);
1001 if _result.is_err() {
1002 self.control_handle.shutdown();
1003 }
1004 self.drop_without_shutdown();
1005 _result
1006 }
1007
1008 pub fn send_no_shutdown_on_err(
1010 self,
1011 mut credential: GrantForRouteTableAuthorization,
1012 ) -> Result<(), fidl::Error> {
1013 let _result = self.send_raw(credential);
1014 self.drop_without_shutdown();
1015 _result
1016 }
1017
1018 fn send_raw(&self, mut credential: GrantForRouteTableAuthorization) -> Result<(), fidl::Error> {
1019 self.control_handle.inner.send::<BaseRouteTableGetAuthorizationForRouteTableResponse>(
1020 (&mut credential,),
1021 self.tx_id,
1022 0x56a48c921ff3b6eb,
1023 fidl::encoding::DynamicFlags::empty(),
1024 )
1025 }
1026}
1027
1028#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1029pub struct BaseRuleSetMarker;
1030
1031impl fidl::endpoints::ProtocolMarker for BaseRuleSetMarker {
1032 type Proxy = BaseRuleSetProxy;
1033 type RequestStream = BaseRuleSetRequestStream;
1034 #[cfg(target_os = "fuchsia")]
1035 type SynchronousProxy = BaseRuleSetSynchronousProxy;
1036
1037 const DEBUG_NAME: &'static str = "(anonymous) BaseRuleSet";
1038}
1039pub type BaseRuleSetAuthenticateForRouteTableResult = Result<(), AuthenticateForRouteTableError>;
1040pub type BaseRuleSetRemoveRuleResult = Result<(), RuleSetError>;
1041
1042pub trait BaseRuleSetProxyInterface: Send + Sync {
1043 type AuthenticateForRouteTableResponseFut: std::future::Future<
1044 Output = Result<BaseRuleSetAuthenticateForRouteTableResult, fidl::Error>,
1045 > + Send;
1046 fn r#authenticate_for_route_table(
1047 &self,
1048 table: u32,
1049 token: fidl::Event,
1050 ) -> Self::AuthenticateForRouteTableResponseFut;
1051 type RemoveRuleResponseFut: std::future::Future<Output = Result<BaseRuleSetRemoveRuleResult, fidl::Error>>
1052 + Send;
1053 fn r#remove_rule(&self, index: u32) -> Self::RemoveRuleResponseFut;
1054 fn r#close(&self) -> Result<(), fidl::Error>;
1055}
1056#[derive(Debug)]
1057#[cfg(target_os = "fuchsia")]
1058pub struct BaseRuleSetSynchronousProxy {
1059 client: fidl::client::sync::Client,
1060}
1061
1062#[cfg(target_os = "fuchsia")]
1063impl fidl::endpoints::SynchronousProxy for BaseRuleSetSynchronousProxy {
1064 type Proxy = BaseRuleSetProxy;
1065 type Protocol = BaseRuleSetMarker;
1066
1067 fn from_channel(inner: fidl::Channel) -> Self {
1068 Self::new(inner)
1069 }
1070
1071 fn into_channel(self) -> fidl::Channel {
1072 self.client.into_channel()
1073 }
1074
1075 fn as_channel(&self) -> &fidl::Channel {
1076 self.client.as_channel()
1077 }
1078}
1079
1080#[cfg(target_os = "fuchsia")]
1081impl BaseRuleSetSynchronousProxy {
1082 pub fn new(channel: fidl::Channel) -> Self {
1083 let protocol_name = <BaseRuleSetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1084 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1085 }
1086
1087 pub fn into_channel(self) -> fidl::Channel {
1088 self.client.into_channel()
1089 }
1090
1091 pub fn wait_for_event(
1094 &self,
1095 deadline: zx::MonotonicInstant,
1096 ) -> Result<BaseRuleSetEvent, fidl::Error> {
1097 BaseRuleSetEvent::decode(self.client.wait_for_event(deadline)?)
1098 }
1099
1100 pub fn r#authenticate_for_route_table(
1102 &self,
1103 mut table: u32,
1104 mut token: fidl::Event,
1105 ___deadline: zx::MonotonicInstant,
1106 ) -> Result<BaseRuleSetAuthenticateForRouteTableResult, fidl::Error> {
1107 let _response =
1108 self.client.send_query::<ProofOfRouteTableAuthorization, fidl::encoding::ResultType<
1109 fidl::encoding::EmptyStruct,
1110 AuthenticateForRouteTableError,
1111 >>(
1112 (table, token),
1113 0x6fd845360ed9bc8f,
1114 fidl::encoding::DynamicFlags::empty(),
1115 ___deadline,
1116 )?;
1117 Ok(_response.map(|x| x))
1118 }
1119
1120 pub fn r#remove_rule(
1127 &self,
1128 mut index: u32,
1129 ___deadline: zx::MonotonicInstant,
1130 ) -> Result<BaseRuleSetRemoveRuleResult, fidl::Error> {
1131 let _response = self.client.send_query::<
1132 BaseRuleSetRemoveRuleRequest,
1133 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
1134 >(
1135 (index,),
1136 0x2ae3d7e817cbff90,
1137 fidl::encoding::DynamicFlags::empty(),
1138 ___deadline,
1139 )?;
1140 Ok(_response.map(|x| x))
1141 }
1142
1143 pub fn r#close(&self) -> Result<(), fidl::Error> {
1148 self.client.send::<fidl::encoding::EmptyPayload>(
1149 (),
1150 0x457e1753672d4073,
1151 fidl::encoding::DynamicFlags::empty(),
1152 )
1153 }
1154}
1155
1156#[cfg(target_os = "fuchsia")]
1157impl From<BaseRuleSetSynchronousProxy> for zx::Handle {
1158 fn from(value: BaseRuleSetSynchronousProxy) -> Self {
1159 value.into_channel().into()
1160 }
1161}
1162
1163#[cfg(target_os = "fuchsia")]
1164impl From<fidl::Channel> for BaseRuleSetSynchronousProxy {
1165 fn from(value: fidl::Channel) -> Self {
1166 Self::new(value)
1167 }
1168}
1169
1170#[derive(Debug, Clone)]
1171pub struct BaseRuleSetProxy {
1172 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1173}
1174
1175impl fidl::endpoints::Proxy for BaseRuleSetProxy {
1176 type Protocol = BaseRuleSetMarker;
1177
1178 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1179 Self::new(inner)
1180 }
1181
1182 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1183 self.client.into_channel().map_err(|client| Self { client })
1184 }
1185
1186 fn as_channel(&self) -> &::fidl::AsyncChannel {
1187 self.client.as_channel()
1188 }
1189}
1190
1191impl BaseRuleSetProxy {
1192 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1194 let protocol_name = <BaseRuleSetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1195 Self { client: fidl::client::Client::new(channel, protocol_name) }
1196 }
1197
1198 pub fn take_event_stream(&self) -> BaseRuleSetEventStream {
1204 BaseRuleSetEventStream { event_receiver: self.client.take_event_receiver() }
1205 }
1206
1207 pub fn r#authenticate_for_route_table(
1209 &self,
1210 mut table: u32,
1211 mut token: fidl::Event,
1212 ) -> fidl::client::QueryResponseFut<
1213 BaseRuleSetAuthenticateForRouteTableResult,
1214 fidl::encoding::DefaultFuchsiaResourceDialect,
1215 > {
1216 BaseRuleSetProxyInterface::r#authenticate_for_route_table(self, table, token)
1217 }
1218
1219 pub fn r#remove_rule(
1226 &self,
1227 mut index: u32,
1228 ) -> fidl::client::QueryResponseFut<
1229 BaseRuleSetRemoveRuleResult,
1230 fidl::encoding::DefaultFuchsiaResourceDialect,
1231 > {
1232 BaseRuleSetProxyInterface::r#remove_rule(self, index)
1233 }
1234
1235 pub fn r#close(&self) -> Result<(), fidl::Error> {
1240 BaseRuleSetProxyInterface::r#close(self)
1241 }
1242}
1243
1244impl BaseRuleSetProxyInterface for BaseRuleSetProxy {
1245 type AuthenticateForRouteTableResponseFut = fidl::client::QueryResponseFut<
1246 BaseRuleSetAuthenticateForRouteTableResult,
1247 fidl::encoding::DefaultFuchsiaResourceDialect,
1248 >;
1249 fn r#authenticate_for_route_table(
1250 &self,
1251 mut table: u32,
1252 mut token: fidl::Event,
1253 ) -> Self::AuthenticateForRouteTableResponseFut {
1254 fn _decode(
1255 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1256 ) -> Result<BaseRuleSetAuthenticateForRouteTableResult, fidl::Error> {
1257 let _response = fidl::client::decode_transaction_body::<
1258 fidl::encoding::ResultType<
1259 fidl::encoding::EmptyStruct,
1260 AuthenticateForRouteTableError,
1261 >,
1262 fidl::encoding::DefaultFuchsiaResourceDialect,
1263 0x6fd845360ed9bc8f,
1264 >(_buf?)?;
1265 Ok(_response.map(|x| x))
1266 }
1267 self.client.send_query_and_decode::<
1268 ProofOfRouteTableAuthorization,
1269 BaseRuleSetAuthenticateForRouteTableResult,
1270 >(
1271 (table, token,),
1272 0x6fd845360ed9bc8f,
1273 fidl::encoding::DynamicFlags::empty(),
1274 _decode,
1275 )
1276 }
1277
1278 type RemoveRuleResponseFut = fidl::client::QueryResponseFut<
1279 BaseRuleSetRemoveRuleResult,
1280 fidl::encoding::DefaultFuchsiaResourceDialect,
1281 >;
1282 fn r#remove_rule(&self, mut index: u32) -> Self::RemoveRuleResponseFut {
1283 fn _decode(
1284 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1285 ) -> Result<BaseRuleSetRemoveRuleResult, fidl::Error> {
1286 let _response = fidl::client::decode_transaction_body::<
1287 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
1288 fidl::encoding::DefaultFuchsiaResourceDialect,
1289 0x2ae3d7e817cbff90,
1290 >(_buf?)?;
1291 Ok(_response.map(|x| x))
1292 }
1293 self.client
1294 .send_query_and_decode::<BaseRuleSetRemoveRuleRequest, BaseRuleSetRemoveRuleResult>(
1295 (index,),
1296 0x2ae3d7e817cbff90,
1297 fidl::encoding::DynamicFlags::empty(),
1298 _decode,
1299 )
1300 }
1301
1302 fn r#close(&self) -> Result<(), fidl::Error> {
1303 self.client.send::<fidl::encoding::EmptyPayload>(
1304 (),
1305 0x457e1753672d4073,
1306 fidl::encoding::DynamicFlags::empty(),
1307 )
1308 }
1309}
1310
1311pub struct BaseRuleSetEventStream {
1312 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1313}
1314
1315impl std::marker::Unpin for BaseRuleSetEventStream {}
1316
1317impl futures::stream::FusedStream for BaseRuleSetEventStream {
1318 fn is_terminated(&self) -> bool {
1319 self.event_receiver.is_terminated()
1320 }
1321}
1322
1323impl futures::Stream for BaseRuleSetEventStream {
1324 type Item = Result<BaseRuleSetEvent, fidl::Error>;
1325
1326 fn poll_next(
1327 mut self: std::pin::Pin<&mut Self>,
1328 cx: &mut std::task::Context<'_>,
1329 ) -> std::task::Poll<Option<Self::Item>> {
1330 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1331 &mut self.event_receiver,
1332 cx
1333 )?) {
1334 Some(buf) => std::task::Poll::Ready(Some(BaseRuleSetEvent::decode(buf))),
1335 None => std::task::Poll::Ready(None),
1336 }
1337 }
1338}
1339
1340#[derive(Debug)]
1341pub enum BaseRuleSetEvent {}
1342
1343impl BaseRuleSetEvent {
1344 fn decode(
1346 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1347 ) -> Result<BaseRuleSetEvent, fidl::Error> {
1348 let (bytes, _handles) = buf.split_mut();
1349 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1350 debug_assert_eq!(tx_header.tx_id, 0);
1351 match tx_header.ordinal {
1352 _ => Err(fidl::Error::UnknownOrdinal {
1353 ordinal: tx_header.ordinal,
1354 protocol_name: <BaseRuleSetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1355 }),
1356 }
1357 }
1358}
1359
1360pub struct BaseRuleSetRequestStream {
1362 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1363 is_terminated: bool,
1364}
1365
1366impl std::marker::Unpin for BaseRuleSetRequestStream {}
1367
1368impl futures::stream::FusedStream for BaseRuleSetRequestStream {
1369 fn is_terminated(&self) -> bool {
1370 self.is_terminated
1371 }
1372}
1373
1374impl fidl::endpoints::RequestStream for BaseRuleSetRequestStream {
1375 type Protocol = BaseRuleSetMarker;
1376 type ControlHandle = BaseRuleSetControlHandle;
1377
1378 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1379 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1380 }
1381
1382 fn control_handle(&self) -> Self::ControlHandle {
1383 BaseRuleSetControlHandle { inner: self.inner.clone() }
1384 }
1385
1386 fn into_inner(
1387 self,
1388 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1389 {
1390 (self.inner, self.is_terminated)
1391 }
1392
1393 fn from_inner(
1394 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1395 is_terminated: bool,
1396 ) -> Self {
1397 Self { inner, is_terminated }
1398 }
1399}
1400
1401impl futures::Stream for BaseRuleSetRequestStream {
1402 type Item = Result<BaseRuleSetRequest, fidl::Error>;
1403
1404 fn poll_next(
1405 mut self: std::pin::Pin<&mut Self>,
1406 cx: &mut std::task::Context<'_>,
1407 ) -> std::task::Poll<Option<Self::Item>> {
1408 let this = &mut *self;
1409 if this.inner.check_shutdown(cx) {
1410 this.is_terminated = true;
1411 return std::task::Poll::Ready(None);
1412 }
1413 if this.is_terminated {
1414 panic!("polled BaseRuleSetRequestStream after completion");
1415 }
1416 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1417 |bytes, handles| {
1418 match this.inner.channel().read_etc(cx, bytes, handles) {
1419 std::task::Poll::Ready(Ok(())) => {}
1420 std::task::Poll::Pending => return std::task::Poll::Pending,
1421 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1422 this.is_terminated = true;
1423 return std::task::Poll::Ready(None);
1424 }
1425 std::task::Poll::Ready(Err(e)) => {
1426 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1427 e.into(),
1428 ))))
1429 }
1430 }
1431
1432 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1434
1435 std::task::Poll::Ready(Some(match header.ordinal {
1436 0x6fd845360ed9bc8f => {
1437 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1438 let mut req = fidl::new_empty!(
1439 ProofOfRouteTableAuthorization,
1440 fidl::encoding::DefaultFuchsiaResourceDialect
1441 );
1442 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProofOfRouteTableAuthorization>(&header, _body_bytes, handles, &mut req)?;
1443 let control_handle = BaseRuleSetControlHandle { inner: this.inner.clone() };
1444 Ok(BaseRuleSetRequest::AuthenticateForRouteTable {
1445 table: req.table,
1446 token: req.token,
1447
1448 responder: BaseRuleSetAuthenticateForRouteTableResponder {
1449 control_handle: std::mem::ManuallyDrop::new(control_handle),
1450 tx_id: header.tx_id,
1451 },
1452 })
1453 }
1454 0x2ae3d7e817cbff90 => {
1455 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1456 let mut req = fidl::new_empty!(
1457 BaseRuleSetRemoveRuleRequest,
1458 fidl::encoding::DefaultFuchsiaResourceDialect
1459 );
1460 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BaseRuleSetRemoveRuleRequest>(&header, _body_bytes, handles, &mut req)?;
1461 let control_handle = BaseRuleSetControlHandle { inner: this.inner.clone() };
1462 Ok(BaseRuleSetRequest::RemoveRule {
1463 index: req.index,
1464
1465 responder: BaseRuleSetRemoveRuleResponder {
1466 control_handle: std::mem::ManuallyDrop::new(control_handle),
1467 tx_id: header.tx_id,
1468 },
1469 })
1470 }
1471 0x457e1753672d4073 => {
1472 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1473 let mut req = fidl::new_empty!(
1474 fidl::encoding::EmptyPayload,
1475 fidl::encoding::DefaultFuchsiaResourceDialect
1476 );
1477 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1478 let control_handle = BaseRuleSetControlHandle { inner: this.inner.clone() };
1479 Ok(BaseRuleSetRequest::Close { control_handle })
1480 }
1481 _ => Err(fidl::Error::UnknownOrdinal {
1482 ordinal: header.ordinal,
1483 protocol_name:
1484 <BaseRuleSetMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1485 }),
1486 }))
1487 },
1488 )
1489 }
1490}
1491
1492#[derive(Debug)]
1495pub enum BaseRuleSetRequest {
1496 AuthenticateForRouteTable {
1498 table: u32,
1499 token: fidl::Event,
1500 responder: BaseRuleSetAuthenticateForRouteTableResponder,
1501 },
1502 RemoveRule { index: u32, responder: BaseRuleSetRemoveRuleResponder },
1509 Close { control_handle: BaseRuleSetControlHandle },
1514}
1515
1516impl BaseRuleSetRequest {
1517 #[allow(irrefutable_let_patterns)]
1518 pub fn into_authenticate_for_route_table(
1519 self,
1520 ) -> Option<(u32, fidl::Event, BaseRuleSetAuthenticateForRouteTableResponder)> {
1521 if let BaseRuleSetRequest::AuthenticateForRouteTable { table, token, responder } = self {
1522 Some((table, token, responder))
1523 } else {
1524 None
1525 }
1526 }
1527
1528 #[allow(irrefutable_let_patterns)]
1529 pub fn into_remove_rule(self) -> Option<(u32, BaseRuleSetRemoveRuleResponder)> {
1530 if let BaseRuleSetRequest::RemoveRule { index, responder } = self {
1531 Some((index, responder))
1532 } else {
1533 None
1534 }
1535 }
1536
1537 #[allow(irrefutable_let_patterns)]
1538 pub fn into_close(self) -> Option<(BaseRuleSetControlHandle)> {
1539 if let BaseRuleSetRequest::Close { control_handle } = self {
1540 Some((control_handle))
1541 } else {
1542 None
1543 }
1544 }
1545
1546 pub fn method_name(&self) -> &'static str {
1548 match *self {
1549 BaseRuleSetRequest::AuthenticateForRouteTable { .. } => "authenticate_for_route_table",
1550 BaseRuleSetRequest::RemoveRule { .. } => "remove_rule",
1551 BaseRuleSetRequest::Close { .. } => "close",
1552 }
1553 }
1554}
1555
1556#[derive(Debug, Clone)]
1557pub struct BaseRuleSetControlHandle {
1558 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1559}
1560
1561impl fidl::endpoints::ControlHandle for BaseRuleSetControlHandle {
1562 fn shutdown(&self) {
1563 self.inner.shutdown()
1564 }
1565 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1566 self.inner.shutdown_with_epitaph(status)
1567 }
1568
1569 fn is_closed(&self) -> bool {
1570 self.inner.channel().is_closed()
1571 }
1572 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1573 self.inner.channel().on_closed()
1574 }
1575
1576 #[cfg(target_os = "fuchsia")]
1577 fn signal_peer(
1578 &self,
1579 clear_mask: zx::Signals,
1580 set_mask: zx::Signals,
1581 ) -> Result<(), zx_status::Status> {
1582 use fidl::Peered;
1583 self.inner.channel().signal_peer(clear_mask, set_mask)
1584 }
1585}
1586
1587impl BaseRuleSetControlHandle {}
1588
1589#[must_use = "FIDL methods require a response to be sent"]
1590#[derive(Debug)]
1591pub struct BaseRuleSetAuthenticateForRouteTableResponder {
1592 control_handle: std::mem::ManuallyDrop<BaseRuleSetControlHandle>,
1593 tx_id: u32,
1594}
1595
1596impl std::ops::Drop for BaseRuleSetAuthenticateForRouteTableResponder {
1600 fn drop(&mut self) {
1601 self.control_handle.shutdown();
1602 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1604 }
1605}
1606
1607impl fidl::endpoints::Responder for BaseRuleSetAuthenticateForRouteTableResponder {
1608 type ControlHandle = BaseRuleSetControlHandle;
1609
1610 fn control_handle(&self) -> &BaseRuleSetControlHandle {
1611 &self.control_handle
1612 }
1613
1614 fn drop_without_shutdown(mut self) {
1615 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1617 std::mem::forget(self);
1619 }
1620}
1621
1622impl BaseRuleSetAuthenticateForRouteTableResponder {
1623 pub fn send(
1627 self,
1628 mut result: Result<(), AuthenticateForRouteTableError>,
1629 ) -> Result<(), fidl::Error> {
1630 let _result = self.send_raw(result);
1631 if _result.is_err() {
1632 self.control_handle.shutdown();
1633 }
1634 self.drop_without_shutdown();
1635 _result
1636 }
1637
1638 pub fn send_no_shutdown_on_err(
1640 self,
1641 mut result: Result<(), AuthenticateForRouteTableError>,
1642 ) -> Result<(), fidl::Error> {
1643 let _result = self.send_raw(result);
1644 self.drop_without_shutdown();
1645 _result
1646 }
1647
1648 fn send_raw(
1649 &self,
1650 mut result: Result<(), AuthenticateForRouteTableError>,
1651 ) -> Result<(), fidl::Error> {
1652 self.control_handle.inner.send::<fidl::encoding::ResultType<
1653 fidl::encoding::EmptyStruct,
1654 AuthenticateForRouteTableError,
1655 >>(
1656 result,
1657 self.tx_id,
1658 0x6fd845360ed9bc8f,
1659 fidl::encoding::DynamicFlags::empty(),
1660 )
1661 }
1662}
1663
1664#[must_use = "FIDL methods require a response to be sent"]
1665#[derive(Debug)]
1666pub struct BaseRuleSetRemoveRuleResponder {
1667 control_handle: std::mem::ManuallyDrop<BaseRuleSetControlHandle>,
1668 tx_id: u32,
1669}
1670
1671impl std::ops::Drop for BaseRuleSetRemoveRuleResponder {
1675 fn drop(&mut self) {
1676 self.control_handle.shutdown();
1677 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1679 }
1680}
1681
1682impl fidl::endpoints::Responder for BaseRuleSetRemoveRuleResponder {
1683 type ControlHandle = BaseRuleSetControlHandle;
1684
1685 fn control_handle(&self) -> &BaseRuleSetControlHandle {
1686 &self.control_handle
1687 }
1688
1689 fn drop_without_shutdown(mut self) {
1690 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1692 std::mem::forget(self);
1694 }
1695}
1696
1697impl BaseRuleSetRemoveRuleResponder {
1698 pub fn send(self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
1702 let _result = self.send_raw(result);
1703 if _result.is_err() {
1704 self.control_handle.shutdown();
1705 }
1706 self.drop_without_shutdown();
1707 _result
1708 }
1709
1710 pub fn send_no_shutdown_on_err(
1712 self,
1713 mut result: Result<(), RuleSetError>,
1714 ) -> Result<(), fidl::Error> {
1715 let _result = self.send_raw(result);
1716 self.drop_without_shutdown();
1717 _result
1718 }
1719
1720 fn send_raw(&self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
1721 self.control_handle.inner.send::<fidl::encoding::ResultType<
1722 fidl::encoding::EmptyStruct,
1723 RuleSetError,
1724 >>(
1725 result,
1726 self.tx_id,
1727 0x2ae3d7e817cbff90,
1728 fidl::encoding::DynamicFlags::empty(),
1729 )
1730 }
1731}
1732
1733#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1734pub struct RouteSetV4Marker;
1735
1736impl fidl::endpoints::ProtocolMarker for RouteSetV4Marker {
1737 type Proxy = RouteSetV4Proxy;
1738 type RequestStream = RouteSetV4RequestStream;
1739 #[cfg(target_os = "fuchsia")]
1740 type SynchronousProxy = RouteSetV4SynchronousProxy;
1741
1742 const DEBUG_NAME: &'static str = "(anonymous) RouteSetV4";
1743}
1744pub type RouteSetV4AuthenticateForInterfaceResult = Result<(), AuthenticateForInterfaceError>;
1745pub type RouteSetV4AddRouteResult = Result<bool, RouteSetError>;
1746pub type RouteSetV4RemoveRouteResult = Result<bool, RouteSetError>;
1747
1748pub trait RouteSetV4ProxyInterface: Send + Sync {
1749 type AuthenticateForInterfaceResponseFut: std::future::Future<Output = Result<RouteSetV4AuthenticateForInterfaceResult, fidl::Error>>
1750 + Send;
1751 fn r#authenticate_for_interface(
1752 &self,
1753 credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
1754 ) -> Self::AuthenticateForInterfaceResponseFut;
1755 type AddRouteResponseFut: std::future::Future<Output = Result<RouteSetV4AddRouteResult, fidl::Error>>
1756 + Send;
1757 fn r#add_route(&self, route: &fidl_fuchsia_net_routes::RouteV4) -> Self::AddRouteResponseFut;
1758 type RemoveRouteResponseFut: std::future::Future<Output = Result<RouteSetV4RemoveRouteResult, fidl::Error>>
1759 + Send;
1760 fn r#remove_route(
1761 &self,
1762 route: &fidl_fuchsia_net_routes::RouteV4,
1763 ) -> Self::RemoveRouteResponseFut;
1764}
1765#[derive(Debug)]
1766#[cfg(target_os = "fuchsia")]
1767pub struct RouteSetV4SynchronousProxy {
1768 client: fidl::client::sync::Client,
1769}
1770
1771#[cfg(target_os = "fuchsia")]
1772impl fidl::endpoints::SynchronousProxy for RouteSetV4SynchronousProxy {
1773 type Proxy = RouteSetV4Proxy;
1774 type Protocol = RouteSetV4Marker;
1775
1776 fn from_channel(inner: fidl::Channel) -> Self {
1777 Self::new(inner)
1778 }
1779
1780 fn into_channel(self) -> fidl::Channel {
1781 self.client.into_channel()
1782 }
1783
1784 fn as_channel(&self) -> &fidl::Channel {
1785 self.client.as_channel()
1786 }
1787}
1788
1789#[cfg(target_os = "fuchsia")]
1790impl RouteSetV4SynchronousProxy {
1791 pub fn new(channel: fidl::Channel) -> Self {
1792 let protocol_name = <RouteSetV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1793 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1794 }
1795
1796 pub fn into_channel(self) -> fidl::Channel {
1797 self.client.into_channel()
1798 }
1799
1800 pub fn wait_for_event(
1803 &self,
1804 deadline: zx::MonotonicInstant,
1805 ) -> Result<RouteSetV4Event, fidl::Error> {
1806 RouteSetV4Event::decode(self.client.wait_for_event(deadline)?)
1807 }
1808
1809 pub fn r#authenticate_for_interface(
1814 &self,
1815 mut credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
1816 ___deadline: zx::MonotonicInstant,
1817 ) -> Result<RouteSetV4AuthenticateForInterfaceResult, fidl::Error> {
1818 let _response = self
1819 .client
1820 .send_query::<RouteSetV4AuthenticateForInterfaceRequest, fidl::encoding::ResultType<
1821 fidl::encoding::EmptyStruct,
1822 AuthenticateForInterfaceError,
1823 >>(
1824 (&mut credential,),
1825 0x74841ceef127518e,
1826 fidl::encoding::DynamicFlags::empty(),
1827 ___deadline,
1828 )?;
1829 Ok(_response.map(|x| x))
1830 }
1831
1832 pub fn r#add_route(
1838 &self,
1839 mut route: &fidl_fuchsia_net_routes::RouteV4,
1840 ___deadline: zx::MonotonicInstant,
1841 ) -> Result<RouteSetV4AddRouteResult, fidl::Error> {
1842 let _response = self.client.send_query::<
1843 RouteSetV4AddRouteRequest,
1844 fidl::encoding::ResultType<RouteSetV4AddRouteResponse, RouteSetError>,
1845 >(
1846 (route,),
1847 0x4bd69e45539e8ec0,
1848 fidl::encoding::DynamicFlags::empty(),
1849 ___deadline,
1850 )?;
1851 Ok(_response.map(|x| x.did_add))
1852 }
1853
1854 pub fn r#remove_route(
1863 &self,
1864 mut route: &fidl_fuchsia_net_routes::RouteV4,
1865 ___deadline: zx::MonotonicInstant,
1866 ) -> Result<RouteSetV4RemoveRouteResult, fidl::Error> {
1867 let _response = self.client.send_query::<
1868 RouteSetV4RemoveRouteRequest,
1869 fidl::encoding::ResultType<RouteSetV4RemoveRouteResponse, RouteSetError>,
1870 >(
1871 (route,),
1872 0x514f6880232f1665,
1873 fidl::encoding::DynamicFlags::empty(),
1874 ___deadline,
1875 )?;
1876 Ok(_response.map(|x| x.did_remove))
1877 }
1878}
1879
1880#[cfg(target_os = "fuchsia")]
1881impl From<RouteSetV4SynchronousProxy> for zx::Handle {
1882 fn from(value: RouteSetV4SynchronousProxy) -> Self {
1883 value.into_channel().into()
1884 }
1885}
1886
1887#[cfg(target_os = "fuchsia")]
1888impl From<fidl::Channel> for RouteSetV4SynchronousProxy {
1889 fn from(value: fidl::Channel) -> Self {
1890 Self::new(value)
1891 }
1892}
1893
1894#[derive(Debug, Clone)]
1895pub struct RouteSetV4Proxy {
1896 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1897}
1898
1899impl fidl::endpoints::Proxy for RouteSetV4Proxy {
1900 type Protocol = RouteSetV4Marker;
1901
1902 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1903 Self::new(inner)
1904 }
1905
1906 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1907 self.client.into_channel().map_err(|client| Self { client })
1908 }
1909
1910 fn as_channel(&self) -> &::fidl::AsyncChannel {
1911 self.client.as_channel()
1912 }
1913}
1914
1915impl RouteSetV4Proxy {
1916 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1918 let protocol_name = <RouteSetV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1919 Self { client: fidl::client::Client::new(channel, protocol_name) }
1920 }
1921
1922 pub fn take_event_stream(&self) -> RouteSetV4EventStream {
1928 RouteSetV4EventStream { event_receiver: self.client.take_event_receiver() }
1929 }
1930
1931 pub fn r#authenticate_for_interface(
1936 &self,
1937 mut credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
1938 ) -> fidl::client::QueryResponseFut<
1939 RouteSetV4AuthenticateForInterfaceResult,
1940 fidl::encoding::DefaultFuchsiaResourceDialect,
1941 > {
1942 RouteSetV4ProxyInterface::r#authenticate_for_interface(self, credential)
1943 }
1944
1945 pub fn r#add_route(
1951 &self,
1952 mut route: &fidl_fuchsia_net_routes::RouteV4,
1953 ) -> fidl::client::QueryResponseFut<
1954 RouteSetV4AddRouteResult,
1955 fidl::encoding::DefaultFuchsiaResourceDialect,
1956 > {
1957 RouteSetV4ProxyInterface::r#add_route(self, route)
1958 }
1959
1960 pub fn r#remove_route(
1969 &self,
1970 mut route: &fidl_fuchsia_net_routes::RouteV4,
1971 ) -> fidl::client::QueryResponseFut<
1972 RouteSetV4RemoveRouteResult,
1973 fidl::encoding::DefaultFuchsiaResourceDialect,
1974 > {
1975 RouteSetV4ProxyInterface::r#remove_route(self, route)
1976 }
1977}
1978
1979impl RouteSetV4ProxyInterface for RouteSetV4Proxy {
1980 type AuthenticateForInterfaceResponseFut = fidl::client::QueryResponseFut<
1981 RouteSetV4AuthenticateForInterfaceResult,
1982 fidl::encoding::DefaultFuchsiaResourceDialect,
1983 >;
1984 fn r#authenticate_for_interface(
1985 &self,
1986 mut credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
1987 ) -> Self::AuthenticateForInterfaceResponseFut {
1988 fn _decode(
1989 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1990 ) -> Result<RouteSetV4AuthenticateForInterfaceResult, fidl::Error> {
1991 let _response = fidl::client::decode_transaction_body::<
1992 fidl::encoding::ResultType<
1993 fidl::encoding::EmptyStruct,
1994 AuthenticateForInterfaceError,
1995 >,
1996 fidl::encoding::DefaultFuchsiaResourceDialect,
1997 0x74841ceef127518e,
1998 >(_buf?)?;
1999 Ok(_response.map(|x| x))
2000 }
2001 self.client.send_query_and_decode::<
2002 RouteSetV4AuthenticateForInterfaceRequest,
2003 RouteSetV4AuthenticateForInterfaceResult,
2004 >(
2005 (&mut credential,),
2006 0x74841ceef127518e,
2007 fidl::encoding::DynamicFlags::empty(),
2008 _decode,
2009 )
2010 }
2011
2012 type AddRouteResponseFut = fidl::client::QueryResponseFut<
2013 RouteSetV4AddRouteResult,
2014 fidl::encoding::DefaultFuchsiaResourceDialect,
2015 >;
2016 fn r#add_route(
2017 &self,
2018 mut route: &fidl_fuchsia_net_routes::RouteV4,
2019 ) -> Self::AddRouteResponseFut {
2020 fn _decode(
2021 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2022 ) -> Result<RouteSetV4AddRouteResult, fidl::Error> {
2023 let _response = fidl::client::decode_transaction_body::<
2024 fidl::encoding::ResultType<RouteSetV4AddRouteResponse, RouteSetError>,
2025 fidl::encoding::DefaultFuchsiaResourceDialect,
2026 0x4bd69e45539e8ec0,
2027 >(_buf?)?;
2028 Ok(_response.map(|x| x.did_add))
2029 }
2030 self.client.send_query_and_decode::<RouteSetV4AddRouteRequest, RouteSetV4AddRouteResult>(
2031 (route,),
2032 0x4bd69e45539e8ec0,
2033 fidl::encoding::DynamicFlags::empty(),
2034 _decode,
2035 )
2036 }
2037
2038 type RemoveRouteResponseFut = fidl::client::QueryResponseFut<
2039 RouteSetV4RemoveRouteResult,
2040 fidl::encoding::DefaultFuchsiaResourceDialect,
2041 >;
2042 fn r#remove_route(
2043 &self,
2044 mut route: &fidl_fuchsia_net_routes::RouteV4,
2045 ) -> Self::RemoveRouteResponseFut {
2046 fn _decode(
2047 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2048 ) -> Result<RouteSetV4RemoveRouteResult, fidl::Error> {
2049 let _response = fidl::client::decode_transaction_body::<
2050 fidl::encoding::ResultType<RouteSetV4RemoveRouteResponse, RouteSetError>,
2051 fidl::encoding::DefaultFuchsiaResourceDialect,
2052 0x514f6880232f1665,
2053 >(_buf?)?;
2054 Ok(_response.map(|x| x.did_remove))
2055 }
2056 self.client
2057 .send_query_and_decode::<RouteSetV4RemoveRouteRequest, RouteSetV4RemoveRouteResult>(
2058 (route,),
2059 0x514f6880232f1665,
2060 fidl::encoding::DynamicFlags::empty(),
2061 _decode,
2062 )
2063 }
2064}
2065
2066pub struct RouteSetV4EventStream {
2067 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2068}
2069
2070impl std::marker::Unpin for RouteSetV4EventStream {}
2071
2072impl futures::stream::FusedStream for RouteSetV4EventStream {
2073 fn is_terminated(&self) -> bool {
2074 self.event_receiver.is_terminated()
2075 }
2076}
2077
2078impl futures::Stream for RouteSetV4EventStream {
2079 type Item = Result<RouteSetV4Event, fidl::Error>;
2080
2081 fn poll_next(
2082 mut self: std::pin::Pin<&mut Self>,
2083 cx: &mut std::task::Context<'_>,
2084 ) -> std::task::Poll<Option<Self::Item>> {
2085 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2086 &mut self.event_receiver,
2087 cx
2088 )?) {
2089 Some(buf) => std::task::Poll::Ready(Some(RouteSetV4Event::decode(buf))),
2090 None => std::task::Poll::Ready(None),
2091 }
2092 }
2093}
2094
2095#[derive(Debug)]
2096pub enum RouteSetV4Event {}
2097
2098impl RouteSetV4Event {
2099 fn decode(
2101 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2102 ) -> Result<RouteSetV4Event, fidl::Error> {
2103 let (bytes, _handles) = buf.split_mut();
2104 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2105 debug_assert_eq!(tx_header.tx_id, 0);
2106 match tx_header.ordinal {
2107 _ => Err(fidl::Error::UnknownOrdinal {
2108 ordinal: tx_header.ordinal,
2109 protocol_name: <RouteSetV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2110 }),
2111 }
2112 }
2113}
2114
2115pub struct RouteSetV4RequestStream {
2117 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2118 is_terminated: bool,
2119}
2120
2121impl std::marker::Unpin for RouteSetV4RequestStream {}
2122
2123impl futures::stream::FusedStream for RouteSetV4RequestStream {
2124 fn is_terminated(&self) -> bool {
2125 self.is_terminated
2126 }
2127}
2128
2129impl fidl::endpoints::RequestStream for RouteSetV4RequestStream {
2130 type Protocol = RouteSetV4Marker;
2131 type ControlHandle = RouteSetV4ControlHandle;
2132
2133 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2134 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2135 }
2136
2137 fn control_handle(&self) -> Self::ControlHandle {
2138 RouteSetV4ControlHandle { inner: self.inner.clone() }
2139 }
2140
2141 fn into_inner(
2142 self,
2143 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2144 {
2145 (self.inner, self.is_terminated)
2146 }
2147
2148 fn from_inner(
2149 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2150 is_terminated: bool,
2151 ) -> Self {
2152 Self { inner, is_terminated }
2153 }
2154}
2155
2156impl futures::Stream for RouteSetV4RequestStream {
2157 type Item = Result<RouteSetV4Request, fidl::Error>;
2158
2159 fn poll_next(
2160 mut self: std::pin::Pin<&mut Self>,
2161 cx: &mut std::task::Context<'_>,
2162 ) -> std::task::Poll<Option<Self::Item>> {
2163 let this = &mut *self;
2164 if this.inner.check_shutdown(cx) {
2165 this.is_terminated = true;
2166 return std::task::Poll::Ready(None);
2167 }
2168 if this.is_terminated {
2169 panic!("polled RouteSetV4RequestStream after completion");
2170 }
2171 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2172 |bytes, handles| {
2173 match this.inner.channel().read_etc(cx, bytes, handles) {
2174 std::task::Poll::Ready(Ok(())) => {}
2175 std::task::Poll::Pending => return std::task::Poll::Pending,
2176 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2177 this.is_terminated = true;
2178 return std::task::Poll::Ready(None);
2179 }
2180 std::task::Poll::Ready(Err(e)) => {
2181 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2182 e.into(),
2183 ))))
2184 }
2185 }
2186
2187 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2189
2190 std::task::Poll::Ready(Some(match header.ordinal {
2191 0x74841ceef127518e => {
2192 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2193 let mut req = fidl::new_empty!(
2194 RouteSetV4AuthenticateForInterfaceRequest,
2195 fidl::encoding::DefaultFuchsiaResourceDialect
2196 );
2197 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteSetV4AuthenticateForInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
2198 let control_handle = RouteSetV4ControlHandle { inner: this.inner.clone() };
2199 Ok(RouteSetV4Request::AuthenticateForInterface {
2200 credential: req.credential,
2201
2202 responder: RouteSetV4AuthenticateForInterfaceResponder {
2203 control_handle: std::mem::ManuallyDrop::new(control_handle),
2204 tx_id: header.tx_id,
2205 },
2206 })
2207 }
2208 0x4bd69e45539e8ec0 => {
2209 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2210 let mut req = fidl::new_empty!(
2211 RouteSetV4AddRouteRequest,
2212 fidl::encoding::DefaultFuchsiaResourceDialect
2213 );
2214 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteSetV4AddRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2215 let control_handle = RouteSetV4ControlHandle { inner: this.inner.clone() };
2216 Ok(RouteSetV4Request::AddRoute {
2217 route: req.route,
2218
2219 responder: RouteSetV4AddRouteResponder {
2220 control_handle: std::mem::ManuallyDrop::new(control_handle),
2221 tx_id: header.tx_id,
2222 },
2223 })
2224 }
2225 0x514f6880232f1665 => {
2226 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2227 let mut req = fidl::new_empty!(
2228 RouteSetV4RemoveRouteRequest,
2229 fidl::encoding::DefaultFuchsiaResourceDialect
2230 );
2231 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteSetV4RemoveRouteRequest>(&header, _body_bytes, handles, &mut req)?;
2232 let control_handle = RouteSetV4ControlHandle { inner: this.inner.clone() };
2233 Ok(RouteSetV4Request::RemoveRoute {
2234 route: req.route,
2235
2236 responder: RouteSetV4RemoveRouteResponder {
2237 control_handle: std::mem::ManuallyDrop::new(control_handle),
2238 tx_id: header.tx_id,
2239 },
2240 })
2241 }
2242 _ => Err(fidl::Error::UnknownOrdinal {
2243 ordinal: header.ordinal,
2244 protocol_name:
2245 <RouteSetV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2246 }),
2247 }))
2248 },
2249 )
2250 }
2251}
2252
2253#[derive(Debug)]
2273pub enum RouteSetV4Request {
2274 AuthenticateForInterface {
2279 credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
2280 responder: RouteSetV4AuthenticateForInterfaceResponder,
2281 },
2282 AddRoute { route: fidl_fuchsia_net_routes::RouteV4, responder: RouteSetV4AddRouteResponder },
2288 RemoveRoute {
2297 route: fidl_fuchsia_net_routes::RouteV4,
2298 responder: RouteSetV4RemoveRouteResponder,
2299 },
2300}
2301
2302impl RouteSetV4Request {
2303 #[allow(irrefutable_let_patterns)]
2304 pub fn into_authenticate_for_interface(
2305 self,
2306 ) -> Option<(
2307 fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
2308 RouteSetV4AuthenticateForInterfaceResponder,
2309 )> {
2310 if let RouteSetV4Request::AuthenticateForInterface { credential, responder } = self {
2311 Some((credential, responder))
2312 } else {
2313 None
2314 }
2315 }
2316
2317 #[allow(irrefutable_let_patterns)]
2318 pub fn into_add_route(
2319 self,
2320 ) -> Option<(fidl_fuchsia_net_routes::RouteV4, RouteSetV4AddRouteResponder)> {
2321 if let RouteSetV4Request::AddRoute { route, responder } = self {
2322 Some((route, responder))
2323 } else {
2324 None
2325 }
2326 }
2327
2328 #[allow(irrefutable_let_patterns)]
2329 pub fn into_remove_route(
2330 self,
2331 ) -> Option<(fidl_fuchsia_net_routes::RouteV4, RouteSetV4RemoveRouteResponder)> {
2332 if let RouteSetV4Request::RemoveRoute { route, responder } = self {
2333 Some((route, responder))
2334 } else {
2335 None
2336 }
2337 }
2338
2339 pub fn method_name(&self) -> &'static str {
2341 match *self {
2342 RouteSetV4Request::AuthenticateForInterface { .. } => "authenticate_for_interface",
2343 RouteSetV4Request::AddRoute { .. } => "add_route",
2344 RouteSetV4Request::RemoveRoute { .. } => "remove_route",
2345 }
2346 }
2347}
2348
2349#[derive(Debug, Clone)]
2350pub struct RouteSetV4ControlHandle {
2351 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2352}
2353
2354impl fidl::endpoints::ControlHandle for RouteSetV4ControlHandle {
2355 fn shutdown(&self) {
2356 self.inner.shutdown()
2357 }
2358 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2359 self.inner.shutdown_with_epitaph(status)
2360 }
2361
2362 fn is_closed(&self) -> bool {
2363 self.inner.channel().is_closed()
2364 }
2365 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2366 self.inner.channel().on_closed()
2367 }
2368
2369 #[cfg(target_os = "fuchsia")]
2370 fn signal_peer(
2371 &self,
2372 clear_mask: zx::Signals,
2373 set_mask: zx::Signals,
2374 ) -> Result<(), zx_status::Status> {
2375 use fidl::Peered;
2376 self.inner.channel().signal_peer(clear_mask, set_mask)
2377 }
2378}
2379
2380impl RouteSetV4ControlHandle {}
2381
2382#[must_use = "FIDL methods require a response to be sent"]
2383#[derive(Debug)]
2384pub struct RouteSetV4AuthenticateForInterfaceResponder {
2385 control_handle: std::mem::ManuallyDrop<RouteSetV4ControlHandle>,
2386 tx_id: u32,
2387}
2388
2389impl std::ops::Drop for RouteSetV4AuthenticateForInterfaceResponder {
2393 fn drop(&mut self) {
2394 self.control_handle.shutdown();
2395 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2397 }
2398}
2399
2400impl fidl::endpoints::Responder for RouteSetV4AuthenticateForInterfaceResponder {
2401 type ControlHandle = RouteSetV4ControlHandle;
2402
2403 fn control_handle(&self) -> &RouteSetV4ControlHandle {
2404 &self.control_handle
2405 }
2406
2407 fn drop_without_shutdown(mut self) {
2408 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2410 std::mem::forget(self);
2412 }
2413}
2414
2415impl RouteSetV4AuthenticateForInterfaceResponder {
2416 pub fn send(
2420 self,
2421 mut result: Result<(), AuthenticateForInterfaceError>,
2422 ) -> Result<(), fidl::Error> {
2423 let _result = self.send_raw(result);
2424 if _result.is_err() {
2425 self.control_handle.shutdown();
2426 }
2427 self.drop_without_shutdown();
2428 _result
2429 }
2430
2431 pub fn send_no_shutdown_on_err(
2433 self,
2434 mut result: Result<(), AuthenticateForInterfaceError>,
2435 ) -> Result<(), fidl::Error> {
2436 let _result = self.send_raw(result);
2437 self.drop_without_shutdown();
2438 _result
2439 }
2440
2441 fn send_raw(
2442 &self,
2443 mut result: Result<(), AuthenticateForInterfaceError>,
2444 ) -> Result<(), fidl::Error> {
2445 self.control_handle.inner.send::<fidl::encoding::ResultType<
2446 fidl::encoding::EmptyStruct,
2447 AuthenticateForInterfaceError,
2448 >>(
2449 result,
2450 self.tx_id,
2451 0x74841ceef127518e,
2452 fidl::encoding::DynamicFlags::empty(),
2453 )
2454 }
2455}
2456
2457#[must_use = "FIDL methods require a response to be sent"]
2458#[derive(Debug)]
2459pub struct RouteSetV4AddRouteResponder {
2460 control_handle: std::mem::ManuallyDrop<RouteSetV4ControlHandle>,
2461 tx_id: u32,
2462}
2463
2464impl std::ops::Drop for RouteSetV4AddRouteResponder {
2468 fn drop(&mut self) {
2469 self.control_handle.shutdown();
2470 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2472 }
2473}
2474
2475impl fidl::endpoints::Responder for RouteSetV4AddRouteResponder {
2476 type ControlHandle = RouteSetV4ControlHandle;
2477
2478 fn control_handle(&self) -> &RouteSetV4ControlHandle {
2479 &self.control_handle
2480 }
2481
2482 fn drop_without_shutdown(mut self) {
2483 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2485 std::mem::forget(self);
2487 }
2488}
2489
2490impl RouteSetV4AddRouteResponder {
2491 pub fn send(self, mut result: Result<bool, RouteSetError>) -> Result<(), fidl::Error> {
2495 let _result = self.send_raw(result);
2496 if _result.is_err() {
2497 self.control_handle.shutdown();
2498 }
2499 self.drop_without_shutdown();
2500 _result
2501 }
2502
2503 pub fn send_no_shutdown_on_err(
2505 self,
2506 mut result: Result<bool, RouteSetError>,
2507 ) -> Result<(), fidl::Error> {
2508 let _result = self.send_raw(result);
2509 self.drop_without_shutdown();
2510 _result
2511 }
2512
2513 fn send_raw(&self, mut result: Result<bool, RouteSetError>) -> Result<(), fidl::Error> {
2514 self.control_handle.inner.send::<fidl::encoding::ResultType<
2515 RouteSetV4AddRouteResponse,
2516 RouteSetError,
2517 >>(
2518 result.map(|did_add| (did_add,)),
2519 self.tx_id,
2520 0x4bd69e45539e8ec0,
2521 fidl::encoding::DynamicFlags::empty(),
2522 )
2523 }
2524}
2525
2526#[must_use = "FIDL methods require a response to be sent"]
2527#[derive(Debug)]
2528pub struct RouteSetV4RemoveRouteResponder {
2529 control_handle: std::mem::ManuallyDrop<RouteSetV4ControlHandle>,
2530 tx_id: u32,
2531}
2532
2533impl std::ops::Drop for RouteSetV4RemoveRouteResponder {
2537 fn drop(&mut self) {
2538 self.control_handle.shutdown();
2539 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2541 }
2542}
2543
2544impl fidl::endpoints::Responder for RouteSetV4RemoveRouteResponder {
2545 type ControlHandle = RouteSetV4ControlHandle;
2546
2547 fn control_handle(&self) -> &RouteSetV4ControlHandle {
2548 &self.control_handle
2549 }
2550
2551 fn drop_without_shutdown(mut self) {
2552 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2554 std::mem::forget(self);
2556 }
2557}
2558
2559impl RouteSetV4RemoveRouteResponder {
2560 pub fn send(self, mut result: Result<bool, RouteSetError>) -> Result<(), fidl::Error> {
2564 let _result = self.send_raw(result);
2565 if _result.is_err() {
2566 self.control_handle.shutdown();
2567 }
2568 self.drop_without_shutdown();
2569 _result
2570 }
2571
2572 pub fn send_no_shutdown_on_err(
2574 self,
2575 mut result: Result<bool, RouteSetError>,
2576 ) -> Result<(), fidl::Error> {
2577 let _result = self.send_raw(result);
2578 self.drop_without_shutdown();
2579 _result
2580 }
2581
2582 fn send_raw(&self, mut result: Result<bool, RouteSetError>) -> Result<(), fidl::Error> {
2583 self.control_handle.inner.send::<fidl::encoding::ResultType<
2584 RouteSetV4RemoveRouteResponse,
2585 RouteSetError,
2586 >>(
2587 result.map(|did_remove| (did_remove,)),
2588 self.tx_id,
2589 0x514f6880232f1665,
2590 fidl::encoding::DynamicFlags::empty(),
2591 )
2592 }
2593}
2594
2595#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2596pub struct RouteSetV6Marker;
2597
2598impl fidl::endpoints::ProtocolMarker for RouteSetV6Marker {
2599 type Proxy = RouteSetV6Proxy;
2600 type RequestStream = RouteSetV6RequestStream;
2601 #[cfg(target_os = "fuchsia")]
2602 type SynchronousProxy = RouteSetV6SynchronousProxy;
2603
2604 const DEBUG_NAME: &'static str = "(anonymous) RouteSetV6";
2605}
2606pub type RouteSetV6AuthenticateForInterfaceResult = Result<(), AuthenticateForInterfaceError>;
2607pub type RouteSetV6AddRouteResult = Result<bool, RouteSetError>;
2608pub type RouteSetV6RemoveRouteResult = Result<bool, RouteSetError>;
2609
2610pub trait RouteSetV6ProxyInterface: Send + Sync {
2611 type AuthenticateForInterfaceResponseFut: std::future::Future<Output = Result<RouteSetV6AuthenticateForInterfaceResult, fidl::Error>>
2612 + Send;
2613 fn r#authenticate_for_interface(
2614 &self,
2615 credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
2616 ) -> Self::AuthenticateForInterfaceResponseFut;
2617 type AddRouteResponseFut: std::future::Future<Output = Result<RouteSetV6AddRouteResult, fidl::Error>>
2618 + Send;
2619 fn r#add_route(&self, route: &fidl_fuchsia_net_routes::RouteV6) -> Self::AddRouteResponseFut;
2620 type RemoveRouteResponseFut: std::future::Future<Output = Result<RouteSetV6RemoveRouteResult, fidl::Error>>
2621 + Send;
2622 fn r#remove_route(
2623 &self,
2624 route: &fidl_fuchsia_net_routes::RouteV6,
2625 ) -> Self::RemoveRouteResponseFut;
2626}
2627#[derive(Debug)]
2628#[cfg(target_os = "fuchsia")]
2629pub struct RouteSetV6SynchronousProxy {
2630 client: fidl::client::sync::Client,
2631}
2632
2633#[cfg(target_os = "fuchsia")]
2634impl fidl::endpoints::SynchronousProxy for RouteSetV6SynchronousProxy {
2635 type Proxy = RouteSetV6Proxy;
2636 type Protocol = RouteSetV6Marker;
2637
2638 fn from_channel(inner: fidl::Channel) -> Self {
2639 Self::new(inner)
2640 }
2641
2642 fn into_channel(self) -> fidl::Channel {
2643 self.client.into_channel()
2644 }
2645
2646 fn as_channel(&self) -> &fidl::Channel {
2647 self.client.as_channel()
2648 }
2649}
2650
2651#[cfg(target_os = "fuchsia")]
2652impl RouteSetV6SynchronousProxy {
2653 pub fn new(channel: fidl::Channel) -> Self {
2654 let protocol_name = <RouteSetV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2655 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2656 }
2657
2658 pub fn into_channel(self) -> fidl::Channel {
2659 self.client.into_channel()
2660 }
2661
2662 pub fn wait_for_event(
2665 &self,
2666 deadline: zx::MonotonicInstant,
2667 ) -> Result<RouteSetV6Event, fidl::Error> {
2668 RouteSetV6Event::decode(self.client.wait_for_event(deadline)?)
2669 }
2670
2671 pub fn r#authenticate_for_interface(
2676 &self,
2677 mut credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
2678 ___deadline: zx::MonotonicInstant,
2679 ) -> Result<RouteSetV6AuthenticateForInterfaceResult, fidl::Error> {
2680 let _response = self
2681 .client
2682 .send_query::<RouteSetV6AuthenticateForInterfaceRequest, fidl::encoding::ResultType<
2683 fidl::encoding::EmptyStruct,
2684 AuthenticateForInterfaceError,
2685 >>(
2686 (&mut credential,),
2687 0x7d63a6a7aed6f640,
2688 fidl::encoding::DynamicFlags::empty(),
2689 ___deadline,
2690 )?;
2691 Ok(_response.map(|x| x))
2692 }
2693
2694 pub fn r#add_route(
2700 &self,
2701 mut route: &fidl_fuchsia_net_routes::RouteV6,
2702 ___deadline: zx::MonotonicInstant,
2703 ) -> Result<RouteSetV6AddRouteResult, fidl::Error> {
2704 let _response = self.client.send_query::<
2705 RouteSetV6AddRouteRequest,
2706 fidl::encoding::ResultType<RouteSetV6AddRouteResponse, RouteSetError>,
2707 >(
2708 (route,),
2709 0x67a2bd2ee34ace2e,
2710 fidl::encoding::DynamicFlags::empty(),
2711 ___deadline,
2712 )?;
2713 Ok(_response.map(|x| x.did_add))
2714 }
2715
2716 pub fn r#remove_route(
2725 &self,
2726 mut route: &fidl_fuchsia_net_routes::RouteV6,
2727 ___deadline: zx::MonotonicInstant,
2728 ) -> Result<RouteSetV6RemoveRouteResult, fidl::Error> {
2729 let _response = self.client.send_query::<
2730 RouteSetV6RemoveRouteRequest,
2731 fidl::encoding::ResultType<RouteSetV6RemoveRouteResponse, RouteSetError>,
2732 >(
2733 (route,),
2734 0x4e5b7d4b1112cd82,
2735 fidl::encoding::DynamicFlags::empty(),
2736 ___deadline,
2737 )?;
2738 Ok(_response.map(|x| x.did_remove))
2739 }
2740}
2741
2742#[cfg(target_os = "fuchsia")]
2743impl From<RouteSetV6SynchronousProxy> for zx::Handle {
2744 fn from(value: RouteSetV6SynchronousProxy) -> Self {
2745 value.into_channel().into()
2746 }
2747}
2748
2749#[cfg(target_os = "fuchsia")]
2750impl From<fidl::Channel> for RouteSetV6SynchronousProxy {
2751 fn from(value: fidl::Channel) -> Self {
2752 Self::new(value)
2753 }
2754}
2755
2756#[derive(Debug, Clone)]
2757pub struct RouteSetV6Proxy {
2758 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2759}
2760
2761impl fidl::endpoints::Proxy for RouteSetV6Proxy {
2762 type Protocol = RouteSetV6Marker;
2763
2764 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2765 Self::new(inner)
2766 }
2767
2768 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2769 self.client.into_channel().map_err(|client| Self { client })
2770 }
2771
2772 fn as_channel(&self) -> &::fidl::AsyncChannel {
2773 self.client.as_channel()
2774 }
2775}
2776
2777impl RouteSetV6Proxy {
2778 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2780 let protocol_name = <RouteSetV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2781 Self { client: fidl::client::Client::new(channel, protocol_name) }
2782 }
2783
2784 pub fn take_event_stream(&self) -> RouteSetV6EventStream {
2790 RouteSetV6EventStream { event_receiver: self.client.take_event_receiver() }
2791 }
2792
2793 pub fn r#authenticate_for_interface(
2798 &self,
2799 mut credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
2800 ) -> fidl::client::QueryResponseFut<
2801 RouteSetV6AuthenticateForInterfaceResult,
2802 fidl::encoding::DefaultFuchsiaResourceDialect,
2803 > {
2804 RouteSetV6ProxyInterface::r#authenticate_for_interface(self, credential)
2805 }
2806
2807 pub fn r#add_route(
2813 &self,
2814 mut route: &fidl_fuchsia_net_routes::RouteV6,
2815 ) -> fidl::client::QueryResponseFut<
2816 RouteSetV6AddRouteResult,
2817 fidl::encoding::DefaultFuchsiaResourceDialect,
2818 > {
2819 RouteSetV6ProxyInterface::r#add_route(self, route)
2820 }
2821
2822 pub fn r#remove_route(
2831 &self,
2832 mut route: &fidl_fuchsia_net_routes::RouteV6,
2833 ) -> fidl::client::QueryResponseFut<
2834 RouteSetV6RemoveRouteResult,
2835 fidl::encoding::DefaultFuchsiaResourceDialect,
2836 > {
2837 RouteSetV6ProxyInterface::r#remove_route(self, route)
2838 }
2839}
2840
2841impl RouteSetV6ProxyInterface for RouteSetV6Proxy {
2842 type AuthenticateForInterfaceResponseFut = fidl::client::QueryResponseFut<
2843 RouteSetV6AuthenticateForInterfaceResult,
2844 fidl::encoding::DefaultFuchsiaResourceDialect,
2845 >;
2846 fn r#authenticate_for_interface(
2847 &self,
2848 mut credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
2849 ) -> Self::AuthenticateForInterfaceResponseFut {
2850 fn _decode(
2851 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2852 ) -> Result<RouteSetV6AuthenticateForInterfaceResult, fidl::Error> {
2853 let _response = fidl::client::decode_transaction_body::<
2854 fidl::encoding::ResultType<
2855 fidl::encoding::EmptyStruct,
2856 AuthenticateForInterfaceError,
2857 >,
2858 fidl::encoding::DefaultFuchsiaResourceDialect,
2859 0x7d63a6a7aed6f640,
2860 >(_buf?)?;
2861 Ok(_response.map(|x| x))
2862 }
2863 self.client.send_query_and_decode::<
2864 RouteSetV6AuthenticateForInterfaceRequest,
2865 RouteSetV6AuthenticateForInterfaceResult,
2866 >(
2867 (&mut credential,),
2868 0x7d63a6a7aed6f640,
2869 fidl::encoding::DynamicFlags::empty(),
2870 _decode,
2871 )
2872 }
2873
2874 type AddRouteResponseFut = fidl::client::QueryResponseFut<
2875 RouteSetV6AddRouteResult,
2876 fidl::encoding::DefaultFuchsiaResourceDialect,
2877 >;
2878 fn r#add_route(
2879 &self,
2880 mut route: &fidl_fuchsia_net_routes::RouteV6,
2881 ) -> Self::AddRouteResponseFut {
2882 fn _decode(
2883 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2884 ) -> Result<RouteSetV6AddRouteResult, fidl::Error> {
2885 let _response = fidl::client::decode_transaction_body::<
2886 fidl::encoding::ResultType<RouteSetV6AddRouteResponse, RouteSetError>,
2887 fidl::encoding::DefaultFuchsiaResourceDialect,
2888 0x67a2bd2ee34ace2e,
2889 >(_buf?)?;
2890 Ok(_response.map(|x| x.did_add))
2891 }
2892 self.client.send_query_and_decode::<RouteSetV6AddRouteRequest, RouteSetV6AddRouteResult>(
2893 (route,),
2894 0x67a2bd2ee34ace2e,
2895 fidl::encoding::DynamicFlags::empty(),
2896 _decode,
2897 )
2898 }
2899
2900 type RemoveRouteResponseFut = fidl::client::QueryResponseFut<
2901 RouteSetV6RemoveRouteResult,
2902 fidl::encoding::DefaultFuchsiaResourceDialect,
2903 >;
2904 fn r#remove_route(
2905 &self,
2906 mut route: &fidl_fuchsia_net_routes::RouteV6,
2907 ) -> Self::RemoveRouteResponseFut {
2908 fn _decode(
2909 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2910 ) -> Result<RouteSetV6RemoveRouteResult, fidl::Error> {
2911 let _response = fidl::client::decode_transaction_body::<
2912 fidl::encoding::ResultType<RouteSetV6RemoveRouteResponse, RouteSetError>,
2913 fidl::encoding::DefaultFuchsiaResourceDialect,
2914 0x4e5b7d4b1112cd82,
2915 >(_buf?)?;
2916 Ok(_response.map(|x| x.did_remove))
2917 }
2918 self.client
2919 .send_query_and_decode::<RouteSetV6RemoveRouteRequest, RouteSetV6RemoveRouteResult>(
2920 (route,),
2921 0x4e5b7d4b1112cd82,
2922 fidl::encoding::DynamicFlags::empty(),
2923 _decode,
2924 )
2925 }
2926}
2927
2928pub struct RouteSetV6EventStream {
2929 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2930}
2931
2932impl std::marker::Unpin for RouteSetV6EventStream {}
2933
2934impl futures::stream::FusedStream for RouteSetV6EventStream {
2935 fn is_terminated(&self) -> bool {
2936 self.event_receiver.is_terminated()
2937 }
2938}
2939
2940impl futures::Stream for RouteSetV6EventStream {
2941 type Item = Result<RouteSetV6Event, fidl::Error>;
2942
2943 fn poll_next(
2944 mut self: std::pin::Pin<&mut Self>,
2945 cx: &mut std::task::Context<'_>,
2946 ) -> std::task::Poll<Option<Self::Item>> {
2947 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2948 &mut self.event_receiver,
2949 cx
2950 )?) {
2951 Some(buf) => std::task::Poll::Ready(Some(RouteSetV6Event::decode(buf))),
2952 None => std::task::Poll::Ready(None),
2953 }
2954 }
2955}
2956
2957#[derive(Debug)]
2958pub enum RouteSetV6Event {}
2959
2960impl RouteSetV6Event {
2961 fn decode(
2963 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2964 ) -> Result<RouteSetV6Event, fidl::Error> {
2965 let (bytes, _handles) = buf.split_mut();
2966 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2967 debug_assert_eq!(tx_header.tx_id, 0);
2968 match tx_header.ordinal {
2969 _ => Err(fidl::Error::UnknownOrdinal {
2970 ordinal: tx_header.ordinal,
2971 protocol_name: <RouteSetV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2972 }),
2973 }
2974 }
2975}
2976
2977pub struct RouteSetV6RequestStream {
2979 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2980 is_terminated: bool,
2981}
2982
2983impl std::marker::Unpin for RouteSetV6RequestStream {}
2984
2985impl futures::stream::FusedStream for RouteSetV6RequestStream {
2986 fn is_terminated(&self) -> bool {
2987 self.is_terminated
2988 }
2989}
2990
2991impl fidl::endpoints::RequestStream for RouteSetV6RequestStream {
2992 type Protocol = RouteSetV6Marker;
2993 type ControlHandle = RouteSetV6ControlHandle;
2994
2995 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2996 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2997 }
2998
2999 fn control_handle(&self) -> Self::ControlHandle {
3000 RouteSetV6ControlHandle { inner: self.inner.clone() }
3001 }
3002
3003 fn into_inner(
3004 self,
3005 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3006 {
3007 (self.inner, self.is_terminated)
3008 }
3009
3010 fn from_inner(
3011 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3012 is_terminated: bool,
3013 ) -> Self {
3014 Self { inner, is_terminated }
3015 }
3016}
3017
3018impl futures::Stream for RouteSetV6RequestStream {
3019 type Item = Result<RouteSetV6Request, fidl::Error>;
3020
3021 fn poll_next(
3022 mut self: std::pin::Pin<&mut Self>,
3023 cx: &mut std::task::Context<'_>,
3024 ) -> std::task::Poll<Option<Self::Item>> {
3025 let this = &mut *self;
3026 if this.inner.check_shutdown(cx) {
3027 this.is_terminated = true;
3028 return std::task::Poll::Ready(None);
3029 }
3030 if this.is_terminated {
3031 panic!("polled RouteSetV6RequestStream after completion");
3032 }
3033 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3034 |bytes, handles| {
3035 match this.inner.channel().read_etc(cx, bytes, handles) {
3036 std::task::Poll::Ready(Ok(())) => {}
3037 std::task::Poll::Pending => return std::task::Poll::Pending,
3038 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3039 this.is_terminated = true;
3040 return std::task::Poll::Ready(None);
3041 }
3042 std::task::Poll::Ready(Err(e)) => {
3043 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3044 e.into(),
3045 ))))
3046 }
3047 }
3048
3049 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3051
3052 std::task::Poll::Ready(Some(match header.ordinal {
3053 0x7d63a6a7aed6f640 => {
3054 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3055 let mut req = fidl::new_empty!(
3056 RouteSetV6AuthenticateForInterfaceRequest,
3057 fidl::encoding::DefaultFuchsiaResourceDialect
3058 );
3059 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteSetV6AuthenticateForInterfaceRequest>(&header, _body_bytes, handles, &mut req)?;
3060 let control_handle = RouteSetV6ControlHandle { inner: this.inner.clone() };
3061 Ok(RouteSetV6Request::AuthenticateForInterface {
3062 credential: req.credential,
3063
3064 responder: RouteSetV6AuthenticateForInterfaceResponder {
3065 control_handle: std::mem::ManuallyDrop::new(control_handle),
3066 tx_id: header.tx_id,
3067 },
3068 })
3069 }
3070 0x67a2bd2ee34ace2e => {
3071 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3072 let mut req = fidl::new_empty!(
3073 RouteSetV6AddRouteRequest,
3074 fidl::encoding::DefaultFuchsiaResourceDialect
3075 );
3076 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteSetV6AddRouteRequest>(&header, _body_bytes, handles, &mut req)?;
3077 let control_handle = RouteSetV6ControlHandle { inner: this.inner.clone() };
3078 Ok(RouteSetV6Request::AddRoute {
3079 route: req.route,
3080
3081 responder: RouteSetV6AddRouteResponder {
3082 control_handle: std::mem::ManuallyDrop::new(control_handle),
3083 tx_id: header.tx_id,
3084 },
3085 })
3086 }
3087 0x4e5b7d4b1112cd82 => {
3088 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3089 let mut req = fidl::new_empty!(
3090 RouteSetV6RemoveRouteRequest,
3091 fidl::encoding::DefaultFuchsiaResourceDialect
3092 );
3093 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteSetV6RemoveRouteRequest>(&header, _body_bytes, handles, &mut req)?;
3094 let control_handle = RouteSetV6ControlHandle { inner: this.inner.clone() };
3095 Ok(RouteSetV6Request::RemoveRoute {
3096 route: req.route,
3097
3098 responder: RouteSetV6RemoveRouteResponder {
3099 control_handle: std::mem::ManuallyDrop::new(control_handle),
3100 tx_id: header.tx_id,
3101 },
3102 })
3103 }
3104 _ => Err(fidl::Error::UnknownOrdinal {
3105 ordinal: header.ordinal,
3106 protocol_name:
3107 <RouteSetV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3108 }),
3109 }))
3110 },
3111 )
3112 }
3113}
3114
3115#[derive(Debug)]
3135pub enum RouteSetV6Request {
3136 AuthenticateForInterface {
3141 credential: fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
3142 responder: RouteSetV6AuthenticateForInterfaceResponder,
3143 },
3144 AddRoute { route: fidl_fuchsia_net_routes::RouteV6, responder: RouteSetV6AddRouteResponder },
3150 RemoveRoute {
3159 route: fidl_fuchsia_net_routes::RouteV6,
3160 responder: RouteSetV6RemoveRouteResponder,
3161 },
3162}
3163
3164impl RouteSetV6Request {
3165 #[allow(irrefutable_let_patterns)]
3166 pub fn into_authenticate_for_interface(
3167 self,
3168 ) -> Option<(
3169 fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
3170 RouteSetV6AuthenticateForInterfaceResponder,
3171 )> {
3172 if let RouteSetV6Request::AuthenticateForInterface { credential, responder } = self {
3173 Some((credential, responder))
3174 } else {
3175 None
3176 }
3177 }
3178
3179 #[allow(irrefutable_let_patterns)]
3180 pub fn into_add_route(
3181 self,
3182 ) -> Option<(fidl_fuchsia_net_routes::RouteV6, RouteSetV6AddRouteResponder)> {
3183 if let RouteSetV6Request::AddRoute { route, responder } = self {
3184 Some((route, responder))
3185 } else {
3186 None
3187 }
3188 }
3189
3190 #[allow(irrefutable_let_patterns)]
3191 pub fn into_remove_route(
3192 self,
3193 ) -> Option<(fidl_fuchsia_net_routes::RouteV6, RouteSetV6RemoveRouteResponder)> {
3194 if let RouteSetV6Request::RemoveRoute { route, responder } = self {
3195 Some((route, responder))
3196 } else {
3197 None
3198 }
3199 }
3200
3201 pub fn method_name(&self) -> &'static str {
3203 match *self {
3204 RouteSetV6Request::AuthenticateForInterface { .. } => "authenticate_for_interface",
3205 RouteSetV6Request::AddRoute { .. } => "add_route",
3206 RouteSetV6Request::RemoveRoute { .. } => "remove_route",
3207 }
3208 }
3209}
3210
3211#[derive(Debug, Clone)]
3212pub struct RouteSetV6ControlHandle {
3213 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3214}
3215
3216impl fidl::endpoints::ControlHandle for RouteSetV6ControlHandle {
3217 fn shutdown(&self) {
3218 self.inner.shutdown()
3219 }
3220 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3221 self.inner.shutdown_with_epitaph(status)
3222 }
3223
3224 fn is_closed(&self) -> bool {
3225 self.inner.channel().is_closed()
3226 }
3227 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3228 self.inner.channel().on_closed()
3229 }
3230
3231 #[cfg(target_os = "fuchsia")]
3232 fn signal_peer(
3233 &self,
3234 clear_mask: zx::Signals,
3235 set_mask: zx::Signals,
3236 ) -> Result<(), zx_status::Status> {
3237 use fidl::Peered;
3238 self.inner.channel().signal_peer(clear_mask, set_mask)
3239 }
3240}
3241
3242impl RouteSetV6ControlHandle {}
3243
3244#[must_use = "FIDL methods require a response to be sent"]
3245#[derive(Debug)]
3246pub struct RouteSetV6AuthenticateForInterfaceResponder {
3247 control_handle: std::mem::ManuallyDrop<RouteSetV6ControlHandle>,
3248 tx_id: u32,
3249}
3250
3251impl std::ops::Drop for RouteSetV6AuthenticateForInterfaceResponder {
3255 fn drop(&mut self) {
3256 self.control_handle.shutdown();
3257 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3259 }
3260}
3261
3262impl fidl::endpoints::Responder for RouteSetV6AuthenticateForInterfaceResponder {
3263 type ControlHandle = RouteSetV6ControlHandle;
3264
3265 fn control_handle(&self) -> &RouteSetV6ControlHandle {
3266 &self.control_handle
3267 }
3268
3269 fn drop_without_shutdown(mut self) {
3270 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3272 std::mem::forget(self);
3274 }
3275}
3276
3277impl RouteSetV6AuthenticateForInterfaceResponder {
3278 pub fn send(
3282 self,
3283 mut result: Result<(), AuthenticateForInterfaceError>,
3284 ) -> Result<(), fidl::Error> {
3285 let _result = self.send_raw(result);
3286 if _result.is_err() {
3287 self.control_handle.shutdown();
3288 }
3289 self.drop_without_shutdown();
3290 _result
3291 }
3292
3293 pub fn send_no_shutdown_on_err(
3295 self,
3296 mut result: Result<(), AuthenticateForInterfaceError>,
3297 ) -> Result<(), fidl::Error> {
3298 let _result = self.send_raw(result);
3299 self.drop_without_shutdown();
3300 _result
3301 }
3302
3303 fn send_raw(
3304 &self,
3305 mut result: Result<(), AuthenticateForInterfaceError>,
3306 ) -> Result<(), fidl::Error> {
3307 self.control_handle.inner.send::<fidl::encoding::ResultType<
3308 fidl::encoding::EmptyStruct,
3309 AuthenticateForInterfaceError,
3310 >>(
3311 result,
3312 self.tx_id,
3313 0x7d63a6a7aed6f640,
3314 fidl::encoding::DynamicFlags::empty(),
3315 )
3316 }
3317}
3318
3319#[must_use = "FIDL methods require a response to be sent"]
3320#[derive(Debug)]
3321pub struct RouteSetV6AddRouteResponder {
3322 control_handle: std::mem::ManuallyDrop<RouteSetV6ControlHandle>,
3323 tx_id: u32,
3324}
3325
3326impl std::ops::Drop for RouteSetV6AddRouteResponder {
3330 fn drop(&mut self) {
3331 self.control_handle.shutdown();
3332 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3334 }
3335}
3336
3337impl fidl::endpoints::Responder for RouteSetV6AddRouteResponder {
3338 type ControlHandle = RouteSetV6ControlHandle;
3339
3340 fn control_handle(&self) -> &RouteSetV6ControlHandle {
3341 &self.control_handle
3342 }
3343
3344 fn drop_without_shutdown(mut self) {
3345 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3347 std::mem::forget(self);
3349 }
3350}
3351
3352impl RouteSetV6AddRouteResponder {
3353 pub fn send(self, mut result: Result<bool, RouteSetError>) -> Result<(), fidl::Error> {
3357 let _result = self.send_raw(result);
3358 if _result.is_err() {
3359 self.control_handle.shutdown();
3360 }
3361 self.drop_without_shutdown();
3362 _result
3363 }
3364
3365 pub fn send_no_shutdown_on_err(
3367 self,
3368 mut result: Result<bool, RouteSetError>,
3369 ) -> Result<(), fidl::Error> {
3370 let _result = self.send_raw(result);
3371 self.drop_without_shutdown();
3372 _result
3373 }
3374
3375 fn send_raw(&self, mut result: Result<bool, RouteSetError>) -> Result<(), fidl::Error> {
3376 self.control_handle.inner.send::<fidl::encoding::ResultType<
3377 RouteSetV6AddRouteResponse,
3378 RouteSetError,
3379 >>(
3380 result.map(|did_add| (did_add,)),
3381 self.tx_id,
3382 0x67a2bd2ee34ace2e,
3383 fidl::encoding::DynamicFlags::empty(),
3384 )
3385 }
3386}
3387
3388#[must_use = "FIDL methods require a response to be sent"]
3389#[derive(Debug)]
3390pub struct RouteSetV6RemoveRouteResponder {
3391 control_handle: std::mem::ManuallyDrop<RouteSetV6ControlHandle>,
3392 tx_id: u32,
3393}
3394
3395impl std::ops::Drop for RouteSetV6RemoveRouteResponder {
3399 fn drop(&mut self) {
3400 self.control_handle.shutdown();
3401 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3403 }
3404}
3405
3406impl fidl::endpoints::Responder for RouteSetV6RemoveRouteResponder {
3407 type ControlHandle = RouteSetV6ControlHandle;
3408
3409 fn control_handle(&self) -> &RouteSetV6ControlHandle {
3410 &self.control_handle
3411 }
3412
3413 fn drop_without_shutdown(mut self) {
3414 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3416 std::mem::forget(self);
3418 }
3419}
3420
3421impl RouteSetV6RemoveRouteResponder {
3422 pub fn send(self, mut result: Result<bool, RouteSetError>) -> Result<(), fidl::Error> {
3426 let _result = self.send_raw(result);
3427 if _result.is_err() {
3428 self.control_handle.shutdown();
3429 }
3430 self.drop_without_shutdown();
3431 _result
3432 }
3433
3434 pub fn send_no_shutdown_on_err(
3436 self,
3437 mut result: Result<bool, RouteSetError>,
3438 ) -> Result<(), fidl::Error> {
3439 let _result = self.send_raw(result);
3440 self.drop_without_shutdown();
3441 _result
3442 }
3443
3444 fn send_raw(&self, mut result: Result<bool, RouteSetError>) -> Result<(), fidl::Error> {
3445 self.control_handle.inner.send::<fidl::encoding::ResultType<
3446 RouteSetV6RemoveRouteResponse,
3447 RouteSetError,
3448 >>(
3449 result.map(|did_remove| (did_remove,)),
3450 self.tx_id,
3451 0x4e5b7d4b1112cd82,
3452 fidl::encoding::DynamicFlags::empty(),
3453 )
3454 }
3455}
3456
3457#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3458pub struct RouteTableProviderV4Marker;
3459
3460impl fidl::endpoints::ProtocolMarker for RouteTableProviderV4Marker {
3461 type Proxy = RouteTableProviderV4Proxy;
3462 type RequestStream = RouteTableProviderV4RequestStream;
3463 #[cfg(target_os = "fuchsia")]
3464 type SynchronousProxy = RouteTableProviderV4SynchronousProxy;
3465
3466 const DEBUG_NAME: &'static str = "fuchsia.net.routes.admin.RouteTableProviderV4";
3467}
3468impl fidl::endpoints::DiscoverableProtocolMarker for RouteTableProviderV4Marker {}
3469
3470pub trait RouteTableProviderV4ProxyInterface: Send + Sync {
3471 fn r#new_route_table(
3472 &self,
3473 provider: fidl::endpoints::ServerEnd<RouteTableV4Marker>,
3474 options: &RouteTableOptionsV4,
3475 ) -> Result<(), fidl::Error>;
3476}
3477#[derive(Debug)]
3478#[cfg(target_os = "fuchsia")]
3479pub struct RouteTableProviderV4SynchronousProxy {
3480 client: fidl::client::sync::Client,
3481}
3482
3483#[cfg(target_os = "fuchsia")]
3484impl fidl::endpoints::SynchronousProxy for RouteTableProviderV4SynchronousProxy {
3485 type Proxy = RouteTableProviderV4Proxy;
3486 type Protocol = RouteTableProviderV4Marker;
3487
3488 fn from_channel(inner: fidl::Channel) -> Self {
3489 Self::new(inner)
3490 }
3491
3492 fn into_channel(self) -> fidl::Channel {
3493 self.client.into_channel()
3494 }
3495
3496 fn as_channel(&self) -> &fidl::Channel {
3497 self.client.as_channel()
3498 }
3499}
3500
3501#[cfg(target_os = "fuchsia")]
3502impl RouteTableProviderV4SynchronousProxy {
3503 pub fn new(channel: fidl::Channel) -> Self {
3504 let protocol_name =
3505 <RouteTableProviderV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3506 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3507 }
3508
3509 pub fn into_channel(self) -> fidl::Channel {
3510 self.client.into_channel()
3511 }
3512
3513 pub fn wait_for_event(
3516 &self,
3517 deadline: zx::MonotonicInstant,
3518 ) -> Result<RouteTableProviderV4Event, fidl::Error> {
3519 RouteTableProviderV4Event::decode(self.client.wait_for_event(deadline)?)
3520 }
3521
3522 pub fn r#new_route_table(
3525 &self,
3526 mut provider: fidl::endpoints::ServerEnd<RouteTableV4Marker>,
3527 mut options: &RouteTableOptionsV4,
3528 ) -> Result<(), fidl::Error> {
3529 self.client.send::<RouteTableProviderV4NewRouteTableRequest>(
3530 (provider, options),
3531 0x703bc0eaf98f07cf,
3532 fidl::encoding::DynamicFlags::empty(),
3533 )
3534 }
3535}
3536
3537#[cfg(target_os = "fuchsia")]
3538impl From<RouteTableProviderV4SynchronousProxy> for zx::Handle {
3539 fn from(value: RouteTableProviderV4SynchronousProxy) -> Self {
3540 value.into_channel().into()
3541 }
3542}
3543
3544#[cfg(target_os = "fuchsia")]
3545impl From<fidl::Channel> for RouteTableProviderV4SynchronousProxy {
3546 fn from(value: fidl::Channel) -> Self {
3547 Self::new(value)
3548 }
3549}
3550
3551#[derive(Debug, Clone)]
3552pub struct RouteTableProviderV4Proxy {
3553 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3554}
3555
3556impl fidl::endpoints::Proxy for RouteTableProviderV4Proxy {
3557 type Protocol = RouteTableProviderV4Marker;
3558
3559 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3560 Self::new(inner)
3561 }
3562
3563 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3564 self.client.into_channel().map_err(|client| Self { client })
3565 }
3566
3567 fn as_channel(&self) -> &::fidl::AsyncChannel {
3568 self.client.as_channel()
3569 }
3570}
3571
3572impl RouteTableProviderV4Proxy {
3573 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3575 let protocol_name =
3576 <RouteTableProviderV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3577 Self { client: fidl::client::Client::new(channel, protocol_name) }
3578 }
3579
3580 pub fn take_event_stream(&self) -> RouteTableProviderV4EventStream {
3586 RouteTableProviderV4EventStream { event_receiver: self.client.take_event_receiver() }
3587 }
3588
3589 pub fn r#new_route_table(
3592 &self,
3593 mut provider: fidl::endpoints::ServerEnd<RouteTableV4Marker>,
3594 mut options: &RouteTableOptionsV4,
3595 ) -> Result<(), fidl::Error> {
3596 RouteTableProviderV4ProxyInterface::r#new_route_table(self, provider, options)
3597 }
3598}
3599
3600impl RouteTableProviderV4ProxyInterface for RouteTableProviderV4Proxy {
3601 fn r#new_route_table(
3602 &self,
3603 mut provider: fidl::endpoints::ServerEnd<RouteTableV4Marker>,
3604 mut options: &RouteTableOptionsV4,
3605 ) -> Result<(), fidl::Error> {
3606 self.client.send::<RouteTableProviderV4NewRouteTableRequest>(
3607 (provider, options),
3608 0x703bc0eaf98f07cf,
3609 fidl::encoding::DynamicFlags::empty(),
3610 )
3611 }
3612}
3613
3614pub struct RouteTableProviderV4EventStream {
3615 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3616}
3617
3618impl std::marker::Unpin for RouteTableProviderV4EventStream {}
3619
3620impl futures::stream::FusedStream for RouteTableProviderV4EventStream {
3621 fn is_terminated(&self) -> bool {
3622 self.event_receiver.is_terminated()
3623 }
3624}
3625
3626impl futures::Stream for RouteTableProviderV4EventStream {
3627 type Item = Result<RouteTableProviderV4Event, fidl::Error>;
3628
3629 fn poll_next(
3630 mut self: std::pin::Pin<&mut Self>,
3631 cx: &mut std::task::Context<'_>,
3632 ) -> std::task::Poll<Option<Self::Item>> {
3633 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3634 &mut self.event_receiver,
3635 cx
3636 )?) {
3637 Some(buf) => std::task::Poll::Ready(Some(RouteTableProviderV4Event::decode(buf))),
3638 None => std::task::Poll::Ready(None),
3639 }
3640 }
3641}
3642
3643#[derive(Debug)]
3644pub enum RouteTableProviderV4Event {}
3645
3646impl RouteTableProviderV4Event {
3647 fn decode(
3649 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3650 ) -> Result<RouteTableProviderV4Event, fidl::Error> {
3651 let (bytes, _handles) = buf.split_mut();
3652 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3653 debug_assert_eq!(tx_header.tx_id, 0);
3654 match tx_header.ordinal {
3655 _ => Err(fidl::Error::UnknownOrdinal {
3656 ordinal: tx_header.ordinal,
3657 protocol_name:
3658 <RouteTableProviderV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3659 }),
3660 }
3661 }
3662}
3663
3664pub struct RouteTableProviderV4RequestStream {
3666 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3667 is_terminated: bool,
3668}
3669
3670impl std::marker::Unpin for RouteTableProviderV4RequestStream {}
3671
3672impl futures::stream::FusedStream for RouteTableProviderV4RequestStream {
3673 fn is_terminated(&self) -> bool {
3674 self.is_terminated
3675 }
3676}
3677
3678impl fidl::endpoints::RequestStream for RouteTableProviderV4RequestStream {
3679 type Protocol = RouteTableProviderV4Marker;
3680 type ControlHandle = RouteTableProviderV4ControlHandle;
3681
3682 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3683 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3684 }
3685
3686 fn control_handle(&self) -> Self::ControlHandle {
3687 RouteTableProviderV4ControlHandle { inner: self.inner.clone() }
3688 }
3689
3690 fn into_inner(
3691 self,
3692 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3693 {
3694 (self.inner, self.is_terminated)
3695 }
3696
3697 fn from_inner(
3698 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3699 is_terminated: bool,
3700 ) -> Self {
3701 Self { inner, is_terminated }
3702 }
3703}
3704
3705impl futures::Stream for RouteTableProviderV4RequestStream {
3706 type Item = Result<RouteTableProviderV4Request, fidl::Error>;
3707
3708 fn poll_next(
3709 mut self: std::pin::Pin<&mut Self>,
3710 cx: &mut std::task::Context<'_>,
3711 ) -> std::task::Poll<Option<Self::Item>> {
3712 let this = &mut *self;
3713 if this.inner.check_shutdown(cx) {
3714 this.is_terminated = true;
3715 return std::task::Poll::Ready(None);
3716 }
3717 if this.is_terminated {
3718 panic!("polled RouteTableProviderV4RequestStream after completion");
3719 }
3720 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3721 |bytes, handles| {
3722 match this.inner.channel().read_etc(cx, bytes, handles) {
3723 std::task::Poll::Ready(Ok(())) => {}
3724 std::task::Poll::Pending => return std::task::Poll::Pending,
3725 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3726 this.is_terminated = true;
3727 return std::task::Poll::Ready(None);
3728 }
3729 std::task::Poll::Ready(Err(e)) => {
3730 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3731 e.into(),
3732 ))))
3733 }
3734 }
3735
3736 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3738
3739 std::task::Poll::Ready(Some(match header.ordinal {
3740 0x703bc0eaf98f07cf => {
3741 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3742 let mut req = fidl::new_empty!(RouteTableProviderV4NewRouteTableRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
3743 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteTableProviderV4NewRouteTableRequest>(&header, _body_bytes, handles, &mut req)?;
3744 let control_handle = RouteTableProviderV4ControlHandle {
3745 inner: this.inner.clone(),
3746 };
3747 Ok(RouteTableProviderV4Request::NewRouteTable {provider: req.provider,
3748options: req.options,
3749
3750 control_handle,
3751 })
3752 }
3753 _ => Err(fidl::Error::UnknownOrdinal {
3754 ordinal: header.ordinal,
3755 protocol_name: <RouteTableProviderV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3756 }),
3757 }))
3758 },
3759 )
3760 }
3761}
3762
3763#[derive(Debug)]
3765pub enum RouteTableProviderV4Request {
3766 NewRouteTable {
3769 provider: fidl::endpoints::ServerEnd<RouteTableV4Marker>,
3770 options: RouteTableOptionsV4,
3771 control_handle: RouteTableProviderV4ControlHandle,
3772 },
3773}
3774
3775impl RouteTableProviderV4Request {
3776 #[allow(irrefutable_let_patterns)]
3777 pub fn into_new_route_table(
3778 self,
3779 ) -> Option<(
3780 fidl::endpoints::ServerEnd<RouteTableV4Marker>,
3781 RouteTableOptionsV4,
3782 RouteTableProviderV4ControlHandle,
3783 )> {
3784 if let RouteTableProviderV4Request::NewRouteTable { provider, options, control_handle } =
3785 self
3786 {
3787 Some((provider, options, control_handle))
3788 } else {
3789 None
3790 }
3791 }
3792
3793 pub fn method_name(&self) -> &'static str {
3795 match *self {
3796 RouteTableProviderV4Request::NewRouteTable { .. } => "new_route_table",
3797 }
3798 }
3799}
3800
3801#[derive(Debug, Clone)]
3802pub struct RouteTableProviderV4ControlHandle {
3803 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3804}
3805
3806impl fidl::endpoints::ControlHandle for RouteTableProviderV4ControlHandle {
3807 fn shutdown(&self) {
3808 self.inner.shutdown()
3809 }
3810 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3811 self.inner.shutdown_with_epitaph(status)
3812 }
3813
3814 fn is_closed(&self) -> bool {
3815 self.inner.channel().is_closed()
3816 }
3817 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3818 self.inner.channel().on_closed()
3819 }
3820
3821 #[cfg(target_os = "fuchsia")]
3822 fn signal_peer(
3823 &self,
3824 clear_mask: zx::Signals,
3825 set_mask: zx::Signals,
3826 ) -> Result<(), zx_status::Status> {
3827 use fidl::Peered;
3828 self.inner.channel().signal_peer(clear_mask, set_mask)
3829 }
3830}
3831
3832impl RouteTableProviderV4ControlHandle {}
3833
3834#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3835pub struct RouteTableProviderV6Marker;
3836
3837impl fidl::endpoints::ProtocolMarker for RouteTableProviderV6Marker {
3838 type Proxy = RouteTableProviderV6Proxy;
3839 type RequestStream = RouteTableProviderV6RequestStream;
3840 #[cfg(target_os = "fuchsia")]
3841 type SynchronousProxy = RouteTableProviderV6SynchronousProxy;
3842
3843 const DEBUG_NAME: &'static str = "fuchsia.net.routes.admin.RouteTableProviderV6";
3844}
3845impl fidl::endpoints::DiscoverableProtocolMarker for RouteTableProviderV6Marker {}
3846
3847pub trait RouteTableProviderV6ProxyInterface: Send + Sync {
3848 fn r#new_route_table(
3849 &self,
3850 provider: fidl::endpoints::ServerEnd<RouteTableV6Marker>,
3851 options: &RouteTableOptionsV6,
3852 ) -> Result<(), fidl::Error>;
3853}
3854#[derive(Debug)]
3855#[cfg(target_os = "fuchsia")]
3856pub struct RouteTableProviderV6SynchronousProxy {
3857 client: fidl::client::sync::Client,
3858}
3859
3860#[cfg(target_os = "fuchsia")]
3861impl fidl::endpoints::SynchronousProxy for RouteTableProviderV6SynchronousProxy {
3862 type Proxy = RouteTableProviderV6Proxy;
3863 type Protocol = RouteTableProviderV6Marker;
3864
3865 fn from_channel(inner: fidl::Channel) -> Self {
3866 Self::new(inner)
3867 }
3868
3869 fn into_channel(self) -> fidl::Channel {
3870 self.client.into_channel()
3871 }
3872
3873 fn as_channel(&self) -> &fidl::Channel {
3874 self.client.as_channel()
3875 }
3876}
3877
3878#[cfg(target_os = "fuchsia")]
3879impl RouteTableProviderV6SynchronousProxy {
3880 pub fn new(channel: fidl::Channel) -> Self {
3881 let protocol_name =
3882 <RouteTableProviderV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3883 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3884 }
3885
3886 pub fn into_channel(self) -> fidl::Channel {
3887 self.client.into_channel()
3888 }
3889
3890 pub fn wait_for_event(
3893 &self,
3894 deadline: zx::MonotonicInstant,
3895 ) -> Result<RouteTableProviderV6Event, fidl::Error> {
3896 RouteTableProviderV6Event::decode(self.client.wait_for_event(deadline)?)
3897 }
3898
3899 pub fn r#new_route_table(
3902 &self,
3903 mut provider: fidl::endpoints::ServerEnd<RouteTableV6Marker>,
3904 mut options: &RouteTableOptionsV6,
3905 ) -> Result<(), fidl::Error> {
3906 self.client.send::<RouteTableProviderV6NewRouteTableRequest>(
3907 (provider, options),
3908 0x152b67b397a31ca,
3909 fidl::encoding::DynamicFlags::empty(),
3910 )
3911 }
3912}
3913
3914#[cfg(target_os = "fuchsia")]
3915impl From<RouteTableProviderV6SynchronousProxy> for zx::Handle {
3916 fn from(value: RouteTableProviderV6SynchronousProxy) -> Self {
3917 value.into_channel().into()
3918 }
3919}
3920
3921#[cfg(target_os = "fuchsia")]
3922impl From<fidl::Channel> for RouteTableProviderV6SynchronousProxy {
3923 fn from(value: fidl::Channel) -> Self {
3924 Self::new(value)
3925 }
3926}
3927
3928#[derive(Debug, Clone)]
3929pub struct RouteTableProviderV6Proxy {
3930 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3931}
3932
3933impl fidl::endpoints::Proxy for RouteTableProviderV6Proxy {
3934 type Protocol = RouteTableProviderV6Marker;
3935
3936 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3937 Self::new(inner)
3938 }
3939
3940 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3941 self.client.into_channel().map_err(|client| Self { client })
3942 }
3943
3944 fn as_channel(&self) -> &::fidl::AsyncChannel {
3945 self.client.as_channel()
3946 }
3947}
3948
3949impl RouteTableProviderV6Proxy {
3950 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3952 let protocol_name =
3953 <RouteTableProviderV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3954 Self { client: fidl::client::Client::new(channel, protocol_name) }
3955 }
3956
3957 pub fn take_event_stream(&self) -> RouteTableProviderV6EventStream {
3963 RouteTableProviderV6EventStream { event_receiver: self.client.take_event_receiver() }
3964 }
3965
3966 pub fn r#new_route_table(
3969 &self,
3970 mut provider: fidl::endpoints::ServerEnd<RouteTableV6Marker>,
3971 mut options: &RouteTableOptionsV6,
3972 ) -> Result<(), fidl::Error> {
3973 RouteTableProviderV6ProxyInterface::r#new_route_table(self, provider, options)
3974 }
3975}
3976
3977impl RouteTableProviderV6ProxyInterface for RouteTableProviderV6Proxy {
3978 fn r#new_route_table(
3979 &self,
3980 mut provider: fidl::endpoints::ServerEnd<RouteTableV6Marker>,
3981 mut options: &RouteTableOptionsV6,
3982 ) -> Result<(), fidl::Error> {
3983 self.client.send::<RouteTableProviderV6NewRouteTableRequest>(
3984 (provider, options),
3985 0x152b67b397a31ca,
3986 fidl::encoding::DynamicFlags::empty(),
3987 )
3988 }
3989}
3990
3991pub struct RouteTableProviderV6EventStream {
3992 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3993}
3994
3995impl std::marker::Unpin for RouteTableProviderV6EventStream {}
3996
3997impl futures::stream::FusedStream for RouteTableProviderV6EventStream {
3998 fn is_terminated(&self) -> bool {
3999 self.event_receiver.is_terminated()
4000 }
4001}
4002
4003impl futures::Stream for RouteTableProviderV6EventStream {
4004 type Item = Result<RouteTableProviderV6Event, fidl::Error>;
4005
4006 fn poll_next(
4007 mut self: std::pin::Pin<&mut Self>,
4008 cx: &mut std::task::Context<'_>,
4009 ) -> std::task::Poll<Option<Self::Item>> {
4010 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4011 &mut self.event_receiver,
4012 cx
4013 )?) {
4014 Some(buf) => std::task::Poll::Ready(Some(RouteTableProviderV6Event::decode(buf))),
4015 None => std::task::Poll::Ready(None),
4016 }
4017 }
4018}
4019
4020#[derive(Debug)]
4021pub enum RouteTableProviderV6Event {}
4022
4023impl RouteTableProviderV6Event {
4024 fn decode(
4026 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4027 ) -> Result<RouteTableProviderV6Event, fidl::Error> {
4028 let (bytes, _handles) = buf.split_mut();
4029 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4030 debug_assert_eq!(tx_header.tx_id, 0);
4031 match tx_header.ordinal {
4032 _ => Err(fidl::Error::UnknownOrdinal {
4033 ordinal: tx_header.ordinal,
4034 protocol_name:
4035 <RouteTableProviderV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4036 }),
4037 }
4038 }
4039}
4040
4041pub struct RouteTableProviderV6RequestStream {
4043 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4044 is_terminated: bool,
4045}
4046
4047impl std::marker::Unpin for RouteTableProviderV6RequestStream {}
4048
4049impl futures::stream::FusedStream for RouteTableProviderV6RequestStream {
4050 fn is_terminated(&self) -> bool {
4051 self.is_terminated
4052 }
4053}
4054
4055impl fidl::endpoints::RequestStream for RouteTableProviderV6RequestStream {
4056 type Protocol = RouteTableProviderV6Marker;
4057 type ControlHandle = RouteTableProviderV6ControlHandle;
4058
4059 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4060 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4061 }
4062
4063 fn control_handle(&self) -> Self::ControlHandle {
4064 RouteTableProviderV6ControlHandle { inner: self.inner.clone() }
4065 }
4066
4067 fn into_inner(
4068 self,
4069 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4070 {
4071 (self.inner, self.is_terminated)
4072 }
4073
4074 fn from_inner(
4075 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4076 is_terminated: bool,
4077 ) -> Self {
4078 Self { inner, is_terminated }
4079 }
4080}
4081
4082impl futures::Stream for RouteTableProviderV6RequestStream {
4083 type Item = Result<RouteTableProviderV6Request, fidl::Error>;
4084
4085 fn poll_next(
4086 mut self: std::pin::Pin<&mut Self>,
4087 cx: &mut std::task::Context<'_>,
4088 ) -> std::task::Poll<Option<Self::Item>> {
4089 let this = &mut *self;
4090 if this.inner.check_shutdown(cx) {
4091 this.is_terminated = true;
4092 return std::task::Poll::Ready(None);
4093 }
4094 if this.is_terminated {
4095 panic!("polled RouteTableProviderV6RequestStream after completion");
4096 }
4097 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4098 |bytes, handles| {
4099 match this.inner.channel().read_etc(cx, bytes, handles) {
4100 std::task::Poll::Ready(Ok(())) => {}
4101 std::task::Poll::Pending => return std::task::Poll::Pending,
4102 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4103 this.is_terminated = true;
4104 return std::task::Poll::Ready(None);
4105 }
4106 std::task::Poll::Ready(Err(e)) => {
4107 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4108 e.into(),
4109 ))))
4110 }
4111 }
4112
4113 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4115
4116 std::task::Poll::Ready(Some(match header.ordinal {
4117 0x152b67b397a31ca => {
4118 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4119 let mut req = fidl::new_empty!(RouteTableProviderV6NewRouteTableRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4120 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteTableProviderV6NewRouteTableRequest>(&header, _body_bytes, handles, &mut req)?;
4121 let control_handle = RouteTableProviderV6ControlHandle {
4122 inner: this.inner.clone(),
4123 };
4124 Ok(RouteTableProviderV6Request::NewRouteTable {provider: req.provider,
4125options: req.options,
4126
4127 control_handle,
4128 })
4129 }
4130 _ => Err(fidl::Error::UnknownOrdinal {
4131 ordinal: header.ordinal,
4132 protocol_name: <RouteTableProviderV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4133 }),
4134 }))
4135 },
4136 )
4137 }
4138}
4139
4140#[derive(Debug)]
4142pub enum RouteTableProviderV6Request {
4143 NewRouteTable {
4146 provider: fidl::endpoints::ServerEnd<RouteTableV6Marker>,
4147 options: RouteTableOptionsV6,
4148 control_handle: RouteTableProviderV6ControlHandle,
4149 },
4150}
4151
4152impl RouteTableProviderV6Request {
4153 #[allow(irrefutable_let_patterns)]
4154 pub fn into_new_route_table(
4155 self,
4156 ) -> Option<(
4157 fidl::endpoints::ServerEnd<RouteTableV6Marker>,
4158 RouteTableOptionsV6,
4159 RouteTableProviderV6ControlHandle,
4160 )> {
4161 if let RouteTableProviderV6Request::NewRouteTable { provider, options, control_handle } =
4162 self
4163 {
4164 Some((provider, options, control_handle))
4165 } else {
4166 None
4167 }
4168 }
4169
4170 pub fn method_name(&self) -> &'static str {
4172 match *self {
4173 RouteTableProviderV6Request::NewRouteTable { .. } => "new_route_table",
4174 }
4175 }
4176}
4177
4178#[derive(Debug, Clone)]
4179pub struct RouteTableProviderV6ControlHandle {
4180 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4181}
4182
4183impl fidl::endpoints::ControlHandle for RouteTableProviderV6ControlHandle {
4184 fn shutdown(&self) {
4185 self.inner.shutdown()
4186 }
4187 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4188 self.inner.shutdown_with_epitaph(status)
4189 }
4190
4191 fn is_closed(&self) -> bool {
4192 self.inner.channel().is_closed()
4193 }
4194 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4195 self.inner.channel().on_closed()
4196 }
4197
4198 #[cfg(target_os = "fuchsia")]
4199 fn signal_peer(
4200 &self,
4201 clear_mask: zx::Signals,
4202 set_mask: zx::Signals,
4203 ) -> Result<(), zx_status::Status> {
4204 use fidl::Peered;
4205 self.inner.channel().signal_peer(clear_mask, set_mask)
4206 }
4207}
4208
4209impl RouteTableProviderV6ControlHandle {}
4210
4211#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4212pub struct RouteTableV4Marker;
4213
4214impl fidl::endpoints::ProtocolMarker for RouteTableV4Marker {
4215 type Proxy = RouteTableV4Proxy;
4216 type RequestStream = RouteTableV4RequestStream;
4217 #[cfg(target_os = "fuchsia")]
4218 type SynchronousProxy = RouteTableV4SynchronousProxy;
4219
4220 const DEBUG_NAME: &'static str = "fuchsia.net.routes.admin.RouteTableV4";
4221}
4222impl fidl::endpoints::DiscoverableProtocolMarker for RouteTableV4Marker {}
4223
4224pub trait RouteTableV4ProxyInterface: Send + Sync {
4225 type GetTableIdResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
4226 fn r#get_table_id(&self) -> Self::GetTableIdResponseFut;
4227 fn r#detach(&self) -> Result<(), fidl::Error>;
4228 type RemoveResponseFut: std::future::Future<Output = Result<BaseRouteTableRemoveResult, fidl::Error>>
4229 + Send;
4230 fn r#remove(&self) -> Self::RemoveResponseFut;
4231 type GetAuthorizationForRouteTableResponseFut: std::future::Future<Output = Result<GrantForRouteTableAuthorization, fidl::Error>>
4232 + Send;
4233 fn r#get_authorization_for_route_table(&self)
4234 -> Self::GetAuthorizationForRouteTableResponseFut;
4235 fn r#new_route_set(
4236 &self,
4237 route_set: fidl::endpoints::ServerEnd<RouteSetV4Marker>,
4238 ) -> Result<(), fidl::Error>;
4239}
4240#[derive(Debug)]
4241#[cfg(target_os = "fuchsia")]
4242pub struct RouteTableV4SynchronousProxy {
4243 client: fidl::client::sync::Client,
4244}
4245
4246#[cfg(target_os = "fuchsia")]
4247impl fidl::endpoints::SynchronousProxy for RouteTableV4SynchronousProxy {
4248 type Proxy = RouteTableV4Proxy;
4249 type Protocol = RouteTableV4Marker;
4250
4251 fn from_channel(inner: fidl::Channel) -> Self {
4252 Self::new(inner)
4253 }
4254
4255 fn into_channel(self) -> fidl::Channel {
4256 self.client.into_channel()
4257 }
4258
4259 fn as_channel(&self) -> &fidl::Channel {
4260 self.client.as_channel()
4261 }
4262}
4263
4264#[cfg(target_os = "fuchsia")]
4265impl RouteTableV4SynchronousProxy {
4266 pub fn new(channel: fidl::Channel) -> Self {
4267 let protocol_name = <RouteTableV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4268 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4269 }
4270
4271 pub fn into_channel(self) -> fidl::Channel {
4272 self.client.into_channel()
4273 }
4274
4275 pub fn wait_for_event(
4278 &self,
4279 deadline: zx::MonotonicInstant,
4280 ) -> Result<RouteTableV4Event, fidl::Error> {
4281 RouteTableV4Event::decode(self.client.wait_for_event(deadline)?)
4282 }
4283
4284 pub fn r#get_table_id(&self, ___deadline: zx::MonotonicInstant) -> Result<u32, fidl::Error> {
4286 let _response = self
4287 .client
4288 .send_query::<fidl::encoding::EmptyPayload, BaseRouteTableGetTableIdResponse>(
4289 (),
4290 0x7eab30c55edbfc15,
4291 fidl::encoding::DynamicFlags::empty(),
4292 ___deadline,
4293 )?;
4294 Ok(_response.table_id)
4295 }
4296
4297 pub fn r#detach(&self) -> Result<(), fidl::Error> {
4303 self.client.send::<fidl::encoding::EmptyPayload>(
4304 (),
4305 0x2853ab157285b384,
4306 fidl::encoding::DynamicFlags::empty(),
4307 )
4308 }
4309
4310 pub fn r#remove(
4316 &self,
4317 ___deadline: zx::MonotonicInstant,
4318 ) -> Result<BaseRouteTableRemoveResult, fidl::Error> {
4319 let _response =
4320 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4321 fidl::encoding::EmptyStruct,
4322 BaseRouteTableRemoveError,
4323 >>(
4324 (),
4325 0xc42e58a5fc79426,
4326 fidl::encoding::DynamicFlags::empty(),
4327 ___deadline,
4328 )?;
4329 Ok(_response.map(|x| x))
4330 }
4331
4332 pub fn r#get_authorization_for_route_table(
4343 &self,
4344 ___deadline: zx::MonotonicInstant,
4345 ) -> Result<GrantForRouteTableAuthorization, fidl::Error> {
4346 let _response = self.client.send_query::<
4347 fidl::encoding::EmptyPayload,
4348 BaseRouteTableGetAuthorizationForRouteTableResponse,
4349 >(
4350 (),
4351 0x56a48c921ff3b6eb,
4352 fidl::encoding::DynamicFlags::empty(),
4353 ___deadline,
4354 )?;
4355 Ok(_response.credential)
4356 }
4357
4358 pub fn r#new_route_set(
4362 &self,
4363 mut route_set: fidl::endpoints::ServerEnd<RouteSetV4Marker>,
4364 ) -> Result<(), fidl::Error> {
4365 self.client.send::<RouteTableV4NewRouteSetRequest>(
4366 (route_set,),
4367 0x6aeb6d05698abedb,
4368 fidl::encoding::DynamicFlags::empty(),
4369 )
4370 }
4371}
4372
4373#[cfg(target_os = "fuchsia")]
4374impl From<RouteTableV4SynchronousProxy> for zx::Handle {
4375 fn from(value: RouteTableV4SynchronousProxy) -> Self {
4376 value.into_channel().into()
4377 }
4378}
4379
4380#[cfg(target_os = "fuchsia")]
4381impl From<fidl::Channel> for RouteTableV4SynchronousProxy {
4382 fn from(value: fidl::Channel) -> Self {
4383 Self::new(value)
4384 }
4385}
4386
4387#[derive(Debug, Clone)]
4388pub struct RouteTableV4Proxy {
4389 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4390}
4391
4392impl fidl::endpoints::Proxy for RouteTableV4Proxy {
4393 type Protocol = RouteTableV4Marker;
4394
4395 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4396 Self::new(inner)
4397 }
4398
4399 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4400 self.client.into_channel().map_err(|client| Self { client })
4401 }
4402
4403 fn as_channel(&self) -> &::fidl::AsyncChannel {
4404 self.client.as_channel()
4405 }
4406}
4407
4408impl RouteTableV4Proxy {
4409 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4411 let protocol_name = <RouteTableV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4412 Self { client: fidl::client::Client::new(channel, protocol_name) }
4413 }
4414
4415 pub fn take_event_stream(&self) -> RouteTableV4EventStream {
4421 RouteTableV4EventStream { event_receiver: self.client.take_event_receiver() }
4422 }
4423
4424 pub fn r#get_table_id(
4426 &self,
4427 ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
4428 RouteTableV4ProxyInterface::r#get_table_id(self)
4429 }
4430
4431 pub fn r#detach(&self) -> Result<(), fidl::Error> {
4437 RouteTableV4ProxyInterface::r#detach(self)
4438 }
4439
4440 pub fn r#remove(
4446 &self,
4447 ) -> fidl::client::QueryResponseFut<
4448 BaseRouteTableRemoveResult,
4449 fidl::encoding::DefaultFuchsiaResourceDialect,
4450 > {
4451 RouteTableV4ProxyInterface::r#remove(self)
4452 }
4453
4454 pub fn r#get_authorization_for_route_table(
4465 &self,
4466 ) -> fidl::client::QueryResponseFut<
4467 GrantForRouteTableAuthorization,
4468 fidl::encoding::DefaultFuchsiaResourceDialect,
4469 > {
4470 RouteTableV4ProxyInterface::r#get_authorization_for_route_table(self)
4471 }
4472
4473 pub fn r#new_route_set(
4477 &self,
4478 mut route_set: fidl::endpoints::ServerEnd<RouteSetV4Marker>,
4479 ) -> Result<(), fidl::Error> {
4480 RouteTableV4ProxyInterface::r#new_route_set(self, route_set)
4481 }
4482}
4483
4484impl RouteTableV4ProxyInterface for RouteTableV4Proxy {
4485 type GetTableIdResponseFut =
4486 fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
4487 fn r#get_table_id(&self) -> Self::GetTableIdResponseFut {
4488 fn _decode(
4489 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4490 ) -> Result<u32, fidl::Error> {
4491 let _response = fidl::client::decode_transaction_body::<
4492 BaseRouteTableGetTableIdResponse,
4493 fidl::encoding::DefaultFuchsiaResourceDialect,
4494 0x7eab30c55edbfc15,
4495 >(_buf?)?;
4496 Ok(_response.table_id)
4497 }
4498 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
4499 (),
4500 0x7eab30c55edbfc15,
4501 fidl::encoding::DynamicFlags::empty(),
4502 _decode,
4503 )
4504 }
4505
4506 fn r#detach(&self) -> Result<(), fidl::Error> {
4507 self.client.send::<fidl::encoding::EmptyPayload>(
4508 (),
4509 0x2853ab157285b384,
4510 fidl::encoding::DynamicFlags::empty(),
4511 )
4512 }
4513
4514 type RemoveResponseFut = fidl::client::QueryResponseFut<
4515 BaseRouteTableRemoveResult,
4516 fidl::encoding::DefaultFuchsiaResourceDialect,
4517 >;
4518 fn r#remove(&self) -> Self::RemoveResponseFut {
4519 fn _decode(
4520 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4521 ) -> Result<BaseRouteTableRemoveResult, fidl::Error> {
4522 let _response = fidl::client::decode_transaction_body::<
4523 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BaseRouteTableRemoveError>,
4524 fidl::encoding::DefaultFuchsiaResourceDialect,
4525 0xc42e58a5fc79426,
4526 >(_buf?)?;
4527 Ok(_response.map(|x| x))
4528 }
4529 self.client
4530 .send_query_and_decode::<fidl::encoding::EmptyPayload, BaseRouteTableRemoveResult>(
4531 (),
4532 0xc42e58a5fc79426,
4533 fidl::encoding::DynamicFlags::empty(),
4534 _decode,
4535 )
4536 }
4537
4538 type GetAuthorizationForRouteTableResponseFut = fidl::client::QueryResponseFut<
4539 GrantForRouteTableAuthorization,
4540 fidl::encoding::DefaultFuchsiaResourceDialect,
4541 >;
4542 fn r#get_authorization_for_route_table(
4543 &self,
4544 ) -> Self::GetAuthorizationForRouteTableResponseFut {
4545 fn _decode(
4546 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4547 ) -> Result<GrantForRouteTableAuthorization, fidl::Error> {
4548 let _response = fidl::client::decode_transaction_body::<
4549 BaseRouteTableGetAuthorizationForRouteTableResponse,
4550 fidl::encoding::DefaultFuchsiaResourceDialect,
4551 0x56a48c921ff3b6eb,
4552 >(_buf?)?;
4553 Ok(_response.credential)
4554 }
4555 self.client
4556 .send_query_and_decode::<fidl::encoding::EmptyPayload, GrantForRouteTableAuthorization>(
4557 (),
4558 0x56a48c921ff3b6eb,
4559 fidl::encoding::DynamicFlags::empty(),
4560 _decode,
4561 )
4562 }
4563
4564 fn r#new_route_set(
4565 &self,
4566 mut route_set: fidl::endpoints::ServerEnd<RouteSetV4Marker>,
4567 ) -> Result<(), fidl::Error> {
4568 self.client.send::<RouteTableV4NewRouteSetRequest>(
4569 (route_set,),
4570 0x6aeb6d05698abedb,
4571 fidl::encoding::DynamicFlags::empty(),
4572 )
4573 }
4574}
4575
4576pub struct RouteTableV4EventStream {
4577 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4578}
4579
4580impl std::marker::Unpin for RouteTableV4EventStream {}
4581
4582impl futures::stream::FusedStream for RouteTableV4EventStream {
4583 fn is_terminated(&self) -> bool {
4584 self.event_receiver.is_terminated()
4585 }
4586}
4587
4588impl futures::Stream for RouteTableV4EventStream {
4589 type Item = Result<RouteTableV4Event, fidl::Error>;
4590
4591 fn poll_next(
4592 mut self: std::pin::Pin<&mut Self>,
4593 cx: &mut std::task::Context<'_>,
4594 ) -> std::task::Poll<Option<Self::Item>> {
4595 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4596 &mut self.event_receiver,
4597 cx
4598 )?) {
4599 Some(buf) => std::task::Poll::Ready(Some(RouteTableV4Event::decode(buf))),
4600 None => std::task::Poll::Ready(None),
4601 }
4602 }
4603}
4604
4605#[derive(Debug)]
4606pub enum RouteTableV4Event {}
4607
4608impl RouteTableV4Event {
4609 fn decode(
4611 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4612 ) -> Result<RouteTableV4Event, fidl::Error> {
4613 let (bytes, _handles) = buf.split_mut();
4614 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4615 debug_assert_eq!(tx_header.tx_id, 0);
4616 match tx_header.ordinal {
4617 _ => Err(fidl::Error::UnknownOrdinal {
4618 ordinal: tx_header.ordinal,
4619 protocol_name: <RouteTableV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4620 }),
4621 }
4622 }
4623}
4624
4625pub struct RouteTableV4RequestStream {
4627 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4628 is_terminated: bool,
4629}
4630
4631impl std::marker::Unpin for RouteTableV4RequestStream {}
4632
4633impl futures::stream::FusedStream for RouteTableV4RequestStream {
4634 fn is_terminated(&self) -> bool {
4635 self.is_terminated
4636 }
4637}
4638
4639impl fidl::endpoints::RequestStream for RouteTableV4RequestStream {
4640 type Protocol = RouteTableV4Marker;
4641 type ControlHandle = RouteTableV4ControlHandle;
4642
4643 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4644 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4645 }
4646
4647 fn control_handle(&self) -> Self::ControlHandle {
4648 RouteTableV4ControlHandle { inner: self.inner.clone() }
4649 }
4650
4651 fn into_inner(
4652 self,
4653 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4654 {
4655 (self.inner, self.is_terminated)
4656 }
4657
4658 fn from_inner(
4659 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4660 is_terminated: bool,
4661 ) -> Self {
4662 Self { inner, is_terminated }
4663 }
4664}
4665
4666impl futures::Stream for RouteTableV4RequestStream {
4667 type Item = Result<RouteTableV4Request, fidl::Error>;
4668
4669 fn poll_next(
4670 mut self: std::pin::Pin<&mut Self>,
4671 cx: &mut std::task::Context<'_>,
4672 ) -> std::task::Poll<Option<Self::Item>> {
4673 let this = &mut *self;
4674 if this.inner.check_shutdown(cx) {
4675 this.is_terminated = true;
4676 return std::task::Poll::Ready(None);
4677 }
4678 if this.is_terminated {
4679 panic!("polled RouteTableV4RequestStream after completion");
4680 }
4681 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4682 |bytes, handles| {
4683 match this.inner.channel().read_etc(cx, bytes, handles) {
4684 std::task::Poll::Ready(Ok(())) => {}
4685 std::task::Poll::Pending => return std::task::Poll::Pending,
4686 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4687 this.is_terminated = true;
4688 return std::task::Poll::Ready(None);
4689 }
4690 std::task::Poll::Ready(Err(e)) => {
4691 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4692 e.into(),
4693 ))))
4694 }
4695 }
4696
4697 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4699
4700 std::task::Poll::Ready(Some(match header.ordinal {
4701 0x7eab30c55edbfc15 => {
4702 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4703 let mut req = fidl::new_empty!(
4704 fidl::encoding::EmptyPayload,
4705 fidl::encoding::DefaultFuchsiaResourceDialect
4706 );
4707 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4708 let control_handle =
4709 RouteTableV4ControlHandle { inner: this.inner.clone() };
4710 Ok(RouteTableV4Request::GetTableId {
4711 responder: RouteTableV4GetTableIdResponder {
4712 control_handle: std::mem::ManuallyDrop::new(control_handle),
4713 tx_id: header.tx_id,
4714 },
4715 })
4716 }
4717 0x2853ab157285b384 => {
4718 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4719 let mut req = fidl::new_empty!(
4720 fidl::encoding::EmptyPayload,
4721 fidl::encoding::DefaultFuchsiaResourceDialect
4722 );
4723 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4724 let control_handle =
4725 RouteTableV4ControlHandle { inner: this.inner.clone() };
4726 Ok(RouteTableV4Request::Detach { control_handle })
4727 }
4728 0xc42e58a5fc79426 => {
4729 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4730 let mut req = fidl::new_empty!(
4731 fidl::encoding::EmptyPayload,
4732 fidl::encoding::DefaultFuchsiaResourceDialect
4733 );
4734 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4735 let control_handle =
4736 RouteTableV4ControlHandle { inner: this.inner.clone() };
4737 Ok(RouteTableV4Request::Remove {
4738 responder: RouteTableV4RemoveResponder {
4739 control_handle: std::mem::ManuallyDrop::new(control_handle),
4740 tx_id: header.tx_id,
4741 },
4742 })
4743 }
4744 0x56a48c921ff3b6eb => {
4745 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4746 let mut req = fidl::new_empty!(
4747 fidl::encoding::EmptyPayload,
4748 fidl::encoding::DefaultFuchsiaResourceDialect
4749 );
4750 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4751 let control_handle =
4752 RouteTableV4ControlHandle { inner: this.inner.clone() };
4753 Ok(RouteTableV4Request::GetAuthorizationForRouteTable {
4754 responder: RouteTableV4GetAuthorizationForRouteTableResponder {
4755 control_handle: std::mem::ManuallyDrop::new(control_handle),
4756 tx_id: header.tx_id,
4757 },
4758 })
4759 }
4760 0x6aeb6d05698abedb => {
4761 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4762 let mut req = fidl::new_empty!(
4763 RouteTableV4NewRouteSetRequest,
4764 fidl::encoding::DefaultFuchsiaResourceDialect
4765 );
4766 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteTableV4NewRouteSetRequest>(&header, _body_bytes, handles, &mut req)?;
4767 let control_handle =
4768 RouteTableV4ControlHandle { inner: this.inner.clone() };
4769 Ok(RouteTableV4Request::NewRouteSet {
4770 route_set: req.route_set,
4771
4772 control_handle,
4773 })
4774 }
4775 _ => Err(fidl::Error::UnknownOrdinal {
4776 ordinal: header.ordinal,
4777 protocol_name:
4778 <RouteTableV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4779 }),
4780 }))
4781 },
4782 )
4783 }
4784}
4785
4786#[derive(Debug)]
4795pub enum RouteTableV4Request {
4796 GetTableId { responder: RouteTableV4GetTableIdResponder },
4798 Detach { control_handle: RouteTableV4ControlHandle },
4804 Remove { responder: RouteTableV4RemoveResponder },
4810 GetAuthorizationForRouteTable { responder: RouteTableV4GetAuthorizationForRouteTableResponder },
4821 NewRouteSet {
4825 route_set: fidl::endpoints::ServerEnd<RouteSetV4Marker>,
4826 control_handle: RouteTableV4ControlHandle,
4827 },
4828}
4829
4830impl RouteTableV4Request {
4831 #[allow(irrefutable_let_patterns)]
4832 pub fn into_get_table_id(self) -> Option<(RouteTableV4GetTableIdResponder)> {
4833 if let RouteTableV4Request::GetTableId { responder } = self {
4834 Some((responder))
4835 } else {
4836 None
4837 }
4838 }
4839
4840 #[allow(irrefutable_let_patterns)]
4841 pub fn into_detach(self) -> Option<(RouteTableV4ControlHandle)> {
4842 if let RouteTableV4Request::Detach { control_handle } = self {
4843 Some((control_handle))
4844 } else {
4845 None
4846 }
4847 }
4848
4849 #[allow(irrefutable_let_patterns)]
4850 pub fn into_remove(self) -> Option<(RouteTableV4RemoveResponder)> {
4851 if let RouteTableV4Request::Remove { responder } = self {
4852 Some((responder))
4853 } else {
4854 None
4855 }
4856 }
4857
4858 #[allow(irrefutable_let_patterns)]
4859 pub fn into_get_authorization_for_route_table(
4860 self,
4861 ) -> Option<(RouteTableV4GetAuthorizationForRouteTableResponder)> {
4862 if let RouteTableV4Request::GetAuthorizationForRouteTable { responder } = self {
4863 Some((responder))
4864 } else {
4865 None
4866 }
4867 }
4868
4869 #[allow(irrefutable_let_patterns)]
4870 pub fn into_new_route_set(
4871 self,
4872 ) -> Option<(fidl::endpoints::ServerEnd<RouteSetV4Marker>, RouteTableV4ControlHandle)> {
4873 if let RouteTableV4Request::NewRouteSet { route_set, control_handle } = self {
4874 Some((route_set, control_handle))
4875 } else {
4876 None
4877 }
4878 }
4879
4880 pub fn method_name(&self) -> &'static str {
4882 match *self {
4883 RouteTableV4Request::GetTableId { .. } => "get_table_id",
4884 RouteTableV4Request::Detach { .. } => "detach",
4885 RouteTableV4Request::Remove { .. } => "remove",
4886 RouteTableV4Request::GetAuthorizationForRouteTable { .. } => {
4887 "get_authorization_for_route_table"
4888 }
4889 RouteTableV4Request::NewRouteSet { .. } => "new_route_set",
4890 }
4891 }
4892}
4893
4894#[derive(Debug, Clone)]
4895pub struct RouteTableV4ControlHandle {
4896 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4897}
4898
4899impl fidl::endpoints::ControlHandle for RouteTableV4ControlHandle {
4900 fn shutdown(&self) {
4901 self.inner.shutdown()
4902 }
4903 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4904 self.inner.shutdown_with_epitaph(status)
4905 }
4906
4907 fn is_closed(&self) -> bool {
4908 self.inner.channel().is_closed()
4909 }
4910 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4911 self.inner.channel().on_closed()
4912 }
4913
4914 #[cfg(target_os = "fuchsia")]
4915 fn signal_peer(
4916 &self,
4917 clear_mask: zx::Signals,
4918 set_mask: zx::Signals,
4919 ) -> Result<(), zx_status::Status> {
4920 use fidl::Peered;
4921 self.inner.channel().signal_peer(clear_mask, set_mask)
4922 }
4923}
4924
4925impl RouteTableV4ControlHandle {}
4926
4927#[must_use = "FIDL methods require a response to be sent"]
4928#[derive(Debug)]
4929pub struct RouteTableV4GetTableIdResponder {
4930 control_handle: std::mem::ManuallyDrop<RouteTableV4ControlHandle>,
4931 tx_id: u32,
4932}
4933
4934impl std::ops::Drop for RouteTableV4GetTableIdResponder {
4938 fn drop(&mut self) {
4939 self.control_handle.shutdown();
4940 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4942 }
4943}
4944
4945impl fidl::endpoints::Responder for RouteTableV4GetTableIdResponder {
4946 type ControlHandle = RouteTableV4ControlHandle;
4947
4948 fn control_handle(&self) -> &RouteTableV4ControlHandle {
4949 &self.control_handle
4950 }
4951
4952 fn drop_without_shutdown(mut self) {
4953 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4955 std::mem::forget(self);
4957 }
4958}
4959
4960impl RouteTableV4GetTableIdResponder {
4961 pub fn send(self, mut table_id: u32) -> Result<(), fidl::Error> {
4965 let _result = self.send_raw(table_id);
4966 if _result.is_err() {
4967 self.control_handle.shutdown();
4968 }
4969 self.drop_without_shutdown();
4970 _result
4971 }
4972
4973 pub fn send_no_shutdown_on_err(self, mut table_id: u32) -> Result<(), fidl::Error> {
4975 let _result = self.send_raw(table_id);
4976 self.drop_without_shutdown();
4977 _result
4978 }
4979
4980 fn send_raw(&self, mut table_id: u32) -> Result<(), fidl::Error> {
4981 self.control_handle.inner.send::<BaseRouteTableGetTableIdResponse>(
4982 (table_id,),
4983 self.tx_id,
4984 0x7eab30c55edbfc15,
4985 fidl::encoding::DynamicFlags::empty(),
4986 )
4987 }
4988}
4989
4990#[must_use = "FIDL methods require a response to be sent"]
4991#[derive(Debug)]
4992pub struct RouteTableV4RemoveResponder {
4993 control_handle: std::mem::ManuallyDrop<RouteTableV4ControlHandle>,
4994 tx_id: u32,
4995}
4996
4997impl std::ops::Drop for RouteTableV4RemoveResponder {
5001 fn drop(&mut self) {
5002 self.control_handle.shutdown();
5003 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5005 }
5006}
5007
5008impl fidl::endpoints::Responder for RouteTableV4RemoveResponder {
5009 type ControlHandle = RouteTableV4ControlHandle;
5010
5011 fn control_handle(&self) -> &RouteTableV4ControlHandle {
5012 &self.control_handle
5013 }
5014
5015 fn drop_without_shutdown(mut self) {
5016 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5018 std::mem::forget(self);
5020 }
5021}
5022
5023impl RouteTableV4RemoveResponder {
5024 pub fn send(
5028 self,
5029 mut result: Result<(), BaseRouteTableRemoveError>,
5030 ) -> Result<(), fidl::Error> {
5031 let _result = self.send_raw(result);
5032 if _result.is_err() {
5033 self.control_handle.shutdown();
5034 }
5035 self.drop_without_shutdown();
5036 _result
5037 }
5038
5039 pub fn send_no_shutdown_on_err(
5041 self,
5042 mut result: Result<(), BaseRouteTableRemoveError>,
5043 ) -> Result<(), fidl::Error> {
5044 let _result = self.send_raw(result);
5045 self.drop_without_shutdown();
5046 _result
5047 }
5048
5049 fn send_raw(
5050 &self,
5051 mut result: Result<(), BaseRouteTableRemoveError>,
5052 ) -> Result<(), fidl::Error> {
5053 self.control_handle.inner.send::<fidl::encoding::ResultType<
5054 fidl::encoding::EmptyStruct,
5055 BaseRouteTableRemoveError,
5056 >>(
5057 result,
5058 self.tx_id,
5059 0xc42e58a5fc79426,
5060 fidl::encoding::DynamicFlags::empty(),
5061 )
5062 }
5063}
5064
5065#[must_use = "FIDL methods require a response to be sent"]
5066#[derive(Debug)]
5067pub struct RouteTableV4GetAuthorizationForRouteTableResponder {
5068 control_handle: std::mem::ManuallyDrop<RouteTableV4ControlHandle>,
5069 tx_id: u32,
5070}
5071
5072impl std::ops::Drop for RouteTableV4GetAuthorizationForRouteTableResponder {
5076 fn drop(&mut self) {
5077 self.control_handle.shutdown();
5078 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5080 }
5081}
5082
5083impl fidl::endpoints::Responder for RouteTableV4GetAuthorizationForRouteTableResponder {
5084 type ControlHandle = RouteTableV4ControlHandle;
5085
5086 fn control_handle(&self) -> &RouteTableV4ControlHandle {
5087 &self.control_handle
5088 }
5089
5090 fn drop_without_shutdown(mut self) {
5091 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5093 std::mem::forget(self);
5095 }
5096}
5097
5098impl RouteTableV4GetAuthorizationForRouteTableResponder {
5099 pub fn send(self, mut credential: GrantForRouteTableAuthorization) -> Result<(), fidl::Error> {
5103 let _result = self.send_raw(credential);
5104 if _result.is_err() {
5105 self.control_handle.shutdown();
5106 }
5107 self.drop_without_shutdown();
5108 _result
5109 }
5110
5111 pub fn send_no_shutdown_on_err(
5113 self,
5114 mut credential: GrantForRouteTableAuthorization,
5115 ) -> Result<(), fidl::Error> {
5116 let _result = self.send_raw(credential);
5117 self.drop_without_shutdown();
5118 _result
5119 }
5120
5121 fn send_raw(&self, mut credential: GrantForRouteTableAuthorization) -> Result<(), fidl::Error> {
5122 self.control_handle.inner.send::<BaseRouteTableGetAuthorizationForRouteTableResponse>(
5123 (&mut credential,),
5124 self.tx_id,
5125 0x56a48c921ff3b6eb,
5126 fidl::encoding::DynamicFlags::empty(),
5127 )
5128 }
5129}
5130
5131#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5132pub struct RouteTableV6Marker;
5133
5134impl fidl::endpoints::ProtocolMarker for RouteTableV6Marker {
5135 type Proxy = RouteTableV6Proxy;
5136 type RequestStream = RouteTableV6RequestStream;
5137 #[cfg(target_os = "fuchsia")]
5138 type SynchronousProxy = RouteTableV6SynchronousProxy;
5139
5140 const DEBUG_NAME: &'static str = "fuchsia.net.routes.admin.RouteTableV6";
5141}
5142impl fidl::endpoints::DiscoverableProtocolMarker for RouteTableV6Marker {}
5143
5144pub trait RouteTableV6ProxyInterface: Send + Sync {
5145 type GetTableIdResponseFut: std::future::Future<Output = Result<u32, fidl::Error>> + Send;
5146 fn r#get_table_id(&self) -> Self::GetTableIdResponseFut;
5147 fn r#detach(&self) -> Result<(), fidl::Error>;
5148 type RemoveResponseFut: std::future::Future<Output = Result<BaseRouteTableRemoveResult, fidl::Error>>
5149 + Send;
5150 fn r#remove(&self) -> Self::RemoveResponseFut;
5151 type GetAuthorizationForRouteTableResponseFut: std::future::Future<Output = Result<GrantForRouteTableAuthorization, fidl::Error>>
5152 + Send;
5153 fn r#get_authorization_for_route_table(&self)
5154 -> Self::GetAuthorizationForRouteTableResponseFut;
5155 fn r#new_route_set(
5156 &self,
5157 route_set: fidl::endpoints::ServerEnd<RouteSetV6Marker>,
5158 ) -> Result<(), fidl::Error>;
5159}
5160#[derive(Debug)]
5161#[cfg(target_os = "fuchsia")]
5162pub struct RouteTableV6SynchronousProxy {
5163 client: fidl::client::sync::Client,
5164}
5165
5166#[cfg(target_os = "fuchsia")]
5167impl fidl::endpoints::SynchronousProxy for RouteTableV6SynchronousProxy {
5168 type Proxy = RouteTableV6Proxy;
5169 type Protocol = RouteTableV6Marker;
5170
5171 fn from_channel(inner: fidl::Channel) -> Self {
5172 Self::new(inner)
5173 }
5174
5175 fn into_channel(self) -> fidl::Channel {
5176 self.client.into_channel()
5177 }
5178
5179 fn as_channel(&self) -> &fidl::Channel {
5180 self.client.as_channel()
5181 }
5182}
5183
5184#[cfg(target_os = "fuchsia")]
5185impl RouteTableV6SynchronousProxy {
5186 pub fn new(channel: fidl::Channel) -> Self {
5187 let protocol_name = <RouteTableV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5188 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5189 }
5190
5191 pub fn into_channel(self) -> fidl::Channel {
5192 self.client.into_channel()
5193 }
5194
5195 pub fn wait_for_event(
5198 &self,
5199 deadline: zx::MonotonicInstant,
5200 ) -> Result<RouteTableV6Event, fidl::Error> {
5201 RouteTableV6Event::decode(self.client.wait_for_event(deadline)?)
5202 }
5203
5204 pub fn r#get_table_id(&self, ___deadline: zx::MonotonicInstant) -> Result<u32, fidl::Error> {
5206 let _response = self
5207 .client
5208 .send_query::<fidl::encoding::EmptyPayload, BaseRouteTableGetTableIdResponse>(
5209 (),
5210 0x7eab30c55edbfc15,
5211 fidl::encoding::DynamicFlags::empty(),
5212 ___deadline,
5213 )?;
5214 Ok(_response.table_id)
5215 }
5216
5217 pub fn r#detach(&self) -> Result<(), fidl::Error> {
5223 self.client.send::<fidl::encoding::EmptyPayload>(
5224 (),
5225 0x2853ab157285b384,
5226 fidl::encoding::DynamicFlags::empty(),
5227 )
5228 }
5229
5230 pub fn r#remove(
5236 &self,
5237 ___deadline: zx::MonotonicInstant,
5238 ) -> Result<BaseRouteTableRemoveResult, fidl::Error> {
5239 let _response =
5240 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5241 fidl::encoding::EmptyStruct,
5242 BaseRouteTableRemoveError,
5243 >>(
5244 (),
5245 0xc42e58a5fc79426,
5246 fidl::encoding::DynamicFlags::empty(),
5247 ___deadline,
5248 )?;
5249 Ok(_response.map(|x| x))
5250 }
5251
5252 pub fn r#get_authorization_for_route_table(
5263 &self,
5264 ___deadline: zx::MonotonicInstant,
5265 ) -> Result<GrantForRouteTableAuthorization, fidl::Error> {
5266 let _response = self.client.send_query::<
5267 fidl::encoding::EmptyPayload,
5268 BaseRouteTableGetAuthorizationForRouteTableResponse,
5269 >(
5270 (),
5271 0x56a48c921ff3b6eb,
5272 fidl::encoding::DynamicFlags::empty(),
5273 ___deadline,
5274 )?;
5275 Ok(_response.credential)
5276 }
5277
5278 pub fn r#new_route_set(
5282 &self,
5283 mut route_set: fidl::endpoints::ServerEnd<RouteSetV6Marker>,
5284 ) -> Result<(), fidl::Error> {
5285 self.client.send::<RouteTableV6NewRouteSetRequest>(
5286 (route_set,),
5287 0x479aeaf9ad470141,
5288 fidl::encoding::DynamicFlags::empty(),
5289 )
5290 }
5291}
5292
5293#[cfg(target_os = "fuchsia")]
5294impl From<RouteTableV6SynchronousProxy> for zx::Handle {
5295 fn from(value: RouteTableV6SynchronousProxy) -> Self {
5296 value.into_channel().into()
5297 }
5298}
5299
5300#[cfg(target_os = "fuchsia")]
5301impl From<fidl::Channel> for RouteTableV6SynchronousProxy {
5302 fn from(value: fidl::Channel) -> Self {
5303 Self::new(value)
5304 }
5305}
5306
5307#[derive(Debug, Clone)]
5308pub struct RouteTableV6Proxy {
5309 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5310}
5311
5312impl fidl::endpoints::Proxy for RouteTableV6Proxy {
5313 type Protocol = RouteTableV6Marker;
5314
5315 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5316 Self::new(inner)
5317 }
5318
5319 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5320 self.client.into_channel().map_err(|client| Self { client })
5321 }
5322
5323 fn as_channel(&self) -> &::fidl::AsyncChannel {
5324 self.client.as_channel()
5325 }
5326}
5327
5328impl RouteTableV6Proxy {
5329 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5331 let protocol_name = <RouteTableV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5332 Self { client: fidl::client::Client::new(channel, protocol_name) }
5333 }
5334
5335 pub fn take_event_stream(&self) -> RouteTableV6EventStream {
5341 RouteTableV6EventStream { event_receiver: self.client.take_event_receiver() }
5342 }
5343
5344 pub fn r#get_table_id(
5346 &self,
5347 ) -> fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect> {
5348 RouteTableV6ProxyInterface::r#get_table_id(self)
5349 }
5350
5351 pub fn r#detach(&self) -> Result<(), fidl::Error> {
5357 RouteTableV6ProxyInterface::r#detach(self)
5358 }
5359
5360 pub fn r#remove(
5366 &self,
5367 ) -> fidl::client::QueryResponseFut<
5368 BaseRouteTableRemoveResult,
5369 fidl::encoding::DefaultFuchsiaResourceDialect,
5370 > {
5371 RouteTableV6ProxyInterface::r#remove(self)
5372 }
5373
5374 pub fn r#get_authorization_for_route_table(
5385 &self,
5386 ) -> fidl::client::QueryResponseFut<
5387 GrantForRouteTableAuthorization,
5388 fidl::encoding::DefaultFuchsiaResourceDialect,
5389 > {
5390 RouteTableV6ProxyInterface::r#get_authorization_for_route_table(self)
5391 }
5392
5393 pub fn r#new_route_set(
5397 &self,
5398 mut route_set: fidl::endpoints::ServerEnd<RouteSetV6Marker>,
5399 ) -> Result<(), fidl::Error> {
5400 RouteTableV6ProxyInterface::r#new_route_set(self, route_set)
5401 }
5402}
5403
5404impl RouteTableV6ProxyInterface for RouteTableV6Proxy {
5405 type GetTableIdResponseFut =
5406 fidl::client::QueryResponseFut<u32, fidl::encoding::DefaultFuchsiaResourceDialect>;
5407 fn r#get_table_id(&self) -> Self::GetTableIdResponseFut {
5408 fn _decode(
5409 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5410 ) -> Result<u32, fidl::Error> {
5411 let _response = fidl::client::decode_transaction_body::<
5412 BaseRouteTableGetTableIdResponse,
5413 fidl::encoding::DefaultFuchsiaResourceDialect,
5414 0x7eab30c55edbfc15,
5415 >(_buf?)?;
5416 Ok(_response.table_id)
5417 }
5418 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u32>(
5419 (),
5420 0x7eab30c55edbfc15,
5421 fidl::encoding::DynamicFlags::empty(),
5422 _decode,
5423 )
5424 }
5425
5426 fn r#detach(&self) -> Result<(), fidl::Error> {
5427 self.client.send::<fidl::encoding::EmptyPayload>(
5428 (),
5429 0x2853ab157285b384,
5430 fidl::encoding::DynamicFlags::empty(),
5431 )
5432 }
5433
5434 type RemoveResponseFut = fidl::client::QueryResponseFut<
5435 BaseRouteTableRemoveResult,
5436 fidl::encoding::DefaultFuchsiaResourceDialect,
5437 >;
5438 fn r#remove(&self) -> Self::RemoveResponseFut {
5439 fn _decode(
5440 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5441 ) -> Result<BaseRouteTableRemoveResult, fidl::Error> {
5442 let _response = fidl::client::decode_transaction_body::<
5443 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BaseRouteTableRemoveError>,
5444 fidl::encoding::DefaultFuchsiaResourceDialect,
5445 0xc42e58a5fc79426,
5446 >(_buf?)?;
5447 Ok(_response.map(|x| x))
5448 }
5449 self.client
5450 .send_query_and_decode::<fidl::encoding::EmptyPayload, BaseRouteTableRemoveResult>(
5451 (),
5452 0xc42e58a5fc79426,
5453 fidl::encoding::DynamicFlags::empty(),
5454 _decode,
5455 )
5456 }
5457
5458 type GetAuthorizationForRouteTableResponseFut = fidl::client::QueryResponseFut<
5459 GrantForRouteTableAuthorization,
5460 fidl::encoding::DefaultFuchsiaResourceDialect,
5461 >;
5462 fn r#get_authorization_for_route_table(
5463 &self,
5464 ) -> Self::GetAuthorizationForRouteTableResponseFut {
5465 fn _decode(
5466 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5467 ) -> Result<GrantForRouteTableAuthorization, fidl::Error> {
5468 let _response = fidl::client::decode_transaction_body::<
5469 BaseRouteTableGetAuthorizationForRouteTableResponse,
5470 fidl::encoding::DefaultFuchsiaResourceDialect,
5471 0x56a48c921ff3b6eb,
5472 >(_buf?)?;
5473 Ok(_response.credential)
5474 }
5475 self.client
5476 .send_query_and_decode::<fidl::encoding::EmptyPayload, GrantForRouteTableAuthorization>(
5477 (),
5478 0x56a48c921ff3b6eb,
5479 fidl::encoding::DynamicFlags::empty(),
5480 _decode,
5481 )
5482 }
5483
5484 fn r#new_route_set(
5485 &self,
5486 mut route_set: fidl::endpoints::ServerEnd<RouteSetV6Marker>,
5487 ) -> Result<(), fidl::Error> {
5488 self.client.send::<RouteTableV6NewRouteSetRequest>(
5489 (route_set,),
5490 0x479aeaf9ad470141,
5491 fidl::encoding::DynamicFlags::empty(),
5492 )
5493 }
5494}
5495
5496pub struct RouteTableV6EventStream {
5497 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5498}
5499
5500impl std::marker::Unpin for RouteTableV6EventStream {}
5501
5502impl futures::stream::FusedStream for RouteTableV6EventStream {
5503 fn is_terminated(&self) -> bool {
5504 self.event_receiver.is_terminated()
5505 }
5506}
5507
5508impl futures::Stream for RouteTableV6EventStream {
5509 type Item = Result<RouteTableV6Event, fidl::Error>;
5510
5511 fn poll_next(
5512 mut self: std::pin::Pin<&mut Self>,
5513 cx: &mut std::task::Context<'_>,
5514 ) -> std::task::Poll<Option<Self::Item>> {
5515 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5516 &mut self.event_receiver,
5517 cx
5518 )?) {
5519 Some(buf) => std::task::Poll::Ready(Some(RouteTableV6Event::decode(buf))),
5520 None => std::task::Poll::Ready(None),
5521 }
5522 }
5523}
5524
5525#[derive(Debug)]
5526pub enum RouteTableV6Event {}
5527
5528impl RouteTableV6Event {
5529 fn decode(
5531 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5532 ) -> Result<RouteTableV6Event, fidl::Error> {
5533 let (bytes, _handles) = buf.split_mut();
5534 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5535 debug_assert_eq!(tx_header.tx_id, 0);
5536 match tx_header.ordinal {
5537 _ => Err(fidl::Error::UnknownOrdinal {
5538 ordinal: tx_header.ordinal,
5539 protocol_name: <RouteTableV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5540 }),
5541 }
5542 }
5543}
5544
5545pub struct RouteTableV6RequestStream {
5547 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5548 is_terminated: bool,
5549}
5550
5551impl std::marker::Unpin for RouteTableV6RequestStream {}
5552
5553impl futures::stream::FusedStream for RouteTableV6RequestStream {
5554 fn is_terminated(&self) -> bool {
5555 self.is_terminated
5556 }
5557}
5558
5559impl fidl::endpoints::RequestStream for RouteTableV6RequestStream {
5560 type Protocol = RouteTableV6Marker;
5561 type ControlHandle = RouteTableV6ControlHandle;
5562
5563 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5564 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5565 }
5566
5567 fn control_handle(&self) -> Self::ControlHandle {
5568 RouteTableV6ControlHandle { inner: self.inner.clone() }
5569 }
5570
5571 fn into_inner(
5572 self,
5573 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5574 {
5575 (self.inner, self.is_terminated)
5576 }
5577
5578 fn from_inner(
5579 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5580 is_terminated: bool,
5581 ) -> Self {
5582 Self { inner, is_terminated }
5583 }
5584}
5585
5586impl futures::Stream for RouteTableV6RequestStream {
5587 type Item = Result<RouteTableV6Request, fidl::Error>;
5588
5589 fn poll_next(
5590 mut self: std::pin::Pin<&mut Self>,
5591 cx: &mut std::task::Context<'_>,
5592 ) -> std::task::Poll<Option<Self::Item>> {
5593 let this = &mut *self;
5594 if this.inner.check_shutdown(cx) {
5595 this.is_terminated = true;
5596 return std::task::Poll::Ready(None);
5597 }
5598 if this.is_terminated {
5599 panic!("polled RouteTableV6RequestStream after completion");
5600 }
5601 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5602 |bytes, handles| {
5603 match this.inner.channel().read_etc(cx, bytes, handles) {
5604 std::task::Poll::Ready(Ok(())) => {}
5605 std::task::Poll::Pending => return std::task::Poll::Pending,
5606 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5607 this.is_terminated = true;
5608 return std::task::Poll::Ready(None);
5609 }
5610 std::task::Poll::Ready(Err(e)) => {
5611 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5612 e.into(),
5613 ))))
5614 }
5615 }
5616
5617 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5619
5620 std::task::Poll::Ready(Some(match header.ordinal {
5621 0x7eab30c55edbfc15 => {
5622 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5623 let mut req = fidl::new_empty!(
5624 fidl::encoding::EmptyPayload,
5625 fidl::encoding::DefaultFuchsiaResourceDialect
5626 );
5627 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5628 let control_handle =
5629 RouteTableV6ControlHandle { inner: this.inner.clone() };
5630 Ok(RouteTableV6Request::GetTableId {
5631 responder: RouteTableV6GetTableIdResponder {
5632 control_handle: std::mem::ManuallyDrop::new(control_handle),
5633 tx_id: header.tx_id,
5634 },
5635 })
5636 }
5637 0x2853ab157285b384 => {
5638 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5639 let mut req = fidl::new_empty!(
5640 fidl::encoding::EmptyPayload,
5641 fidl::encoding::DefaultFuchsiaResourceDialect
5642 );
5643 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5644 let control_handle =
5645 RouteTableV6ControlHandle { inner: this.inner.clone() };
5646 Ok(RouteTableV6Request::Detach { control_handle })
5647 }
5648 0xc42e58a5fc79426 => {
5649 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5650 let mut req = fidl::new_empty!(
5651 fidl::encoding::EmptyPayload,
5652 fidl::encoding::DefaultFuchsiaResourceDialect
5653 );
5654 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5655 let control_handle =
5656 RouteTableV6ControlHandle { inner: this.inner.clone() };
5657 Ok(RouteTableV6Request::Remove {
5658 responder: RouteTableV6RemoveResponder {
5659 control_handle: std::mem::ManuallyDrop::new(control_handle),
5660 tx_id: header.tx_id,
5661 },
5662 })
5663 }
5664 0x56a48c921ff3b6eb => {
5665 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5666 let mut req = fidl::new_empty!(
5667 fidl::encoding::EmptyPayload,
5668 fidl::encoding::DefaultFuchsiaResourceDialect
5669 );
5670 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5671 let control_handle =
5672 RouteTableV6ControlHandle { inner: this.inner.clone() };
5673 Ok(RouteTableV6Request::GetAuthorizationForRouteTable {
5674 responder: RouteTableV6GetAuthorizationForRouteTableResponder {
5675 control_handle: std::mem::ManuallyDrop::new(control_handle),
5676 tx_id: header.tx_id,
5677 },
5678 })
5679 }
5680 0x479aeaf9ad470141 => {
5681 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5682 let mut req = fidl::new_empty!(
5683 RouteTableV6NewRouteSetRequest,
5684 fidl::encoding::DefaultFuchsiaResourceDialect
5685 );
5686 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteTableV6NewRouteSetRequest>(&header, _body_bytes, handles, &mut req)?;
5687 let control_handle =
5688 RouteTableV6ControlHandle { inner: this.inner.clone() };
5689 Ok(RouteTableV6Request::NewRouteSet {
5690 route_set: req.route_set,
5691
5692 control_handle,
5693 })
5694 }
5695 _ => Err(fidl::Error::UnknownOrdinal {
5696 ordinal: header.ordinal,
5697 protocol_name:
5698 <RouteTableV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5699 }),
5700 }))
5701 },
5702 )
5703 }
5704}
5705
5706#[derive(Debug)]
5715pub enum RouteTableV6Request {
5716 GetTableId { responder: RouteTableV6GetTableIdResponder },
5718 Detach { control_handle: RouteTableV6ControlHandle },
5724 Remove { responder: RouteTableV6RemoveResponder },
5730 GetAuthorizationForRouteTable { responder: RouteTableV6GetAuthorizationForRouteTableResponder },
5741 NewRouteSet {
5745 route_set: fidl::endpoints::ServerEnd<RouteSetV6Marker>,
5746 control_handle: RouteTableV6ControlHandle,
5747 },
5748}
5749
5750impl RouteTableV6Request {
5751 #[allow(irrefutable_let_patterns)]
5752 pub fn into_get_table_id(self) -> Option<(RouteTableV6GetTableIdResponder)> {
5753 if let RouteTableV6Request::GetTableId { responder } = self {
5754 Some((responder))
5755 } else {
5756 None
5757 }
5758 }
5759
5760 #[allow(irrefutable_let_patterns)]
5761 pub fn into_detach(self) -> Option<(RouteTableV6ControlHandle)> {
5762 if let RouteTableV6Request::Detach { control_handle } = self {
5763 Some((control_handle))
5764 } else {
5765 None
5766 }
5767 }
5768
5769 #[allow(irrefutable_let_patterns)]
5770 pub fn into_remove(self) -> Option<(RouteTableV6RemoveResponder)> {
5771 if let RouteTableV6Request::Remove { responder } = self {
5772 Some((responder))
5773 } else {
5774 None
5775 }
5776 }
5777
5778 #[allow(irrefutable_let_patterns)]
5779 pub fn into_get_authorization_for_route_table(
5780 self,
5781 ) -> Option<(RouteTableV6GetAuthorizationForRouteTableResponder)> {
5782 if let RouteTableV6Request::GetAuthorizationForRouteTable { responder } = self {
5783 Some((responder))
5784 } else {
5785 None
5786 }
5787 }
5788
5789 #[allow(irrefutable_let_patterns)]
5790 pub fn into_new_route_set(
5791 self,
5792 ) -> Option<(fidl::endpoints::ServerEnd<RouteSetV6Marker>, RouteTableV6ControlHandle)> {
5793 if let RouteTableV6Request::NewRouteSet { route_set, control_handle } = self {
5794 Some((route_set, control_handle))
5795 } else {
5796 None
5797 }
5798 }
5799
5800 pub fn method_name(&self) -> &'static str {
5802 match *self {
5803 RouteTableV6Request::GetTableId { .. } => "get_table_id",
5804 RouteTableV6Request::Detach { .. } => "detach",
5805 RouteTableV6Request::Remove { .. } => "remove",
5806 RouteTableV6Request::GetAuthorizationForRouteTable { .. } => {
5807 "get_authorization_for_route_table"
5808 }
5809 RouteTableV6Request::NewRouteSet { .. } => "new_route_set",
5810 }
5811 }
5812}
5813
5814#[derive(Debug, Clone)]
5815pub struct RouteTableV6ControlHandle {
5816 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5817}
5818
5819impl fidl::endpoints::ControlHandle for RouteTableV6ControlHandle {
5820 fn shutdown(&self) {
5821 self.inner.shutdown()
5822 }
5823 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5824 self.inner.shutdown_with_epitaph(status)
5825 }
5826
5827 fn is_closed(&self) -> bool {
5828 self.inner.channel().is_closed()
5829 }
5830 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5831 self.inner.channel().on_closed()
5832 }
5833
5834 #[cfg(target_os = "fuchsia")]
5835 fn signal_peer(
5836 &self,
5837 clear_mask: zx::Signals,
5838 set_mask: zx::Signals,
5839 ) -> Result<(), zx_status::Status> {
5840 use fidl::Peered;
5841 self.inner.channel().signal_peer(clear_mask, set_mask)
5842 }
5843}
5844
5845impl RouteTableV6ControlHandle {}
5846
5847#[must_use = "FIDL methods require a response to be sent"]
5848#[derive(Debug)]
5849pub struct RouteTableV6GetTableIdResponder {
5850 control_handle: std::mem::ManuallyDrop<RouteTableV6ControlHandle>,
5851 tx_id: u32,
5852}
5853
5854impl std::ops::Drop for RouteTableV6GetTableIdResponder {
5858 fn drop(&mut self) {
5859 self.control_handle.shutdown();
5860 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5862 }
5863}
5864
5865impl fidl::endpoints::Responder for RouteTableV6GetTableIdResponder {
5866 type ControlHandle = RouteTableV6ControlHandle;
5867
5868 fn control_handle(&self) -> &RouteTableV6ControlHandle {
5869 &self.control_handle
5870 }
5871
5872 fn drop_without_shutdown(mut self) {
5873 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5875 std::mem::forget(self);
5877 }
5878}
5879
5880impl RouteTableV6GetTableIdResponder {
5881 pub fn send(self, mut table_id: u32) -> Result<(), fidl::Error> {
5885 let _result = self.send_raw(table_id);
5886 if _result.is_err() {
5887 self.control_handle.shutdown();
5888 }
5889 self.drop_without_shutdown();
5890 _result
5891 }
5892
5893 pub fn send_no_shutdown_on_err(self, mut table_id: u32) -> Result<(), fidl::Error> {
5895 let _result = self.send_raw(table_id);
5896 self.drop_without_shutdown();
5897 _result
5898 }
5899
5900 fn send_raw(&self, mut table_id: u32) -> Result<(), fidl::Error> {
5901 self.control_handle.inner.send::<BaseRouteTableGetTableIdResponse>(
5902 (table_id,),
5903 self.tx_id,
5904 0x7eab30c55edbfc15,
5905 fidl::encoding::DynamicFlags::empty(),
5906 )
5907 }
5908}
5909
5910#[must_use = "FIDL methods require a response to be sent"]
5911#[derive(Debug)]
5912pub struct RouteTableV6RemoveResponder {
5913 control_handle: std::mem::ManuallyDrop<RouteTableV6ControlHandle>,
5914 tx_id: u32,
5915}
5916
5917impl std::ops::Drop for RouteTableV6RemoveResponder {
5921 fn drop(&mut self) {
5922 self.control_handle.shutdown();
5923 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5925 }
5926}
5927
5928impl fidl::endpoints::Responder for RouteTableV6RemoveResponder {
5929 type ControlHandle = RouteTableV6ControlHandle;
5930
5931 fn control_handle(&self) -> &RouteTableV6ControlHandle {
5932 &self.control_handle
5933 }
5934
5935 fn drop_without_shutdown(mut self) {
5936 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5938 std::mem::forget(self);
5940 }
5941}
5942
5943impl RouteTableV6RemoveResponder {
5944 pub fn send(
5948 self,
5949 mut result: Result<(), BaseRouteTableRemoveError>,
5950 ) -> Result<(), fidl::Error> {
5951 let _result = self.send_raw(result);
5952 if _result.is_err() {
5953 self.control_handle.shutdown();
5954 }
5955 self.drop_without_shutdown();
5956 _result
5957 }
5958
5959 pub fn send_no_shutdown_on_err(
5961 self,
5962 mut result: Result<(), BaseRouteTableRemoveError>,
5963 ) -> Result<(), fidl::Error> {
5964 let _result = self.send_raw(result);
5965 self.drop_without_shutdown();
5966 _result
5967 }
5968
5969 fn send_raw(
5970 &self,
5971 mut result: Result<(), BaseRouteTableRemoveError>,
5972 ) -> Result<(), fidl::Error> {
5973 self.control_handle.inner.send::<fidl::encoding::ResultType<
5974 fidl::encoding::EmptyStruct,
5975 BaseRouteTableRemoveError,
5976 >>(
5977 result,
5978 self.tx_id,
5979 0xc42e58a5fc79426,
5980 fidl::encoding::DynamicFlags::empty(),
5981 )
5982 }
5983}
5984
5985#[must_use = "FIDL methods require a response to be sent"]
5986#[derive(Debug)]
5987pub struct RouteTableV6GetAuthorizationForRouteTableResponder {
5988 control_handle: std::mem::ManuallyDrop<RouteTableV6ControlHandle>,
5989 tx_id: u32,
5990}
5991
5992impl std::ops::Drop for RouteTableV6GetAuthorizationForRouteTableResponder {
5996 fn drop(&mut self) {
5997 self.control_handle.shutdown();
5998 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6000 }
6001}
6002
6003impl fidl::endpoints::Responder for RouteTableV6GetAuthorizationForRouteTableResponder {
6004 type ControlHandle = RouteTableV6ControlHandle;
6005
6006 fn control_handle(&self) -> &RouteTableV6ControlHandle {
6007 &self.control_handle
6008 }
6009
6010 fn drop_without_shutdown(mut self) {
6011 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6013 std::mem::forget(self);
6015 }
6016}
6017
6018impl RouteTableV6GetAuthorizationForRouteTableResponder {
6019 pub fn send(self, mut credential: GrantForRouteTableAuthorization) -> Result<(), fidl::Error> {
6023 let _result = self.send_raw(credential);
6024 if _result.is_err() {
6025 self.control_handle.shutdown();
6026 }
6027 self.drop_without_shutdown();
6028 _result
6029 }
6030
6031 pub fn send_no_shutdown_on_err(
6033 self,
6034 mut credential: GrantForRouteTableAuthorization,
6035 ) -> Result<(), fidl::Error> {
6036 let _result = self.send_raw(credential);
6037 self.drop_without_shutdown();
6038 _result
6039 }
6040
6041 fn send_raw(&self, mut credential: GrantForRouteTableAuthorization) -> Result<(), fidl::Error> {
6042 self.control_handle.inner.send::<BaseRouteTableGetAuthorizationForRouteTableResponse>(
6043 (&mut credential,),
6044 self.tx_id,
6045 0x56a48c921ff3b6eb,
6046 fidl::encoding::DynamicFlags::empty(),
6047 )
6048 }
6049}
6050
6051#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6052pub struct RuleSetV4Marker;
6053
6054impl fidl::endpoints::ProtocolMarker for RuleSetV4Marker {
6055 type Proxy = RuleSetV4Proxy;
6056 type RequestStream = RuleSetV4RequestStream;
6057 #[cfg(target_os = "fuchsia")]
6058 type SynchronousProxy = RuleSetV4SynchronousProxy;
6059
6060 const DEBUG_NAME: &'static str = "(anonymous) RuleSetV4";
6061}
6062pub type RuleSetV4AddRuleResult = Result<(), RuleSetError>;
6063
6064pub trait RuleSetV4ProxyInterface: Send + Sync {
6065 type AuthenticateForRouteTableResponseFut: std::future::Future<
6066 Output = Result<BaseRuleSetAuthenticateForRouteTableResult, fidl::Error>,
6067 > + Send;
6068 fn r#authenticate_for_route_table(
6069 &self,
6070 table: u32,
6071 token: fidl::Event,
6072 ) -> Self::AuthenticateForRouteTableResponseFut;
6073 type RemoveRuleResponseFut: std::future::Future<Output = Result<BaseRuleSetRemoveRuleResult, fidl::Error>>
6074 + Send;
6075 fn r#remove_rule(&self, index: u32) -> Self::RemoveRuleResponseFut;
6076 fn r#close(&self) -> Result<(), fidl::Error>;
6077 type AddRuleResponseFut: std::future::Future<Output = Result<RuleSetV4AddRuleResult, fidl::Error>>
6078 + Send;
6079 fn r#add_rule(
6080 &self,
6081 index: u32,
6082 matcher: &fidl_fuchsia_net_routes::RuleMatcherV4,
6083 action: &fidl_fuchsia_net_routes::RuleAction,
6084 ) -> Self::AddRuleResponseFut;
6085}
6086#[derive(Debug)]
6087#[cfg(target_os = "fuchsia")]
6088pub struct RuleSetV4SynchronousProxy {
6089 client: fidl::client::sync::Client,
6090}
6091
6092#[cfg(target_os = "fuchsia")]
6093impl fidl::endpoints::SynchronousProxy for RuleSetV4SynchronousProxy {
6094 type Proxy = RuleSetV4Proxy;
6095 type Protocol = RuleSetV4Marker;
6096
6097 fn from_channel(inner: fidl::Channel) -> Self {
6098 Self::new(inner)
6099 }
6100
6101 fn into_channel(self) -> fidl::Channel {
6102 self.client.into_channel()
6103 }
6104
6105 fn as_channel(&self) -> &fidl::Channel {
6106 self.client.as_channel()
6107 }
6108}
6109
6110#[cfg(target_os = "fuchsia")]
6111impl RuleSetV4SynchronousProxy {
6112 pub fn new(channel: fidl::Channel) -> Self {
6113 let protocol_name = <RuleSetV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6114 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6115 }
6116
6117 pub fn into_channel(self) -> fidl::Channel {
6118 self.client.into_channel()
6119 }
6120
6121 pub fn wait_for_event(
6124 &self,
6125 deadline: zx::MonotonicInstant,
6126 ) -> Result<RuleSetV4Event, fidl::Error> {
6127 RuleSetV4Event::decode(self.client.wait_for_event(deadline)?)
6128 }
6129
6130 pub fn r#authenticate_for_route_table(
6132 &self,
6133 mut table: u32,
6134 mut token: fidl::Event,
6135 ___deadline: zx::MonotonicInstant,
6136 ) -> Result<BaseRuleSetAuthenticateForRouteTableResult, fidl::Error> {
6137 let _response =
6138 self.client.send_query::<ProofOfRouteTableAuthorization, fidl::encoding::ResultType<
6139 fidl::encoding::EmptyStruct,
6140 AuthenticateForRouteTableError,
6141 >>(
6142 (table, token),
6143 0x6fd845360ed9bc8f,
6144 fidl::encoding::DynamicFlags::empty(),
6145 ___deadline,
6146 )?;
6147 Ok(_response.map(|x| x))
6148 }
6149
6150 pub fn r#remove_rule(
6157 &self,
6158 mut index: u32,
6159 ___deadline: zx::MonotonicInstant,
6160 ) -> Result<BaseRuleSetRemoveRuleResult, fidl::Error> {
6161 let _response = self.client.send_query::<
6162 BaseRuleSetRemoveRuleRequest,
6163 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
6164 >(
6165 (index,),
6166 0x2ae3d7e817cbff90,
6167 fidl::encoding::DynamicFlags::empty(),
6168 ___deadline,
6169 )?;
6170 Ok(_response.map(|x| x))
6171 }
6172
6173 pub fn r#close(&self) -> Result<(), fidl::Error> {
6178 self.client.send::<fidl::encoding::EmptyPayload>(
6179 (),
6180 0x457e1753672d4073,
6181 fidl::encoding::DynamicFlags::empty(),
6182 )
6183 }
6184
6185 pub fn r#add_rule(
6194 &self,
6195 mut index: u32,
6196 mut matcher: &fidl_fuchsia_net_routes::RuleMatcherV4,
6197 mut action: &fidl_fuchsia_net_routes::RuleAction,
6198 ___deadline: zx::MonotonicInstant,
6199 ) -> Result<RuleSetV4AddRuleResult, fidl::Error> {
6200 let _response = self.client.send_query::<
6201 RuleSetV4AddRuleRequest,
6202 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
6203 >(
6204 (index, matcher, action,),
6205 0x7f68325de94e80,
6206 fidl::encoding::DynamicFlags::empty(),
6207 ___deadline,
6208 )?;
6209 Ok(_response.map(|x| x))
6210 }
6211}
6212
6213#[cfg(target_os = "fuchsia")]
6214impl From<RuleSetV4SynchronousProxy> for zx::Handle {
6215 fn from(value: RuleSetV4SynchronousProxy) -> Self {
6216 value.into_channel().into()
6217 }
6218}
6219
6220#[cfg(target_os = "fuchsia")]
6221impl From<fidl::Channel> for RuleSetV4SynchronousProxy {
6222 fn from(value: fidl::Channel) -> Self {
6223 Self::new(value)
6224 }
6225}
6226
6227#[derive(Debug, Clone)]
6228pub struct RuleSetV4Proxy {
6229 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6230}
6231
6232impl fidl::endpoints::Proxy for RuleSetV4Proxy {
6233 type Protocol = RuleSetV4Marker;
6234
6235 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6236 Self::new(inner)
6237 }
6238
6239 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6240 self.client.into_channel().map_err(|client| Self { client })
6241 }
6242
6243 fn as_channel(&self) -> &::fidl::AsyncChannel {
6244 self.client.as_channel()
6245 }
6246}
6247
6248impl RuleSetV4Proxy {
6249 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6251 let protocol_name = <RuleSetV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6252 Self { client: fidl::client::Client::new(channel, protocol_name) }
6253 }
6254
6255 pub fn take_event_stream(&self) -> RuleSetV4EventStream {
6261 RuleSetV4EventStream { event_receiver: self.client.take_event_receiver() }
6262 }
6263
6264 pub fn r#authenticate_for_route_table(
6266 &self,
6267 mut table: u32,
6268 mut token: fidl::Event,
6269 ) -> fidl::client::QueryResponseFut<
6270 BaseRuleSetAuthenticateForRouteTableResult,
6271 fidl::encoding::DefaultFuchsiaResourceDialect,
6272 > {
6273 RuleSetV4ProxyInterface::r#authenticate_for_route_table(self, table, token)
6274 }
6275
6276 pub fn r#remove_rule(
6283 &self,
6284 mut index: u32,
6285 ) -> fidl::client::QueryResponseFut<
6286 BaseRuleSetRemoveRuleResult,
6287 fidl::encoding::DefaultFuchsiaResourceDialect,
6288 > {
6289 RuleSetV4ProxyInterface::r#remove_rule(self, index)
6290 }
6291
6292 pub fn r#close(&self) -> Result<(), fidl::Error> {
6297 RuleSetV4ProxyInterface::r#close(self)
6298 }
6299
6300 pub fn r#add_rule(
6309 &self,
6310 mut index: u32,
6311 mut matcher: &fidl_fuchsia_net_routes::RuleMatcherV4,
6312 mut action: &fidl_fuchsia_net_routes::RuleAction,
6313 ) -> fidl::client::QueryResponseFut<
6314 RuleSetV4AddRuleResult,
6315 fidl::encoding::DefaultFuchsiaResourceDialect,
6316 > {
6317 RuleSetV4ProxyInterface::r#add_rule(self, index, matcher, action)
6318 }
6319}
6320
6321impl RuleSetV4ProxyInterface for RuleSetV4Proxy {
6322 type AuthenticateForRouteTableResponseFut = fidl::client::QueryResponseFut<
6323 BaseRuleSetAuthenticateForRouteTableResult,
6324 fidl::encoding::DefaultFuchsiaResourceDialect,
6325 >;
6326 fn r#authenticate_for_route_table(
6327 &self,
6328 mut table: u32,
6329 mut token: fidl::Event,
6330 ) -> Self::AuthenticateForRouteTableResponseFut {
6331 fn _decode(
6332 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6333 ) -> Result<BaseRuleSetAuthenticateForRouteTableResult, fidl::Error> {
6334 let _response = fidl::client::decode_transaction_body::<
6335 fidl::encoding::ResultType<
6336 fidl::encoding::EmptyStruct,
6337 AuthenticateForRouteTableError,
6338 >,
6339 fidl::encoding::DefaultFuchsiaResourceDialect,
6340 0x6fd845360ed9bc8f,
6341 >(_buf?)?;
6342 Ok(_response.map(|x| x))
6343 }
6344 self.client.send_query_and_decode::<
6345 ProofOfRouteTableAuthorization,
6346 BaseRuleSetAuthenticateForRouteTableResult,
6347 >(
6348 (table, token,),
6349 0x6fd845360ed9bc8f,
6350 fidl::encoding::DynamicFlags::empty(),
6351 _decode,
6352 )
6353 }
6354
6355 type RemoveRuleResponseFut = fidl::client::QueryResponseFut<
6356 BaseRuleSetRemoveRuleResult,
6357 fidl::encoding::DefaultFuchsiaResourceDialect,
6358 >;
6359 fn r#remove_rule(&self, mut index: u32) -> Self::RemoveRuleResponseFut {
6360 fn _decode(
6361 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6362 ) -> Result<BaseRuleSetRemoveRuleResult, fidl::Error> {
6363 let _response = fidl::client::decode_transaction_body::<
6364 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
6365 fidl::encoding::DefaultFuchsiaResourceDialect,
6366 0x2ae3d7e817cbff90,
6367 >(_buf?)?;
6368 Ok(_response.map(|x| x))
6369 }
6370 self.client
6371 .send_query_and_decode::<BaseRuleSetRemoveRuleRequest, BaseRuleSetRemoveRuleResult>(
6372 (index,),
6373 0x2ae3d7e817cbff90,
6374 fidl::encoding::DynamicFlags::empty(),
6375 _decode,
6376 )
6377 }
6378
6379 fn r#close(&self) -> Result<(), fidl::Error> {
6380 self.client.send::<fidl::encoding::EmptyPayload>(
6381 (),
6382 0x457e1753672d4073,
6383 fidl::encoding::DynamicFlags::empty(),
6384 )
6385 }
6386
6387 type AddRuleResponseFut = fidl::client::QueryResponseFut<
6388 RuleSetV4AddRuleResult,
6389 fidl::encoding::DefaultFuchsiaResourceDialect,
6390 >;
6391 fn r#add_rule(
6392 &self,
6393 mut index: u32,
6394 mut matcher: &fidl_fuchsia_net_routes::RuleMatcherV4,
6395 mut action: &fidl_fuchsia_net_routes::RuleAction,
6396 ) -> Self::AddRuleResponseFut {
6397 fn _decode(
6398 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6399 ) -> Result<RuleSetV4AddRuleResult, fidl::Error> {
6400 let _response = fidl::client::decode_transaction_body::<
6401 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
6402 fidl::encoding::DefaultFuchsiaResourceDialect,
6403 0x7f68325de94e80,
6404 >(_buf?)?;
6405 Ok(_response.map(|x| x))
6406 }
6407 self.client.send_query_and_decode::<RuleSetV4AddRuleRequest, RuleSetV4AddRuleResult>(
6408 (index, matcher, action),
6409 0x7f68325de94e80,
6410 fidl::encoding::DynamicFlags::empty(),
6411 _decode,
6412 )
6413 }
6414}
6415
6416pub struct RuleSetV4EventStream {
6417 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6418}
6419
6420impl std::marker::Unpin for RuleSetV4EventStream {}
6421
6422impl futures::stream::FusedStream for RuleSetV4EventStream {
6423 fn is_terminated(&self) -> bool {
6424 self.event_receiver.is_terminated()
6425 }
6426}
6427
6428impl futures::Stream for RuleSetV4EventStream {
6429 type Item = Result<RuleSetV4Event, fidl::Error>;
6430
6431 fn poll_next(
6432 mut self: std::pin::Pin<&mut Self>,
6433 cx: &mut std::task::Context<'_>,
6434 ) -> std::task::Poll<Option<Self::Item>> {
6435 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6436 &mut self.event_receiver,
6437 cx
6438 )?) {
6439 Some(buf) => std::task::Poll::Ready(Some(RuleSetV4Event::decode(buf))),
6440 None => std::task::Poll::Ready(None),
6441 }
6442 }
6443}
6444
6445#[derive(Debug)]
6446pub enum RuleSetV4Event {}
6447
6448impl RuleSetV4Event {
6449 fn decode(
6451 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6452 ) -> Result<RuleSetV4Event, fidl::Error> {
6453 let (bytes, _handles) = buf.split_mut();
6454 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6455 debug_assert_eq!(tx_header.tx_id, 0);
6456 match tx_header.ordinal {
6457 _ => Err(fidl::Error::UnknownOrdinal {
6458 ordinal: tx_header.ordinal,
6459 protocol_name: <RuleSetV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6460 }),
6461 }
6462 }
6463}
6464
6465pub struct RuleSetV4RequestStream {
6467 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6468 is_terminated: bool,
6469}
6470
6471impl std::marker::Unpin for RuleSetV4RequestStream {}
6472
6473impl futures::stream::FusedStream for RuleSetV4RequestStream {
6474 fn is_terminated(&self) -> bool {
6475 self.is_terminated
6476 }
6477}
6478
6479impl fidl::endpoints::RequestStream for RuleSetV4RequestStream {
6480 type Protocol = RuleSetV4Marker;
6481 type ControlHandle = RuleSetV4ControlHandle;
6482
6483 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6484 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6485 }
6486
6487 fn control_handle(&self) -> Self::ControlHandle {
6488 RuleSetV4ControlHandle { inner: self.inner.clone() }
6489 }
6490
6491 fn into_inner(
6492 self,
6493 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6494 {
6495 (self.inner, self.is_terminated)
6496 }
6497
6498 fn from_inner(
6499 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6500 is_terminated: bool,
6501 ) -> Self {
6502 Self { inner, is_terminated }
6503 }
6504}
6505
6506impl futures::Stream for RuleSetV4RequestStream {
6507 type Item = Result<RuleSetV4Request, fidl::Error>;
6508
6509 fn poll_next(
6510 mut self: std::pin::Pin<&mut Self>,
6511 cx: &mut std::task::Context<'_>,
6512 ) -> std::task::Poll<Option<Self::Item>> {
6513 let this = &mut *self;
6514 if this.inner.check_shutdown(cx) {
6515 this.is_terminated = true;
6516 return std::task::Poll::Ready(None);
6517 }
6518 if this.is_terminated {
6519 panic!("polled RuleSetV4RequestStream after completion");
6520 }
6521 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6522 |bytes, handles| {
6523 match this.inner.channel().read_etc(cx, bytes, handles) {
6524 std::task::Poll::Ready(Ok(())) => {}
6525 std::task::Poll::Pending => return std::task::Poll::Pending,
6526 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6527 this.is_terminated = true;
6528 return std::task::Poll::Ready(None);
6529 }
6530 std::task::Poll::Ready(Err(e)) => {
6531 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6532 e.into(),
6533 ))))
6534 }
6535 }
6536
6537 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6539
6540 std::task::Poll::Ready(Some(match header.ordinal {
6541 0x6fd845360ed9bc8f => {
6542 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6543 let mut req = fidl::new_empty!(
6544 ProofOfRouteTableAuthorization,
6545 fidl::encoding::DefaultFuchsiaResourceDialect
6546 );
6547 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProofOfRouteTableAuthorization>(&header, _body_bytes, handles, &mut req)?;
6548 let control_handle = RuleSetV4ControlHandle { inner: this.inner.clone() };
6549 Ok(RuleSetV4Request::AuthenticateForRouteTable {
6550 table: req.table,
6551 token: req.token,
6552
6553 responder: RuleSetV4AuthenticateForRouteTableResponder {
6554 control_handle: std::mem::ManuallyDrop::new(control_handle),
6555 tx_id: header.tx_id,
6556 },
6557 })
6558 }
6559 0x2ae3d7e817cbff90 => {
6560 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6561 let mut req = fidl::new_empty!(
6562 BaseRuleSetRemoveRuleRequest,
6563 fidl::encoding::DefaultFuchsiaResourceDialect
6564 );
6565 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BaseRuleSetRemoveRuleRequest>(&header, _body_bytes, handles, &mut req)?;
6566 let control_handle = RuleSetV4ControlHandle { inner: this.inner.clone() };
6567 Ok(RuleSetV4Request::RemoveRule {
6568 index: req.index,
6569
6570 responder: RuleSetV4RemoveRuleResponder {
6571 control_handle: std::mem::ManuallyDrop::new(control_handle),
6572 tx_id: header.tx_id,
6573 },
6574 })
6575 }
6576 0x457e1753672d4073 => {
6577 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
6578 let mut req = fidl::new_empty!(
6579 fidl::encoding::EmptyPayload,
6580 fidl::encoding::DefaultFuchsiaResourceDialect
6581 );
6582 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6583 let control_handle = RuleSetV4ControlHandle { inner: this.inner.clone() };
6584 Ok(RuleSetV4Request::Close { control_handle })
6585 }
6586 0x7f68325de94e80 => {
6587 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6588 let mut req = fidl::new_empty!(
6589 RuleSetV4AddRuleRequest,
6590 fidl::encoding::DefaultFuchsiaResourceDialect
6591 );
6592 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RuleSetV4AddRuleRequest>(&header, _body_bytes, handles, &mut req)?;
6593 let control_handle = RuleSetV4ControlHandle { inner: this.inner.clone() };
6594 Ok(RuleSetV4Request::AddRule {
6595 index: req.index,
6596 matcher: req.matcher,
6597 action: req.action,
6598
6599 responder: RuleSetV4AddRuleResponder {
6600 control_handle: std::mem::ManuallyDrop::new(control_handle),
6601 tx_id: header.tx_id,
6602 },
6603 })
6604 }
6605 _ => Err(fidl::Error::UnknownOrdinal {
6606 ordinal: header.ordinal,
6607 protocol_name:
6608 <RuleSetV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6609 }),
6610 }))
6611 },
6612 )
6613 }
6614}
6615
6616#[derive(Debug)]
6625pub enum RuleSetV4Request {
6626 AuthenticateForRouteTable {
6628 table: u32,
6629 token: fidl::Event,
6630 responder: RuleSetV4AuthenticateForRouteTableResponder,
6631 },
6632 RemoveRule { index: u32, responder: RuleSetV4RemoveRuleResponder },
6639 Close { control_handle: RuleSetV4ControlHandle },
6644 AddRule {
6653 index: u32,
6654 matcher: fidl_fuchsia_net_routes::RuleMatcherV4,
6655 action: fidl_fuchsia_net_routes::RuleAction,
6656 responder: RuleSetV4AddRuleResponder,
6657 },
6658}
6659
6660impl RuleSetV4Request {
6661 #[allow(irrefutable_let_patterns)]
6662 pub fn into_authenticate_for_route_table(
6663 self,
6664 ) -> Option<(u32, fidl::Event, RuleSetV4AuthenticateForRouteTableResponder)> {
6665 if let RuleSetV4Request::AuthenticateForRouteTable { table, token, responder } = self {
6666 Some((table, token, responder))
6667 } else {
6668 None
6669 }
6670 }
6671
6672 #[allow(irrefutable_let_patterns)]
6673 pub fn into_remove_rule(self) -> Option<(u32, RuleSetV4RemoveRuleResponder)> {
6674 if let RuleSetV4Request::RemoveRule { index, responder } = self {
6675 Some((index, responder))
6676 } else {
6677 None
6678 }
6679 }
6680
6681 #[allow(irrefutable_let_patterns)]
6682 pub fn into_close(self) -> Option<(RuleSetV4ControlHandle)> {
6683 if let RuleSetV4Request::Close { control_handle } = self {
6684 Some((control_handle))
6685 } else {
6686 None
6687 }
6688 }
6689
6690 #[allow(irrefutable_let_patterns)]
6691 pub fn into_add_rule(
6692 self,
6693 ) -> Option<(
6694 u32,
6695 fidl_fuchsia_net_routes::RuleMatcherV4,
6696 fidl_fuchsia_net_routes::RuleAction,
6697 RuleSetV4AddRuleResponder,
6698 )> {
6699 if let RuleSetV4Request::AddRule { index, matcher, action, responder } = self {
6700 Some((index, matcher, action, responder))
6701 } else {
6702 None
6703 }
6704 }
6705
6706 pub fn method_name(&self) -> &'static str {
6708 match *self {
6709 RuleSetV4Request::AuthenticateForRouteTable { .. } => "authenticate_for_route_table",
6710 RuleSetV4Request::RemoveRule { .. } => "remove_rule",
6711 RuleSetV4Request::Close { .. } => "close",
6712 RuleSetV4Request::AddRule { .. } => "add_rule",
6713 }
6714 }
6715}
6716
6717#[derive(Debug, Clone)]
6718pub struct RuleSetV4ControlHandle {
6719 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6720}
6721
6722impl fidl::endpoints::ControlHandle for RuleSetV4ControlHandle {
6723 fn shutdown(&self) {
6724 self.inner.shutdown()
6725 }
6726 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6727 self.inner.shutdown_with_epitaph(status)
6728 }
6729
6730 fn is_closed(&self) -> bool {
6731 self.inner.channel().is_closed()
6732 }
6733 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6734 self.inner.channel().on_closed()
6735 }
6736
6737 #[cfg(target_os = "fuchsia")]
6738 fn signal_peer(
6739 &self,
6740 clear_mask: zx::Signals,
6741 set_mask: zx::Signals,
6742 ) -> Result<(), zx_status::Status> {
6743 use fidl::Peered;
6744 self.inner.channel().signal_peer(clear_mask, set_mask)
6745 }
6746}
6747
6748impl RuleSetV4ControlHandle {}
6749
6750#[must_use = "FIDL methods require a response to be sent"]
6751#[derive(Debug)]
6752pub struct RuleSetV4AuthenticateForRouteTableResponder {
6753 control_handle: std::mem::ManuallyDrop<RuleSetV4ControlHandle>,
6754 tx_id: u32,
6755}
6756
6757impl std::ops::Drop for RuleSetV4AuthenticateForRouteTableResponder {
6761 fn drop(&mut self) {
6762 self.control_handle.shutdown();
6763 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6765 }
6766}
6767
6768impl fidl::endpoints::Responder for RuleSetV4AuthenticateForRouteTableResponder {
6769 type ControlHandle = RuleSetV4ControlHandle;
6770
6771 fn control_handle(&self) -> &RuleSetV4ControlHandle {
6772 &self.control_handle
6773 }
6774
6775 fn drop_without_shutdown(mut self) {
6776 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6778 std::mem::forget(self);
6780 }
6781}
6782
6783impl RuleSetV4AuthenticateForRouteTableResponder {
6784 pub fn send(
6788 self,
6789 mut result: Result<(), AuthenticateForRouteTableError>,
6790 ) -> Result<(), fidl::Error> {
6791 let _result = self.send_raw(result);
6792 if _result.is_err() {
6793 self.control_handle.shutdown();
6794 }
6795 self.drop_without_shutdown();
6796 _result
6797 }
6798
6799 pub fn send_no_shutdown_on_err(
6801 self,
6802 mut result: Result<(), AuthenticateForRouteTableError>,
6803 ) -> Result<(), fidl::Error> {
6804 let _result = self.send_raw(result);
6805 self.drop_without_shutdown();
6806 _result
6807 }
6808
6809 fn send_raw(
6810 &self,
6811 mut result: Result<(), AuthenticateForRouteTableError>,
6812 ) -> Result<(), fidl::Error> {
6813 self.control_handle.inner.send::<fidl::encoding::ResultType<
6814 fidl::encoding::EmptyStruct,
6815 AuthenticateForRouteTableError,
6816 >>(
6817 result,
6818 self.tx_id,
6819 0x6fd845360ed9bc8f,
6820 fidl::encoding::DynamicFlags::empty(),
6821 )
6822 }
6823}
6824
6825#[must_use = "FIDL methods require a response to be sent"]
6826#[derive(Debug)]
6827pub struct RuleSetV4RemoveRuleResponder {
6828 control_handle: std::mem::ManuallyDrop<RuleSetV4ControlHandle>,
6829 tx_id: u32,
6830}
6831
6832impl std::ops::Drop for RuleSetV4RemoveRuleResponder {
6836 fn drop(&mut self) {
6837 self.control_handle.shutdown();
6838 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6840 }
6841}
6842
6843impl fidl::endpoints::Responder for RuleSetV4RemoveRuleResponder {
6844 type ControlHandle = RuleSetV4ControlHandle;
6845
6846 fn control_handle(&self) -> &RuleSetV4ControlHandle {
6847 &self.control_handle
6848 }
6849
6850 fn drop_without_shutdown(mut self) {
6851 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6853 std::mem::forget(self);
6855 }
6856}
6857
6858impl RuleSetV4RemoveRuleResponder {
6859 pub fn send(self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
6863 let _result = self.send_raw(result);
6864 if _result.is_err() {
6865 self.control_handle.shutdown();
6866 }
6867 self.drop_without_shutdown();
6868 _result
6869 }
6870
6871 pub fn send_no_shutdown_on_err(
6873 self,
6874 mut result: Result<(), RuleSetError>,
6875 ) -> Result<(), fidl::Error> {
6876 let _result = self.send_raw(result);
6877 self.drop_without_shutdown();
6878 _result
6879 }
6880
6881 fn send_raw(&self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
6882 self.control_handle.inner.send::<fidl::encoding::ResultType<
6883 fidl::encoding::EmptyStruct,
6884 RuleSetError,
6885 >>(
6886 result,
6887 self.tx_id,
6888 0x2ae3d7e817cbff90,
6889 fidl::encoding::DynamicFlags::empty(),
6890 )
6891 }
6892}
6893
6894#[must_use = "FIDL methods require a response to be sent"]
6895#[derive(Debug)]
6896pub struct RuleSetV4AddRuleResponder {
6897 control_handle: std::mem::ManuallyDrop<RuleSetV4ControlHandle>,
6898 tx_id: u32,
6899}
6900
6901impl std::ops::Drop for RuleSetV4AddRuleResponder {
6905 fn drop(&mut self) {
6906 self.control_handle.shutdown();
6907 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6909 }
6910}
6911
6912impl fidl::endpoints::Responder for RuleSetV4AddRuleResponder {
6913 type ControlHandle = RuleSetV4ControlHandle;
6914
6915 fn control_handle(&self) -> &RuleSetV4ControlHandle {
6916 &self.control_handle
6917 }
6918
6919 fn drop_without_shutdown(mut self) {
6920 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6922 std::mem::forget(self);
6924 }
6925}
6926
6927impl RuleSetV4AddRuleResponder {
6928 pub fn send(self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
6932 let _result = self.send_raw(result);
6933 if _result.is_err() {
6934 self.control_handle.shutdown();
6935 }
6936 self.drop_without_shutdown();
6937 _result
6938 }
6939
6940 pub fn send_no_shutdown_on_err(
6942 self,
6943 mut result: Result<(), RuleSetError>,
6944 ) -> Result<(), fidl::Error> {
6945 let _result = self.send_raw(result);
6946 self.drop_without_shutdown();
6947 _result
6948 }
6949
6950 fn send_raw(&self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
6951 self.control_handle.inner.send::<fidl::encoding::ResultType<
6952 fidl::encoding::EmptyStruct,
6953 RuleSetError,
6954 >>(
6955 result,
6956 self.tx_id,
6957 0x7f68325de94e80,
6958 fidl::encoding::DynamicFlags::empty(),
6959 )
6960 }
6961}
6962
6963#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6964pub struct RuleSetV6Marker;
6965
6966impl fidl::endpoints::ProtocolMarker for RuleSetV6Marker {
6967 type Proxy = RuleSetV6Proxy;
6968 type RequestStream = RuleSetV6RequestStream;
6969 #[cfg(target_os = "fuchsia")]
6970 type SynchronousProxy = RuleSetV6SynchronousProxy;
6971
6972 const DEBUG_NAME: &'static str = "(anonymous) RuleSetV6";
6973}
6974pub type RuleSetV6AddRuleResult = Result<(), RuleSetError>;
6975
6976pub trait RuleSetV6ProxyInterface: Send + Sync {
6977 type AuthenticateForRouteTableResponseFut: std::future::Future<
6978 Output = Result<BaseRuleSetAuthenticateForRouteTableResult, fidl::Error>,
6979 > + Send;
6980 fn r#authenticate_for_route_table(
6981 &self,
6982 table: u32,
6983 token: fidl::Event,
6984 ) -> Self::AuthenticateForRouteTableResponseFut;
6985 type RemoveRuleResponseFut: std::future::Future<Output = Result<BaseRuleSetRemoveRuleResult, fidl::Error>>
6986 + Send;
6987 fn r#remove_rule(&self, index: u32) -> Self::RemoveRuleResponseFut;
6988 fn r#close(&self) -> Result<(), fidl::Error>;
6989 type AddRuleResponseFut: std::future::Future<Output = Result<RuleSetV6AddRuleResult, fidl::Error>>
6990 + Send;
6991 fn r#add_rule(
6992 &self,
6993 index: u32,
6994 matcher: &fidl_fuchsia_net_routes::RuleMatcherV6,
6995 action: &fidl_fuchsia_net_routes::RuleAction,
6996 ) -> Self::AddRuleResponseFut;
6997}
6998#[derive(Debug)]
6999#[cfg(target_os = "fuchsia")]
7000pub struct RuleSetV6SynchronousProxy {
7001 client: fidl::client::sync::Client,
7002}
7003
7004#[cfg(target_os = "fuchsia")]
7005impl fidl::endpoints::SynchronousProxy for RuleSetV6SynchronousProxy {
7006 type Proxy = RuleSetV6Proxy;
7007 type Protocol = RuleSetV6Marker;
7008
7009 fn from_channel(inner: fidl::Channel) -> Self {
7010 Self::new(inner)
7011 }
7012
7013 fn into_channel(self) -> fidl::Channel {
7014 self.client.into_channel()
7015 }
7016
7017 fn as_channel(&self) -> &fidl::Channel {
7018 self.client.as_channel()
7019 }
7020}
7021
7022#[cfg(target_os = "fuchsia")]
7023impl RuleSetV6SynchronousProxy {
7024 pub fn new(channel: fidl::Channel) -> Self {
7025 let protocol_name = <RuleSetV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7026 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7027 }
7028
7029 pub fn into_channel(self) -> fidl::Channel {
7030 self.client.into_channel()
7031 }
7032
7033 pub fn wait_for_event(
7036 &self,
7037 deadline: zx::MonotonicInstant,
7038 ) -> Result<RuleSetV6Event, fidl::Error> {
7039 RuleSetV6Event::decode(self.client.wait_for_event(deadline)?)
7040 }
7041
7042 pub fn r#authenticate_for_route_table(
7044 &self,
7045 mut table: u32,
7046 mut token: fidl::Event,
7047 ___deadline: zx::MonotonicInstant,
7048 ) -> Result<BaseRuleSetAuthenticateForRouteTableResult, fidl::Error> {
7049 let _response =
7050 self.client.send_query::<ProofOfRouteTableAuthorization, fidl::encoding::ResultType<
7051 fidl::encoding::EmptyStruct,
7052 AuthenticateForRouteTableError,
7053 >>(
7054 (table, token),
7055 0x6fd845360ed9bc8f,
7056 fidl::encoding::DynamicFlags::empty(),
7057 ___deadline,
7058 )?;
7059 Ok(_response.map(|x| x))
7060 }
7061
7062 pub fn r#remove_rule(
7069 &self,
7070 mut index: u32,
7071 ___deadline: zx::MonotonicInstant,
7072 ) -> Result<BaseRuleSetRemoveRuleResult, fidl::Error> {
7073 let _response = self.client.send_query::<
7074 BaseRuleSetRemoveRuleRequest,
7075 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
7076 >(
7077 (index,),
7078 0x2ae3d7e817cbff90,
7079 fidl::encoding::DynamicFlags::empty(),
7080 ___deadline,
7081 )?;
7082 Ok(_response.map(|x| x))
7083 }
7084
7085 pub fn r#close(&self) -> Result<(), fidl::Error> {
7090 self.client.send::<fidl::encoding::EmptyPayload>(
7091 (),
7092 0x457e1753672d4073,
7093 fidl::encoding::DynamicFlags::empty(),
7094 )
7095 }
7096
7097 pub fn r#add_rule(
7106 &self,
7107 mut index: u32,
7108 mut matcher: &fidl_fuchsia_net_routes::RuleMatcherV6,
7109 mut action: &fidl_fuchsia_net_routes::RuleAction,
7110 ___deadline: zx::MonotonicInstant,
7111 ) -> Result<RuleSetV6AddRuleResult, fidl::Error> {
7112 let _response = self.client.send_query::<
7113 RuleSetV6AddRuleRequest,
7114 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
7115 >(
7116 (index, matcher, action,),
7117 0x946cad8f8a726b3,
7118 fidl::encoding::DynamicFlags::empty(),
7119 ___deadline,
7120 )?;
7121 Ok(_response.map(|x| x))
7122 }
7123}
7124
7125#[cfg(target_os = "fuchsia")]
7126impl From<RuleSetV6SynchronousProxy> for zx::Handle {
7127 fn from(value: RuleSetV6SynchronousProxy) -> Self {
7128 value.into_channel().into()
7129 }
7130}
7131
7132#[cfg(target_os = "fuchsia")]
7133impl From<fidl::Channel> for RuleSetV6SynchronousProxy {
7134 fn from(value: fidl::Channel) -> Self {
7135 Self::new(value)
7136 }
7137}
7138
7139#[derive(Debug, Clone)]
7140pub struct RuleSetV6Proxy {
7141 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7142}
7143
7144impl fidl::endpoints::Proxy for RuleSetV6Proxy {
7145 type Protocol = RuleSetV6Marker;
7146
7147 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7148 Self::new(inner)
7149 }
7150
7151 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7152 self.client.into_channel().map_err(|client| Self { client })
7153 }
7154
7155 fn as_channel(&self) -> &::fidl::AsyncChannel {
7156 self.client.as_channel()
7157 }
7158}
7159
7160impl RuleSetV6Proxy {
7161 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7163 let protocol_name = <RuleSetV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7164 Self { client: fidl::client::Client::new(channel, protocol_name) }
7165 }
7166
7167 pub fn take_event_stream(&self) -> RuleSetV6EventStream {
7173 RuleSetV6EventStream { event_receiver: self.client.take_event_receiver() }
7174 }
7175
7176 pub fn r#authenticate_for_route_table(
7178 &self,
7179 mut table: u32,
7180 mut token: fidl::Event,
7181 ) -> fidl::client::QueryResponseFut<
7182 BaseRuleSetAuthenticateForRouteTableResult,
7183 fidl::encoding::DefaultFuchsiaResourceDialect,
7184 > {
7185 RuleSetV6ProxyInterface::r#authenticate_for_route_table(self, table, token)
7186 }
7187
7188 pub fn r#remove_rule(
7195 &self,
7196 mut index: u32,
7197 ) -> fidl::client::QueryResponseFut<
7198 BaseRuleSetRemoveRuleResult,
7199 fidl::encoding::DefaultFuchsiaResourceDialect,
7200 > {
7201 RuleSetV6ProxyInterface::r#remove_rule(self, index)
7202 }
7203
7204 pub fn r#close(&self) -> Result<(), fidl::Error> {
7209 RuleSetV6ProxyInterface::r#close(self)
7210 }
7211
7212 pub fn r#add_rule(
7221 &self,
7222 mut index: u32,
7223 mut matcher: &fidl_fuchsia_net_routes::RuleMatcherV6,
7224 mut action: &fidl_fuchsia_net_routes::RuleAction,
7225 ) -> fidl::client::QueryResponseFut<
7226 RuleSetV6AddRuleResult,
7227 fidl::encoding::DefaultFuchsiaResourceDialect,
7228 > {
7229 RuleSetV6ProxyInterface::r#add_rule(self, index, matcher, action)
7230 }
7231}
7232
7233impl RuleSetV6ProxyInterface for RuleSetV6Proxy {
7234 type AuthenticateForRouteTableResponseFut = fidl::client::QueryResponseFut<
7235 BaseRuleSetAuthenticateForRouteTableResult,
7236 fidl::encoding::DefaultFuchsiaResourceDialect,
7237 >;
7238 fn r#authenticate_for_route_table(
7239 &self,
7240 mut table: u32,
7241 mut token: fidl::Event,
7242 ) -> Self::AuthenticateForRouteTableResponseFut {
7243 fn _decode(
7244 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7245 ) -> Result<BaseRuleSetAuthenticateForRouteTableResult, fidl::Error> {
7246 let _response = fidl::client::decode_transaction_body::<
7247 fidl::encoding::ResultType<
7248 fidl::encoding::EmptyStruct,
7249 AuthenticateForRouteTableError,
7250 >,
7251 fidl::encoding::DefaultFuchsiaResourceDialect,
7252 0x6fd845360ed9bc8f,
7253 >(_buf?)?;
7254 Ok(_response.map(|x| x))
7255 }
7256 self.client.send_query_and_decode::<
7257 ProofOfRouteTableAuthorization,
7258 BaseRuleSetAuthenticateForRouteTableResult,
7259 >(
7260 (table, token,),
7261 0x6fd845360ed9bc8f,
7262 fidl::encoding::DynamicFlags::empty(),
7263 _decode,
7264 )
7265 }
7266
7267 type RemoveRuleResponseFut = fidl::client::QueryResponseFut<
7268 BaseRuleSetRemoveRuleResult,
7269 fidl::encoding::DefaultFuchsiaResourceDialect,
7270 >;
7271 fn r#remove_rule(&self, mut index: u32) -> Self::RemoveRuleResponseFut {
7272 fn _decode(
7273 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7274 ) -> Result<BaseRuleSetRemoveRuleResult, fidl::Error> {
7275 let _response = fidl::client::decode_transaction_body::<
7276 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
7277 fidl::encoding::DefaultFuchsiaResourceDialect,
7278 0x2ae3d7e817cbff90,
7279 >(_buf?)?;
7280 Ok(_response.map(|x| x))
7281 }
7282 self.client
7283 .send_query_and_decode::<BaseRuleSetRemoveRuleRequest, BaseRuleSetRemoveRuleResult>(
7284 (index,),
7285 0x2ae3d7e817cbff90,
7286 fidl::encoding::DynamicFlags::empty(),
7287 _decode,
7288 )
7289 }
7290
7291 fn r#close(&self) -> Result<(), fidl::Error> {
7292 self.client.send::<fidl::encoding::EmptyPayload>(
7293 (),
7294 0x457e1753672d4073,
7295 fidl::encoding::DynamicFlags::empty(),
7296 )
7297 }
7298
7299 type AddRuleResponseFut = fidl::client::QueryResponseFut<
7300 RuleSetV6AddRuleResult,
7301 fidl::encoding::DefaultFuchsiaResourceDialect,
7302 >;
7303 fn r#add_rule(
7304 &self,
7305 mut index: u32,
7306 mut matcher: &fidl_fuchsia_net_routes::RuleMatcherV6,
7307 mut action: &fidl_fuchsia_net_routes::RuleAction,
7308 ) -> Self::AddRuleResponseFut {
7309 fn _decode(
7310 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7311 ) -> Result<RuleSetV6AddRuleResult, fidl::Error> {
7312 let _response = fidl::client::decode_transaction_body::<
7313 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, RuleSetError>,
7314 fidl::encoding::DefaultFuchsiaResourceDialect,
7315 0x946cad8f8a726b3,
7316 >(_buf?)?;
7317 Ok(_response.map(|x| x))
7318 }
7319 self.client.send_query_and_decode::<RuleSetV6AddRuleRequest, RuleSetV6AddRuleResult>(
7320 (index, matcher, action),
7321 0x946cad8f8a726b3,
7322 fidl::encoding::DynamicFlags::empty(),
7323 _decode,
7324 )
7325 }
7326}
7327
7328pub struct RuleSetV6EventStream {
7329 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7330}
7331
7332impl std::marker::Unpin for RuleSetV6EventStream {}
7333
7334impl futures::stream::FusedStream for RuleSetV6EventStream {
7335 fn is_terminated(&self) -> bool {
7336 self.event_receiver.is_terminated()
7337 }
7338}
7339
7340impl futures::Stream for RuleSetV6EventStream {
7341 type Item = Result<RuleSetV6Event, fidl::Error>;
7342
7343 fn poll_next(
7344 mut self: std::pin::Pin<&mut Self>,
7345 cx: &mut std::task::Context<'_>,
7346 ) -> std::task::Poll<Option<Self::Item>> {
7347 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7348 &mut self.event_receiver,
7349 cx
7350 )?) {
7351 Some(buf) => std::task::Poll::Ready(Some(RuleSetV6Event::decode(buf))),
7352 None => std::task::Poll::Ready(None),
7353 }
7354 }
7355}
7356
7357#[derive(Debug)]
7358pub enum RuleSetV6Event {}
7359
7360impl RuleSetV6Event {
7361 fn decode(
7363 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7364 ) -> Result<RuleSetV6Event, fidl::Error> {
7365 let (bytes, _handles) = buf.split_mut();
7366 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7367 debug_assert_eq!(tx_header.tx_id, 0);
7368 match tx_header.ordinal {
7369 _ => Err(fidl::Error::UnknownOrdinal {
7370 ordinal: tx_header.ordinal,
7371 protocol_name: <RuleSetV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7372 }),
7373 }
7374 }
7375}
7376
7377pub struct RuleSetV6RequestStream {
7379 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7380 is_terminated: bool,
7381}
7382
7383impl std::marker::Unpin for RuleSetV6RequestStream {}
7384
7385impl futures::stream::FusedStream for RuleSetV6RequestStream {
7386 fn is_terminated(&self) -> bool {
7387 self.is_terminated
7388 }
7389}
7390
7391impl fidl::endpoints::RequestStream for RuleSetV6RequestStream {
7392 type Protocol = RuleSetV6Marker;
7393 type ControlHandle = RuleSetV6ControlHandle;
7394
7395 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7396 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7397 }
7398
7399 fn control_handle(&self) -> Self::ControlHandle {
7400 RuleSetV6ControlHandle { inner: self.inner.clone() }
7401 }
7402
7403 fn into_inner(
7404 self,
7405 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7406 {
7407 (self.inner, self.is_terminated)
7408 }
7409
7410 fn from_inner(
7411 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7412 is_terminated: bool,
7413 ) -> Self {
7414 Self { inner, is_terminated }
7415 }
7416}
7417
7418impl futures::Stream for RuleSetV6RequestStream {
7419 type Item = Result<RuleSetV6Request, fidl::Error>;
7420
7421 fn poll_next(
7422 mut self: std::pin::Pin<&mut Self>,
7423 cx: &mut std::task::Context<'_>,
7424 ) -> std::task::Poll<Option<Self::Item>> {
7425 let this = &mut *self;
7426 if this.inner.check_shutdown(cx) {
7427 this.is_terminated = true;
7428 return std::task::Poll::Ready(None);
7429 }
7430 if this.is_terminated {
7431 panic!("polled RuleSetV6RequestStream after completion");
7432 }
7433 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7434 |bytes, handles| {
7435 match this.inner.channel().read_etc(cx, bytes, handles) {
7436 std::task::Poll::Ready(Ok(())) => {}
7437 std::task::Poll::Pending => return std::task::Poll::Pending,
7438 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7439 this.is_terminated = true;
7440 return std::task::Poll::Ready(None);
7441 }
7442 std::task::Poll::Ready(Err(e)) => {
7443 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7444 e.into(),
7445 ))))
7446 }
7447 }
7448
7449 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7451
7452 std::task::Poll::Ready(Some(match header.ordinal {
7453 0x6fd845360ed9bc8f => {
7454 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7455 let mut req = fidl::new_empty!(
7456 ProofOfRouteTableAuthorization,
7457 fidl::encoding::DefaultFuchsiaResourceDialect
7458 );
7459 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProofOfRouteTableAuthorization>(&header, _body_bytes, handles, &mut req)?;
7460 let control_handle = RuleSetV6ControlHandle { inner: this.inner.clone() };
7461 Ok(RuleSetV6Request::AuthenticateForRouteTable {
7462 table: req.table,
7463 token: req.token,
7464
7465 responder: RuleSetV6AuthenticateForRouteTableResponder {
7466 control_handle: std::mem::ManuallyDrop::new(control_handle),
7467 tx_id: header.tx_id,
7468 },
7469 })
7470 }
7471 0x2ae3d7e817cbff90 => {
7472 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7473 let mut req = fidl::new_empty!(
7474 BaseRuleSetRemoveRuleRequest,
7475 fidl::encoding::DefaultFuchsiaResourceDialect
7476 );
7477 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BaseRuleSetRemoveRuleRequest>(&header, _body_bytes, handles, &mut req)?;
7478 let control_handle = RuleSetV6ControlHandle { inner: this.inner.clone() };
7479 Ok(RuleSetV6Request::RemoveRule {
7480 index: req.index,
7481
7482 responder: RuleSetV6RemoveRuleResponder {
7483 control_handle: std::mem::ManuallyDrop::new(control_handle),
7484 tx_id: header.tx_id,
7485 },
7486 })
7487 }
7488 0x457e1753672d4073 => {
7489 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7490 let mut req = fidl::new_empty!(
7491 fidl::encoding::EmptyPayload,
7492 fidl::encoding::DefaultFuchsiaResourceDialect
7493 );
7494 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7495 let control_handle = RuleSetV6ControlHandle { inner: this.inner.clone() };
7496 Ok(RuleSetV6Request::Close { control_handle })
7497 }
7498 0x946cad8f8a726b3 => {
7499 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7500 let mut req = fidl::new_empty!(
7501 RuleSetV6AddRuleRequest,
7502 fidl::encoding::DefaultFuchsiaResourceDialect
7503 );
7504 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RuleSetV6AddRuleRequest>(&header, _body_bytes, handles, &mut req)?;
7505 let control_handle = RuleSetV6ControlHandle { inner: this.inner.clone() };
7506 Ok(RuleSetV6Request::AddRule {
7507 index: req.index,
7508 matcher: req.matcher,
7509 action: req.action,
7510
7511 responder: RuleSetV6AddRuleResponder {
7512 control_handle: std::mem::ManuallyDrop::new(control_handle),
7513 tx_id: header.tx_id,
7514 },
7515 })
7516 }
7517 _ => Err(fidl::Error::UnknownOrdinal {
7518 ordinal: header.ordinal,
7519 protocol_name:
7520 <RuleSetV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7521 }),
7522 }))
7523 },
7524 )
7525 }
7526}
7527
7528#[derive(Debug)]
7537pub enum RuleSetV6Request {
7538 AuthenticateForRouteTable {
7540 table: u32,
7541 token: fidl::Event,
7542 responder: RuleSetV6AuthenticateForRouteTableResponder,
7543 },
7544 RemoveRule { index: u32, responder: RuleSetV6RemoveRuleResponder },
7551 Close { control_handle: RuleSetV6ControlHandle },
7556 AddRule {
7565 index: u32,
7566 matcher: fidl_fuchsia_net_routes::RuleMatcherV6,
7567 action: fidl_fuchsia_net_routes::RuleAction,
7568 responder: RuleSetV6AddRuleResponder,
7569 },
7570}
7571
7572impl RuleSetV6Request {
7573 #[allow(irrefutable_let_patterns)]
7574 pub fn into_authenticate_for_route_table(
7575 self,
7576 ) -> Option<(u32, fidl::Event, RuleSetV6AuthenticateForRouteTableResponder)> {
7577 if let RuleSetV6Request::AuthenticateForRouteTable { table, token, responder } = self {
7578 Some((table, token, responder))
7579 } else {
7580 None
7581 }
7582 }
7583
7584 #[allow(irrefutable_let_patterns)]
7585 pub fn into_remove_rule(self) -> Option<(u32, RuleSetV6RemoveRuleResponder)> {
7586 if let RuleSetV6Request::RemoveRule { index, responder } = self {
7587 Some((index, responder))
7588 } else {
7589 None
7590 }
7591 }
7592
7593 #[allow(irrefutable_let_patterns)]
7594 pub fn into_close(self) -> Option<(RuleSetV6ControlHandle)> {
7595 if let RuleSetV6Request::Close { control_handle } = self {
7596 Some((control_handle))
7597 } else {
7598 None
7599 }
7600 }
7601
7602 #[allow(irrefutable_let_patterns)]
7603 pub fn into_add_rule(
7604 self,
7605 ) -> Option<(
7606 u32,
7607 fidl_fuchsia_net_routes::RuleMatcherV6,
7608 fidl_fuchsia_net_routes::RuleAction,
7609 RuleSetV6AddRuleResponder,
7610 )> {
7611 if let RuleSetV6Request::AddRule { index, matcher, action, responder } = self {
7612 Some((index, matcher, action, responder))
7613 } else {
7614 None
7615 }
7616 }
7617
7618 pub fn method_name(&self) -> &'static str {
7620 match *self {
7621 RuleSetV6Request::AuthenticateForRouteTable { .. } => "authenticate_for_route_table",
7622 RuleSetV6Request::RemoveRule { .. } => "remove_rule",
7623 RuleSetV6Request::Close { .. } => "close",
7624 RuleSetV6Request::AddRule { .. } => "add_rule",
7625 }
7626 }
7627}
7628
7629#[derive(Debug, Clone)]
7630pub struct RuleSetV6ControlHandle {
7631 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7632}
7633
7634impl fidl::endpoints::ControlHandle for RuleSetV6ControlHandle {
7635 fn shutdown(&self) {
7636 self.inner.shutdown()
7637 }
7638 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7639 self.inner.shutdown_with_epitaph(status)
7640 }
7641
7642 fn is_closed(&self) -> bool {
7643 self.inner.channel().is_closed()
7644 }
7645 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7646 self.inner.channel().on_closed()
7647 }
7648
7649 #[cfg(target_os = "fuchsia")]
7650 fn signal_peer(
7651 &self,
7652 clear_mask: zx::Signals,
7653 set_mask: zx::Signals,
7654 ) -> Result<(), zx_status::Status> {
7655 use fidl::Peered;
7656 self.inner.channel().signal_peer(clear_mask, set_mask)
7657 }
7658}
7659
7660impl RuleSetV6ControlHandle {}
7661
7662#[must_use = "FIDL methods require a response to be sent"]
7663#[derive(Debug)]
7664pub struct RuleSetV6AuthenticateForRouteTableResponder {
7665 control_handle: std::mem::ManuallyDrop<RuleSetV6ControlHandle>,
7666 tx_id: u32,
7667}
7668
7669impl std::ops::Drop for RuleSetV6AuthenticateForRouteTableResponder {
7673 fn drop(&mut self) {
7674 self.control_handle.shutdown();
7675 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7677 }
7678}
7679
7680impl fidl::endpoints::Responder for RuleSetV6AuthenticateForRouteTableResponder {
7681 type ControlHandle = RuleSetV6ControlHandle;
7682
7683 fn control_handle(&self) -> &RuleSetV6ControlHandle {
7684 &self.control_handle
7685 }
7686
7687 fn drop_without_shutdown(mut self) {
7688 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7690 std::mem::forget(self);
7692 }
7693}
7694
7695impl RuleSetV6AuthenticateForRouteTableResponder {
7696 pub fn send(
7700 self,
7701 mut result: Result<(), AuthenticateForRouteTableError>,
7702 ) -> Result<(), fidl::Error> {
7703 let _result = self.send_raw(result);
7704 if _result.is_err() {
7705 self.control_handle.shutdown();
7706 }
7707 self.drop_without_shutdown();
7708 _result
7709 }
7710
7711 pub fn send_no_shutdown_on_err(
7713 self,
7714 mut result: Result<(), AuthenticateForRouteTableError>,
7715 ) -> Result<(), fidl::Error> {
7716 let _result = self.send_raw(result);
7717 self.drop_without_shutdown();
7718 _result
7719 }
7720
7721 fn send_raw(
7722 &self,
7723 mut result: Result<(), AuthenticateForRouteTableError>,
7724 ) -> Result<(), fidl::Error> {
7725 self.control_handle.inner.send::<fidl::encoding::ResultType<
7726 fidl::encoding::EmptyStruct,
7727 AuthenticateForRouteTableError,
7728 >>(
7729 result,
7730 self.tx_id,
7731 0x6fd845360ed9bc8f,
7732 fidl::encoding::DynamicFlags::empty(),
7733 )
7734 }
7735}
7736
7737#[must_use = "FIDL methods require a response to be sent"]
7738#[derive(Debug)]
7739pub struct RuleSetV6RemoveRuleResponder {
7740 control_handle: std::mem::ManuallyDrop<RuleSetV6ControlHandle>,
7741 tx_id: u32,
7742}
7743
7744impl std::ops::Drop for RuleSetV6RemoveRuleResponder {
7748 fn drop(&mut self) {
7749 self.control_handle.shutdown();
7750 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7752 }
7753}
7754
7755impl fidl::endpoints::Responder for RuleSetV6RemoveRuleResponder {
7756 type ControlHandle = RuleSetV6ControlHandle;
7757
7758 fn control_handle(&self) -> &RuleSetV6ControlHandle {
7759 &self.control_handle
7760 }
7761
7762 fn drop_without_shutdown(mut self) {
7763 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7765 std::mem::forget(self);
7767 }
7768}
7769
7770impl RuleSetV6RemoveRuleResponder {
7771 pub fn send(self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
7775 let _result = self.send_raw(result);
7776 if _result.is_err() {
7777 self.control_handle.shutdown();
7778 }
7779 self.drop_without_shutdown();
7780 _result
7781 }
7782
7783 pub fn send_no_shutdown_on_err(
7785 self,
7786 mut result: Result<(), RuleSetError>,
7787 ) -> Result<(), fidl::Error> {
7788 let _result = self.send_raw(result);
7789 self.drop_without_shutdown();
7790 _result
7791 }
7792
7793 fn send_raw(&self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
7794 self.control_handle.inner.send::<fidl::encoding::ResultType<
7795 fidl::encoding::EmptyStruct,
7796 RuleSetError,
7797 >>(
7798 result,
7799 self.tx_id,
7800 0x2ae3d7e817cbff90,
7801 fidl::encoding::DynamicFlags::empty(),
7802 )
7803 }
7804}
7805
7806#[must_use = "FIDL methods require a response to be sent"]
7807#[derive(Debug)]
7808pub struct RuleSetV6AddRuleResponder {
7809 control_handle: std::mem::ManuallyDrop<RuleSetV6ControlHandle>,
7810 tx_id: u32,
7811}
7812
7813impl std::ops::Drop for RuleSetV6AddRuleResponder {
7817 fn drop(&mut self) {
7818 self.control_handle.shutdown();
7819 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7821 }
7822}
7823
7824impl fidl::endpoints::Responder for RuleSetV6AddRuleResponder {
7825 type ControlHandle = RuleSetV6ControlHandle;
7826
7827 fn control_handle(&self) -> &RuleSetV6ControlHandle {
7828 &self.control_handle
7829 }
7830
7831 fn drop_without_shutdown(mut self) {
7832 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7834 std::mem::forget(self);
7836 }
7837}
7838
7839impl RuleSetV6AddRuleResponder {
7840 pub fn send(self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
7844 let _result = self.send_raw(result);
7845 if _result.is_err() {
7846 self.control_handle.shutdown();
7847 }
7848 self.drop_without_shutdown();
7849 _result
7850 }
7851
7852 pub fn send_no_shutdown_on_err(
7854 self,
7855 mut result: Result<(), RuleSetError>,
7856 ) -> Result<(), fidl::Error> {
7857 let _result = self.send_raw(result);
7858 self.drop_without_shutdown();
7859 _result
7860 }
7861
7862 fn send_raw(&self, mut result: Result<(), RuleSetError>) -> Result<(), fidl::Error> {
7863 self.control_handle.inner.send::<fidl::encoding::ResultType<
7864 fidl::encoding::EmptyStruct,
7865 RuleSetError,
7866 >>(
7867 result,
7868 self.tx_id,
7869 0x946cad8f8a726b3,
7870 fidl::encoding::DynamicFlags::empty(),
7871 )
7872 }
7873}
7874
7875#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7876pub struct RuleTableV4Marker;
7877
7878impl fidl::endpoints::ProtocolMarker for RuleTableV4Marker {
7879 type Proxy = RuleTableV4Proxy;
7880 type RequestStream = RuleTableV4RequestStream;
7881 #[cfg(target_os = "fuchsia")]
7882 type SynchronousProxy = RuleTableV4SynchronousProxy;
7883
7884 const DEBUG_NAME: &'static str = "fuchsia.net.routes.admin.RuleTableV4";
7885}
7886impl fidl::endpoints::DiscoverableProtocolMarker for RuleTableV4Marker {}
7887
7888pub trait RuleTableV4ProxyInterface: Send + Sync {
7889 fn r#new_rule_set(
7890 &self,
7891 priority: u32,
7892 rule_set: fidl::endpoints::ServerEnd<RuleSetV4Marker>,
7893 ) -> Result<(), fidl::Error>;
7894}
7895#[derive(Debug)]
7896#[cfg(target_os = "fuchsia")]
7897pub struct RuleTableV4SynchronousProxy {
7898 client: fidl::client::sync::Client,
7899}
7900
7901#[cfg(target_os = "fuchsia")]
7902impl fidl::endpoints::SynchronousProxy for RuleTableV4SynchronousProxy {
7903 type Proxy = RuleTableV4Proxy;
7904 type Protocol = RuleTableV4Marker;
7905
7906 fn from_channel(inner: fidl::Channel) -> Self {
7907 Self::new(inner)
7908 }
7909
7910 fn into_channel(self) -> fidl::Channel {
7911 self.client.into_channel()
7912 }
7913
7914 fn as_channel(&self) -> &fidl::Channel {
7915 self.client.as_channel()
7916 }
7917}
7918
7919#[cfg(target_os = "fuchsia")]
7920impl RuleTableV4SynchronousProxy {
7921 pub fn new(channel: fidl::Channel) -> Self {
7922 let protocol_name = <RuleTableV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7923 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7924 }
7925
7926 pub fn into_channel(self) -> fidl::Channel {
7927 self.client.into_channel()
7928 }
7929
7930 pub fn wait_for_event(
7933 &self,
7934 deadline: zx::MonotonicInstant,
7935 ) -> Result<RuleTableV4Event, fidl::Error> {
7936 RuleTableV4Event::decode(self.client.wait_for_event(deadline)?)
7937 }
7938
7939 pub fn r#new_rule_set(
7950 &self,
7951 mut priority: u32,
7952 mut rule_set: fidl::endpoints::ServerEnd<RuleSetV4Marker>,
7953 ) -> Result<(), fidl::Error> {
7954 self.client.send::<RuleTableV4NewRuleSetRequest>(
7955 (priority, rule_set),
7956 0xa32a9097da46f3a,
7957 fidl::encoding::DynamicFlags::empty(),
7958 )
7959 }
7960}
7961
7962#[cfg(target_os = "fuchsia")]
7963impl From<RuleTableV4SynchronousProxy> for zx::Handle {
7964 fn from(value: RuleTableV4SynchronousProxy) -> Self {
7965 value.into_channel().into()
7966 }
7967}
7968
7969#[cfg(target_os = "fuchsia")]
7970impl From<fidl::Channel> for RuleTableV4SynchronousProxy {
7971 fn from(value: fidl::Channel) -> Self {
7972 Self::new(value)
7973 }
7974}
7975
7976#[derive(Debug, Clone)]
7977pub struct RuleTableV4Proxy {
7978 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7979}
7980
7981impl fidl::endpoints::Proxy for RuleTableV4Proxy {
7982 type Protocol = RuleTableV4Marker;
7983
7984 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7985 Self::new(inner)
7986 }
7987
7988 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7989 self.client.into_channel().map_err(|client| Self { client })
7990 }
7991
7992 fn as_channel(&self) -> &::fidl::AsyncChannel {
7993 self.client.as_channel()
7994 }
7995}
7996
7997impl RuleTableV4Proxy {
7998 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8000 let protocol_name = <RuleTableV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8001 Self { client: fidl::client::Client::new(channel, protocol_name) }
8002 }
8003
8004 pub fn take_event_stream(&self) -> RuleTableV4EventStream {
8010 RuleTableV4EventStream { event_receiver: self.client.take_event_receiver() }
8011 }
8012
8013 pub fn r#new_rule_set(
8024 &self,
8025 mut priority: u32,
8026 mut rule_set: fidl::endpoints::ServerEnd<RuleSetV4Marker>,
8027 ) -> Result<(), fidl::Error> {
8028 RuleTableV4ProxyInterface::r#new_rule_set(self, priority, rule_set)
8029 }
8030}
8031
8032impl RuleTableV4ProxyInterface for RuleTableV4Proxy {
8033 fn r#new_rule_set(
8034 &self,
8035 mut priority: u32,
8036 mut rule_set: fidl::endpoints::ServerEnd<RuleSetV4Marker>,
8037 ) -> Result<(), fidl::Error> {
8038 self.client.send::<RuleTableV4NewRuleSetRequest>(
8039 (priority, rule_set),
8040 0xa32a9097da46f3a,
8041 fidl::encoding::DynamicFlags::empty(),
8042 )
8043 }
8044}
8045
8046pub struct RuleTableV4EventStream {
8047 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8048}
8049
8050impl std::marker::Unpin for RuleTableV4EventStream {}
8051
8052impl futures::stream::FusedStream for RuleTableV4EventStream {
8053 fn is_terminated(&self) -> bool {
8054 self.event_receiver.is_terminated()
8055 }
8056}
8057
8058impl futures::Stream for RuleTableV4EventStream {
8059 type Item = Result<RuleTableV4Event, fidl::Error>;
8060
8061 fn poll_next(
8062 mut self: std::pin::Pin<&mut Self>,
8063 cx: &mut std::task::Context<'_>,
8064 ) -> std::task::Poll<Option<Self::Item>> {
8065 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8066 &mut self.event_receiver,
8067 cx
8068 )?) {
8069 Some(buf) => std::task::Poll::Ready(Some(RuleTableV4Event::decode(buf))),
8070 None => std::task::Poll::Ready(None),
8071 }
8072 }
8073}
8074
8075#[derive(Debug)]
8076pub enum RuleTableV4Event {}
8077
8078impl RuleTableV4Event {
8079 fn decode(
8081 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8082 ) -> Result<RuleTableV4Event, fidl::Error> {
8083 let (bytes, _handles) = buf.split_mut();
8084 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8085 debug_assert_eq!(tx_header.tx_id, 0);
8086 match tx_header.ordinal {
8087 _ => Err(fidl::Error::UnknownOrdinal {
8088 ordinal: tx_header.ordinal,
8089 protocol_name: <RuleTableV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8090 }),
8091 }
8092 }
8093}
8094
8095pub struct RuleTableV4RequestStream {
8097 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8098 is_terminated: bool,
8099}
8100
8101impl std::marker::Unpin for RuleTableV4RequestStream {}
8102
8103impl futures::stream::FusedStream for RuleTableV4RequestStream {
8104 fn is_terminated(&self) -> bool {
8105 self.is_terminated
8106 }
8107}
8108
8109impl fidl::endpoints::RequestStream for RuleTableV4RequestStream {
8110 type Protocol = RuleTableV4Marker;
8111 type ControlHandle = RuleTableV4ControlHandle;
8112
8113 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8114 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8115 }
8116
8117 fn control_handle(&self) -> Self::ControlHandle {
8118 RuleTableV4ControlHandle { inner: self.inner.clone() }
8119 }
8120
8121 fn into_inner(
8122 self,
8123 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8124 {
8125 (self.inner, self.is_terminated)
8126 }
8127
8128 fn from_inner(
8129 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8130 is_terminated: bool,
8131 ) -> Self {
8132 Self { inner, is_terminated }
8133 }
8134}
8135
8136impl futures::Stream for RuleTableV4RequestStream {
8137 type Item = Result<RuleTableV4Request, fidl::Error>;
8138
8139 fn poll_next(
8140 mut self: std::pin::Pin<&mut Self>,
8141 cx: &mut std::task::Context<'_>,
8142 ) -> std::task::Poll<Option<Self::Item>> {
8143 let this = &mut *self;
8144 if this.inner.check_shutdown(cx) {
8145 this.is_terminated = true;
8146 return std::task::Poll::Ready(None);
8147 }
8148 if this.is_terminated {
8149 panic!("polled RuleTableV4RequestStream after completion");
8150 }
8151 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8152 |bytes, handles| {
8153 match this.inner.channel().read_etc(cx, bytes, handles) {
8154 std::task::Poll::Ready(Ok(())) => {}
8155 std::task::Poll::Pending => return std::task::Poll::Pending,
8156 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8157 this.is_terminated = true;
8158 return std::task::Poll::Ready(None);
8159 }
8160 std::task::Poll::Ready(Err(e)) => {
8161 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8162 e.into(),
8163 ))))
8164 }
8165 }
8166
8167 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8169
8170 std::task::Poll::Ready(Some(match header.ordinal {
8171 0xa32a9097da46f3a => {
8172 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8173 let mut req = fidl::new_empty!(
8174 RuleTableV4NewRuleSetRequest,
8175 fidl::encoding::DefaultFuchsiaResourceDialect
8176 );
8177 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RuleTableV4NewRuleSetRequest>(&header, _body_bytes, handles, &mut req)?;
8178 let control_handle = RuleTableV4ControlHandle { inner: this.inner.clone() };
8179 Ok(RuleTableV4Request::NewRuleSet {
8180 priority: req.priority,
8181 rule_set: req.rule_set,
8182
8183 control_handle,
8184 })
8185 }
8186 _ => Err(fidl::Error::UnknownOrdinal {
8187 ordinal: header.ordinal,
8188 protocol_name:
8189 <RuleTableV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8190 }),
8191 }))
8192 },
8193 )
8194 }
8195}
8196
8197#[derive(Debug)]
8199pub enum RuleTableV4Request {
8200 NewRuleSet {
8211 priority: u32,
8212 rule_set: fidl::endpoints::ServerEnd<RuleSetV4Marker>,
8213 control_handle: RuleTableV4ControlHandle,
8214 },
8215}
8216
8217impl RuleTableV4Request {
8218 #[allow(irrefutable_let_patterns)]
8219 pub fn into_new_rule_set(
8220 self,
8221 ) -> Option<(u32, fidl::endpoints::ServerEnd<RuleSetV4Marker>, RuleTableV4ControlHandle)> {
8222 if let RuleTableV4Request::NewRuleSet { priority, rule_set, control_handle } = self {
8223 Some((priority, rule_set, control_handle))
8224 } else {
8225 None
8226 }
8227 }
8228
8229 pub fn method_name(&self) -> &'static str {
8231 match *self {
8232 RuleTableV4Request::NewRuleSet { .. } => "new_rule_set",
8233 }
8234 }
8235}
8236
8237#[derive(Debug, Clone)]
8238pub struct RuleTableV4ControlHandle {
8239 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8240}
8241
8242impl fidl::endpoints::ControlHandle for RuleTableV4ControlHandle {
8243 fn shutdown(&self) {
8244 self.inner.shutdown()
8245 }
8246 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8247 self.inner.shutdown_with_epitaph(status)
8248 }
8249
8250 fn is_closed(&self) -> bool {
8251 self.inner.channel().is_closed()
8252 }
8253 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8254 self.inner.channel().on_closed()
8255 }
8256
8257 #[cfg(target_os = "fuchsia")]
8258 fn signal_peer(
8259 &self,
8260 clear_mask: zx::Signals,
8261 set_mask: zx::Signals,
8262 ) -> Result<(), zx_status::Status> {
8263 use fidl::Peered;
8264 self.inner.channel().signal_peer(clear_mask, set_mask)
8265 }
8266}
8267
8268impl RuleTableV4ControlHandle {}
8269
8270#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8271pub struct RuleTableV6Marker;
8272
8273impl fidl::endpoints::ProtocolMarker for RuleTableV6Marker {
8274 type Proxy = RuleTableV6Proxy;
8275 type RequestStream = RuleTableV6RequestStream;
8276 #[cfg(target_os = "fuchsia")]
8277 type SynchronousProxy = RuleTableV6SynchronousProxy;
8278
8279 const DEBUG_NAME: &'static str = "fuchsia.net.routes.admin.RuleTableV6";
8280}
8281impl fidl::endpoints::DiscoverableProtocolMarker for RuleTableV6Marker {}
8282
8283pub trait RuleTableV6ProxyInterface: Send + Sync {
8284 fn r#new_rule_set(
8285 &self,
8286 priority: u32,
8287 rule_set: fidl::endpoints::ServerEnd<RuleSetV6Marker>,
8288 ) -> Result<(), fidl::Error>;
8289}
8290#[derive(Debug)]
8291#[cfg(target_os = "fuchsia")]
8292pub struct RuleTableV6SynchronousProxy {
8293 client: fidl::client::sync::Client,
8294}
8295
8296#[cfg(target_os = "fuchsia")]
8297impl fidl::endpoints::SynchronousProxy for RuleTableV6SynchronousProxy {
8298 type Proxy = RuleTableV6Proxy;
8299 type Protocol = RuleTableV6Marker;
8300
8301 fn from_channel(inner: fidl::Channel) -> Self {
8302 Self::new(inner)
8303 }
8304
8305 fn into_channel(self) -> fidl::Channel {
8306 self.client.into_channel()
8307 }
8308
8309 fn as_channel(&self) -> &fidl::Channel {
8310 self.client.as_channel()
8311 }
8312}
8313
8314#[cfg(target_os = "fuchsia")]
8315impl RuleTableV6SynchronousProxy {
8316 pub fn new(channel: fidl::Channel) -> Self {
8317 let protocol_name = <RuleTableV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8318 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8319 }
8320
8321 pub fn into_channel(self) -> fidl::Channel {
8322 self.client.into_channel()
8323 }
8324
8325 pub fn wait_for_event(
8328 &self,
8329 deadline: zx::MonotonicInstant,
8330 ) -> Result<RuleTableV6Event, fidl::Error> {
8331 RuleTableV6Event::decode(self.client.wait_for_event(deadline)?)
8332 }
8333
8334 pub fn r#new_rule_set(
8345 &self,
8346 mut priority: u32,
8347 mut rule_set: fidl::endpoints::ServerEnd<RuleSetV6Marker>,
8348 ) -> Result<(), fidl::Error> {
8349 self.client.send::<RuleTableV6NewRuleSetRequest>(
8350 (priority, rule_set),
8351 0x2261cc6eee9726a0,
8352 fidl::encoding::DynamicFlags::empty(),
8353 )
8354 }
8355}
8356
8357#[cfg(target_os = "fuchsia")]
8358impl From<RuleTableV6SynchronousProxy> for zx::Handle {
8359 fn from(value: RuleTableV6SynchronousProxy) -> Self {
8360 value.into_channel().into()
8361 }
8362}
8363
8364#[cfg(target_os = "fuchsia")]
8365impl From<fidl::Channel> for RuleTableV6SynchronousProxy {
8366 fn from(value: fidl::Channel) -> Self {
8367 Self::new(value)
8368 }
8369}
8370
8371#[derive(Debug, Clone)]
8372pub struct RuleTableV6Proxy {
8373 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8374}
8375
8376impl fidl::endpoints::Proxy for RuleTableV6Proxy {
8377 type Protocol = RuleTableV6Marker;
8378
8379 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8380 Self::new(inner)
8381 }
8382
8383 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8384 self.client.into_channel().map_err(|client| Self { client })
8385 }
8386
8387 fn as_channel(&self) -> &::fidl::AsyncChannel {
8388 self.client.as_channel()
8389 }
8390}
8391
8392impl RuleTableV6Proxy {
8393 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8395 let protocol_name = <RuleTableV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8396 Self { client: fidl::client::Client::new(channel, protocol_name) }
8397 }
8398
8399 pub fn take_event_stream(&self) -> RuleTableV6EventStream {
8405 RuleTableV6EventStream { event_receiver: self.client.take_event_receiver() }
8406 }
8407
8408 pub fn r#new_rule_set(
8419 &self,
8420 mut priority: u32,
8421 mut rule_set: fidl::endpoints::ServerEnd<RuleSetV6Marker>,
8422 ) -> Result<(), fidl::Error> {
8423 RuleTableV6ProxyInterface::r#new_rule_set(self, priority, rule_set)
8424 }
8425}
8426
8427impl RuleTableV6ProxyInterface for RuleTableV6Proxy {
8428 fn r#new_rule_set(
8429 &self,
8430 mut priority: u32,
8431 mut rule_set: fidl::endpoints::ServerEnd<RuleSetV6Marker>,
8432 ) -> Result<(), fidl::Error> {
8433 self.client.send::<RuleTableV6NewRuleSetRequest>(
8434 (priority, rule_set),
8435 0x2261cc6eee9726a0,
8436 fidl::encoding::DynamicFlags::empty(),
8437 )
8438 }
8439}
8440
8441pub struct RuleTableV6EventStream {
8442 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8443}
8444
8445impl std::marker::Unpin for RuleTableV6EventStream {}
8446
8447impl futures::stream::FusedStream for RuleTableV6EventStream {
8448 fn is_terminated(&self) -> bool {
8449 self.event_receiver.is_terminated()
8450 }
8451}
8452
8453impl futures::Stream for RuleTableV6EventStream {
8454 type Item = Result<RuleTableV6Event, fidl::Error>;
8455
8456 fn poll_next(
8457 mut self: std::pin::Pin<&mut Self>,
8458 cx: &mut std::task::Context<'_>,
8459 ) -> std::task::Poll<Option<Self::Item>> {
8460 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8461 &mut self.event_receiver,
8462 cx
8463 )?) {
8464 Some(buf) => std::task::Poll::Ready(Some(RuleTableV6Event::decode(buf))),
8465 None => std::task::Poll::Ready(None),
8466 }
8467 }
8468}
8469
8470#[derive(Debug)]
8471pub enum RuleTableV6Event {}
8472
8473impl RuleTableV6Event {
8474 fn decode(
8476 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8477 ) -> Result<RuleTableV6Event, fidl::Error> {
8478 let (bytes, _handles) = buf.split_mut();
8479 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8480 debug_assert_eq!(tx_header.tx_id, 0);
8481 match tx_header.ordinal {
8482 _ => Err(fidl::Error::UnknownOrdinal {
8483 ordinal: tx_header.ordinal,
8484 protocol_name: <RuleTableV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8485 }),
8486 }
8487 }
8488}
8489
8490pub struct RuleTableV6RequestStream {
8492 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8493 is_terminated: bool,
8494}
8495
8496impl std::marker::Unpin for RuleTableV6RequestStream {}
8497
8498impl futures::stream::FusedStream for RuleTableV6RequestStream {
8499 fn is_terminated(&self) -> bool {
8500 self.is_terminated
8501 }
8502}
8503
8504impl fidl::endpoints::RequestStream for RuleTableV6RequestStream {
8505 type Protocol = RuleTableV6Marker;
8506 type ControlHandle = RuleTableV6ControlHandle;
8507
8508 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8509 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8510 }
8511
8512 fn control_handle(&self) -> Self::ControlHandle {
8513 RuleTableV6ControlHandle { inner: self.inner.clone() }
8514 }
8515
8516 fn into_inner(
8517 self,
8518 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8519 {
8520 (self.inner, self.is_terminated)
8521 }
8522
8523 fn from_inner(
8524 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8525 is_terminated: bool,
8526 ) -> Self {
8527 Self { inner, is_terminated }
8528 }
8529}
8530
8531impl futures::Stream for RuleTableV6RequestStream {
8532 type Item = Result<RuleTableV6Request, fidl::Error>;
8533
8534 fn poll_next(
8535 mut self: std::pin::Pin<&mut Self>,
8536 cx: &mut std::task::Context<'_>,
8537 ) -> std::task::Poll<Option<Self::Item>> {
8538 let this = &mut *self;
8539 if this.inner.check_shutdown(cx) {
8540 this.is_terminated = true;
8541 return std::task::Poll::Ready(None);
8542 }
8543 if this.is_terminated {
8544 panic!("polled RuleTableV6RequestStream after completion");
8545 }
8546 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8547 |bytes, handles| {
8548 match this.inner.channel().read_etc(cx, bytes, handles) {
8549 std::task::Poll::Ready(Ok(())) => {}
8550 std::task::Poll::Pending => return std::task::Poll::Pending,
8551 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8552 this.is_terminated = true;
8553 return std::task::Poll::Ready(None);
8554 }
8555 std::task::Poll::Ready(Err(e)) => {
8556 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8557 e.into(),
8558 ))))
8559 }
8560 }
8561
8562 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8564
8565 std::task::Poll::Ready(Some(match header.ordinal {
8566 0x2261cc6eee9726a0 => {
8567 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
8568 let mut req = fidl::new_empty!(
8569 RuleTableV6NewRuleSetRequest,
8570 fidl::encoding::DefaultFuchsiaResourceDialect
8571 );
8572 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RuleTableV6NewRuleSetRequest>(&header, _body_bytes, handles, &mut req)?;
8573 let control_handle = RuleTableV6ControlHandle { inner: this.inner.clone() };
8574 Ok(RuleTableV6Request::NewRuleSet {
8575 priority: req.priority,
8576 rule_set: req.rule_set,
8577
8578 control_handle,
8579 })
8580 }
8581 _ => Err(fidl::Error::UnknownOrdinal {
8582 ordinal: header.ordinal,
8583 protocol_name:
8584 <RuleTableV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8585 }),
8586 }))
8587 },
8588 )
8589 }
8590}
8591
8592#[derive(Debug)]
8594pub enum RuleTableV6Request {
8595 NewRuleSet {
8606 priority: u32,
8607 rule_set: fidl::endpoints::ServerEnd<RuleSetV6Marker>,
8608 control_handle: RuleTableV6ControlHandle,
8609 },
8610}
8611
8612impl RuleTableV6Request {
8613 #[allow(irrefutable_let_patterns)]
8614 pub fn into_new_rule_set(
8615 self,
8616 ) -> Option<(u32, fidl::endpoints::ServerEnd<RuleSetV6Marker>, RuleTableV6ControlHandle)> {
8617 if let RuleTableV6Request::NewRuleSet { priority, rule_set, control_handle } = self {
8618 Some((priority, rule_set, control_handle))
8619 } else {
8620 None
8621 }
8622 }
8623
8624 pub fn method_name(&self) -> &'static str {
8626 match *self {
8627 RuleTableV6Request::NewRuleSet { .. } => "new_rule_set",
8628 }
8629 }
8630}
8631
8632#[derive(Debug, Clone)]
8633pub struct RuleTableV6ControlHandle {
8634 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8635}
8636
8637impl fidl::endpoints::ControlHandle for RuleTableV6ControlHandle {
8638 fn shutdown(&self) {
8639 self.inner.shutdown()
8640 }
8641 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8642 self.inner.shutdown_with_epitaph(status)
8643 }
8644
8645 fn is_closed(&self) -> bool {
8646 self.inner.channel().is_closed()
8647 }
8648 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8649 self.inner.channel().on_closed()
8650 }
8651
8652 #[cfg(target_os = "fuchsia")]
8653 fn signal_peer(
8654 &self,
8655 clear_mask: zx::Signals,
8656 set_mask: zx::Signals,
8657 ) -> Result<(), zx_status::Status> {
8658 use fidl::Peered;
8659 self.inner.channel().signal_peer(clear_mask, set_mask)
8660 }
8661}
8662
8663impl RuleTableV6ControlHandle {}
8664
8665mod internal {
8666 use super::*;
8667
8668 impl fidl::encoding::ResourceTypeMarker for BaseRouteTableGetAuthorizationForRouteTableResponse {
8669 type Borrowed<'a> = &'a mut Self;
8670 fn take_or_borrow<'a>(
8671 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8672 ) -> Self::Borrowed<'a> {
8673 value
8674 }
8675 }
8676
8677 unsafe impl fidl::encoding::TypeMarker for BaseRouteTableGetAuthorizationForRouteTableResponse {
8678 type Owned = Self;
8679
8680 #[inline(always)]
8681 fn inline_align(_context: fidl::encoding::Context) -> usize {
8682 4
8683 }
8684
8685 #[inline(always)]
8686 fn inline_size(_context: fidl::encoding::Context) -> usize {
8687 8
8688 }
8689 }
8690
8691 unsafe impl
8692 fidl::encoding::Encode<
8693 BaseRouteTableGetAuthorizationForRouteTableResponse,
8694 fidl::encoding::DefaultFuchsiaResourceDialect,
8695 > for &mut BaseRouteTableGetAuthorizationForRouteTableResponse
8696 {
8697 #[inline]
8698 unsafe fn encode(
8699 self,
8700 encoder: &mut fidl::encoding::Encoder<
8701 '_,
8702 fidl::encoding::DefaultFuchsiaResourceDialect,
8703 >,
8704 offset: usize,
8705 _depth: fidl::encoding::Depth,
8706 ) -> fidl::Result<()> {
8707 encoder
8708 .debug_check_bounds::<BaseRouteTableGetAuthorizationForRouteTableResponse>(offset);
8709 fidl::encoding::Encode::<BaseRouteTableGetAuthorizationForRouteTableResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8711 (
8712 <GrantForRouteTableAuthorization as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.credential),
8713 ),
8714 encoder, offset, _depth
8715 )
8716 }
8717 }
8718 unsafe impl<
8719 T0: fidl::encoding::Encode<
8720 GrantForRouteTableAuthorization,
8721 fidl::encoding::DefaultFuchsiaResourceDialect,
8722 >,
8723 >
8724 fidl::encoding::Encode<
8725 BaseRouteTableGetAuthorizationForRouteTableResponse,
8726 fidl::encoding::DefaultFuchsiaResourceDialect,
8727 > for (T0,)
8728 {
8729 #[inline]
8730 unsafe fn encode(
8731 self,
8732 encoder: &mut fidl::encoding::Encoder<
8733 '_,
8734 fidl::encoding::DefaultFuchsiaResourceDialect,
8735 >,
8736 offset: usize,
8737 depth: fidl::encoding::Depth,
8738 ) -> fidl::Result<()> {
8739 encoder
8740 .debug_check_bounds::<BaseRouteTableGetAuthorizationForRouteTableResponse>(offset);
8741 self.0.encode(encoder, offset + 0, depth)?;
8745 Ok(())
8746 }
8747 }
8748
8749 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8750 for BaseRouteTableGetAuthorizationForRouteTableResponse
8751 {
8752 #[inline(always)]
8753 fn new_empty() -> Self {
8754 Self {
8755 credential: fidl::new_empty!(
8756 GrantForRouteTableAuthorization,
8757 fidl::encoding::DefaultFuchsiaResourceDialect
8758 ),
8759 }
8760 }
8761
8762 #[inline]
8763 unsafe fn decode(
8764 &mut self,
8765 decoder: &mut fidl::encoding::Decoder<
8766 '_,
8767 fidl::encoding::DefaultFuchsiaResourceDialect,
8768 >,
8769 offset: usize,
8770 _depth: fidl::encoding::Depth,
8771 ) -> fidl::Result<()> {
8772 decoder.debug_check_bounds::<Self>(offset);
8773 fidl::decode!(
8775 GrantForRouteTableAuthorization,
8776 fidl::encoding::DefaultFuchsiaResourceDialect,
8777 &mut self.credential,
8778 decoder,
8779 offset + 0,
8780 _depth
8781 )?;
8782 Ok(())
8783 }
8784 }
8785
8786 impl fidl::encoding::ResourceTypeMarker for GrantForRouteTableAuthorization {
8787 type Borrowed<'a> = &'a mut Self;
8788 fn take_or_borrow<'a>(
8789 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8790 ) -> Self::Borrowed<'a> {
8791 value
8792 }
8793 }
8794
8795 unsafe impl fidl::encoding::TypeMarker for GrantForRouteTableAuthorization {
8796 type Owned = Self;
8797
8798 #[inline(always)]
8799 fn inline_align(_context: fidl::encoding::Context) -> usize {
8800 4
8801 }
8802
8803 #[inline(always)]
8804 fn inline_size(_context: fidl::encoding::Context) -> usize {
8805 8
8806 }
8807 }
8808
8809 unsafe impl
8810 fidl::encoding::Encode<
8811 GrantForRouteTableAuthorization,
8812 fidl::encoding::DefaultFuchsiaResourceDialect,
8813 > for &mut GrantForRouteTableAuthorization
8814 {
8815 #[inline]
8816 unsafe fn encode(
8817 self,
8818 encoder: &mut fidl::encoding::Encoder<
8819 '_,
8820 fidl::encoding::DefaultFuchsiaResourceDialect,
8821 >,
8822 offset: usize,
8823 _depth: fidl::encoding::Depth,
8824 ) -> fidl::Result<()> {
8825 encoder.debug_check_bounds::<GrantForRouteTableAuthorization>(offset);
8826 fidl::encoding::Encode::<
8828 GrantForRouteTableAuthorization,
8829 fidl::encoding::DefaultFuchsiaResourceDialect,
8830 >::encode(
8831 (
8832 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.table_id),
8833 <fidl::encoding::HandleType<
8834 fidl::Event,
8835 { fidl::ObjectType::EVENT.into_raw() },
8836 3,
8837 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8838 &mut self.token
8839 ),
8840 ),
8841 encoder,
8842 offset,
8843 _depth,
8844 )
8845 }
8846 }
8847 unsafe impl<
8848 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
8849 T1: fidl::encoding::Encode<
8850 fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>,
8851 fidl::encoding::DefaultFuchsiaResourceDialect,
8852 >,
8853 >
8854 fidl::encoding::Encode<
8855 GrantForRouteTableAuthorization,
8856 fidl::encoding::DefaultFuchsiaResourceDialect,
8857 > for (T0, T1)
8858 {
8859 #[inline]
8860 unsafe fn encode(
8861 self,
8862 encoder: &mut fidl::encoding::Encoder<
8863 '_,
8864 fidl::encoding::DefaultFuchsiaResourceDialect,
8865 >,
8866 offset: usize,
8867 depth: fidl::encoding::Depth,
8868 ) -> fidl::Result<()> {
8869 encoder.debug_check_bounds::<GrantForRouteTableAuthorization>(offset);
8870 self.0.encode(encoder, offset + 0, depth)?;
8874 self.1.encode(encoder, offset + 4, depth)?;
8875 Ok(())
8876 }
8877 }
8878
8879 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8880 for GrantForRouteTableAuthorization
8881 {
8882 #[inline(always)]
8883 fn new_empty() -> Self {
8884 Self {
8885 table_id: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
8886 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>, fidl::encoding::DefaultFuchsiaResourceDialect),
8887 }
8888 }
8889
8890 #[inline]
8891 unsafe fn decode(
8892 &mut self,
8893 decoder: &mut fidl::encoding::Decoder<
8894 '_,
8895 fidl::encoding::DefaultFuchsiaResourceDialect,
8896 >,
8897 offset: usize,
8898 _depth: fidl::encoding::Depth,
8899 ) -> fidl::Result<()> {
8900 decoder.debug_check_bounds::<Self>(offset);
8901 fidl::decode!(
8903 u32,
8904 fidl::encoding::DefaultFuchsiaResourceDialect,
8905 &mut self.table_id,
8906 decoder,
8907 offset + 0,
8908 _depth
8909 )?;
8910 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 3>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 4, _depth)?;
8911 Ok(())
8912 }
8913 }
8914
8915 impl fidl::encoding::ResourceTypeMarker for ProofOfRouteTableAuthorization {
8916 type Borrowed<'a> = &'a mut Self;
8917 fn take_or_borrow<'a>(
8918 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8919 ) -> Self::Borrowed<'a> {
8920 value
8921 }
8922 }
8923
8924 unsafe impl fidl::encoding::TypeMarker for ProofOfRouteTableAuthorization {
8925 type Owned = Self;
8926
8927 #[inline(always)]
8928 fn inline_align(_context: fidl::encoding::Context) -> usize {
8929 4
8930 }
8931
8932 #[inline(always)]
8933 fn inline_size(_context: fidl::encoding::Context) -> usize {
8934 8
8935 }
8936 }
8937
8938 unsafe impl
8939 fidl::encoding::Encode<
8940 ProofOfRouteTableAuthorization,
8941 fidl::encoding::DefaultFuchsiaResourceDialect,
8942 > for &mut ProofOfRouteTableAuthorization
8943 {
8944 #[inline]
8945 unsafe fn encode(
8946 self,
8947 encoder: &mut fidl::encoding::Encoder<
8948 '_,
8949 fidl::encoding::DefaultFuchsiaResourceDialect,
8950 >,
8951 offset: usize,
8952 _depth: fidl::encoding::Depth,
8953 ) -> fidl::Result<()> {
8954 encoder.debug_check_bounds::<ProofOfRouteTableAuthorization>(offset);
8955 fidl::encoding::Encode::<
8957 ProofOfRouteTableAuthorization,
8958 fidl::encoding::DefaultFuchsiaResourceDialect,
8959 >::encode(
8960 (
8961 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.table),
8962 <fidl::encoding::HandleType<
8963 fidl::Event,
8964 { fidl::ObjectType::EVENT.into_raw() },
8965 0,
8966 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8967 &mut self.token
8968 ),
8969 ),
8970 encoder,
8971 offset,
8972 _depth,
8973 )
8974 }
8975 }
8976 unsafe impl<
8977 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
8978 T1: fidl::encoding::Encode<
8979 fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 0>,
8980 fidl::encoding::DefaultFuchsiaResourceDialect,
8981 >,
8982 >
8983 fidl::encoding::Encode<
8984 ProofOfRouteTableAuthorization,
8985 fidl::encoding::DefaultFuchsiaResourceDialect,
8986 > for (T0, T1)
8987 {
8988 #[inline]
8989 unsafe fn encode(
8990 self,
8991 encoder: &mut fidl::encoding::Encoder<
8992 '_,
8993 fidl::encoding::DefaultFuchsiaResourceDialect,
8994 >,
8995 offset: usize,
8996 depth: fidl::encoding::Depth,
8997 ) -> fidl::Result<()> {
8998 encoder.debug_check_bounds::<ProofOfRouteTableAuthorization>(offset);
8999 self.0.encode(encoder, offset + 0, depth)?;
9003 self.1.encode(encoder, offset + 4, depth)?;
9004 Ok(())
9005 }
9006 }
9007
9008 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9009 for ProofOfRouteTableAuthorization
9010 {
9011 #[inline(always)]
9012 fn new_empty() -> Self {
9013 Self {
9014 table: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
9015 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 0>, fidl::encoding::DefaultFuchsiaResourceDialect),
9016 }
9017 }
9018
9019 #[inline]
9020 unsafe fn decode(
9021 &mut self,
9022 decoder: &mut fidl::encoding::Decoder<
9023 '_,
9024 fidl::encoding::DefaultFuchsiaResourceDialect,
9025 >,
9026 offset: usize,
9027 _depth: fidl::encoding::Depth,
9028 ) -> fidl::Result<()> {
9029 decoder.debug_check_bounds::<Self>(offset);
9030 fidl::decode!(
9032 u32,
9033 fidl::encoding::DefaultFuchsiaResourceDialect,
9034 &mut self.table,
9035 decoder,
9036 offset + 0,
9037 _depth
9038 )?;
9039 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 0>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 4, _depth)?;
9040 Ok(())
9041 }
9042 }
9043
9044 impl fidl::encoding::ResourceTypeMarker for RouteSetV4AddRouteRequest {
9045 type Borrowed<'a> = &'a mut Self;
9046 fn take_or_borrow<'a>(
9047 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9048 ) -> Self::Borrowed<'a> {
9049 value
9050 }
9051 }
9052
9053 unsafe impl fidl::encoding::TypeMarker for RouteSetV4AddRouteRequest {
9054 type Owned = Self;
9055
9056 #[inline(always)]
9057 fn inline_align(_context: fidl::encoding::Context) -> usize {
9058 8
9059 }
9060
9061 #[inline(always)]
9062 fn inline_size(_context: fidl::encoding::Context) -> usize {
9063 40
9064 }
9065 }
9066
9067 unsafe impl
9068 fidl::encoding::Encode<
9069 RouteSetV4AddRouteRequest,
9070 fidl::encoding::DefaultFuchsiaResourceDialect,
9071 > for &mut RouteSetV4AddRouteRequest
9072 {
9073 #[inline]
9074 unsafe fn encode(
9075 self,
9076 encoder: &mut fidl::encoding::Encoder<
9077 '_,
9078 fidl::encoding::DefaultFuchsiaResourceDialect,
9079 >,
9080 offset: usize,
9081 _depth: fidl::encoding::Depth,
9082 ) -> fidl::Result<()> {
9083 encoder.debug_check_bounds::<RouteSetV4AddRouteRequest>(offset);
9084 fidl::encoding::Encode::<
9086 RouteSetV4AddRouteRequest,
9087 fidl::encoding::DefaultFuchsiaResourceDialect,
9088 >::encode(
9089 (<fidl_fuchsia_net_routes::RouteV4 as fidl::encoding::ValueTypeMarker>::borrow(
9090 &self.route,
9091 ),),
9092 encoder,
9093 offset,
9094 _depth,
9095 )
9096 }
9097 }
9098 unsafe impl<
9099 T0: fidl::encoding::Encode<
9100 fidl_fuchsia_net_routes::RouteV4,
9101 fidl::encoding::DefaultFuchsiaResourceDialect,
9102 >,
9103 >
9104 fidl::encoding::Encode<
9105 RouteSetV4AddRouteRequest,
9106 fidl::encoding::DefaultFuchsiaResourceDialect,
9107 > for (T0,)
9108 {
9109 #[inline]
9110 unsafe fn encode(
9111 self,
9112 encoder: &mut fidl::encoding::Encoder<
9113 '_,
9114 fidl::encoding::DefaultFuchsiaResourceDialect,
9115 >,
9116 offset: usize,
9117 depth: fidl::encoding::Depth,
9118 ) -> fidl::Result<()> {
9119 encoder.debug_check_bounds::<RouteSetV4AddRouteRequest>(offset);
9120 self.0.encode(encoder, offset + 0, depth)?;
9124 Ok(())
9125 }
9126 }
9127
9128 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9129 for RouteSetV4AddRouteRequest
9130 {
9131 #[inline(always)]
9132 fn new_empty() -> Self {
9133 Self {
9134 route: fidl::new_empty!(
9135 fidl_fuchsia_net_routes::RouteV4,
9136 fidl::encoding::DefaultFuchsiaResourceDialect
9137 ),
9138 }
9139 }
9140
9141 #[inline]
9142 unsafe fn decode(
9143 &mut self,
9144 decoder: &mut fidl::encoding::Decoder<
9145 '_,
9146 fidl::encoding::DefaultFuchsiaResourceDialect,
9147 >,
9148 offset: usize,
9149 _depth: fidl::encoding::Depth,
9150 ) -> fidl::Result<()> {
9151 decoder.debug_check_bounds::<Self>(offset);
9152 fidl::decode!(
9154 fidl_fuchsia_net_routes::RouteV4,
9155 fidl::encoding::DefaultFuchsiaResourceDialect,
9156 &mut self.route,
9157 decoder,
9158 offset + 0,
9159 _depth
9160 )?;
9161 Ok(())
9162 }
9163 }
9164
9165 impl fidl::encoding::ResourceTypeMarker for RouteSetV4AuthenticateForInterfaceRequest {
9166 type Borrowed<'a> = &'a mut Self;
9167 fn take_or_borrow<'a>(
9168 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9169 ) -> Self::Borrowed<'a> {
9170 value
9171 }
9172 }
9173
9174 unsafe impl fidl::encoding::TypeMarker for RouteSetV4AuthenticateForInterfaceRequest {
9175 type Owned = Self;
9176
9177 #[inline(always)]
9178 fn inline_align(_context: fidl::encoding::Context) -> usize {
9179 8
9180 }
9181
9182 #[inline(always)]
9183 fn inline_size(_context: fidl::encoding::Context) -> usize {
9184 16
9185 }
9186 }
9187
9188 unsafe impl
9189 fidl::encoding::Encode<
9190 RouteSetV4AuthenticateForInterfaceRequest,
9191 fidl::encoding::DefaultFuchsiaResourceDialect,
9192 > for &mut RouteSetV4AuthenticateForInterfaceRequest
9193 {
9194 #[inline]
9195 unsafe fn encode(
9196 self,
9197 encoder: &mut fidl::encoding::Encoder<
9198 '_,
9199 fidl::encoding::DefaultFuchsiaResourceDialect,
9200 >,
9201 offset: usize,
9202 _depth: fidl::encoding::Depth,
9203 ) -> fidl::Result<()> {
9204 encoder.debug_check_bounds::<RouteSetV4AuthenticateForInterfaceRequest>(offset);
9205 fidl::encoding::Encode::<RouteSetV4AuthenticateForInterfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9207 (
9208 <fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.credential),
9209 ),
9210 encoder, offset, _depth
9211 )
9212 }
9213 }
9214 unsafe impl<
9215 T0: fidl::encoding::Encode<
9216 fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
9217 fidl::encoding::DefaultFuchsiaResourceDialect,
9218 >,
9219 >
9220 fidl::encoding::Encode<
9221 RouteSetV4AuthenticateForInterfaceRequest,
9222 fidl::encoding::DefaultFuchsiaResourceDialect,
9223 > for (T0,)
9224 {
9225 #[inline]
9226 unsafe fn encode(
9227 self,
9228 encoder: &mut fidl::encoding::Encoder<
9229 '_,
9230 fidl::encoding::DefaultFuchsiaResourceDialect,
9231 >,
9232 offset: usize,
9233 depth: fidl::encoding::Depth,
9234 ) -> fidl::Result<()> {
9235 encoder.debug_check_bounds::<RouteSetV4AuthenticateForInterfaceRequest>(offset);
9236 self.0.encode(encoder, offset + 0, depth)?;
9240 Ok(())
9241 }
9242 }
9243
9244 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9245 for RouteSetV4AuthenticateForInterfaceRequest
9246 {
9247 #[inline(always)]
9248 fn new_empty() -> Self {
9249 Self {
9250 credential: fidl::new_empty!(
9251 fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
9252 fidl::encoding::DefaultFuchsiaResourceDialect
9253 ),
9254 }
9255 }
9256
9257 #[inline]
9258 unsafe fn decode(
9259 &mut self,
9260 decoder: &mut fidl::encoding::Decoder<
9261 '_,
9262 fidl::encoding::DefaultFuchsiaResourceDialect,
9263 >,
9264 offset: usize,
9265 _depth: fidl::encoding::Depth,
9266 ) -> fidl::Result<()> {
9267 decoder.debug_check_bounds::<Self>(offset);
9268 fidl::decode!(
9270 fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
9271 fidl::encoding::DefaultFuchsiaResourceDialect,
9272 &mut self.credential,
9273 decoder,
9274 offset + 0,
9275 _depth
9276 )?;
9277 Ok(())
9278 }
9279 }
9280
9281 impl fidl::encoding::ResourceTypeMarker for RouteSetV4RemoveRouteRequest {
9282 type Borrowed<'a> = &'a mut Self;
9283 fn take_or_borrow<'a>(
9284 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9285 ) -> Self::Borrowed<'a> {
9286 value
9287 }
9288 }
9289
9290 unsafe impl fidl::encoding::TypeMarker for RouteSetV4RemoveRouteRequest {
9291 type Owned = Self;
9292
9293 #[inline(always)]
9294 fn inline_align(_context: fidl::encoding::Context) -> usize {
9295 8
9296 }
9297
9298 #[inline(always)]
9299 fn inline_size(_context: fidl::encoding::Context) -> usize {
9300 40
9301 }
9302 }
9303
9304 unsafe impl
9305 fidl::encoding::Encode<
9306 RouteSetV4RemoveRouteRequest,
9307 fidl::encoding::DefaultFuchsiaResourceDialect,
9308 > for &mut RouteSetV4RemoveRouteRequest
9309 {
9310 #[inline]
9311 unsafe fn encode(
9312 self,
9313 encoder: &mut fidl::encoding::Encoder<
9314 '_,
9315 fidl::encoding::DefaultFuchsiaResourceDialect,
9316 >,
9317 offset: usize,
9318 _depth: fidl::encoding::Depth,
9319 ) -> fidl::Result<()> {
9320 encoder.debug_check_bounds::<RouteSetV4RemoveRouteRequest>(offset);
9321 fidl::encoding::Encode::<
9323 RouteSetV4RemoveRouteRequest,
9324 fidl::encoding::DefaultFuchsiaResourceDialect,
9325 >::encode(
9326 (<fidl_fuchsia_net_routes::RouteV4 as fidl::encoding::ValueTypeMarker>::borrow(
9327 &self.route,
9328 ),),
9329 encoder,
9330 offset,
9331 _depth,
9332 )
9333 }
9334 }
9335 unsafe impl<
9336 T0: fidl::encoding::Encode<
9337 fidl_fuchsia_net_routes::RouteV4,
9338 fidl::encoding::DefaultFuchsiaResourceDialect,
9339 >,
9340 >
9341 fidl::encoding::Encode<
9342 RouteSetV4RemoveRouteRequest,
9343 fidl::encoding::DefaultFuchsiaResourceDialect,
9344 > for (T0,)
9345 {
9346 #[inline]
9347 unsafe fn encode(
9348 self,
9349 encoder: &mut fidl::encoding::Encoder<
9350 '_,
9351 fidl::encoding::DefaultFuchsiaResourceDialect,
9352 >,
9353 offset: usize,
9354 depth: fidl::encoding::Depth,
9355 ) -> fidl::Result<()> {
9356 encoder.debug_check_bounds::<RouteSetV4RemoveRouteRequest>(offset);
9357 self.0.encode(encoder, offset + 0, depth)?;
9361 Ok(())
9362 }
9363 }
9364
9365 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9366 for RouteSetV4RemoveRouteRequest
9367 {
9368 #[inline(always)]
9369 fn new_empty() -> Self {
9370 Self {
9371 route: fidl::new_empty!(
9372 fidl_fuchsia_net_routes::RouteV4,
9373 fidl::encoding::DefaultFuchsiaResourceDialect
9374 ),
9375 }
9376 }
9377
9378 #[inline]
9379 unsafe fn decode(
9380 &mut self,
9381 decoder: &mut fidl::encoding::Decoder<
9382 '_,
9383 fidl::encoding::DefaultFuchsiaResourceDialect,
9384 >,
9385 offset: usize,
9386 _depth: fidl::encoding::Depth,
9387 ) -> fidl::Result<()> {
9388 decoder.debug_check_bounds::<Self>(offset);
9389 fidl::decode!(
9391 fidl_fuchsia_net_routes::RouteV4,
9392 fidl::encoding::DefaultFuchsiaResourceDialect,
9393 &mut self.route,
9394 decoder,
9395 offset + 0,
9396 _depth
9397 )?;
9398 Ok(())
9399 }
9400 }
9401
9402 impl fidl::encoding::ResourceTypeMarker for RouteSetV6AddRouteRequest {
9403 type Borrowed<'a> = &'a mut Self;
9404 fn take_or_borrow<'a>(
9405 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9406 ) -> Self::Borrowed<'a> {
9407 value
9408 }
9409 }
9410
9411 unsafe impl fidl::encoding::TypeMarker for RouteSetV6AddRouteRequest {
9412 type Owned = Self;
9413
9414 #[inline(always)]
9415 fn inline_align(_context: fidl::encoding::Context) -> usize {
9416 8
9417 }
9418
9419 #[inline(always)]
9420 fn inline_size(_context: fidl::encoding::Context) -> usize {
9421 56
9422 }
9423 }
9424
9425 unsafe impl
9426 fidl::encoding::Encode<
9427 RouteSetV6AddRouteRequest,
9428 fidl::encoding::DefaultFuchsiaResourceDialect,
9429 > for &mut RouteSetV6AddRouteRequest
9430 {
9431 #[inline]
9432 unsafe fn encode(
9433 self,
9434 encoder: &mut fidl::encoding::Encoder<
9435 '_,
9436 fidl::encoding::DefaultFuchsiaResourceDialect,
9437 >,
9438 offset: usize,
9439 _depth: fidl::encoding::Depth,
9440 ) -> fidl::Result<()> {
9441 encoder.debug_check_bounds::<RouteSetV6AddRouteRequest>(offset);
9442 fidl::encoding::Encode::<
9444 RouteSetV6AddRouteRequest,
9445 fidl::encoding::DefaultFuchsiaResourceDialect,
9446 >::encode(
9447 (<fidl_fuchsia_net_routes::RouteV6 as fidl::encoding::ValueTypeMarker>::borrow(
9448 &self.route,
9449 ),),
9450 encoder,
9451 offset,
9452 _depth,
9453 )
9454 }
9455 }
9456 unsafe impl<
9457 T0: fidl::encoding::Encode<
9458 fidl_fuchsia_net_routes::RouteV6,
9459 fidl::encoding::DefaultFuchsiaResourceDialect,
9460 >,
9461 >
9462 fidl::encoding::Encode<
9463 RouteSetV6AddRouteRequest,
9464 fidl::encoding::DefaultFuchsiaResourceDialect,
9465 > for (T0,)
9466 {
9467 #[inline]
9468 unsafe fn encode(
9469 self,
9470 encoder: &mut fidl::encoding::Encoder<
9471 '_,
9472 fidl::encoding::DefaultFuchsiaResourceDialect,
9473 >,
9474 offset: usize,
9475 depth: fidl::encoding::Depth,
9476 ) -> fidl::Result<()> {
9477 encoder.debug_check_bounds::<RouteSetV6AddRouteRequest>(offset);
9478 self.0.encode(encoder, offset + 0, depth)?;
9482 Ok(())
9483 }
9484 }
9485
9486 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9487 for RouteSetV6AddRouteRequest
9488 {
9489 #[inline(always)]
9490 fn new_empty() -> Self {
9491 Self {
9492 route: fidl::new_empty!(
9493 fidl_fuchsia_net_routes::RouteV6,
9494 fidl::encoding::DefaultFuchsiaResourceDialect
9495 ),
9496 }
9497 }
9498
9499 #[inline]
9500 unsafe fn decode(
9501 &mut self,
9502 decoder: &mut fidl::encoding::Decoder<
9503 '_,
9504 fidl::encoding::DefaultFuchsiaResourceDialect,
9505 >,
9506 offset: usize,
9507 _depth: fidl::encoding::Depth,
9508 ) -> fidl::Result<()> {
9509 decoder.debug_check_bounds::<Self>(offset);
9510 fidl::decode!(
9512 fidl_fuchsia_net_routes::RouteV6,
9513 fidl::encoding::DefaultFuchsiaResourceDialect,
9514 &mut self.route,
9515 decoder,
9516 offset + 0,
9517 _depth
9518 )?;
9519 Ok(())
9520 }
9521 }
9522
9523 impl fidl::encoding::ResourceTypeMarker for RouteSetV6AuthenticateForInterfaceRequest {
9524 type Borrowed<'a> = &'a mut Self;
9525 fn take_or_borrow<'a>(
9526 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9527 ) -> Self::Borrowed<'a> {
9528 value
9529 }
9530 }
9531
9532 unsafe impl fidl::encoding::TypeMarker for RouteSetV6AuthenticateForInterfaceRequest {
9533 type Owned = Self;
9534
9535 #[inline(always)]
9536 fn inline_align(_context: fidl::encoding::Context) -> usize {
9537 8
9538 }
9539
9540 #[inline(always)]
9541 fn inline_size(_context: fidl::encoding::Context) -> usize {
9542 16
9543 }
9544 }
9545
9546 unsafe impl
9547 fidl::encoding::Encode<
9548 RouteSetV6AuthenticateForInterfaceRequest,
9549 fidl::encoding::DefaultFuchsiaResourceDialect,
9550 > for &mut RouteSetV6AuthenticateForInterfaceRequest
9551 {
9552 #[inline]
9553 unsafe fn encode(
9554 self,
9555 encoder: &mut fidl::encoding::Encoder<
9556 '_,
9557 fidl::encoding::DefaultFuchsiaResourceDialect,
9558 >,
9559 offset: usize,
9560 _depth: fidl::encoding::Depth,
9561 ) -> fidl::Result<()> {
9562 encoder.debug_check_bounds::<RouteSetV6AuthenticateForInterfaceRequest>(offset);
9563 fidl::encoding::Encode::<RouteSetV6AuthenticateForInterfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9565 (
9566 <fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.credential),
9567 ),
9568 encoder, offset, _depth
9569 )
9570 }
9571 }
9572 unsafe impl<
9573 T0: fidl::encoding::Encode<
9574 fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
9575 fidl::encoding::DefaultFuchsiaResourceDialect,
9576 >,
9577 >
9578 fidl::encoding::Encode<
9579 RouteSetV6AuthenticateForInterfaceRequest,
9580 fidl::encoding::DefaultFuchsiaResourceDialect,
9581 > for (T0,)
9582 {
9583 #[inline]
9584 unsafe fn encode(
9585 self,
9586 encoder: &mut fidl::encoding::Encoder<
9587 '_,
9588 fidl::encoding::DefaultFuchsiaResourceDialect,
9589 >,
9590 offset: usize,
9591 depth: fidl::encoding::Depth,
9592 ) -> fidl::Result<()> {
9593 encoder.debug_check_bounds::<RouteSetV6AuthenticateForInterfaceRequest>(offset);
9594 self.0.encode(encoder, offset + 0, depth)?;
9598 Ok(())
9599 }
9600 }
9601
9602 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9603 for RouteSetV6AuthenticateForInterfaceRequest
9604 {
9605 #[inline(always)]
9606 fn new_empty() -> Self {
9607 Self {
9608 credential: fidl::new_empty!(
9609 fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
9610 fidl::encoding::DefaultFuchsiaResourceDialect
9611 ),
9612 }
9613 }
9614
9615 #[inline]
9616 unsafe fn decode(
9617 &mut self,
9618 decoder: &mut fidl::encoding::Decoder<
9619 '_,
9620 fidl::encoding::DefaultFuchsiaResourceDialect,
9621 >,
9622 offset: usize,
9623 _depth: fidl::encoding::Depth,
9624 ) -> fidl::Result<()> {
9625 decoder.debug_check_bounds::<Self>(offset);
9626 fidl::decode!(
9628 fidl_fuchsia_net_interfaces_admin::ProofOfInterfaceAuthorization,
9629 fidl::encoding::DefaultFuchsiaResourceDialect,
9630 &mut self.credential,
9631 decoder,
9632 offset + 0,
9633 _depth
9634 )?;
9635 Ok(())
9636 }
9637 }
9638
9639 impl fidl::encoding::ResourceTypeMarker for RouteSetV6RemoveRouteRequest {
9640 type Borrowed<'a> = &'a mut Self;
9641 fn take_or_borrow<'a>(
9642 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9643 ) -> Self::Borrowed<'a> {
9644 value
9645 }
9646 }
9647
9648 unsafe impl fidl::encoding::TypeMarker for RouteSetV6RemoveRouteRequest {
9649 type Owned = Self;
9650
9651 #[inline(always)]
9652 fn inline_align(_context: fidl::encoding::Context) -> usize {
9653 8
9654 }
9655
9656 #[inline(always)]
9657 fn inline_size(_context: fidl::encoding::Context) -> usize {
9658 56
9659 }
9660 }
9661
9662 unsafe impl
9663 fidl::encoding::Encode<
9664 RouteSetV6RemoveRouteRequest,
9665 fidl::encoding::DefaultFuchsiaResourceDialect,
9666 > for &mut RouteSetV6RemoveRouteRequest
9667 {
9668 #[inline]
9669 unsafe fn encode(
9670 self,
9671 encoder: &mut fidl::encoding::Encoder<
9672 '_,
9673 fidl::encoding::DefaultFuchsiaResourceDialect,
9674 >,
9675 offset: usize,
9676 _depth: fidl::encoding::Depth,
9677 ) -> fidl::Result<()> {
9678 encoder.debug_check_bounds::<RouteSetV6RemoveRouteRequest>(offset);
9679 fidl::encoding::Encode::<
9681 RouteSetV6RemoveRouteRequest,
9682 fidl::encoding::DefaultFuchsiaResourceDialect,
9683 >::encode(
9684 (<fidl_fuchsia_net_routes::RouteV6 as fidl::encoding::ValueTypeMarker>::borrow(
9685 &self.route,
9686 ),),
9687 encoder,
9688 offset,
9689 _depth,
9690 )
9691 }
9692 }
9693 unsafe impl<
9694 T0: fidl::encoding::Encode<
9695 fidl_fuchsia_net_routes::RouteV6,
9696 fidl::encoding::DefaultFuchsiaResourceDialect,
9697 >,
9698 >
9699 fidl::encoding::Encode<
9700 RouteSetV6RemoveRouteRequest,
9701 fidl::encoding::DefaultFuchsiaResourceDialect,
9702 > for (T0,)
9703 {
9704 #[inline]
9705 unsafe fn encode(
9706 self,
9707 encoder: &mut fidl::encoding::Encoder<
9708 '_,
9709 fidl::encoding::DefaultFuchsiaResourceDialect,
9710 >,
9711 offset: usize,
9712 depth: fidl::encoding::Depth,
9713 ) -> fidl::Result<()> {
9714 encoder.debug_check_bounds::<RouteSetV6RemoveRouteRequest>(offset);
9715 self.0.encode(encoder, offset + 0, depth)?;
9719 Ok(())
9720 }
9721 }
9722
9723 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9724 for RouteSetV6RemoveRouteRequest
9725 {
9726 #[inline(always)]
9727 fn new_empty() -> Self {
9728 Self {
9729 route: fidl::new_empty!(
9730 fidl_fuchsia_net_routes::RouteV6,
9731 fidl::encoding::DefaultFuchsiaResourceDialect
9732 ),
9733 }
9734 }
9735
9736 #[inline]
9737 unsafe fn decode(
9738 &mut self,
9739 decoder: &mut fidl::encoding::Decoder<
9740 '_,
9741 fidl::encoding::DefaultFuchsiaResourceDialect,
9742 >,
9743 offset: usize,
9744 _depth: fidl::encoding::Depth,
9745 ) -> fidl::Result<()> {
9746 decoder.debug_check_bounds::<Self>(offset);
9747 fidl::decode!(
9749 fidl_fuchsia_net_routes::RouteV6,
9750 fidl::encoding::DefaultFuchsiaResourceDialect,
9751 &mut self.route,
9752 decoder,
9753 offset + 0,
9754 _depth
9755 )?;
9756 Ok(())
9757 }
9758 }
9759
9760 impl fidl::encoding::ResourceTypeMarker for RouteTableProviderV4NewRouteTableRequest {
9761 type Borrowed<'a> = &'a mut Self;
9762 fn take_or_borrow<'a>(
9763 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9764 ) -> Self::Borrowed<'a> {
9765 value
9766 }
9767 }
9768
9769 unsafe impl fidl::encoding::TypeMarker for RouteTableProviderV4NewRouteTableRequest {
9770 type Owned = Self;
9771
9772 #[inline(always)]
9773 fn inline_align(_context: fidl::encoding::Context) -> usize {
9774 8
9775 }
9776
9777 #[inline(always)]
9778 fn inline_size(_context: fidl::encoding::Context) -> usize {
9779 24
9780 }
9781 }
9782
9783 unsafe impl
9784 fidl::encoding::Encode<
9785 RouteTableProviderV4NewRouteTableRequest,
9786 fidl::encoding::DefaultFuchsiaResourceDialect,
9787 > for &mut RouteTableProviderV4NewRouteTableRequest
9788 {
9789 #[inline]
9790 unsafe fn encode(
9791 self,
9792 encoder: &mut fidl::encoding::Encoder<
9793 '_,
9794 fidl::encoding::DefaultFuchsiaResourceDialect,
9795 >,
9796 offset: usize,
9797 _depth: fidl::encoding::Depth,
9798 ) -> fidl::Result<()> {
9799 encoder.debug_check_bounds::<RouteTableProviderV4NewRouteTableRequest>(offset);
9800 fidl::encoding::Encode::<RouteTableProviderV4NewRouteTableRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9802 (
9803 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteTableV4Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.provider),
9804 <RouteTableOptionsV4 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
9805 ),
9806 encoder, offset, _depth
9807 )
9808 }
9809 }
9810 unsafe impl<
9811 T0: fidl::encoding::Encode<
9812 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteTableV4Marker>>,
9813 fidl::encoding::DefaultFuchsiaResourceDialect,
9814 >,
9815 T1: fidl::encoding::Encode<
9816 RouteTableOptionsV4,
9817 fidl::encoding::DefaultFuchsiaResourceDialect,
9818 >,
9819 >
9820 fidl::encoding::Encode<
9821 RouteTableProviderV4NewRouteTableRequest,
9822 fidl::encoding::DefaultFuchsiaResourceDialect,
9823 > for (T0, T1)
9824 {
9825 #[inline]
9826 unsafe fn encode(
9827 self,
9828 encoder: &mut fidl::encoding::Encoder<
9829 '_,
9830 fidl::encoding::DefaultFuchsiaResourceDialect,
9831 >,
9832 offset: usize,
9833 depth: fidl::encoding::Depth,
9834 ) -> fidl::Result<()> {
9835 encoder.debug_check_bounds::<RouteTableProviderV4NewRouteTableRequest>(offset);
9836 unsafe {
9839 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9840 (ptr as *mut u64).write_unaligned(0);
9841 }
9842 self.0.encode(encoder, offset + 0, depth)?;
9844 self.1.encode(encoder, offset + 8, depth)?;
9845 Ok(())
9846 }
9847 }
9848
9849 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9850 for RouteTableProviderV4NewRouteTableRequest
9851 {
9852 #[inline(always)]
9853 fn new_empty() -> Self {
9854 Self {
9855 provider: fidl::new_empty!(
9856 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteTableV4Marker>>,
9857 fidl::encoding::DefaultFuchsiaResourceDialect
9858 ),
9859 options: fidl::new_empty!(
9860 RouteTableOptionsV4,
9861 fidl::encoding::DefaultFuchsiaResourceDialect
9862 ),
9863 }
9864 }
9865
9866 #[inline]
9867 unsafe fn decode(
9868 &mut self,
9869 decoder: &mut fidl::encoding::Decoder<
9870 '_,
9871 fidl::encoding::DefaultFuchsiaResourceDialect,
9872 >,
9873 offset: usize,
9874 _depth: fidl::encoding::Depth,
9875 ) -> fidl::Result<()> {
9876 decoder.debug_check_bounds::<Self>(offset);
9877 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
9879 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9880 let mask = 0xffffffff00000000u64;
9881 let maskedval = padval & mask;
9882 if maskedval != 0 {
9883 return Err(fidl::Error::NonZeroPadding {
9884 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
9885 });
9886 }
9887 fidl::decode!(
9888 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteTableV4Marker>>,
9889 fidl::encoding::DefaultFuchsiaResourceDialect,
9890 &mut self.provider,
9891 decoder,
9892 offset + 0,
9893 _depth
9894 )?;
9895 fidl::decode!(
9896 RouteTableOptionsV4,
9897 fidl::encoding::DefaultFuchsiaResourceDialect,
9898 &mut self.options,
9899 decoder,
9900 offset + 8,
9901 _depth
9902 )?;
9903 Ok(())
9904 }
9905 }
9906
9907 impl fidl::encoding::ResourceTypeMarker for RouteTableProviderV6NewRouteTableRequest {
9908 type Borrowed<'a> = &'a mut Self;
9909 fn take_or_borrow<'a>(
9910 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9911 ) -> Self::Borrowed<'a> {
9912 value
9913 }
9914 }
9915
9916 unsafe impl fidl::encoding::TypeMarker for RouteTableProviderV6NewRouteTableRequest {
9917 type Owned = Self;
9918
9919 #[inline(always)]
9920 fn inline_align(_context: fidl::encoding::Context) -> usize {
9921 8
9922 }
9923
9924 #[inline(always)]
9925 fn inline_size(_context: fidl::encoding::Context) -> usize {
9926 24
9927 }
9928 }
9929
9930 unsafe impl
9931 fidl::encoding::Encode<
9932 RouteTableProviderV6NewRouteTableRequest,
9933 fidl::encoding::DefaultFuchsiaResourceDialect,
9934 > for &mut RouteTableProviderV6NewRouteTableRequest
9935 {
9936 #[inline]
9937 unsafe fn encode(
9938 self,
9939 encoder: &mut fidl::encoding::Encoder<
9940 '_,
9941 fidl::encoding::DefaultFuchsiaResourceDialect,
9942 >,
9943 offset: usize,
9944 _depth: fidl::encoding::Depth,
9945 ) -> fidl::Result<()> {
9946 encoder.debug_check_bounds::<RouteTableProviderV6NewRouteTableRequest>(offset);
9947 fidl::encoding::Encode::<RouteTableProviderV6NewRouteTableRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9949 (
9950 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteTableV6Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.provider),
9951 <RouteTableOptionsV6 as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
9952 ),
9953 encoder, offset, _depth
9954 )
9955 }
9956 }
9957 unsafe impl<
9958 T0: fidl::encoding::Encode<
9959 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteTableV6Marker>>,
9960 fidl::encoding::DefaultFuchsiaResourceDialect,
9961 >,
9962 T1: fidl::encoding::Encode<
9963 RouteTableOptionsV6,
9964 fidl::encoding::DefaultFuchsiaResourceDialect,
9965 >,
9966 >
9967 fidl::encoding::Encode<
9968 RouteTableProviderV6NewRouteTableRequest,
9969 fidl::encoding::DefaultFuchsiaResourceDialect,
9970 > for (T0, T1)
9971 {
9972 #[inline]
9973 unsafe fn encode(
9974 self,
9975 encoder: &mut fidl::encoding::Encoder<
9976 '_,
9977 fidl::encoding::DefaultFuchsiaResourceDialect,
9978 >,
9979 offset: usize,
9980 depth: fidl::encoding::Depth,
9981 ) -> fidl::Result<()> {
9982 encoder.debug_check_bounds::<RouteTableProviderV6NewRouteTableRequest>(offset);
9983 unsafe {
9986 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
9987 (ptr as *mut u64).write_unaligned(0);
9988 }
9989 self.0.encode(encoder, offset + 0, depth)?;
9991 self.1.encode(encoder, offset + 8, depth)?;
9992 Ok(())
9993 }
9994 }
9995
9996 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9997 for RouteTableProviderV6NewRouteTableRequest
9998 {
9999 #[inline(always)]
10000 fn new_empty() -> Self {
10001 Self {
10002 provider: fidl::new_empty!(
10003 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteTableV6Marker>>,
10004 fidl::encoding::DefaultFuchsiaResourceDialect
10005 ),
10006 options: fidl::new_empty!(
10007 RouteTableOptionsV6,
10008 fidl::encoding::DefaultFuchsiaResourceDialect
10009 ),
10010 }
10011 }
10012
10013 #[inline]
10014 unsafe fn decode(
10015 &mut self,
10016 decoder: &mut fidl::encoding::Decoder<
10017 '_,
10018 fidl::encoding::DefaultFuchsiaResourceDialect,
10019 >,
10020 offset: usize,
10021 _depth: fidl::encoding::Depth,
10022 ) -> fidl::Result<()> {
10023 decoder.debug_check_bounds::<Self>(offset);
10024 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10026 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10027 let mask = 0xffffffff00000000u64;
10028 let maskedval = padval & mask;
10029 if maskedval != 0 {
10030 return Err(fidl::Error::NonZeroPadding {
10031 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10032 });
10033 }
10034 fidl::decode!(
10035 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteTableV6Marker>>,
10036 fidl::encoding::DefaultFuchsiaResourceDialect,
10037 &mut self.provider,
10038 decoder,
10039 offset + 0,
10040 _depth
10041 )?;
10042 fidl::decode!(
10043 RouteTableOptionsV6,
10044 fidl::encoding::DefaultFuchsiaResourceDialect,
10045 &mut self.options,
10046 decoder,
10047 offset + 8,
10048 _depth
10049 )?;
10050 Ok(())
10051 }
10052 }
10053
10054 impl fidl::encoding::ResourceTypeMarker for RouteTableV4NewRouteSetRequest {
10055 type Borrowed<'a> = &'a mut Self;
10056 fn take_or_borrow<'a>(
10057 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10058 ) -> Self::Borrowed<'a> {
10059 value
10060 }
10061 }
10062
10063 unsafe impl fidl::encoding::TypeMarker for RouteTableV4NewRouteSetRequest {
10064 type Owned = Self;
10065
10066 #[inline(always)]
10067 fn inline_align(_context: fidl::encoding::Context) -> usize {
10068 4
10069 }
10070
10071 #[inline(always)]
10072 fn inline_size(_context: fidl::encoding::Context) -> usize {
10073 4
10074 }
10075 }
10076
10077 unsafe impl
10078 fidl::encoding::Encode<
10079 RouteTableV4NewRouteSetRequest,
10080 fidl::encoding::DefaultFuchsiaResourceDialect,
10081 > for &mut RouteTableV4NewRouteSetRequest
10082 {
10083 #[inline]
10084 unsafe fn encode(
10085 self,
10086 encoder: &mut fidl::encoding::Encoder<
10087 '_,
10088 fidl::encoding::DefaultFuchsiaResourceDialect,
10089 >,
10090 offset: usize,
10091 _depth: fidl::encoding::Depth,
10092 ) -> fidl::Result<()> {
10093 encoder.debug_check_bounds::<RouteTableV4NewRouteSetRequest>(offset);
10094 fidl::encoding::Encode::<RouteTableV4NewRouteSetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10096 (
10097 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteSetV4Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.route_set),
10098 ),
10099 encoder, offset, _depth
10100 )
10101 }
10102 }
10103 unsafe impl<
10104 T0: fidl::encoding::Encode<
10105 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteSetV4Marker>>,
10106 fidl::encoding::DefaultFuchsiaResourceDialect,
10107 >,
10108 >
10109 fidl::encoding::Encode<
10110 RouteTableV4NewRouteSetRequest,
10111 fidl::encoding::DefaultFuchsiaResourceDialect,
10112 > for (T0,)
10113 {
10114 #[inline]
10115 unsafe fn encode(
10116 self,
10117 encoder: &mut fidl::encoding::Encoder<
10118 '_,
10119 fidl::encoding::DefaultFuchsiaResourceDialect,
10120 >,
10121 offset: usize,
10122 depth: fidl::encoding::Depth,
10123 ) -> fidl::Result<()> {
10124 encoder.debug_check_bounds::<RouteTableV4NewRouteSetRequest>(offset);
10125 self.0.encode(encoder, offset + 0, depth)?;
10129 Ok(())
10130 }
10131 }
10132
10133 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10134 for RouteTableV4NewRouteSetRequest
10135 {
10136 #[inline(always)]
10137 fn new_empty() -> Self {
10138 Self {
10139 route_set: fidl::new_empty!(
10140 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteSetV4Marker>>,
10141 fidl::encoding::DefaultFuchsiaResourceDialect
10142 ),
10143 }
10144 }
10145
10146 #[inline]
10147 unsafe fn decode(
10148 &mut self,
10149 decoder: &mut fidl::encoding::Decoder<
10150 '_,
10151 fidl::encoding::DefaultFuchsiaResourceDialect,
10152 >,
10153 offset: usize,
10154 _depth: fidl::encoding::Depth,
10155 ) -> fidl::Result<()> {
10156 decoder.debug_check_bounds::<Self>(offset);
10157 fidl::decode!(
10159 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteSetV4Marker>>,
10160 fidl::encoding::DefaultFuchsiaResourceDialect,
10161 &mut self.route_set,
10162 decoder,
10163 offset + 0,
10164 _depth
10165 )?;
10166 Ok(())
10167 }
10168 }
10169
10170 impl fidl::encoding::ResourceTypeMarker for RouteTableV6NewRouteSetRequest {
10171 type Borrowed<'a> = &'a mut Self;
10172 fn take_or_borrow<'a>(
10173 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10174 ) -> Self::Borrowed<'a> {
10175 value
10176 }
10177 }
10178
10179 unsafe impl fidl::encoding::TypeMarker for RouteTableV6NewRouteSetRequest {
10180 type Owned = Self;
10181
10182 #[inline(always)]
10183 fn inline_align(_context: fidl::encoding::Context) -> usize {
10184 4
10185 }
10186
10187 #[inline(always)]
10188 fn inline_size(_context: fidl::encoding::Context) -> usize {
10189 4
10190 }
10191 }
10192
10193 unsafe impl
10194 fidl::encoding::Encode<
10195 RouteTableV6NewRouteSetRequest,
10196 fidl::encoding::DefaultFuchsiaResourceDialect,
10197 > for &mut RouteTableV6NewRouteSetRequest
10198 {
10199 #[inline]
10200 unsafe fn encode(
10201 self,
10202 encoder: &mut fidl::encoding::Encoder<
10203 '_,
10204 fidl::encoding::DefaultFuchsiaResourceDialect,
10205 >,
10206 offset: usize,
10207 _depth: fidl::encoding::Depth,
10208 ) -> fidl::Result<()> {
10209 encoder.debug_check_bounds::<RouteTableV6NewRouteSetRequest>(offset);
10210 fidl::encoding::Encode::<RouteTableV6NewRouteSetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10212 (
10213 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteSetV6Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.route_set),
10214 ),
10215 encoder, offset, _depth
10216 )
10217 }
10218 }
10219 unsafe impl<
10220 T0: fidl::encoding::Encode<
10221 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteSetV6Marker>>,
10222 fidl::encoding::DefaultFuchsiaResourceDialect,
10223 >,
10224 >
10225 fidl::encoding::Encode<
10226 RouteTableV6NewRouteSetRequest,
10227 fidl::encoding::DefaultFuchsiaResourceDialect,
10228 > for (T0,)
10229 {
10230 #[inline]
10231 unsafe fn encode(
10232 self,
10233 encoder: &mut fidl::encoding::Encoder<
10234 '_,
10235 fidl::encoding::DefaultFuchsiaResourceDialect,
10236 >,
10237 offset: usize,
10238 depth: fidl::encoding::Depth,
10239 ) -> fidl::Result<()> {
10240 encoder.debug_check_bounds::<RouteTableV6NewRouteSetRequest>(offset);
10241 self.0.encode(encoder, offset + 0, depth)?;
10245 Ok(())
10246 }
10247 }
10248
10249 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10250 for RouteTableV6NewRouteSetRequest
10251 {
10252 #[inline(always)]
10253 fn new_empty() -> Self {
10254 Self {
10255 route_set: fidl::new_empty!(
10256 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteSetV6Marker>>,
10257 fidl::encoding::DefaultFuchsiaResourceDialect
10258 ),
10259 }
10260 }
10261
10262 #[inline]
10263 unsafe fn decode(
10264 &mut self,
10265 decoder: &mut fidl::encoding::Decoder<
10266 '_,
10267 fidl::encoding::DefaultFuchsiaResourceDialect,
10268 >,
10269 offset: usize,
10270 _depth: fidl::encoding::Depth,
10271 ) -> fidl::Result<()> {
10272 decoder.debug_check_bounds::<Self>(offset);
10273 fidl::decode!(
10275 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RouteSetV6Marker>>,
10276 fidl::encoding::DefaultFuchsiaResourceDialect,
10277 &mut self.route_set,
10278 decoder,
10279 offset + 0,
10280 _depth
10281 )?;
10282 Ok(())
10283 }
10284 }
10285
10286 impl fidl::encoding::ResourceTypeMarker for RuleSetV4AddRuleRequest {
10287 type Borrowed<'a> = &'a mut Self;
10288 fn take_or_borrow<'a>(
10289 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10290 ) -> Self::Borrowed<'a> {
10291 value
10292 }
10293 }
10294
10295 unsafe impl fidl::encoding::TypeMarker for RuleSetV4AddRuleRequest {
10296 type Owned = Self;
10297
10298 #[inline(always)]
10299 fn inline_align(_context: fidl::encoding::Context) -> usize {
10300 8
10301 }
10302
10303 #[inline(always)]
10304 fn inline_size(_context: fidl::encoding::Context) -> usize {
10305 40
10306 }
10307 }
10308
10309 unsafe impl
10310 fidl::encoding::Encode<
10311 RuleSetV4AddRuleRequest,
10312 fidl::encoding::DefaultFuchsiaResourceDialect,
10313 > for &mut RuleSetV4AddRuleRequest
10314 {
10315 #[inline]
10316 unsafe fn encode(
10317 self,
10318 encoder: &mut fidl::encoding::Encoder<
10319 '_,
10320 fidl::encoding::DefaultFuchsiaResourceDialect,
10321 >,
10322 offset: usize,
10323 _depth: fidl::encoding::Depth,
10324 ) -> fidl::Result<()> {
10325 encoder.debug_check_bounds::<RuleSetV4AddRuleRequest>(offset);
10326 fidl::encoding::Encode::<RuleSetV4AddRuleRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10328 (
10329 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
10330 <fidl_fuchsia_net_routes::RuleMatcherV4 as fidl::encoding::ValueTypeMarker>::borrow(&self.matcher),
10331 <fidl_fuchsia_net_routes::RuleAction as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
10332 ),
10333 encoder, offset, _depth
10334 )
10335 }
10336 }
10337 unsafe impl<
10338 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
10339 T1: fidl::encoding::Encode<
10340 fidl_fuchsia_net_routes::RuleMatcherV4,
10341 fidl::encoding::DefaultFuchsiaResourceDialect,
10342 >,
10343 T2: fidl::encoding::Encode<
10344 fidl_fuchsia_net_routes::RuleAction,
10345 fidl::encoding::DefaultFuchsiaResourceDialect,
10346 >,
10347 >
10348 fidl::encoding::Encode<
10349 RuleSetV4AddRuleRequest,
10350 fidl::encoding::DefaultFuchsiaResourceDialect,
10351 > for (T0, T1, T2)
10352 {
10353 #[inline]
10354 unsafe fn encode(
10355 self,
10356 encoder: &mut fidl::encoding::Encoder<
10357 '_,
10358 fidl::encoding::DefaultFuchsiaResourceDialect,
10359 >,
10360 offset: usize,
10361 depth: fidl::encoding::Depth,
10362 ) -> fidl::Result<()> {
10363 encoder.debug_check_bounds::<RuleSetV4AddRuleRequest>(offset);
10364 unsafe {
10367 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10368 (ptr as *mut u64).write_unaligned(0);
10369 }
10370 self.0.encode(encoder, offset + 0, depth)?;
10372 self.1.encode(encoder, offset + 8, depth)?;
10373 self.2.encode(encoder, offset + 24, depth)?;
10374 Ok(())
10375 }
10376 }
10377
10378 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10379 for RuleSetV4AddRuleRequest
10380 {
10381 #[inline(always)]
10382 fn new_empty() -> Self {
10383 Self {
10384 index: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
10385 matcher: fidl::new_empty!(
10386 fidl_fuchsia_net_routes::RuleMatcherV4,
10387 fidl::encoding::DefaultFuchsiaResourceDialect
10388 ),
10389 action: fidl::new_empty!(
10390 fidl_fuchsia_net_routes::RuleAction,
10391 fidl::encoding::DefaultFuchsiaResourceDialect
10392 ),
10393 }
10394 }
10395
10396 #[inline]
10397 unsafe fn decode(
10398 &mut self,
10399 decoder: &mut fidl::encoding::Decoder<
10400 '_,
10401 fidl::encoding::DefaultFuchsiaResourceDialect,
10402 >,
10403 offset: usize,
10404 _depth: fidl::encoding::Depth,
10405 ) -> fidl::Result<()> {
10406 decoder.debug_check_bounds::<Self>(offset);
10407 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10409 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10410 let mask = 0xffffffff00000000u64;
10411 let maskedval = padval & mask;
10412 if maskedval != 0 {
10413 return Err(fidl::Error::NonZeroPadding {
10414 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10415 });
10416 }
10417 fidl::decode!(
10418 u32,
10419 fidl::encoding::DefaultFuchsiaResourceDialect,
10420 &mut self.index,
10421 decoder,
10422 offset + 0,
10423 _depth
10424 )?;
10425 fidl::decode!(
10426 fidl_fuchsia_net_routes::RuleMatcherV4,
10427 fidl::encoding::DefaultFuchsiaResourceDialect,
10428 &mut self.matcher,
10429 decoder,
10430 offset + 8,
10431 _depth
10432 )?;
10433 fidl::decode!(
10434 fidl_fuchsia_net_routes::RuleAction,
10435 fidl::encoding::DefaultFuchsiaResourceDialect,
10436 &mut self.action,
10437 decoder,
10438 offset + 24,
10439 _depth
10440 )?;
10441 Ok(())
10442 }
10443 }
10444
10445 impl fidl::encoding::ResourceTypeMarker for RuleSetV6AddRuleRequest {
10446 type Borrowed<'a> = &'a mut Self;
10447 fn take_or_borrow<'a>(
10448 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10449 ) -> Self::Borrowed<'a> {
10450 value
10451 }
10452 }
10453
10454 unsafe impl fidl::encoding::TypeMarker for RuleSetV6AddRuleRequest {
10455 type Owned = Self;
10456
10457 #[inline(always)]
10458 fn inline_align(_context: fidl::encoding::Context) -> usize {
10459 8
10460 }
10461
10462 #[inline(always)]
10463 fn inline_size(_context: fidl::encoding::Context) -> usize {
10464 40
10465 }
10466 }
10467
10468 unsafe impl
10469 fidl::encoding::Encode<
10470 RuleSetV6AddRuleRequest,
10471 fidl::encoding::DefaultFuchsiaResourceDialect,
10472 > for &mut RuleSetV6AddRuleRequest
10473 {
10474 #[inline]
10475 unsafe fn encode(
10476 self,
10477 encoder: &mut fidl::encoding::Encoder<
10478 '_,
10479 fidl::encoding::DefaultFuchsiaResourceDialect,
10480 >,
10481 offset: usize,
10482 _depth: fidl::encoding::Depth,
10483 ) -> fidl::Result<()> {
10484 encoder.debug_check_bounds::<RuleSetV6AddRuleRequest>(offset);
10485 fidl::encoding::Encode::<RuleSetV6AddRuleRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10487 (
10488 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.index),
10489 <fidl_fuchsia_net_routes::RuleMatcherV6 as fidl::encoding::ValueTypeMarker>::borrow(&self.matcher),
10490 <fidl_fuchsia_net_routes::RuleAction as fidl::encoding::ValueTypeMarker>::borrow(&self.action),
10491 ),
10492 encoder, offset, _depth
10493 )
10494 }
10495 }
10496 unsafe impl<
10497 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
10498 T1: fidl::encoding::Encode<
10499 fidl_fuchsia_net_routes::RuleMatcherV6,
10500 fidl::encoding::DefaultFuchsiaResourceDialect,
10501 >,
10502 T2: fidl::encoding::Encode<
10503 fidl_fuchsia_net_routes::RuleAction,
10504 fidl::encoding::DefaultFuchsiaResourceDialect,
10505 >,
10506 >
10507 fidl::encoding::Encode<
10508 RuleSetV6AddRuleRequest,
10509 fidl::encoding::DefaultFuchsiaResourceDialect,
10510 > for (T0, T1, T2)
10511 {
10512 #[inline]
10513 unsafe fn encode(
10514 self,
10515 encoder: &mut fidl::encoding::Encoder<
10516 '_,
10517 fidl::encoding::DefaultFuchsiaResourceDialect,
10518 >,
10519 offset: usize,
10520 depth: fidl::encoding::Depth,
10521 ) -> fidl::Result<()> {
10522 encoder.debug_check_bounds::<RuleSetV6AddRuleRequest>(offset);
10523 unsafe {
10526 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
10527 (ptr as *mut u64).write_unaligned(0);
10528 }
10529 self.0.encode(encoder, offset + 0, depth)?;
10531 self.1.encode(encoder, offset + 8, depth)?;
10532 self.2.encode(encoder, offset + 24, depth)?;
10533 Ok(())
10534 }
10535 }
10536
10537 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10538 for RuleSetV6AddRuleRequest
10539 {
10540 #[inline(always)]
10541 fn new_empty() -> Self {
10542 Self {
10543 index: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
10544 matcher: fidl::new_empty!(
10545 fidl_fuchsia_net_routes::RuleMatcherV6,
10546 fidl::encoding::DefaultFuchsiaResourceDialect
10547 ),
10548 action: fidl::new_empty!(
10549 fidl_fuchsia_net_routes::RuleAction,
10550 fidl::encoding::DefaultFuchsiaResourceDialect
10551 ),
10552 }
10553 }
10554
10555 #[inline]
10556 unsafe fn decode(
10557 &mut self,
10558 decoder: &mut fidl::encoding::Decoder<
10559 '_,
10560 fidl::encoding::DefaultFuchsiaResourceDialect,
10561 >,
10562 offset: usize,
10563 _depth: fidl::encoding::Depth,
10564 ) -> fidl::Result<()> {
10565 decoder.debug_check_bounds::<Self>(offset);
10566 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
10568 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10569 let mask = 0xffffffff00000000u64;
10570 let maskedval = padval & mask;
10571 if maskedval != 0 {
10572 return Err(fidl::Error::NonZeroPadding {
10573 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
10574 });
10575 }
10576 fidl::decode!(
10577 u32,
10578 fidl::encoding::DefaultFuchsiaResourceDialect,
10579 &mut self.index,
10580 decoder,
10581 offset + 0,
10582 _depth
10583 )?;
10584 fidl::decode!(
10585 fidl_fuchsia_net_routes::RuleMatcherV6,
10586 fidl::encoding::DefaultFuchsiaResourceDialect,
10587 &mut self.matcher,
10588 decoder,
10589 offset + 8,
10590 _depth
10591 )?;
10592 fidl::decode!(
10593 fidl_fuchsia_net_routes::RuleAction,
10594 fidl::encoding::DefaultFuchsiaResourceDialect,
10595 &mut self.action,
10596 decoder,
10597 offset + 24,
10598 _depth
10599 )?;
10600 Ok(())
10601 }
10602 }
10603
10604 impl fidl::encoding::ResourceTypeMarker for RuleTableV4NewRuleSetRequest {
10605 type Borrowed<'a> = &'a mut Self;
10606 fn take_or_borrow<'a>(
10607 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10608 ) -> Self::Borrowed<'a> {
10609 value
10610 }
10611 }
10612
10613 unsafe impl fidl::encoding::TypeMarker for RuleTableV4NewRuleSetRequest {
10614 type Owned = Self;
10615
10616 #[inline(always)]
10617 fn inline_align(_context: fidl::encoding::Context) -> usize {
10618 4
10619 }
10620
10621 #[inline(always)]
10622 fn inline_size(_context: fidl::encoding::Context) -> usize {
10623 8
10624 }
10625 }
10626
10627 unsafe impl
10628 fidl::encoding::Encode<
10629 RuleTableV4NewRuleSetRequest,
10630 fidl::encoding::DefaultFuchsiaResourceDialect,
10631 > for &mut RuleTableV4NewRuleSetRequest
10632 {
10633 #[inline]
10634 unsafe fn encode(
10635 self,
10636 encoder: &mut fidl::encoding::Encoder<
10637 '_,
10638 fidl::encoding::DefaultFuchsiaResourceDialect,
10639 >,
10640 offset: usize,
10641 _depth: fidl::encoding::Depth,
10642 ) -> fidl::Result<()> {
10643 encoder.debug_check_bounds::<RuleTableV4NewRuleSetRequest>(offset);
10644 fidl::encoding::Encode::<RuleTableV4NewRuleSetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10646 (
10647 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.priority),
10648 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RuleSetV4Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.rule_set),
10649 ),
10650 encoder, offset, _depth
10651 )
10652 }
10653 }
10654 unsafe impl<
10655 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
10656 T1: fidl::encoding::Encode<
10657 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RuleSetV4Marker>>,
10658 fidl::encoding::DefaultFuchsiaResourceDialect,
10659 >,
10660 >
10661 fidl::encoding::Encode<
10662 RuleTableV4NewRuleSetRequest,
10663 fidl::encoding::DefaultFuchsiaResourceDialect,
10664 > for (T0, T1)
10665 {
10666 #[inline]
10667 unsafe fn encode(
10668 self,
10669 encoder: &mut fidl::encoding::Encoder<
10670 '_,
10671 fidl::encoding::DefaultFuchsiaResourceDialect,
10672 >,
10673 offset: usize,
10674 depth: fidl::encoding::Depth,
10675 ) -> fidl::Result<()> {
10676 encoder.debug_check_bounds::<RuleTableV4NewRuleSetRequest>(offset);
10677 self.0.encode(encoder, offset + 0, depth)?;
10681 self.1.encode(encoder, offset + 4, depth)?;
10682 Ok(())
10683 }
10684 }
10685
10686 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10687 for RuleTableV4NewRuleSetRequest
10688 {
10689 #[inline(always)]
10690 fn new_empty() -> Self {
10691 Self {
10692 priority: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
10693 rule_set: fidl::new_empty!(
10694 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RuleSetV4Marker>>,
10695 fidl::encoding::DefaultFuchsiaResourceDialect
10696 ),
10697 }
10698 }
10699
10700 #[inline]
10701 unsafe fn decode(
10702 &mut self,
10703 decoder: &mut fidl::encoding::Decoder<
10704 '_,
10705 fidl::encoding::DefaultFuchsiaResourceDialect,
10706 >,
10707 offset: usize,
10708 _depth: fidl::encoding::Depth,
10709 ) -> fidl::Result<()> {
10710 decoder.debug_check_bounds::<Self>(offset);
10711 fidl::decode!(
10713 u32,
10714 fidl::encoding::DefaultFuchsiaResourceDialect,
10715 &mut self.priority,
10716 decoder,
10717 offset + 0,
10718 _depth
10719 )?;
10720 fidl::decode!(
10721 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RuleSetV4Marker>>,
10722 fidl::encoding::DefaultFuchsiaResourceDialect,
10723 &mut self.rule_set,
10724 decoder,
10725 offset + 4,
10726 _depth
10727 )?;
10728 Ok(())
10729 }
10730 }
10731
10732 impl fidl::encoding::ResourceTypeMarker for RuleTableV6NewRuleSetRequest {
10733 type Borrowed<'a> = &'a mut Self;
10734 fn take_or_borrow<'a>(
10735 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10736 ) -> Self::Borrowed<'a> {
10737 value
10738 }
10739 }
10740
10741 unsafe impl fidl::encoding::TypeMarker for RuleTableV6NewRuleSetRequest {
10742 type Owned = Self;
10743
10744 #[inline(always)]
10745 fn inline_align(_context: fidl::encoding::Context) -> usize {
10746 4
10747 }
10748
10749 #[inline(always)]
10750 fn inline_size(_context: fidl::encoding::Context) -> usize {
10751 8
10752 }
10753 }
10754
10755 unsafe impl
10756 fidl::encoding::Encode<
10757 RuleTableV6NewRuleSetRequest,
10758 fidl::encoding::DefaultFuchsiaResourceDialect,
10759 > for &mut RuleTableV6NewRuleSetRequest
10760 {
10761 #[inline]
10762 unsafe fn encode(
10763 self,
10764 encoder: &mut fidl::encoding::Encoder<
10765 '_,
10766 fidl::encoding::DefaultFuchsiaResourceDialect,
10767 >,
10768 offset: usize,
10769 _depth: fidl::encoding::Depth,
10770 ) -> fidl::Result<()> {
10771 encoder.debug_check_bounds::<RuleTableV6NewRuleSetRequest>(offset);
10772 fidl::encoding::Encode::<RuleTableV6NewRuleSetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10774 (
10775 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.priority),
10776 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RuleSetV6Marker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.rule_set),
10777 ),
10778 encoder, offset, _depth
10779 )
10780 }
10781 }
10782 unsafe impl<
10783 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
10784 T1: fidl::encoding::Encode<
10785 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RuleSetV6Marker>>,
10786 fidl::encoding::DefaultFuchsiaResourceDialect,
10787 >,
10788 >
10789 fidl::encoding::Encode<
10790 RuleTableV6NewRuleSetRequest,
10791 fidl::encoding::DefaultFuchsiaResourceDialect,
10792 > for (T0, T1)
10793 {
10794 #[inline]
10795 unsafe fn encode(
10796 self,
10797 encoder: &mut fidl::encoding::Encoder<
10798 '_,
10799 fidl::encoding::DefaultFuchsiaResourceDialect,
10800 >,
10801 offset: usize,
10802 depth: fidl::encoding::Depth,
10803 ) -> fidl::Result<()> {
10804 encoder.debug_check_bounds::<RuleTableV6NewRuleSetRequest>(offset);
10805 self.0.encode(encoder, offset + 0, depth)?;
10809 self.1.encode(encoder, offset + 4, depth)?;
10810 Ok(())
10811 }
10812 }
10813
10814 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10815 for RuleTableV6NewRuleSetRequest
10816 {
10817 #[inline(always)]
10818 fn new_empty() -> Self {
10819 Self {
10820 priority: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
10821 rule_set: fidl::new_empty!(
10822 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RuleSetV6Marker>>,
10823 fidl::encoding::DefaultFuchsiaResourceDialect
10824 ),
10825 }
10826 }
10827
10828 #[inline]
10829 unsafe fn decode(
10830 &mut self,
10831 decoder: &mut fidl::encoding::Decoder<
10832 '_,
10833 fidl::encoding::DefaultFuchsiaResourceDialect,
10834 >,
10835 offset: usize,
10836 _depth: fidl::encoding::Depth,
10837 ) -> fidl::Result<()> {
10838 decoder.debug_check_bounds::<Self>(offset);
10839 fidl::decode!(
10841 u32,
10842 fidl::encoding::DefaultFuchsiaResourceDialect,
10843 &mut self.priority,
10844 decoder,
10845 offset + 0,
10846 _depth
10847 )?;
10848 fidl::decode!(
10849 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RuleSetV6Marker>>,
10850 fidl::encoding::DefaultFuchsiaResourceDialect,
10851 &mut self.rule_set,
10852 decoder,
10853 offset + 4,
10854 _depth
10855 )?;
10856 Ok(())
10857 }
10858 }
10859}