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_component_sandbox__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14pub type Token = fidl::EventPair;
17
18#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19pub struct CapabilityStoreConnectorCreateRequest {
20 pub id: u64,
21 pub receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
22}
23
24impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
25 for CapabilityStoreConnectorCreateRequest
26{
27}
28
29#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
30pub struct CapabilityStoreConnectorOpenRequest {
31 pub id: u64,
32 pub server_end: fidl::Channel,
33}
34
35impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
36 for CapabilityStoreConnectorOpenRequest
37{
38}
39
40#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
41pub struct CapabilityStoreDictionaryDrainRequest {
42 pub id: u64,
43 pub iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
44}
45
46impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
47 for CapabilityStoreDictionaryDrainRequest
48{
49}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
52pub struct CapabilityStoreDictionaryEnumerateRequest {
53 pub id: u64,
54 pub iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
55}
56
57impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
58 for CapabilityStoreDictionaryEnumerateRequest
59{
60}
61
62#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
63pub struct CapabilityStoreDictionaryKeysRequest {
64 pub id: u64,
65 pub iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
66}
67
68impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
69 for CapabilityStoreDictionaryKeysRequest
70{
71}
72
73#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
74pub struct CapabilityStoreDictionaryLegacyExportRequest {
75 pub id: u64,
76 pub server_end: fidl::Channel,
77}
78
79impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
80 for CapabilityStoreDictionaryLegacyExportRequest
81{
82}
83
84#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85pub struct CapabilityStoreDictionaryLegacyImportRequest {
86 pub id: u64,
87 pub client_end: fidl::Channel,
88}
89
90impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
91 for CapabilityStoreDictionaryLegacyImportRequest
92{
93}
94
95#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
96pub struct CapabilityStoreDirConnectorCreateRequest {
97 pub id: u64,
98 pub receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
99}
100
101impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
102 for CapabilityStoreDirConnectorCreateRequest
103{
104}
105
106#[derive(Debug, PartialEq)]
107pub struct CapabilityStoreImportRequest {
108 pub id: u64,
109 pub capability: Capability,
110}
111
112impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
113 for CapabilityStoreImportRequest
114{
115}
116
117#[derive(Debug, PartialEq)]
118pub struct CapabilityStoreExportResponse {
119 pub capability: Capability,
120}
121
122impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
123 for CapabilityStoreExportResponse
124{
125}
126
127#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
128pub struct Connector {
129 pub token: fidl::EventPair,
130}
131
132impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {}
133
134#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135pub struct DictionaryDrainIteratorGetNextResponse {
136 pub items: Vec<DictionaryItem>,
137 pub end_id: u64,
138}
139
140impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
141 for DictionaryDrainIteratorGetNextResponse
142{
143}
144
145#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
146pub struct DictionaryEnumerateIteratorGetNextResponse {
147 pub items: Vec<DictionaryOptionalItem>,
148 pub end_id: u64,
149}
150
151impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
152 for DictionaryEnumerateIteratorGetNextResponse
153{
154}
155
156#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157pub struct DictionaryKeysIteratorGetNextResponse {
158 pub keys: Vec<String>,
159}
160
161impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
162 for DictionaryKeysIteratorGetNextResponse
163{
164}
165
166#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
170pub struct DictionaryOptionalItem {
171 pub key: String,
172 pub value: Option<Box<WrappedCapabilityId>>,
173}
174
175impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryOptionalItem {}
176
177#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
178pub struct DictionaryRef {
179 pub token: fidl::EventPair,
180}
181
182impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {}
183
184#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
185pub struct DirConnector {
186 pub token: fidl::EventPair,
187}
188
189impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {}
190
191#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
192pub struct DirEntry {
193 pub token: fidl::EventPair,
194}
195
196impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {}
197
198#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
201pub struct InstanceToken {
202 pub token: fidl::EventPair,
203}
204
205impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {}
206
207#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
209pub struct ProtocolPayload {
210 pub channel: fidl::Channel,
211}
212
213impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ProtocolPayload {}
214
215#[derive(Debug, Default, PartialEq)]
216pub struct CapabilityStoreDirConnectorOpenRequest {
217 pub id: Option<u64>,
218 pub server_end: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>>,
219 pub flags: Option<fidl_fuchsia_io::Flags>,
220 pub path: Option<String>,
221 #[doc(hidden)]
222 pub __source_breaking: fidl::marker::SourceBreaking,
223}
224
225impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
226 for CapabilityStoreDirConnectorOpenRequest
227{
228}
229
230#[derive(Debug, Default, PartialEq)]
231pub struct DirReceiverReceiveRequest {
232 pub channel: Option<fidl::Channel>,
233 pub flags: Option<fidl_fuchsia_io::Flags>,
234 pub subdir: Option<String>,
235 #[doc(hidden)]
236 pub __source_breaking: fidl::marker::SourceBreaking,
237}
238
239impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DirReceiverReceiveRequest {}
240
241#[derive(Debug, Default, PartialEq)]
243pub struct RouteRequest {
244 pub requesting: Option<InstanceToken>,
247 pub metadata: Option<DictionaryRef>,
250 #[doc(hidden)]
251 pub __source_breaking: fidl::marker::SourceBreaking,
252}
253
254impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {}
255
256#[derive(Debug)]
257pub enum Capability {
258 Unit(Unit),
259 Handle(fidl::NullableHandle),
260 Data(Data),
261 Dictionary(DictionaryRef),
262 Connector(Connector),
263 DirConnector(DirConnector),
264 Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
265 DirEntry(DirEntry),
266 ConnectorRouter(fidl::endpoints::ClientEnd<ConnectorRouterMarker>),
267 DictionaryRouter(fidl::endpoints::ClientEnd<DictionaryRouterMarker>),
268 DirEntryRouter(fidl::endpoints::ClientEnd<DirEntryRouterMarker>),
269 DataRouter(fidl::endpoints::ClientEnd<DataRouterMarker>),
270 DirConnectorRouter(fidl::endpoints::ClientEnd<DirConnectorRouterMarker>),
271 #[doc(hidden)]
272 __SourceBreaking {
273 unknown_ordinal: u64,
274 },
275}
276
277#[macro_export]
279macro_rules! CapabilityUnknown {
280 () => {
281 _
282 };
283}
284
285impl PartialEq for Capability {
287 fn eq(&self, other: &Self) -> bool {
288 match (self, other) {
289 (Self::Unit(x), Self::Unit(y)) => *x == *y,
290 (Self::Handle(x), Self::Handle(y)) => *x == *y,
291 (Self::Data(x), Self::Data(y)) => *x == *y,
292 (Self::Dictionary(x), Self::Dictionary(y)) => *x == *y,
293 (Self::Connector(x), Self::Connector(y)) => *x == *y,
294 (Self::DirConnector(x), Self::DirConnector(y)) => *x == *y,
295 (Self::Directory(x), Self::Directory(y)) => *x == *y,
296 (Self::DirEntry(x), Self::DirEntry(y)) => *x == *y,
297 (Self::ConnectorRouter(x), Self::ConnectorRouter(y)) => *x == *y,
298 (Self::DictionaryRouter(x), Self::DictionaryRouter(y)) => *x == *y,
299 (Self::DirEntryRouter(x), Self::DirEntryRouter(y)) => *x == *y,
300 (Self::DataRouter(x), Self::DataRouter(y)) => *x == *y,
301 (Self::DirConnectorRouter(x), Self::DirConnectorRouter(y)) => *x == *y,
302 _ => false,
303 }
304 }
305}
306
307impl Capability {
308 #[inline]
309 pub fn ordinal(&self) -> u64 {
310 match *self {
311 Self::Unit(_) => 1,
312 Self::Handle(_) => 2,
313 Self::Data(_) => 3,
314 Self::Dictionary(_) => 4,
315 Self::Connector(_) => 5,
316 Self::DirConnector(_) => 6,
317 Self::Directory(_) => 7,
318 Self::DirEntry(_) => 8,
319 Self::ConnectorRouter(_) => 9,
320 Self::DictionaryRouter(_) => 10,
321 Self::DirEntryRouter(_) => 11,
322 Self::DataRouter(_) => 12,
323 Self::DirConnectorRouter(_) => 13,
324 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
325 }
326 }
327
328 #[inline]
329 pub fn unknown_variant_for_testing() -> Self {
330 Self::__SourceBreaking { unknown_ordinal: 0 }
331 }
332
333 #[inline]
334 pub fn is_unknown(&self) -> bool {
335 match self {
336 Self::__SourceBreaking { .. } => true,
337 _ => false,
338 }
339 }
340}
341
342impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {}
343
344#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
345pub enum ConnectorRouterRouteResponse {
346 Connector(Connector),
347 Unavailable(Unit),
348}
349
350impl ConnectorRouterRouteResponse {
351 #[inline]
352 pub fn ordinal(&self) -> u64 {
353 match *self {
354 Self::Connector(_) => 1,
355 Self::Unavailable(_) => 2,
356 }
357 }
358}
359
360impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
361 for ConnectorRouterRouteResponse
362{
363}
364
365#[derive(Debug, PartialEq)]
366pub enum DataRouterRouteResponse {
367 Data(Data),
368 Unavailable(Unit),
369}
370
371impl DataRouterRouteResponse {
372 #[inline]
373 pub fn ordinal(&self) -> u64 {
374 match *self {
375 Self::Data(_) => 1,
376 Self::Unavailable(_) => 2,
377 }
378 }
379}
380
381impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DataRouterRouteResponse {}
382
383#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
384pub enum DictionaryRouterRouteResponse {
385 Dictionary(DictionaryRef),
386 Unavailable(Unit),
387}
388
389impl DictionaryRouterRouteResponse {
390 #[inline]
391 pub fn ordinal(&self) -> u64 {
392 match *self {
393 Self::Dictionary(_) => 1,
394 Self::Unavailable(_) => 2,
395 }
396 }
397}
398
399impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
400 for DictionaryRouterRouteResponse
401{
402}
403
404#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
405pub enum DirConnectorRouterRouteResponse {
406 DirConnector(DirConnector),
407 Unavailable(Unit),
408}
409
410impl DirConnectorRouterRouteResponse {
411 #[inline]
412 pub fn ordinal(&self) -> u64 {
413 match *self {
414 Self::DirConnector(_) => 1,
415 Self::Unavailable(_) => 2,
416 }
417 }
418}
419
420impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
421 for DirConnectorRouterRouteResponse
422{
423}
424
425#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
426pub enum DirEntryRouterRouteResponse {
427 DirEntry(DirEntry),
428 Unavailable(Unit),
429}
430
431impl DirEntryRouterRouteResponse {
432 #[inline]
433 pub fn ordinal(&self) -> u64 {
434 match *self {
435 Self::DirEntry(_) => 1,
436 Self::Unavailable(_) => 2,
437 }
438 }
439}
440
441impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
442 for DirEntryRouterRouteResponse
443{
444}
445
446#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
447pub enum DirectoryRouterRouteResponse {
448 Directory(fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>),
449 Unavailable(Unit),
450}
451
452impl DirectoryRouterRouteResponse {
453 #[inline]
454 pub fn ordinal(&self) -> u64 {
455 match *self {
456 Self::Directory(_) => 1,
457 Self::Unavailable(_) => 2,
458 }
459 }
460}
461
462impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
463 for DirectoryRouterRouteResponse
464{
465}
466
467#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
468pub struct CapabilityStoreMarker;
469
470impl fidl::endpoints::ProtocolMarker for CapabilityStoreMarker {
471 type Proxy = CapabilityStoreProxy;
472 type RequestStream = CapabilityStoreRequestStream;
473 #[cfg(target_os = "fuchsia")]
474 type SynchronousProxy = CapabilityStoreSynchronousProxy;
475
476 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.CapabilityStore";
477}
478impl fidl::endpoints::DiscoverableProtocolMarker for CapabilityStoreMarker {}
479pub type CapabilityStoreDuplicateResult = Result<(), CapabilityStoreError>;
480pub type CapabilityStoreDropResult = Result<(), CapabilityStoreError>;
481pub type CapabilityStoreExportResult = Result<Capability, CapabilityStoreError>;
482pub type CapabilityStoreImportResult = Result<(), CapabilityStoreError>;
483pub type CapabilityStoreConnectorCreateResult = Result<(), CapabilityStoreError>;
484pub type CapabilityStoreConnectorOpenResult = Result<(), CapabilityStoreError>;
485pub type CapabilityStoreDirConnectorCreateResult = Result<(), CapabilityStoreError>;
486pub type CapabilityStoreDirConnectorOpenResult = Result<(), CapabilityStoreError>;
487pub type CapabilityStoreDictionaryCreateResult = Result<(), CapabilityStoreError>;
488pub type CapabilityStoreDictionaryLegacyImportResult = Result<(), CapabilityStoreError>;
489pub type CapabilityStoreDictionaryLegacyExportResult = Result<(), CapabilityStoreError>;
490pub type CapabilityStoreDictionaryInsertResult = Result<(), CapabilityStoreError>;
491pub type CapabilityStoreDictionaryGetResult = Result<(), CapabilityStoreError>;
492pub type CapabilityStoreDictionaryRemoveResult = Result<(), CapabilityStoreError>;
493pub type CapabilityStoreDictionaryCopyResult = Result<(), CapabilityStoreError>;
494pub type CapabilityStoreDictionaryKeysResult = Result<(), CapabilityStoreError>;
495pub type CapabilityStoreDictionaryEnumerateResult = Result<(), CapabilityStoreError>;
496pub type CapabilityStoreDictionaryDrainResult = Result<(), CapabilityStoreError>;
497
498pub trait CapabilityStoreProxyInterface: Send + Sync {
499 type DuplicateResponseFut: std::future::Future<Output = Result<CapabilityStoreDuplicateResult, fidl::Error>>
500 + Send;
501 fn r#duplicate(&self, id: u64, dest_id: u64) -> Self::DuplicateResponseFut;
502 type DropResponseFut: std::future::Future<Output = Result<CapabilityStoreDropResult, fidl::Error>>
503 + Send;
504 fn r#drop(&self, id: u64) -> Self::DropResponseFut;
505 type ExportResponseFut: std::future::Future<Output = Result<CapabilityStoreExportResult, fidl::Error>>
506 + Send;
507 fn r#export(&self, id: u64) -> Self::ExportResponseFut;
508 type ImportResponseFut: std::future::Future<Output = Result<CapabilityStoreImportResult, fidl::Error>>
509 + Send;
510 fn r#import(&self, id: u64, capability: Capability) -> Self::ImportResponseFut;
511 type ConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorCreateResult, fidl::Error>>
512 + Send;
513 fn r#connector_create(
514 &self,
515 id: u64,
516 receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
517 ) -> Self::ConnectorCreateResponseFut;
518 type ConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreConnectorOpenResult, fidl::Error>>
519 + Send;
520 fn r#connector_open(
521 &self,
522 id: u64,
523 server_end: fidl::Channel,
524 ) -> Self::ConnectorOpenResponseFut;
525 type DirConnectorCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorCreateResult, fidl::Error>>
526 + Send;
527 fn r#dir_connector_create(
528 &self,
529 id: u64,
530 receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
531 ) -> Self::DirConnectorCreateResponseFut;
532 type DirConnectorOpenResponseFut: std::future::Future<Output = Result<CapabilityStoreDirConnectorOpenResult, fidl::Error>>
533 + Send;
534 fn r#dir_connector_open(
535 &self,
536 payload: CapabilityStoreDirConnectorOpenRequest,
537 ) -> Self::DirConnectorOpenResponseFut;
538 type DictionaryCreateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCreateResult, fidl::Error>>
539 + Send;
540 fn r#dictionary_create(&self, id: u64) -> Self::DictionaryCreateResponseFut;
541 type DictionaryLegacyImportResponseFut: std::future::Future<
542 Output = Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error>,
543 > + Send;
544 fn r#dictionary_legacy_import(
545 &self,
546 id: u64,
547 client_end: fidl::Channel,
548 ) -> Self::DictionaryLegacyImportResponseFut;
549 type DictionaryLegacyExportResponseFut: std::future::Future<
550 Output = Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error>,
551 > + Send;
552 fn r#dictionary_legacy_export(
553 &self,
554 id: u64,
555 server_end: fidl::Channel,
556 ) -> Self::DictionaryLegacyExportResponseFut;
557 type DictionaryInsertResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryInsertResult, fidl::Error>>
558 + Send;
559 fn r#dictionary_insert(
560 &self,
561 id: u64,
562 item: &DictionaryItem,
563 ) -> Self::DictionaryInsertResponseFut;
564 type DictionaryGetResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryGetResult, fidl::Error>>
565 + Send;
566 fn r#dictionary_get(&self, id: u64, key: &str, dest_id: u64) -> Self::DictionaryGetResponseFut;
567 type DictionaryRemoveResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryRemoveResult, fidl::Error>>
568 + Send;
569 fn r#dictionary_remove(
570 &self,
571 id: u64,
572 key: &str,
573 dest_id: Option<&WrappedCapabilityId>,
574 ) -> Self::DictionaryRemoveResponseFut;
575 type DictionaryCopyResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryCopyResult, fidl::Error>>
576 + Send;
577 fn r#dictionary_copy(&self, id: u64, dest_id: u64) -> Self::DictionaryCopyResponseFut;
578 type DictionaryKeysResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryKeysResult, fidl::Error>>
579 + Send;
580 fn r#dictionary_keys(
581 &self,
582 id: u64,
583 iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
584 ) -> Self::DictionaryKeysResponseFut;
585 type DictionaryEnumerateResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error>>
586 + Send;
587 fn r#dictionary_enumerate(
588 &self,
589 id: u64,
590 iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
591 ) -> Self::DictionaryEnumerateResponseFut;
592 type DictionaryDrainResponseFut: std::future::Future<Output = Result<CapabilityStoreDictionaryDrainResult, fidl::Error>>
593 + Send;
594 fn r#dictionary_drain(
595 &self,
596 id: u64,
597 iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
598 ) -> Self::DictionaryDrainResponseFut;
599}
600#[derive(Debug)]
601#[cfg(target_os = "fuchsia")]
602pub struct CapabilityStoreSynchronousProxy {
603 client: fidl::client::sync::Client,
604}
605
606#[cfg(target_os = "fuchsia")]
607impl fidl::endpoints::SynchronousProxy for CapabilityStoreSynchronousProxy {
608 type Proxy = CapabilityStoreProxy;
609 type Protocol = CapabilityStoreMarker;
610
611 fn from_channel(inner: fidl::Channel) -> Self {
612 Self::new(inner)
613 }
614
615 fn into_channel(self) -> fidl::Channel {
616 self.client.into_channel()
617 }
618
619 fn as_channel(&self) -> &fidl::Channel {
620 self.client.as_channel()
621 }
622}
623
624#[cfg(target_os = "fuchsia")]
625impl CapabilityStoreSynchronousProxy {
626 pub fn new(channel: fidl::Channel) -> Self {
627 let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
628 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
629 }
630
631 pub fn into_channel(self) -> fidl::Channel {
632 self.client.into_channel()
633 }
634
635 pub fn wait_for_event(
638 &self,
639 deadline: zx::MonotonicInstant,
640 ) -> Result<CapabilityStoreEvent, fidl::Error> {
641 CapabilityStoreEvent::decode(self.client.wait_for_event(deadline)?)
642 }
643
644 pub fn r#duplicate(
652 &self,
653 mut id: u64,
654 mut dest_id: u64,
655 ___deadline: zx::MonotonicInstant,
656 ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
657 let _response =
658 self.client
659 .send_query::<CapabilityStoreDuplicateRequest, fidl::encoding::FlexibleResultType<
660 fidl::encoding::EmptyStruct,
661 CapabilityStoreError,
662 >>(
663 (id, dest_id),
664 0x5d5d35d9c20a2184,
665 fidl::encoding::DynamicFlags::FLEXIBLE,
666 ___deadline,
667 )?
668 .into_result::<CapabilityStoreMarker>("duplicate")?;
669 Ok(_response.map(|x| x))
670 }
671
672 pub fn r#drop(
678 &self,
679 mut id: u64,
680 ___deadline: zx::MonotonicInstant,
681 ) -> Result<CapabilityStoreDropResult, fidl::Error> {
682 let _response =
683 self.client
684 .send_query::<CapabilityStoreDropRequest, fidl::encoding::FlexibleResultType<
685 fidl::encoding::EmptyStruct,
686 CapabilityStoreError,
687 >>(
688 (id,), 0xa745c0990fc2559, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
689 )?
690 .into_result::<CapabilityStoreMarker>("drop")?;
691 Ok(_response.map(|x| x))
692 }
693
694 pub fn r#export(
702 &self,
703 mut id: u64,
704 ___deadline: zx::MonotonicInstant,
705 ) -> Result<CapabilityStoreExportResult, fidl::Error> {
706 let _response =
707 self.client
708 .send_query::<CapabilityStoreExportRequest, fidl::encoding::FlexibleResultType<
709 CapabilityStoreExportResponse,
710 CapabilityStoreError,
711 >>(
712 (id,), 0x3237a8f4748faff, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
713 )?
714 .into_result::<CapabilityStoreMarker>("export")?;
715 Ok(_response.map(|x| x.capability))
716 }
717
718 pub fn r#import(
725 &self,
726 mut id: u64,
727 mut capability: Capability,
728 ___deadline: zx::MonotonicInstant,
729 ) -> Result<CapabilityStoreImportResult, fidl::Error> {
730 let _response =
731 self.client
732 .send_query::<CapabilityStoreImportRequest, fidl::encoding::FlexibleResultType<
733 fidl::encoding::EmptyStruct,
734 CapabilityStoreError,
735 >>(
736 (id, &mut capability),
737 0x1f96157a29f4539b,
738 fidl::encoding::DynamicFlags::FLEXIBLE,
739 ___deadline,
740 )?
741 .into_result::<CapabilityStoreMarker>("import")?;
742 Ok(_response.map(|x| x))
743 }
744
745 pub fn r#connector_create(
752 &self,
753 mut id: u64,
754 mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
755 ___deadline: zx::MonotonicInstant,
756 ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
757 let _response = self.client.send_query::<
758 CapabilityStoreConnectorCreateRequest,
759 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
760 >(
761 (id, receiver,),
762 0x29592c5d63e91c25,
763 fidl::encoding::DynamicFlags::FLEXIBLE,
764 ___deadline,
765 )?
766 .into_result::<CapabilityStoreMarker>("connector_create")?;
767 Ok(_response.map(|x| x))
768 }
769
770 pub fn r#connector_open(
780 &self,
781 mut id: u64,
782 mut server_end: fidl::Channel,
783 ___deadline: zx::MonotonicInstant,
784 ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
785 let _response = self.client.send_query::<
786 CapabilityStoreConnectorOpenRequest,
787 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
788 >(
789 (id, server_end,),
790 0x537e69ab40563b9f,
791 fidl::encoding::DynamicFlags::FLEXIBLE,
792 ___deadline,
793 )?
794 .into_result::<CapabilityStoreMarker>("connector_open")?;
795 Ok(_response.map(|x| x))
796 }
797
798 pub fn r#dir_connector_create(
805 &self,
806 mut id: u64,
807 mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
808 ___deadline: zx::MonotonicInstant,
809 ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
810 let _response = self.client.send_query::<
811 CapabilityStoreDirConnectorCreateRequest,
812 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
813 >(
814 (id, receiver,),
815 0x186138a11ccf19bb,
816 fidl::encoding::DynamicFlags::FLEXIBLE,
817 ___deadline,
818 )?
819 .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
820 Ok(_response.map(|x| x))
821 }
822
823 pub fn r#dir_connector_open(
837 &self,
838 mut payload: CapabilityStoreDirConnectorOpenRequest,
839 ___deadline: zx::MonotonicInstant,
840 ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
841 let _response = self.client.send_query::<
842 CapabilityStoreDirConnectorOpenRequest,
843 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
844 >(
845 &mut payload,
846 0x5650d3d6a3a13901,
847 fidl::encoding::DynamicFlags::FLEXIBLE,
848 ___deadline,
849 )?
850 .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
851 Ok(_response.map(|x| x))
852 }
853
854 pub fn r#dictionary_create(
860 &self,
861 mut id: u64,
862 ___deadline: zx::MonotonicInstant,
863 ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
864 let _response = self.client.send_query::<
865 CapabilityStoreDictionaryCreateRequest,
866 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
867 >(
868 (id,),
869 0x6997c8dfc63de093,
870 fidl::encoding::DynamicFlags::FLEXIBLE,
871 ___deadline,
872 )?
873 .into_result::<CapabilityStoreMarker>("dictionary_create")?;
874 Ok(_response.map(|x| x))
875 }
876
877 pub fn r#dictionary_legacy_import(
887 &self,
888 mut id: u64,
889 mut client_end: fidl::Channel,
890 ___deadline: zx::MonotonicInstant,
891 ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
892 let _response = self.client.send_query::<
893 CapabilityStoreDictionaryLegacyImportRequest,
894 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
895 >(
896 (id, client_end,),
897 0x72fd686c37b6025f,
898 fidl::encoding::DynamicFlags::FLEXIBLE,
899 ___deadline,
900 )?
901 .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
902 Ok(_response.map(|x| x))
903 }
904
905 pub fn r#dictionary_legacy_export(
915 &self,
916 mut id: u64,
917 mut server_end: fidl::Channel,
918 ___deadline: zx::MonotonicInstant,
919 ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
920 let _response = self.client.send_query::<
921 CapabilityStoreDictionaryLegacyExportRequest,
922 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
923 >(
924 (id, server_end,),
925 0x407e15cc4bde5dcd,
926 fidl::encoding::DynamicFlags::FLEXIBLE,
927 ___deadline,
928 )?
929 .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
930 Ok(_response.map(|x| x))
931 }
932
933 pub fn r#dictionary_insert(
943 &self,
944 mut id: u64,
945 mut item: &DictionaryItem,
946 ___deadline: zx::MonotonicInstant,
947 ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
948 let _response = self.client.send_query::<
949 CapabilityStoreDictionaryInsertRequest,
950 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
951 >(
952 (id, item,),
953 0x7702183689d44c27,
954 fidl::encoding::DynamicFlags::FLEXIBLE,
955 ___deadline,
956 )?
957 .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
958 Ok(_response.map(|x| x))
959 }
960
961 pub fn r#dictionary_get(
973 &self,
974 mut id: u64,
975 mut key: &str,
976 mut dest_id: u64,
977 ___deadline: zx::MonotonicInstant,
978 ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
979 let _response = self.client.send_query::<
980 CapabilityStoreDictionaryGetRequest,
981 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
982 >(
983 (id, key, dest_id,),
984 0x4d9e27538284add2,
985 fidl::encoding::DynamicFlags::FLEXIBLE,
986 ___deadline,
987 )?
988 .into_result::<CapabilityStoreMarker>("dictionary_get")?;
989 Ok(_response.map(|x| x))
990 }
991
992 pub fn r#dictionary_remove(
1003 &self,
1004 mut id: u64,
1005 mut key: &str,
1006 mut dest_id: Option<&WrappedCapabilityId>,
1007 ___deadline: zx::MonotonicInstant,
1008 ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1009 let _response = self.client.send_query::<
1010 CapabilityStoreDictionaryRemoveRequest,
1011 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1012 >(
1013 (id, key, dest_id,),
1014 0x4c5c025ab05d4f3,
1015 fidl::encoding::DynamicFlags::FLEXIBLE,
1016 ___deadline,
1017 )?
1018 .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
1019 Ok(_response.map(|x| x))
1020 }
1021
1022 pub fn r#dictionary_copy(
1038 &self,
1039 mut id: u64,
1040 mut dest_id: u64,
1041 ___deadline: zx::MonotonicInstant,
1042 ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
1043 let _response = self.client.send_query::<
1044 CapabilityStoreDictionaryCopyRequest,
1045 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1046 >(
1047 (id, dest_id,),
1048 0x3733ecdf4ea1b44f,
1049 fidl::encoding::DynamicFlags::FLEXIBLE,
1050 ___deadline,
1051 )?
1052 .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
1053 Ok(_response.map(|x| x))
1054 }
1055
1056 pub fn r#dictionary_keys(
1063 &self,
1064 mut id: u64,
1065 mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1066 ___deadline: zx::MonotonicInstant,
1067 ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
1068 let _response = self.client.send_query::<
1069 CapabilityStoreDictionaryKeysRequest,
1070 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1071 >(
1072 (id, iterator,),
1073 0x84b05577ceaec9e,
1074 fidl::encoding::DynamicFlags::FLEXIBLE,
1075 ___deadline,
1076 )?
1077 .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
1078 Ok(_response.map(|x| x))
1079 }
1080
1081 pub fn r#dictionary_enumerate(
1091 &self,
1092 mut id: u64,
1093 mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1094 ___deadline: zx::MonotonicInstant,
1095 ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
1096 let _response = self.client.send_query::<
1097 CapabilityStoreDictionaryEnumerateRequest,
1098 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1099 >(
1100 (id, iterator,),
1101 0xd6279b6ced04641,
1102 fidl::encoding::DynamicFlags::FLEXIBLE,
1103 ___deadline,
1104 )?
1105 .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
1106 Ok(_response.map(|x| x))
1107 }
1108
1109 pub fn r#dictionary_drain(
1117 &self,
1118 mut id: u64,
1119 mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1120 ___deadline: zx::MonotonicInstant,
1121 ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
1122 let _response = self.client.send_query::<
1123 CapabilityStoreDictionaryDrainRequest,
1124 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, CapabilityStoreError>,
1125 >(
1126 (id, iterator,),
1127 0x28a3a3f84d928cd8,
1128 fidl::encoding::DynamicFlags::FLEXIBLE,
1129 ___deadline,
1130 )?
1131 .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
1132 Ok(_response.map(|x| x))
1133 }
1134}
1135
1136#[cfg(target_os = "fuchsia")]
1137impl From<CapabilityStoreSynchronousProxy> for zx::NullableHandle {
1138 fn from(value: CapabilityStoreSynchronousProxy) -> Self {
1139 value.into_channel().into()
1140 }
1141}
1142
1143#[cfg(target_os = "fuchsia")]
1144impl From<fidl::Channel> for CapabilityStoreSynchronousProxy {
1145 fn from(value: fidl::Channel) -> Self {
1146 Self::new(value)
1147 }
1148}
1149
1150#[cfg(target_os = "fuchsia")]
1151impl fidl::endpoints::FromClient for CapabilityStoreSynchronousProxy {
1152 type Protocol = CapabilityStoreMarker;
1153
1154 fn from_client(value: fidl::endpoints::ClientEnd<CapabilityStoreMarker>) -> Self {
1155 Self::new(value.into_channel())
1156 }
1157}
1158
1159#[derive(Debug, Clone)]
1160pub struct CapabilityStoreProxy {
1161 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1162}
1163
1164impl fidl::endpoints::Proxy for CapabilityStoreProxy {
1165 type Protocol = CapabilityStoreMarker;
1166
1167 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1168 Self::new(inner)
1169 }
1170
1171 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1172 self.client.into_channel().map_err(|client| Self { client })
1173 }
1174
1175 fn as_channel(&self) -> &::fidl::AsyncChannel {
1176 self.client.as_channel()
1177 }
1178}
1179
1180impl CapabilityStoreProxy {
1181 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1183 let protocol_name = <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1184 Self { client: fidl::client::Client::new(channel, protocol_name) }
1185 }
1186
1187 pub fn take_event_stream(&self) -> CapabilityStoreEventStream {
1193 CapabilityStoreEventStream { event_receiver: self.client.take_event_receiver() }
1194 }
1195
1196 pub fn r#duplicate(
1204 &self,
1205 mut id: u64,
1206 mut dest_id: u64,
1207 ) -> fidl::client::QueryResponseFut<
1208 CapabilityStoreDuplicateResult,
1209 fidl::encoding::DefaultFuchsiaResourceDialect,
1210 > {
1211 CapabilityStoreProxyInterface::r#duplicate(self, id, dest_id)
1212 }
1213
1214 pub fn r#drop(
1220 &self,
1221 mut id: u64,
1222 ) -> fidl::client::QueryResponseFut<
1223 CapabilityStoreDropResult,
1224 fidl::encoding::DefaultFuchsiaResourceDialect,
1225 > {
1226 CapabilityStoreProxyInterface::r#drop(self, id)
1227 }
1228
1229 pub fn r#export(
1237 &self,
1238 mut id: u64,
1239 ) -> fidl::client::QueryResponseFut<
1240 CapabilityStoreExportResult,
1241 fidl::encoding::DefaultFuchsiaResourceDialect,
1242 > {
1243 CapabilityStoreProxyInterface::r#export(self, id)
1244 }
1245
1246 pub fn r#import(
1253 &self,
1254 mut id: u64,
1255 mut capability: Capability,
1256 ) -> fidl::client::QueryResponseFut<
1257 CapabilityStoreImportResult,
1258 fidl::encoding::DefaultFuchsiaResourceDialect,
1259 > {
1260 CapabilityStoreProxyInterface::r#import(self, id, capability)
1261 }
1262
1263 pub fn r#connector_create(
1270 &self,
1271 mut id: u64,
1272 mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1273 ) -> fidl::client::QueryResponseFut<
1274 CapabilityStoreConnectorCreateResult,
1275 fidl::encoding::DefaultFuchsiaResourceDialect,
1276 > {
1277 CapabilityStoreProxyInterface::r#connector_create(self, id, receiver)
1278 }
1279
1280 pub fn r#connector_open(
1290 &self,
1291 mut id: u64,
1292 mut server_end: fidl::Channel,
1293 ) -> fidl::client::QueryResponseFut<
1294 CapabilityStoreConnectorOpenResult,
1295 fidl::encoding::DefaultFuchsiaResourceDialect,
1296 > {
1297 CapabilityStoreProxyInterface::r#connector_open(self, id, server_end)
1298 }
1299
1300 pub fn r#dir_connector_create(
1307 &self,
1308 mut id: u64,
1309 mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1310 ) -> fidl::client::QueryResponseFut<
1311 CapabilityStoreDirConnectorCreateResult,
1312 fidl::encoding::DefaultFuchsiaResourceDialect,
1313 > {
1314 CapabilityStoreProxyInterface::r#dir_connector_create(self, id, receiver)
1315 }
1316
1317 pub fn r#dir_connector_open(
1331 &self,
1332 mut payload: CapabilityStoreDirConnectorOpenRequest,
1333 ) -> fidl::client::QueryResponseFut<
1334 CapabilityStoreDirConnectorOpenResult,
1335 fidl::encoding::DefaultFuchsiaResourceDialect,
1336 > {
1337 CapabilityStoreProxyInterface::r#dir_connector_open(self, payload)
1338 }
1339
1340 pub fn r#dictionary_create(
1346 &self,
1347 mut id: u64,
1348 ) -> fidl::client::QueryResponseFut<
1349 CapabilityStoreDictionaryCreateResult,
1350 fidl::encoding::DefaultFuchsiaResourceDialect,
1351 > {
1352 CapabilityStoreProxyInterface::r#dictionary_create(self, id)
1353 }
1354
1355 pub fn r#dictionary_legacy_import(
1365 &self,
1366 mut id: u64,
1367 mut client_end: fidl::Channel,
1368 ) -> fidl::client::QueryResponseFut<
1369 CapabilityStoreDictionaryLegacyImportResult,
1370 fidl::encoding::DefaultFuchsiaResourceDialect,
1371 > {
1372 CapabilityStoreProxyInterface::r#dictionary_legacy_import(self, id, client_end)
1373 }
1374
1375 pub fn r#dictionary_legacy_export(
1385 &self,
1386 mut id: u64,
1387 mut server_end: fidl::Channel,
1388 ) -> fidl::client::QueryResponseFut<
1389 CapabilityStoreDictionaryLegacyExportResult,
1390 fidl::encoding::DefaultFuchsiaResourceDialect,
1391 > {
1392 CapabilityStoreProxyInterface::r#dictionary_legacy_export(self, id, server_end)
1393 }
1394
1395 pub fn r#dictionary_insert(
1405 &self,
1406 mut id: u64,
1407 mut item: &DictionaryItem,
1408 ) -> fidl::client::QueryResponseFut<
1409 CapabilityStoreDictionaryInsertResult,
1410 fidl::encoding::DefaultFuchsiaResourceDialect,
1411 > {
1412 CapabilityStoreProxyInterface::r#dictionary_insert(self, id, item)
1413 }
1414
1415 pub fn r#dictionary_get(
1427 &self,
1428 mut id: u64,
1429 mut key: &str,
1430 mut dest_id: u64,
1431 ) -> fidl::client::QueryResponseFut<
1432 CapabilityStoreDictionaryGetResult,
1433 fidl::encoding::DefaultFuchsiaResourceDialect,
1434 > {
1435 CapabilityStoreProxyInterface::r#dictionary_get(self, id, key, dest_id)
1436 }
1437
1438 pub fn r#dictionary_remove(
1449 &self,
1450 mut id: u64,
1451 mut key: &str,
1452 mut dest_id: Option<&WrappedCapabilityId>,
1453 ) -> fidl::client::QueryResponseFut<
1454 CapabilityStoreDictionaryRemoveResult,
1455 fidl::encoding::DefaultFuchsiaResourceDialect,
1456 > {
1457 CapabilityStoreProxyInterface::r#dictionary_remove(self, id, key, dest_id)
1458 }
1459
1460 pub fn r#dictionary_copy(
1476 &self,
1477 mut id: u64,
1478 mut dest_id: u64,
1479 ) -> fidl::client::QueryResponseFut<
1480 CapabilityStoreDictionaryCopyResult,
1481 fidl::encoding::DefaultFuchsiaResourceDialect,
1482 > {
1483 CapabilityStoreProxyInterface::r#dictionary_copy(self, id, dest_id)
1484 }
1485
1486 pub fn r#dictionary_keys(
1493 &self,
1494 mut id: u64,
1495 mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
1496 ) -> fidl::client::QueryResponseFut<
1497 CapabilityStoreDictionaryKeysResult,
1498 fidl::encoding::DefaultFuchsiaResourceDialect,
1499 > {
1500 CapabilityStoreProxyInterface::r#dictionary_keys(self, id, iterator)
1501 }
1502
1503 pub fn r#dictionary_enumerate(
1513 &self,
1514 mut id: u64,
1515 mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
1516 ) -> fidl::client::QueryResponseFut<
1517 CapabilityStoreDictionaryEnumerateResult,
1518 fidl::encoding::DefaultFuchsiaResourceDialect,
1519 > {
1520 CapabilityStoreProxyInterface::r#dictionary_enumerate(self, id, iterator)
1521 }
1522
1523 pub fn r#dictionary_drain(
1531 &self,
1532 mut id: u64,
1533 mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
1534 ) -> fidl::client::QueryResponseFut<
1535 CapabilityStoreDictionaryDrainResult,
1536 fidl::encoding::DefaultFuchsiaResourceDialect,
1537 > {
1538 CapabilityStoreProxyInterface::r#dictionary_drain(self, id, iterator)
1539 }
1540}
1541
1542impl CapabilityStoreProxyInterface for CapabilityStoreProxy {
1543 type DuplicateResponseFut = fidl::client::QueryResponseFut<
1544 CapabilityStoreDuplicateResult,
1545 fidl::encoding::DefaultFuchsiaResourceDialect,
1546 >;
1547 fn r#duplicate(&self, mut id: u64, mut dest_id: u64) -> Self::DuplicateResponseFut {
1548 fn _decode(
1549 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1550 ) -> Result<CapabilityStoreDuplicateResult, fidl::Error> {
1551 let _response = fidl::client::decode_transaction_body::<
1552 fidl::encoding::FlexibleResultType<
1553 fidl::encoding::EmptyStruct,
1554 CapabilityStoreError,
1555 >,
1556 fidl::encoding::DefaultFuchsiaResourceDialect,
1557 0x5d5d35d9c20a2184,
1558 >(_buf?)?
1559 .into_result::<CapabilityStoreMarker>("duplicate")?;
1560 Ok(_response.map(|x| x))
1561 }
1562 self.client.send_query_and_decode::<
1563 CapabilityStoreDuplicateRequest,
1564 CapabilityStoreDuplicateResult,
1565 >(
1566 (id, dest_id,),
1567 0x5d5d35d9c20a2184,
1568 fidl::encoding::DynamicFlags::FLEXIBLE,
1569 _decode,
1570 )
1571 }
1572
1573 type DropResponseFut = fidl::client::QueryResponseFut<
1574 CapabilityStoreDropResult,
1575 fidl::encoding::DefaultFuchsiaResourceDialect,
1576 >;
1577 fn r#drop(&self, mut id: u64) -> Self::DropResponseFut {
1578 fn _decode(
1579 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1580 ) -> Result<CapabilityStoreDropResult, fidl::Error> {
1581 let _response = fidl::client::decode_transaction_body::<
1582 fidl::encoding::FlexibleResultType<
1583 fidl::encoding::EmptyStruct,
1584 CapabilityStoreError,
1585 >,
1586 fidl::encoding::DefaultFuchsiaResourceDialect,
1587 0xa745c0990fc2559,
1588 >(_buf?)?
1589 .into_result::<CapabilityStoreMarker>("drop")?;
1590 Ok(_response.map(|x| x))
1591 }
1592 self.client.send_query_and_decode::<CapabilityStoreDropRequest, CapabilityStoreDropResult>(
1593 (id,),
1594 0xa745c0990fc2559,
1595 fidl::encoding::DynamicFlags::FLEXIBLE,
1596 _decode,
1597 )
1598 }
1599
1600 type ExportResponseFut = fidl::client::QueryResponseFut<
1601 CapabilityStoreExportResult,
1602 fidl::encoding::DefaultFuchsiaResourceDialect,
1603 >;
1604 fn r#export(&self, mut id: u64) -> Self::ExportResponseFut {
1605 fn _decode(
1606 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1607 ) -> Result<CapabilityStoreExportResult, fidl::Error> {
1608 let _response = fidl::client::decode_transaction_body::<
1609 fidl::encoding::FlexibleResultType<
1610 CapabilityStoreExportResponse,
1611 CapabilityStoreError,
1612 >,
1613 fidl::encoding::DefaultFuchsiaResourceDialect,
1614 0x3237a8f4748faff,
1615 >(_buf?)?
1616 .into_result::<CapabilityStoreMarker>("export")?;
1617 Ok(_response.map(|x| x.capability))
1618 }
1619 self.client
1620 .send_query_and_decode::<CapabilityStoreExportRequest, CapabilityStoreExportResult>(
1621 (id,),
1622 0x3237a8f4748faff,
1623 fidl::encoding::DynamicFlags::FLEXIBLE,
1624 _decode,
1625 )
1626 }
1627
1628 type ImportResponseFut = fidl::client::QueryResponseFut<
1629 CapabilityStoreImportResult,
1630 fidl::encoding::DefaultFuchsiaResourceDialect,
1631 >;
1632 fn r#import(&self, mut id: u64, mut capability: Capability) -> Self::ImportResponseFut {
1633 fn _decode(
1634 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1635 ) -> Result<CapabilityStoreImportResult, fidl::Error> {
1636 let _response = fidl::client::decode_transaction_body::<
1637 fidl::encoding::FlexibleResultType<
1638 fidl::encoding::EmptyStruct,
1639 CapabilityStoreError,
1640 >,
1641 fidl::encoding::DefaultFuchsiaResourceDialect,
1642 0x1f96157a29f4539b,
1643 >(_buf?)?
1644 .into_result::<CapabilityStoreMarker>("import")?;
1645 Ok(_response.map(|x| x))
1646 }
1647 self.client
1648 .send_query_and_decode::<CapabilityStoreImportRequest, CapabilityStoreImportResult>(
1649 (id, &mut capability),
1650 0x1f96157a29f4539b,
1651 fidl::encoding::DynamicFlags::FLEXIBLE,
1652 _decode,
1653 )
1654 }
1655
1656 type ConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1657 CapabilityStoreConnectorCreateResult,
1658 fidl::encoding::DefaultFuchsiaResourceDialect,
1659 >;
1660 fn r#connector_create(
1661 &self,
1662 mut id: u64,
1663 mut receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
1664 ) -> Self::ConnectorCreateResponseFut {
1665 fn _decode(
1666 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1667 ) -> Result<CapabilityStoreConnectorCreateResult, fidl::Error> {
1668 let _response = fidl::client::decode_transaction_body::<
1669 fidl::encoding::FlexibleResultType<
1670 fidl::encoding::EmptyStruct,
1671 CapabilityStoreError,
1672 >,
1673 fidl::encoding::DefaultFuchsiaResourceDialect,
1674 0x29592c5d63e91c25,
1675 >(_buf?)?
1676 .into_result::<CapabilityStoreMarker>("connector_create")?;
1677 Ok(_response.map(|x| x))
1678 }
1679 self.client.send_query_and_decode::<
1680 CapabilityStoreConnectorCreateRequest,
1681 CapabilityStoreConnectorCreateResult,
1682 >(
1683 (id, receiver,),
1684 0x29592c5d63e91c25,
1685 fidl::encoding::DynamicFlags::FLEXIBLE,
1686 _decode,
1687 )
1688 }
1689
1690 type ConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1691 CapabilityStoreConnectorOpenResult,
1692 fidl::encoding::DefaultFuchsiaResourceDialect,
1693 >;
1694 fn r#connector_open(
1695 &self,
1696 mut id: u64,
1697 mut server_end: fidl::Channel,
1698 ) -> Self::ConnectorOpenResponseFut {
1699 fn _decode(
1700 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1701 ) -> Result<CapabilityStoreConnectorOpenResult, fidl::Error> {
1702 let _response = fidl::client::decode_transaction_body::<
1703 fidl::encoding::FlexibleResultType<
1704 fidl::encoding::EmptyStruct,
1705 CapabilityStoreError,
1706 >,
1707 fidl::encoding::DefaultFuchsiaResourceDialect,
1708 0x537e69ab40563b9f,
1709 >(_buf?)?
1710 .into_result::<CapabilityStoreMarker>("connector_open")?;
1711 Ok(_response.map(|x| x))
1712 }
1713 self.client.send_query_and_decode::<
1714 CapabilityStoreConnectorOpenRequest,
1715 CapabilityStoreConnectorOpenResult,
1716 >(
1717 (id, server_end,),
1718 0x537e69ab40563b9f,
1719 fidl::encoding::DynamicFlags::FLEXIBLE,
1720 _decode,
1721 )
1722 }
1723
1724 type DirConnectorCreateResponseFut = fidl::client::QueryResponseFut<
1725 CapabilityStoreDirConnectorCreateResult,
1726 fidl::encoding::DefaultFuchsiaResourceDialect,
1727 >;
1728 fn r#dir_connector_create(
1729 &self,
1730 mut id: u64,
1731 mut receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
1732 ) -> Self::DirConnectorCreateResponseFut {
1733 fn _decode(
1734 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1735 ) -> Result<CapabilityStoreDirConnectorCreateResult, fidl::Error> {
1736 let _response = fidl::client::decode_transaction_body::<
1737 fidl::encoding::FlexibleResultType<
1738 fidl::encoding::EmptyStruct,
1739 CapabilityStoreError,
1740 >,
1741 fidl::encoding::DefaultFuchsiaResourceDialect,
1742 0x186138a11ccf19bb,
1743 >(_buf?)?
1744 .into_result::<CapabilityStoreMarker>("dir_connector_create")?;
1745 Ok(_response.map(|x| x))
1746 }
1747 self.client.send_query_and_decode::<
1748 CapabilityStoreDirConnectorCreateRequest,
1749 CapabilityStoreDirConnectorCreateResult,
1750 >(
1751 (id, receiver,),
1752 0x186138a11ccf19bb,
1753 fidl::encoding::DynamicFlags::FLEXIBLE,
1754 _decode,
1755 )
1756 }
1757
1758 type DirConnectorOpenResponseFut = fidl::client::QueryResponseFut<
1759 CapabilityStoreDirConnectorOpenResult,
1760 fidl::encoding::DefaultFuchsiaResourceDialect,
1761 >;
1762 fn r#dir_connector_open(
1763 &self,
1764 mut payload: CapabilityStoreDirConnectorOpenRequest,
1765 ) -> Self::DirConnectorOpenResponseFut {
1766 fn _decode(
1767 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1768 ) -> Result<CapabilityStoreDirConnectorOpenResult, fidl::Error> {
1769 let _response = fidl::client::decode_transaction_body::<
1770 fidl::encoding::FlexibleResultType<
1771 fidl::encoding::EmptyStruct,
1772 CapabilityStoreError,
1773 >,
1774 fidl::encoding::DefaultFuchsiaResourceDialect,
1775 0x5650d3d6a3a13901,
1776 >(_buf?)?
1777 .into_result::<CapabilityStoreMarker>("dir_connector_open")?;
1778 Ok(_response.map(|x| x))
1779 }
1780 self.client.send_query_and_decode::<
1781 CapabilityStoreDirConnectorOpenRequest,
1782 CapabilityStoreDirConnectorOpenResult,
1783 >(
1784 &mut payload,
1785 0x5650d3d6a3a13901,
1786 fidl::encoding::DynamicFlags::FLEXIBLE,
1787 _decode,
1788 )
1789 }
1790
1791 type DictionaryCreateResponseFut = fidl::client::QueryResponseFut<
1792 CapabilityStoreDictionaryCreateResult,
1793 fidl::encoding::DefaultFuchsiaResourceDialect,
1794 >;
1795 fn r#dictionary_create(&self, mut id: u64) -> Self::DictionaryCreateResponseFut {
1796 fn _decode(
1797 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1798 ) -> Result<CapabilityStoreDictionaryCreateResult, fidl::Error> {
1799 let _response = fidl::client::decode_transaction_body::<
1800 fidl::encoding::FlexibleResultType<
1801 fidl::encoding::EmptyStruct,
1802 CapabilityStoreError,
1803 >,
1804 fidl::encoding::DefaultFuchsiaResourceDialect,
1805 0x6997c8dfc63de093,
1806 >(_buf?)?
1807 .into_result::<CapabilityStoreMarker>("dictionary_create")?;
1808 Ok(_response.map(|x| x))
1809 }
1810 self.client.send_query_and_decode::<
1811 CapabilityStoreDictionaryCreateRequest,
1812 CapabilityStoreDictionaryCreateResult,
1813 >(
1814 (id,),
1815 0x6997c8dfc63de093,
1816 fidl::encoding::DynamicFlags::FLEXIBLE,
1817 _decode,
1818 )
1819 }
1820
1821 type DictionaryLegacyImportResponseFut = fidl::client::QueryResponseFut<
1822 CapabilityStoreDictionaryLegacyImportResult,
1823 fidl::encoding::DefaultFuchsiaResourceDialect,
1824 >;
1825 fn r#dictionary_legacy_import(
1826 &self,
1827 mut id: u64,
1828 mut client_end: fidl::Channel,
1829 ) -> Self::DictionaryLegacyImportResponseFut {
1830 fn _decode(
1831 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1832 ) -> Result<CapabilityStoreDictionaryLegacyImportResult, fidl::Error> {
1833 let _response = fidl::client::decode_transaction_body::<
1834 fidl::encoding::FlexibleResultType<
1835 fidl::encoding::EmptyStruct,
1836 CapabilityStoreError,
1837 >,
1838 fidl::encoding::DefaultFuchsiaResourceDialect,
1839 0x72fd686c37b6025f,
1840 >(_buf?)?
1841 .into_result::<CapabilityStoreMarker>("dictionary_legacy_import")?;
1842 Ok(_response.map(|x| x))
1843 }
1844 self.client.send_query_and_decode::<
1845 CapabilityStoreDictionaryLegacyImportRequest,
1846 CapabilityStoreDictionaryLegacyImportResult,
1847 >(
1848 (id, client_end,),
1849 0x72fd686c37b6025f,
1850 fidl::encoding::DynamicFlags::FLEXIBLE,
1851 _decode,
1852 )
1853 }
1854
1855 type DictionaryLegacyExportResponseFut = fidl::client::QueryResponseFut<
1856 CapabilityStoreDictionaryLegacyExportResult,
1857 fidl::encoding::DefaultFuchsiaResourceDialect,
1858 >;
1859 fn r#dictionary_legacy_export(
1860 &self,
1861 mut id: u64,
1862 mut server_end: fidl::Channel,
1863 ) -> Self::DictionaryLegacyExportResponseFut {
1864 fn _decode(
1865 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1866 ) -> Result<CapabilityStoreDictionaryLegacyExportResult, fidl::Error> {
1867 let _response = fidl::client::decode_transaction_body::<
1868 fidl::encoding::FlexibleResultType<
1869 fidl::encoding::EmptyStruct,
1870 CapabilityStoreError,
1871 >,
1872 fidl::encoding::DefaultFuchsiaResourceDialect,
1873 0x407e15cc4bde5dcd,
1874 >(_buf?)?
1875 .into_result::<CapabilityStoreMarker>("dictionary_legacy_export")?;
1876 Ok(_response.map(|x| x))
1877 }
1878 self.client.send_query_and_decode::<
1879 CapabilityStoreDictionaryLegacyExportRequest,
1880 CapabilityStoreDictionaryLegacyExportResult,
1881 >(
1882 (id, server_end,),
1883 0x407e15cc4bde5dcd,
1884 fidl::encoding::DynamicFlags::FLEXIBLE,
1885 _decode,
1886 )
1887 }
1888
1889 type DictionaryInsertResponseFut = fidl::client::QueryResponseFut<
1890 CapabilityStoreDictionaryInsertResult,
1891 fidl::encoding::DefaultFuchsiaResourceDialect,
1892 >;
1893 fn r#dictionary_insert(
1894 &self,
1895 mut id: u64,
1896 mut item: &DictionaryItem,
1897 ) -> Self::DictionaryInsertResponseFut {
1898 fn _decode(
1899 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1900 ) -> Result<CapabilityStoreDictionaryInsertResult, fidl::Error> {
1901 let _response = fidl::client::decode_transaction_body::<
1902 fidl::encoding::FlexibleResultType<
1903 fidl::encoding::EmptyStruct,
1904 CapabilityStoreError,
1905 >,
1906 fidl::encoding::DefaultFuchsiaResourceDialect,
1907 0x7702183689d44c27,
1908 >(_buf?)?
1909 .into_result::<CapabilityStoreMarker>("dictionary_insert")?;
1910 Ok(_response.map(|x| x))
1911 }
1912 self.client.send_query_and_decode::<
1913 CapabilityStoreDictionaryInsertRequest,
1914 CapabilityStoreDictionaryInsertResult,
1915 >(
1916 (id, item,),
1917 0x7702183689d44c27,
1918 fidl::encoding::DynamicFlags::FLEXIBLE,
1919 _decode,
1920 )
1921 }
1922
1923 type DictionaryGetResponseFut = fidl::client::QueryResponseFut<
1924 CapabilityStoreDictionaryGetResult,
1925 fidl::encoding::DefaultFuchsiaResourceDialect,
1926 >;
1927 fn r#dictionary_get(
1928 &self,
1929 mut id: u64,
1930 mut key: &str,
1931 mut dest_id: u64,
1932 ) -> Self::DictionaryGetResponseFut {
1933 fn _decode(
1934 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1935 ) -> Result<CapabilityStoreDictionaryGetResult, fidl::Error> {
1936 let _response = fidl::client::decode_transaction_body::<
1937 fidl::encoding::FlexibleResultType<
1938 fidl::encoding::EmptyStruct,
1939 CapabilityStoreError,
1940 >,
1941 fidl::encoding::DefaultFuchsiaResourceDialect,
1942 0x4d9e27538284add2,
1943 >(_buf?)?
1944 .into_result::<CapabilityStoreMarker>("dictionary_get")?;
1945 Ok(_response.map(|x| x))
1946 }
1947 self.client.send_query_and_decode::<
1948 CapabilityStoreDictionaryGetRequest,
1949 CapabilityStoreDictionaryGetResult,
1950 >(
1951 (id, key, dest_id,),
1952 0x4d9e27538284add2,
1953 fidl::encoding::DynamicFlags::FLEXIBLE,
1954 _decode,
1955 )
1956 }
1957
1958 type DictionaryRemoveResponseFut = fidl::client::QueryResponseFut<
1959 CapabilityStoreDictionaryRemoveResult,
1960 fidl::encoding::DefaultFuchsiaResourceDialect,
1961 >;
1962 fn r#dictionary_remove(
1963 &self,
1964 mut id: u64,
1965 mut key: &str,
1966 mut dest_id: Option<&WrappedCapabilityId>,
1967 ) -> Self::DictionaryRemoveResponseFut {
1968 fn _decode(
1969 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1970 ) -> Result<CapabilityStoreDictionaryRemoveResult, fidl::Error> {
1971 let _response = fidl::client::decode_transaction_body::<
1972 fidl::encoding::FlexibleResultType<
1973 fidl::encoding::EmptyStruct,
1974 CapabilityStoreError,
1975 >,
1976 fidl::encoding::DefaultFuchsiaResourceDialect,
1977 0x4c5c025ab05d4f3,
1978 >(_buf?)?
1979 .into_result::<CapabilityStoreMarker>("dictionary_remove")?;
1980 Ok(_response.map(|x| x))
1981 }
1982 self.client.send_query_and_decode::<
1983 CapabilityStoreDictionaryRemoveRequest,
1984 CapabilityStoreDictionaryRemoveResult,
1985 >(
1986 (id, key, dest_id,),
1987 0x4c5c025ab05d4f3,
1988 fidl::encoding::DynamicFlags::FLEXIBLE,
1989 _decode,
1990 )
1991 }
1992
1993 type DictionaryCopyResponseFut = fidl::client::QueryResponseFut<
1994 CapabilityStoreDictionaryCopyResult,
1995 fidl::encoding::DefaultFuchsiaResourceDialect,
1996 >;
1997 fn r#dictionary_copy(&self, mut id: u64, mut dest_id: u64) -> Self::DictionaryCopyResponseFut {
1998 fn _decode(
1999 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2000 ) -> Result<CapabilityStoreDictionaryCopyResult, fidl::Error> {
2001 let _response = fidl::client::decode_transaction_body::<
2002 fidl::encoding::FlexibleResultType<
2003 fidl::encoding::EmptyStruct,
2004 CapabilityStoreError,
2005 >,
2006 fidl::encoding::DefaultFuchsiaResourceDialect,
2007 0x3733ecdf4ea1b44f,
2008 >(_buf?)?
2009 .into_result::<CapabilityStoreMarker>("dictionary_copy")?;
2010 Ok(_response.map(|x| x))
2011 }
2012 self.client.send_query_and_decode::<
2013 CapabilityStoreDictionaryCopyRequest,
2014 CapabilityStoreDictionaryCopyResult,
2015 >(
2016 (id, dest_id,),
2017 0x3733ecdf4ea1b44f,
2018 fidl::encoding::DynamicFlags::FLEXIBLE,
2019 _decode,
2020 )
2021 }
2022
2023 type DictionaryKeysResponseFut = fidl::client::QueryResponseFut<
2024 CapabilityStoreDictionaryKeysResult,
2025 fidl::encoding::DefaultFuchsiaResourceDialect,
2026 >;
2027 fn r#dictionary_keys(
2028 &self,
2029 mut id: u64,
2030 mut iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2031 ) -> Self::DictionaryKeysResponseFut {
2032 fn _decode(
2033 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2034 ) -> Result<CapabilityStoreDictionaryKeysResult, fidl::Error> {
2035 let _response = fidl::client::decode_transaction_body::<
2036 fidl::encoding::FlexibleResultType<
2037 fidl::encoding::EmptyStruct,
2038 CapabilityStoreError,
2039 >,
2040 fidl::encoding::DefaultFuchsiaResourceDialect,
2041 0x84b05577ceaec9e,
2042 >(_buf?)?
2043 .into_result::<CapabilityStoreMarker>("dictionary_keys")?;
2044 Ok(_response.map(|x| x))
2045 }
2046 self.client.send_query_and_decode::<
2047 CapabilityStoreDictionaryKeysRequest,
2048 CapabilityStoreDictionaryKeysResult,
2049 >(
2050 (id, iterator,),
2051 0x84b05577ceaec9e,
2052 fidl::encoding::DynamicFlags::FLEXIBLE,
2053 _decode,
2054 )
2055 }
2056
2057 type DictionaryEnumerateResponseFut = fidl::client::QueryResponseFut<
2058 CapabilityStoreDictionaryEnumerateResult,
2059 fidl::encoding::DefaultFuchsiaResourceDialect,
2060 >;
2061 fn r#dictionary_enumerate(
2062 &self,
2063 mut id: u64,
2064 mut iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2065 ) -> Self::DictionaryEnumerateResponseFut {
2066 fn _decode(
2067 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2068 ) -> Result<CapabilityStoreDictionaryEnumerateResult, fidl::Error> {
2069 let _response = fidl::client::decode_transaction_body::<
2070 fidl::encoding::FlexibleResultType<
2071 fidl::encoding::EmptyStruct,
2072 CapabilityStoreError,
2073 >,
2074 fidl::encoding::DefaultFuchsiaResourceDialect,
2075 0xd6279b6ced04641,
2076 >(_buf?)?
2077 .into_result::<CapabilityStoreMarker>("dictionary_enumerate")?;
2078 Ok(_response.map(|x| x))
2079 }
2080 self.client.send_query_and_decode::<
2081 CapabilityStoreDictionaryEnumerateRequest,
2082 CapabilityStoreDictionaryEnumerateResult,
2083 >(
2084 (id, iterator,),
2085 0xd6279b6ced04641,
2086 fidl::encoding::DynamicFlags::FLEXIBLE,
2087 _decode,
2088 )
2089 }
2090
2091 type DictionaryDrainResponseFut = fidl::client::QueryResponseFut<
2092 CapabilityStoreDictionaryDrainResult,
2093 fidl::encoding::DefaultFuchsiaResourceDialect,
2094 >;
2095 fn r#dictionary_drain(
2096 &self,
2097 mut id: u64,
2098 mut iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2099 ) -> Self::DictionaryDrainResponseFut {
2100 fn _decode(
2101 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2102 ) -> Result<CapabilityStoreDictionaryDrainResult, fidl::Error> {
2103 let _response = fidl::client::decode_transaction_body::<
2104 fidl::encoding::FlexibleResultType<
2105 fidl::encoding::EmptyStruct,
2106 CapabilityStoreError,
2107 >,
2108 fidl::encoding::DefaultFuchsiaResourceDialect,
2109 0x28a3a3f84d928cd8,
2110 >(_buf?)?
2111 .into_result::<CapabilityStoreMarker>("dictionary_drain")?;
2112 Ok(_response.map(|x| x))
2113 }
2114 self.client.send_query_and_decode::<
2115 CapabilityStoreDictionaryDrainRequest,
2116 CapabilityStoreDictionaryDrainResult,
2117 >(
2118 (id, iterator,),
2119 0x28a3a3f84d928cd8,
2120 fidl::encoding::DynamicFlags::FLEXIBLE,
2121 _decode,
2122 )
2123 }
2124}
2125
2126pub struct CapabilityStoreEventStream {
2127 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2128}
2129
2130impl std::marker::Unpin for CapabilityStoreEventStream {}
2131
2132impl futures::stream::FusedStream for CapabilityStoreEventStream {
2133 fn is_terminated(&self) -> bool {
2134 self.event_receiver.is_terminated()
2135 }
2136}
2137
2138impl futures::Stream for CapabilityStoreEventStream {
2139 type Item = Result<CapabilityStoreEvent, fidl::Error>;
2140
2141 fn poll_next(
2142 mut self: std::pin::Pin<&mut Self>,
2143 cx: &mut std::task::Context<'_>,
2144 ) -> std::task::Poll<Option<Self::Item>> {
2145 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2146 &mut self.event_receiver,
2147 cx
2148 )?) {
2149 Some(buf) => std::task::Poll::Ready(Some(CapabilityStoreEvent::decode(buf))),
2150 None => std::task::Poll::Ready(None),
2151 }
2152 }
2153}
2154
2155#[derive(Debug)]
2156pub enum CapabilityStoreEvent {
2157 #[non_exhaustive]
2158 _UnknownEvent {
2159 ordinal: u64,
2161 },
2162}
2163
2164impl CapabilityStoreEvent {
2165 fn decode(
2167 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2168 ) -> Result<CapabilityStoreEvent, fidl::Error> {
2169 let (bytes, _handles) = buf.split_mut();
2170 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2171 debug_assert_eq!(tx_header.tx_id, 0);
2172 match tx_header.ordinal {
2173 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2174 Ok(CapabilityStoreEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2175 }
2176 _ => Err(fidl::Error::UnknownOrdinal {
2177 ordinal: tx_header.ordinal,
2178 protocol_name:
2179 <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2180 }),
2181 }
2182 }
2183}
2184
2185pub struct CapabilityStoreRequestStream {
2187 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2188 is_terminated: bool,
2189}
2190
2191impl std::marker::Unpin for CapabilityStoreRequestStream {}
2192
2193impl futures::stream::FusedStream for CapabilityStoreRequestStream {
2194 fn is_terminated(&self) -> bool {
2195 self.is_terminated
2196 }
2197}
2198
2199impl fidl::endpoints::RequestStream for CapabilityStoreRequestStream {
2200 type Protocol = CapabilityStoreMarker;
2201 type ControlHandle = CapabilityStoreControlHandle;
2202
2203 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2204 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2205 }
2206
2207 fn control_handle(&self) -> Self::ControlHandle {
2208 CapabilityStoreControlHandle { inner: self.inner.clone() }
2209 }
2210
2211 fn into_inner(
2212 self,
2213 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2214 {
2215 (self.inner, self.is_terminated)
2216 }
2217
2218 fn from_inner(
2219 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2220 is_terminated: bool,
2221 ) -> Self {
2222 Self { inner, is_terminated }
2223 }
2224}
2225
2226impl futures::Stream for CapabilityStoreRequestStream {
2227 type Item = Result<CapabilityStoreRequest, fidl::Error>;
2228
2229 fn poll_next(
2230 mut self: std::pin::Pin<&mut Self>,
2231 cx: &mut std::task::Context<'_>,
2232 ) -> std::task::Poll<Option<Self::Item>> {
2233 let this = &mut *self;
2234 if this.inner.check_shutdown(cx) {
2235 this.is_terminated = true;
2236 return std::task::Poll::Ready(None);
2237 }
2238 if this.is_terminated {
2239 panic!("polled CapabilityStoreRequestStream after completion");
2240 }
2241 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2242 |bytes, handles| {
2243 match this.inner.channel().read_etc(cx, bytes, handles) {
2244 std::task::Poll::Ready(Ok(())) => {}
2245 std::task::Poll::Pending => return std::task::Poll::Pending,
2246 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2247 this.is_terminated = true;
2248 return std::task::Poll::Ready(None);
2249 }
2250 std::task::Poll::Ready(Err(e)) => {
2251 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2252 e.into(),
2253 ))));
2254 }
2255 }
2256
2257 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2259
2260 std::task::Poll::Ready(Some(match header.ordinal {
2261 0x5d5d35d9c20a2184 => {
2262 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2263 let mut req = fidl::new_empty!(
2264 CapabilityStoreDuplicateRequest,
2265 fidl::encoding::DefaultFuchsiaResourceDialect
2266 );
2267 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDuplicateRequest>(&header, _body_bytes, handles, &mut req)?;
2268 let control_handle =
2269 CapabilityStoreControlHandle { inner: this.inner.clone() };
2270 Ok(CapabilityStoreRequest::Duplicate {
2271 id: req.id,
2272 dest_id: req.dest_id,
2273
2274 responder: CapabilityStoreDuplicateResponder {
2275 control_handle: std::mem::ManuallyDrop::new(control_handle),
2276 tx_id: header.tx_id,
2277 },
2278 })
2279 }
2280 0xa745c0990fc2559 => {
2281 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2282 let mut req = fidl::new_empty!(
2283 CapabilityStoreDropRequest,
2284 fidl::encoding::DefaultFuchsiaResourceDialect
2285 );
2286 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDropRequest>(&header, _body_bytes, handles, &mut req)?;
2287 let control_handle =
2288 CapabilityStoreControlHandle { inner: this.inner.clone() };
2289 Ok(CapabilityStoreRequest::Drop {
2290 id: req.id,
2291
2292 responder: CapabilityStoreDropResponder {
2293 control_handle: std::mem::ManuallyDrop::new(control_handle),
2294 tx_id: header.tx_id,
2295 },
2296 })
2297 }
2298 0x3237a8f4748faff => {
2299 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2300 let mut req = fidl::new_empty!(
2301 CapabilityStoreExportRequest,
2302 fidl::encoding::DefaultFuchsiaResourceDialect
2303 );
2304 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreExportRequest>(&header, _body_bytes, handles, &mut req)?;
2305 let control_handle =
2306 CapabilityStoreControlHandle { inner: this.inner.clone() };
2307 Ok(CapabilityStoreRequest::Export {
2308 id: req.id,
2309
2310 responder: CapabilityStoreExportResponder {
2311 control_handle: std::mem::ManuallyDrop::new(control_handle),
2312 tx_id: header.tx_id,
2313 },
2314 })
2315 }
2316 0x1f96157a29f4539b => {
2317 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2318 let mut req = fidl::new_empty!(
2319 CapabilityStoreImportRequest,
2320 fidl::encoding::DefaultFuchsiaResourceDialect
2321 );
2322 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreImportRequest>(&header, _body_bytes, handles, &mut req)?;
2323 let control_handle =
2324 CapabilityStoreControlHandle { inner: this.inner.clone() };
2325 Ok(CapabilityStoreRequest::Import {
2326 id: req.id,
2327 capability: req.capability,
2328
2329 responder: CapabilityStoreImportResponder {
2330 control_handle: std::mem::ManuallyDrop::new(control_handle),
2331 tx_id: header.tx_id,
2332 },
2333 })
2334 }
2335 0x29592c5d63e91c25 => {
2336 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2337 let mut req = fidl::new_empty!(
2338 CapabilityStoreConnectorCreateRequest,
2339 fidl::encoding::DefaultFuchsiaResourceDialect
2340 );
2341 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2342 let control_handle =
2343 CapabilityStoreControlHandle { inner: this.inner.clone() };
2344 Ok(CapabilityStoreRequest::ConnectorCreate {
2345 id: req.id,
2346 receiver: req.receiver,
2347
2348 responder: CapabilityStoreConnectorCreateResponder {
2349 control_handle: std::mem::ManuallyDrop::new(control_handle),
2350 tx_id: header.tx_id,
2351 },
2352 })
2353 }
2354 0x537e69ab40563b9f => {
2355 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2356 let mut req = fidl::new_empty!(
2357 CapabilityStoreConnectorOpenRequest,
2358 fidl::encoding::DefaultFuchsiaResourceDialect
2359 );
2360 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2361 let control_handle =
2362 CapabilityStoreControlHandle { inner: this.inner.clone() };
2363 Ok(CapabilityStoreRequest::ConnectorOpen {
2364 id: req.id,
2365 server_end: req.server_end,
2366
2367 responder: CapabilityStoreConnectorOpenResponder {
2368 control_handle: std::mem::ManuallyDrop::new(control_handle),
2369 tx_id: header.tx_id,
2370 },
2371 })
2372 }
2373 0x186138a11ccf19bb => {
2374 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2375 let mut req = fidl::new_empty!(
2376 CapabilityStoreDirConnectorCreateRequest,
2377 fidl::encoding::DefaultFuchsiaResourceDialect
2378 );
2379 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2380 let control_handle =
2381 CapabilityStoreControlHandle { inner: this.inner.clone() };
2382 Ok(CapabilityStoreRequest::DirConnectorCreate {
2383 id: req.id,
2384 receiver: req.receiver,
2385
2386 responder: CapabilityStoreDirConnectorCreateResponder {
2387 control_handle: std::mem::ManuallyDrop::new(control_handle),
2388 tx_id: header.tx_id,
2389 },
2390 })
2391 }
2392 0x5650d3d6a3a13901 => {
2393 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2394 let mut req = fidl::new_empty!(
2395 CapabilityStoreDirConnectorOpenRequest,
2396 fidl::encoding::DefaultFuchsiaResourceDialect
2397 );
2398 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDirConnectorOpenRequest>(&header, _body_bytes, handles, &mut req)?;
2399 let control_handle =
2400 CapabilityStoreControlHandle { inner: this.inner.clone() };
2401 Ok(CapabilityStoreRequest::DirConnectorOpen {
2402 payload: req,
2403 responder: CapabilityStoreDirConnectorOpenResponder {
2404 control_handle: std::mem::ManuallyDrop::new(control_handle),
2405 tx_id: header.tx_id,
2406 },
2407 })
2408 }
2409 0x6997c8dfc63de093 => {
2410 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2411 let mut req = fidl::new_empty!(
2412 CapabilityStoreDictionaryCreateRequest,
2413 fidl::encoding::DefaultFuchsiaResourceDialect
2414 );
2415 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2416 let control_handle =
2417 CapabilityStoreControlHandle { inner: this.inner.clone() };
2418 Ok(CapabilityStoreRequest::DictionaryCreate {
2419 id: req.id,
2420
2421 responder: CapabilityStoreDictionaryCreateResponder {
2422 control_handle: std::mem::ManuallyDrop::new(control_handle),
2423 tx_id: header.tx_id,
2424 },
2425 })
2426 }
2427 0x72fd686c37b6025f => {
2428 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2429 let mut req = fidl::new_empty!(
2430 CapabilityStoreDictionaryLegacyImportRequest,
2431 fidl::encoding::DefaultFuchsiaResourceDialect
2432 );
2433 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyImportRequest>(&header, _body_bytes, handles, &mut req)?;
2434 let control_handle =
2435 CapabilityStoreControlHandle { inner: this.inner.clone() };
2436 Ok(CapabilityStoreRequest::DictionaryLegacyImport {
2437 id: req.id,
2438 client_end: req.client_end,
2439
2440 responder: CapabilityStoreDictionaryLegacyImportResponder {
2441 control_handle: std::mem::ManuallyDrop::new(control_handle),
2442 tx_id: header.tx_id,
2443 },
2444 })
2445 }
2446 0x407e15cc4bde5dcd => {
2447 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2448 let mut req = fidl::new_empty!(
2449 CapabilityStoreDictionaryLegacyExportRequest,
2450 fidl::encoding::DefaultFuchsiaResourceDialect
2451 );
2452 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryLegacyExportRequest>(&header, _body_bytes, handles, &mut req)?;
2453 let control_handle =
2454 CapabilityStoreControlHandle { inner: this.inner.clone() };
2455 Ok(CapabilityStoreRequest::DictionaryLegacyExport {
2456 id: req.id,
2457 server_end: req.server_end,
2458
2459 responder: CapabilityStoreDictionaryLegacyExportResponder {
2460 control_handle: std::mem::ManuallyDrop::new(control_handle),
2461 tx_id: header.tx_id,
2462 },
2463 })
2464 }
2465 0x7702183689d44c27 => {
2466 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2467 let mut req = fidl::new_empty!(
2468 CapabilityStoreDictionaryInsertRequest,
2469 fidl::encoding::DefaultFuchsiaResourceDialect
2470 );
2471 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryInsertRequest>(&header, _body_bytes, handles, &mut req)?;
2472 let control_handle =
2473 CapabilityStoreControlHandle { inner: this.inner.clone() };
2474 Ok(CapabilityStoreRequest::DictionaryInsert {
2475 id: req.id,
2476 item: req.item,
2477
2478 responder: CapabilityStoreDictionaryInsertResponder {
2479 control_handle: std::mem::ManuallyDrop::new(control_handle),
2480 tx_id: header.tx_id,
2481 },
2482 })
2483 }
2484 0x4d9e27538284add2 => {
2485 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2486 let mut req = fidl::new_empty!(
2487 CapabilityStoreDictionaryGetRequest,
2488 fidl::encoding::DefaultFuchsiaResourceDialect
2489 );
2490 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryGetRequest>(&header, _body_bytes, handles, &mut req)?;
2491 let control_handle =
2492 CapabilityStoreControlHandle { inner: this.inner.clone() };
2493 Ok(CapabilityStoreRequest::DictionaryGet {
2494 id: req.id,
2495 key: req.key,
2496 dest_id: req.dest_id,
2497
2498 responder: CapabilityStoreDictionaryGetResponder {
2499 control_handle: std::mem::ManuallyDrop::new(control_handle),
2500 tx_id: header.tx_id,
2501 },
2502 })
2503 }
2504 0x4c5c025ab05d4f3 => {
2505 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2506 let mut req = fidl::new_empty!(
2507 CapabilityStoreDictionaryRemoveRequest,
2508 fidl::encoding::DefaultFuchsiaResourceDialect
2509 );
2510 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2511 let control_handle =
2512 CapabilityStoreControlHandle { inner: this.inner.clone() };
2513 Ok(CapabilityStoreRequest::DictionaryRemove {
2514 id: req.id,
2515 key: req.key,
2516 dest_id: req.dest_id,
2517
2518 responder: CapabilityStoreDictionaryRemoveResponder {
2519 control_handle: std::mem::ManuallyDrop::new(control_handle),
2520 tx_id: header.tx_id,
2521 },
2522 })
2523 }
2524 0x3733ecdf4ea1b44f => {
2525 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2526 let mut req = fidl::new_empty!(
2527 CapabilityStoreDictionaryCopyRequest,
2528 fidl::encoding::DefaultFuchsiaResourceDialect
2529 );
2530 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryCopyRequest>(&header, _body_bytes, handles, &mut req)?;
2531 let control_handle =
2532 CapabilityStoreControlHandle { inner: this.inner.clone() };
2533 Ok(CapabilityStoreRequest::DictionaryCopy {
2534 id: req.id,
2535 dest_id: req.dest_id,
2536
2537 responder: CapabilityStoreDictionaryCopyResponder {
2538 control_handle: std::mem::ManuallyDrop::new(control_handle),
2539 tx_id: header.tx_id,
2540 },
2541 })
2542 }
2543 0x84b05577ceaec9e => {
2544 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2545 let mut req = fidl::new_empty!(
2546 CapabilityStoreDictionaryKeysRequest,
2547 fidl::encoding::DefaultFuchsiaResourceDialect
2548 );
2549 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryKeysRequest>(&header, _body_bytes, handles, &mut req)?;
2550 let control_handle =
2551 CapabilityStoreControlHandle { inner: this.inner.clone() };
2552 Ok(CapabilityStoreRequest::DictionaryKeys {
2553 id: req.id,
2554 iterator: req.iterator,
2555
2556 responder: CapabilityStoreDictionaryKeysResponder {
2557 control_handle: std::mem::ManuallyDrop::new(control_handle),
2558 tx_id: header.tx_id,
2559 },
2560 })
2561 }
2562 0xd6279b6ced04641 => {
2563 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2564 let mut req = fidl::new_empty!(
2565 CapabilityStoreDictionaryEnumerateRequest,
2566 fidl::encoding::DefaultFuchsiaResourceDialect
2567 );
2568 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryEnumerateRequest>(&header, _body_bytes, handles, &mut req)?;
2569 let control_handle =
2570 CapabilityStoreControlHandle { inner: this.inner.clone() };
2571 Ok(CapabilityStoreRequest::DictionaryEnumerate {
2572 id: req.id,
2573 iterator: req.iterator,
2574
2575 responder: CapabilityStoreDictionaryEnumerateResponder {
2576 control_handle: std::mem::ManuallyDrop::new(control_handle),
2577 tx_id: header.tx_id,
2578 },
2579 })
2580 }
2581 0x28a3a3f84d928cd8 => {
2582 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2583 let mut req = fidl::new_empty!(
2584 CapabilityStoreDictionaryDrainRequest,
2585 fidl::encoding::DefaultFuchsiaResourceDialect
2586 );
2587 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CapabilityStoreDictionaryDrainRequest>(&header, _body_bytes, handles, &mut req)?;
2588 let control_handle =
2589 CapabilityStoreControlHandle { inner: this.inner.clone() };
2590 Ok(CapabilityStoreRequest::DictionaryDrain {
2591 id: req.id,
2592 iterator: req.iterator,
2593
2594 responder: CapabilityStoreDictionaryDrainResponder {
2595 control_handle: std::mem::ManuallyDrop::new(control_handle),
2596 tx_id: header.tx_id,
2597 },
2598 })
2599 }
2600 _ if header.tx_id == 0
2601 && header
2602 .dynamic_flags()
2603 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2604 {
2605 Ok(CapabilityStoreRequest::_UnknownMethod {
2606 ordinal: header.ordinal,
2607 control_handle: CapabilityStoreControlHandle {
2608 inner: this.inner.clone(),
2609 },
2610 method_type: fidl::MethodType::OneWay,
2611 })
2612 }
2613 _ if header
2614 .dynamic_flags()
2615 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2616 {
2617 this.inner.send_framework_err(
2618 fidl::encoding::FrameworkErr::UnknownMethod,
2619 header.tx_id,
2620 header.ordinal,
2621 header.dynamic_flags(),
2622 (bytes, handles),
2623 )?;
2624 Ok(CapabilityStoreRequest::_UnknownMethod {
2625 ordinal: header.ordinal,
2626 control_handle: CapabilityStoreControlHandle {
2627 inner: this.inner.clone(),
2628 },
2629 method_type: fidl::MethodType::TwoWay,
2630 })
2631 }
2632 _ => Err(fidl::Error::UnknownOrdinal {
2633 ordinal: header.ordinal,
2634 protocol_name:
2635 <CapabilityStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2636 }),
2637 }))
2638 },
2639 )
2640 }
2641}
2642
2643#[derive(Debug)]
2667pub enum CapabilityStoreRequest {
2668 Duplicate { id: u64, dest_id: u64, responder: CapabilityStoreDuplicateResponder },
2676 Drop { id: u64, responder: CapabilityStoreDropResponder },
2682 Export { id: u64, responder: CapabilityStoreExportResponder },
2690 Import { id: u64, capability: Capability, responder: CapabilityStoreImportResponder },
2697 ConnectorCreate {
2704 id: u64,
2705 receiver: fidl::endpoints::ClientEnd<ReceiverMarker>,
2706 responder: CapabilityStoreConnectorCreateResponder,
2707 },
2708 ConnectorOpen {
2718 id: u64,
2719 server_end: fidl::Channel,
2720 responder: CapabilityStoreConnectorOpenResponder,
2721 },
2722 DirConnectorCreate {
2729 id: u64,
2730 receiver: fidl::endpoints::ClientEnd<DirReceiverMarker>,
2731 responder: CapabilityStoreDirConnectorCreateResponder,
2732 },
2733 DirConnectorOpen {
2747 payload: CapabilityStoreDirConnectorOpenRequest,
2748 responder: CapabilityStoreDirConnectorOpenResponder,
2749 },
2750 DictionaryCreate { id: u64, responder: CapabilityStoreDictionaryCreateResponder },
2756 DictionaryLegacyImport {
2766 id: u64,
2767 client_end: fidl::Channel,
2768 responder: CapabilityStoreDictionaryLegacyImportResponder,
2769 },
2770 DictionaryLegacyExport {
2780 id: u64,
2781 server_end: fidl::Channel,
2782 responder: CapabilityStoreDictionaryLegacyExportResponder,
2783 },
2784 DictionaryInsert {
2794 id: u64,
2795 item: DictionaryItem,
2796 responder: CapabilityStoreDictionaryInsertResponder,
2797 },
2798 DictionaryGet {
2810 id: u64,
2811 key: String,
2812 dest_id: u64,
2813 responder: CapabilityStoreDictionaryGetResponder,
2814 },
2815 DictionaryRemove {
2826 id: u64,
2827 key: String,
2828 dest_id: Option<Box<WrappedCapabilityId>>,
2829 responder: CapabilityStoreDictionaryRemoveResponder,
2830 },
2831 DictionaryCopy { id: u64, dest_id: u64, responder: CapabilityStoreDictionaryCopyResponder },
2847 DictionaryKeys {
2854 id: u64,
2855 iterator: fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
2856 responder: CapabilityStoreDictionaryKeysResponder,
2857 },
2858 DictionaryEnumerate {
2868 id: u64,
2869 iterator: fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
2870 responder: CapabilityStoreDictionaryEnumerateResponder,
2871 },
2872 DictionaryDrain {
2880 id: u64,
2881 iterator: Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
2882 responder: CapabilityStoreDictionaryDrainResponder,
2883 },
2884 #[non_exhaustive]
2886 _UnknownMethod {
2887 ordinal: u64,
2889 control_handle: CapabilityStoreControlHandle,
2890 method_type: fidl::MethodType,
2891 },
2892}
2893
2894impl CapabilityStoreRequest {
2895 #[allow(irrefutable_let_patterns)]
2896 pub fn into_duplicate(self) -> Option<(u64, u64, CapabilityStoreDuplicateResponder)> {
2897 if let CapabilityStoreRequest::Duplicate { id, dest_id, responder } = self {
2898 Some((id, dest_id, responder))
2899 } else {
2900 None
2901 }
2902 }
2903
2904 #[allow(irrefutable_let_patterns)]
2905 pub fn into_drop(self) -> Option<(u64, CapabilityStoreDropResponder)> {
2906 if let CapabilityStoreRequest::Drop { id, responder } = self {
2907 Some((id, responder))
2908 } else {
2909 None
2910 }
2911 }
2912
2913 #[allow(irrefutable_let_patterns)]
2914 pub fn into_export(self) -> Option<(u64, CapabilityStoreExportResponder)> {
2915 if let CapabilityStoreRequest::Export { id, responder } = self {
2916 Some((id, responder))
2917 } else {
2918 None
2919 }
2920 }
2921
2922 #[allow(irrefutable_let_patterns)]
2923 pub fn into_import(self) -> Option<(u64, Capability, CapabilityStoreImportResponder)> {
2924 if let CapabilityStoreRequest::Import { id, capability, responder } = self {
2925 Some((id, capability, responder))
2926 } else {
2927 None
2928 }
2929 }
2930
2931 #[allow(irrefutable_let_patterns)]
2932 pub fn into_connector_create(
2933 self,
2934 ) -> Option<(
2935 u64,
2936 fidl::endpoints::ClientEnd<ReceiverMarker>,
2937 CapabilityStoreConnectorCreateResponder,
2938 )> {
2939 if let CapabilityStoreRequest::ConnectorCreate { id, receiver, responder } = self {
2940 Some((id, receiver, responder))
2941 } else {
2942 None
2943 }
2944 }
2945
2946 #[allow(irrefutable_let_patterns)]
2947 pub fn into_connector_open(
2948 self,
2949 ) -> Option<(u64, fidl::Channel, CapabilityStoreConnectorOpenResponder)> {
2950 if let CapabilityStoreRequest::ConnectorOpen { id, server_end, responder } = self {
2951 Some((id, server_end, responder))
2952 } else {
2953 None
2954 }
2955 }
2956
2957 #[allow(irrefutable_let_patterns)]
2958 pub fn into_dir_connector_create(
2959 self,
2960 ) -> Option<(
2961 u64,
2962 fidl::endpoints::ClientEnd<DirReceiverMarker>,
2963 CapabilityStoreDirConnectorCreateResponder,
2964 )> {
2965 if let CapabilityStoreRequest::DirConnectorCreate { id, receiver, responder } = self {
2966 Some((id, receiver, responder))
2967 } else {
2968 None
2969 }
2970 }
2971
2972 #[allow(irrefutable_let_patterns)]
2973 pub fn into_dir_connector_open(
2974 self,
2975 ) -> Option<(CapabilityStoreDirConnectorOpenRequest, CapabilityStoreDirConnectorOpenResponder)>
2976 {
2977 if let CapabilityStoreRequest::DirConnectorOpen { payload, responder } = self {
2978 Some((payload, responder))
2979 } else {
2980 None
2981 }
2982 }
2983
2984 #[allow(irrefutable_let_patterns)]
2985 pub fn into_dictionary_create(self) -> Option<(u64, CapabilityStoreDictionaryCreateResponder)> {
2986 if let CapabilityStoreRequest::DictionaryCreate { id, responder } = self {
2987 Some((id, responder))
2988 } else {
2989 None
2990 }
2991 }
2992
2993 #[allow(irrefutable_let_patterns)]
2994 pub fn into_dictionary_legacy_import(
2995 self,
2996 ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyImportResponder)> {
2997 if let CapabilityStoreRequest::DictionaryLegacyImport { id, client_end, responder } = self {
2998 Some((id, client_end, responder))
2999 } else {
3000 None
3001 }
3002 }
3003
3004 #[allow(irrefutable_let_patterns)]
3005 pub fn into_dictionary_legacy_export(
3006 self,
3007 ) -> Option<(u64, fidl::Channel, CapabilityStoreDictionaryLegacyExportResponder)> {
3008 if let CapabilityStoreRequest::DictionaryLegacyExport { id, server_end, responder } = self {
3009 Some((id, server_end, responder))
3010 } else {
3011 None
3012 }
3013 }
3014
3015 #[allow(irrefutable_let_patterns)]
3016 pub fn into_dictionary_insert(
3017 self,
3018 ) -> Option<(u64, DictionaryItem, CapabilityStoreDictionaryInsertResponder)> {
3019 if let CapabilityStoreRequest::DictionaryInsert { id, item, responder } = self {
3020 Some((id, item, responder))
3021 } else {
3022 None
3023 }
3024 }
3025
3026 #[allow(irrefutable_let_patterns)]
3027 pub fn into_dictionary_get(
3028 self,
3029 ) -> Option<(u64, String, u64, CapabilityStoreDictionaryGetResponder)> {
3030 if let CapabilityStoreRequest::DictionaryGet { id, key, dest_id, responder } = self {
3031 Some((id, key, dest_id, responder))
3032 } else {
3033 None
3034 }
3035 }
3036
3037 #[allow(irrefutable_let_patterns)]
3038 pub fn into_dictionary_remove(
3039 self,
3040 ) -> Option<(
3041 u64,
3042 String,
3043 Option<Box<WrappedCapabilityId>>,
3044 CapabilityStoreDictionaryRemoveResponder,
3045 )> {
3046 if let CapabilityStoreRequest::DictionaryRemove { id, key, dest_id, responder } = self {
3047 Some((id, key, dest_id, responder))
3048 } else {
3049 None
3050 }
3051 }
3052
3053 #[allow(irrefutable_let_patterns)]
3054 pub fn into_dictionary_copy(
3055 self,
3056 ) -> Option<(u64, u64, CapabilityStoreDictionaryCopyResponder)> {
3057 if let CapabilityStoreRequest::DictionaryCopy { id, dest_id, responder } = self {
3058 Some((id, dest_id, responder))
3059 } else {
3060 None
3061 }
3062 }
3063
3064 #[allow(irrefutable_let_patterns)]
3065 pub fn into_dictionary_keys(
3066 self,
3067 ) -> Option<(
3068 u64,
3069 fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
3070 CapabilityStoreDictionaryKeysResponder,
3071 )> {
3072 if let CapabilityStoreRequest::DictionaryKeys { id, iterator, responder } = self {
3073 Some((id, iterator, responder))
3074 } else {
3075 None
3076 }
3077 }
3078
3079 #[allow(irrefutable_let_patterns)]
3080 pub fn into_dictionary_enumerate(
3081 self,
3082 ) -> Option<(
3083 u64,
3084 fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
3085 CapabilityStoreDictionaryEnumerateResponder,
3086 )> {
3087 if let CapabilityStoreRequest::DictionaryEnumerate { id, iterator, responder } = self {
3088 Some((id, iterator, responder))
3089 } else {
3090 None
3091 }
3092 }
3093
3094 #[allow(irrefutable_let_patterns)]
3095 pub fn into_dictionary_drain(
3096 self,
3097 ) -> Option<(
3098 u64,
3099 Option<fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>>,
3100 CapabilityStoreDictionaryDrainResponder,
3101 )> {
3102 if let CapabilityStoreRequest::DictionaryDrain { id, iterator, responder } = self {
3103 Some((id, iterator, responder))
3104 } else {
3105 None
3106 }
3107 }
3108
3109 pub fn method_name(&self) -> &'static str {
3111 match *self {
3112 CapabilityStoreRequest::Duplicate { .. } => "duplicate",
3113 CapabilityStoreRequest::Drop { .. } => "drop",
3114 CapabilityStoreRequest::Export { .. } => "export",
3115 CapabilityStoreRequest::Import { .. } => "import",
3116 CapabilityStoreRequest::ConnectorCreate { .. } => "connector_create",
3117 CapabilityStoreRequest::ConnectorOpen { .. } => "connector_open",
3118 CapabilityStoreRequest::DirConnectorCreate { .. } => "dir_connector_create",
3119 CapabilityStoreRequest::DirConnectorOpen { .. } => "dir_connector_open",
3120 CapabilityStoreRequest::DictionaryCreate { .. } => "dictionary_create",
3121 CapabilityStoreRequest::DictionaryLegacyImport { .. } => "dictionary_legacy_import",
3122 CapabilityStoreRequest::DictionaryLegacyExport { .. } => "dictionary_legacy_export",
3123 CapabilityStoreRequest::DictionaryInsert { .. } => "dictionary_insert",
3124 CapabilityStoreRequest::DictionaryGet { .. } => "dictionary_get",
3125 CapabilityStoreRequest::DictionaryRemove { .. } => "dictionary_remove",
3126 CapabilityStoreRequest::DictionaryCopy { .. } => "dictionary_copy",
3127 CapabilityStoreRequest::DictionaryKeys { .. } => "dictionary_keys",
3128 CapabilityStoreRequest::DictionaryEnumerate { .. } => "dictionary_enumerate",
3129 CapabilityStoreRequest::DictionaryDrain { .. } => "dictionary_drain",
3130 CapabilityStoreRequest::_UnknownMethod {
3131 method_type: fidl::MethodType::OneWay,
3132 ..
3133 } => "unknown one-way method",
3134 CapabilityStoreRequest::_UnknownMethod {
3135 method_type: fidl::MethodType::TwoWay,
3136 ..
3137 } => "unknown two-way method",
3138 }
3139 }
3140}
3141
3142#[derive(Debug, Clone)]
3143pub struct CapabilityStoreControlHandle {
3144 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3145}
3146
3147impl fidl::endpoints::ControlHandle for CapabilityStoreControlHandle {
3148 fn shutdown(&self) {
3149 self.inner.shutdown()
3150 }
3151
3152 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3153 self.inner.shutdown_with_epitaph(status)
3154 }
3155
3156 fn is_closed(&self) -> bool {
3157 self.inner.channel().is_closed()
3158 }
3159 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3160 self.inner.channel().on_closed()
3161 }
3162
3163 #[cfg(target_os = "fuchsia")]
3164 fn signal_peer(
3165 &self,
3166 clear_mask: zx::Signals,
3167 set_mask: zx::Signals,
3168 ) -> Result<(), zx_status::Status> {
3169 use fidl::Peered;
3170 self.inner.channel().signal_peer(clear_mask, set_mask)
3171 }
3172}
3173
3174impl CapabilityStoreControlHandle {}
3175
3176#[must_use = "FIDL methods require a response to be sent"]
3177#[derive(Debug)]
3178pub struct CapabilityStoreDuplicateResponder {
3179 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3180 tx_id: u32,
3181}
3182
3183impl std::ops::Drop for CapabilityStoreDuplicateResponder {
3187 fn drop(&mut self) {
3188 self.control_handle.shutdown();
3189 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3191 }
3192}
3193
3194impl fidl::endpoints::Responder for CapabilityStoreDuplicateResponder {
3195 type ControlHandle = CapabilityStoreControlHandle;
3196
3197 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3198 &self.control_handle
3199 }
3200
3201 fn drop_without_shutdown(mut self) {
3202 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3204 std::mem::forget(self);
3206 }
3207}
3208
3209impl CapabilityStoreDuplicateResponder {
3210 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3214 let _result = self.send_raw(result);
3215 if _result.is_err() {
3216 self.control_handle.shutdown();
3217 }
3218 self.drop_without_shutdown();
3219 _result
3220 }
3221
3222 pub fn send_no_shutdown_on_err(
3224 self,
3225 mut result: Result<(), CapabilityStoreError>,
3226 ) -> Result<(), fidl::Error> {
3227 let _result = self.send_raw(result);
3228 self.drop_without_shutdown();
3229 _result
3230 }
3231
3232 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3233 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3234 fidl::encoding::EmptyStruct,
3235 CapabilityStoreError,
3236 >>(
3237 fidl::encoding::FlexibleResult::new(result),
3238 self.tx_id,
3239 0x5d5d35d9c20a2184,
3240 fidl::encoding::DynamicFlags::FLEXIBLE,
3241 )
3242 }
3243}
3244
3245#[must_use = "FIDL methods require a response to be sent"]
3246#[derive(Debug)]
3247pub struct CapabilityStoreDropResponder {
3248 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3249 tx_id: u32,
3250}
3251
3252impl std::ops::Drop for CapabilityStoreDropResponder {
3256 fn drop(&mut self) {
3257 self.control_handle.shutdown();
3258 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3260 }
3261}
3262
3263impl fidl::endpoints::Responder for CapabilityStoreDropResponder {
3264 type ControlHandle = CapabilityStoreControlHandle;
3265
3266 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3267 &self.control_handle
3268 }
3269
3270 fn drop_without_shutdown(mut self) {
3271 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3273 std::mem::forget(self);
3275 }
3276}
3277
3278impl CapabilityStoreDropResponder {
3279 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3283 let _result = self.send_raw(result);
3284 if _result.is_err() {
3285 self.control_handle.shutdown();
3286 }
3287 self.drop_without_shutdown();
3288 _result
3289 }
3290
3291 pub fn send_no_shutdown_on_err(
3293 self,
3294 mut result: Result<(), CapabilityStoreError>,
3295 ) -> Result<(), fidl::Error> {
3296 let _result = self.send_raw(result);
3297 self.drop_without_shutdown();
3298 _result
3299 }
3300
3301 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3302 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3303 fidl::encoding::EmptyStruct,
3304 CapabilityStoreError,
3305 >>(
3306 fidl::encoding::FlexibleResult::new(result),
3307 self.tx_id,
3308 0xa745c0990fc2559,
3309 fidl::encoding::DynamicFlags::FLEXIBLE,
3310 )
3311 }
3312}
3313
3314#[must_use = "FIDL methods require a response to be sent"]
3315#[derive(Debug)]
3316pub struct CapabilityStoreExportResponder {
3317 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3318 tx_id: u32,
3319}
3320
3321impl std::ops::Drop for CapabilityStoreExportResponder {
3325 fn drop(&mut self) {
3326 self.control_handle.shutdown();
3327 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3329 }
3330}
3331
3332impl fidl::endpoints::Responder for CapabilityStoreExportResponder {
3333 type ControlHandle = CapabilityStoreControlHandle;
3334
3335 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3336 &self.control_handle
3337 }
3338
3339 fn drop_without_shutdown(mut self) {
3340 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3342 std::mem::forget(self);
3344 }
3345}
3346
3347impl CapabilityStoreExportResponder {
3348 pub fn send(
3352 self,
3353 mut result: Result<Capability, CapabilityStoreError>,
3354 ) -> Result<(), fidl::Error> {
3355 let _result = self.send_raw(result);
3356 if _result.is_err() {
3357 self.control_handle.shutdown();
3358 }
3359 self.drop_without_shutdown();
3360 _result
3361 }
3362
3363 pub fn send_no_shutdown_on_err(
3365 self,
3366 mut result: Result<Capability, CapabilityStoreError>,
3367 ) -> Result<(), fidl::Error> {
3368 let _result = self.send_raw(result);
3369 self.drop_without_shutdown();
3370 _result
3371 }
3372
3373 fn send_raw(
3374 &self,
3375 mut result: Result<Capability, CapabilityStoreError>,
3376 ) -> Result<(), fidl::Error> {
3377 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3378 CapabilityStoreExportResponse,
3379 CapabilityStoreError,
3380 >>(
3381 fidl::encoding::FlexibleResult::new(
3382 result.as_mut().map_err(|e| *e).map(|capability| (capability,)),
3383 ),
3384 self.tx_id,
3385 0x3237a8f4748faff,
3386 fidl::encoding::DynamicFlags::FLEXIBLE,
3387 )
3388 }
3389}
3390
3391#[must_use = "FIDL methods require a response to be sent"]
3392#[derive(Debug)]
3393pub struct CapabilityStoreImportResponder {
3394 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3395 tx_id: u32,
3396}
3397
3398impl std::ops::Drop for CapabilityStoreImportResponder {
3402 fn drop(&mut self) {
3403 self.control_handle.shutdown();
3404 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3406 }
3407}
3408
3409impl fidl::endpoints::Responder for CapabilityStoreImportResponder {
3410 type ControlHandle = CapabilityStoreControlHandle;
3411
3412 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3413 &self.control_handle
3414 }
3415
3416 fn drop_without_shutdown(mut self) {
3417 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3419 std::mem::forget(self);
3421 }
3422}
3423
3424impl CapabilityStoreImportResponder {
3425 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3429 let _result = self.send_raw(result);
3430 if _result.is_err() {
3431 self.control_handle.shutdown();
3432 }
3433 self.drop_without_shutdown();
3434 _result
3435 }
3436
3437 pub fn send_no_shutdown_on_err(
3439 self,
3440 mut result: Result<(), CapabilityStoreError>,
3441 ) -> Result<(), fidl::Error> {
3442 let _result = self.send_raw(result);
3443 self.drop_without_shutdown();
3444 _result
3445 }
3446
3447 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3448 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3449 fidl::encoding::EmptyStruct,
3450 CapabilityStoreError,
3451 >>(
3452 fidl::encoding::FlexibleResult::new(result),
3453 self.tx_id,
3454 0x1f96157a29f4539b,
3455 fidl::encoding::DynamicFlags::FLEXIBLE,
3456 )
3457 }
3458}
3459
3460#[must_use = "FIDL methods require a response to be sent"]
3461#[derive(Debug)]
3462pub struct CapabilityStoreConnectorCreateResponder {
3463 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3464 tx_id: u32,
3465}
3466
3467impl std::ops::Drop for CapabilityStoreConnectorCreateResponder {
3471 fn drop(&mut self) {
3472 self.control_handle.shutdown();
3473 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3475 }
3476}
3477
3478impl fidl::endpoints::Responder for CapabilityStoreConnectorCreateResponder {
3479 type ControlHandle = CapabilityStoreControlHandle;
3480
3481 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3482 &self.control_handle
3483 }
3484
3485 fn drop_without_shutdown(mut self) {
3486 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3488 std::mem::forget(self);
3490 }
3491}
3492
3493impl CapabilityStoreConnectorCreateResponder {
3494 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3498 let _result = self.send_raw(result);
3499 if _result.is_err() {
3500 self.control_handle.shutdown();
3501 }
3502 self.drop_without_shutdown();
3503 _result
3504 }
3505
3506 pub fn send_no_shutdown_on_err(
3508 self,
3509 mut result: Result<(), CapabilityStoreError>,
3510 ) -> Result<(), fidl::Error> {
3511 let _result = self.send_raw(result);
3512 self.drop_without_shutdown();
3513 _result
3514 }
3515
3516 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3517 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3518 fidl::encoding::EmptyStruct,
3519 CapabilityStoreError,
3520 >>(
3521 fidl::encoding::FlexibleResult::new(result),
3522 self.tx_id,
3523 0x29592c5d63e91c25,
3524 fidl::encoding::DynamicFlags::FLEXIBLE,
3525 )
3526 }
3527}
3528
3529#[must_use = "FIDL methods require a response to be sent"]
3530#[derive(Debug)]
3531pub struct CapabilityStoreConnectorOpenResponder {
3532 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3533 tx_id: u32,
3534}
3535
3536impl std::ops::Drop for CapabilityStoreConnectorOpenResponder {
3540 fn drop(&mut self) {
3541 self.control_handle.shutdown();
3542 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3544 }
3545}
3546
3547impl fidl::endpoints::Responder for CapabilityStoreConnectorOpenResponder {
3548 type ControlHandle = CapabilityStoreControlHandle;
3549
3550 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3551 &self.control_handle
3552 }
3553
3554 fn drop_without_shutdown(mut self) {
3555 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3557 std::mem::forget(self);
3559 }
3560}
3561
3562impl CapabilityStoreConnectorOpenResponder {
3563 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3567 let _result = self.send_raw(result);
3568 if _result.is_err() {
3569 self.control_handle.shutdown();
3570 }
3571 self.drop_without_shutdown();
3572 _result
3573 }
3574
3575 pub fn send_no_shutdown_on_err(
3577 self,
3578 mut result: Result<(), CapabilityStoreError>,
3579 ) -> Result<(), fidl::Error> {
3580 let _result = self.send_raw(result);
3581 self.drop_without_shutdown();
3582 _result
3583 }
3584
3585 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3586 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3587 fidl::encoding::EmptyStruct,
3588 CapabilityStoreError,
3589 >>(
3590 fidl::encoding::FlexibleResult::new(result),
3591 self.tx_id,
3592 0x537e69ab40563b9f,
3593 fidl::encoding::DynamicFlags::FLEXIBLE,
3594 )
3595 }
3596}
3597
3598#[must_use = "FIDL methods require a response to be sent"]
3599#[derive(Debug)]
3600pub struct CapabilityStoreDirConnectorCreateResponder {
3601 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3602 tx_id: u32,
3603}
3604
3605impl std::ops::Drop for CapabilityStoreDirConnectorCreateResponder {
3609 fn drop(&mut self) {
3610 self.control_handle.shutdown();
3611 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3613 }
3614}
3615
3616impl fidl::endpoints::Responder for CapabilityStoreDirConnectorCreateResponder {
3617 type ControlHandle = CapabilityStoreControlHandle;
3618
3619 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3620 &self.control_handle
3621 }
3622
3623 fn drop_without_shutdown(mut self) {
3624 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3626 std::mem::forget(self);
3628 }
3629}
3630
3631impl CapabilityStoreDirConnectorCreateResponder {
3632 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3636 let _result = self.send_raw(result);
3637 if _result.is_err() {
3638 self.control_handle.shutdown();
3639 }
3640 self.drop_without_shutdown();
3641 _result
3642 }
3643
3644 pub fn send_no_shutdown_on_err(
3646 self,
3647 mut result: Result<(), CapabilityStoreError>,
3648 ) -> Result<(), fidl::Error> {
3649 let _result = self.send_raw(result);
3650 self.drop_without_shutdown();
3651 _result
3652 }
3653
3654 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3655 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3656 fidl::encoding::EmptyStruct,
3657 CapabilityStoreError,
3658 >>(
3659 fidl::encoding::FlexibleResult::new(result),
3660 self.tx_id,
3661 0x186138a11ccf19bb,
3662 fidl::encoding::DynamicFlags::FLEXIBLE,
3663 )
3664 }
3665}
3666
3667#[must_use = "FIDL methods require a response to be sent"]
3668#[derive(Debug)]
3669pub struct CapabilityStoreDirConnectorOpenResponder {
3670 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3671 tx_id: u32,
3672}
3673
3674impl std::ops::Drop for CapabilityStoreDirConnectorOpenResponder {
3678 fn drop(&mut self) {
3679 self.control_handle.shutdown();
3680 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3682 }
3683}
3684
3685impl fidl::endpoints::Responder for CapabilityStoreDirConnectorOpenResponder {
3686 type ControlHandle = CapabilityStoreControlHandle;
3687
3688 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3689 &self.control_handle
3690 }
3691
3692 fn drop_without_shutdown(mut self) {
3693 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3695 std::mem::forget(self);
3697 }
3698}
3699
3700impl CapabilityStoreDirConnectorOpenResponder {
3701 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3705 let _result = self.send_raw(result);
3706 if _result.is_err() {
3707 self.control_handle.shutdown();
3708 }
3709 self.drop_without_shutdown();
3710 _result
3711 }
3712
3713 pub fn send_no_shutdown_on_err(
3715 self,
3716 mut result: Result<(), CapabilityStoreError>,
3717 ) -> Result<(), fidl::Error> {
3718 let _result = self.send_raw(result);
3719 self.drop_without_shutdown();
3720 _result
3721 }
3722
3723 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3724 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3725 fidl::encoding::EmptyStruct,
3726 CapabilityStoreError,
3727 >>(
3728 fidl::encoding::FlexibleResult::new(result),
3729 self.tx_id,
3730 0x5650d3d6a3a13901,
3731 fidl::encoding::DynamicFlags::FLEXIBLE,
3732 )
3733 }
3734}
3735
3736#[must_use = "FIDL methods require a response to be sent"]
3737#[derive(Debug)]
3738pub struct CapabilityStoreDictionaryCreateResponder {
3739 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3740 tx_id: u32,
3741}
3742
3743impl std::ops::Drop for CapabilityStoreDictionaryCreateResponder {
3747 fn drop(&mut self) {
3748 self.control_handle.shutdown();
3749 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3751 }
3752}
3753
3754impl fidl::endpoints::Responder for CapabilityStoreDictionaryCreateResponder {
3755 type ControlHandle = CapabilityStoreControlHandle;
3756
3757 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3758 &self.control_handle
3759 }
3760
3761 fn drop_without_shutdown(mut self) {
3762 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3764 std::mem::forget(self);
3766 }
3767}
3768
3769impl CapabilityStoreDictionaryCreateResponder {
3770 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3774 let _result = self.send_raw(result);
3775 if _result.is_err() {
3776 self.control_handle.shutdown();
3777 }
3778 self.drop_without_shutdown();
3779 _result
3780 }
3781
3782 pub fn send_no_shutdown_on_err(
3784 self,
3785 mut result: Result<(), CapabilityStoreError>,
3786 ) -> Result<(), fidl::Error> {
3787 let _result = self.send_raw(result);
3788 self.drop_without_shutdown();
3789 _result
3790 }
3791
3792 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3793 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3794 fidl::encoding::EmptyStruct,
3795 CapabilityStoreError,
3796 >>(
3797 fidl::encoding::FlexibleResult::new(result),
3798 self.tx_id,
3799 0x6997c8dfc63de093,
3800 fidl::encoding::DynamicFlags::FLEXIBLE,
3801 )
3802 }
3803}
3804
3805#[must_use = "FIDL methods require a response to be sent"]
3806#[derive(Debug)]
3807pub struct CapabilityStoreDictionaryLegacyImportResponder {
3808 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3809 tx_id: u32,
3810}
3811
3812impl std::ops::Drop for CapabilityStoreDictionaryLegacyImportResponder {
3816 fn drop(&mut self) {
3817 self.control_handle.shutdown();
3818 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3820 }
3821}
3822
3823impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyImportResponder {
3824 type ControlHandle = CapabilityStoreControlHandle;
3825
3826 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3827 &self.control_handle
3828 }
3829
3830 fn drop_without_shutdown(mut self) {
3831 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3833 std::mem::forget(self);
3835 }
3836}
3837
3838impl CapabilityStoreDictionaryLegacyImportResponder {
3839 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3843 let _result = self.send_raw(result);
3844 if _result.is_err() {
3845 self.control_handle.shutdown();
3846 }
3847 self.drop_without_shutdown();
3848 _result
3849 }
3850
3851 pub fn send_no_shutdown_on_err(
3853 self,
3854 mut result: Result<(), CapabilityStoreError>,
3855 ) -> Result<(), fidl::Error> {
3856 let _result = self.send_raw(result);
3857 self.drop_without_shutdown();
3858 _result
3859 }
3860
3861 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3862 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3863 fidl::encoding::EmptyStruct,
3864 CapabilityStoreError,
3865 >>(
3866 fidl::encoding::FlexibleResult::new(result),
3867 self.tx_id,
3868 0x72fd686c37b6025f,
3869 fidl::encoding::DynamicFlags::FLEXIBLE,
3870 )
3871 }
3872}
3873
3874#[must_use = "FIDL methods require a response to be sent"]
3875#[derive(Debug)]
3876pub struct CapabilityStoreDictionaryLegacyExportResponder {
3877 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3878 tx_id: u32,
3879}
3880
3881impl std::ops::Drop for CapabilityStoreDictionaryLegacyExportResponder {
3885 fn drop(&mut self) {
3886 self.control_handle.shutdown();
3887 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3889 }
3890}
3891
3892impl fidl::endpoints::Responder for CapabilityStoreDictionaryLegacyExportResponder {
3893 type ControlHandle = CapabilityStoreControlHandle;
3894
3895 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3896 &self.control_handle
3897 }
3898
3899 fn drop_without_shutdown(mut self) {
3900 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3902 std::mem::forget(self);
3904 }
3905}
3906
3907impl CapabilityStoreDictionaryLegacyExportResponder {
3908 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3912 let _result = self.send_raw(result);
3913 if _result.is_err() {
3914 self.control_handle.shutdown();
3915 }
3916 self.drop_without_shutdown();
3917 _result
3918 }
3919
3920 pub fn send_no_shutdown_on_err(
3922 self,
3923 mut result: Result<(), CapabilityStoreError>,
3924 ) -> Result<(), fidl::Error> {
3925 let _result = self.send_raw(result);
3926 self.drop_without_shutdown();
3927 _result
3928 }
3929
3930 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3931 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3932 fidl::encoding::EmptyStruct,
3933 CapabilityStoreError,
3934 >>(
3935 fidl::encoding::FlexibleResult::new(result),
3936 self.tx_id,
3937 0x407e15cc4bde5dcd,
3938 fidl::encoding::DynamicFlags::FLEXIBLE,
3939 )
3940 }
3941}
3942
3943#[must_use = "FIDL methods require a response to be sent"]
3944#[derive(Debug)]
3945pub struct CapabilityStoreDictionaryInsertResponder {
3946 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
3947 tx_id: u32,
3948}
3949
3950impl std::ops::Drop for CapabilityStoreDictionaryInsertResponder {
3954 fn drop(&mut self) {
3955 self.control_handle.shutdown();
3956 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3958 }
3959}
3960
3961impl fidl::endpoints::Responder for CapabilityStoreDictionaryInsertResponder {
3962 type ControlHandle = CapabilityStoreControlHandle;
3963
3964 fn control_handle(&self) -> &CapabilityStoreControlHandle {
3965 &self.control_handle
3966 }
3967
3968 fn drop_without_shutdown(mut self) {
3969 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3971 std::mem::forget(self);
3973 }
3974}
3975
3976impl CapabilityStoreDictionaryInsertResponder {
3977 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
3981 let _result = self.send_raw(result);
3982 if _result.is_err() {
3983 self.control_handle.shutdown();
3984 }
3985 self.drop_without_shutdown();
3986 _result
3987 }
3988
3989 pub fn send_no_shutdown_on_err(
3991 self,
3992 mut result: Result<(), CapabilityStoreError>,
3993 ) -> Result<(), fidl::Error> {
3994 let _result = self.send_raw(result);
3995 self.drop_without_shutdown();
3996 _result
3997 }
3998
3999 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4000 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4001 fidl::encoding::EmptyStruct,
4002 CapabilityStoreError,
4003 >>(
4004 fidl::encoding::FlexibleResult::new(result),
4005 self.tx_id,
4006 0x7702183689d44c27,
4007 fidl::encoding::DynamicFlags::FLEXIBLE,
4008 )
4009 }
4010}
4011
4012#[must_use = "FIDL methods require a response to be sent"]
4013#[derive(Debug)]
4014pub struct CapabilityStoreDictionaryGetResponder {
4015 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4016 tx_id: u32,
4017}
4018
4019impl std::ops::Drop for CapabilityStoreDictionaryGetResponder {
4023 fn drop(&mut self) {
4024 self.control_handle.shutdown();
4025 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4027 }
4028}
4029
4030impl fidl::endpoints::Responder for CapabilityStoreDictionaryGetResponder {
4031 type ControlHandle = CapabilityStoreControlHandle;
4032
4033 fn control_handle(&self) -> &CapabilityStoreControlHandle {
4034 &self.control_handle
4035 }
4036
4037 fn drop_without_shutdown(mut self) {
4038 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4040 std::mem::forget(self);
4042 }
4043}
4044
4045impl CapabilityStoreDictionaryGetResponder {
4046 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4050 let _result = self.send_raw(result);
4051 if _result.is_err() {
4052 self.control_handle.shutdown();
4053 }
4054 self.drop_without_shutdown();
4055 _result
4056 }
4057
4058 pub fn send_no_shutdown_on_err(
4060 self,
4061 mut result: Result<(), CapabilityStoreError>,
4062 ) -> Result<(), fidl::Error> {
4063 let _result = self.send_raw(result);
4064 self.drop_without_shutdown();
4065 _result
4066 }
4067
4068 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4069 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4070 fidl::encoding::EmptyStruct,
4071 CapabilityStoreError,
4072 >>(
4073 fidl::encoding::FlexibleResult::new(result),
4074 self.tx_id,
4075 0x4d9e27538284add2,
4076 fidl::encoding::DynamicFlags::FLEXIBLE,
4077 )
4078 }
4079}
4080
4081#[must_use = "FIDL methods require a response to be sent"]
4082#[derive(Debug)]
4083pub struct CapabilityStoreDictionaryRemoveResponder {
4084 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4085 tx_id: u32,
4086}
4087
4088impl std::ops::Drop for CapabilityStoreDictionaryRemoveResponder {
4092 fn drop(&mut self) {
4093 self.control_handle.shutdown();
4094 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4096 }
4097}
4098
4099impl fidl::endpoints::Responder for CapabilityStoreDictionaryRemoveResponder {
4100 type ControlHandle = CapabilityStoreControlHandle;
4101
4102 fn control_handle(&self) -> &CapabilityStoreControlHandle {
4103 &self.control_handle
4104 }
4105
4106 fn drop_without_shutdown(mut self) {
4107 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4109 std::mem::forget(self);
4111 }
4112}
4113
4114impl CapabilityStoreDictionaryRemoveResponder {
4115 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4119 let _result = self.send_raw(result);
4120 if _result.is_err() {
4121 self.control_handle.shutdown();
4122 }
4123 self.drop_without_shutdown();
4124 _result
4125 }
4126
4127 pub fn send_no_shutdown_on_err(
4129 self,
4130 mut result: Result<(), CapabilityStoreError>,
4131 ) -> Result<(), fidl::Error> {
4132 let _result = self.send_raw(result);
4133 self.drop_without_shutdown();
4134 _result
4135 }
4136
4137 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4138 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4139 fidl::encoding::EmptyStruct,
4140 CapabilityStoreError,
4141 >>(
4142 fidl::encoding::FlexibleResult::new(result),
4143 self.tx_id,
4144 0x4c5c025ab05d4f3,
4145 fidl::encoding::DynamicFlags::FLEXIBLE,
4146 )
4147 }
4148}
4149
4150#[must_use = "FIDL methods require a response to be sent"]
4151#[derive(Debug)]
4152pub struct CapabilityStoreDictionaryCopyResponder {
4153 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4154 tx_id: u32,
4155}
4156
4157impl std::ops::Drop for CapabilityStoreDictionaryCopyResponder {
4161 fn drop(&mut self) {
4162 self.control_handle.shutdown();
4163 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4165 }
4166}
4167
4168impl fidl::endpoints::Responder for CapabilityStoreDictionaryCopyResponder {
4169 type ControlHandle = CapabilityStoreControlHandle;
4170
4171 fn control_handle(&self) -> &CapabilityStoreControlHandle {
4172 &self.control_handle
4173 }
4174
4175 fn drop_without_shutdown(mut self) {
4176 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4178 std::mem::forget(self);
4180 }
4181}
4182
4183impl CapabilityStoreDictionaryCopyResponder {
4184 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4188 let _result = self.send_raw(result);
4189 if _result.is_err() {
4190 self.control_handle.shutdown();
4191 }
4192 self.drop_without_shutdown();
4193 _result
4194 }
4195
4196 pub fn send_no_shutdown_on_err(
4198 self,
4199 mut result: Result<(), CapabilityStoreError>,
4200 ) -> Result<(), fidl::Error> {
4201 let _result = self.send_raw(result);
4202 self.drop_without_shutdown();
4203 _result
4204 }
4205
4206 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4207 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4208 fidl::encoding::EmptyStruct,
4209 CapabilityStoreError,
4210 >>(
4211 fidl::encoding::FlexibleResult::new(result),
4212 self.tx_id,
4213 0x3733ecdf4ea1b44f,
4214 fidl::encoding::DynamicFlags::FLEXIBLE,
4215 )
4216 }
4217}
4218
4219#[must_use = "FIDL methods require a response to be sent"]
4220#[derive(Debug)]
4221pub struct CapabilityStoreDictionaryKeysResponder {
4222 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4223 tx_id: u32,
4224}
4225
4226impl std::ops::Drop for CapabilityStoreDictionaryKeysResponder {
4230 fn drop(&mut self) {
4231 self.control_handle.shutdown();
4232 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4234 }
4235}
4236
4237impl fidl::endpoints::Responder for CapabilityStoreDictionaryKeysResponder {
4238 type ControlHandle = CapabilityStoreControlHandle;
4239
4240 fn control_handle(&self) -> &CapabilityStoreControlHandle {
4241 &self.control_handle
4242 }
4243
4244 fn drop_without_shutdown(mut self) {
4245 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4247 std::mem::forget(self);
4249 }
4250}
4251
4252impl CapabilityStoreDictionaryKeysResponder {
4253 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4257 let _result = self.send_raw(result);
4258 if _result.is_err() {
4259 self.control_handle.shutdown();
4260 }
4261 self.drop_without_shutdown();
4262 _result
4263 }
4264
4265 pub fn send_no_shutdown_on_err(
4267 self,
4268 mut result: Result<(), CapabilityStoreError>,
4269 ) -> Result<(), fidl::Error> {
4270 let _result = self.send_raw(result);
4271 self.drop_without_shutdown();
4272 _result
4273 }
4274
4275 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4276 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4277 fidl::encoding::EmptyStruct,
4278 CapabilityStoreError,
4279 >>(
4280 fidl::encoding::FlexibleResult::new(result),
4281 self.tx_id,
4282 0x84b05577ceaec9e,
4283 fidl::encoding::DynamicFlags::FLEXIBLE,
4284 )
4285 }
4286}
4287
4288#[must_use = "FIDL methods require a response to be sent"]
4289#[derive(Debug)]
4290pub struct CapabilityStoreDictionaryEnumerateResponder {
4291 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4292 tx_id: u32,
4293}
4294
4295impl std::ops::Drop for CapabilityStoreDictionaryEnumerateResponder {
4299 fn drop(&mut self) {
4300 self.control_handle.shutdown();
4301 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4303 }
4304}
4305
4306impl fidl::endpoints::Responder for CapabilityStoreDictionaryEnumerateResponder {
4307 type ControlHandle = CapabilityStoreControlHandle;
4308
4309 fn control_handle(&self) -> &CapabilityStoreControlHandle {
4310 &self.control_handle
4311 }
4312
4313 fn drop_without_shutdown(mut self) {
4314 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4316 std::mem::forget(self);
4318 }
4319}
4320
4321impl CapabilityStoreDictionaryEnumerateResponder {
4322 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4326 let _result = self.send_raw(result);
4327 if _result.is_err() {
4328 self.control_handle.shutdown();
4329 }
4330 self.drop_without_shutdown();
4331 _result
4332 }
4333
4334 pub fn send_no_shutdown_on_err(
4336 self,
4337 mut result: Result<(), CapabilityStoreError>,
4338 ) -> Result<(), fidl::Error> {
4339 let _result = self.send_raw(result);
4340 self.drop_without_shutdown();
4341 _result
4342 }
4343
4344 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4345 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4346 fidl::encoding::EmptyStruct,
4347 CapabilityStoreError,
4348 >>(
4349 fidl::encoding::FlexibleResult::new(result),
4350 self.tx_id,
4351 0xd6279b6ced04641,
4352 fidl::encoding::DynamicFlags::FLEXIBLE,
4353 )
4354 }
4355}
4356
4357#[must_use = "FIDL methods require a response to be sent"]
4358#[derive(Debug)]
4359pub struct CapabilityStoreDictionaryDrainResponder {
4360 control_handle: std::mem::ManuallyDrop<CapabilityStoreControlHandle>,
4361 tx_id: u32,
4362}
4363
4364impl std::ops::Drop for CapabilityStoreDictionaryDrainResponder {
4368 fn drop(&mut self) {
4369 self.control_handle.shutdown();
4370 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4372 }
4373}
4374
4375impl fidl::endpoints::Responder for CapabilityStoreDictionaryDrainResponder {
4376 type ControlHandle = CapabilityStoreControlHandle;
4377
4378 fn control_handle(&self) -> &CapabilityStoreControlHandle {
4379 &self.control_handle
4380 }
4381
4382 fn drop_without_shutdown(mut self) {
4383 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4385 std::mem::forget(self);
4387 }
4388}
4389
4390impl CapabilityStoreDictionaryDrainResponder {
4391 pub fn send(self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4395 let _result = self.send_raw(result);
4396 if _result.is_err() {
4397 self.control_handle.shutdown();
4398 }
4399 self.drop_without_shutdown();
4400 _result
4401 }
4402
4403 pub fn send_no_shutdown_on_err(
4405 self,
4406 mut result: Result<(), CapabilityStoreError>,
4407 ) -> Result<(), fidl::Error> {
4408 let _result = self.send_raw(result);
4409 self.drop_without_shutdown();
4410 _result
4411 }
4412
4413 fn send_raw(&self, mut result: Result<(), CapabilityStoreError>) -> Result<(), fidl::Error> {
4414 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4415 fidl::encoding::EmptyStruct,
4416 CapabilityStoreError,
4417 >>(
4418 fidl::encoding::FlexibleResult::new(result),
4419 self.tx_id,
4420 0x28a3a3f84d928cd8,
4421 fidl::encoding::DynamicFlags::FLEXIBLE,
4422 )
4423 }
4424}
4425
4426#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4427pub struct ConnectorRouterMarker;
4428
4429impl fidl::endpoints::ProtocolMarker for ConnectorRouterMarker {
4430 type Proxy = ConnectorRouterProxy;
4431 type RequestStream = ConnectorRouterRequestStream;
4432 #[cfg(target_os = "fuchsia")]
4433 type SynchronousProxy = ConnectorRouterSynchronousProxy;
4434
4435 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.ConnectorRouter";
4436}
4437impl fidl::endpoints::DiscoverableProtocolMarker for ConnectorRouterMarker {}
4438pub type ConnectorRouterRouteResult = Result<ConnectorRouterRouteResponse, RouterError>;
4439
4440pub trait ConnectorRouterProxyInterface: Send + Sync {
4441 type RouteResponseFut: std::future::Future<Output = Result<ConnectorRouterRouteResult, fidl::Error>>
4442 + Send;
4443 fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4444}
4445#[derive(Debug)]
4446#[cfg(target_os = "fuchsia")]
4447pub struct ConnectorRouterSynchronousProxy {
4448 client: fidl::client::sync::Client,
4449}
4450
4451#[cfg(target_os = "fuchsia")]
4452impl fidl::endpoints::SynchronousProxy for ConnectorRouterSynchronousProxy {
4453 type Proxy = ConnectorRouterProxy;
4454 type Protocol = ConnectorRouterMarker;
4455
4456 fn from_channel(inner: fidl::Channel) -> Self {
4457 Self::new(inner)
4458 }
4459
4460 fn into_channel(self) -> fidl::Channel {
4461 self.client.into_channel()
4462 }
4463
4464 fn as_channel(&self) -> &fidl::Channel {
4465 self.client.as_channel()
4466 }
4467}
4468
4469#[cfg(target_os = "fuchsia")]
4470impl ConnectorRouterSynchronousProxy {
4471 pub fn new(channel: fidl::Channel) -> Self {
4472 let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4473 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4474 }
4475
4476 pub fn into_channel(self) -> fidl::Channel {
4477 self.client.into_channel()
4478 }
4479
4480 pub fn wait_for_event(
4483 &self,
4484 deadline: zx::MonotonicInstant,
4485 ) -> Result<ConnectorRouterEvent, fidl::Error> {
4486 ConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
4487 }
4488
4489 pub fn r#route(
4490 &self,
4491 mut payload: RouteRequest,
4492 ___deadline: zx::MonotonicInstant,
4493 ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4494 let _response = self.client.send_query::<
4495 RouteRequest,
4496 fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4497 >(
4498 &mut payload,
4499 0x74dbb8bc13730766,
4500 fidl::encoding::DynamicFlags::FLEXIBLE,
4501 ___deadline,
4502 )?
4503 .into_result::<ConnectorRouterMarker>("route")?;
4504 Ok(_response.map(|x| x))
4505 }
4506}
4507
4508#[cfg(target_os = "fuchsia")]
4509impl From<ConnectorRouterSynchronousProxy> for zx::NullableHandle {
4510 fn from(value: ConnectorRouterSynchronousProxy) -> Self {
4511 value.into_channel().into()
4512 }
4513}
4514
4515#[cfg(target_os = "fuchsia")]
4516impl From<fidl::Channel> for ConnectorRouterSynchronousProxy {
4517 fn from(value: fidl::Channel) -> Self {
4518 Self::new(value)
4519 }
4520}
4521
4522#[cfg(target_os = "fuchsia")]
4523impl fidl::endpoints::FromClient for ConnectorRouterSynchronousProxy {
4524 type Protocol = ConnectorRouterMarker;
4525
4526 fn from_client(value: fidl::endpoints::ClientEnd<ConnectorRouterMarker>) -> Self {
4527 Self::new(value.into_channel())
4528 }
4529}
4530
4531#[derive(Debug, Clone)]
4532pub struct ConnectorRouterProxy {
4533 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4534}
4535
4536impl fidl::endpoints::Proxy for ConnectorRouterProxy {
4537 type Protocol = ConnectorRouterMarker;
4538
4539 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4540 Self::new(inner)
4541 }
4542
4543 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4544 self.client.into_channel().map_err(|client| Self { client })
4545 }
4546
4547 fn as_channel(&self) -> &::fidl::AsyncChannel {
4548 self.client.as_channel()
4549 }
4550}
4551
4552impl ConnectorRouterProxy {
4553 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4555 let protocol_name = <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4556 Self { client: fidl::client::Client::new(channel, protocol_name) }
4557 }
4558
4559 pub fn take_event_stream(&self) -> ConnectorRouterEventStream {
4565 ConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
4566 }
4567
4568 pub fn r#route(
4569 &self,
4570 mut payload: RouteRequest,
4571 ) -> fidl::client::QueryResponseFut<
4572 ConnectorRouterRouteResult,
4573 fidl::encoding::DefaultFuchsiaResourceDialect,
4574 > {
4575 ConnectorRouterProxyInterface::r#route(self, payload)
4576 }
4577}
4578
4579impl ConnectorRouterProxyInterface for ConnectorRouterProxy {
4580 type RouteResponseFut = fidl::client::QueryResponseFut<
4581 ConnectorRouterRouteResult,
4582 fidl::encoding::DefaultFuchsiaResourceDialect,
4583 >;
4584 fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
4585 fn _decode(
4586 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4587 ) -> Result<ConnectorRouterRouteResult, fidl::Error> {
4588 let _response = fidl::client::decode_transaction_body::<
4589 fidl::encoding::FlexibleResultType<ConnectorRouterRouteResponse, RouterError>,
4590 fidl::encoding::DefaultFuchsiaResourceDialect,
4591 0x74dbb8bc13730766,
4592 >(_buf?)?
4593 .into_result::<ConnectorRouterMarker>("route")?;
4594 Ok(_response.map(|x| x))
4595 }
4596 self.client.send_query_and_decode::<RouteRequest, ConnectorRouterRouteResult>(
4597 &mut payload,
4598 0x74dbb8bc13730766,
4599 fidl::encoding::DynamicFlags::FLEXIBLE,
4600 _decode,
4601 )
4602 }
4603}
4604
4605pub struct ConnectorRouterEventStream {
4606 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4607}
4608
4609impl std::marker::Unpin for ConnectorRouterEventStream {}
4610
4611impl futures::stream::FusedStream for ConnectorRouterEventStream {
4612 fn is_terminated(&self) -> bool {
4613 self.event_receiver.is_terminated()
4614 }
4615}
4616
4617impl futures::Stream for ConnectorRouterEventStream {
4618 type Item = Result<ConnectorRouterEvent, fidl::Error>;
4619
4620 fn poll_next(
4621 mut self: std::pin::Pin<&mut Self>,
4622 cx: &mut std::task::Context<'_>,
4623 ) -> std::task::Poll<Option<Self::Item>> {
4624 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4625 &mut self.event_receiver,
4626 cx
4627 )?) {
4628 Some(buf) => std::task::Poll::Ready(Some(ConnectorRouterEvent::decode(buf))),
4629 None => std::task::Poll::Ready(None),
4630 }
4631 }
4632}
4633
4634#[derive(Debug)]
4635pub enum ConnectorRouterEvent {
4636 #[non_exhaustive]
4637 _UnknownEvent {
4638 ordinal: u64,
4640 },
4641}
4642
4643impl ConnectorRouterEvent {
4644 fn decode(
4646 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4647 ) -> Result<ConnectorRouterEvent, fidl::Error> {
4648 let (bytes, _handles) = buf.split_mut();
4649 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4650 debug_assert_eq!(tx_header.tx_id, 0);
4651 match tx_header.ordinal {
4652 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4653 Ok(ConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4654 }
4655 _ => Err(fidl::Error::UnknownOrdinal {
4656 ordinal: tx_header.ordinal,
4657 protocol_name:
4658 <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4659 }),
4660 }
4661 }
4662}
4663
4664pub struct ConnectorRouterRequestStream {
4666 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4667 is_terminated: bool,
4668}
4669
4670impl std::marker::Unpin for ConnectorRouterRequestStream {}
4671
4672impl futures::stream::FusedStream for ConnectorRouterRequestStream {
4673 fn is_terminated(&self) -> bool {
4674 self.is_terminated
4675 }
4676}
4677
4678impl fidl::endpoints::RequestStream for ConnectorRouterRequestStream {
4679 type Protocol = ConnectorRouterMarker;
4680 type ControlHandle = ConnectorRouterControlHandle;
4681
4682 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4683 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4684 }
4685
4686 fn control_handle(&self) -> Self::ControlHandle {
4687 ConnectorRouterControlHandle { inner: self.inner.clone() }
4688 }
4689
4690 fn into_inner(
4691 self,
4692 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4693 {
4694 (self.inner, self.is_terminated)
4695 }
4696
4697 fn from_inner(
4698 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4699 is_terminated: bool,
4700 ) -> Self {
4701 Self { inner, is_terminated }
4702 }
4703}
4704
4705impl futures::Stream for ConnectorRouterRequestStream {
4706 type Item = Result<ConnectorRouterRequest, fidl::Error>;
4707
4708 fn poll_next(
4709 mut self: std::pin::Pin<&mut Self>,
4710 cx: &mut std::task::Context<'_>,
4711 ) -> std::task::Poll<Option<Self::Item>> {
4712 let this = &mut *self;
4713 if this.inner.check_shutdown(cx) {
4714 this.is_terminated = true;
4715 return std::task::Poll::Ready(None);
4716 }
4717 if this.is_terminated {
4718 panic!("polled ConnectorRouterRequestStream after completion");
4719 }
4720 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4721 |bytes, handles| {
4722 match this.inner.channel().read_etc(cx, bytes, handles) {
4723 std::task::Poll::Ready(Ok(())) => {}
4724 std::task::Poll::Pending => return std::task::Poll::Pending,
4725 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4726 this.is_terminated = true;
4727 return std::task::Poll::Ready(None);
4728 }
4729 std::task::Poll::Ready(Err(e)) => {
4730 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4731 e.into(),
4732 ))));
4733 }
4734 }
4735
4736 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4738
4739 std::task::Poll::Ready(Some(match header.ordinal {
4740 0x74dbb8bc13730766 => {
4741 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4742 let mut req = fidl::new_empty!(
4743 RouteRequest,
4744 fidl::encoding::DefaultFuchsiaResourceDialect
4745 );
4746 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
4747 let control_handle =
4748 ConnectorRouterControlHandle { inner: this.inner.clone() };
4749 Ok(ConnectorRouterRequest::Route {
4750 payload: req,
4751 responder: ConnectorRouterRouteResponder {
4752 control_handle: std::mem::ManuallyDrop::new(control_handle),
4753 tx_id: header.tx_id,
4754 },
4755 })
4756 }
4757 _ if header.tx_id == 0
4758 && header
4759 .dynamic_flags()
4760 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4761 {
4762 Ok(ConnectorRouterRequest::_UnknownMethod {
4763 ordinal: header.ordinal,
4764 control_handle: ConnectorRouterControlHandle {
4765 inner: this.inner.clone(),
4766 },
4767 method_type: fidl::MethodType::OneWay,
4768 })
4769 }
4770 _ if header
4771 .dynamic_flags()
4772 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4773 {
4774 this.inner.send_framework_err(
4775 fidl::encoding::FrameworkErr::UnknownMethod,
4776 header.tx_id,
4777 header.ordinal,
4778 header.dynamic_flags(),
4779 (bytes, handles),
4780 )?;
4781 Ok(ConnectorRouterRequest::_UnknownMethod {
4782 ordinal: header.ordinal,
4783 control_handle: ConnectorRouterControlHandle {
4784 inner: this.inner.clone(),
4785 },
4786 method_type: fidl::MethodType::TwoWay,
4787 })
4788 }
4789 _ => Err(fidl::Error::UnknownOrdinal {
4790 ordinal: header.ordinal,
4791 protocol_name:
4792 <ConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4793 }),
4794 }))
4795 },
4796 )
4797 }
4798}
4799
4800#[derive(Debug)]
4801pub enum ConnectorRouterRequest {
4802 Route {
4803 payload: RouteRequest,
4804 responder: ConnectorRouterRouteResponder,
4805 },
4806 #[non_exhaustive]
4808 _UnknownMethod {
4809 ordinal: u64,
4811 control_handle: ConnectorRouterControlHandle,
4812 method_type: fidl::MethodType,
4813 },
4814}
4815
4816impl ConnectorRouterRequest {
4817 #[allow(irrefutable_let_patterns)]
4818 pub fn into_route(self) -> Option<(RouteRequest, ConnectorRouterRouteResponder)> {
4819 if let ConnectorRouterRequest::Route { payload, responder } = self {
4820 Some((payload, responder))
4821 } else {
4822 None
4823 }
4824 }
4825
4826 pub fn method_name(&self) -> &'static str {
4828 match *self {
4829 ConnectorRouterRequest::Route { .. } => "route",
4830 ConnectorRouterRequest::_UnknownMethod {
4831 method_type: fidl::MethodType::OneWay,
4832 ..
4833 } => "unknown one-way method",
4834 ConnectorRouterRequest::_UnknownMethod {
4835 method_type: fidl::MethodType::TwoWay,
4836 ..
4837 } => "unknown two-way method",
4838 }
4839 }
4840}
4841
4842#[derive(Debug, Clone)]
4843pub struct ConnectorRouterControlHandle {
4844 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4845}
4846
4847impl fidl::endpoints::ControlHandle for ConnectorRouterControlHandle {
4848 fn shutdown(&self) {
4849 self.inner.shutdown()
4850 }
4851
4852 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4853 self.inner.shutdown_with_epitaph(status)
4854 }
4855
4856 fn is_closed(&self) -> bool {
4857 self.inner.channel().is_closed()
4858 }
4859 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4860 self.inner.channel().on_closed()
4861 }
4862
4863 #[cfg(target_os = "fuchsia")]
4864 fn signal_peer(
4865 &self,
4866 clear_mask: zx::Signals,
4867 set_mask: zx::Signals,
4868 ) -> Result<(), zx_status::Status> {
4869 use fidl::Peered;
4870 self.inner.channel().signal_peer(clear_mask, set_mask)
4871 }
4872}
4873
4874impl ConnectorRouterControlHandle {}
4875
4876#[must_use = "FIDL methods require a response to be sent"]
4877#[derive(Debug)]
4878pub struct ConnectorRouterRouteResponder {
4879 control_handle: std::mem::ManuallyDrop<ConnectorRouterControlHandle>,
4880 tx_id: u32,
4881}
4882
4883impl std::ops::Drop for ConnectorRouterRouteResponder {
4887 fn drop(&mut self) {
4888 self.control_handle.shutdown();
4889 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4891 }
4892}
4893
4894impl fidl::endpoints::Responder for ConnectorRouterRouteResponder {
4895 type ControlHandle = ConnectorRouterControlHandle;
4896
4897 fn control_handle(&self) -> &ConnectorRouterControlHandle {
4898 &self.control_handle
4899 }
4900
4901 fn drop_without_shutdown(mut self) {
4902 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4904 std::mem::forget(self);
4906 }
4907}
4908
4909impl ConnectorRouterRouteResponder {
4910 pub fn send(
4914 self,
4915 mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4916 ) -> Result<(), fidl::Error> {
4917 let _result = self.send_raw(result);
4918 if _result.is_err() {
4919 self.control_handle.shutdown();
4920 }
4921 self.drop_without_shutdown();
4922 _result
4923 }
4924
4925 pub fn send_no_shutdown_on_err(
4927 self,
4928 mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4929 ) -> Result<(), fidl::Error> {
4930 let _result = self.send_raw(result);
4931 self.drop_without_shutdown();
4932 _result
4933 }
4934
4935 fn send_raw(
4936 &self,
4937 mut result: Result<ConnectorRouterRouteResponse, RouterError>,
4938 ) -> Result<(), fidl::Error> {
4939 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4940 ConnectorRouterRouteResponse,
4941 RouterError,
4942 >>(
4943 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
4944 self.tx_id,
4945 0x74dbb8bc13730766,
4946 fidl::encoding::DynamicFlags::FLEXIBLE,
4947 )
4948 }
4949}
4950
4951#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4952pub struct DataRouterMarker;
4953
4954impl fidl::endpoints::ProtocolMarker for DataRouterMarker {
4955 type Proxy = DataRouterProxy;
4956 type RequestStream = DataRouterRequestStream;
4957 #[cfg(target_os = "fuchsia")]
4958 type SynchronousProxy = DataRouterSynchronousProxy;
4959
4960 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DataRouter";
4961}
4962impl fidl::endpoints::DiscoverableProtocolMarker for DataRouterMarker {}
4963pub type DataRouterRouteResult = Result<DataRouterRouteResponse, RouterError>;
4964
4965pub trait DataRouterProxyInterface: Send + Sync {
4966 type RouteResponseFut: std::future::Future<Output = Result<DataRouterRouteResult, fidl::Error>>
4967 + Send;
4968 fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
4969}
4970#[derive(Debug)]
4971#[cfg(target_os = "fuchsia")]
4972pub struct DataRouterSynchronousProxy {
4973 client: fidl::client::sync::Client,
4974}
4975
4976#[cfg(target_os = "fuchsia")]
4977impl fidl::endpoints::SynchronousProxy for DataRouterSynchronousProxy {
4978 type Proxy = DataRouterProxy;
4979 type Protocol = DataRouterMarker;
4980
4981 fn from_channel(inner: fidl::Channel) -> Self {
4982 Self::new(inner)
4983 }
4984
4985 fn into_channel(self) -> fidl::Channel {
4986 self.client.into_channel()
4987 }
4988
4989 fn as_channel(&self) -> &fidl::Channel {
4990 self.client.as_channel()
4991 }
4992}
4993
4994#[cfg(target_os = "fuchsia")]
4995impl DataRouterSynchronousProxy {
4996 pub fn new(channel: fidl::Channel) -> Self {
4997 let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4998 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4999 }
5000
5001 pub fn into_channel(self) -> fidl::Channel {
5002 self.client.into_channel()
5003 }
5004
5005 pub fn wait_for_event(
5008 &self,
5009 deadline: zx::MonotonicInstant,
5010 ) -> Result<DataRouterEvent, fidl::Error> {
5011 DataRouterEvent::decode(self.client.wait_for_event(deadline)?)
5012 }
5013
5014 pub fn r#route(
5015 &self,
5016 mut payload: RouteRequest,
5017 ___deadline: zx::MonotonicInstant,
5018 ) -> Result<DataRouterRouteResult, fidl::Error> {
5019 let _response = self.client.send_query::<
5020 RouteRequest,
5021 fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5022 >(
5023 &mut payload,
5024 0x2e87dc44dfc53804,
5025 fidl::encoding::DynamicFlags::FLEXIBLE,
5026 ___deadline,
5027 )?
5028 .into_result::<DataRouterMarker>("route")?;
5029 Ok(_response.map(|x| x))
5030 }
5031}
5032
5033#[cfg(target_os = "fuchsia")]
5034impl From<DataRouterSynchronousProxy> for zx::NullableHandle {
5035 fn from(value: DataRouterSynchronousProxy) -> Self {
5036 value.into_channel().into()
5037 }
5038}
5039
5040#[cfg(target_os = "fuchsia")]
5041impl From<fidl::Channel> for DataRouterSynchronousProxy {
5042 fn from(value: fidl::Channel) -> Self {
5043 Self::new(value)
5044 }
5045}
5046
5047#[cfg(target_os = "fuchsia")]
5048impl fidl::endpoints::FromClient for DataRouterSynchronousProxy {
5049 type Protocol = DataRouterMarker;
5050
5051 fn from_client(value: fidl::endpoints::ClientEnd<DataRouterMarker>) -> Self {
5052 Self::new(value.into_channel())
5053 }
5054}
5055
5056#[derive(Debug, Clone)]
5057pub struct DataRouterProxy {
5058 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5059}
5060
5061impl fidl::endpoints::Proxy for DataRouterProxy {
5062 type Protocol = DataRouterMarker;
5063
5064 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5065 Self::new(inner)
5066 }
5067
5068 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5069 self.client.into_channel().map_err(|client| Self { client })
5070 }
5071
5072 fn as_channel(&self) -> &::fidl::AsyncChannel {
5073 self.client.as_channel()
5074 }
5075}
5076
5077impl DataRouterProxy {
5078 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5080 let protocol_name = <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5081 Self { client: fidl::client::Client::new(channel, protocol_name) }
5082 }
5083
5084 pub fn take_event_stream(&self) -> DataRouterEventStream {
5090 DataRouterEventStream { event_receiver: self.client.take_event_receiver() }
5091 }
5092
5093 pub fn r#route(
5094 &self,
5095 mut payload: RouteRequest,
5096 ) -> fidl::client::QueryResponseFut<
5097 DataRouterRouteResult,
5098 fidl::encoding::DefaultFuchsiaResourceDialect,
5099 > {
5100 DataRouterProxyInterface::r#route(self, payload)
5101 }
5102}
5103
5104impl DataRouterProxyInterface for DataRouterProxy {
5105 type RouteResponseFut = fidl::client::QueryResponseFut<
5106 DataRouterRouteResult,
5107 fidl::encoding::DefaultFuchsiaResourceDialect,
5108 >;
5109 fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
5110 fn _decode(
5111 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5112 ) -> Result<DataRouterRouteResult, fidl::Error> {
5113 let _response = fidl::client::decode_transaction_body::<
5114 fidl::encoding::FlexibleResultType<DataRouterRouteResponse, RouterError>,
5115 fidl::encoding::DefaultFuchsiaResourceDialect,
5116 0x2e87dc44dfc53804,
5117 >(_buf?)?
5118 .into_result::<DataRouterMarker>("route")?;
5119 Ok(_response.map(|x| x))
5120 }
5121 self.client.send_query_and_decode::<RouteRequest, DataRouterRouteResult>(
5122 &mut payload,
5123 0x2e87dc44dfc53804,
5124 fidl::encoding::DynamicFlags::FLEXIBLE,
5125 _decode,
5126 )
5127 }
5128}
5129
5130pub struct DataRouterEventStream {
5131 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5132}
5133
5134impl std::marker::Unpin for DataRouterEventStream {}
5135
5136impl futures::stream::FusedStream for DataRouterEventStream {
5137 fn is_terminated(&self) -> bool {
5138 self.event_receiver.is_terminated()
5139 }
5140}
5141
5142impl futures::Stream for DataRouterEventStream {
5143 type Item = Result<DataRouterEvent, fidl::Error>;
5144
5145 fn poll_next(
5146 mut self: std::pin::Pin<&mut Self>,
5147 cx: &mut std::task::Context<'_>,
5148 ) -> std::task::Poll<Option<Self::Item>> {
5149 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5150 &mut self.event_receiver,
5151 cx
5152 )?) {
5153 Some(buf) => std::task::Poll::Ready(Some(DataRouterEvent::decode(buf))),
5154 None => std::task::Poll::Ready(None),
5155 }
5156 }
5157}
5158
5159#[derive(Debug)]
5160pub enum DataRouterEvent {
5161 #[non_exhaustive]
5162 _UnknownEvent {
5163 ordinal: u64,
5165 },
5166}
5167
5168impl DataRouterEvent {
5169 fn decode(
5171 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5172 ) -> Result<DataRouterEvent, fidl::Error> {
5173 let (bytes, _handles) = buf.split_mut();
5174 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5175 debug_assert_eq!(tx_header.tx_id, 0);
5176 match tx_header.ordinal {
5177 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5178 Ok(DataRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5179 }
5180 _ => Err(fidl::Error::UnknownOrdinal {
5181 ordinal: tx_header.ordinal,
5182 protocol_name: <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5183 }),
5184 }
5185 }
5186}
5187
5188pub struct DataRouterRequestStream {
5190 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5191 is_terminated: bool,
5192}
5193
5194impl std::marker::Unpin for DataRouterRequestStream {}
5195
5196impl futures::stream::FusedStream for DataRouterRequestStream {
5197 fn is_terminated(&self) -> bool {
5198 self.is_terminated
5199 }
5200}
5201
5202impl fidl::endpoints::RequestStream for DataRouterRequestStream {
5203 type Protocol = DataRouterMarker;
5204 type ControlHandle = DataRouterControlHandle;
5205
5206 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5207 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5208 }
5209
5210 fn control_handle(&self) -> Self::ControlHandle {
5211 DataRouterControlHandle { inner: self.inner.clone() }
5212 }
5213
5214 fn into_inner(
5215 self,
5216 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5217 {
5218 (self.inner, self.is_terminated)
5219 }
5220
5221 fn from_inner(
5222 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5223 is_terminated: bool,
5224 ) -> Self {
5225 Self { inner, is_terminated }
5226 }
5227}
5228
5229impl futures::Stream for DataRouterRequestStream {
5230 type Item = Result<DataRouterRequest, fidl::Error>;
5231
5232 fn poll_next(
5233 mut self: std::pin::Pin<&mut Self>,
5234 cx: &mut std::task::Context<'_>,
5235 ) -> std::task::Poll<Option<Self::Item>> {
5236 let this = &mut *self;
5237 if this.inner.check_shutdown(cx) {
5238 this.is_terminated = true;
5239 return std::task::Poll::Ready(None);
5240 }
5241 if this.is_terminated {
5242 panic!("polled DataRouterRequestStream after completion");
5243 }
5244 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5245 |bytes, handles| {
5246 match this.inner.channel().read_etc(cx, bytes, handles) {
5247 std::task::Poll::Ready(Ok(())) => {}
5248 std::task::Poll::Pending => return std::task::Poll::Pending,
5249 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5250 this.is_terminated = true;
5251 return std::task::Poll::Ready(None);
5252 }
5253 std::task::Poll::Ready(Err(e)) => {
5254 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5255 e.into(),
5256 ))));
5257 }
5258 }
5259
5260 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5262
5263 std::task::Poll::Ready(Some(match header.ordinal {
5264 0x2e87dc44dfc53804 => {
5265 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5266 let mut req = fidl::new_empty!(
5267 RouteRequest,
5268 fidl::encoding::DefaultFuchsiaResourceDialect
5269 );
5270 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
5271 let control_handle = DataRouterControlHandle { inner: this.inner.clone() };
5272 Ok(DataRouterRequest::Route {
5273 payload: req,
5274 responder: DataRouterRouteResponder {
5275 control_handle: std::mem::ManuallyDrop::new(control_handle),
5276 tx_id: header.tx_id,
5277 },
5278 })
5279 }
5280 _ if header.tx_id == 0
5281 && header
5282 .dynamic_flags()
5283 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5284 {
5285 Ok(DataRouterRequest::_UnknownMethod {
5286 ordinal: header.ordinal,
5287 control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5288 method_type: fidl::MethodType::OneWay,
5289 })
5290 }
5291 _ if header
5292 .dynamic_flags()
5293 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5294 {
5295 this.inner.send_framework_err(
5296 fidl::encoding::FrameworkErr::UnknownMethod,
5297 header.tx_id,
5298 header.ordinal,
5299 header.dynamic_flags(),
5300 (bytes, handles),
5301 )?;
5302 Ok(DataRouterRequest::_UnknownMethod {
5303 ordinal: header.ordinal,
5304 control_handle: DataRouterControlHandle { inner: this.inner.clone() },
5305 method_type: fidl::MethodType::TwoWay,
5306 })
5307 }
5308 _ => Err(fidl::Error::UnknownOrdinal {
5309 ordinal: header.ordinal,
5310 protocol_name:
5311 <DataRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5312 }),
5313 }))
5314 },
5315 )
5316 }
5317}
5318
5319#[derive(Debug)]
5320pub enum DataRouterRequest {
5321 Route {
5322 payload: RouteRequest,
5323 responder: DataRouterRouteResponder,
5324 },
5325 #[non_exhaustive]
5327 _UnknownMethod {
5328 ordinal: u64,
5330 control_handle: DataRouterControlHandle,
5331 method_type: fidl::MethodType,
5332 },
5333}
5334
5335impl DataRouterRequest {
5336 #[allow(irrefutable_let_patterns)]
5337 pub fn into_route(self) -> Option<(RouteRequest, DataRouterRouteResponder)> {
5338 if let DataRouterRequest::Route { payload, responder } = self {
5339 Some((payload, responder))
5340 } else {
5341 None
5342 }
5343 }
5344
5345 pub fn method_name(&self) -> &'static str {
5347 match *self {
5348 DataRouterRequest::Route { .. } => "route",
5349 DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5350 "unknown one-way method"
5351 }
5352 DataRouterRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5353 "unknown two-way method"
5354 }
5355 }
5356 }
5357}
5358
5359#[derive(Debug, Clone)]
5360pub struct DataRouterControlHandle {
5361 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5362}
5363
5364impl fidl::endpoints::ControlHandle for DataRouterControlHandle {
5365 fn shutdown(&self) {
5366 self.inner.shutdown()
5367 }
5368
5369 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5370 self.inner.shutdown_with_epitaph(status)
5371 }
5372
5373 fn is_closed(&self) -> bool {
5374 self.inner.channel().is_closed()
5375 }
5376 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5377 self.inner.channel().on_closed()
5378 }
5379
5380 #[cfg(target_os = "fuchsia")]
5381 fn signal_peer(
5382 &self,
5383 clear_mask: zx::Signals,
5384 set_mask: zx::Signals,
5385 ) -> Result<(), zx_status::Status> {
5386 use fidl::Peered;
5387 self.inner.channel().signal_peer(clear_mask, set_mask)
5388 }
5389}
5390
5391impl DataRouterControlHandle {}
5392
5393#[must_use = "FIDL methods require a response to be sent"]
5394#[derive(Debug)]
5395pub struct DataRouterRouteResponder {
5396 control_handle: std::mem::ManuallyDrop<DataRouterControlHandle>,
5397 tx_id: u32,
5398}
5399
5400impl std::ops::Drop for DataRouterRouteResponder {
5404 fn drop(&mut self) {
5405 self.control_handle.shutdown();
5406 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5408 }
5409}
5410
5411impl fidl::endpoints::Responder for DataRouterRouteResponder {
5412 type ControlHandle = DataRouterControlHandle;
5413
5414 fn control_handle(&self) -> &DataRouterControlHandle {
5415 &self.control_handle
5416 }
5417
5418 fn drop_without_shutdown(mut self) {
5419 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5421 std::mem::forget(self);
5423 }
5424}
5425
5426impl DataRouterRouteResponder {
5427 pub fn send(
5431 self,
5432 mut result: Result<DataRouterRouteResponse, RouterError>,
5433 ) -> Result<(), fidl::Error> {
5434 let _result = self.send_raw(result);
5435 if _result.is_err() {
5436 self.control_handle.shutdown();
5437 }
5438 self.drop_without_shutdown();
5439 _result
5440 }
5441
5442 pub fn send_no_shutdown_on_err(
5444 self,
5445 mut result: Result<DataRouterRouteResponse, RouterError>,
5446 ) -> Result<(), fidl::Error> {
5447 let _result = self.send_raw(result);
5448 self.drop_without_shutdown();
5449 _result
5450 }
5451
5452 fn send_raw(
5453 &self,
5454 mut result: Result<DataRouterRouteResponse, RouterError>,
5455 ) -> Result<(), fidl::Error> {
5456 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
5457 DataRouterRouteResponse,
5458 RouterError,
5459 >>(
5460 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
5461 self.tx_id,
5462 0x2e87dc44dfc53804,
5463 fidl::encoding::DynamicFlags::FLEXIBLE,
5464 )
5465 }
5466}
5467
5468#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5469pub struct DictionaryMarker;
5470
5471impl fidl::endpoints::ProtocolMarker for DictionaryMarker {
5472 type Proxy = DictionaryProxy;
5473 type RequestStream = DictionaryRequestStream;
5474 #[cfg(target_os = "fuchsia")]
5475 type SynchronousProxy = DictionarySynchronousProxy;
5476
5477 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Dictionary";
5478}
5479impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryMarker {}
5480
5481pub trait DictionaryProxyInterface: Send + Sync {}
5482#[derive(Debug)]
5483#[cfg(target_os = "fuchsia")]
5484pub struct DictionarySynchronousProxy {
5485 client: fidl::client::sync::Client,
5486}
5487
5488#[cfg(target_os = "fuchsia")]
5489impl fidl::endpoints::SynchronousProxy for DictionarySynchronousProxy {
5490 type Proxy = DictionaryProxy;
5491 type Protocol = DictionaryMarker;
5492
5493 fn from_channel(inner: fidl::Channel) -> Self {
5494 Self::new(inner)
5495 }
5496
5497 fn into_channel(self) -> fidl::Channel {
5498 self.client.into_channel()
5499 }
5500
5501 fn as_channel(&self) -> &fidl::Channel {
5502 self.client.as_channel()
5503 }
5504}
5505
5506#[cfg(target_os = "fuchsia")]
5507impl DictionarySynchronousProxy {
5508 pub fn new(channel: fidl::Channel) -> Self {
5509 let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5510 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5511 }
5512
5513 pub fn into_channel(self) -> fidl::Channel {
5514 self.client.into_channel()
5515 }
5516
5517 pub fn wait_for_event(
5520 &self,
5521 deadline: zx::MonotonicInstant,
5522 ) -> Result<DictionaryEvent, fidl::Error> {
5523 DictionaryEvent::decode(self.client.wait_for_event(deadline)?)
5524 }
5525}
5526
5527#[cfg(target_os = "fuchsia")]
5528impl From<DictionarySynchronousProxy> for zx::NullableHandle {
5529 fn from(value: DictionarySynchronousProxy) -> Self {
5530 value.into_channel().into()
5531 }
5532}
5533
5534#[cfg(target_os = "fuchsia")]
5535impl From<fidl::Channel> for DictionarySynchronousProxy {
5536 fn from(value: fidl::Channel) -> Self {
5537 Self::new(value)
5538 }
5539}
5540
5541#[cfg(target_os = "fuchsia")]
5542impl fidl::endpoints::FromClient for DictionarySynchronousProxy {
5543 type Protocol = DictionaryMarker;
5544
5545 fn from_client(value: fidl::endpoints::ClientEnd<DictionaryMarker>) -> Self {
5546 Self::new(value.into_channel())
5547 }
5548}
5549
5550#[derive(Debug, Clone)]
5551pub struct DictionaryProxy {
5552 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5553}
5554
5555impl fidl::endpoints::Proxy for DictionaryProxy {
5556 type Protocol = DictionaryMarker;
5557
5558 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5559 Self::new(inner)
5560 }
5561
5562 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5563 self.client.into_channel().map_err(|client| Self { client })
5564 }
5565
5566 fn as_channel(&self) -> &::fidl::AsyncChannel {
5567 self.client.as_channel()
5568 }
5569}
5570
5571impl DictionaryProxy {
5572 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5574 let protocol_name = <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5575 Self { client: fidl::client::Client::new(channel, protocol_name) }
5576 }
5577
5578 pub fn take_event_stream(&self) -> DictionaryEventStream {
5584 DictionaryEventStream { event_receiver: self.client.take_event_receiver() }
5585 }
5586}
5587
5588impl DictionaryProxyInterface for DictionaryProxy {}
5589
5590pub struct DictionaryEventStream {
5591 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5592}
5593
5594impl std::marker::Unpin for DictionaryEventStream {}
5595
5596impl futures::stream::FusedStream for DictionaryEventStream {
5597 fn is_terminated(&self) -> bool {
5598 self.event_receiver.is_terminated()
5599 }
5600}
5601
5602impl futures::Stream for DictionaryEventStream {
5603 type Item = Result<DictionaryEvent, fidl::Error>;
5604
5605 fn poll_next(
5606 mut self: std::pin::Pin<&mut Self>,
5607 cx: &mut std::task::Context<'_>,
5608 ) -> std::task::Poll<Option<Self::Item>> {
5609 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5610 &mut self.event_receiver,
5611 cx
5612 )?) {
5613 Some(buf) => std::task::Poll::Ready(Some(DictionaryEvent::decode(buf))),
5614 None => std::task::Poll::Ready(None),
5615 }
5616 }
5617}
5618
5619#[derive(Debug)]
5620pub enum DictionaryEvent {
5621 #[non_exhaustive]
5622 _UnknownEvent {
5623 ordinal: u64,
5625 },
5626}
5627
5628impl DictionaryEvent {
5629 fn decode(
5631 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5632 ) -> Result<DictionaryEvent, fidl::Error> {
5633 let (bytes, _handles) = buf.split_mut();
5634 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5635 debug_assert_eq!(tx_header.tx_id, 0);
5636 match tx_header.ordinal {
5637 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
5638 Ok(DictionaryEvent::_UnknownEvent { ordinal: tx_header.ordinal })
5639 }
5640 _ => Err(fidl::Error::UnknownOrdinal {
5641 ordinal: tx_header.ordinal,
5642 protocol_name: <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5643 }),
5644 }
5645 }
5646}
5647
5648pub struct DictionaryRequestStream {
5650 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5651 is_terminated: bool,
5652}
5653
5654impl std::marker::Unpin for DictionaryRequestStream {}
5655
5656impl futures::stream::FusedStream for DictionaryRequestStream {
5657 fn is_terminated(&self) -> bool {
5658 self.is_terminated
5659 }
5660}
5661
5662impl fidl::endpoints::RequestStream for DictionaryRequestStream {
5663 type Protocol = DictionaryMarker;
5664 type ControlHandle = DictionaryControlHandle;
5665
5666 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5667 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5668 }
5669
5670 fn control_handle(&self) -> Self::ControlHandle {
5671 DictionaryControlHandle { inner: self.inner.clone() }
5672 }
5673
5674 fn into_inner(
5675 self,
5676 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5677 {
5678 (self.inner, self.is_terminated)
5679 }
5680
5681 fn from_inner(
5682 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5683 is_terminated: bool,
5684 ) -> Self {
5685 Self { inner, is_terminated }
5686 }
5687}
5688
5689impl futures::Stream for DictionaryRequestStream {
5690 type Item = Result<DictionaryRequest, fidl::Error>;
5691
5692 fn poll_next(
5693 mut self: std::pin::Pin<&mut Self>,
5694 cx: &mut std::task::Context<'_>,
5695 ) -> std::task::Poll<Option<Self::Item>> {
5696 let this = &mut *self;
5697 if this.inner.check_shutdown(cx) {
5698 this.is_terminated = true;
5699 return std::task::Poll::Ready(None);
5700 }
5701 if this.is_terminated {
5702 panic!("polled DictionaryRequestStream after completion");
5703 }
5704 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5705 |bytes, handles| {
5706 match this.inner.channel().read_etc(cx, bytes, handles) {
5707 std::task::Poll::Ready(Ok(())) => {}
5708 std::task::Poll::Pending => return std::task::Poll::Pending,
5709 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5710 this.is_terminated = true;
5711 return std::task::Poll::Ready(None);
5712 }
5713 std::task::Poll::Ready(Err(e)) => {
5714 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5715 e.into(),
5716 ))));
5717 }
5718 }
5719
5720 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5722
5723 std::task::Poll::Ready(Some(match header.ordinal {
5724 _ if header.tx_id == 0
5725 && header
5726 .dynamic_flags()
5727 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5728 {
5729 Ok(DictionaryRequest::_UnknownMethod {
5730 ordinal: header.ordinal,
5731 control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5732 method_type: fidl::MethodType::OneWay,
5733 })
5734 }
5735 _ if header
5736 .dynamic_flags()
5737 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5738 {
5739 this.inner.send_framework_err(
5740 fidl::encoding::FrameworkErr::UnknownMethod,
5741 header.tx_id,
5742 header.ordinal,
5743 header.dynamic_flags(),
5744 (bytes, handles),
5745 )?;
5746 Ok(DictionaryRequest::_UnknownMethod {
5747 ordinal: header.ordinal,
5748 control_handle: DictionaryControlHandle { inner: this.inner.clone() },
5749 method_type: fidl::MethodType::TwoWay,
5750 })
5751 }
5752 _ => Err(fidl::Error::UnknownOrdinal {
5753 ordinal: header.ordinal,
5754 protocol_name:
5755 <DictionaryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5756 }),
5757 }))
5758 },
5759 )
5760 }
5761}
5762
5763#[derive(Debug)]
5764pub enum DictionaryRequest {
5765 #[non_exhaustive]
5767 _UnknownMethod {
5768 ordinal: u64,
5770 control_handle: DictionaryControlHandle,
5771 method_type: fidl::MethodType,
5772 },
5773}
5774
5775impl DictionaryRequest {
5776 pub fn method_name(&self) -> &'static str {
5778 match *self {
5779 DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
5780 "unknown one-way method"
5781 }
5782 DictionaryRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
5783 "unknown two-way method"
5784 }
5785 }
5786 }
5787}
5788
5789#[derive(Debug, Clone)]
5790pub struct DictionaryControlHandle {
5791 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5792}
5793
5794impl fidl::endpoints::ControlHandle for DictionaryControlHandle {
5795 fn shutdown(&self) {
5796 self.inner.shutdown()
5797 }
5798
5799 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5800 self.inner.shutdown_with_epitaph(status)
5801 }
5802
5803 fn is_closed(&self) -> bool {
5804 self.inner.channel().is_closed()
5805 }
5806 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5807 self.inner.channel().on_closed()
5808 }
5809
5810 #[cfg(target_os = "fuchsia")]
5811 fn signal_peer(
5812 &self,
5813 clear_mask: zx::Signals,
5814 set_mask: zx::Signals,
5815 ) -> Result<(), zx_status::Status> {
5816 use fidl::Peered;
5817 self.inner.channel().signal_peer(clear_mask, set_mask)
5818 }
5819}
5820
5821impl DictionaryControlHandle {}
5822
5823#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5824pub struct DictionaryDrainIteratorMarker;
5825
5826impl fidl::endpoints::ProtocolMarker for DictionaryDrainIteratorMarker {
5827 type Proxy = DictionaryDrainIteratorProxy;
5828 type RequestStream = DictionaryDrainIteratorRequestStream;
5829 #[cfg(target_os = "fuchsia")]
5830 type SynchronousProxy = DictionaryDrainIteratorSynchronousProxy;
5831
5832 const DEBUG_NAME: &'static str = "(anonymous) DictionaryDrainIterator";
5833}
5834pub type DictionaryDrainIteratorGetNextResult =
5835 Result<(Vec<DictionaryItem>, u64), CapabilityStoreError>;
5836
5837pub trait DictionaryDrainIteratorProxyInterface: Send + Sync {
5838 type GetNextResponseFut: std::future::Future<Output = Result<DictionaryDrainIteratorGetNextResult, fidl::Error>>
5839 + Send;
5840 fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
5841}
5842#[derive(Debug)]
5843#[cfg(target_os = "fuchsia")]
5844pub struct DictionaryDrainIteratorSynchronousProxy {
5845 client: fidl::client::sync::Client,
5846}
5847
5848#[cfg(target_os = "fuchsia")]
5849impl fidl::endpoints::SynchronousProxy for DictionaryDrainIteratorSynchronousProxy {
5850 type Proxy = DictionaryDrainIteratorProxy;
5851 type Protocol = DictionaryDrainIteratorMarker;
5852
5853 fn from_channel(inner: fidl::Channel) -> Self {
5854 Self::new(inner)
5855 }
5856
5857 fn into_channel(self) -> fidl::Channel {
5858 self.client.into_channel()
5859 }
5860
5861 fn as_channel(&self) -> &fidl::Channel {
5862 self.client.as_channel()
5863 }
5864}
5865
5866#[cfg(target_os = "fuchsia")]
5867impl DictionaryDrainIteratorSynchronousProxy {
5868 pub fn new(channel: fidl::Channel) -> Self {
5869 let protocol_name =
5870 <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5871 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5872 }
5873
5874 pub fn into_channel(self) -> fidl::Channel {
5875 self.client.into_channel()
5876 }
5877
5878 pub fn wait_for_event(
5881 &self,
5882 deadline: zx::MonotonicInstant,
5883 ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
5884 DictionaryDrainIteratorEvent::decode(self.client.wait_for_event(deadline)?)
5885 }
5886
5887 pub fn r#get_next(
5904 &self,
5905 mut start_id: u64,
5906 mut limit: u32,
5907 ___deadline: zx::MonotonicInstant,
5908 ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
5909 let _response = self
5910 .client
5911 .send_query::<DictionaryDrainIteratorGetNextRequest, fidl::encoding::FlexibleResultType<
5912 DictionaryDrainIteratorGetNextResponse,
5913 CapabilityStoreError,
5914 >>(
5915 (start_id, limit),
5916 0x4f8082ca1ee26061,
5917 fidl::encoding::DynamicFlags::FLEXIBLE,
5918 ___deadline,
5919 )?
5920 .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
5921 Ok(_response.map(|x| (x.items, x.end_id)))
5922 }
5923}
5924
5925#[cfg(target_os = "fuchsia")]
5926impl From<DictionaryDrainIteratorSynchronousProxy> for zx::NullableHandle {
5927 fn from(value: DictionaryDrainIteratorSynchronousProxy) -> Self {
5928 value.into_channel().into()
5929 }
5930}
5931
5932#[cfg(target_os = "fuchsia")]
5933impl From<fidl::Channel> for DictionaryDrainIteratorSynchronousProxy {
5934 fn from(value: fidl::Channel) -> Self {
5935 Self::new(value)
5936 }
5937}
5938
5939#[cfg(target_os = "fuchsia")]
5940impl fidl::endpoints::FromClient for DictionaryDrainIteratorSynchronousProxy {
5941 type Protocol = DictionaryDrainIteratorMarker;
5942
5943 fn from_client(value: fidl::endpoints::ClientEnd<DictionaryDrainIteratorMarker>) -> Self {
5944 Self::new(value.into_channel())
5945 }
5946}
5947
5948#[derive(Debug, Clone)]
5949pub struct DictionaryDrainIteratorProxy {
5950 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5951}
5952
5953impl fidl::endpoints::Proxy for DictionaryDrainIteratorProxy {
5954 type Protocol = DictionaryDrainIteratorMarker;
5955
5956 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5957 Self::new(inner)
5958 }
5959
5960 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5961 self.client.into_channel().map_err(|client| Self { client })
5962 }
5963
5964 fn as_channel(&self) -> &::fidl::AsyncChannel {
5965 self.client.as_channel()
5966 }
5967}
5968
5969impl DictionaryDrainIteratorProxy {
5970 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5972 let protocol_name =
5973 <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5974 Self { client: fidl::client::Client::new(channel, protocol_name) }
5975 }
5976
5977 pub fn take_event_stream(&self) -> DictionaryDrainIteratorEventStream {
5983 DictionaryDrainIteratorEventStream { event_receiver: self.client.take_event_receiver() }
5984 }
5985
5986 pub fn r#get_next(
6003 &self,
6004 mut start_id: u64,
6005 mut limit: u32,
6006 ) -> fidl::client::QueryResponseFut<
6007 DictionaryDrainIteratorGetNextResult,
6008 fidl::encoding::DefaultFuchsiaResourceDialect,
6009 > {
6010 DictionaryDrainIteratorProxyInterface::r#get_next(self, start_id, limit)
6011 }
6012}
6013
6014impl DictionaryDrainIteratorProxyInterface for DictionaryDrainIteratorProxy {
6015 type GetNextResponseFut = fidl::client::QueryResponseFut<
6016 DictionaryDrainIteratorGetNextResult,
6017 fidl::encoding::DefaultFuchsiaResourceDialect,
6018 >;
6019 fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6020 fn _decode(
6021 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6022 ) -> Result<DictionaryDrainIteratorGetNextResult, fidl::Error> {
6023 let _response = fidl::client::decode_transaction_body::<
6024 fidl::encoding::FlexibleResultType<
6025 DictionaryDrainIteratorGetNextResponse,
6026 CapabilityStoreError,
6027 >,
6028 fidl::encoding::DefaultFuchsiaResourceDialect,
6029 0x4f8082ca1ee26061,
6030 >(_buf?)?
6031 .into_result::<DictionaryDrainIteratorMarker>("get_next")?;
6032 Ok(_response.map(|x| (x.items, x.end_id)))
6033 }
6034 self.client.send_query_and_decode::<
6035 DictionaryDrainIteratorGetNextRequest,
6036 DictionaryDrainIteratorGetNextResult,
6037 >(
6038 (start_id, limit,),
6039 0x4f8082ca1ee26061,
6040 fidl::encoding::DynamicFlags::FLEXIBLE,
6041 _decode,
6042 )
6043 }
6044}
6045
6046pub struct DictionaryDrainIteratorEventStream {
6047 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6048}
6049
6050impl std::marker::Unpin for DictionaryDrainIteratorEventStream {}
6051
6052impl futures::stream::FusedStream for DictionaryDrainIteratorEventStream {
6053 fn is_terminated(&self) -> bool {
6054 self.event_receiver.is_terminated()
6055 }
6056}
6057
6058impl futures::Stream for DictionaryDrainIteratorEventStream {
6059 type Item = Result<DictionaryDrainIteratorEvent, fidl::Error>;
6060
6061 fn poll_next(
6062 mut self: std::pin::Pin<&mut Self>,
6063 cx: &mut std::task::Context<'_>,
6064 ) -> std::task::Poll<Option<Self::Item>> {
6065 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6066 &mut self.event_receiver,
6067 cx
6068 )?) {
6069 Some(buf) => std::task::Poll::Ready(Some(DictionaryDrainIteratorEvent::decode(buf))),
6070 None => std::task::Poll::Ready(None),
6071 }
6072 }
6073}
6074
6075#[derive(Debug)]
6076pub enum DictionaryDrainIteratorEvent {
6077 #[non_exhaustive]
6078 _UnknownEvent {
6079 ordinal: u64,
6081 },
6082}
6083
6084impl DictionaryDrainIteratorEvent {
6085 fn decode(
6087 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6088 ) -> Result<DictionaryDrainIteratorEvent, fidl::Error> {
6089 let (bytes, _handles) = buf.split_mut();
6090 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6091 debug_assert_eq!(tx_header.tx_id, 0);
6092 match tx_header.ordinal {
6093 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6094 Ok(DictionaryDrainIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
6095 }
6096 _ => Err(fidl::Error::UnknownOrdinal {
6097 ordinal: tx_header.ordinal,
6098 protocol_name:
6099 <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6100 }),
6101 }
6102 }
6103}
6104
6105pub struct DictionaryDrainIteratorRequestStream {
6107 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6108 is_terminated: bool,
6109}
6110
6111impl std::marker::Unpin for DictionaryDrainIteratorRequestStream {}
6112
6113impl futures::stream::FusedStream for DictionaryDrainIteratorRequestStream {
6114 fn is_terminated(&self) -> bool {
6115 self.is_terminated
6116 }
6117}
6118
6119impl fidl::endpoints::RequestStream for DictionaryDrainIteratorRequestStream {
6120 type Protocol = DictionaryDrainIteratorMarker;
6121 type ControlHandle = DictionaryDrainIteratorControlHandle;
6122
6123 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6124 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6125 }
6126
6127 fn control_handle(&self) -> Self::ControlHandle {
6128 DictionaryDrainIteratorControlHandle { inner: self.inner.clone() }
6129 }
6130
6131 fn into_inner(
6132 self,
6133 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6134 {
6135 (self.inner, self.is_terminated)
6136 }
6137
6138 fn from_inner(
6139 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6140 is_terminated: bool,
6141 ) -> Self {
6142 Self { inner, is_terminated }
6143 }
6144}
6145
6146impl futures::Stream for DictionaryDrainIteratorRequestStream {
6147 type Item = Result<DictionaryDrainIteratorRequest, fidl::Error>;
6148
6149 fn poll_next(
6150 mut self: std::pin::Pin<&mut Self>,
6151 cx: &mut std::task::Context<'_>,
6152 ) -> std::task::Poll<Option<Self::Item>> {
6153 let this = &mut *self;
6154 if this.inner.check_shutdown(cx) {
6155 this.is_terminated = true;
6156 return std::task::Poll::Ready(None);
6157 }
6158 if this.is_terminated {
6159 panic!("polled DictionaryDrainIteratorRequestStream after completion");
6160 }
6161 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6162 |bytes, handles| {
6163 match this.inner.channel().read_etc(cx, bytes, handles) {
6164 std::task::Poll::Ready(Ok(())) => {}
6165 std::task::Poll::Pending => return std::task::Poll::Pending,
6166 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6167 this.is_terminated = true;
6168 return std::task::Poll::Ready(None);
6169 }
6170 std::task::Poll::Ready(Err(e)) => {
6171 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6172 e.into(),
6173 ))));
6174 }
6175 }
6176
6177 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6179
6180 std::task::Poll::Ready(Some(match header.ordinal {
6181 0x4f8082ca1ee26061 => {
6182 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6183 let mut req = fidl::new_empty!(DictionaryDrainIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6184 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryDrainIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6185 let control_handle = DictionaryDrainIteratorControlHandle {
6186 inner: this.inner.clone(),
6187 };
6188 Ok(DictionaryDrainIteratorRequest::GetNext {start_id: req.start_id,
6189limit: req.limit,
6190
6191 responder: DictionaryDrainIteratorGetNextResponder {
6192 control_handle: std::mem::ManuallyDrop::new(control_handle),
6193 tx_id: header.tx_id,
6194 },
6195 })
6196 }
6197 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6198 Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6199 ordinal: header.ordinal,
6200 control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6201 method_type: fidl::MethodType::OneWay,
6202 })
6203 }
6204 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6205 this.inner.send_framework_err(
6206 fidl::encoding::FrameworkErr::UnknownMethod,
6207 header.tx_id,
6208 header.ordinal,
6209 header.dynamic_flags(),
6210 (bytes, handles),
6211 )?;
6212 Ok(DictionaryDrainIteratorRequest::_UnknownMethod {
6213 ordinal: header.ordinal,
6214 control_handle: DictionaryDrainIteratorControlHandle { inner: this.inner.clone() },
6215 method_type: fidl::MethodType::TwoWay,
6216 })
6217 }
6218 _ => Err(fidl::Error::UnknownOrdinal {
6219 ordinal: header.ordinal,
6220 protocol_name: <DictionaryDrainIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6221 }),
6222 }))
6223 },
6224 )
6225 }
6226}
6227
6228#[derive(Debug)]
6229pub enum DictionaryDrainIteratorRequest {
6230 GetNext { start_id: u64, limit: u32, responder: DictionaryDrainIteratorGetNextResponder },
6247 #[non_exhaustive]
6249 _UnknownMethod {
6250 ordinal: u64,
6252 control_handle: DictionaryDrainIteratorControlHandle,
6253 method_type: fidl::MethodType,
6254 },
6255}
6256
6257impl DictionaryDrainIteratorRequest {
6258 #[allow(irrefutable_let_patterns)]
6259 pub fn into_get_next(self) -> Option<(u64, u32, DictionaryDrainIteratorGetNextResponder)> {
6260 if let DictionaryDrainIteratorRequest::GetNext { start_id, limit, responder } = self {
6261 Some((start_id, limit, responder))
6262 } else {
6263 None
6264 }
6265 }
6266
6267 pub fn method_name(&self) -> &'static str {
6269 match *self {
6270 DictionaryDrainIteratorRequest::GetNext { .. } => "get_next",
6271 DictionaryDrainIteratorRequest::_UnknownMethod {
6272 method_type: fidl::MethodType::OneWay,
6273 ..
6274 } => "unknown one-way method",
6275 DictionaryDrainIteratorRequest::_UnknownMethod {
6276 method_type: fidl::MethodType::TwoWay,
6277 ..
6278 } => "unknown two-way method",
6279 }
6280 }
6281}
6282
6283#[derive(Debug, Clone)]
6284pub struct DictionaryDrainIteratorControlHandle {
6285 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6286}
6287
6288impl fidl::endpoints::ControlHandle for DictionaryDrainIteratorControlHandle {
6289 fn shutdown(&self) {
6290 self.inner.shutdown()
6291 }
6292
6293 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6294 self.inner.shutdown_with_epitaph(status)
6295 }
6296
6297 fn is_closed(&self) -> bool {
6298 self.inner.channel().is_closed()
6299 }
6300 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6301 self.inner.channel().on_closed()
6302 }
6303
6304 #[cfg(target_os = "fuchsia")]
6305 fn signal_peer(
6306 &self,
6307 clear_mask: zx::Signals,
6308 set_mask: zx::Signals,
6309 ) -> Result<(), zx_status::Status> {
6310 use fidl::Peered;
6311 self.inner.channel().signal_peer(clear_mask, set_mask)
6312 }
6313}
6314
6315impl DictionaryDrainIteratorControlHandle {}
6316
6317#[must_use = "FIDL methods require a response to be sent"]
6318#[derive(Debug)]
6319pub struct DictionaryDrainIteratorGetNextResponder {
6320 control_handle: std::mem::ManuallyDrop<DictionaryDrainIteratorControlHandle>,
6321 tx_id: u32,
6322}
6323
6324impl std::ops::Drop for DictionaryDrainIteratorGetNextResponder {
6328 fn drop(&mut self) {
6329 self.control_handle.shutdown();
6330 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6332 }
6333}
6334
6335impl fidl::endpoints::Responder for DictionaryDrainIteratorGetNextResponder {
6336 type ControlHandle = DictionaryDrainIteratorControlHandle;
6337
6338 fn control_handle(&self) -> &DictionaryDrainIteratorControlHandle {
6339 &self.control_handle
6340 }
6341
6342 fn drop_without_shutdown(mut self) {
6343 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6345 std::mem::forget(self);
6347 }
6348}
6349
6350impl DictionaryDrainIteratorGetNextResponder {
6351 pub fn send(
6355 self,
6356 mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6357 ) -> Result<(), fidl::Error> {
6358 let _result = self.send_raw(result);
6359 if _result.is_err() {
6360 self.control_handle.shutdown();
6361 }
6362 self.drop_without_shutdown();
6363 _result
6364 }
6365
6366 pub fn send_no_shutdown_on_err(
6368 self,
6369 mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6370 ) -> Result<(), fidl::Error> {
6371 let _result = self.send_raw(result);
6372 self.drop_without_shutdown();
6373 _result
6374 }
6375
6376 fn send_raw(
6377 &self,
6378 mut result: Result<(&[DictionaryItem], u64), CapabilityStoreError>,
6379 ) -> Result<(), fidl::Error> {
6380 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6381 DictionaryDrainIteratorGetNextResponse,
6382 CapabilityStoreError,
6383 >>(
6384 fidl::encoding::FlexibleResult::new(result),
6385 self.tx_id,
6386 0x4f8082ca1ee26061,
6387 fidl::encoding::DynamicFlags::FLEXIBLE,
6388 )
6389 }
6390}
6391
6392#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6393pub struct DictionaryEnumerateIteratorMarker;
6394
6395impl fidl::endpoints::ProtocolMarker for DictionaryEnumerateIteratorMarker {
6396 type Proxy = DictionaryEnumerateIteratorProxy;
6397 type RequestStream = DictionaryEnumerateIteratorRequestStream;
6398 #[cfg(target_os = "fuchsia")]
6399 type SynchronousProxy = DictionaryEnumerateIteratorSynchronousProxy;
6400
6401 const DEBUG_NAME: &'static str = "(anonymous) DictionaryEnumerateIterator";
6402}
6403pub type DictionaryEnumerateIteratorGetNextResult =
6404 Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>;
6405
6406pub trait DictionaryEnumerateIteratorProxyInterface: Send + Sync {
6407 type GetNextResponseFut: std::future::Future<Output = Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error>>
6408 + Send;
6409 fn r#get_next(&self, start_id: u64, limit: u32) -> Self::GetNextResponseFut;
6410}
6411#[derive(Debug)]
6412#[cfg(target_os = "fuchsia")]
6413pub struct DictionaryEnumerateIteratorSynchronousProxy {
6414 client: fidl::client::sync::Client,
6415}
6416
6417#[cfg(target_os = "fuchsia")]
6418impl fidl::endpoints::SynchronousProxy for DictionaryEnumerateIteratorSynchronousProxy {
6419 type Proxy = DictionaryEnumerateIteratorProxy;
6420 type Protocol = DictionaryEnumerateIteratorMarker;
6421
6422 fn from_channel(inner: fidl::Channel) -> Self {
6423 Self::new(inner)
6424 }
6425
6426 fn into_channel(self) -> fidl::Channel {
6427 self.client.into_channel()
6428 }
6429
6430 fn as_channel(&self) -> &fidl::Channel {
6431 self.client.as_channel()
6432 }
6433}
6434
6435#[cfg(target_os = "fuchsia")]
6436impl DictionaryEnumerateIteratorSynchronousProxy {
6437 pub fn new(channel: fidl::Channel) -> Self {
6438 let protocol_name =
6439 <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6440 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6441 }
6442
6443 pub fn into_channel(self) -> fidl::Channel {
6444 self.client.into_channel()
6445 }
6446
6447 pub fn wait_for_event(
6450 &self,
6451 deadline: zx::MonotonicInstant,
6452 ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6453 DictionaryEnumerateIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6454 }
6455
6456 pub fn r#get_next(
6477 &self,
6478 mut start_id: u64,
6479 mut limit: u32,
6480 ___deadline: zx::MonotonicInstant,
6481 ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6482 let _response = self.client.send_query::<
6483 DictionaryEnumerateIteratorGetNextRequest,
6484 fidl::encoding::FlexibleResultType<DictionaryEnumerateIteratorGetNextResponse, CapabilityStoreError>,
6485 >(
6486 (start_id, limit,),
6487 0x14f8bc286512f5cf,
6488 fidl::encoding::DynamicFlags::FLEXIBLE,
6489 ___deadline,
6490 )?
6491 .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6492 Ok(_response.map(|x| (x.items, x.end_id)))
6493 }
6494}
6495
6496#[cfg(target_os = "fuchsia")]
6497impl From<DictionaryEnumerateIteratorSynchronousProxy> for zx::NullableHandle {
6498 fn from(value: DictionaryEnumerateIteratorSynchronousProxy) -> Self {
6499 value.into_channel().into()
6500 }
6501}
6502
6503#[cfg(target_os = "fuchsia")]
6504impl From<fidl::Channel> for DictionaryEnumerateIteratorSynchronousProxy {
6505 fn from(value: fidl::Channel) -> Self {
6506 Self::new(value)
6507 }
6508}
6509
6510#[cfg(target_os = "fuchsia")]
6511impl fidl::endpoints::FromClient for DictionaryEnumerateIteratorSynchronousProxy {
6512 type Protocol = DictionaryEnumerateIteratorMarker;
6513
6514 fn from_client(value: fidl::endpoints::ClientEnd<DictionaryEnumerateIteratorMarker>) -> Self {
6515 Self::new(value.into_channel())
6516 }
6517}
6518
6519#[derive(Debug, Clone)]
6520pub struct DictionaryEnumerateIteratorProxy {
6521 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6522}
6523
6524impl fidl::endpoints::Proxy for DictionaryEnumerateIteratorProxy {
6525 type Protocol = DictionaryEnumerateIteratorMarker;
6526
6527 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6528 Self::new(inner)
6529 }
6530
6531 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6532 self.client.into_channel().map_err(|client| Self { client })
6533 }
6534
6535 fn as_channel(&self) -> &::fidl::AsyncChannel {
6536 self.client.as_channel()
6537 }
6538}
6539
6540impl DictionaryEnumerateIteratorProxy {
6541 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6543 let protocol_name =
6544 <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6545 Self { client: fidl::client::Client::new(channel, protocol_name) }
6546 }
6547
6548 pub fn take_event_stream(&self) -> DictionaryEnumerateIteratorEventStream {
6554 DictionaryEnumerateIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6555 }
6556
6557 pub fn r#get_next(
6578 &self,
6579 mut start_id: u64,
6580 mut limit: u32,
6581 ) -> fidl::client::QueryResponseFut<
6582 DictionaryEnumerateIteratorGetNextResult,
6583 fidl::encoding::DefaultFuchsiaResourceDialect,
6584 > {
6585 DictionaryEnumerateIteratorProxyInterface::r#get_next(self, start_id, limit)
6586 }
6587}
6588
6589impl DictionaryEnumerateIteratorProxyInterface for DictionaryEnumerateIteratorProxy {
6590 type GetNextResponseFut = fidl::client::QueryResponseFut<
6591 DictionaryEnumerateIteratorGetNextResult,
6592 fidl::encoding::DefaultFuchsiaResourceDialect,
6593 >;
6594 fn r#get_next(&self, mut start_id: u64, mut limit: u32) -> Self::GetNextResponseFut {
6595 fn _decode(
6596 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6597 ) -> Result<DictionaryEnumerateIteratorGetNextResult, fidl::Error> {
6598 let _response = fidl::client::decode_transaction_body::<
6599 fidl::encoding::FlexibleResultType<
6600 DictionaryEnumerateIteratorGetNextResponse,
6601 CapabilityStoreError,
6602 >,
6603 fidl::encoding::DefaultFuchsiaResourceDialect,
6604 0x14f8bc286512f5cf,
6605 >(_buf?)?
6606 .into_result::<DictionaryEnumerateIteratorMarker>("get_next")?;
6607 Ok(_response.map(|x| (x.items, x.end_id)))
6608 }
6609 self.client.send_query_and_decode::<
6610 DictionaryEnumerateIteratorGetNextRequest,
6611 DictionaryEnumerateIteratorGetNextResult,
6612 >(
6613 (start_id, limit,),
6614 0x14f8bc286512f5cf,
6615 fidl::encoding::DynamicFlags::FLEXIBLE,
6616 _decode,
6617 )
6618 }
6619}
6620
6621pub struct DictionaryEnumerateIteratorEventStream {
6622 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6623}
6624
6625impl std::marker::Unpin for DictionaryEnumerateIteratorEventStream {}
6626
6627impl futures::stream::FusedStream for DictionaryEnumerateIteratorEventStream {
6628 fn is_terminated(&self) -> bool {
6629 self.event_receiver.is_terminated()
6630 }
6631}
6632
6633impl futures::Stream for DictionaryEnumerateIteratorEventStream {
6634 type Item = Result<DictionaryEnumerateIteratorEvent, fidl::Error>;
6635
6636 fn poll_next(
6637 mut self: std::pin::Pin<&mut Self>,
6638 cx: &mut std::task::Context<'_>,
6639 ) -> std::task::Poll<Option<Self::Item>> {
6640 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6641 &mut self.event_receiver,
6642 cx
6643 )?) {
6644 Some(buf) => {
6645 std::task::Poll::Ready(Some(DictionaryEnumerateIteratorEvent::decode(buf)))
6646 }
6647 None => std::task::Poll::Ready(None),
6648 }
6649 }
6650}
6651
6652#[derive(Debug)]
6653pub enum DictionaryEnumerateIteratorEvent {
6654 #[non_exhaustive]
6655 _UnknownEvent {
6656 ordinal: u64,
6658 },
6659}
6660
6661impl DictionaryEnumerateIteratorEvent {
6662 fn decode(
6664 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6665 ) -> Result<DictionaryEnumerateIteratorEvent, fidl::Error> {
6666 let (bytes, _handles) = buf.split_mut();
6667 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6668 debug_assert_eq!(tx_header.tx_id, 0);
6669 match tx_header.ordinal {
6670 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6671 Ok(DictionaryEnumerateIteratorEvent::_UnknownEvent {
6672 ordinal: tx_header.ordinal,
6673 })
6674 }
6675 _ => Err(fidl::Error::UnknownOrdinal {
6676 ordinal: tx_header.ordinal,
6677 protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6678 })
6679 }
6680 }
6681}
6682
6683pub struct DictionaryEnumerateIteratorRequestStream {
6685 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6686 is_terminated: bool,
6687}
6688
6689impl std::marker::Unpin for DictionaryEnumerateIteratorRequestStream {}
6690
6691impl futures::stream::FusedStream for DictionaryEnumerateIteratorRequestStream {
6692 fn is_terminated(&self) -> bool {
6693 self.is_terminated
6694 }
6695}
6696
6697impl fidl::endpoints::RequestStream for DictionaryEnumerateIteratorRequestStream {
6698 type Protocol = DictionaryEnumerateIteratorMarker;
6699 type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6700
6701 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6702 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6703 }
6704
6705 fn control_handle(&self) -> Self::ControlHandle {
6706 DictionaryEnumerateIteratorControlHandle { inner: self.inner.clone() }
6707 }
6708
6709 fn into_inner(
6710 self,
6711 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6712 {
6713 (self.inner, self.is_terminated)
6714 }
6715
6716 fn from_inner(
6717 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6718 is_terminated: bool,
6719 ) -> Self {
6720 Self { inner, is_terminated }
6721 }
6722}
6723
6724impl futures::Stream for DictionaryEnumerateIteratorRequestStream {
6725 type Item = Result<DictionaryEnumerateIteratorRequest, fidl::Error>;
6726
6727 fn poll_next(
6728 mut self: std::pin::Pin<&mut Self>,
6729 cx: &mut std::task::Context<'_>,
6730 ) -> std::task::Poll<Option<Self::Item>> {
6731 let this = &mut *self;
6732 if this.inner.check_shutdown(cx) {
6733 this.is_terminated = true;
6734 return std::task::Poll::Ready(None);
6735 }
6736 if this.is_terminated {
6737 panic!("polled DictionaryEnumerateIteratorRequestStream after completion");
6738 }
6739 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6740 |bytes, handles| {
6741 match this.inner.channel().read_etc(cx, bytes, handles) {
6742 std::task::Poll::Ready(Ok(())) => {}
6743 std::task::Poll::Pending => return std::task::Poll::Pending,
6744 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6745 this.is_terminated = true;
6746 return std::task::Poll::Ready(None);
6747 }
6748 std::task::Poll::Ready(Err(e)) => {
6749 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6750 e.into(),
6751 ))));
6752 }
6753 }
6754
6755 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6757
6758 std::task::Poll::Ready(Some(match header.ordinal {
6759 0x14f8bc286512f5cf => {
6760 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6761 let mut req = fidl::new_empty!(DictionaryEnumerateIteratorGetNextRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
6762 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DictionaryEnumerateIteratorGetNextRequest>(&header, _body_bytes, handles, &mut req)?;
6763 let control_handle = DictionaryEnumerateIteratorControlHandle {
6764 inner: this.inner.clone(),
6765 };
6766 Ok(DictionaryEnumerateIteratorRequest::GetNext {start_id: req.start_id,
6767limit: req.limit,
6768
6769 responder: DictionaryEnumerateIteratorGetNextResponder {
6770 control_handle: std::mem::ManuallyDrop::new(control_handle),
6771 tx_id: header.tx_id,
6772 },
6773 })
6774 }
6775 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6776 Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6777 ordinal: header.ordinal,
6778 control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6779 method_type: fidl::MethodType::OneWay,
6780 })
6781 }
6782 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
6783 this.inner.send_framework_err(
6784 fidl::encoding::FrameworkErr::UnknownMethod,
6785 header.tx_id,
6786 header.ordinal,
6787 header.dynamic_flags(),
6788 (bytes, handles),
6789 )?;
6790 Ok(DictionaryEnumerateIteratorRequest::_UnknownMethod {
6791 ordinal: header.ordinal,
6792 control_handle: DictionaryEnumerateIteratorControlHandle { inner: this.inner.clone() },
6793 method_type: fidl::MethodType::TwoWay,
6794 })
6795 }
6796 _ => Err(fidl::Error::UnknownOrdinal {
6797 ordinal: header.ordinal,
6798 protocol_name: <DictionaryEnumerateIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6799 }),
6800 }))
6801 },
6802 )
6803 }
6804}
6805
6806#[derive(Debug)]
6807pub enum DictionaryEnumerateIteratorRequest {
6808 GetNext { start_id: u64, limit: u32, responder: DictionaryEnumerateIteratorGetNextResponder },
6829 #[non_exhaustive]
6831 _UnknownMethod {
6832 ordinal: u64,
6834 control_handle: DictionaryEnumerateIteratorControlHandle,
6835 method_type: fidl::MethodType,
6836 },
6837}
6838
6839impl DictionaryEnumerateIteratorRequest {
6840 #[allow(irrefutable_let_patterns)]
6841 pub fn into_get_next(self) -> Option<(u64, u32, DictionaryEnumerateIteratorGetNextResponder)> {
6842 if let DictionaryEnumerateIteratorRequest::GetNext { start_id, limit, responder } = self {
6843 Some((start_id, limit, responder))
6844 } else {
6845 None
6846 }
6847 }
6848
6849 pub fn method_name(&self) -> &'static str {
6851 match *self {
6852 DictionaryEnumerateIteratorRequest::GetNext { .. } => "get_next",
6853 DictionaryEnumerateIteratorRequest::_UnknownMethod {
6854 method_type: fidl::MethodType::OneWay,
6855 ..
6856 } => "unknown one-way method",
6857 DictionaryEnumerateIteratorRequest::_UnknownMethod {
6858 method_type: fidl::MethodType::TwoWay,
6859 ..
6860 } => "unknown two-way method",
6861 }
6862 }
6863}
6864
6865#[derive(Debug, Clone)]
6866pub struct DictionaryEnumerateIteratorControlHandle {
6867 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6868}
6869
6870impl fidl::endpoints::ControlHandle for DictionaryEnumerateIteratorControlHandle {
6871 fn shutdown(&self) {
6872 self.inner.shutdown()
6873 }
6874
6875 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6876 self.inner.shutdown_with_epitaph(status)
6877 }
6878
6879 fn is_closed(&self) -> bool {
6880 self.inner.channel().is_closed()
6881 }
6882 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6883 self.inner.channel().on_closed()
6884 }
6885
6886 #[cfg(target_os = "fuchsia")]
6887 fn signal_peer(
6888 &self,
6889 clear_mask: zx::Signals,
6890 set_mask: zx::Signals,
6891 ) -> Result<(), zx_status::Status> {
6892 use fidl::Peered;
6893 self.inner.channel().signal_peer(clear_mask, set_mask)
6894 }
6895}
6896
6897impl DictionaryEnumerateIteratorControlHandle {}
6898
6899#[must_use = "FIDL methods require a response to be sent"]
6900#[derive(Debug)]
6901pub struct DictionaryEnumerateIteratorGetNextResponder {
6902 control_handle: std::mem::ManuallyDrop<DictionaryEnumerateIteratorControlHandle>,
6903 tx_id: u32,
6904}
6905
6906impl std::ops::Drop for DictionaryEnumerateIteratorGetNextResponder {
6910 fn drop(&mut self) {
6911 self.control_handle.shutdown();
6912 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6914 }
6915}
6916
6917impl fidl::endpoints::Responder for DictionaryEnumerateIteratorGetNextResponder {
6918 type ControlHandle = DictionaryEnumerateIteratorControlHandle;
6919
6920 fn control_handle(&self) -> &DictionaryEnumerateIteratorControlHandle {
6921 &self.control_handle
6922 }
6923
6924 fn drop_without_shutdown(mut self) {
6925 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6927 std::mem::forget(self);
6929 }
6930}
6931
6932impl DictionaryEnumerateIteratorGetNextResponder {
6933 pub fn send(
6937 self,
6938 mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6939 ) -> Result<(), fidl::Error> {
6940 let _result = self.send_raw(result);
6941 if _result.is_err() {
6942 self.control_handle.shutdown();
6943 }
6944 self.drop_without_shutdown();
6945 _result
6946 }
6947
6948 pub fn send_no_shutdown_on_err(
6950 self,
6951 mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6952 ) -> Result<(), fidl::Error> {
6953 let _result = self.send_raw(result);
6954 self.drop_without_shutdown();
6955 _result
6956 }
6957
6958 fn send_raw(
6959 &self,
6960 mut result: Result<(Vec<DictionaryOptionalItem>, u64), CapabilityStoreError>,
6961 ) -> Result<(), fidl::Error> {
6962 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
6963 DictionaryEnumerateIteratorGetNextResponse,
6964 CapabilityStoreError,
6965 >>(
6966 fidl::encoding::FlexibleResult::new(
6967 result
6968 .as_mut()
6969 .map_err(|e| *e)
6970 .map(|(items, end_id)| (items.as_mut_slice(), *end_id)),
6971 ),
6972 self.tx_id,
6973 0x14f8bc286512f5cf,
6974 fidl::encoding::DynamicFlags::FLEXIBLE,
6975 )
6976 }
6977}
6978
6979#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6980pub struct DictionaryKeysIteratorMarker;
6981
6982impl fidl::endpoints::ProtocolMarker for DictionaryKeysIteratorMarker {
6983 type Proxy = DictionaryKeysIteratorProxy;
6984 type RequestStream = DictionaryKeysIteratorRequestStream;
6985 #[cfg(target_os = "fuchsia")]
6986 type SynchronousProxy = DictionaryKeysIteratorSynchronousProxy;
6987
6988 const DEBUG_NAME: &'static str = "(anonymous) DictionaryKeysIterator";
6989}
6990
6991pub trait DictionaryKeysIteratorProxyInterface: Send + Sync {
6992 type GetNextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6993 fn r#get_next(&self) -> Self::GetNextResponseFut;
6994}
6995#[derive(Debug)]
6996#[cfg(target_os = "fuchsia")]
6997pub struct DictionaryKeysIteratorSynchronousProxy {
6998 client: fidl::client::sync::Client,
6999}
7000
7001#[cfg(target_os = "fuchsia")]
7002impl fidl::endpoints::SynchronousProxy for DictionaryKeysIteratorSynchronousProxy {
7003 type Proxy = DictionaryKeysIteratorProxy;
7004 type Protocol = DictionaryKeysIteratorMarker;
7005
7006 fn from_channel(inner: fidl::Channel) -> Self {
7007 Self::new(inner)
7008 }
7009
7010 fn into_channel(self) -> fidl::Channel {
7011 self.client.into_channel()
7012 }
7013
7014 fn as_channel(&self) -> &fidl::Channel {
7015 self.client.as_channel()
7016 }
7017}
7018
7019#[cfg(target_os = "fuchsia")]
7020impl DictionaryKeysIteratorSynchronousProxy {
7021 pub fn new(channel: fidl::Channel) -> Self {
7022 let protocol_name =
7023 <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7024 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7025 }
7026
7027 pub fn into_channel(self) -> fidl::Channel {
7028 self.client.into_channel()
7029 }
7030
7031 pub fn wait_for_event(
7034 &self,
7035 deadline: zx::MonotonicInstant,
7036 ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7037 DictionaryKeysIteratorEvent::decode(self.client.wait_for_event(deadline)?)
7038 }
7039
7040 pub fn r#get_next(
7041 &self,
7042 ___deadline: zx::MonotonicInstant,
7043 ) -> Result<Vec<String>, fidl::Error> {
7044 let _response = self.client.send_query::<
7045 fidl::encoding::EmptyPayload,
7046 fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7047 >(
7048 (),
7049 0x453828cbacca7d53,
7050 fidl::encoding::DynamicFlags::FLEXIBLE,
7051 ___deadline,
7052 )?
7053 .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7054 Ok(_response.keys)
7055 }
7056}
7057
7058#[cfg(target_os = "fuchsia")]
7059impl From<DictionaryKeysIteratorSynchronousProxy> for zx::NullableHandle {
7060 fn from(value: DictionaryKeysIteratorSynchronousProxy) -> Self {
7061 value.into_channel().into()
7062 }
7063}
7064
7065#[cfg(target_os = "fuchsia")]
7066impl From<fidl::Channel> for DictionaryKeysIteratorSynchronousProxy {
7067 fn from(value: fidl::Channel) -> Self {
7068 Self::new(value)
7069 }
7070}
7071
7072#[cfg(target_os = "fuchsia")]
7073impl fidl::endpoints::FromClient for DictionaryKeysIteratorSynchronousProxy {
7074 type Protocol = DictionaryKeysIteratorMarker;
7075
7076 fn from_client(value: fidl::endpoints::ClientEnd<DictionaryKeysIteratorMarker>) -> Self {
7077 Self::new(value.into_channel())
7078 }
7079}
7080
7081#[derive(Debug, Clone)]
7082pub struct DictionaryKeysIteratorProxy {
7083 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7084}
7085
7086impl fidl::endpoints::Proxy for DictionaryKeysIteratorProxy {
7087 type Protocol = DictionaryKeysIteratorMarker;
7088
7089 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7090 Self::new(inner)
7091 }
7092
7093 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7094 self.client.into_channel().map_err(|client| Self { client })
7095 }
7096
7097 fn as_channel(&self) -> &::fidl::AsyncChannel {
7098 self.client.as_channel()
7099 }
7100}
7101
7102impl DictionaryKeysIteratorProxy {
7103 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7105 let protocol_name =
7106 <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7107 Self { client: fidl::client::Client::new(channel, protocol_name) }
7108 }
7109
7110 pub fn take_event_stream(&self) -> DictionaryKeysIteratorEventStream {
7116 DictionaryKeysIteratorEventStream { event_receiver: self.client.take_event_receiver() }
7117 }
7118
7119 pub fn r#get_next(
7120 &self,
7121 ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
7122 {
7123 DictionaryKeysIteratorProxyInterface::r#get_next(self)
7124 }
7125}
7126
7127impl DictionaryKeysIteratorProxyInterface for DictionaryKeysIteratorProxy {
7128 type GetNextResponseFut =
7129 fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
7130 fn r#get_next(&self) -> Self::GetNextResponseFut {
7131 fn _decode(
7132 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7133 ) -> Result<Vec<String>, fidl::Error> {
7134 let _response = fidl::client::decode_transaction_body::<
7135 fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>,
7136 fidl::encoding::DefaultFuchsiaResourceDialect,
7137 0x453828cbacca7d53,
7138 >(_buf?)?
7139 .into_result::<DictionaryKeysIteratorMarker>("get_next")?;
7140 Ok(_response.keys)
7141 }
7142 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
7143 (),
7144 0x453828cbacca7d53,
7145 fidl::encoding::DynamicFlags::FLEXIBLE,
7146 _decode,
7147 )
7148 }
7149}
7150
7151pub struct DictionaryKeysIteratorEventStream {
7152 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7153}
7154
7155impl std::marker::Unpin for DictionaryKeysIteratorEventStream {}
7156
7157impl futures::stream::FusedStream for DictionaryKeysIteratorEventStream {
7158 fn is_terminated(&self) -> bool {
7159 self.event_receiver.is_terminated()
7160 }
7161}
7162
7163impl futures::Stream for DictionaryKeysIteratorEventStream {
7164 type Item = Result<DictionaryKeysIteratorEvent, fidl::Error>;
7165
7166 fn poll_next(
7167 mut self: std::pin::Pin<&mut Self>,
7168 cx: &mut std::task::Context<'_>,
7169 ) -> std::task::Poll<Option<Self::Item>> {
7170 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7171 &mut self.event_receiver,
7172 cx
7173 )?) {
7174 Some(buf) => std::task::Poll::Ready(Some(DictionaryKeysIteratorEvent::decode(buf))),
7175 None => std::task::Poll::Ready(None),
7176 }
7177 }
7178}
7179
7180#[derive(Debug)]
7181pub enum DictionaryKeysIteratorEvent {
7182 #[non_exhaustive]
7183 _UnknownEvent {
7184 ordinal: u64,
7186 },
7187}
7188
7189impl DictionaryKeysIteratorEvent {
7190 fn decode(
7192 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7193 ) -> Result<DictionaryKeysIteratorEvent, fidl::Error> {
7194 let (bytes, _handles) = buf.split_mut();
7195 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7196 debug_assert_eq!(tx_header.tx_id, 0);
7197 match tx_header.ordinal {
7198 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7199 Ok(DictionaryKeysIteratorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7200 }
7201 _ => Err(fidl::Error::UnknownOrdinal {
7202 ordinal: tx_header.ordinal,
7203 protocol_name:
7204 <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7205 }),
7206 }
7207 }
7208}
7209
7210pub struct DictionaryKeysIteratorRequestStream {
7212 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7213 is_terminated: bool,
7214}
7215
7216impl std::marker::Unpin for DictionaryKeysIteratorRequestStream {}
7217
7218impl futures::stream::FusedStream for DictionaryKeysIteratorRequestStream {
7219 fn is_terminated(&self) -> bool {
7220 self.is_terminated
7221 }
7222}
7223
7224impl fidl::endpoints::RequestStream for DictionaryKeysIteratorRequestStream {
7225 type Protocol = DictionaryKeysIteratorMarker;
7226 type ControlHandle = DictionaryKeysIteratorControlHandle;
7227
7228 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7229 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7230 }
7231
7232 fn control_handle(&self) -> Self::ControlHandle {
7233 DictionaryKeysIteratorControlHandle { inner: self.inner.clone() }
7234 }
7235
7236 fn into_inner(
7237 self,
7238 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7239 {
7240 (self.inner, self.is_terminated)
7241 }
7242
7243 fn from_inner(
7244 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7245 is_terminated: bool,
7246 ) -> Self {
7247 Self { inner, is_terminated }
7248 }
7249}
7250
7251impl futures::Stream for DictionaryKeysIteratorRequestStream {
7252 type Item = Result<DictionaryKeysIteratorRequest, fidl::Error>;
7253
7254 fn poll_next(
7255 mut self: std::pin::Pin<&mut Self>,
7256 cx: &mut std::task::Context<'_>,
7257 ) -> std::task::Poll<Option<Self::Item>> {
7258 let this = &mut *self;
7259 if this.inner.check_shutdown(cx) {
7260 this.is_terminated = true;
7261 return std::task::Poll::Ready(None);
7262 }
7263 if this.is_terminated {
7264 panic!("polled DictionaryKeysIteratorRequestStream after completion");
7265 }
7266 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7267 |bytes, handles| {
7268 match this.inner.channel().read_etc(cx, bytes, handles) {
7269 std::task::Poll::Ready(Ok(())) => {}
7270 std::task::Poll::Pending => return std::task::Poll::Pending,
7271 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7272 this.is_terminated = true;
7273 return std::task::Poll::Ready(None);
7274 }
7275 std::task::Poll::Ready(Err(e)) => {
7276 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7277 e.into(),
7278 ))));
7279 }
7280 }
7281
7282 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7284
7285 std::task::Poll::Ready(Some(match header.ordinal {
7286 0x453828cbacca7d53 => {
7287 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7288 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
7289 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7290 let control_handle = DictionaryKeysIteratorControlHandle {
7291 inner: this.inner.clone(),
7292 };
7293 Ok(DictionaryKeysIteratorRequest::GetNext {
7294 responder: DictionaryKeysIteratorGetNextResponder {
7295 control_handle: std::mem::ManuallyDrop::new(control_handle),
7296 tx_id: header.tx_id,
7297 },
7298 })
7299 }
7300 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7301 Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7302 ordinal: header.ordinal,
7303 control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7304 method_type: fidl::MethodType::OneWay,
7305 })
7306 }
7307 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7308 this.inner.send_framework_err(
7309 fidl::encoding::FrameworkErr::UnknownMethod,
7310 header.tx_id,
7311 header.ordinal,
7312 header.dynamic_flags(),
7313 (bytes, handles),
7314 )?;
7315 Ok(DictionaryKeysIteratorRequest::_UnknownMethod {
7316 ordinal: header.ordinal,
7317 control_handle: DictionaryKeysIteratorControlHandle { inner: this.inner.clone() },
7318 method_type: fidl::MethodType::TwoWay,
7319 })
7320 }
7321 _ => Err(fidl::Error::UnknownOrdinal {
7322 ordinal: header.ordinal,
7323 protocol_name: <DictionaryKeysIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7324 }),
7325 }))
7326 },
7327 )
7328 }
7329}
7330
7331#[derive(Debug)]
7332pub enum DictionaryKeysIteratorRequest {
7333 GetNext {
7334 responder: DictionaryKeysIteratorGetNextResponder,
7335 },
7336 #[non_exhaustive]
7338 _UnknownMethod {
7339 ordinal: u64,
7341 control_handle: DictionaryKeysIteratorControlHandle,
7342 method_type: fidl::MethodType,
7343 },
7344}
7345
7346impl DictionaryKeysIteratorRequest {
7347 #[allow(irrefutable_let_patterns)]
7348 pub fn into_get_next(self) -> Option<(DictionaryKeysIteratorGetNextResponder)> {
7349 if let DictionaryKeysIteratorRequest::GetNext { responder } = self {
7350 Some((responder))
7351 } else {
7352 None
7353 }
7354 }
7355
7356 pub fn method_name(&self) -> &'static str {
7358 match *self {
7359 DictionaryKeysIteratorRequest::GetNext { .. } => "get_next",
7360 DictionaryKeysIteratorRequest::_UnknownMethod {
7361 method_type: fidl::MethodType::OneWay,
7362 ..
7363 } => "unknown one-way method",
7364 DictionaryKeysIteratorRequest::_UnknownMethod {
7365 method_type: fidl::MethodType::TwoWay,
7366 ..
7367 } => "unknown two-way method",
7368 }
7369 }
7370}
7371
7372#[derive(Debug, Clone)]
7373pub struct DictionaryKeysIteratorControlHandle {
7374 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7375}
7376
7377impl fidl::endpoints::ControlHandle for DictionaryKeysIteratorControlHandle {
7378 fn shutdown(&self) {
7379 self.inner.shutdown()
7380 }
7381
7382 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7383 self.inner.shutdown_with_epitaph(status)
7384 }
7385
7386 fn is_closed(&self) -> bool {
7387 self.inner.channel().is_closed()
7388 }
7389 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7390 self.inner.channel().on_closed()
7391 }
7392
7393 #[cfg(target_os = "fuchsia")]
7394 fn signal_peer(
7395 &self,
7396 clear_mask: zx::Signals,
7397 set_mask: zx::Signals,
7398 ) -> Result<(), zx_status::Status> {
7399 use fidl::Peered;
7400 self.inner.channel().signal_peer(clear_mask, set_mask)
7401 }
7402}
7403
7404impl DictionaryKeysIteratorControlHandle {}
7405
7406#[must_use = "FIDL methods require a response to be sent"]
7407#[derive(Debug)]
7408pub struct DictionaryKeysIteratorGetNextResponder {
7409 control_handle: std::mem::ManuallyDrop<DictionaryKeysIteratorControlHandle>,
7410 tx_id: u32,
7411}
7412
7413impl std::ops::Drop for DictionaryKeysIteratorGetNextResponder {
7417 fn drop(&mut self) {
7418 self.control_handle.shutdown();
7419 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7421 }
7422}
7423
7424impl fidl::endpoints::Responder for DictionaryKeysIteratorGetNextResponder {
7425 type ControlHandle = DictionaryKeysIteratorControlHandle;
7426
7427 fn control_handle(&self) -> &DictionaryKeysIteratorControlHandle {
7428 &self.control_handle
7429 }
7430
7431 fn drop_without_shutdown(mut self) {
7432 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7434 std::mem::forget(self);
7436 }
7437}
7438
7439impl DictionaryKeysIteratorGetNextResponder {
7440 pub fn send(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7444 let _result = self.send_raw(keys);
7445 if _result.is_err() {
7446 self.control_handle.shutdown();
7447 }
7448 self.drop_without_shutdown();
7449 _result
7450 }
7451
7452 pub fn send_no_shutdown_on_err(self, mut keys: &[String]) -> Result<(), fidl::Error> {
7454 let _result = self.send_raw(keys);
7455 self.drop_without_shutdown();
7456 _result
7457 }
7458
7459 fn send_raw(&self, mut keys: &[String]) -> Result<(), fidl::Error> {
7460 self.control_handle
7461 .inner
7462 .send::<fidl::encoding::FlexibleType<DictionaryKeysIteratorGetNextResponse>>(
7463 fidl::encoding::Flexible::new((keys,)),
7464 self.tx_id,
7465 0x453828cbacca7d53,
7466 fidl::encoding::DynamicFlags::FLEXIBLE,
7467 )
7468 }
7469}
7470
7471#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7472pub struct DictionaryRouterMarker;
7473
7474impl fidl::endpoints::ProtocolMarker for DictionaryRouterMarker {
7475 type Proxy = DictionaryRouterProxy;
7476 type RequestStream = DictionaryRouterRequestStream;
7477 #[cfg(target_os = "fuchsia")]
7478 type SynchronousProxy = DictionaryRouterSynchronousProxy;
7479
7480 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DictionaryRouter";
7481}
7482impl fidl::endpoints::DiscoverableProtocolMarker for DictionaryRouterMarker {}
7483pub type DictionaryRouterRouteResult = Result<DictionaryRouterRouteResponse, RouterError>;
7484
7485pub trait DictionaryRouterProxyInterface: Send + Sync {
7486 type RouteResponseFut: std::future::Future<Output = Result<DictionaryRouterRouteResult, fidl::Error>>
7487 + Send;
7488 fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
7489}
7490#[derive(Debug)]
7491#[cfg(target_os = "fuchsia")]
7492pub struct DictionaryRouterSynchronousProxy {
7493 client: fidl::client::sync::Client,
7494}
7495
7496#[cfg(target_os = "fuchsia")]
7497impl fidl::endpoints::SynchronousProxy for DictionaryRouterSynchronousProxy {
7498 type Proxy = DictionaryRouterProxy;
7499 type Protocol = DictionaryRouterMarker;
7500
7501 fn from_channel(inner: fidl::Channel) -> Self {
7502 Self::new(inner)
7503 }
7504
7505 fn into_channel(self) -> fidl::Channel {
7506 self.client.into_channel()
7507 }
7508
7509 fn as_channel(&self) -> &fidl::Channel {
7510 self.client.as_channel()
7511 }
7512}
7513
7514#[cfg(target_os = "fuchsia")]
7515impl DictionaryRouterSynchronousProxy {
7516 pub fn new(channel: fidl::Channel) -> Self {
7517 let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7518 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7519 }
7520
7521 pub fn into_channel(self) -> fidl::Channel {
7522 self.client.into_channel()
7523 }
7524
7525 pub fn wait_for_event(
7528 &self,
7529 deadline: zx::MonotonicInstant,
7530 ) -> Result<DictionaryRouterEvent, fidl::Error> {
7531 DictionaryRouterEvent::decode(self.client.wait_for_event(deadline)?)
7532 }
7533
7534 pub fn r#route(
7535 &self,
7536 mut payload: RouteRequest,
7537 ___deadline: zx::MonotonicInstant,
7538 ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7539 let _response = self.client.send_query::<
7540 RouteRequest,
7541 fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7542 >(
7543 &mut payload,
7544 0x714c65bfe54bd79f,
7545 fidl::encoding::DynamicFlags::FLEXIBLE,
7546 ___deadline,
7547 )?
7548 .into_result::<DictionaryRouterMarker>("route")?;
7549 Ok(_response.map(|x| x))
7550 }
7551}
7552
7553#[cfg(target_os = "fuchsia")]
7554impl From<DictionaryRouterSynchronousProxy> for zx::NullableHandle {
7555 fn from(value: DictionaryRouterSynchronousProxy) -> Self {
7556 value.into_channel().into()
7557 }
7558}
7559
7560#[cfg(target_os = "fuchsia")]
7561impl From<fidl::Channel> for DictionaryRouterSynchronousProxy {
7562 fn from(value: fidl::Channel) -> Self {
7563 Self::new(value)
7564 }
7565}
7566
7567#[cfg(target_os = "fuchsia")]
7568impl fidl::endpoints::FromClient for DictionaryRouterSynchronousProxy {
7569 type Protocol = DictionaryRouterMarker;
7570
7571 fn from_client(value: fidl::endpoints::ClientEnd<DictionaryRouterMarker>) -> Self {
7572 Self::new(value.into_channel())
7573 }
7574}
7575
7576#[derive(Debug, Clone)]
7577pub struct DictionaryRouterProxy {
7578 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7579}
7580
7581impl fidl::endpoints::Proxy for DictionaryRouterProxy {
7582 type Protocol = DictionaryRouterMarker;
7583
7584 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7585 Self::new(inner)
7586 }
7587
7588 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7589 self.client.into_channel().map_err(|client| Self { client })
7590 }
7591
7592 fn as_channel(&self) -> &::fidl::AsyncChannel {
7593 self.client.as_channel()
7594 }
7595}
7596
7597impl DictionaryRouterProxy {
7598 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7600 let protocol_name = <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7601 Self { client: fidl::client::Client::new(channel, protocol_name) }
7602 }
7603
7604 pub fn take_event_stream(&self) -> DictionaryRouterEventStream {
7610 DictionaryRouterEventStream { event_receiver: self.client.take_event_receiver() }
7611 }
7612
7613 pub fn r#route(
7614 &self,
7615 mut payload: RouteRequest,
7616 ) -> fidl::client::QueryResponseFut<
7617 DictionaryRouterRouteResult,
7618 fidl::encoding::DefaultFuchsiaResourceDialect,
7619 > {
7620 DictionaryRouterProxyInterface::r#route(self, payload)
7621 }
7622}
7623
7624impl DictionaryRouterProxyInterface for DictionaryRouterProxy {
7625 type RouteResponseFut = fidl::client::QueryResponseFut<
7626 DictionaryRouterRouteResult,
7627 fidl::encoding::DefaultFuchsiaResourceDialect,
7628 >;
7629 fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
7630 fn _decode(
7631 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7632 ) -> Result<DictionaryRouterRouteResult, fidl::Error> {
7633 let _response = fidl::client::decode_transaction_body::<
7634 fidl::encoding::FlexibleResultType<DictionaryRouterRouteResponse, RouterError>,
7635 fidl::encoding::DefaultFuchsiaResourceDialect,
7636 0x714c65bfe54bd79f,
7637 >(_buf?)?
7638 .into_result::<DictionaryRouterMarker>("route")?;
7639 Ok(_response.map(|x| x))
7640 }
7641 self.client.send_query_and_decode::<RouteRequest, DictionaryRouterRouteResult>(
7642 &mut payload,
7643 0x714c65bfe54bd79f,
7644 fidl::encoding::DynamicFlags::FLEXIBLE,
7645 _decode,
7646 )
7647 }
7648}
7649
7650pub struct DictionaryRouterEventStream {
7651 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7652}
7653
7654impl std::marker::Unpin for DictionaryRouterEventStream {}
7655
7656impl futures::stream::FusedStream for DictionaryRouterEventStream {
7657 fn is_terminated(&self) -> bool {
7658 self.event_receiver.is_terminated()
7659 }
7660}
7661
7662impl futures::Stream for DictionaryRouterEventStream {
7663 type Item = Result<DictionaryRouterEvent, fidl::Error>;
7664
7665 fn poll_next(
7666 mut self: std::pin::Pin<&mut Self>,
7667 cx: &mut std::task::Context<'_>,
7668 ) -> std::task::Poll<Option<Self::Item>> {
7669 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7670 &mut self.event_receiver,
7671 cx
7672 )?) {
7673 Some(buf) => std::task::Poll::Ready(Some(DictionaryRouterEvent::decode(buf))),
7674 None => std::task::Poll::Ready(None),
7675 }
7676 }
7677}
7678
7679#[derive(Debug)]
7680pub enum DictionaryRouterEvent {
7681 #[non_exhaustive]
7682 _UnknownEvent {
7683 ordinal: u64,
7685 },
7686}
7687
7688impl DictionaryRouterEvent {
7689 fn decode(
7691 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7692 ) -> Result<DictionaryRouterEvent, fidl::Error> {
7693 let (bytes, _handles) = buf.split_mut();
7694 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7695 debug_assert_eq!(tx_header.tx_id, 0);
7696 match tx_header.ordinal {
7697 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
7698 Ok(DictionaryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
7699 }
7700 _ => Err(fidl::Error::UnknownOrdinal {
7701 ordinal: tx_header.ordinal,
7702 protocol_name:
7703 <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7704 }),
7705 }
7706 }
7707}
7708
7709pub struct DictionaryRouterRequestStream {
7711 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7712 is_terminated: bool,
7713}
7714
7715impl std::marker::Unpin for DictionaryRouterRequestStream {}
7716
7717impl futures::stream::FusedStream for DictionaryRouterRequestStream {
7718 fn is_terminated(&self) -> bool {
7719 self.is_terminated
7720 }
7721}
7722
7723impl fidl::endpoints::RequestStream for DictionaryRouterRequestStream {
7724 type Protocol = DictionaryRouterMarker;
7725 type ControlHandle = DictionaryRouterControlHandle;
7726
7727 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7728 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7729 }
7730
7731 fn control_handle(&self) -> Self::ControlHandle {
7732 DictionaryRouterControlHandle { inner: self.inner.clone() }
7733 }
7734
7735 fn into_inner(
7736 self,
7737 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7738 {
7739 (self.inner, self.is_terminated)
7740 }
7741
7742 fn from_inner(
7743 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7744 is_terminated: bool,
7745 ) -> Self {
7746 Self { inner, is_terminated }
7747 }
7748}
7749
7750impl futures::Stream for DictionaryRouterRequestStream {
7751 type Item = Result<DictionaryRouterRequest, fidl::Error>;
7752
7753 fn poll_next(
7754 mut self: std::pin::Pin<&mut Self>,
7755 cx: &mut std::task::Context<'_>,
7756 ) -> std::task::Poll<Option<Self::Item>> {
7757 let this = &mut *self;
7758 if this.inner.check_shutdown(cx) {
7759 this.is_terminated = true;
7760 return std::task::Poll::Ready(None);
7761 }
7762 if this.is_terminated {
7763 panic!("polled DictionaryRouterRequestStream after completion");
7764 }
7765 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7766 |bytes, handles| {
7767 match this.inner.channel().read_etc(cx, bytes, handles) {
7768 std::task::Poll::Ready(Ok(())) => {}
7769 std::task::Poll::Pending => return std::task::Poll::Pending,
7770 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7771 this.is_terminated = true;
7772 return std::task::Poll::Ready(None);
7773 }
7774 std::task::Poll::Ready(Err(e)) => {
7775 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7776 e.into(),
7777 ))));
7778 }
7779 }
7780
7781 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7783
7784 std::task::Poll::Ready(Some(match header.ordinal {
7785 0x714c65bfe54bd79f => {
7786 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7787 let mut req = fidl::new_empty!(
7788 RouteRequest,
7789 fidl::encoding::DefaultFuchsiaResourceDialect
7790 );
7791 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
7792 let control_handle =
7793 DictionaryRouterControlHandle { inner: this.inner.clone() };
7794 Ok(DictionaryRouterRequest::Route {
7795 payload: req,
7796 responder: DictionaryRouterRouteResponder {
7797 control_handle: std::mem::ManuallyDrop::new(control_handle),
7798 tx_id: header.tx_id,
7799 },
7800 })
7801 }
7802 _ if header.tx_id == 0
7803 && header
7804 .dynamic_flags()
7805 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7806 {
7807 Ok(DictionaryRouterRequest::_UnknownMethod {
7808 ordinal: header.ordinal,
7809 control_handle: DictionaryRouterControlHandle {
7810 inner: this.inner.clone(),
7811 },
7812 method_type: fidl::MethodType::OneWay,
7813 })
7814 }
7815 _ if header
7816 .dynamic_flags()
7817 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
7818 {
7819 this.inner.send_framework_err(
7820 fidl::encoding::FrameworkErr::UnknownMethod,
7821 header.tx_id,
7822 header.ordinal,
7823 header.dynamic_flags(),
7824 (bytes, handles),
7825 )?;
7826 Ok(DictionaryRouterRequest::_UnknownMethod {
7827 ordinal: header.ordinal,
7828 control_handle: DictionaryRouterControlHandle {
7829 inner: this.inner.clone(),
7830 },
7831 method_type: fidl::MethodType::TwoWay,
7832 })
7833 }
7834 _ => Err(fidl::Error::UnknownOrdinal {
7835 ordinal: header.ordinal,
7836 protocol_name:
7837 <DictionaryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7838 }),
7839 }))
7840 },
7841 )
7842 }
7843}
7844
7845#[derive(Debug)]
7846pub enum DictionaryRouterRequest {
7847 Route {
7848 payload: RouteRequest,
7849 responder: DictionaryRouterRouteResponder,
7850 },
7851 #[non_exhaustive]
7853 _UnknownMethod {
7854 ordinal: u64,
7856 control_handle: DictionaryRouterControlHandle,
7857 method_type: fidl::MethodType,
7858 },
7859}
7860
7861impl DictionaryRouterRequest {
7862 #[allow(irrefutable_let_patterns)]
7863 pub fn into_route(self) -> Option<(RouteRequest, DictionaryRouterRouteResponder)> {
7864 if let DictionaryRouterRequest::Route { payload, responder } = self {
7865 Some((payload, responder))
7866 } else {
7867 None
7868 }
7869 }
7870
7871 pub fn method_name(&self) -> &'static str {
7873 match *self {
7874 DictionaryRouterRequest::Route { .. } => "route",
7875 DictionaryRouterRequest::_UnknownMethod {
7876 method_type: fidl::MethodType::OneWay,
7877 ..
7878 } => "unknown one-way method",
7879 DictionaryRouterRequest::_UnknownMethod {
7880 method_type: fidl::MethodType::TwoWay,
7881 ..
7882 } => "unknown two-way method",
7883 }
7884 }
7885}
7886
7887#[derive(Debug, Clone)]
7888pub struct DictionaryRouterControlHandle {
7889 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7890}
7891
7892impl fidl::endpoints::ControlHandle for DictionaryRouterControlHandle {
7893 fn shutdown(&self) {
7894 self.inner.shutdown()
7895 }
7896
7897 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7898 self.inner.shutdown_with_epitaph(status)
7899 }
7900
7901 fn is_closed(&self) -> bool {
7902 self.inner.channel().is_closed()
7903 }
7904 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7905 self.inner.channel().on_closed()
7906 }
7907
7908 #[cfg(target_os = "fuchsia")]
7909 fn signal_peer(
7910 &self,
7911 clear_mask: zx::Signals,
7912 set_mask: zx::Signals,
7913 ) -> Result<(), zx_status::Status> {
7914 use fidl::Peered;
7915 self.inner.channel().signal_peer(clear_mask, set_mask)
7916 }
7917}
7918
7919impl DictionaryRouterControlHandle {}
7920
7921#[must_use = "FIDL methods require a response to be sent"]
7922#[derive(Debug)]
7923pub struct DictionaryRouterRouteResponder {
7924 control_handle: std::mem::ManuallyDrop<DictionaryRouterControlHandle>,
7925 tx_id: u32,
7926}
7927
7928impl std::ops::Drop for DictionaryRouterRouteResponder {
7932 fn drop(&mut self) {
7933 self.control_handle.shutdown();
7934 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7936 }
7937}
7938
7939impl fidl::endpoints::Responder for DictionaryRouterRouteResponder {
7940 type ControlHandle = DictionaryRouterControlHandle;
7941
7942 fn control_handle(&self) -> &DictionaryRouterControlHandle {
7943 &self.control_handle
7944 }
7945
7946 fn drop_without_shutdown(mut self) {
7947 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7949 std::mem::forget(self);
7951 }
7952}
7953
7954impl DictionaryRouterRouteResponder {
7955 pub fn send(
7959 self,
7960 mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7961 ) -> Result<(), fidl::Error> {
7962 let _result = self.send_raw(result);
7963 if _result.is_err() {
7964 self.control_handle.shutdown();
7965 }
7966 self.drop_without_shutdown();
7967 _result
7968 }
7969
7970 pub fn send_no_shutdown_on_err(
7972 self,
7973 mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7974 ) -> Result<(), fidl::Error> {
7975 let _result = self.send_raw(result);
7976 self.drop_without_shutdown();
7977 _result
7978 }
7979
7980 fn send_raw(
7981 &self,
7982 mut result: Result<DictionaryRouterRouteResponse, RouterError>,
7983 ) -> Result<(), fidl::Error> {
7984 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
7985 DictionaryRouterRouteResponse,
7986 RouterError,
7987 >>(
7988 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
7989 self.tx_id,
7990 0x714c65bfe54bd79f,
7991 fidl::encoding::DynamicFlags::FLEXIBLE,
7992 )
7993 }
7994}
7995
7996#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7997pub struct DirConnectorRouterMarker;
7998
7999impl fidl::endpoints::ProtocolMarker for DirConnectorRouterMarker {
8000 type Proxy = DirConnectorRouterProxy;
8001 type RequestStream = DirConnectorRouterRequestStream;
8002 #[cfg(target_os = "fuchsia")]
8003 type SynchronousProxy = DirConnectorRouterSynchronousProxy;
8004
8005 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirConnectorRouter";
8006}
8007impl fidl::endpoints::DiscoverableProtocolMarker for DirConnectorRouterMarker {}
8008pub type DirConnectorRouterRouteResult = Result<DirConnectorRouterRouteResponse, RouterError>;
8009
8010pub trait DirConnectorRouterProxyInterface: Send + Sync {
8011 type RouteResponseFut: std::future::Future<Output = Result<DirConnectorRouterRouteResult, fidl::Error>>
8012 + Send;
8013 fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8014}
8015#[derive(Debug)]
8016#[cfg(target_os = "fuchsia")]
8017pub struct DirConnectorRouterSynchronousProxy {
8018 client: fidl::client::sync::Client,
8019}
8020
8021#[cfg(target_os = "fuchsia")]
8022impl fidl::endpoints::SynchronousProxy for DirConnectorRouterSynchronousProxy {
8023 type Proxy = DirConnectorRouterProxy;
8024 type Protocol = DirConnectorRouterMarker;
8025
8026 fn from_channel(inner: fidl::Channel) -> Self {
8027 Self::new(inner)
8028 }
8029
8030 fn into_channel(self) -> fidl::Channel {
8031 self.client.into_channel()
8032 }
8033
8034 fn as_channel(&self) -> &fidl::Channel {
8035 self.client.as_channel()
8036 }
8037}
8038
8039#[cfg(target_os = "fuchsia")]
8040impl DirConnectorRouterSynchronousProxy {
8041 pub fn new(channel: fidl::Channel) -> Self {
8042 let protocol_name =
8043 <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8044 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8045 }
8046
8047 pub fn into_channel(self) -> fidl::Channel {
8048 self.client.into_channel()
8049 }
8050
8051 pub fn wait_for_event(
8054 &self,
8055 deadline: zx::MonotonicInstant,
8056 ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8057 DirConnectorRouterEvent::decode(self.client.wait_for_event(deadline)?)
8058 }
8059
8060 pub fn r#route(
8061 &self,
8062 mut payload: RouteRequest,
8063 ___deadline: zx::MonotonicInstant,
8064 ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8065 let _response = self.client.send_query::<
8066 RouteRequest,
8067 fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8068 >(
8069 &mut payload,
8070 0xd7e0f01da2c8e40,
8071 fidl::encoding::DynamicFlags::FLEXIBLE,
8072 ___deadline,
8073 )?
8074 .into_result::<DirConnectorRouterMarker>("route")?;
8075 Ok(_response.map(|x| x))
8076 }
8077}
8078
8079#[cfg(target_os = "fuchsia")]
8080impl From<DirConnectorRouterSynchronousProxy> for zx::NullableHandle {
8081 fn from(value: DirConnectorRouterSynchronousProxy) -> Self {
8082 value.into_channel().into()
8083 }
8084}
8085
8086#[cfg(target_os = "fuchsia")]
8087impl From<fidl::Channel> for DirConnectorRouterSynchronousProxy {
8088 fn from(value: fidl::Channel) -> Self {
8089 Self::new(value)
8090 }
8091}
8092
8093#[cfg(target_os = "fuchsia")]
8094impl fidl::endpoints::FromClient for DirConnectorRouterSynchronousProxy {
8095 type Protocol = DirConnectorRouterMarker;
8096
8097 fn from_client(value: fidl::endpoints::ClientEnd<DirConnectorRouterMarker>) -> Self {
8098 Self::new(value.into_channel())
8099 }
8100}
8101
8102#[derive(Debug, Clone)]
8103pub struct DirConnectorRouterProxy {
8104 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8105}
8106
8107impl fidl::endpoints::Proxy for DirConnectorRouterProxy {
8108 type Protocol = DirConnectorRouterMarker;
8109
8110 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8111 Self::new(inner)
8112 }
8113
8114 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8115 self.client.into_channel().map_err(|client| Self { client })
8116 }
8117
8118 fn as_channel(&self) -> &::fidl::AsyncChannel {
8119 self.client.as_channel()
8120 }
8121}
8122
8123impl DirConnectorRouterProxy {
8124 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8126 let protocol_name =
8127 <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8128 Self { client: fidl::client::Client::new(channel, protocol_name) }
8129 }
8130
8131 pub fn take_event_stream(&self) -> DirConnectorRouterEventStream {
8137 DirConnectorRouterEventStream { event_receiver: self.client.take_event_receiver() }
8138 }
8139
8140 pub fn r#route(
8141 &self,
8142 mut payload: RouteRequest,
8143 ) -> fidl::client::QueryResponseFut<
8144 DirConnectorRouterRouteResult,
8145 fidl::encoding::DefaultFuchsiaResourceDialect,
8146 > {
8147 DirConnectorRouterProxyInterface::r#route(self, payload)
8148 }
8149}
8150
8151impl DirConnectorRouterProxyInterface for DirConnectorRouterProxy {
8152 type RouteResponseFut = fidl::client::QueryResponseFut<
8153 DirConnectorRouterRouteResult,
8154 fidl::encoding::DefaultFuchsiaResourceDialect,
8155 >;
8156 fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8157 fn _decode(
8158 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8159 ) -> Result<DirConnectorRouterRouteResult, fidl::Error> {
8160 let _response = fidl::client::decode_transaction_body::<
8161 fidl::encoding::FlexibleResultType<DirConnectorRouterRouteResponse, RouterError>,
8162 fidl::encoding::DefaultFuchsiaResourceDialect,
8163 0xd7e0f01da2c8e40,
8164 >(_buf?)?
8165 .into_result::<DirConnectorRouterMarker>("route")?;
8166 Ok(_response.map(|x| x))
8167 }
8168 self.client.send_query_and_decode::<RouteRequest, DirConnectorRouterRouteResult>(
8169 &mut payload,
8170 0xd7e0f01da2c8e40,
8171 fidl::encoding::DynamicFlags::FLEXIBLE,
8172 _decode,
8173 )
8174 }
8175}
8176
8177pub struct DirConnectorRouterEventStream {
8178 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8179}
8180
8181impl std::marker::Unpin for DirConnectorRouterEventStream {}
8182
8183impl futures::stream::FusedStream for DirConnectorRouterEventStream {
8184 fn is_terminated(&self) -> bool {
8185 self.event_receiver.is_terminated()
8186 }
8187}
8188
8189impl futures::Stream for DirConnectorRouterEventStream {
8190 type Item = Result<DirConnectorRouterEvent, fidl::Error>;
8191
8192 fn poll_next(
8193 mut self: std::pin::Pin<&mut Self>,
8194 cx: &mut std::task::Context<'_>,
8195 ) -> std::task::Poll<Option<Self::Item>> {
8196 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8197 &mut self.event_receiver,
8198 cx
8199 )?) {
8200 Some(buf) => std::task::Poll::Ready(Some(DirConnectorRouterEvent::decode(buf))),
8201 None => std::task::Poll::Ready(None),
8202 }
8203 }
8204}
8205
8206#[derive(Debug)]
8207pub enum DirConnectorRouterEvent {
8208 #[non_exhaustive]
8209 _UnknownEvent {
8210 ordinal: u64,
8212 },
8213}
8214
8215impl DirConnectorRouterEvent {
8216 fn decode(
8218 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8219 ) -> Result<DirConnectorRouterEvent, fidl::Error> {
8220 let (bytes, _handles) = buf.split_mut();
8221 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8222 debug_assert_eq!(tx_header.tx_id, 0);
8223 match tx_header.ordinal {
8224 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8225 Ok(DirConnectorRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8226 }
8227 _ => Err(fidl::Error::UnknownOrdinal {
8228 ordinal: tx_header.ordinal,
8229 protocol_name:
8230 <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8231 }),
8232 }
8233 }
8234}
8235
8236pub struct DirConnectorRouterRequestStream {
8238 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8239 is_terminated: bool,
8240}
8241
8242impl std::marker::Unpin for DirConnectorRouterRequestStream {}
8243
8244impl futures::stream::FusedStream for DirConnectorRouterRequestStream {
8245 fn is_terminated(&self) -> bool {
8246 self.is_terminated
8247 }
8248}
8249
8250impl fidl::endpoints::RequestStream for DirConnectorRouterRequestStream {
8251 type Protocol = DirConnectorRouterMarker;
8252 type ControlHandle = DirConnectorRouterControlHandle;
8253
8254 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8255 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8256 }
8257
8258 fn control_handle(&self) -> Self::ControlHandle {
8259 DirConnectorRouterControlHandle { inner: self.inner.clone() }
8260 }
8261
8262 fn into_inner(
8263 self,
8264 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8265 {
8266 (self.inner, self.is_terminated)
8267 }
8268
8269 fn from_inner(
8270 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8271 is_terminated: bool,
8272 ) -> Self {
8273 Self { inner, is_terminated }
8274 }
8275}
8276
8277impl futures::Stream for DirConnectorRouterRequestStream {
8278 type Item = Result<DirConnectorRouterRequest, fidl::Error>;
8279
8280 fn poll_next(
8281 mut self: std::pin::Pin<&mut Self>,
8282 cx: &mut std::task::Context<'_>,
8283 ) -> std::task::Poll<Option<Self::Item>> {
8284 let this = &mut *self;
8285 if this.inner.check_shutdown(cx) {
8286 this.is_terminated = true;
8287 return std::task::Poll::Ready(None);
8288 }
8289 if this.is_terminated {
8290 panic!("polled DirConnectorRouterRequestStream after completion");
8291 }
8292 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8293 |bytes, handles| {
8294 match this.inner.channel().read_etc(cx, bytes, handles) {
8295 std::task::Poll::Ready(Ok(())) => {}
8296 std::task::Poll::Pending => return std::task::Poll::Pending,
8297 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8298 this.is_terminated = true;
8299 return std::task::Poll::Ready(None);
8300 }
8301 std::task::Poll::Ready(Err(e)) => {
8302 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8303 e.into(),
8304 ))));
8305 }
8306 }
8307
8308 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8310
8311 std::task::Poll::Ready(Some(match header.ordinal {
8312 0xd7e0f01da2c8e40 => {
8313 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8314 let mut req = fidl::new_empty!(RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
8315 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8316 let control_handle = DirConnectorRouterControlHandle {
8317 inner: this.inner.clone(),
8318 };
8319 Ok(DirConnectorRouterRequest::Route {payload: req,
8320 responder: DirConnectorRouterRouteResponder {
8321 control_handle: std::mem::ManuallyDrop::new(control_handle),
8322 tx_id: header.tx_id,
8323 },
8324 })
8325 }
8326 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8327 Ok(DirConnectorRouterRequest::_UnknownMethod {
8328 ordinal: header.ordinal,
8329 control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8330 method_type: fidl::MethodType::OneWay,
8331 })
8332 }
8333 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8334 this.inner.send_framework_err(
8335 fidl::encoding::FrameworkErr::UnknownMethod,
8336 header.tx_id,
8337 header.ordinal,
8338 header.dynamic_flags(),
8339 (bytes, handles),
8340 )?;
8341 Ok(DirConnectorRouterRequest::_UnknownMethod {
8342 ordinal: header.ordinal,
8343 control_handle: DirConnectorRouterControlHandle { inner: this.inner.clone() },
8344 method_type: fidl::MethodType::TwoWay,
8345 })
8346 }
8347 _ => Err(fidl::Error::UnknownOrdinal {
8348 ordinal: header.ordinal,
8349 protocol_name: <DirConnectorRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8350 }),
8351 }))
8352 },
8353 )
8354 }
8355}
8356
8357#[derive(Debug)]
8358pub enum DirConnectorRouterRequest {
8359 Route {
8360 payload: RouteRequest,
8361 responder: DirConnectorRouterRouteResponder,
8362 },
8363 #[non_exhaustive]
8365 _UnknownMethod {
8366 ordinal: u64,
8368 control_handle: DirConnectorRouterControlHandle,
8369 method_type: fidl::MethodType,
8370 },
8371}
8372
8373impl DirConnectorRouterRequest {
8374 #[allow(irrefutable_let_patterns)]
8375 pub fn into_route(self) -> Option<(RouteRequest, DirConnectorRouterRouteResponder)> {
8376 if let DirConnectorRouterRequest::Route { payload, responder } = self {
8377 Some((payload, responder))
8378 } else {
8379 None
8380 }
8381 }
8382
8383 pub fn method_name(&self) -> &'static str {
8385 match *self {
8386 DirConnectorRouterRequest::Route { .. } => "route",
8387 DirConnectorRouterRequest::_UnknownMethod {
8388 method_type: fidl::MethodType::OneWay,
8389 ..
8390 } => "unknown one-way method",
8391 DirConnectorRouterRequest::_UnknownMethod {
8392 method_type: fidl::MethodType::TwoWay,
8393 ..
8394 } => "unknown two-way method",
8395 }
8396 }
8397}
8398
8399#[derive(Debug, Clone)]
8400pub struct DirConnectorRouterControlHandle {
8401 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8402}
8403
8404impl fidl::endpoints::ControlHandle for DirConnectorRouterControlHandle {
8405 fn shutdown(&self) {
8406 self.inner.shutdown()
8407 }
8408
8409 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8410 self.inner.shutdown_with_epitaph(status)
8411 }
8412
8413 fn is_closed(&self) -> bool {
8414 self.inner.channel().is_closed()
8415 }
8416 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8417 self.inner.channel().on_closed()
8418 }
8419
8420 #[cfg(target_os = "fuchsia")]
8421 fn signal_peer(
8422 &self,
8423 clear_mask: zx::Signals,
8424 set_mask: zx::Signals,
8425 ) -> Result<(), zx_status::Status> {
8426 use fidl::Peered;
8427 self.inner.channel().signal_peer(clear_mask, set_mask)
8428 }
8429}
8430
8431impl DirConnectorRouterControlHandle {}
8432
8433#[must_use = "FIDL methods require a response to be sent"]
8434#[derive(Debug)]
8435pub struct DirConnectorRouterRouteResponder {
8436 control_handle: std::mem::ManuallyDrop<DirConnectorRouterControlHandle>,
8437 tx_id: u32,
8438}
8439
8440impl std::ops::Drop for DirConnectorRouterRouteResponder {
8444 fn drop(&mut self) {
8445 self.control_handle.shutdown();
8446 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8448 }
8449}
8450
8451impl fidl::endpoints::Responder for DirConnectorRouterRouteResponder {
8452 type ControlHandle = DirConnectorRouterControlHandle;
8453
8454 fn control_handle(&self) -> &DirConnectorRouterControlHandle {
8455 &self.control_handle
8456 }
8457
8458 fn drop_without_shutdown(mut self) {
8459 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8461 std::mem::forget(self);
8463 }
8464}
8465
8466impl DirConnectorRouterRouteResponder {
8467 pub fn send(
8471 self,
8472 mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8473 ) -> Result<(), fidl::Error> {
8474 let _result = self.send_raw(result);
8475 if _result.is_err() {
8476 self.control_handle.shutdown();
8477 }
8478 self.drop_without_shutdown();
8479 _result
8480 }
8481
8482 pub fn send_no_shutdown_on_err(
8484 self,
8485 mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8486 ) -> Result<(), fidl::Error> {
8487 let _result = self.send_raw(result);
8488 self.drop_without_shutdown();
8489 _result
8490 }
8491
8492 fn send_raw(
8493 &self,
8494 mut result: Result<DirConnectorRouterRouteResponse, RouterError>,
8495 ) -> Result<(), fidl::Error> {
8496 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
8497 DirConnectorRouterRouteResponse,
8498 RouterError,
8499 >>(
8500 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
8501 self.tx_id,
8502 0xd7e0f01da2c8e40,
8503 fidl::encoding::DynamicFlags::FLEXIBLE,
8504 )
8505 }
8506}
8507
8508#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8509pub struct DirEntryRouterMarker;
8510
8511impl fidl::endpoints::ProtocolMarker for DirEntryRouterMarker {
8512 type Proxy = DirEntryRouterProxy;
8513 type RequestStream = DirEntryRouterRequestStream;
8514 #[cfg(target_os = "fuchsia")]
8515 type SynchronousProxy = DirEntryRouterSynchronousProxy;
8516
8517 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirEntryRouter";
8518}
8519impl fidl::endpoints::DiscoverableProtocolMarker for DirEntryRouterMarker {}
8520pub type DirEntryRouterRouteResult = Result<DirEntryRouterRouteResponse, RouterError>;
8521
8522pub trait DirEntryRouterProxyInterface: Send + Sync {
8523 type RouteResponseFut: std::future::Future<Output = Result<DirEntryRouterRouteResult, fidl::Error>>
8524 + Send;
8525 fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
8526}
8527#[derive(Debug)]
8528#[cfg(target_os = "fuchsia")]
8529pub struct DirEntryRouterSynchronousProxy {
8530 client: fidl::client::sync::Client,
8531}
8532
8533#[cfg(target_os = "fuchsia")]
8534impl fidl::endpoints::SynchronousProxy for DirEntryRouterSynchronousProxy {
8535 type Proxy = DirEntryRouterProxy;
8536 type Protocol = DirEntryRouterMarker;
8537
8538 fn from_channel(inner: fidl::Channel) -> Self {
8539 Self::new(inner)
8540 }
8541
8542 fn into_channel(self) -> fidl::Channel {
8543 self.client.into_channel()
8544 }
8545
8546 fn as_channel(&self) -> &fidl::Channel {
8547 self.client.as_channel()
8548 }
8549}
8550
8551#[cfg(target_os = "fuchsia")]
8552impl DirEntryRouterSynchronousProxy {
8553 pub fn new(channel: fidl::Channel) -> Self {
8554 let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8555 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8556 }
8557
8558 pub fn into_channel(self) -> fidl::Channel {
8559 self.client.into_channel()
8560 }
8561
8562 pub fn wait_for_event(
8565 &self,
8566 deadline: zx::MonotonicInstant,
8567 ) -> Result<DirEntryRouterEvent, fidl::Error> {
8568 DirEntryRouterEvent::decode(self.client.wait_for_event(deadline)?)
8569 }
8570
8571 pub fn r#route(
8572 &self,
8573 mut payload: RouteRequest,
8574 ___deadline: zx::MonotonicInstant,
8575 ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8576 let _response = self.client.send_query::<
8577 RouteRequest,
8578 fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8579 >(
8580 &mut payload,
8581 0x1ac694001c208bd2,
8582 fidl::encoding::DynamicFlags::FLEXIBLE,
8583 ___deadline,
8584 )?
8585 .into_result::<DirEntryRouterMarker>("route")?;
8586 Ok(_response.map(|x| x))
8587 }
8588}
8589
8590#[cfg(target_os = "fuchsia")]
8591impl From<DirEntryRouterSynchronousProxy> for zx::NullableHandle {
8592 fn from(value: DirEntryRouterSynchronousProxy) -> Self {
8593 value.into_channel().into()
8594 }
8595}
8596
8597#[cfg(target_os = "fuchsia")]
8598impl From<fidl::Channel> for DirEntryRouterSynchronousProxy {
8599 fn from(value: fidl::Channel) -> Self {
8600 Self::new(value)
8601 }
8602}
8603
8604#[cfg(target_os = "fuchsia")]
8605impl fidl::endpoints::FromClient for DirEntryRouterSynchronousProxy {
8606 type Protocol = DirEntryRouterMarker;
8607
8608 fn from_client(value: fidl::endpoints::ClientEnd<DirEntryRouterMarker>) -> Self {
8609 Self::new(value.into_channel())
8610 }
8611}
8612
8613#[derive(Debug, Clone)]
8614pub struct DirEntryRouterProxy {
8615 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8616}
8617
8618impl fidl::endpoints::Proxy for DirEntryRouterProxy {
8619 type Protocol = DirEntryRouterMarker;
8620
8621 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8622 Self::new(inner)
8623 }
8624
8625 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8626 self.client.into_channel().map_err(|client| Self { client })
8627 }
8628
8629 fn as_channel(&self) -> &::fidl::AsyncChannel {
8630 self.client.as_channel()
8631 }
8632}
8633
8634impl DirEntryRouterProxy {
8635 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8637 let protocol_name = <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8638 Self { client: fidl::client::Client::new(channel, protocol_name) }
8639 }
8640
8641 pub fn take_event_stream(&self) -> DirEntryRouterEventStream {
8647 DirEntryRouterEventStream { event_receiver: self.client.take_event_receiver() }
8648 }
8649
8650 pub fn r#route(
8651 &self,
8652 mut payload: RouteRequest,
8653 ) -> fidl::client::QueryResponseFut<
8654 DirEntryRouterRouteResult,
8655 fidl::encoding::DefaultFuchsiaResourceDialect,
8656 > {
8657 DirEntryRouterProxyInterface::r#route(self, payload)
8658 }
8659}
8660
8661impl DirEntryRouterProxyInterface for DirEntryRouterProxy {
8662 type RouteResponseFut = fidl::client::QueryResponseFut<
8663 DirEntryRouterRouteResult,
8664 fidl::encoding::DefaultFuchsiaResourceDialect,
8665 >;
8666 fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
8667 fn _decode(
8668 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8669 ) -> Result<DirEntryRouterRouteResult, fidl::Error> {
8670 let _response = fidl::client::decode_transaction_body::<
8671 fidl::encoding::FlexibleResultType<DirEntryRouterRouteResponse, RouterError>,
8672 fidl::encoding::DefaultFuchsiaResourceDialect,
8673 0x1ac694001c208bd2,
8674 >(_buf?)?
8675 .into_result::<DirEntryRouterMarker>("route")?;
8676 Ok(_response.map(|x| x))
8677 }
8678 self.client.send_query_and_decode::<RouteRequest, DirEntryRouterRouteResult>(
8679 &mut payload,
8680 0x1ac694001c208bd2,
8681 fidl::encoding::DynamicFlags::FLEXIBLE,
8682 _decode,
8683 )
8684 }
8685}
8686
8687pub struct DirEntryRouterEventStream {
8688 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8689}
8690
8691impl std::marker::Unpin for DirEntryRouterEventStream {}
8692
8693impl futures::stream::FusedStream for DirEntryRouterEventStream {
8694 fn is_terminated(&self) -> bool {
8695 self.event_receiver.is_terminated()
8696 }
8697}
8698
8699impl futures::Stream for DirEntryRouterEventStream {
8700 type Item = Result<DirEntryRouterEvent, fidl::Error>;
8701
8702 fn poll_next(
8703 mut self: std::pin::Pin<&mut Self>,
8704 cx: &mut std::task::Context<'_>,
8705 ) -> std::task::Poll<Option<Self::Item>> {
8706 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8707 &mut self.event_receiver,
8708 cx
8709 )?) {
8710 Some(buf) => std::task::Poll::Ready(Some(DirEntryRouterEvent::decode(buf))),
8711 None => std::task::Poll::Ready(None),
8712 }
8713 }
8714}
8715
8716#[derive(Debug)]
8717pub enum DirEntryRouterEvent {
8718 #[non_exhaustive]
8719 _UnknownEvent {
8720 ordinal: u64,
8722 },
8723}
8724
8725impl DirEntryRouterEvent {
8726 fn decode(
8728 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8729 ) -> Result<DirEntryRouterEvent, fidl::Error> {
8730 let (bytes, _handles) = buf.split_mut();
8731 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8732 debug_assert_eq!(tx_header.tx_id, 0);
8733 match tx_header.ordinal {
8734 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
8735 Ok(DirEntryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
8736 }
8737 _ => Err(fidl::Error::UnknownOrdinal {
8738 ordinal: tx_header.ordinal,
8739 protocol_name:
8740 <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8741 }),
8742 }
8743 }
8744}
8745
8746pub struct DirEntryRouterRequestStream {
8748 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8749 is_terminated: bool,
8750}
8751
8752impl std::marker::Unpin for DirEntryRouterRequestStream {}
8753
8754impl futures::stream::FusedStream for DirEntryRouterRequestStream {
8755 fn is_terminated(&self) -> bool {
8756 self.is_terminated
8757 }
8758}
8759
8760impl fidl::endpoints::RequestStream for DirEntryRouterRequestStream {
8761 type Protocol = DirEntryRouterMarker;
8762 type ControlHandle = DirEntryRouterControlHandle;
8763
8764 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8765 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8766 }
8767
8768 fn control_handle(&self) -> Self::ControlHandle {
8769 DirEntryRouterControlHandle { inner: self.inner.clone() }
8770 }
8771
8772 fn into_inner(
8773 self,
8774 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8775 {
8776 (self.inner, self.is_terminated)
8777 }
8778
8779 fn from_inner(
8780 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8781 is_terminated: bool,
8782 ) -> Self {
8783 Self { inner, is_terminated }
8784 }
8785}
8786
8787impl futures::Stream for DirEntryRouterRequestStream {
8788 type Item = Result<DirEntryRouterRequest, fidl::Error>;
8789
8790 fn poll_next(
8791 mut self: std::pin::Pin<&mut Self>,
8792 cx: &mut std::task::Context<'_>,
8793 ) -> std::task::Poll<Option<Self::Item>> {
8794 let this = &mut *self;
8795 if this.inner.check_shutdown(cx) {
8796 this.is_terminated = true;
8797 return std::task::Poll::Ready(None);
8798 }
8799 if this.is_terminated {
8800 panic!("polled DirEntryRouterRequestStream after completion");
8801 }
8802 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8803 |bytes, handles| {
8804 match this.inner.channel().read_etc(cx, bytes, handles) {
8805 std::task::Poll::Ready(Ok(())) => {}
8806 std::task::Poll::Pending => return std::task::Poll::Pending,
8807 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8808 this.is_terminated = true;
8809 return std::task::Poll::Ready(None);
8810 }
8811 std::task::Poll::Ready(Err(e)) => {
8812 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8813 e.into(),
8814 ))));
8815 }
8816 }
8817
8818 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8820
8821 std::task::Poll::Ready(Some(match header.ordinal {
8822 0x1ac694001c208bd2 => {
8823 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8824 let mut req = fidl::new_empty!(
8825 RouteRequest,
8826 fidl::encoding::DefaultFuchsiaResourceDialect
8827 );
8828 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
8829 let control_handle =
8830 DirEntryRouterControlHandle { inner: this.inner.clone() };
8831 Ok(DirEntryRouterRequest::Route {
8832 payload: req,
8833 responder: DirEntryRouterRouteResponder {
8834 control_handle: std::mem::ManuallyDrop::new(control_handle),
8835 tx_id: header.tx_id,
8836 },
8837 })
8838 }
8839 _ if header.tx_id == 0
8840 && header
8841 .dynamic_flags()
8842 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8843 {
8844 Ok(DirEntryRouterRequest::_UnknownMethod {
8845 ordinal: header.ordinal,
8846 control_handle: DirEntryRouterControlHandle {
8847 inner: this.inner.clone(),
8848 },
8849 method_type: fidl::MethodType::OneWay,
8850 })
8851 }
8852 _ if header
8853 .dynamic_flags()
8854 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
8855 {
8856 this.inner.send_framework_err(
8857 fidl::encoding::FrameworkErr::UnknownMethod,
8858 header.tx_id,
8859 header.ordinal,
8860 header.dynamic_flags(),
8861 (bytes, handles),
8862 )?;
8863 Ok(DirEntryRouterRequest::_UnknownMethod {
8864 ordinal: header.ordinal,
8865 control_handle: DirEntryRouterControlHandle {
8866 inner: this.inner.clone(),
8867 },
8868 method_type: fidl::MethodType::TwoWay,
8869 })
8870 }
8871 _ => Err(fidl::Error::UnknownOrdinal {
8872 ordinal: header.ordinal,
8873 protocol_name:
8874 <DirEntryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8875 }),
8876 }))
8877 },
8878 )
8879 }
8880}
8881
8882#[derive(Debug)]
8883pub enum DirEntryRouterRequest {
8884 Route {
8885 payload: RouteRequest,
8886 responder: DirEntryRouterRouteResponder,
8887 },
8888 #[non_exhaustive]
8890 _UnknownMethod {
8891 ordinal: u64,
8893 control_handle: DirEntryRouterControlHandle,
8894 method_type: fidl::MethodType,
8895 },
8896}
8897
8898impl DirEntryRouterRequest {
8899 #[allow(irrefutable_let_patterns)]
8900 pub fn into_route(self) -> Option<(RouteRequest, DirEntryRouterRouteResponder)> {
8901 if let DirEntryRouterRequest::Route { payload, responder } = self {
8902 Some((payload, responder))
8903 } else {
8904 None
8905 }
8906 }
8907
8908 pub fn method_name(&self) -> &'static str {
8910 match *self {
8911 DirEntryRouterRequest::Route { .. } => "route",
8912 DirEntryRouterRequest::_UnknownMethod {
8913 method_type: fidl::MethodType::OneWay, ..
8914 } => "unknown one-way method",
8915 DirEntryRouterRequest::_UnknownMethod {
8916 method_type: fidl::MethodType::TwoWay, ..
8917 } => "unknown two-way method",
8918 }
8919 }
8920}
8921
8922#[derive(Debug, Clone)]
8923pub struct DirEntryRouterControlHandle {
8924 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8925}
8926
8927impl fidl::endpoints::ControlHandle for DirEntryRouterControlHandle {
8928 fn shutdown(&self) {
8929 self.inner.shutdown()
8930 }
8931
8932 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8933 self.inner.shutdown_with_epitaph(status)
8934 }
8935
8936 fn is_closed(&self) -> bool {
8937 self.inner.channel().is_closed()
8938 }
8939 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8940 self.inner.channel().on_closed()
8941 }
8942
8943 #[cfg(target_os = "fuchsia")]
8944 fn signal_peer(
8945 &self,
8946 clear_mask: zx::Signals,
8947 set_mask: zx::Signals,
8948 ) -> Result<(), zx_status::Status> {
8949 use fidl::Peered;
8950 self.inner.channel().signal_peer(clear_mask, set_mask)
8951 }
8952}
8953
8954impl DirEntryRouterControlHandle {}
8955
8956#[must_use = "FIDL methods require a response to be sent"]
8957#[derive(Debug)]
8958pub struct DirEntryRouterRouteResponder {
8959 control_handle: std::mem::ManuallyDrop<DirEntryRouterControlHandle>,
8960 tx_id: u32,
8961}
8962
8963impl std::ops::Drop for DirEntryRouterRouteResponder {
8967 fn drop(&mut self) {
8968 self.control_handle.shutdown();
8969 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8971 }
8972}
8973
8974impl fidl::endpoints::Responder for DirEntryRouterRouteResponder {
8975 type ControlHandle = DirEntryRouterControlHandle;
8976
8977 fn control_handle(&self) -> &DirEntryRouterControlHandle {
8978 &self.control_handle
8979 }
8980
8981 fn drop_without_shutdown(mut self) {
8982 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8984 std::mem::forget(self);
8986 }
8987}
8988
8989impl DirEntryRouterRouteResponder {
8990 pub fn send(
8994 self,
8995 mut result: Result<DirEntryRouterRouteResponse, RouterError>,
8996 ) -> Result<(), fidl::Error> {
8997 let _result = self.send_raw(result);
8998 if _result.is_err() {
8999 self.control_handle.shutdown();
9000 }
9001 self.drop_without_shutdown();
9002 _result
9003 }
9004
9005 pub fn send_no_shutdown_on_err(
9007 self,
9008 mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9009 ) -> Result<(), fidl::Error> {
9010 let _result = self.send_raw(result);
9011 self.drop_without_shutdown();
9012 _result
9013 }
9014
9015 fn send_raw(
9016 &self,
9017 mut result: Result<DirEntryRouterRouteResponse, RouterError>,
9018 ) -> Result<(), fidl::Error> {
9019 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9020 DirEntryRouterRouteResponse,
9021 RouterError,
9022 >>(
9023 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9024 self.tx_id,
9025 0x1ac694001c208bd2,
9026 fidl::encoding::DynamicFlags::FLEXIBLE,
9027 )
9028 }
9029}
9030
9031#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9032pub struct DirReceiverMarker;
9033
9034impl fidl::endpoints::ProtocolMarker for DirReceiverMarker {
9035 type Proxy = DirReceiverProxy;
9036 type RequestStream = DirReceiverRequestStream;
9037 #[cfg(target_os = "fuchsia")]
9038 type SynchronousProxy = DirReceiverSynchronousProxy;
9039
9040 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirReceiver";
9041}
9042impl fidl::endpoints::DiscoverableProtocolMarker for DirReceiverMarker {}
9043
9044pub trait DirReceiverProxyInterface: Send + Sync {
9045 fn r#receive(&self, payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error>;
9046}
9047#[derive(Debug)]
9048#[cfg(target_os = "fuchsia")]
9049pub struct DirReceiverSynchronousProxy {
9050 client: fidl::client::sync::Client,
9051}
9052
9053#[cfg(target_os = "fuchsia")]
9054impl fidl::endpoints::SynchronousProxy for DirReceiverSynchronousProxy {
9055 type Proxy = DirReceiverProxy;
9056 type Protocol = DirReceiverMarker;
9057
9058 fn from_channel(inner: fidl::Channel) -> Self {
9059 Self::new(inner)
9060 }
9061
9062 fn into_channel(self) -> fidl::Channel {
9063 self.client.into_channel()
9064 }
9065
9066 fn as_channel(&self) -> &fidl::Channel {
9067 self.client.as_channel()
9068 }
9069}
9070
9071#[cfg(target_os = "fuchsia")]
9072impl DirReceiverSynchronousProxy {
9073 pub fn new(channel: fidl::Channel) -> Self {
9074 let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9075 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9076 }
9077
9078 pub fn into_channel(self) -> fidl::Channel {
9079 self.client.into_channel()
9080 }
9081
9082 pub fn wait_for_event(
9085 &self,
9086 deadline: zx::MonotonicInstant,
9087 ) -> Result<DirReceiverEvent, fidl::Error> {
9088 DirReceiverEvent::decode(self.client.wait_for_event(deadline)?)
9089 }
9090
9091 pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9096 self.client.send::<DirReceiverReceiveRequest>(
9097 &mut payload,
9098 0xcdc3e9b89fe7bb4,
9099 fidl::encoding::DynamicFlags::FLEXIBLE,
9100 )
9101 }
9102}
9103
9104#[cfg(target_os = "fuchsia")]
9105impl From<DirReceiverSynchronousProxy> for zx::NullableHandle {
9106 fn from(value: DirReceiverSynchronousProxy) -> Self {
9107 value.into_channel().into()
9108 }
9109}
9110
9111#[cfg(target_os = "fuchsia")]
9112impl From<fidl::Channel> for DirReceiverSynchronousProxy {
9113 fn from(value: fidl::Channel) -> Self {
9114 Self::new(value)
9115 }
9116}
9117
9118#[cfg(target_os = "fuchsia")]
9119impl fidl::endpoints::FromClient for DirReceiverSynchronousProxy {
9120 type Protocol = DirReceiverMarker;
9121
9122 fn from_client(value: fidl::endpoints::ClientEnd<DirReceiverMarker>) -> Self {
9123 Self::new(value.into_channel())
9124 }
9125}
9126
9127#[derive(Debug, Clone)]
9128pub struct DirReceiverProxy {
9129 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9130}
9131
9132impl fidl::endpoints::Proxy for DirReceiverProxy {
9133 type Protocol = DirReceiverMarker;
9134
9135 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9136 Self::new(inner)
9137 }
9138
9139 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9140 self.client.into_channel().map_err(|client| Self { client })
9141 }
9142
9143 fn as_channel(&self) -> &::fidl::AsyncChannel {
9144 self.client.as_channel()
9145 }
9146}
9147
9148impl DirReceiverProxy {
9149 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9151 let protocol_name = <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9152 Self { client: fidl::client::Client::new(channel, protocol_name) }
9153 }
9154
9155 pub fn take_event_stream(&self) -> DirReceiverEventStream {
9161 DirReceiverEventStream { event_receiver: self.client.take_event_receiver() }
9162 }
9163
9164 pub fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9169 DirReceiverProxyInterface::r#receive(self, payload)
9170 }
9171}
9172
9173impl DirReceiverProxyInterface for DirReceiverProxy {
9174 fn r#receive(&self, mut payload: DirReceiverReceiveRequest) -> Result<(), fidl::Error> {
9175 self.client.send::<DirReceiverReceiveRequest>(
9176 &mut payload,
9177 0xcdc3e9b89fe7bb4,
9178 fidl::encoding::DynamicFlags::FLEXIBLE,
9179 )
9180 }
9181}
9182
9183pub struct DirReceiverEventStream {
9184 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9185}
9186
9187impl std::marker::Unpin for DirReceiverEventStream {}
9188
9189impl futures::stream::FusedStream for DirReceiverEventStream {
9190 fn is_terminated(&self) -> bool {
9191 self.event_receiver.is_terminated()
9192 }
9193}
9194
9195impl futures::Stream for DirReceiverEventStream {
9196 type Item = Result<DirReceiverEvent, fidl::Error>;
9197
9198 fn poll_next(
9199 mut self: std::pin::Pin<&mut Self>,
9200 cx: &mut std::task::Context<'_>,
9201 ) -> std::task::Poll<Option<Self::Item>> {
9202 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9203 &mut self.event_receiver,
9204 cx
9205 )?) {
9206 Some(buf) => std::task::Poll::Ready(Some(DirReceiverEvent::decode(buf))),
9207 None => std::task::Poll::Ready(None),
9208 }
9209 }
9210}
9211
9212#[derive(Debug)]
9213pub enum DirReceiverEvent {
9214 #[non_exhaustive]
9215 _UnknownEvent {
9216 ordinal: u64,
9218 },
9219}
9220
9221impl DirReceiverEvent {
9222 fn decode(
9224 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9225 ) -> Result<DirReceiverEvent, fidl::Error> {
9226 let (bytes, _handles) = buf.split_mut();
9227 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9228 debug_assert_eq!(tx_header.tx_id, 0);
9229 match tx_header.ordinal {
9230 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9231 Ok(DirReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9232 }
9233 _ => Err(fidl::Error::UnknownOrdinal {
9234 ordinal: tx_header.ordinal,
9235 protocol_name: <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9236 }),
9237 }
9238 }
9239}
9240
9241pub struct DirReceiverRequestStream {
9243 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9244 is_terminated: bool,
9245}
9246
9247impl std::marker::Unpin for DirReceiverRequestStream {}
9248
9249impl futures::stream::FusedStream for DirReceiverRequestStream {
9250 fn is_terminated(&self) -> bool {
9251 self.is_terminated
9252 }
9253}
9254
9255impl fidl::endpoints::RequestStream for DirReceiverRequestStream {
9256 type Protocol = DirReceiverMarker;
9257 type ControlHandle = DirReceiverControlHandle;
9258
9259 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9260 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9261 }
9262
9263 fn control_handle(&self) -> Self::ControlHandle {
9264 DirReceiverControlHandle { inner: self.inner.clone() }
9265 }
9266
9267 fn into_inner(
9268 self,
9269 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9270 {
9271 (self.inner, self.is_terminated)
9272 }
9273
9274 fn from_inner(
9275 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9276 is_terminated: bool,
9277 ) -> Self {
9278 Self { inner, is_terminated }
9279 }
9280}
9281
9282impl futures::Stream for DirReceiverRequestStream {
9283 type Item = Result<DirReceiverRequest, fidl::Error>;
9284
9285 fn poll_next(
9286 mut self: std::pin::Pin<&mut Self>,
9287 cx: &mut std::task::Context<'_>,
9288 ) -> std::task::Poll<Option<Self::Item>> {
9289 let this = &mut *self;
9290 if this.inner.check_shutdown(cx) {
9291 this.is_terminated = true;
9292 return std::task::Poll::Ready(None);
9293 }
9294 if this.is_terminated {
9295 panic!("polled DirReceiverRequestStream after completion");
9296 }
9297 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9298 |bytes, handles| {
9299 match this.inner.channel().read_etc(cx, bytes, handles) {
9300 std::task::Poll::Ready(Ok(())) => {}
9301 std::task::Poll::Pending => return std::task::Poll::Pending,
9302 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9303 this.is_terminated = true;
9304 return std::task::Poll::Ready(None);
9305 }
9306 std::task::Poll::Ready(Err(e)) => {
9307 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9308 e.into(),
9309 ))));
9310 }
9311 }
9312
9313 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9315
9316 std::task::Poll::Ready(Some(match header.ordinal {
9317 0xcdc3e9b89fe7bb4 => {
9318 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
9319 let mut req = fidl::new_empty!(
9320 DirReceiverReceiveRequest,
9321 fidl::encoding::DefaultFuchsiaResourceDialect
9322 );
9323 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DirReceiverReceiveRequest>(&header, _body_bytes, handles, &mut req)?;
9324 let control_handle = DirReceiverControlHandle { inner: this.inner.clone() };
9325 Ok(DirReceiverRequest::Receive { payload: req, control_handle })
9326 }
9327 _ if header.tx_id == 0
9328 && header
9329 .dynamic_flags()
9330 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9331 {
9332 Ok(DirReceiverRequest::_UnknownMethod {
9333 ordinal: header.ordinal,
9334 control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9335 method_type: fidl::MethodType::OneWay,
9336 })
9337 }
9338 _ if header
9339 .dynamic_flags()
9340 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9341 {
9342 this.inner.send_framework_err(
9343 fidl::encoding::FrameworkErr::UnknownMethod,
9344 header.tx_id,
9345 header.ordinal,
9346 header.dynamic_flags(),
9347 (bytes, handles),
9348 )?;
9349 Ok(DirReceiverRequest::_UnknownMethod {
9350 ordinal: header.ordinal,
9351 control_handle: DirReceiverControlHandle { inner: this.inner.clone() },
9352 method_type: fidl::MethodType::TwoWay,
9353 })
9354 }
9355 _ => Err(fidl::Error::UnknownOrdinal {
9356 ordinal: header.ordinal,
9357 protocol_name:
9358 <DirReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9359 }),
9360 }))
9361 },
9362 )
9363 }
9364}
9365
9366#[derive(Debug)]
9369pub enum DirReceiverRequest {
9370 Receive { payload: DirReceiverReceiveRequest, control_handle: DirReceiverControlHandle },
9375 #[non_exhaustive]
9377 _UnknownMethod {
9378 ordinal: u64,
9380 control_handle: DirReceiverControlHandle,
9381 method_type: fidl::MethodType,
9382 },
9383}
9384
9385impl DirReceiverRequest {
9386 #[allow(irrefutable_let_patterns)]
9387 pub fn into_receive(self) -> Option<(DirReceiverReceiveRequest, DirReceiverControlHandle)> {
9388 if let DirReceiverRequest::Receive { payload, control_handle } = self {
9389 Some((payload, control_handle))
9390 } else {
9391 None
9392 }
9393 }
9394
9395 pub fn method_name(&self) -> &'static str {
9397 match *self {
9398 DirReceiverRequest::Receive { .. } => "receive",
9399 DirReceiverRequest::_UnknownMethod {
9400 method_type: fidl::MethodType::OneWay, ..
9401 } => "unknown one-way method",
9402 DirReceiverRequest::_UnknownMethod {
9403 method_type: fidl::MethodType::TwoWay, ..
9404 } => "unknown two-way method",
9405 }
9406 }
9407}
9408
9409#[derive(Debug, Clone)]
9410pub struct DirReceiverControlHandle {
9411 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9412}
9413
9414impl fidl::endpoints::ControlHandle for DirReceiverControlHandle {
9415 fn shutdown(&self) {
9416 self.inner.shutdown()
9417 }
9418
9419 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9420 self.inner.shutdown_with_epitaph(status)
9421 }
9422
9423 fn is_closed(&self) -> bool {
9424 self.inner.channel().is_closed()
9425 }
9426 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9427 self.inner.channel().on_closed()
9428 }
9429
9430 #[cfg(target_os = "fuchsia")]
9431 fn signal_peer(
9432 &self,
9433 clear_mask: zx::Signals,
9434 set_mask: zx::Signals,
9435 ) -> Result<(), zx_status::Status> {
9436 use fidl::Peered;
9437 self.inner.channel().signal_peer(clear_mask, set_mask)
9438 }
9439}
9440
9441impl DirReceiverControlHandle {}
9442
9443#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9444pub struct DirectoryRouterMarker;
9445
9446impl fidl::endpoints::ProtocolMarker for DirectoryRouterMarker {
9447 type Proxy = DirectoryRouterProxy;
9448 type RequestStream = DirectoryRouterRequestStream;
9449 #[cfg(target_os = "fuchsia")]
9450 type SynchronousProxy = DirectoryRouterSynchronousProxy;
9451
9452 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.DirectoryRouter";
9453}
9454impl fidl::endpoints::DiscoverableProtocolMarker for DirectoryRouterMarker {}
9455pub type DirectoryRouterRouteResult = Result<DirectoryRouterRouteResponse, RouterError>;
9456
9457pub trait DirectoryRouterProxyInterface: Send + Sync {
9458 type RouteResponseFut: std::future::Future<Output = Result<DirectoryRouterRouteResult, fidl::Error>>
9459 + Send;
9460 fn r#route(&self, payload: RouteRequest) -> Self::RouteResponseFut;
9461}
9462#[derive(Debug)]
9463#[cfg(target_os = "fuchsia")]
9464pub struct DirectoryRouterSynchronousProxy {
9465 client: fidl::client::sync::Client,
9466}
9467
9468#[cfg(target_os = "fuchsia")]
9469impl fidl::endpoints::SynchronousProxy for DirectoryRouterSynchronousProxy {
9470 type Proxy = DirectoryRouterProxy;
9471 type Protocol = DirectoryRouterMarker;
9472
9473 fn from_channel(inner: fidl::Channel) -> Self {
9474 Self::new(inner)
9475 }
9476
9477 fn into_channel(self) -> fidl::Channel {
9478 self.client.into_channel()
9479 }
9480
9481 fn as_channel(&self) -> &fidl::Channel {
9482 self.client.as_channel()
9483 }
9484}
9485
9486#[cfg(target_os = "fuchsia")]
9487impl DirectoryRouterSynchronousProxy {
9488 pub fn new(channel: fidl::Channel) -> Self {
9489 let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9490 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9491 }
9492
9493 pub fn into_channel(self) -> fidl::Channel {
9494 self.client.into_channel()
9495 }
9496
9497 pub fn wait_for_event(
9500 &self,
9501 deadline: zx::MonotonicInstant,
9502 ) -> Result<DirectoryRouterEvent, fidl::Error> {
9503 DirectoryRouterEvent::decode(self.client.wait_for_event(deadline)?)
9504 }
9505
9506 pub fn r#route(
9507 &self,
9508 mut payload: RouteRequest,
9509 ___deadline: zx::MonotonicInstant,
9510 ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9511 let _response = self.client.send_query::<
9512 RouteRequest,
9513 fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9514 >(
9515 &mut payload,
9516 0x683b6c6be21b0f21,
9517 fidl::encoding::DynamicFlags::FLEXIBLE,
9518 ___deadline,
9519 )?
9520 .into_result::<DirectoryRouterMarker>("route")?;
9521 Ok(_response.map(|x| x))
9522 }
9523}
9524
9525#[cfg(target_os = "fuchsia")]
9526impl From<DirectoryRouterSynchronousProxy> for zx::NullableHandle {
9527 fn from(value: DirectoryRouterSynchronousProxy) -> Self {
9528 value.into_channel().into()
9529 }
9530}
9531
9532#[cfg(target_os = "fuchsia")]
9533impl From<fidl::Channel> for DirectoryRouterSynchronousProxy {
9534 fn from(value: fidl::Channel) -> Self {
9535 Self::new(value)
9536 }
9537}
9538
9539#[cfg(target_os = "fuchsia")]
9540impl fidl::endpoints::FromClient for DirectoryRouterSynchronousProxy {
9541 type Protocol = DirectoryRouterMarker;
9542
9543 fn from_client(value: fidl::endpoints::ClientEnd<DirectoryRouterMarker>) -> Self {
9544 Self::new(value.into_channel())
9545 }
9546}
9547
9548#[derive(Debug, Clone)]
9549pub struct DirectoryRouterProxy {
9550 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9551}
9552
9553impl fidl::endpoints::Proxy for DirectoryRouterProxy {
9554 type Protocol = DirectoryRouterMarker;
9555
9556 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9557 Self::new(inner)
9558 }
9559
9560 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9561 self.client.into_channel().map_err(|client| Self { client })
9562 }
9563
9564 fn as_channel(&self) -> &::fidl::AsyncChannel {
9565 self.client.as_channel()
9566 }
9567}
9568
9569impl DirectoryRouterProxy {
9570 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9572 let protocol_name = <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9573 Self { client: fidl::client::Client::new(channel, protocol_name) }
9574 }
9575
9576 pub fn take_event_stream(&self) -> DirectoryRouterEventStream {
9582 DirectoryRouterEventStream { event_receiver: self.client.take_event_receiver() }
9583 }
9584
9585 pub fn r#route(
9586 &self,
9587 mut payload: RouteRequest,
9588 ) -> fidl::client::QueryResponseFut<
9589 DirectoryRouterRouteResult,
9590 fidl::encoding::DefaultFuchsiaResourceDialect,
9591 > {
9592 DirectoryRouterProxyInterface::r#route(self, payload)
9593 }
9594}
9595
9596impl DirectoryRouterProxyInterface for DirectoryRouterProxy {
9597 type RouteResponseFut = fidl::client::QueryResponseFut<
9598 DirectoryRouterRouteResult,
9599 fidl::encoding::DefaultFuchsiaResourceDialect,
9600 >;
9601 fn r#route(&self, mut payload: RouteRequest) -> Self::RouteResponseFut {
9602 fn _decode(
9603 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9604 ) -> Result<DirectoryRouterRouteResult, fidl::Error> {
9605 let _response = fidl::client::decode_transaction_body::<
9606 fidl::encoding::FlexibleResultType<DirectoryRouterRouteResponse, RouterError>,
9607 fidl::encoding::DefaultFuchsiaResourceDialect,
9608 0x683b6c6be21b0f21,
9609 >(_buf?)?
9610 .into_result::<DirectoryRouterMarker>("route")?;
9611 Ok(_response.map(|x| x))
9612 }
9613 self.client.send_query_and_decode::<RouteRequest, DirectoryRouterRouteResult>(
9614 &mut payload,
9615 0x683b6c6be21b0f21,
9616 fidl::encoding::DynamicFlags::FLEXIBLE,
9617 _decode,
9618 )
9619 }
9620}
9621
9622pub struct DirectoryRouterEventStream {
9623 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9624}
9625
9626impl std::marker::Unpin for DirectoryRouterEventStream {}
9627
9628impl futures::stream::FusedStream for DirectoryRouterEventStream {
9629 fn is_terminated(&self) -> bool {
9630 self.event_receiver.is_terminated()
9631 }
9632}
9633
9634impl futures::Stream for DirectoryRouterEventStream {
9635 type Item = Result<DirectoryRouterEvent, fidl::Error>;
9636
9637 fn poll_next(
9638 mut self: std::pin::Pin<&mut Self>,
9639 cx: &mut std::task::Context<'_>,
9640 ) -> std::task::Poll<Option<Self::Item>> {
9641 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9642 &mut self.event_receiver,
9643 cx
9644 )?) {
9645 Some(buf) => std::task::Poll::Ready(Some(DirectoryRouterEvent::decode(buf))),
9646 None => std::task::Poll::Ready(None),
9647 }
9648 }
9649}
9650
9651#[derive(Debug)]
9652pub enum DirectoryRouterEvent {
9653 #[non_exhaustive]
9654 _UnknownEvent {
9655 ordinal: u64,
9657 },
9658}
9659
9660impl DirectoryRouterEvent {
9661 fn decode(
9663 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9664 ) -> Result<DirectoryRouterEvent, fidl::Error> {
9665 let (bytes, _handles) = buf.split_mut();
9666 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9667 debug_assert_eq!(tx_header.tx_id, 0);
9668 match tx_header.ordinal {
9669 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
9670 Ok(DirectoryRouterEvent::_UnknownEvent { ordinal: tx_header.ordinal })
9671 }
9672 _ => Err(fidl::Error::UnknownOrdinal {
9673 ordinal: tx_header.ordinal,
9674 protocol_name:
9675 <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9676 }),
9677 }
9678 }
9679}
9680
9681pub struct DirectoryRouterRequestStream {
9683 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9684 is_terminated: bool,
9685}
9686
9687impl std::marker::Unpin for DirectoryRouterRequestStream {}
9688
9689impl futures::stream::FusedStream for DirectoryRouterRequestStream {
9690 fn is_terminated(&self) -> bool {
9691 self.is_terminated
9692 }
9693}
9694
9695impl fidl::endpoints::RequestStream for DirectoryRouterRequestStream {
9696 type Protocol = DirectoryRouterMarker;
9697 type ControlHandle = DirectoryRouterControlHandle;
9698
9699 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9700 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9701 }
9702
9703 fn control_handle(&self) -> Self::ControlHandle {
9704 DirectoryRouterControlHandle { inner: self.inner.clone() }
9705 }
9706
9707 fn into_inner(
9708 self,
9709 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9710 {
9711 (self.inner, self.is_terminated)
9712 }
9713
9714 fn from_inner(
9715 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9716 is_terminated: bool,
9717 ) -> Self {
9718 Self { inner, is_terminated }
9719 }
9720}
9721
9722impl futures::Stream for DirectoryRouterRequestStream {
9723 type Item = Result<DirectoryRouterRequest, fidl::Error>;
9724
9725 fn poll_next(
9726 mut self: std::pin::Pin<&mut Self>,
9727 cx: &mut std::task::Context<'_>,
9728 ) -> std::task::Poll<Option<Self::Item>> {
9729 let this = &mut *self;
9730 if this.inner.check_shutdown(cx) {
9731 this.is_terminated = true;
9732 return std::task::Poll::Ready(None);
9733 }
9734 if this.is_terminated {
9735 panic!("polled DirectoryRouterRequestStream after completion");
9736 }
9737 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9738 |bytes, handles| {
9739 match this.inner.channel().read_etc(cx, bytes, handles) {
9740 std::task::Poll::Ready(Ok(())) => {}
9741 std::task::Poll::Pending => return std::task::Poll::Pending,
9742 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9743 this.is_terminated = true;
9744 return std::task::Poll::Ready(None);
9745 }
9746 std::task::Poll::Ready(Err(e)) => {
9747 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9748 e.into(),
9749 ))));
9750 }
9751 }
9752
9753 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9755
9756 std::task::Poll::Ready(Some(match header.ordinal {
9757 0x683b6c6be21b0f21 => {
9758 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9759 let mut req = fidl::new_empty!(
9760 RouteRequest,
9761 fidl::encoding::DefaultFuchsiaResourceDialect
9762 );
9763 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteRequest>(&header, _body_bytes, handles, &mut req)?;
9764 let control_handle =
9765 DirectoryRouterControlHandle { inner: this.inner.clone() };
9766 Ok(DirectoryRouterRequest::Route {
9767 payload: req,
9768 responder: DirectoryRouterRouteResponder {
9769 control_handle: std::mem::ManuallyDrop::new(control_handle),
9770 tx_id: header.tx_id,
9771 },
9772 })
9773 }
9774 _ if header.tx_id == 0
9775 && header
9776 .dynamic_flags()
9777 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9778 {
9779 Ok(DirectoryRouterRequest::_UnknownMethod {
9780 ordinal: header.ordinal,
9781 control_handle: DirectoryRouterControlHandle {
9782 inner: this.inner.clone(),
9783 },
9784 method_type: fidl::MethodType::OneWay,
9785 })
9786 }
9787 _ if header
9788 .dynamic_flags()
9789 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
9790 {
9791 this.inner.send_framework_err(
9792 fidl::encoding::FrameworkErr::UnknownMethod,
9793 header.tx_id,
9794 header.ordinal,
9795 header.dynamic_flags(),
9796 (bytes, handles),
9797 )?;
9798 Ok(DirectoryRouterRequest::_UnknownMethod {
9799 ordinal: header.ordinal,
9800 control_handle: DirectoryRouterControlHandle {
9801 inner: this.inner.clone(),
9802 },
9803 method_type: fidl::MethodType::TwoWay,
9804 })
9805 }
9806 _ => Err(fidl::Error::UnknownOrdinal {
9807 ordinal: header.ordinal,
9808 protocol_name:
9809 <DirectoryRouterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9810 }),
9811 }))
9812 },
9813 )
9814 }
9815}
9816
9817#[derive(Debug)]
9818pub enum DirectoryRouterRequest {
9819 Route {
9820 payload: RouteRequest,
9821 responder: DirectoryRouterRouteResponder,
9822 },
9823 #[non_exhaustive]
9825 _UnknownMethod {
9826 ordinal: u64,
9828 control_handle: DirectoryRouterControlHandle,
9829 method_type: fidl::MethodType,
9830 },
9831}
9832
9833impl DirectoryRouterRequest {
9834 #[allow(irrefutable_let_patterns)]
9835 pub fn into_route(self) -> Option<(RouteRequest, DirectoryRouterRouteResponder)> {
9836 if let DirectoryRouterRequest::Route { payload, responder } = self {
9837 Some((payload, responder))
9838 } else {
9839 None
9840 }
9841 }
9842
9843 pub fn method_name(&self) -> &'static str {
9845 match *self {
9846 DirectoryRouterRequest::Route { .. } => "route",
9847 DirectoryRouterRequest::_UnknownMethod {
9848 method_type: fidl::MethodType::OneWay,
9849 ..
9850 } => "unknown one-way method",
9851 DirectoryRouterRequest::_UnknownMethod {
9852 method_type: fidl::MethodType::TwoWay,
9853 ..
9854 } => "unknown two-way method",
9855 }
9856 }
9857}
9858
9859#[derive(Debug, Clone)]
9860pub struct DirectoryRouterControlHandle {
9861 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9862}
9863
9864impl fidl::endpoints::ControlHandle for DirectoryRouterControlHandle {
9865 fn shutdown(&self) {
9866 self.inner.shutdown()
9867 }
9868
9869 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9870 self.inner.shutdown_with_epitaph(status)
9871 }
9872
9873 fn is_closed(&self) -> bool {
9874 self.inner.channel().is_closed()
9875 }
9876 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9877 self.inner.channel().on_closed()
9878 }
9879
9880 #[cfg(target_os = "fuchsia")]
9881 fn signal_peer(
9882 &self,
9883 clear_mask: zx::Signals,
9884 set_mask: zx::Signals,
9885 ) -> Result<(), zx_status::Status> {
9886 use fidl::Peered;
9887 self.inner.channel().signal_peer(clear_mask, set_mask)
9888 }
9889}
9890
9891impl DirectoryRouterControlHandle {}
9892
9893#[must_use = "FIDL methods require a response to be sent"]
9894#[derive(Debug)]
9895pub struct DirectoryRouterRouteResponder {
9896 control_handle: std::mem::ManuallyDrop<DirectoryRouterControlHandle>,
9897 tx_id: u32,
9898}
9899
9900impl std::ops::Drop for DirectoryRouterRouteResponder {
9904 fn drop(&mut self) {
9905 self.control_handle.shutdown();
9906 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9908 }
9909}
9910
9911impl fidl::endpoints::Responder for DirectoryRouterRouteResponder {
9912 type ControlHandle = DirectoryRouterControlHandle;
9913
9914 fn control_handle(&self) -> &DirectoryRouterControlHandle {
9915 &self.control_handle
9916 }
9917
9918 fn drop_without_shutdown(mut self) {
9919 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9921 std::mem::forget(self);
9923 }
9924}
9925
9926impl DirectoryRouterRouteResponder {
9927 pub fn send(
9931 self,
9932 mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9933 ) -> Result<(), fidl::Error> {
9934 let _result = self.send_raw(result);
9935 if _result.is_err() {
9936 self.control_handle.shutdown();
9937 }
9938 self.drop_without_shutdown();
9939 _result
9940 }
9941
9942 pub fn send_no_shutdown_on_err(
9944 self,
9945 mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9946 ) -> Result<(), fidl::Error> {
9947 let _result = self.send_raw(result);
9948 self.drop_without_shutdown();
9949 _result
9950 }
9951
9952 fn send_raw(
9953 &self,
9954 mut result: Result<DirectoryRouterRouteResponse, RouterError>,
9955 ) -> Result<(), fidl::Error> {
9956 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
9957 DirectoryRouterRouteResponse,
9958 RouterError,
9959 >>(
9960 fidl::encoding::FlexibleResult::new(result.as_mut().map_err(|e| *e)),
9961 self.tx_id,
9962 0x683b6c6be21b0f21,
9963 fidl::encoding::DynamicFlags::FLEXIBLE,
9964 )
9965 }
9966}
9967
9968#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9969pub struct ReceiverMarker;
9970
9971impl fidl::endpoints::ProtocolMarker for ReceiverMarker {
9972 type Proxy = ReceiverProxy;
9973 type RequestStream = ReceiverRequestStream;
9974 #[cfg(target_os = "fuchsia")]
9975 type SynchronousProxy = ReceiverSynchronousProxy;
9976
9977 const DEBUG_NAME: &'static str = "fuchsia.component.sandbox.Receiver";
9978}
9979impl fidl::endpoints::DiscoverableProtocolMarker for ReceiverMarker {}
9980
9981pub trait ReceiverProxyInterface: Send + Sync {
9982 fn r#receive(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
9983}
9984#[derive(Debug)]
9985#[cfg(target_os = "fuchsia")]
9986pub struct ReceiverSynchronousProxy {
9987 client: fidl::client::sync::Client,
9988}
9989
9990#[cfg(target_os = "fuchsia")]
9991impl fidl::endpoints::SynchronousProxy for ReceiverSynchronousProxy {
9992 type Proxy = ReceiverProxy;
9993 type Protocol = ReceiverMarker;
9994
9995 fn from_channel(inner: fidl::Channel) -> Self {
9996 Self::new(inner)
9997 }
9998
9999 fn into_channel(self) -> fidl::Channel {
10000 self.client.into_channel()
10001 }
10002
10003 fn as_channel(&self) -> &fidl::Channel {
10004 self.client.as_channel()
10005 }
10006}
10007
10008#[cfg(target_os = "fuchsia")]
10009impl ReceiverSynchronousProxy {
10010 pub fn new(channel: fidl::Channel) -> Self {
10011 let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10012 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10013 }
10014
10015 pub fn into_channel(self) -> fidl::Channel {
10016 self.client.into_channel()
10017 }
10018
10019 pub fn wait_for_event(
10022 &self,
10023 deadline: zx::MonotonicInstant,
10024 ) -> Result<ReceiverEvent, fidl::Error> {
10025 ReceiverEvent::decode(self.client.wait_for_event(deadline)?)
10026 }
10027
10028 pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10030 self.client.send::<ProtocolPayload>(
10031 (channel,),
10032 0x4bae18ab7aa1a94,
10033 fidl::encoding::DynamicFlags::FLEXIBLE,
10034 )
10035 }
10036}
10037
10038#[cfg(target_os = "fuchsia")]
10039impl From<ReceiverSynchronousProxy> for zx::NullableHandle {
10040 fn from(value: ReceiverSynchronousProxy) -> Self {
10041 value.into_channel().into()
10042 }
10043}
10044
10045#[cfg(target_os = "fuchsia")]
10046impl From<fidl::Channel> for ReceiverSynchronousProxy {
10047 fn from(value: fidl::Channel) -> Self {
10048 Self::new(value)
10049 }
10050}
10051
10052#[cfg(target_os = "fuchsia")]
10053impl fidl::endpoints::FromClient for ReceiverSynchronousProxy {
10054 type Protocol = ReceiverMarker;
10055
10056 fn from_client(value: fidl::endpoints::ClientEnd<ReceiverMarker>) -> Self {
10057 Self::new(value.into_channel())
10058 }
10059}
10060
10061#[derive(Debug, Clone)]
10062pub struct ReceiverProxy {
10063 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10064}
10065
10066impl fidl::endpoints::Proxy for ReceiverProxy {
10067 type Protocol = ReceiverMarker;
10068
10069 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10070 Self::new(inner)
10071 }
10072
10073 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10074 self.client.into_channel().map_err(|client| Self { client })
10075 }
10076
10077 fn as_channel(&self) -> &::fidl::AsyncChannel {
10078 self.client.as_channel()
10079 }
10080}
10081
10082impl ReceiverProxy {
10083 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10085 let protocol_name = <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10086 Self { client: fidl::client::Client::new(channel, protocol_name) }
10087 }
10088
10089 pub fn take_event_stream(&self) -> ReceiverEventStream {
10095 ReceiverEventStream { event_receiver: self.client.take_event_receiver() }
10096 }
10097
10098 pub fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10100 ReceiverProxyInterface::r#receive(self, channel)
10101 }
10102}
10103
10104impl ReceiverProxyInterface for ReceiverProxy {
10105 fn r#receive(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
10106 self.client.send::<ProtocolPayload>(
10107 (channel,),
10108 0x4bae18ab7aa1a94,
10109 fidl::encoding::DynamicFlags::FLEXIBLE,
10110 )
10111 }
10112}
10113
10114pub struct ReceiverEventStream {
10115 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10116}
10117
10118impl std::marker::Unpin for ReceiverEventStream {}
10119
10120impl futures::stream::FusedStream for ReceiverEventStream {
10121 fn is_terminated(&self) -> bool {
10122 self.event_receiver.is_terminated()
10123 }
10124}
10125
10126impl futures::Stream for ReceiverEventStream {
10127 type Item = Result<ReceiverEvent, fidl::Error>;
10128
10129 fn poll_next(
10130 mut self: std::pin::Pin<&mut Self>,
10131 cx: &mut std::task::Context<'_>,
10132 ) -> std::task::Poll<Option<Self::Item>> {
10133 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10134 &mut self.event_receiver,
10135 cx
10136 )?) {
10137 Some(buf) => std::task::Poll::Ready(Some(ReceiverEvent::decode(buf))),
10138 None => std::task::Poll::Ready(None),
10139 }
10140 }
10141}
10142
10143#[derive(Debug)]
10144pub enum ReceiverEvent {
10145 #[non_exhaustive]
10146 _UnknownEvent {
10147 ordinal: u64,
10149 },
10150}
10151
10152impl ReceiverEvent {
10153 fn decode(
10155 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10156 ) -> Result<ReceiverEvent, fidl::Error> {
10157 let (bytes, _handles) = buf.split_mut();
10158 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10159 debug_assert_eq!(tx_header.tx_id, 0);
10160 match tx_header.ordinal {
10161 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
10162 Ok(ReceiverEvent::_UnknownEvent { ordinal: tx_header.ordinal })
10163 }
10164 _ => Err(fidl::Error::UnknownOrdinal {
10165 ordinal: tx_header.ordinal,
10166 protocol_name: <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10167 }),
10168 }
10169 }
10170}
10171
10172pub struct ReceiverRequestStream {
10174 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10175 is_terminated: bool,
10176}
10177
10178impl std::marker::Unpin for ReceiverRequestStream {}
10179
10180impl futures::stream::FusedStream for ReceiverRequestStream {
10181 fn is_terminated(&self) -> bool {
10182 self.is_terminated
10183 }
10184}
10185
10186impl fidl::endpoints::RequestStream for ReceiverRequestStream {
10187 type Protocol = ReceiverMarker;
10188 type ControlHandle = ReceiverControlHandle;
10189
10190 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10191 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10192 }
10193
10194 fn control_handle(&self) -> Self::ControlHandle {
10195 ReceiverControlHandle { inner: self.inner.clone() }
10196 }
10197
10198 fn into_inner(
10199 self,
10200 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10201 {
10202 (self.inner, self.is_terminated)
10203 }
10204
10205 fn from_inner(
10206 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10207 is_terminated: bool,
10208 ) -> Self {
10209 Self { inner, is_terminated }
10210 }
10211}
10212
10213impl futures::Stream for ReceiverRequestStream {
10214 type Item = Result<ReceiverRequest, fidl::Error>;
10215
10216 fn poll_next(
10217 mut self: std::pin::Pin<&mut Self>,
10218 cx: &mut std::task::Context<'_>,
10219 ) -> std::task::Poll<Option<Self::Item>> {
10220 let this = &mut *self;
10221 if this.inner.check_shutdown(cx) {
10222 this.is_terminated = true;
10223 return std::task::Poll::Ready(None);
10224 }
10225 if this.is_terminated {
10226 panic!("polled ReceiverRequestStream after completion");
10227 }
10228 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10229 |bytes, handles| {
10230 match this.inner.channel().read_etc(cx, bytes, handles) {
10231 std::task::Poll::Ready(Ok(())) => {}
10232 std::task::Poll::Pending => return std::task::Poll::Pending,
10233 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10234 this.is_terminated = true;
10235 return std::task::Poll::Ready(None);
10236 }
10237 std::task::Poll::Ready(Err(e)) => {
10238 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10239 e.into(),
10240 ))));
10241 }
10242 }
10243
10244 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10246
10247 std::task::Poll::Ready(Some(match header.ordinal {
10248 0x4bae18ab7aa1a94 => {
10249 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
10250 let mut req = fidl::new_empty!(
10251 ProtocolPayload,
10252 fidl::encoding::DefaultFuchsiaResourceDialect
10253 );
10254 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProtocolPayload>(&header, _body_bytes, handles, &mut req)?;
10255 let control_handle = ReceiverControlHandle { inner: this.inner.clone() };
10256 Ok(ReceiverRequest::Receive { channel: req.channel, control_handle })
10257 }
10258 _ if header.tx_id == 0
10259 && header
10260 .dynamic_flags()
10261 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10262 {
10263 Ok(ReceiverRequest::_UnknownMethod {
10264 ordinal: header.ordinal,
10265 control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10266 method_type: fidl::MethodType::OneWay,
10267 })
10268 }
10269 _ if header
10270 .dynamic_flags()
10271 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
10272 {
10273 this.inner.send_framework_err(
10274 fidl::encoding::FrameworkErr::UnknownMethod,
10275 header.tx_id,
10276 header.ordinal,
10277 header.dynamic_flags(),
10278 (bytes, handles),
10279 )?;
10280 Ok(ReceiverRequest::_UnknownMethod {
10281 ordinal: header.ordinal,
10282 control_handle: ReceiverControlHandle { inner: this.inner.clone() },
10283 method_type: fidl::MethodType::TwoWay,
10284 })
10285 }
10286 _ => Err(fidl::Error::UnknownOrdinal {
10287 ordinal: header.ordinal,
10288 protocol_name:
10289 <ReceiverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10290 }),
10291 }))
10292 },
10293 )
10294 }
10295}
10296
10297#[derive(Debug)]
10300pub enum ReceiverRequest {
10301 Receive { channel: fidl::Channel, control_handle: ReceiverControlHandle },
10303 #[non_exhaustive]
10305 _UnknownMethod {
10306 ordinal: u64,
10308 control_handle: ReceiverControlHandle,
10309 method_type: fidl::MethodType,
10310 },
10311}
10312
10313impl ReceiverRequest {
10314 #[allow(irrefutable_let_patterns)]
10315 pub fn into_receive(self) -> Option<(fidl::Channel, ReceiverControlHandle)> {
10316 if let ReceiverRequest::Receive { channel, control_handle } = self {
10317 Some((channel, control_handle))
10318 } else {
10319 None
10320 }
10321 }
10322
10323 pub fn method_name(&self) -> &'static str {
10325 match *self {
10326 ReceiverRequest::Receive { .. } => "receive",
10327 ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
10328 "unknown one-way method"
10329 }
10330 ReceiverRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
10331 "unknown two-way method"
10332 }
10333 }
10334 }
10335}
10336
10337#[derive(Debug, Clone)]
10338pub struct ReceiverControlHandle {
10339 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10340}
10341
10342impl fidl::endpoints::ControlHandle for ReceiverControlHandle {
10343 fn shutdown(&self) {
10344 self.inner.shutdown()
10345 }
10346
10347 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10348 self.inner.shutdown_with_epitaph(status)
10349 }
10350
10351 fn is_closed(&self) -> bool {
10352 self.inner.channel().is_closed()
10353 }
10354 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10355 self.inner.channel().on_closed()
10356 }
10357
10358 #[cfg(target_os = "fuchsia")]
10359 fn signal_peer(
10360 &self,
10361 clear_mask: zx::Signals,
10362 set_mask: zx::Signals,
10363 ) -> Result<(), zx_status::Status> {
10364 use fidl::Peered;
10365 self.inner.channel().signal_peer(clear_mask, set_mask)
10366 }
10367}
10368
10369impl ReceiverControlHandle {}
10370
10371mod internal {
10372 use super::*;
10373
10374 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorCreateRequest {
10375 type Borrowed<'a> = &'a mut Self;
10376 fn take_or_borrow<'a>(
10377 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10378 ) -> Self::Borrowed<'a> {
10379 value
10380 }
10381 }
10382
10383 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorCreateRequest {
10384 type Owned = Self;
10385
10386 #[inline(always)]
10387 fn inline_align(_context: fidl::encoding::Context) -> usize {
10388 8
10389 }
10390
10391 #[inline(always)]
10392 fn inline_size(_context: fidl::encoding::Context) -> usize {
10393 16
10394 }
10395 }
10396
10397 unsafe impl
10398 fidl::encoding::Encode<
10399 CapabilityStoreConnectorCreateRequest,
10400 fidl::encoding::DefaultFuchsiaResourceDialect,
10401 > for &mut CapabilityStoreConnectorCreateRequest
10402 {
10403 #[inline]
10404 unsafe fn encode(
10405 self,
10406 encoder: &mut fidl::encoding::Encoder<
10407 '_,
10408 fidl::encoding::DefaultFuchsiaResourceDialect,
10409 >,
10410 offset: usize,
10411 _depth: fidl::encoding::Depth,
10412 ) -> fidl::Result<()> {
10413 encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10414 fidl::encoding::Encode::<CapabilityStoreConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10416 (
10417 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10418 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
10419 ),
10420 encoder, offset, _depth
10421 )
10422 }
10423 }
10424 unsafe impl<
10425 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10426 T1: fidl::encoding::Encode<
10427 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10428 fidl::encoding::DefaultFuchsiaResourceDialect,
10429 >,
10430 >
10431 fidl::encoding::Encode<
10432 CapabilityStoreConnectorCreateRequest,
10433 fidl::encoding::DefaultFuchsiaResourceDialect,
10434 > for (T0, T1)
10435 {
10436 #[inline]
10437 unsafe fn encode(
10438 self,
10439 encoder: &mut fidl::encoding::Encoder<
10440 '_,
10441 fidl::encoding::DefaultFuchsiaResourceDialect,
10442 >,
10443 offset: usize,
10444 depth: fidl::encoding::Depth,
10445 ) -> fidl::Result<()> {
10446 encoder.debug_check_bounds::<CapabilityStoreConnectorCreateRequest>(offset);
10447 unsafe {
10450 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10451 (ptr as *mut u64).write_unaligned(0);
10452 }
10453 self.0.encode(encoder, offset + 0, depth)?;
10455 self.1.encode(encoder, offset + 8, depth)?;
10456 Ok(())
10457 }
10458 }
10459
10460 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10461 for CapabilityStoreConnectorCreateRequest
10462 {
10463 #[inline(always)]
10464 fn new_empty() -> Self {
10465 Self {
10466 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10467 receiver: fidl::new_empty!(
10468 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10469 fidl::encoding::DefaultFuchsiaResourceDialect
10470 ),
10471 }
10472 }
10473
10474 #[inline]
10475 unsafe fn decode(
10476 &mut self,
10477 decoder: &mut fidl::encoding::Decoder<
10478 '_,
10479 fidl::encoding::DefaultFuchsiaResourceDialect,
10480 >,
10481 offset: usize,
10482 _depth: fidl::encoding::Depth,
10483 ) -> fidl::Result<()> {
10484 decoder.debug_check_bounds::<Self>(offset);
10485 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10487 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10488 let mask = 0xffffffff00000000u64;
10489 let maskedval = padval & mask;
10490 if maskedval != 0 {
10491 return Err(fidl::Error::NonZeroPadding {
10492 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10493 });
10494 }
10495 fidl::decode!(
10496 u64,
10497 fidl::encoding::DefaultFuchsiaResourceDialect,
10498 &mut self.id,
10499 decoder,
10500 offset + 0,
10501 _depth
10502 )?;
10503 fidl::decode!(
10504 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ReceiverMarker>>,
10505 fidl::encoding::DefaultFuchsiaResourceDialect,
10506 &mut self.receiver,
10507 decoder,
10508 offset + 8,
10509 _depth
10510 )?;
10511 Ok(())
10512 }
10513 }
10514
10515 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreConnectorOpenRequest {
10516 type Borrowed<'a> = &'a mut Self;
10517 fn take_or_borrow<'a>(
10518 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10519 ) -> Self::Borrowed<'a> {
10520 value
10521 }
10522 }
10523
10524 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreConnectorOpenRequest {
10525 type Owned = Self;
10526
10527 #[inline(always)]
10528 fn inline_align(_context: fidl::encoding::Context) -> usize {
10529 8
10530 }
10531
10532 #[inline(always)]
10533 fn inline_size(_context: fidl::encoding::Context) -> usize {
10534 16
10535 }
10536 }
10537
10538 unsafe impl
10539 fidl::encoding::Encode<
10540 CapabilityStoreConnectorOpenRequest,
10541 fidl::encoding::DefaultFuchsiaResourceDialect,
10542 > for &mut CapabilityStoreConnectorOpenRequest
10543 {
10544 #[inline]
10545 unsafe fn encode(
10546 self,
10547 encoder: &mut fidl::encoding::Encoder<
10548 '_,
10549 fidl::encoding::DefaultFuchsiaResourceDialect,
10550 >,
10551 offset: usize,
10552 _depth: fidl::encoding::Depth,
10553 ) -> fidl::Result<()> {
10554 encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10555 fidl::encoding::Encode::<
10557 CapabilityStoreConnectorOpenRequest,
10558 fidl::encoding::DefaultFuchsiaResourceDialect,
10559 >::encode(
10560 (
10561 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10562 <fidl::encoding::HandleType<
10563 fidl::Channel,
10564 { fidl::ObjectType::CHANNEL.into_raw() },
10565 2147483648,
10566 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10567 &mut self.server_end
10568 ),
10569 ),
10570 encoder,
10571 offset,
10572 _depth,
10573 )
10574 }
10575 }
10576 unsafe impl<
10577 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10578 T1: fidl::encoding::Encode<
10579 fidl::encoding::HandleType<
10580 fidl::Channel,
10581 { fidl::ObjectType::CHANNEL.into_raw() },
10582 2147483648,
10583 >,
10584 fidl::encoding::DefaultFuchsiaResourceDialect,
10585 >,
10586 >
10587 fidl::encoding::Encode<
10588 CapabilityStoreConnectorOpenRequest,
10589 fidl::encoding::DefaultFuchsiaResourceDialect,
10590 > for (T0, T1)
10591 {
10592 #[inline]
10593 unsafe fn encode(
10594 self,
10595 encoder: &mut fidl::encoding::Encoder<
10596 '_,
10597 fidl::encoding::DefaultFuchsiaResourceDialect,
10598 >,
10599 offset: usize,
10600 depth: fidl::encoding::Depth,
10601 ) -> fidl::Result<()> {
10602 encoder.debug_check_bounds::<CapabilityStoreConnectorOpenRequest>(offset);
10603 unsafe {
10606 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10607 (ptr as *mut u64).write_unaligned(0);
10608 }
10609 self.0.encode(encoder, offset + 0, depth)?;
10611 self.1.encode(encoder, offset + 8, depth)?;
10612 Ok(())
10613 }
10614 }
10615
10616 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10617 for CapabilityStoreConnectorOpenRequest
10618 {
10619 #[inline(always)]
10620 fn new_empty() -> Self {
10621 Self {
10622 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10623 server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10624 }
10625 }
10626
10627 #[inline]
10628 unsafe fn decode(
10629 &mut self,
10630 decoder: &mut fidl::encoding::Decoder<
10631 '_,
10632 fidl::encoding::DefaultFuchsiaResourceDialect,
10633 >,
10634 offset: usize,
10635 _depth: fidl::encoding::Depth,
10636 ) -> fidl::Result<()> {
10637 decoder.debug_check_bounds::<Self>(offset);
10638 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10640 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10641 let mask = 0xffffffff00000000u64;
10642 let maskedval = padval & mask;
10643 if maskedval != 0 {
10644 return Err(fidl::Error::NonZeroPadding {
10645 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10646 });
10647 }
10648 fidl::decode!(
10649 u64,
10650 fidl::encoding::DefaultFuchsiaResourceDialect,
10651 &mut self.id,
10652 decoder,
10653 offset + 0,
10654 _depth
10655 )?;
10656 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
10657 Ok(())
10658 }
10659 }
10660
10661 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryDrainRequest {
10662 type Borrowed<'a> = &'a mut Self;
10663 fn take_or_borrow<'a>(
10664 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10665 ) -> Self::Borrowed<'a> {
10666 value
10667 }
10668 }
10669
10670 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryDrainRequest {
10671 type Owned = Self;
10672
10673 #[inline(always)]
10674 fn inline_align(_context: fidl::encoding::Context) -> usize {
10675 8
10676 }
10677
10678 #[inline(always)]
10679 fn inline_size(_context: fidl::encoding::Context) -> usize {
10680 16
10681 }
10682 }
10683
10684 unsafe impl
10685 fidl::encoding::Encode<
10686 CapabilityStoreDictionaryDrainRequest,
10687 fidl::encoding::DefaultFuchsiaResourceDialect,
10688 > for &mut CapabilityStoreDictionaryDrainRequest
10689 {
10690 #[inline]
10691 unsafe fn encode(
10692 self,
10693 encoder: &mut fidl::encoding::Encoder<
10694 '_,
10695 fidl::encoding::DefaultFuchsiaResourceDialect,
10696 >,
10697 offset: usize,
10698 _depth: fidl::encoding::Depth,
10699 ) -> fidl::Result<()> {
10700 encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10701 fidl::encoding::Encode::<
10703 CapabilityStoreDictionaryDrainRequest,
10704 fidl::encoding::DefaultFuchsiaResourceDialect,
10705 >::encode(
10706 (
10707 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10708 <fidl::encoding::Optional<
10709 fidl::encoding::Endpoint<
10710 fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10711 >,
10712 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10713 &mut self.iterator
10714 ),
10715 ),
10716 encoder,
10717 offset,
10718 _depth,
10719 )
10720 }
10721 }
10722 unsafe impl<
10723 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10724 T1: fidl::encoding::Encode<
10725 fidl::encoding::Optional<
10726 fidl::encoding::Endpoint<
10727 fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10728 >,
10729 >,
10730 fidl::encoding::DefaultFuchsiaResourceDialect,
10731 >,
10732 >
10733 fidl::encoding::Encode<
10734 CapabilityStoreDictionaryDrainRequest,
10735 fidl::encoding::DefaultFuchsiaResourceDialect,
10736 > for (T0, T1)
10737 {
10738 #[inline]
10739 unsafe fn encode(
10740 self,
10741 encoder: &mut fidl::encoding::Encoder<
10742 '_,
10743 fidl::encoding::DefaultFuchsiaResourceDialect,
10744 >,
10745 offset: usize,
10746 depth: fidl::encoding::Depth,
10747 ) -> fidl::Result<()> {
10748 encoder.debug_check_bounds::<CapabilityStoreDictionaryDrainRequest>(offset);
10749 unsafe {
10752 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10753 (ptr as *mut u64).write_unaligned(0);
10754 }
10755 self.0.encode(encoder, offset + 0, depth)?;
10757 self.1.encode(encoder, offset + 8, depth)?;
10758 Ok(())
10759 }
10760 }
10761
10762 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10763 for CapabilityStoreDictionaryDrainRequest
10764 {
10765 #[inline(always)]
10766 fn new_empty() -> Self {
10767 Self {
10768 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10769 iterator: fidl::new_empty!(
10770 fidl::encoding::Optional<
10771 fidl::encoding::Endpoint<
10772 fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10773 >,
10774 >,
10775 fidl::encoding::DefaultFuchsiaResourceDialect
10776 ),
10777 }
10778 }
10779
10780 #[inline]
10781 unsafe fn decode(
10782 &mut self,
10783 decoder: &mut fidl::encoding::Decoder<
10784 '_,
10785 fidl::encoding::DefaultFuchsiaResourceDialect,
10786 >,
10787 offset: usize,
10788 _depth: fidl::encoding::Depth,
10789 ) -> fidl::Result<()> {
10790 decoder.debug_check_bounds::<Self>(offset);
10791 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10793 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10794 let mask = 0xffffffff00000000u64;
10795 let maskedval = padval & mask;
10796 if maskedval != 0 {
10797 return Err(fidl::Error::NonZeroPadding {
10798 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10799 });
10800 }
10801 fidl::decode!(
10802 u64,
10803 fidl::encoding::DefaultFuchsiaResourceDialect,
10804 &mut self.id,
10805 decoder,
10806 offset + 0,
10807 _depth
10808 )?;
10809 fidl::decode!(
10810 fidl::encoding::Optional<
10811 fidl::encoding::Endpoint<
10812 fidl::endpoints::ServerEnd<DictionaryDrainIteratorMarker>,
10813 >,
10814 >,
10815 fidl::encoding::DefaultFuchsiaResourceDialect,
10816 &mut self.iterator,
10817 decoder,
10818 offset + 8,
10819 _depth
10820 )?;
10821 Ok(())
10822 }
10823 }
10824
10825 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10826 type Borrowed<'a> = &'a mut Self;
10827 fn take_or_borrow<'a>(
10828 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10829 ) -> Self::Borrowed<'a> {
10830 value
10831 }
10832 }
10833
10834 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryEnumerateRequest {
10835 type Owned = Self;
10836
10837 #[inline(always)]
10838 fn inline_align(_context: fidl::encoding::Context) -> usize {
10839 8
10840 }
10841
10842 #[inline(always)]
10843 fn inline_size(_context: fidl::encoding::Context) -> usize {
10844 16
10845 }
10846 }
10847
10848 unsafe impl
10849 fidl::encoding::Encode<
10850 CapabilityStoreDictionaryEnumerateRequest,
10851 fidl::encoding::DefaultFuchsiaResourceDialect,
10852 > for &mut CapabilityStoreDictionaryEnumerateRequest
10853 {
10854 #[inline]
10855 unsafe fn encode(
10856 self,
10857 encoder: &mut fidl::encoding::Encoder<
10858 '_,
10859 fidl::encoding::DefaultFuchsiaResourceDialect,
10860 >,
10861 offset: usize,
10862 _depth: fidl::encoding::Depth,
10863 ) -> fidl::Result<()> {
10864 encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10865 fidl::encoding::Encode::<
10867 CapabilityStoreDictionaryEnumerateRequest,
10868 fidl::encoding::DefaultFuchsiaResourceDialect,
10869 >::encode(
10870 (
10871 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
10872 <fidl::encoding::Endpoint<
10873 fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10874 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10875 &mut self.iterator
10876 ),
10877 ),
10878 encoder,
10879 offset,
10880 _depth,
10881 )
10882 }
10883 }
10884 unsafe impl<
10885 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
10886 T1: fidl::encoding::Encode<
10887 fidl::encoding::Endpoint<
10888 fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10889 >,
10890 fidl::encoding::DefaultFuchsiaResourceDialect,
10891 >,
10892 >
10893 fidl::encoding::Encode<
10894 CapabilityStoreDictionaryEnumerateRequest,
10895 fidl::encoding::DefaultFuchsiaResourceDialect,
10896 > for (T0, T1)
10897 {
10898 #[inline]
10899 unsafe fn encode(
10900 self,
10901 encoder: &mut fidl::encoding::Encoder<
10902 '_,
10903 fidl::encoding::DefaultFuchsiaResourceDialect,
10904 >,
10905 offset: usize,
10906 depth: fidl::encoding::Depth,
10907 ) -> fidl::Result<()> {
10908 encoder.debug_check_bounds::<CapabilityStoreDictionaryEnumerateRequest>(offset);
10909 unsafe {
10912 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
10913 (ptr as *mut u64).write_unaligned(0);
10914 }
10915 self.0.encode(encoder, offset + 0, depth)?;
10917 self.1.encode(encoder, offset + 8, depth)?;
10918 Ok(())
10919 }
10920 }
10921
10922 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10923 for CapabilityStoreDictionaryEnumerateRequest
10924 {
10925 #[inline(always)]
10926 fn new_empty() -> Self {
10927 Self {
10928 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
10929 iterator: fidl::new_empty!(
10930 fidl::encoding::Endpoint<
10931 fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10932 >,
10933 fidl::encoding::DefaultFuchsiaResourceDialect
10934 ),
10935 }
10936 }
10937
10938 #[inline]
10939 unsafe fn decode(
10940 &mut self,
10941 decoder: &mut fidl::encoding::Decoder<
10942 '_,
10943 fidl::encoding::DefaultFuchsiaResourceDialect,
10944 >,
10945 offset: usize,
10946 _depth: fidl::encoding::Depth,
10947 ) -> fidl::Result<()> {
10948 decoder.debug_check_bounds::<Self>(offset);
10949 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
10951 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10952 let mask = 0xffffffff00000000u64;
10953 let maskedval = padval & mask;
10954 if maskedval != 0 {
10955 return Err(fidl::Error::NonZeroPadding {
10956 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
10957 });
10958 }
10959 fidl::decode!(
10960 u64,
10961 fidl::encoding::DefaultFuchsiaResourceDialect,
10962 &mut self.id,
10963 decoder,
10964 offset + 0,
10965 _depth
10966 )?;
10967 fidl::decode!(
10968 fidl::encoding::Endpoint<
10969 fidl::endpoints::ServerEnd<DictionaryEnumerateIteratorMarker>,
10970 >,
10971 fidl::encoding::DefaultFuchsiaResourceDialect,
10972 &mut self.iterator,
10973 decoder,
10974 offset + 8,
10975 _depth
10976 )?;
10977 Ok(())
10978 }
10979 }
10980
10981 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryKeysRequest {
10982 type Borrowed<'a> = &'a mut Self;
10983 fn take_or_borrow<'a>(
10984 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10985 ) -> Self::Borrowed<'a> {
10986 value
10987 }
10988 }
10989
10990 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryKeysRequest {
10991 type Owned = Self;
10992
10993 #[inline(always)]
10994 fn inline_align(_context: fidl::encoding::Context) -> usize {
10995 8
10996 }
10997
10998 #[inline(always)]
10999 fn inline_size(_context: fidl::encoding::Context) -> usize {
11000 16
11001 }
11002 }
11003
11004 unsafe impl
11005 fidl::encoding::Encode<
11006 CapabilityStoreDictionaryKeysRequest,
11007 fidl::encoding::DefaultFuchsiaResourceDialect,
11008 > for &mut CapabilityStoreDictionaryKeysRequest
11009 {
11010 #[inline]
11011 unsafe fn encode(
11012 self,
11013 encoder: &mut fidl::encoding::Encoder<
11014 '_,
11015 fidl::encoding::DefaultFuchsiaResourceDialect,
11016 >,
11017 offset: usize,
11018 _depth: fidl::encoding::Depth,
11019 ) -> fidl::Result<()> {
11020 encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11021 fidl::encoding::Encode::<
11023 CapabilityStoreDictionaryKeysRequest,
11024 fidl::encoding::DefaultFuchsiaResourceDialect,
11025 >::encode(
11026 (
11027 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11028 <fidl::encoding::Endpoint<
11029 fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11030 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11031 &mut self.iterator
11032 ),
11033 ),
11034 encoder,
11035 offset,
11036 _depth,
11037 )
11038 }
11039 }
11040 unsafe impl<
11041 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11042 T1: fidl::encoding::Encode<
11043 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11044 fidl::encoding::DefaultFuchsiaResourceDialect,
11045 >,
11046 >
11047 fidl::encoding::Encode<
11048 CapabilityStoreDictionaryKeysRequest,
11049 fidl::encoding::DefaultFuchsiaResourceDialect,
11050 > for (T0, T1)
11051 {
11052 #[inline]
11053 unsafe fn encode(
11054 self,
11055 encoder: &mut fidl::encoding::Encoder<
11056 '_,
11057 fidl::encoding::DefaultFuchsiaResourceDialect,
11058 >,
11059 offset: usize,
11060 depth: fidl::encoding::Depth,
11061 ) -> fidl::Result<()> {
11062 encoder.debug_check_bounds::<CapabilityStoreDictionaryKeysRequest>(offset);
11063 unsafe {
11066 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11067 (ptr as *mut u64).write_unaligned(0);
11068 }
11069 self.0.encode(encoder, offset + 0, depth)?;
11071 self.1.encode(encoder, offset + 8, depth)?;
11072 Ok(())
11073 }
11074 }
11075
11076 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11077 for CapabilityStoreDictionaryKeysRequest
11078 {
11079 #[inline(always)]
11080 fn new_empty() -> Self {
11081 Self {
11082 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11083 iterator: fidl::new_empty!(
11084 fidl::encoding::Endpoint<
11085 fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>,
11086 >,
11087 fidl::encoding::DefaultFuchsiaResourceDialect
11088 ),
11089 }
11090 }
11091
11092 #[inline]
11093 unsafe fn decode(
11094 &mut self,
11095 decoder: &mut fidl::encoding::Decoder<
11096 '_,
11097 fidl::encoding::DefaultFuchsiaResourceDialect,
11098 >,
11099 offset: usize,
11100 _depth: fidl::encoding::Depth,
11101 ) -> fidl::Result<()> {
11102 decoder.debug_check_bounds::<Self>(offset);
11103 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11105 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11106 let mask = 0xffffffff00000000u64;
11107 let maskedval = padval & mask;
11108 if maskedval != 0 {
11109 return Err(fidl::Error::NonZeroPadding {
11110 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11111 });
11112 }
11113 fidl::decode!(
11114 u64,
11115 fidl::encoding::DefaultFuchsiaResourceDialect,
11116 &mut self.id,
11117 decoder,
11118 offset + 0,
11119 _depth
11120 )?;
11121 fidl::decode!(
11122 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DictionaryKeysIteratorMarker>>,
11123 fidl::encoding::DefaultFuchsiaResourceDialect,
11124 &mut self.iterator,
11125 decoder,
11126 offset + 8,
11127 _depth
11128 )?;
11129 Ok(())
11130 }
11131 }
11132
11133 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11134 type Borrowed<'a> = &'a mut Self;
11135 fn take_or_borrow<'a>(
11136 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11137 ) -> Self::Borrowed<'a> {
11138 value
11139 }
11140 }
11141
11142 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyExportRequest {
11143 type Owned = Self;
11144
11145 #[inline(always)]
11146 fn inline_align(_context: fidl::encoding::Context) -> usize {
11147 8
11148 }
11149
11150 #[inline(always)]
11151 fn inline_size(_context: fidl::encoding::Context) -> usize {
11152 16
11153 }
11154 }
11155
11156 unsafe impl
11157 fidl::encoding::Encode<
11158 CapabilityStoreDictionaryLegacyExportRequest,
11159 fidl::encoding::DefaultFuchsiaResourceDialect,
11160 > for &mut CapabilityStoreDictionaryLegacyExportRequest
11161 {
11162 #[inline]
11163 unsafe fn encode(
11164 self,
11165 encoder: &mut fidl::encoding::Encoder<
11166 '_,
11167 fidl::encoding::DefaultFuchsiaResourceDialect,
11168 >,
11169 offset: usize,
11170 _depth: fidl::encoding::Depth,
11171 ) -> fidl::Result<()> {
11172 encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11173 fidl::encoding::Encode::<
11175 CapabilityStoreDictionaryLegacyExportRequest,
11176 fidl::encoding::DefaultFuchsiaResourceDialect,
11177 >::encode(
11178 (
11179 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11180 <fidl::encoding::HandleType<
11181 fidl::Channel,
11182 { fidl::ObjectType::CHANNEL.into_raw() },
11183 2147483648,
11184 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11185 &mut self.server_end
11186 ),
11187 ),
11188 encoder,
11189 offset,
11190 _depth,
11191 )
11192 }
11193 }
11194 unsafe impl<
11195 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11196 T1: fidl::encoding::Encode<
11197 fidl::encoding::HandleType<
11198 fidl::Channel,
11199 { fidl::ObjectType::CHANNEL.into_raw() },
11200 2147483648,
11201 >,
11202 fidl::encoding::DefaultFuchsiaResourceDialect,
11203 >,
11204 >
11205 fidl::encoding::Encode<
11206 CapabilityStoreDictionaryLegacyExportRequest,
11207 fidl::encoding::DefaultFuchsiaResourceDialect,
11208 > for (T0, T1)
11209 {
11210 #[inline]
11211 unsafe fn encode(
11212 self,
11213 encoder: &mut fidl::encoding::Encoder<
11214 '_,
11215 fidl::encoding::DefaultFuchsiaResourceDialect,
11216 >,
11217 offset: usize,
11218 depth: fidl::encoding::Depth,
11219 ) -> fidl::Result<()> {
11220 encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyExportRequest>(offset);
11221 unsafe {
11224 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11225 (ptr as *mut u64).write_unaligned(0);
11226 }
11227 self.0.encode(encoder, offset + 0, depth)?;
11229 self.1.encode(encoder, offset + 8, depth)?;
11230 Ok(())
11231 }
11232 }
11233
11234 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11235 for CapabilityStoreDictionaryLegacyExportRequest
11236 {
11237 #[inline(always)]
11238 fn new_empty() -> Self {
11239 Self {
11240 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11241 server_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11242 }
11243 }
11244
11245 #[inline]
11246 unsafe fn decode(
11247 &mut self,
11248 decoder: &mut fidl::encoding::Decoder<
11249 '_,
11250 fidl::encoding::DefaultFuchsiaResourceDialect,
11251 >,
11252 offset: usize,
11253 _depth: fidl::encoding::Depth,
11254 ) -> fidl::Result<()> {
11255 decoder.debug_check_bounds::<Self>(offset);
11256 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11258 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11259 let mask = 0xffffffff00000000u64;
11260 let maskedval = padval & mask;
11261 if maskedval != 0 {
11262 return Err(fidl::Error::NonZeroPadding {
11263 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11264 });
11265 }
11266 fidl::decode!(
11267 u64,
11268 fidl::encoding::DefaultFuchsiaResourceDialect,
11269 &mut self.id,
11270 decoder,
11271 offset + 0,
11272 _depth
11273 )?;
11274 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_end, decoder, offset + 8, _depth)?;
11275 Ok(())
11276 }
11277 }
11278
11279 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11280 type Borrowed<'a> = &'a mut Self;
11281 fn take_or_borrow<'a>(
11282 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11283 ) -> Self::Borrowed<'a> {
11284 value
11285 }
11286 }
11287
11288 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDictionaryLegacyImportRequest {
11289 type Owned = Self;
11290
11291 #[inline(always)]
11292 fn inline_align(_context: fidl::encoding::Context) -> usize {
11293 8
11294 }
11295
11296 #[inline(always)]
11297 fn inline_size(_context: fidl::encoding::Context) -> usize {
11298 16
11299 }
11300 }
11301
11302 unsafe impl
11303 fidl::encoding::Encode<
11304 CapabilityStoreDictionaryLegacyImportRequest,
11305 fidl::encoding::DefaultFuchsiaResourceDialect,
11306 > for &mut CapabilityStoreDictionaryLegacyImportRequest
11307 {
11308 #[inline]
11309 unsafe fn encode(
11310 self,
11311 encoder: &mut fidl::encoding::Encoder<
11312 '_,
11313 fidl::encoding::DefaultFuchsiaResourceDialect,
11314 >,
11315 offset: usize,
11316 _depth: fidl::encoding::Depth,
11317 ) -> fidl::Result<()> {
11318 encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11319 fidl::encoding::Encode::<
11321 CapabilityStoreDictionaryLegacyImportRequest,
11322 fidl::encoding::DefaultFuchsiaResourceDialect,
11323 >::encode(
11324 (
11325 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11326 <fidl::encoding::HandleType<
11327 fidl::Channel,
11328 { fidl::ObjectType::CHANNEL.into_raw() },
11329 2147483648,
11330 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11331 &mut self.client_end
11332 ),
11333 ),
11334 encoder,
11335 offset,
11336 _depth,
11337 )
11338 }
11339 }
11340 unsafe impl<
11341 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11342 T1: fidl::encoding::Encode<
11343 fidl::encoding::HandleType<
11344 fidl::Channel,
11345 { fidl::ObjectType::CHANNEL.into_raw() },
11346 2147483648,
11347 >,
11348 fidl::encoding::DefaultFuchsiaResourceDialect,
11349 >,
11350 >
11351 fidl::encoding::Encode<
11352 CapabilityStoreDictionaryLegacyImportRequest,
11353 fidl::encoding::DefaultFuchsiaResourceDialect,
11354 > for (T0, T1)
11355 {
11356 #[inline]
11357 unsafe fn encode(
11358 self,
11359 encoder: &mut fidl::encoding::Encoder<
11360 '_,
11361 fidl::encoding::DefaultFuchsiaResourceDialect,
11362 >,
11363 offset: usize,
11364 depth: fidl::encoding::Depth,
11365 ) -> fidl::Result<()> {
11366 encoder.debug_check_bounds::<CapabilityStoreDictionaryLegacyImportRequest>(offset);
11367 unsafe {
11370 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11371 (ptr as *mut u64).write_unaligned(0);
11372 }
11373 self.0.encode(encoder, offset + 0, depth)?;
11375 self.1.encode(encoder, offset + 8, depth)?;
11376 Ok(())
11377 }
11378 }
11379
11380 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11381 for CapabilityStoreDictionaryLegacyImportRequest
11382 {
11383 #[inline(always)]
11384 fn new_empty() -> Self {
11385 Self {
11386 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11387 client_end: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11388 }
11389 }
11390
11391 #[inline]
11392 unsafe fn decode(
11393 &mut self,
11394 decoder: &mut fidl::encoding::Decoder<
11395 '_,
11396 fidl::encoding::DefaultFuchsiaResourceDialect,
11397 >,
11398 offset: usize,
11399 _depth: fidl::encoding::Depth,
11400 ) -> fidl::Result<()> {
11401 decoder.debug_check_bounds::<Self>(offset);
11402 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11404 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11405 let mask = 0xffffffff00000000u64;
11406 let maskedval = padval & mask;
11407 if maskedval != 0 {
11408 return Err(fidl::Error::NonZeroPadding {
11409 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11410 });
11411 }
11412 fidl::decode!(
11413 u64,
11414 fidl::encoding::DefaultFuchsiaResourceDialect,
11415 &mut self.id,
11416 decoder,
11417 offset + 0,
11418 _depth
11419 )?;
11420 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.client_end, decoder, offset + 8, _depth)?;
11421 Ok(())
11422 }
11423 }
11424
11425 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorCreateRequest {
11426 type Borrowed<'a> = &'a mut Self;
11427 fn take_or_borrow<'a>(
11428 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11429 ) -> Self::Borrowed<'a> {
11430 value
11431 }
11432 }
11433
11434 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorCreateRequest {
11435 type Owned = Self;
11436
11437 #[inline(always)]
11438 fn inline_align(_context: fidl::encoding::Context) -> usize {
11439 8
11440 }
11441
11442 #[inline(always)]
11443 fn inline_size(_context: fidl::encoding::Context) -> usize {
11444 16
11445 }
11446 }
11447
11448 unsafe impl
11449 fidl::encoding::Encode<
11450 CapabilityStoreDirConnectorCreateRequest,
11451 fidl::encoding::DefaultFuchsiaResourceDialect,
11452 > for &mut CapabilityStoreDirConnectorCreateRequest
11453 {
11454 #[inline]
11455 unsafe fn encode(
11456 self,
11457 encoder: &mut fidl::encoding::Encoder<
11458 '_,
11459 fidl::encoding::DefaultFuchsiaResourceDialect,
11460 >,
11461 offset: usize,
11462 _depth: fidl::encoding::Depth,
11463 ) -> fidl::Result<()> {
11464 encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11465 fidl::encoding::Encode::<CapabilityStoreDirConnectorCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11467 (
11468 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11469 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.receiver),
11470 ),
11471 encoder, offset, _depth
11472 )
11473 }
11474 }
11475 unsafe impl<
11476 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11477 T1: fidl::encoding::Encode<
11478 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11479 fidl::encoding::DefaultFuchsiaResourceDialect,
11480 >,
11481 >
11482 fidl::encoding::Encode<
11483 CapabilityStoreDirConnectorCreateRequest,
11484 fidl::encoding::DefaultFuchsiaResourceDialect,
11485 > for (T0, T1)
11486 {
11487 #[inline]
11488 unsafe fn encode(
11489 self,
11490 encoder: &mut fidl::encoding::Encoder<
11491 '_,
11492 fidl::encoding::DefaultFuchsiaResourceDialect,
11493 >,
11494 offset: usize,
11495 depth: fidl::encoding::Depth,
11496 ) -> fidl::Result<()> {
11497 encoder.debug_check_bounds::<CapabilityStoreDirConnectorCreateRequest>(offset);
11498 unsafe {
11501 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11502 (ptr as *mut u64).write_unaligned(0);
11503 }
11504 self.0.encode(encoder, offset + 0, depth)?;
11506 self.1.encode(encoder, offset + 8, depth)?;
11507 Ok(())
11508 }
11509 }
11510
11511 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11512 for CapabilityStoreDirConnectorCreateRequest
11513 {
11514 #[inline(always)]
11515 fn new_empty() -> Self {
11516 Self {
11517 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11518 receiver: fidl::new_empty!(
11519 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11520 fidl::encoding::DefaultFuchsiaResourceDialect
11521 ),
11522 }
11523 }
11524
11525 #[inline]
11526 unsafe fn decode(
11527 &mut self,
11528 decoder: &mut fidl::encoding::Decoder<
11529 '_,
11530 fidl::encoding::DefaultFuchsiaResourceDialect,
11531 >,
11532 offset: usize,
11533 _depth: fidl::encoding::Depth,
11534 ) -> fidl::Result<()> {
11535 decoder.debug_check_bounds::<Self>(offset);
11536 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11538 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11539 let mask = 0xffffffff00000000u64;
11540 let maskedval = padval & mask;
11541 if maskedval != 0 {
11542 return Err(fidl::Error::NonZeroPadding {
11543 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11544 });
11545 }
11546 fidl::decode!(
11547 u64,
11548 fidl::encoding::DefaultFuchsiaResourceDialect,
11549 &mut self.id,
11550 decoder,
11551 offset + 0,
11552 _depth
11553 )?;
11554 fidl::decode!(
11555 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirReceiverMarker>>,
11556 fidl::encoding::DefaultFuchsiaResourceDialect,
11557 &mut self.receiver,
11558 decoder,
11559 offset + 8,
11560 _depth
11561 )?;
11562 Ok(())
11563 }
11564 }
11565
11566 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreImportRequest {
11567 type Borrowed<'a> = &'a mut Self;
11568 fn take_or_borrow<'a>(
11569 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11570 ) -> Self::Borrowed<'a> {
11571 value
11572 }
11573 }
11574
11575 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreImportRequest {
11576 type Owned = Self;
11577
11578 #[inline(always)]
11579 fn inline_align(_context: fidl::encoding::Context) -> usize {
11580 8
11581 }
11582
11583 #[inline(always)]
11584 fn inline_size(_context: fidl::encoding::Context) -> usize {
11585 24
11586 }
11587 }
11588
11589 unsafe impl
11590 fidl::encoding::Encode<
11591 CapabilityStoreImportRequest,
11592 fidl::encoding::DefaultFuchsiaResourceDialect,
11593 > for &mut CapabilityStoreImportRequest
11594 {
11595 #[inline]
11596 unsafe fn encode(
11597 self,
11598 encoder: &mut fidl::encoding::Encoder<
11599 '_,
11600 fidl::encoding::DefaultFuchsiaResourceDialect,
11601 >,
11602 offset: usize,
11603 _depth: fidl::encoding::Depth,
11604 ) -> fidl::Result<()> {
11605 encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11606 fidl::encoding::Encode::<
11608 CapabilityStoreImportRequest,
11609 fidl::encoding::DefaultFuchsiaResourceDialect,
11610 >::encode(
11611 (
11612 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
11613 <Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11614 &mut self.capability,
11615 ),
11616 ),
11617 encoder,
11618 offset,
11619 _depth,
11620 )
11621 }
11622 }
11623 unsafe impl<
11624 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11625 T1: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
11626 >
11627 fidl::encoding::Encode<
11628 CapabilityStoreImportRequest,
11629 fidl::encoding::DefaultFuchsiaResourceDialect,
11630 > for (T0, T1)
11631 {
11632 #[inline]
11633 unsafe fn encode(
11634 self,
11635 encoder: &mut fidl::encoding::Encoder<
11636 '_,
11637 fidl::encoding::DefaultFuchsiaResourceDialect,
11638 >,
11639 offset: usize,
11640 depth: fidl::encoding::Depth,
11641 ) -> fidl::Result<()> {
11642 encoder.debug_check_bounds::<CapabilityStoreImportRequest>(offset);
11643 self.0.encode(encoder, offset + 0, depth)?;
11647 self.1.encode(encoder, offset + 8, depth)?;
11648 Ok(())
11649 }
11650 }
11651
11652 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11653 for CapabilityStoreImportRequest
11654 {
11655 #[inline(always)]
11656 fn new_empty() -> Self {
11657 Self {
11658 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
11659 capability: fidl::new_empty!(
11660 Capability,
11661 fidl::encoding::DefaultFuchsiaResourceDialect
11662 ),
11663 }
11664 }
11665
11666 #[inline]
11667 unsafe fn decode(
11668 &mut self,
11669 decoder: &mut fidl::encoding::Decoder<
11670 '_,
11671 fidl::encoding::DefaultFuchsiaResourceDialect,
11672 >,
11673 offset: usize,
11674 _depth: fidl::encoding::Depth,
11675 ) -> fidl::Result<()> {
11676 decoder.debug_check_bounds::<Self>(offset);
11677 fidl::decode!(
11679 u64,
11680 fidl::encoding::DefaultFuchsiaResourceDialect,
11681 &mut self.id,
11682 decoder,
11683 offset + 0,
11684 _depth
11685 )?;
11686 fidl::decode!(
11687 Capability,
11688 fidl::encoding::DefaultFuchsiaResourceDialect,
11689 &mut self.capability,
11690 decoder,
11691 offset + 8,
11692 _depth
11693 )?;
11694 Ok(())
11695 }
11696 }
11697
11698 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreExportResponse {
11699 type Borrowed<'a> = &'a mut Self;
11700 fn take_or_borrow<'a>(
11701 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11702 ) -> Self::Borrowed<'a> {
11703 value
11704 }
11705 }
11706
11707 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreExportResponse {
11708 type Owned = Self;
11709
11710 #[inline(always)]
11711 fn inline_align(_context: fidl::encoding::Context) -> usize {
11712 8
11713 }
11714
11715 #[inline(always)]
11716 fn inline_size(_context: fidl::encoding::Context) -> usize {
11717 16
11718 }
11719 }
11720
11721 unsafe impl
11722 fidl::encoding::Encode<
11723 CapabilityStoreExportResponse,
11724 fidl::encoding::DefaultFuchsiaResourceDialect,
11725 > for &mut CapabilityStoreExportResponse
11726 {
11727 #[inline]
11728 unsafe fn encode(
11729 self,
11730 encoder: &mut fidl::encoding::Encoder<
11731 '_,
11732 fidl::encoding::DefaultFuchsiaResourceDialect,
11733 >,
11734 offset: usize,
11735 _depth: fidl::encoding::Depth,
11736 ) -> fidl::Result<()> {
11737 encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11738 fidl::encoding::Encode::<
11740 CapabilityStoreExportResponse,
11741 fidl::encoding::DefaultFuchsiaResourceDialect,
11742 >::encode(
11743 (<Capability as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11744 &mut self.capability,
11745 ),),
11746 encoder,
11747 offset,
11748 _depth,
11749 )
11750 }
11751 }
11752 unsafe impl<
11753 T0: fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>,
11754 >
11755 fidl::encoding::Encode<
11756 CapabilityStoreExportResponse,
11757 fidl::encoding::DefaultFuchsiaResourceDialect,
11758 > for (T0,)
11759 {
11760 #[inline]
11761 unsafe fn encode(
11762 self,
11763 encoder: &mut fidl::encoding::Encoder<
11764 '_,
11765 fidl::encoding::DefaultFuchsiaResourceDialect,
11766 >,
11767 offset: usize,
11768 depth: fidl::encoding::Depth,
11769 ) -> fidl::Result<()> {
11770 encoder.debug_check_bounds::<CapabilityStoreExportResponse>(offset);
11771 self.0.encode(encoder, offset + 0, depth)?;
11775 Ok(())
11776 }
11777 }
11778
11779 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11780 for CapabilityStoreExportResponse
11781 {
11782 #[inline(always)]
11783 fn new_empty() -> Self {
11784 Self {
11785 capability: fidl::new_empty!(
11786 Capability,
11787 fidl::encoding::DefaultFuchsiaResourceDialect
11788 ),
11789 }
11790 }
11791
11792 #[inline]
11793 unsafe fn decode(
11794 &mut self,
11795 decoder: &mut fidl::encoding::Decoder<
11796 '_,
11797 fidl::encoding::DefaultFuchsiaResourceDialect,
11798 >,
11799 offset: usize,
11800 _depth: fidl::encoding::Depth,
11801 ) -> fidl::Result<()> {
11802 decoder.debug_check_bounds::<Self>(offset);
11803 fidl::decode!(
11805 Capability,
11806 fidl::encoding::DefaultFuchsiaResourceDialect,
11807 &mut self.capability,
11808 decoder,
11809 offset + 0,
11810 _depth
11811 )?;
11812 Ok(())
11813 }
11814 }
11815
11816 impl fidl::encoding::ResourceTypeMarker for Connector {
11817 type Borrowed<'a> = &'a mut Self;
11818 fn take_or_borrow<'a>(
11819 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11820 ) -> Self::Borrowed<'a> {
11821 value
11822 }
11823 }
11824
11825 unsafe impl fidl::encoding::TypeMarker for Connector {
11826 type Owned = Self;
11827
11828 #[inline(always)]
11829 fn inline_align(_context: fidl::encoding::Context) -> usize {
11830 4
11831 }
11832
11833 #[inline(always)]
11834 fn inline_size(_context: fidl::encoding::Context) -> usize {
11835 4
11836 }
11837 }
11838
11839 unsafe impl fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>
11840 for &mut Connector
11841 {
11842 #[inline]
11843 unsafe fn encode(
11844 self,
11845 encoder: &mut fidl::encoding::Encoder<
11846 '_,
11847 fidl::encoding::DefaultFuchsiaResourceDialect,
11848 >,
11849 offset: usize,
11850 _depth: fidl::encoding::Depth,
11851 ) -> fidl::Result<()> {
11852 encoder.debug_check_bounds::<Connector>(offset);
11853 fidl::encoding::Encode::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11855 (
11856 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
11857 ),
11858 encoder, offset, _depth
11859 )
11860 }
11861 }
11862 unsafe impl<
11863 T0: fidl::encoding::Encode<
11864 fidl::encoding::HandleType<
11865 fidl::EventPair,
11866 { fidl::ObjectType::EVENTPAIR.into_raw() },
11867 2147483648,
11868 >,
11869 fidl::encoding::DefaultFuchsiaResourceDialect,
11870 >,
11871 > fidl::encoding::Encode<Connector, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
11872 {
11873 #[inline]
11874 unsafe fn encode(
11875 self,
11876 encoder: &mut fidl::encoding::Encoder<
11877 '_,
11878 fidl::encoding::DefaultFuchsiaResourceDialect,
11879 >,
11880 offset: usize,
11881 depth: fidl::encoding::Depth,
11882 ) -> fidl::Result<()> {
11883 encoder.debug_check_bounds::<Connector>(offset);
11884 self.0.encode(encoder, offset + 0, depth)?;
11888 Ok(())
11889 }
11890 }
11891
11892 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Connector {
11893 #[inline(always)]
11894 fn new_empty() -> Self {
11895 Self {
11896 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11897 }
11898 }
11899
11900 #[inline]
11901 unsafe fn decode(
11902 &mut self,
11903 decoder: &mut fidl::encoding::Decoder<
11904 '_,
11905 fidl::encoding::DefaultFuchsiaResourceDialect,
11906 >,
11907 offset: usize,
11908 _depth: fidl::encoding::Depth,
11909 ) -> fidl::Result<()> {
11910 decoder.debug_check_bounds::<Self>(offset);
11911 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
11913 Ok(())
11914 }
11915 }
11916
11917 impl fidl::encoding::ResourceTypeMarker for DictionaryDrainIteratorGetNextResponse {
11918 type Borrowed<'a> = &'a mut Self;
11919 fn take_or_borrow<'a>(
11920 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11921 ) -> Self::Borrowed<'a> {
11922 value
11923 }
11924 }
11925
11926 unsafe impl fidl::encoding::TypeMarker for DictionaryDrainIteratorGetNextResponse {
11927 type Owned = Self;
11928
11929 #[inline(always)]
11930 fn inline_align(_context: fidl::encoding::Context) -> usize {
11931 8
11932 }
11933
11934 #[inline(always)]
11935 fn inline_size(_context: fidl::encoding::Context) -> usize {
11936 24
11937 }
11938 }
11939
11940 unsafe impl
11941 fidl::encoding::Encode<
11942 DictionaryDrainIteratorGetNextResponse,
11943 fidl::encoding::DefaultFuchsiaResourceDialect,
11944 > for &mut DictionaryDrainIteratorGetNextResponse
11945 {
11946 #[inline]
11947 unsafe fn encode(
11948 self,
11949 encoder: &mut fidl::encoding::Encoder<
11950 '_,
11951 fidl::encoding::DefaultFuchsiaResourceDialect,
11952 >,
11953 offset: usize,
11954 _depth: fidl::encoding::Depth,
11955 ) -> fidl::Result<()> {
11956 encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
11957 fidl::encoding::Encode::<DictionaryDrainIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11959 (
11960 <fidl::encoding::Vector<DictionaryItem, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
11961 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
11962 ),
11963 encoder, offset, _depth
11964 )
11965 }
11966 }
11967 unsafe impl<
11968 T0: fidl::encoding::Encode<
11969 fidl::encoding::Vector<DictionaryItem, 128>,
11970 fidl::encoding::DefaultFuchsiaResourceDialect,
11971 >,
11972 T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11973 >
11974 fidl::encoding::Encode<
11975 DictionaryDrainIteratorGetNextResponse,
11976 fidl::encoding::DefaultFuchsiaResourceDialect,
11977 > for (T0, T1)
11978 {
11979 #[inline]
11980 unsafe fn encode(
11981 self,
11982 encoder: &mut fidl::encoding::Encoder<
11983 '_,
11984 fidl::encoding::DefaultFuchsiaResourceDialect,
11985 >,
11986 offset: usize,
11987 depth: fidl::encoding::Depth,
11988 ) -> fidl::Result<()> {
11989 encoder.debug_check_bounds::<DictionaryDrainIteratorGetNextResponse>(offset);
11990 self.0.encode(encoder, offset + 0, depth)?;
11994 self.1.encode(encoder, offset + 16, depth)?;
11995 Ok(())
11996 }
11997 }
11998
11999 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12000 for DictionaryDrainIteratorGetNextResponse
12001 {
12002 #[inline(always)]
12003 fn new_empty() -> Self {
12004 Self {
12005 items: fidl::new_empty!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12006 end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12007 }
12008 }
12009
12010 #[inline]
12011 unsafe fn decode(
12012 &mut self,
12013 decoder: &mut fidl::encoding::Decoder<
12014 '_,
12015 fidl::encoding::DefaultFuchsiaResourceDialect,
12016 >,
12017 offset: usize,
12018 _depth: fidl::encoding::Depth,
12019 ) -> fidl::Result<()> {
12020 decoder.debug_check_bounds::<Self>(offset);
12021 fidl::decode!(fidl::encoding::Vector<DictionaryItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12023 fidl::decode!(
12024 u64,
12025 fidl::encoding::DefaultFuchsiaResourceDialect,
12026 &mut self.end_id,
12027 decoder,
12028 offset + 16,
12029 _depth
12030 )?;
12031 Ok(())
12032 }
12033 }
12034
12035 impl fidl::encoding::ResourceTypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12036 type Borrowed<'a> = &'a mut Self;
12037 fn take_or_borrow<'a>(
12038 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12039 ) -> Self::Borrowed<'a> {
12040 value
12041 }
12042 }
12043
12044 unsafe impl fidl::encoding::TypeMarker for DictionaryEnumerateIteratorGetNextResponse {
12045 type Owned = Self;
12046
12047 #[inline(always)]
12048 fn inline_align(_context: fidl::encoding::Context) -> usize {
12049 8
12050 }
12051
12052 #[inline(always)]
12053 fn inline_size(_context: fidl::encoding::Context) -> usize {
12054 24
12055 }
12056 }
12057
12058 unsafe impl
12059 fidl::encoding::Encode<
12060 DictionaryEnumerateIteratorGetNextResponse,
12061 fidl::encoding::DefaultFuchsiaResourceDialect,
12062 > for &mut DictionaryEnumerateIteratorGetNextResponse
12063 {
12064 #[inline]
12065 unsafe fn encode(
12066 self,
12067 encoder: &mut fidl::encoding::Encoder<
12068 '_,
12069 fidl::encoding::DefaultFuchsiaResourceDialect,
12070 >,
12071 offset: usize,
12072 _depth: fidl::encoding::Depth,
12073 ) -> fidl::Result<()> {
12074 encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12075 fidl::encoding::Encode::<DictionaryEnumerateIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12077 (
12078 <fidl::encoding::Vector<DictionaryOptionalItem, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.items),
12079 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_id),
12080 ),
12081 encoder, offset, _depth
12082 )
12083 }
12084 }
12085 unsafe impl<
12086 T0: fidl::encoding::Encode<
12087 fidl::encoding::Vector<DictionaryOptionalItem, 128>,
12088 fidl::encoding::DefaultFuchsiaResourceDialect,
12089 >,
12090 T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
12091 >
12092 fidl::encoding::Encode<
12093 DictionaryEnumerateIteratorGetNextResponse,
12094 fidl::encoding::DefaultFuchsiaResourceDialect,
12095 > for (T0, T1)
12096 {
12097 #[inline]
12098 unsafe fn encode(
12099 self,
12100 encoder: &mut fidl::encoding::Encoder<
12101 '_,
12102 fidl::encoding::DefaultFuchsiaResourceDialect,
12103 >,
12104 offset: usize,
12105 depth: fidl::encoding::Depth,
12106 ) -> fidl::Result<()> {
12107 encoder.debug_check_bounds::<DictionaryEnumerateIteratorGetNextResponse>(offset);
12108 self.0.encode(encoder, offset + 0, depth)?;
12112 self.1.encode(encoder, offset + 16, depth)?;
12113 Ok(())
12114 }
12115 }
12116
12117 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12118 for DictionaryEnumerateIteratorGetNextResponse
12119 {
12120 #[inline(always)]
12121 fn new_empty() -> Self {
12122 Self {
12123 items: fidl::new_empty!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect),
12124 end_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12125 }
12126 }
12127
12128 #[inline]
12129 unsafe fn decode(
12130 &mut self,
12131 decoder: &mut fidl::encoding::Decoder<
12132 '_,
12133 fidl::encoding::DefaultFuchsiaResourceDialect,
12134 >,
12135 offset: usize,
12136 _depth: fidl::encoding::Depth,
12137 ) -> fidl::Result<()> {
12138 decoder.debug_check_bounds::<Self>(offset);
12139 fidl::decode!(fidl::encoding::Vector<DictionaryOptionalItem, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.items, decoder, offset + 0, _depth)?;
12141 fidl::decode!(
12142 u64,
12143 fidl::encoding::DefaultFuchsiaResourceDialect,
12144 &mut self.end_id,
12145 decoder,
12146 offset + 16,
12147 _depth
12148 )?;
12149 Ok(())
12150 }
12151 }
12152
12153 impl fidl::encoding::ResourceTypeMarker for DictionaryKeysIteratorGetNextResponse {
12154 type Borrowed<'a> = &'a mut Self;
12155 fn take_or_borrow<'a>(
12156 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12157 ) -> Self::Borrowed<'a> {
12158 value
12159 }
12160 }
12161
12162 unsafe impl fidl::encoding::TypeMarker for DictionaryKeysIteratorGetNextResponse {
12163 type Owned = Self;
12164
12165 #[inline(always)]
12166 fn inline_align(_context: fidl::encoding::Context) -> usize {
12167 8
12168 }
12169
12170 #[inline(always)]
12171 fn inline_size(_context: fidl::encoding::Context) -> usize {
12172 16
12173 }
12174 }
12175
12176 unsafe impl
12177 fidl::encoding::Encode<
12178 DictionaryKeysIteratorGetNextResponse,
12179 fidl::encoding::DefaultFuchsiaResourceDialect,
12180 > for &mut DictionaryKeysIteratorGetNextResponse
12181 {
12182 #[inline]
12183 unsafe fn encode(
12184 self,
12185 encoder: &mut fidl::encoding::Encoder<
12186 '_,
12187 fidl::encoding::DefaultFuchsiaResourceDialect,
12188 >,
12189 offset: usize,
12190 _depth: fidl::encoding::Depth,
12191 ) -> fidl::Result<()> {
12192 encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12193 fidl::encoding::Encode::<DictionaryKeysIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12195 (
12196 <fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
12197 ),
12198 encoder, offset, _depth
12199 )
12200 }
12201 }
12202 unsafe impl<
12203 T0: fidl::encoding::Encode<
12204 fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12205 fidl::encoding::DefaultFuchsiaResourceDialect,
12206 >,
12207 >
12208 fidl::encoding::Encode<
12209 DictionaryKeysIteratorGetNextResponse,
12210 fidl::encoding::DefaultFuchsiaResourceDialect,
12211 > for (T0,)
12212 {
12213 #[inline]
12214 unsafe fn encode(
12215 self,
12216 encoder: &mut fidl::encoding::Encoder<
12217 '_,
12218 fidl::encoding::DefaultFuchsiaResourceDialect,
12219 >,
12220 offset: usize,
12221 depth: fidl::encoding::Depth,
12222 ) -> fidl::Result<()> {
12223 encoder.debug_check_bounds::<DictionaryKeysIteratorGetNextResponse>(offset);
12224 self.0.encode(encoder, offset + 0, depth)?;
12228 Ok(())
12229 }
12230 }
12231
12232 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12233 for DictionaryKeysIteratorGetNextResponse
12234 {
12235 #[inline(always)]
12236 fn new_empty() -> Self {
12237 Self {
12238 keys: fidl::new_empty!(
12239 fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12240 fidl::encoding::DefaultFuchsiaResourceDialect
12241 ),
12242 }
12243 }
12244
12245 #[inline]
12246 unsafe fn decode(
12247 &mut self,
12248 decoder: &mut fidl::encoding::Decoder<
12249 '_,
12250 fidl::encoding::DefaultFuchsiaResourceDialect,
12251 >,
12252 offset: usize,
12253 _depth: fidl::encoding::Depth,
12254 ) -> fidl::Result<()> {
12255 decoder.debug_check_bounds::<Self>(offset);
12256 fidl::decode!(
12258 fidl::encoding::Vector<fidl::encoding::BoundedString<255>, 128>,
12259 fidl::encoding::DefaultFuchsiaResourceDialect,
12260 &mut self.keys,
12261 decoder,
12262 offset + 0,
12263 _depth
12264 )?;
12265 Ok(())
12266 }
12267 }
12268
12269 impl fidl::encoding::ResourceTypeMarker for DictionaryOptionalItem {
12270 type Borrowed<'a> = &'a mut Self;
12271 fn take_or_borrow<'a>(
12272 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12273 ) -> Self::Borrowed<'a> {
12274 value
12275 }
12276 }
12277
12278 unsafe impl fidl::encoding::TypeMarker for DictionaryOptionalItem {
12279 type Owned = Self;
12280
12281 #[inline(always)]
12282 fn inline_align(_context: fidl::encoding::Context) -> usize {
12283 8
12284 }
12285
12286 #[inline(always)]
12287 fn inline_size(_context: fidl::encoding::Context) -> usize {
12288 24
12289 }
12290 }
12291
12292 unsafe impl
12293 fidl::encoding::Encode<
12294 DictionaryOptionalItem,
12295 fidl::encoding::DefaultFuchsiaResourceDialect,
12296 > for &mut DictionaryOptionalItem
12297 {
12298 #[inline]
12299 unsafe fn encode(
12300 self,
12301 encoder: &mut fidl::encoding::Encoder<
12302 '_,
12303 fidl::encoding::DefaultFuchsiaResourceDialect,
12304 >,
12305 offset: usize,
12306 _depth: fidl::encoding::Depth,
12307 ) -> fidl::Result<()> {
12308 encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12309 fidl::encoding::Encode::<DictionaryOptionalItem, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12311 (
12312 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
12313 <fidl::encoding::Boxed<WrappedCapabilityId> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
12314 ),
12315 encoder, offset, _depth
12316 )
12317 }
12318 }
12319 unsafe impl<
12320 T0: fidl::encoding::Encode<
12321 fidl::encoding::BoundedString<255>,
12322 fidl::encoding::DefaultFuchsiaResourceDialect,
12323 >,
12324 T1: fidl::encoding::Encode<
12325 fidl::encoding::Boxed<WrappedCapabilityId>,
12326 fidl::encoding::DefaultFuchsiaResourceDialect,
12327 >,
12328 >
12329 fidl::encoding::Encode<
12330 DictionaryOptionalItem,
12331 fidl::encoding::DefaultFuchsiaResourceDialect,
12332 > for (T0, T1)
12333 {
12334 #[inline]
12335 unsafe fn encode(
12336 self,
12337 encoder: &mut fidl::encoding::Encoder<
12338 '_,
12339 fidl::encoding::DefaultFuchsiaResourceDialect,
12340 >,
12341 offset: usize,
12342 depth: fidl::encoding::Depth,
12343 ) -> fidl::Result<()> {
12344 encoder.debug_check_bounds::<DictionaryOptionalItem>(offset);
12345 self.0.encode(encoder, offset + 0, depth)?;
12349 self.1.encode(encoder, offset + 16, depth)?;
12350 Ok(())
12351 }
12352 }
12353
12354 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12355 for DictionaryOptionalItem
12356 {
12357 #[inline(always)]
12358 fn new_empty() -> Self {
12359 Self {
12360 key: fidl::new_empty!(
12361 fidl::encoding::BoundedString<255>,
12362 fidl::encoding::DefaultFuchsiaResourceDialect
12363 ),
12364 value: fidl::new_empty!(
12365 fidl::encoding::Boxed<WrappedCapabilityId>,
12366 fidl::encoding::DefaultFuchsiaResourceDialect
12367 ),
12368 }
12369 }
12370
12371 #[inline]
12372 unsafe fn decode(
12373 &mut self,
12374 decoder: &mut fidl::encoding::Decoder<
12375 '_,
12376 fidl::encoding::DefaultFuchsiaResourceDialect,
12377 >,
12378 offset: usize,
12379 _depth: fidl::encoding::Depth,
12380 ) -> fidl::Result<()> {
12381 decoder.debug_check_bounds::<Self>(offset);
12382 fidl::decode!(
12384 fidl::encoding::BoundedString<255>,
12385 fidl::encoding::DefaultFuchsiaResourceDialect,
12386 &mut self.key,
12387 decoder,
12388 offset + 0,
12389 _depth
12390 )?;
12391 fidl::decode!(
12392 fidl::encoding::Boxed<WrappedCapabilityId>,
12393 fidl::encoding::DefaultFuchsiaResourceDialect,
12394 &mut self.value,
12395 decoder,
12396 offset + 16,
12397 _depth
12398 )?;
12399 Ok(())
12400 }
12401 }
12402
12403 impl fidl::encoding::ResourceTypeMarker for DictionaryRef {
12404 type Borrowed<'a> = &'a mut Self;
12405 fn take_or_borrow<'a>(
12406 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12407 ) -> Self::Borrowed<'a> {
12408 value
12409 }
12410 }
12411
12412 unsafe impl fidl::encoding::TypeMarker for DictionaryRef {
12413 type Owned = Self;
12414
12415 #[inline(always)]
12416 fn inline_align(_context: fidl::encoding::Context) -> usize {
12417 4
12418 }
12419
12420 #[inline(always)]
12421 fn inline_size(_context: fidl::encoding::Context) -> usize {
12422 4
12423 }
12424 }
12425
12426 unsafe impl fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12427 for &mut DictionaryRef
12428 {
12429 #[inline]
12430 unsafe fn encode(
12431 self,
12432 encoder: &mut fidl::encoding::Encoder<
12433 '_,
12434 fidl::encoding::DefaultFuchsiaResourceDialect,
12435 >,
12436 offset: usize,
12437 _depth: fidl::encoding::Depth,
12438 ) -> fidl::Result<()> {
12439 encoder.debug_check_bounds::<DictionaryRef>(offset);
12440 fidl::encoding::Encode::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12442 (
12443 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12444 ),
12445 encoder, offset, _depth
12446 )
12447 }
12448 }
12449 unsafe impl<
12450 T0: fidl::encoding::Encode<
12451 fidl::encoding::HandleType<
12452 fidl::EventPair,
12453 { fidl::ObjectType::EVENTPAIR.into_raw() },
12454 2147483648,
12455 >,
12456 fidl::encoding::DefaultFuchsiaResourceDialect,
12457 >,
12458 > fidl::encoding::Encode<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>
12459 for (T0,)
12460 {
12461 #[inline]
12462 unsafe fn encode(
12463 self,
12464 encoder: &mut fidl::encoding::Encoder<
12465 '_,
12466 fidl::encoding::DefaultFuchsiaResourceDialect,
12467 >,
12468 offset: usize,
12469 depth: fidl::encoding::Depth,
12470 ) -> fidl::Result<()> {
12471 encoder.debug_check_bounds::<DictionaryRef>(offset);
12472 self.0.encode(encoder, offset + 0, depth)?;
12476 Ok(())
12477 }
12478 }
12479
12480 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DictionaryRef {
12481 #[inline(always)]
12482 fn new_empty() -> Self {
12483 Self {
12484 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12485 }
12486 }
12487
12488 #[inline]
12489 unsafe fn decode(
12490 &mut self,
12491 decoder: &mut fidl::encoding::Decoder<
12492 '_,
12493 fidl::encoding::DefaultFuchsiaResourceDialect,
12494 >,
12495 offset: usize,
12496 _depth: fidl::encoding::Depth,
12497 ) -> fidl::Result<()> {
12498 decoder.debug_check_bounds::<Self>(offset);
12499 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12501 Ok(())
12502 }
12503 }
12504
12505 impl fidl::encoding::ResourceTypeMarker for DirConnector {
12506 type Borrowed<'a> = &'a mut Self;
12507 fn take_or_borrow<'a>(
12508 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12509 ) -> Self::Borrowed<'a> {
12510 value
12511 }
12512 }
12513
12514 unsafe impl fidl::encoding::TypeMarker for DirConnector {
12515 type Owned = Self;
12516
12517 #[inline(always)]
12518 fn inline_align(_context: fidl::encoding::Context) -> usize {
12519 4
12520 }
12521
12522 #[inline(always)]
12523 fn inline_size(_context: fidl::encoding::Context) -> usize {
12524 4
12525 }
12526 }
12527
12528 unsafe impl fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>
12529 for &mut DirConnector
12530 {
12531 #[inline]
12532 unsafe fn encode(
12533 self,
12534 encoder: &mut fidl::encoding::Encoder<
12535 '_,
12536 fidl::encoding::DefaultFuchsiaResourceDialect,
12537 >,
12538 offset: usize,
12539 _depth: fidl::encoding::Depth,
12540 ) -> fidl::Result<()> {
12541 encoder.debug_check_bounds::<DirConnector>(offset);
12542 fidl::encoding::Encode::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12544 (
12545 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12546 ),
12547 encoder, offset, _depth
12548 )
12549 }
12550 }
12551 unsafe impl<
12552 T0: fidl::encoding::Encode<
12553 fidl::encoding::HandleType<
12554 fidl::EventPair,
12555 { fidl::ObjectType::EVENTPAIR.into_raw() },
12556 2147483648,
12557 >,
12558 fidl::encoding::DefaultFuchsiaResourceDialect,
12559 >,
12560 > fidl::encoding::Encode<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
12561 {
12562 #[inline]
12563 unsafe fn encode(
12564 self,
12565 encoder: &mut fidl::encoding::Encoder<
12566 '_,
12567 fidl::encoding::DefaultFuchsiaResourceDialect,
12568 >,
12569 offset: usize,
12570 depth: fidl::encoding::Depth,
12571 ) -> fidl::Result<()> {
12572 encoder.debug_check_bounds::<DirConnector>(offset);
12573 self.0.encode(encoder, offset + 0, depth)?;
12577 Ok(())
12578 }
12579 }
12580
12581 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirConnector {
12582 #[inline(always)]
12583 fn new_empty() -> Self {
12584 Self {
12585 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12586 }
12587 }
12588
12589 #[inline]
12590 unsafe fn decode(
12591 &mut self,
12592 decoder: &mut fidl::encoding::Decoder<
12593 '_,
12594 fidl::encoding::DefaultFuchsiaResourceDialect,
12595 >,
12596 offset: usize,
12597 _depth: fidl::encoding::Depth,
12598 ) -> fidl::Result<()> {
12599 decoder.debug_check_bounds::<Self>(offset);
12600 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12602 Ok(())
12603 }
12604 }
12605
12606 impl fidl::encoding::ResourceTypeMarker for DirEntry {
12607 type Borrowed<'a> = &'a mut Self;
12608 fn take_or_borrow<'a>(
12609 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12610 ) -> Self::Borrowed<'a> {
12611 value
12612 }
12613 }
12614
12615 unsafe impl fidl::encoding::TypeMarker for DirEntry {
12616 type Owned = Self;
12617
12618 #[inline(always)]
12619 fn inline_align(_context: fidl::encoding::Context) -> usize {
12620 4
12621 }
12622
12623 #[inline(always)]
12624 fn inline_size(_context: fidl::encoding::Context) -> usize {
12625 4
12626 }
12627 }
12628
12629 unsafe impl fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
12630 for &mut DirEntry
12631 {
12632 #[inline]
12633 unsafe fn encode(
12634 self,
12635 encoder: &mut fidl::encoding::Encoder<
12636 '_,
12637 fidl::encoding::DefaultFuchsiaResourceDialect,
12638 >,
12639 offset: usize,
12640 _depth: fidl::encoding::Depth,
12641 ) -> fidl::Result<()> {
12642 encoder.debug_check_bounds::<DirEntry>(offset);
12643 fidl::encoding::Encode::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12645 (
12646 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12647 ),
12648 encoder, offset, _depth
12649 )
12650 }
12651 }
12652 unsafe impl<
12653 T0: fidl::encoding::Encode<
12654 fidl::encoding::HandleType<
12655 fidl::EventPair,
12656 { fidl::ObjectType::EVENTPAIR.into_raw() },
12657 2147483648,
12658 >,
12659 fidl::encoding::DefaultFuchsiaResourceDialect,
12660 >,
12661 > fidl::encoding::Encode<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect> for (T0,)
12662 {
12663 #[inline]
12664 unsafe fn encode(
12665 self,
12666 encoder: &mut fidl::encoding::Encoder<
12667 '_,
12668 fidl::encoding::DefaultFuchsiaResourceDialect,
12669 >,
12670 offset: usize,
12671 depth: fidl::encoding::Depth,
12672 ) -> fidl::Result<()> {
12673 encoder.debug_check_bounds::<DirEntry>(offset);
12674 self.0.encode(encoder, offset + 0, depth)?;
12678 Ok(())
12679 }
12680 }
12681
12682 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for DirEntry {
12683 #[inline(always)]
12684 fn new_empty() -> Self {
12685 Self {
12686 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12687 }
12688 }
12689
12690 #[inline]
12691 unsafe fn decode(
12692 &mut self,
12693 decoder: &mut fidl::encoding::Decoder<
12694 '_,
12695 fidl::encoding::DefaultFuchsiaResourceDialect,
12696 >,
12697 offset: usize,
12698 _depth: fidl::encoding::Depth,
12699 ) -> fidl::Result<()> {
12700 decoder.debug_check_bounds::<Self>(offset);
12701 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12703 Ok(())
12704 }
12705 }
12706
12707 impl fidl::encoding::ResourceTypeMarker for InstanceToken {
12708 type Borrowed<'a> = &'a mut Self;
12709 fn take_or_borrow<'a>(
12710 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12711 ) -> Self::Borrowed<'a> {
12712 value
12713 }
12714 }
12715
12716 unsafe impl fidl::encoding::TypeMarker for InstanceToken {
12717 type Owned = Self;
12718
12719 #[inline(always)]
12720 fn inline_align(_context: fidl::encoding::Context) -> usize {
12721 4
12722 }
12723
12724 #[inline(always)]
12725 fn inline_size(_context: fidl::encoding::Context) -> usize {
12726 4
12727 }
12728 }
12729
12730 unsafe impl fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
12731 for &mut InstanceToken
12732 {
12733 #[inline]
12734 unsafe fn encode(
12735 self,
12736 encoder: &mut fidl::encoding::Encoder<
12737 '_,
12738 fidl::encoding::DefaultFuchsiaResourceDialect,
12739 >,
12740 offset: usize,
12741 _depth: fidl::encoding::Depth,
12742 ) -> fidl::Result<()> {
12743 encoder.debug_check_bounds::<InstanceToken>(offset);
12744 fidl::encoding::Encode::<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12746 (
12747 <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.token),
12748 ),
12749 encoder, offset, _depth
12750 )
12751 }
12752 }
12753 unsafe impl<
12754 T0: fidl::encoding::Encode<
12755 fidl::encoding::HandleType<
12756 fidl::EventPair,
12757 { fidl::ObjectType::EVENTPAIR.into_raw() },
12758 2147483648,
12759 >,
12760 fidl::encoding::DefaultFuchsiaResourceDialect,
12761 >,
12762 > fidl::encoding::Encode<InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect>
12763 for (T0,)
12764 {
12765 #[inline]
12766 unsafe fn encode(
12767 self,
12768 encoder: &mut fidl::encoding::Encoder<
12769 '_,
12770 fidl::encoding::DefaultFuchsiaResourceDialect,
12771 >,
12772 offset: usize,
12773 depth: fidl::encoding::Depth,
12774 ) -> fidl::Result<()> {
12775 encoder.debug_check_bounds::<InstanceToken>(offset);
12776 self.0.encode(encoder, offset + 0, depth)?;
12780 Ok(())
12781 }
12782 }
12783
12784 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for InstanceToken {
12785 #[inline(always)]
12786 fn new_empty() -> Self {
12787 Self {
12788 token: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12789 }
12790 }
12791
12792 #[inline]
12793 unsafe fn decode(
12794 &mut self,
12795 decoder: &mut fidl::encoding::Decoder<
12796 '_,
12797 fidl::encoding::DefaultFuchsiaResourceDialect,
12798 >,
12799 offset: usize,
12800 _depth: fidl::encoding::Depth,
12801 ) -> fidl::Result<()> {
12802 decoder.debug_check_bounds::<Self>(offset);
12803 fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.token, decoder, offset + 0, _depth)?;
12805 Ok(())
12806 }
12807 }
12808
12809 impl fidl::encoding::ResourceTypeMarker for ProtocolPayload {
12810 type Borrowed<'a> = &'a mut Self;
12811 fn take_or_borrow<'a>(
12812 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12813 ) -> Self::Borrowed<'a> {
12814 value
12815 }
12816 }
12817
12818 unsafe impl fidl::encoding::TypeMarker for ProtocolPayload {
12819 type Owned = Self;
12820
12821 #[inline(always)]
12822 fn inline_align(_context: fidl::encoding::Context) -> usize {
12823 4
12824 }
12825
12826 #[inline(always)]
12827 fn inline_size(_context: fidl::encoding::Context) -> usize {
12828 4
12829 }
12830 }
12831
12832 unsafe impl
12833 fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
12834 for &mut ProtocolPayload
12835 {
12836 #[inline]
12837 unsafe fn encode(
12838 self,
12839 encoder: &mut fidl::encoding::Encoder<
12840 '_,
12841 fidl::encoding::DefaultFuchsiaResourceDialect,
12842 >,
12843 offset: usize,
12844 _depth: fidl::encoding::Depth,
12845 ) -> fidl::Result<()> {
12846 encoder.debug_check_bounds::<ProtocolPayload>(offset);
12847 fidl::encoding::Encode::<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
12849 (
12850 <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.channel),
12851 ),
12852 encoder, offset, _depth
12853 )
12854 }
12855 }
12856 unsafe impl<
12857 T0: fidl::encoding::Encode<
12858 fidl::encoding::HandleType<
12859 fidl::Channel,
12860 { fidl::ObjectType::CHANNEL.into_raw() },
12861 2147483648,
12862 >,
12863 fidl::encoding::DefaultFuchsiaResourceDialect,
12864 >,
12865 > fidl::encoding::Encode<ProtocolPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
12866 for (T0,)
12867 {
12868 #[inline]
12869 unsafe fn encode(
12870 self,
12871 encoder: &mut fidl::encoding::Encoder<
12872 '_,
12873 fidl::encoding::DefaultFuchsiaResourceDialect,
12874 >,
12875 offset: usize,
12876 depth: fidl::encoding::Depth,
12877 ) -> fidl::Result<()> {
12878 encoder.debug_check_bounds::<ProtocolPayload>(offset);
12879 self.0.encode(encoder, offset + 0, depth)?;
12883 Ok(())
12884 }
12885 }
12886
12887 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12888 for ProtocolPayload
12889 {
12890 #[inline(always)]
12891 fn new_empty() -> Self {
12892 Self {
12893 channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12894 }
12895 }
12896
12897 #[inline]
12898 unsafe fn decode(
12899 &mut self,
12900 decoder: &mut fidl::encoding::Decoder<
12901 '_,
12902 fidl::encoding::DefaultFuchsiaResourceDialect,
12903 >,
12904 offset: usize,
12905 _depth: fidl::encoding::Depth,
12906 ) -> fidl::Result<()> {
12907 decoder.debug_check_bounds::<Self>(offset);
12908 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
12910 Ok(())
12911 }
12912 }
12913
12914 impl CapabilityStoreDirConnectorOpenRequest {
12915 #[inline(always)]
12916 fn max_ordinal_present(&self) -> u64 {
12917 if let Some(_) = self.path {
12918 return 4;
12919 }
12920 if let Some(_) = self.flags {
12921 return 3;
12922 }
12923 if let Some(_) = self.server_end {
12924 return 2;
12925 }
12926 if let Some(_) = self.id {
12927 return 1;
12928 }
12929 0
12930 }
12931 }
12932
12933 impl fidl::encoding::ResourceTypeMarker for CapabilityStoreDirConnectorOpenRequest {
12934 type Borrowed<'a> = &'a mut Self;
12935 fn take_or_borrow<'a>(
12936 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12937 ) -> Self::Borrowed<'a> {
12938 value
12939 }
12940 }
12941
12942 unsafe impl fidl::encoding::TypeMarker for CapabilityStoreDirConnectorOpenRequest {
12943 type Owned = Self;
12944
12945 #[inline(always)]
12946 fn inline_align(_context: fidl::encoding::Context) -> usize {
12947 8
12948 }
12949
12950 #[inline(always)]
12951 fn inline_size(_context: fidl::encoding::Context) -> usize {
12952 16
12953 }
12954 }
12955
12956 unsafe impl
12957 fidl::encoding::Encode<
12958 CapabilityStoreDirConnectorOpenRequest,
12959 fidl::encoding::DefaultFuchsiaResourceDialect,
12960 > for &mut CapabilityStoreDirConnectorOpenRequest
12961 {
12962 unsafe fn encode(
12963 self,
12964 encoder: &mut fidl::encoding::Encoder<
12965 '_,
12966 fidl::encoding::DefaultFuchsiaResourceDialect,
12967 >,
12968 offset: usize,
12969 mut depth: fidl::encoding::Depth,
12970 ) -> fidl::Result<()> {
12971 encoder.debug_check_bounds::<CapabilityStoreDirConnectorOpenRequest>(offset);
12972 let max_ordinal: u64 = self.max_ordinal_present();
12974 encoder.write_num(max_ordinal, offset);
12975 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12976 if max_ordinal == 0 {
12978 return Ok(());
12979 }
12980 depth.increment()?;
12981 let envelope_size = 8;
12982 let bytes_len = max_ordinal as usize * envelope_size;
12983 #[allow(unused_variables)]
12984 let offset = encoder.out_of_line_offset(bytes_len);
12985 let mut _prev_end_offset: usize = 0;
12986 if 1 > max_ordinal {
12987 return Ok(());
12988 }
12989
12990 let cur_offset: usize = (1 - 1) * envelope_size;
12993
12994 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12996
12997 fidl::encoding::encode_in_envelope_optional::<
13002 u64,
13003 fidl::encoding::DefaultFuchsiaResourceDialect,
13004 >(
13005 self.id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
13006 encoder,
13007 offset + cur_offset,
13008 depth,
13009 )?;
13010
13011 _prev_end_offset = cur_offset + envelope_size;
13012 if 2 > max_ordinal {
13013 return Ok(());
13014 }
13015
13016 let cur_offset: usize = (2 - 1) * envelope_size;
13019
13020 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13022
13023 fidl::encoding::encode_in_envelope_optional::<
13028 fidl::encoding::Endpoint<
13029 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13030 >,
13031 fidl::encoding::DefaultFuchsiaResourceDialect,
13032 >(
13033 self.server_end.as_mut().map(
13034 <fidl::encoding::Endpoint<
13035 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13036 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13037 ),
13038 encoder,
13039 offset + cur_offset,
13040 depth,
13041 )?;
13042
13043 _prev_end_offset = cur_offset + envelope_size;
13044 if 3 > max_ordinal {
13045 return Ok(());
13046 }
13047
13048 let cur_offset: usize = (3 - 1) * envelope_size;
13051
13052 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13054
13055 fidl::encoding::encode_in_envelope_optional::<
13060 fidl_fuchsia_io::Flags,
13061 fidl::encoding::DefaultFuchsiaResourceDialect,
13062 >(
13063 self.flags
13064 .as_ref()
13065 .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
13066 encoder,
13067 offset + cur_offset,
13068 depth,
13069 )?;
13070
13071 _prev_end_offset = cur_offset + envelope_size;
13072 if 4 > max_ordinal {
13073 return Ok(());
13074 }
13075
13076 let cur_offset: usize = (4 - 1) * envelope_size;
13079
13080 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13082
13083 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13088 self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13089 encoder, offset + cur_offset, depth
13090 )?;
13091
13092 _prev_end_offset = cur_offset + envelope_size;
13093
13094 Ok(())
13095 }
13096 }
13097
13098 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13099 for CapabilityStoreDirConnectorOpenRequest
13100 {
13101 #[inline(always)]
13102 fn new_empty() -> Self {
13103 Self::default()
13104 }
13105
13106 unsafe fn decode(
13107 &mut self,
13108 decoder: &mut fidl::encoding::Decoder<
13109 '_,
13110 fidl::encoding::DefaultFuchsiaResourceDialect,
13111 >,
13112 offset: usize,
13113 mut depth: fidl::encoding::Depth,
13114 ) -> fidl::Result<()> {
13115 decoder.debug_check_bounds::<Self>(offset);
13116 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13117 None => return Err(fidl::Error::NotNullable),
13118 Some(len) => len,
13119 };
13120 if len == 0 {
13122 return Ok(());
13123 };
13124 depth.increment()?;
13125 let envelope_size = 8;
13126 let bytes_len = len * envelope_size;
13127 let offset = decoder.out_of_line_offset(bytes_len)?;
13128 let mut _next_ordinal_to_read = 0;
13130 let mut next_offset = offset;
13131 let end_offset = offset + bytes_len;
13132 _next_ordinal_to_read += 1;
13133 if next_offset >= end_offset {
13134 return Ok(());
13135 }
13136
13137 while _next_ordinal_to_read < 1 {
13139 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13140 _next_ordinal_to_read += 1;
13141 next_offset += envelope_size;
13142 }
13143
13144 let next_out_of_line = decoder.next_out_of_line();
13145 let handles_before = decoder.remaining_handles();
13146 if let Some((inlined, num_bytes, num_handles)) =
13147 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13148 {
13149 let member_inline_size =
13150 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13151 if inlined != (member_inline_size <= 4) {
13152 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13153 }
13154 let inner_offset;
13155 let mut inner_depth = depth.clone();
13156 if inlined {
13157 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13158 inner_offset = next_offset;
13159 } else {
13160 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13161 inner_depth.increment()?;
13162 }
13163 let val_ref = self.id.get_or_insert_with(|| {
13164 fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
13165 });
13166 fidl::decode!(
13167 u64,
13168 fidl::encoding::DefaultFuchsiaResourceDialect,
13169 val_ref,
13170 decoder,
13171 inner_offset,
13172 inner_depth
13173 )?;
13174 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13175 {
13176 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13177 }
13178 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13179 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13180 }
13181 }
13182
13183 next_offset += envelope_size;
13184 _next_ordinal_to_read += 1;
13185 if next_offset >= end_offset {
13186 return Ok(());
13187 }
13188
13189 while _next_ordinal_to_read < 2 {
13191 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13192 _next_ordinal_to_read += 1;
13193 next_offset += envelope_size;
13194 }
13195
13196 let next_out_of_line = decoder.next_out_of_line();
13197 let handles_before = decoder.remaining_handles();
13198 if let Some((inlined, num_bytes, num_handles)) =
13199 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13200 {
13201 let member_inline_size = <fidl::encoding::Endpoint<
13202 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13203 > as fidl::encoding::TypeMarker>::inline_size(
13204 decoder.context
13205 );
13206 if inlined != (member_inline_size <= 4) {
13207 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13208 }
13209 let inner_offset;
13210 let mut inner_depth = depth.clone();
13211 if inlined {
13212 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13213 inner_offset = next_offset;
13214 } else {
13215 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13216 inner_depth.increment()?;
13217 }
13218 let val_ref = self.server_end.get_or_insert_with(|| {
13219 fidl::new_empty!(
13220 fidl::encoding::Endpoint<
13221 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13222 >,
13223 fidl::encoding::DefaultFuchsiaResourceDialect
13224 )
13225 });
13226 fidl::decode!(
13227 fidl::encoding::Endpoint<
13228 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
13229 >,
13230 fidl::encoding::DefaultFuchsiaResourceDialect,
13231 val_ref,
13232 decoder,
13233 inner_offset,
13234 inner_depth
13235 )?;
13236 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13237 {
13238 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13239 }
13240 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13241 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13242 }
13243 }
13244
13245 next_offset += envelope_size;
13246 _next_ordinal_to_read += 1;
13247 if next_offset >= end_offset {
13248 return Ok(());
13249 }
13250
13251 while _next_ordinal_to_read < 3 {
13253 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13254 _next_ordinal_to_read += 1;
13255 next_offset += envelope_size;
13256 }
13257
13258 let next_out_of_line = decoder.next_out_of_line();
13259 let handles_before = decoder.remaining_handles();
13260 if let Some((inlined, num_bytes, num_handles)) =
13261 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13262 {
13263 let member_inline_size =
13264 <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
13265 decoder.context,
13266 );
13267 if inlined != (member_inline_size <= 4) {
13268 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13269 }
13270 let inner_offset;
13271 let mut inner_depth = depth.clone();
13272 if inlined {
13273 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13274 inner_offset = next_offset;
13275 } else {
13276 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13277 inner_depth.increment()?;
13278 }
13279 let val_ref = self.flags.get_or_insert_with(|| {
13280 fidl::new_empty!(
13281 fidl_fuchsia_io::Flags,
13282 fidl::encoding::DefaultFuchsiaResourceDialect
13283 )
13284 });
13285 fidl::decode!(
13286 fidl_fuchsia_io::Flags,
13287 fidl::encoding::DefaultFuchsiaResourceDialect,
13288 val_ref,
13289 decoder,
13290 inner_offset,
13291 inner_depth
13292 )?;
13293 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13294 {
13295 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13296 }
13297 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13298 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13299 }
13300 }
13301
13302 next_offset += envelope_size;
13303 _next_ordinal_to_read += 1;
13304 if next_offset >= end_offset {
13305 return Ok(());
13306 }
13307
13308 while _next_ordinal_to_read < 4 {
13310 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13311 _next_ordinal_to_read += 1;
13312 next_offset += envelope_size;
13313 }
13314
13315 let next_out_of_line = decoder.next_out_of_line();
13316 let handles_before = decoder.remaining_handles();
13317 if let Some((inlined, num_bytes, num_handles)) =
13318 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13319 {
13320 let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13321 if inlined != (member_inline_size <= 4) {
13322 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13323 }
13324 let inner_offset;
13325 let mut inner_depth = depth.clone();
13326 if inlined {
13327 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13328 inner_offset = next_offset;
13329 } else {
13330 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13331 inner_depth.increment()?;
13332 }
13333 let val_ref = self.path.get_or_insert_with(|| {
13334 fidl::new_empty!(
13335 fidl::encoding::BoundedString<4095>,
13336 fidl::encoding::DefaultFuchsiaResourceDialect
13337 )
13338 });
13339 fidl::decode!(
13340 fidl::encoding::BoundedString<4095>,
13341 fidl::encoding::DefaultFuchsiaResourceDialect,
13342 val_ref,
13343 decoder,
13344 inner_offset,
13345 inner_depth
13346 )?;
13347 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13348 {
13349 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13350 }
13351 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13352 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13353 }
13354 }
13355
13356 next_offset += envelope_size;
13357
13358 while next_offset < end_offset {
13360 _next_ordinal_to_read += 1;
13361 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13362 next_offset += envelope_size;
13363 }
13364
13365 Ok(())
13366 }
13367 }
13368
13369 impl DirReceiverReceiveRequest {
13370 #[inline(always)]
13371 fn max_ordinal_present(&self) -> u64 {
13372 if let Some(_) = self.subdir {
13373 return 3;
13374 }
13375 if let Some(_) = self.flags {
13376 return 2;
13377 }
13378 if let Some(_) = self.channel {
13379 return 1;
13380 }
13381 0
13382 }
13383 }
13384
13385 impl fidl::encoding::ResourceTypeMarker for DirReceiverReceiveRequest {
13386 type Borrowed<'a> = &'a mut Self;
13387 fn take_or_borrow<'a>(
13388 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13389 ) -> Self::Borrowed<'a> {
13390 value
13391 }
13392 }
13393
13394 unsafe impl fidl::encoding::TypeMarker for DirReceiverReceiveRequest {
13395 type Owned = Self;
13396
13397 #[inline(always)]
13398 fn inline_align(_context: fidl::encoding::Context) -> usize {
13399 8
13400 }
13401
13402 #[inline(always)]
13403 fn inline_size(_context: fidl::encoding::Context) -> usize {
13404 16
13405 }
13406 }
13407
13408 unsafe impl
13409 fidl::encoding::Encode<
13410 DirReceiverReceiveRequest,
13411 fidl::encoding::DefaultFuchsiaResourceDialect,
13412 > for &mut DirReceiverReceiveRequest
13413 {
13414 unsafe fn encode(
13415 self,
13416 encoder: &mut fidl::encoding::Encoder<
13417 '_,
13418 fidl::encoding::DefaultFuchsiaResourceDialect,
13419 >,
13420 offset: usize,
13421 mut depth: fidl::encoding::Depth,
13422 ) -> fidl::Result<()> {
13423 encoder.debug_check_bounds::<DirReceiverReceiveRequest>(offset);
13424 let max_ordinal: u64 = self.max_ordinal_present();
13426 encoder.write_num(max_ordinal, offset);
13427 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13428 if max_ordinal == 0 {
13430 return Ok(());
13431 }
13432 depth.increment()?;
13433 let envelope_size = 8;
13434 let bytes_len = max_ordinal as usize * envelope_size;
13435 #[allow(unused_variables)]
13436 let offset = encoder.out_of_line_offset(bytes_len);
13437 let mut _prev_end_offset: usize = 0;
13438 if 1 > max_ordinal {
13439 return Ok(());
13440 }
13441
13442 let cur_offset: usize = (1 - 1) * envelope_size;
13445
13446 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13448
13449 fidl::encoding::encode_in_envelope_optional::<
13454 fidl::encoding::HandleType<
13455 fidl::Channel,
13456 { fidl::ObjectType::CHANNEL.into_raw() },
13457 2147483648,
13458 >,
13459 fidl::encoding::DefaultFuchsiaResourceDialect,
13460 >(
13461 self.channel.as_mut().map(
13462 <fidl::encoding::HandleType<
13463 fidl::Channel,
13464 { fidl::ObjectType::CHANNEL.into_raw() },
13465 2147483648,
13466 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13467 ),
13468 encoder,
13469 offset + cur_offset,
13470 depth,
13471 )?;
13472
13473 _prev_end_offset = cur_offset + envelope_size;
13474 if 2 > max_ordinal {
13475 return Ok(());
13476 }
13477
13478 let cur_offset: usize = (2 - 1) * envelope_size;
13481
13482 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13484
13485 fidl::encoding::encode_in_envelope_optional::<
13490 fidl_fuchsia_io::Flags,
13491 fidl::encoding::DefaultFuchsiaResourceDialect,
13492 >(
13493 self.flags
13494 .as_ref()
13495 .map(<fidl_fuchsia_io::Flags as fidl::encoding::ValueTypeMarker>::borrow),
13496 encoder,
13497 offset + cur_offset,
13498 depth,
13499 )?;
13500
13501 _prev_end_offset = cur_offset + envelope_size;
13502 if 3 > max_ordinal {
13503 return Ok(());
13504 }
13505
13506 let cur_offset: usize = (3 - 1) * envelope_size;
13509
13510 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13512
13513 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13518 self.subdir.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13519 encoder, offset + cur_offset, depth
13520 )?;
13521
13522 _prev_end_offset = cur_offset + envelope_size;
13523
13524 Ok(())
13525 }
13526 }
13527
13528 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13529 for DirReceiverReceiveRequest
13530 {
13531 #[inline(always)]
13532 fn new_empty() -> Self {
13533 Self::default()
13534 }
13535
13536 unsafe fn decode(
13537 &mut self,
13538 decoder: &mut fidl::encoding::Decoder<
13539 '_,
13540 fidl::encoding::DefaultFuchsiaResourceDialect,
13541 >,
13542 offset: usize,
13543 mut depth: fidl::encoding::Depth,
13544 ) -> fidl::Result<()> {
13545 decoder.debug_check_bounds::<Self>(offset);
13546 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13547 None => return Err(fidl::Error::NotNullable),
13548 Some(len) => len,
13549 };
13550 if len == 0 {
13552 return Ok(());
13553 };
13554 depth.increment()?;
13555 let envelope_size = 8;
13556 let bytes_len = len * envelope_size;
13557 let offset = decoder.out_of_line_offset(bytes_len)?;
13558 let mut _next_ordinal_to_read = 0;
13560 let mut next_offset = offset;
13561 let end_offset = offset + bytes_len;
13562 _next_ordinal_to_read += 1;
13563 if next_offset >= end_offset {
13564 return Ok(());
13565 }
13566
13567 while _next_ordinal_to_read < 1 {
13569 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13570 _next_ordinal_to_read += 1;
13571 next_offset += envelope_size;
13572 }
13573
13574 let next_out_of_line = decoder.next_out_of_line();
13575 let handles_before = decoder.remaining_handles();
13576 if let Some((inlined, num_bytes, num_handles)) =
13577 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13578 {
13579 let member_inline_size = <fidl::encoding::HandleType<
13580 fidl::Channel,
13581 { fidl::ObjectType::CHANNEL.into_raw() },
13582 2147483648,
13583 > as fidl::encoding::TypeMarker>::inline_size(
13584 decoder.context
13585 );
13586 if inlined != (member_inline_size <= 4) {
13587 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13588 }
13589 let inner_offset;
13590 let mut inner_depth = depth.clone();
13591 if inlined {
13592 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13593 inner_offset = next_offset;
13594 } else {
13595 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13596 inner_depth.increment()?;
13597 }
13598 let val_ref =
13599 self.channel.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13600 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13601 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13602 {
13603 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13604 }
13605 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13606 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13607 }
13608 }
13609
13610 next_offset += envelope_size;
13611 _next_ordinal_to_read += 1;
13612 if next_offset >= end_offset {
13613 return Ok(());
13614 }
13615
13616 while _next_ordinal_to_read < 2 {
13618 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13619 _next_ordinal_to_read += 1;
13620 next_offset += envelope_size;
13621 }
13622
13623 let next_out_of_line = decoder.next_out_of_line();
13624 let handles_before = decoder.remaining_handles();
13625 if let Some((inlined, num_bytes, num_handles)) =
13626 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13627 {
13628 let member_inline_size =
13629 <fidl_fuchsia_io::Flags as fidl::encoding::TypeMarker>::inline_size(
13630 decoder.context,
13631 );
13632 if inlined != (member_inline_size <= 4) {
13633 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13634 }
13635 let inner_offset;
13636 let mut inner_depth = depth.clone();
13637 if inlined {
13638 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13639 inner_offset = next_offset;
13640 } else {
13641 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13642 inner_depth.increment()?;
13643 }
13644 let val_ref = self.flags.get_or_insert_with(|| {
13645 fidl::new_empty!(
13646 fidl_fuchsia_io::Flags,
13647 fidl::encoding::DefaultFuchsiaResourceDialect
13648 )
13649 });
13650 fidl::decode!(
13651 fidl_fuchsia_io::Flags,
13652 fidl::encoding::DefaultFuchsiaResourceDialect,
13653 val_ref,
13654 decoder,
13655 inner_offset,
13656 inner_depth
13657 )?;
13658 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13659 {
13660 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13661 }
13662 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13663 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13664 }
13665 }
13666
13667 next_offset += envelope_size;
13668 _next_ordinal_to_read += 1;
13669 if next_offset >= end_offset {
13670 return Ok(());
13671 }
13672
13673 while _next_ordinal_to_read < 3 {
13675 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13676 _next_ordinal_to_read += 1;
13677 next_offset += envelope_size;
13678 }
13679
13680 let next_out_of_line = decoder.next_out_of_line();
13681 let handles_before = decoder.remaining_handles();
13682 if let Some((inlined, num_bytes, num_handles)) =
13683 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13684 {
13685 let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13686 if inlined != (member_inline_size <= 4) {
13687 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13688 }
13689 let inner_offset;
13690 let mut inner_depth = depth.clone();
13691 if inlined {
13692 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13693 inner_offset = next_offset;
13694 } else {
13695 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13696 inner_depth.increment()?;
13697 }
13698 let val_ref = self.subdir.get_or_insert_with(|| {
13699 fidl::new_empty!(
13700 fidl::encoding::BoundedString<4095>,
13701 fidl::encoding::DefaultFuchsiaResourceDialect
13702 )
13703 });
13704 fidl::decode!(
13705 fidl::encoding::BoundedString<4095>,
13706 fidl::encoding::DefaultFuchsiaResourceDialect,
13707 val_ref,
13708 decoder,
13709 inner_offset,
13710 inner_depth
13711 )?;
13712 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13713 {
13714 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13715 }
13716 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13717 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13718 }
13719 }
13720
13721 next_offset += envelope_size;
13722
13723 while next_offset < end_offset {
13725 _next_ordinal_to_read += 1;
13726 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13727 next_offset += envelope_size;
13728 }
13729
13730 Ok(())
13731 }
13732 }
13733
13734 impl RouteRequest {
13735 #[inline(always)]
13736 fn max_ordinal_present(&self) -> u64 {
13737 if let Some(_) = self.metadata {
13738 return 2;
13739 }
13740 if let Some(_) = self.requesting {
13741 return 1;
13742 }
13743 0
13744 }
13745 }
13746
13747 impl fidl::encoding::ResourceTypeMarker for RouteRequest {
13748 type Borrowed<'a> = &'a mut Self;
13749 fn take_or_borrow<'a>(
13750 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13751 ) -> Self::Borrowed<'a> {
13752 value
13753 }
13754 }
13755
13756 unsafe impl fidl::encoding::TypeMarker for RouteRequest {
13757 type Owned = Self;
13758
13759 #[inline(always)]
13760 fn inline_align(_context: fidl::encoding::Context) -> usize {
13761 8
13762 }
13763
13764 #[inline(always)]
13765 fn inline_size(_context: fidl::encoding::Context) -> usize {
13766 16
13767 }
13768 }
13769
13770 unsafe impl fidl::encoding::Encode<RouteRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
13771 for &mut RouteRequest
13772 {
13773 unsafe fn encode(
13774 self,
13775 encoder: &mut fidl::encoding::Encoder<
13776 '_,
13777 fidl::encoding::DefaultFuchsiaResourceDialect,
13778 >,
13779 offset: usize,
13780 mut depth: fidl::encoding::Depth,
13781 ) -> fidl::Result<()> {
13782 encoder.debug_check_bounds::<RouteRequest>(offset);
13783 let max_ordinal: u64 = self.max_ordinal_present();
13785 encoder.write_num(max_ordinal, offset);
13786 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13787 if max_ordinal == 0 {
13789 return Ok(());
13790 }
13791 depth.increment()?;
13792 let envelope_size = 8;
13793 let bytes_len = max_ordinal as usize * envelope_size;
13794 #[allow(unused_variables)]
13795 let offset = encoder.out_of_line_offset(bytes_len);
13796 let mut _prev_end_offset: usize = 0;
13797 if 1 > max_ordinal {
13798 return Ok(());
13799 }
13800
13801 let cur_offset: usize = (1 - 1) * envelope_size;
13804
13805 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13807
13808 fidl::encoding::encode_in_envelope_optional::<
13813 InstanceToken,
13814 fidl::encoding::DefaultFuchsiaResourceDialect,
13815 >(
13816 self.requesting
13817 .as_mut()
13818 .map(<InstanceToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13819 encoder,
13820 offset + cur_offset,
13821 depth,
13822 )?;
13823
13824 _prev_end_offset = cur_offset + envelope_size;
13825 if 2 > max_ordinal {
13826 return Ok(());
13827 }
13828
13829 let cur_offset: usize = (2 - 1) * envelope_size;
13832
13833 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13835
13836 fidl::encoding::encode_in_envelope_optional::<
13841 DictionaryRef,
13842 fidl::encoding::DefaultFuchsiaResourceDialect,
13843 >(
13844 self.metadata
13845 .as_mut()
13846 .map(<DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13847 encoder,
13848 offset + cur_offset,
13849 depth,
13850 )?;
13851
13852 _prev_end_offset = cur_offset + envelope_size;
13853
13854 Ok(())
13855 }
13856 }
13857
13858 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for RouteRequest {
13859 #[inline(always)]
13860 fn new_empty() -> Self {
13861 Self::default()
13862 }
13863
13864 unsafe fn decode(
13865 &mut self,
13866 decoder: &mut fidl::encoding::Decoder<
13867 '_,
13868 fidl::encoding::DefaultFuchsiaResourceDialect,
13869 >,
13870 offset: usize,
13871 mut depth: fidl::encoding::Depth,
13872 ) -> fidl::Result<()> {
13873 decoder.debug_check_bounds::<Self>(offset);
13874 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13875 None => return Err(fidl::Error::NotNullable),
13876 Some(len) => len,
13877 };
13878 if len == 0 {
13880 return Ok(());
13881 };
13882 depth.increment()?;
13883 let envelope_size = 8;
13884 let bytes_len = len * envelope_size;
13885 let offset = decoder.out_of_line_offset(bytes_len)?;
13886 let mut _next_ordinal_to_read = 0;
13888 let mut next_offset = offset;
13889 let end_offset = offset + bytes_len;
13890 _next_ordinal_to_read += 1;
13891 if next_offset >= end_offset {
13892 return Ok(());
13893 }
13894
13895 while _next_ordinal_to_read < 1 {
13897 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13898 _next_ordinal_to_read += 1;
13899 next_offset += envelope_size;
13900 }
13901
13902 let next_out_of_line = decoder.next_out_of_line();
13903 let handles_before = decoder.remaining_handles();
13904 if let Some((inlined, num_bytes, num_handles)) =
13905 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13906 {
13907 let member_inline_size =
13908 <InstanceToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13909 if inlined != (member_inline_size <= 4) {
13910 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13911 }
13912 let inner_offset;
13913 let mut inner_depth = depth.clone();
13914 if inlined {
13915 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13916 inner_offset = next_offset;
13917 } else {
13918 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13919 inner_depth.increment()?;
13920 }
13921 let val_ref = self.requesting.get_or_insert_with(|| {
13922 fidl::new_empty!(InstanceToken, fidl::encoding::DefaultFuchsiaResourceDialect)
13923 });
13924 fidl::decode!(
13925 InstanceToken,
13926 fidl::encoding::DefaultFuchsiaResourceDialect,
13927 val_ref,
13928 decoder,
13929 inner_offset,
13930 inner_depth
13931 )?;
13932 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13933 {
13934 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13935 }
13936 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13937 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13938 }
13939 }
13940
13941 next_offset += envelope_size;
13942 _next_ordinal_to_read += 1;
13943 if next_offset >= end_offset {
13944 return Ok(());
13945 }
13946
13947 while _next_ordinal_to_read < 2 {
13949 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13950 _next_ordinal_to_read += 1;
13951 next_offset += envelope_size;
13952 }
13953
13954 let next_out_of_line = decoder.next_out_of_line();
13955 let handles_before = decoder.remaining_handles();
13956 if let Some((inlined, num_bytes, num_handles)) =
13957 fidl::encoding::decode_envelope_header(decoder, next_offset)?
13958 {
13959 let member_inline_size =
13960 <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13961 if inlined != (member_inline_size <= 4) {
13962 return Err(fidl::Error::InvalidInlineBitInEnvelope);
13963 }
13964 let inner_offset;
13965 let mut inner_depth = depth.clone();
13966 if inlined {
13967 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13968 inner_offset = next_offset;
13969 } else {
13970 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13971 inner_depth.increment()?;
13972 }
13973 let val_ref = self.metadata.get_or_insert_with(|| {
13974 fidl::new_empty!(DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect)
13975 });
13976 fidl::decode!(
13977 DictionaryRef,
13978 fidl::encoding::DefaultFuchsiaResourceDialect,
13979 val_ref,
13980 decoder,
13981 inner_offset,
13982 inner_depth
13983 )?;
13984 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13985 {
13986 return Err(fidl::Error::InvalidNumBytesInEnvelope);
13987 }
13988 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13989 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13990 }
13991 }
13992
13993 next_offset += envelope_size;
13994
13995 while next_offset < end_offset {
13997 _next_ordinal_to_read += 1;
13998 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13999 next_offset += envelope_size;
14000 }
14001
14002 Ok(())
14003 }
14004 }
14005
14006 impl fidl::encoding::ResourceTypeMarker for Capability {
14007 type Borrowed<'a> = &'a mut Self;
14008 fn take_or_borrow<'a>(
14009 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14010 ) -> Self::Borrowed<'a> {
14011 value
14012 }
14013 }
14014
14015 unsafe impl fidl::encoding::TypeMarker for Capability {
14016 type Owned = Self;
14017
14018 #[inline(always)]
14019 fn inline_align(_context: fidl::encoding::Context) -> usize {
14020 8
14021 }
14022
14023 #[inline(always)]
14024 fn inline_size(_context: fidl::encoding::Context) -> usize {
14025 16
14026 }
14027 }
14028
14029 unsafe impl fidl::encoding::Encode<Capability, fidl::encoding::DefaultFuchsiaResourceDialect>
14030 for &mut Capability
14031 {
14032 #[inline]
14033 unsafe fn encode(
14034 self,
14035 encoder: &mut fidl::encoding::Encoder<
14036 '_,
14037 fidl::encoding::DefaultFuchsiaResourceDialect,
14038 >,
14039 offset: usize,
14040 _depth: fidl::encoding::Depth,
14041 ) -> fidl::Result<()> {
14042 encoder.debug_check_bounds::<Capability>(offset);
14043 encoder.write_num::<u64>(self.ordinal(), offset);
14044 match self {
14045 Capability::Unit(ref val) => {
14046 fidl::encoding::encode_in_envelope::<Unit, fidl::encoding::DefaultFuchsiaResourceDialect>(
14047 <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14048 encoder, offset + 8, _depth
14049 )
14050 }
14051 Capability::Handle(ref mut val) => {
14052 fidl::encoding::encode_in_envelope::<fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14053 <fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14054 encoder, offset + 8, _depth
14055 )
14056 }
14057 Capability::Data(ref val) => {
14058 fidl::encoding::encode_in_envelope::<Data, fidl::encoding::DefaultFuchsiaResourceDialect>(
14059 <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
14060 encoder, offset + 8, _depth
14061 )
14062 }
14063 Capability::Dictionary(ref mut val) => {
14064 fidl::encoding::encode_in_envelope::<DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
14065 <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14066 encoder, offset + 8, _depth
14067 )
14068 }
14069 Capability::Connector(ref mut val) => {
14070 fidl::encoding::encode_in_envelope::<Connector, fidl::encoding::DefaultFuchsiaResourceDialect>(
14071 <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14072 encoder, offset + 8, _depth
14073 )
14074 }
14075 Capability::DirConnector(ref mut val) => {
14076 fidl::encoding::encode_in_envelope::<DirConnector, fidl::encoding::DefaultFuchsiaResourceDialect>(
14077 <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14078 encoder, offset + 8, _depth
14079 )
14080 }
14081 Capability::Directory(ref mut val) => {
14082 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14083 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14084 encoder, offset + 8, _depth
14085 )
14086 }
14087 Capability::DirEntry(ref mut val) => {
14088 fidl::encoding::encode_in_envelope::<DirEntry, fidl::encoding::DefaultFuchsiaResourceDialect>(
14089 <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14090 encoder, offset + 8, _depth
14091 )
14092 }
14093 Capability::ConnectorRouter(ref mut val) => {
14094 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14095 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14096 encoder, offset + 8, _depth
14097 )
14098 }
14099 Capability::DictionaryRouter(ref mut val) => {
14100 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14101 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14102 encoder, offset + 8, _depth
14103 )
14104 }
14105 Capability::DirEntryRouter(ref mut val) => {
14106 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14107 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14108 encoder, offset + 8, _depth
14109 )
14110 }
14111 Capability::DataRouter(ref mut val) => {
14112 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14113 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14114 encoder, offset + 8, _depth
14115 )
14116 }
14117 Capability::DirConnectorRouter(ref mut val) => {
14118 fidl::encoding::encode_in_envelope::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
14119 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14120 encoder, offset + 8, _depth
14121 )
14122 }
14123 Capability::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
14124 }
14125 }
14126 }
14127
14128 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Capability {
14129 #[inline(always)]
14130 fn new_empty() -> Self {
14131 Self::__SourceBreaking { unknown_ordinal: 0 }
14132 }
14133
14134 #[inline]
14135 unsafe fn decode(
14136 &mut self,
14137 decoder: &mut fidl::encoding::Decoder<
14138 '_,
14139 fidl::encoding::DefaultFuchsiaResourceDialect,
14140 >,
14141 offset: usize,
14142 mut depth: fidl::encoding::Depth,
14143 ) -> fidl::Result<()> {
14144 decoder.debug_check_bounds::<Self>(offset);
14145 #[allow(unused_variables)]
14146 let next_out_of_line = decoder.next_out_of_line();
14147 let handles_before = decoder.remaining_handles();
14148 let (ordinal, inlined, num_bytes, num_handles) =
14149 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14150
14151 let member_inline_size = match ordinal {
14152 1 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14153 2 => <fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14154 3 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14155 4 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14156 5 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14157 6 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14158 7 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14159 8 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14160 9 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14161 10 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DictionaryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14162 11 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirEntryRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14163 12 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14164 13 => <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DirConnectorRouterMarker>> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14165 0 => return Err(fidl::Error::UnknownUnionTag),
14166 _ => num_bytes as usize,
14167 };
14168
14169 if inlined != (member_inline_size <= 4) {
14170 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14171 }
14172 let _inner_offset;
14173 if inlined {
14174 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14175 _inner_offset = offset + 8;
14176 } else {
14177 depth.increment()?;
14178 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14179 }
14180 match ordinal {
14181 1 => {
14182 #[allow(irrefutable_let_patterns)]
14183 if let Capability::Unit(_) = self {
14184 } else {
14186 *self = Capability::Unit(fidl::new_empty!(
14188 Unit,
14189 fidl::encoding::DefaultFuchsiaResourceDialect
14190 ));
14191 }
14192 #[allow(irrefutable_let_patterns)]
14193 if let Capability::Unit(ref mut val) = self {
14194 fidl::decode!(
14195 Unit,
14196 fidl::encoding::DefaultFuchsiaResourceDialect,
14197 val,
14198 decoder,
14199 _inner_offset,
14200 depth
14201 )?;
14202 } else {
14203 unreachable!()
14204 }
14205 }
14206 2 => {
14207 #[allow(irrefutable_let_patterns)]
14208 if let Capability::Handle(_) = self {
14209 } else {
14211 *self = Capability::Handle(
14213 fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
14214 );
14215 }
14216 #[allow(irrefutable_let_patterns)]
14217 if let Capability::Handle(ref mut val) = self {
14218 fidl::decode!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val, decoder, _inner_offset, depth)?;
14219 } else {
14220 unreachable!()
14221 }
14222 }
14223 3 => {
14224 #[allow(irrefutable_let_patterns)]
14225 if let Capability::Data(_) = self {
14226 } else {
14228 *self = Capability::Data(fidl::new_empty!(
14230 Data,
14231 fidl::encoding::DefaultFuchsiaResourceDialect
14232 ));
14233 }
14234 #[allow(irrefutable_let_patterns)]
14235 if let Capability::Data(ref mut val) = self {
14236 fidl::decode!(
14237 Data,
14238 fidl::encoding::DefaultFuchsiaResourceDialect,
14239 val,
14240 decoder,
14241 _inner_offset,
14242 depth
14243 )?;
14244 } else {
14245 unreachable!()
14246 }
14247 }
14248 4 => {
14249 #[allow(irrefutable_let_patterns)]
14250 if let Capability::Dictionary(_) = self {
14251 } else {
14253 *self = Capability::Dictionary(fidl::new_empty!(
14255 DictionaryRef,
14256 fidl::encoding::DefaultFuchsiaResourceDialect
14257 ));
14258 }
14259 #[allow(irrefutable_let_patterns)]
14260 if let Capability::Dictionary(ref mut val) = self {
14261 fidl::decode!(
14262 DictionaryRef,
14263 fidl::encoding::DefaultFuchsiaResourceDialect,
14264 val,
14265 decoder,
14266 _inner_offset,
14267 depth
14268 )?;
14269 } else {
14270 unreachable!()
14271 }
14272 }
14273 5 => {
14274 #[allow(irrefutable_let_patterns)]
14275 if let Capability::Connector(_) = self {
14276 } else {
14278 *self = Capability::Connector(fidl::new_empty!(
14280 Connector,
14281 fidl::encoding::DefaultFuchsiaResourceDialect
14282 ));
14283 }
14284 #[allow(irrefutable_let_patterns)]
14285 if let Capability::Connector(ref mut val) = self {
14286 fidl::decode!(
14287 Connector,
14288 fidl::encoding::DefaultFuchsiaResourceDialect,
14289 val,
14290 decoder,
14291 _inner_offset,
14292 depth
14293 )?;
14294 } else {
14295 unreachable!()
14296 }
14297 }
14298 6 => {
14299 #[allow(irrefutable_let_patterns)]
14300 if let Capability::DirConnector(_) = self {
14301 } else {
14303 *self = Capability::DirConnector(fidl::new_empty!(
14305 DirConnector,
14306 fidl::encoding::DefaultFuchsiaResourceDialect
14307 ));
14308 }
14309 #[allow(irrefutable_let_patterns)]
14310 if let Capability::DirConnector(ref mut val) = self {
14311 fidl::decode!(
14312 DirConnector,
14313 fidl::encoding::DefaultFuchsiaResourceDialect,
14314 val,
14315 decoder,
14316 _inner_offset,
14317 depth
14318 )?;
14319 } else {
14320 unreachable!()
14321 }
14322 }
14323 7 => {
14324 #[allow(irrefutable_let_patterns)]
14325 if let Capability::Directory(_) = self {
14326 } else {
14328 *self = Capability::Directory(fidl::new_empty!(
14330 fidl::encoding::Endpoint<
14331 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14332 >,
14333 fidl::encoding::DefaultFuchsiaResourceDialect
14334 ));
14335 }
14336 #[allow(irrefutable_let_patterns)]
14337 if let Capability::Directory(ref mut val) = self {
14338 fidl::decode!(
14339 fidl::encoding::Endpoint<
14340 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
14341 >,
14342 fidl::encoding::DefaultFuchsiaResourceDialect,
14343 val,
14344 decoder,
14345 _inner_offset,
14346 depth
14347 )?;
14348 } else {
14349 unreachable!()
14350 }
14351 }
14352 8 => {
14353 #[allow(irrefutable_let_patterns)]
14354 if let Capability::DirEntry(_) = self {
14355 } else {
14357 *self = Capability::DirEntry(fidl::new_empty!(
14359 DirEntry,
14360 fidl::encoding::DefaultFuchsiaResourceDialect
14361 ));
14362 }
14363 #[allow(irrefutable_let_patterns)]
14364 if let Capability::DirEntry(ref mut val) = self {
14365 fidl::decode!(
14366 DirEntry,
14367 fidl::encoding::DefaultFuchsiaResourceDialect,
14368 val,
14369 decoder,
14370 _inner_offset,
14371 depth
14372 )?;
14373 } else {
14374 unreachable!()
14375 }
14376 }
14377 9 => {
14378 #[allow(irrefutable_let_patterns)]
14379 if let Capability::ConnectorRouter(_) = self {
14380 } else {
14382 *self = Capability::ConnectorRouter(fidl::new_empty!(
14384 fidl::encoding::Endpoint<
14385 fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
14386 >,
14387 fidl::encoding::DefaultFuchsiaResourceDialect
14388 ));
14389 }
14390 #[allow(irrefutable_let_patterns)]
14391 if let Capability::ConnectorRouter(ref mut val) = self {
14392 fidl::decode!(
14393 fidl::encoding::Endpoint<
14394 fidl::endpoints::ClientEnd<ConnectorRouterMarker>,
14395 >,
14396 fidl::encoding::DefaultFuchsiaResourceDialect,
14397 val,
14398 decoder,
14399 _inner_offset,
14400 depth
14401 )?;
14402 } else {
14403 unreachable!()
14404 }
14405 }
14406 10 => {
14407 #[allow(irrefutable_let_patterns)]
14408 if let Capability::DictionaryRouter(_) = self {
14409 } else {
14411 *self = Capability::DictionaryRouter(fidl::new_empty!(
14413 fidl::encoding::Endpoint<
14414 fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
14415 >,
14416 fidl::encoding::DefaultFuchsiaResourceDialect
14417 ));
14418 }
14419 #[allow(irrefutable_let_patterns)]
14420 if let Capability::DictionaryRouter(ref mut val) = self {
14421 fidl::decode!(
14422 fidl::encoding::Endpoint<
14423 fidl::endpoints::ClientEnd<DictionaryRouterMarker>,
14424 >,
14425 fidl::encoding::DefaultFuchsiaResourceDialect,
14426 val,
14427 decoder,
14428 _inner_offset,
14429 depth
14430 )?;
14431 } else {
14432 unreachable!()
14433 }
14434 }
14435 11 => {
14436 #[allow(irrefutable_let_patterns)]
14437 if let Capability::DirEntryRouter(_) = self {
14438 } else {
14440 *self = Capability::DirEntryRouter(fidl::new_empty!(
14442 fidl::encoding::Endpoint<
14443 fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
14444 >,
14445 fidl::encoding::DefaultFuchsiaResourceDialect
14446 ));
14447 }
14448 #[allow(irrefutable_let_patterns)]
14449 if let Capability::DirEntryRouter(ref mut val) = self {
14450 fidl::decode!(
14451 fidl::encoding::Endpoint<
14452 fidl::endpoints::ClientEnd<DirEntryRouterMarker>,
14453 >,
14454 fidl::encoding::DefaultFuchsiaResourceDialect,
14455 val,
14456 decoder,
14457 _inner_offset,
14458 depth
14459 )?;
14460 } else {
14461 unreachable!()
14462 }
14463 }
14464 12 => {
14465 #[allow(irrefutable_let_patterns)]
14466 if let Capability::DataRouter(_) = self {
14467 } else {
14469 *self = Capability::DataRouter(fidl::new_empty!(
14471 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
14472 fidl::encoding::DefaultFuchsiaResourceDialect
14473 ));
14474 }
14475 #[allow(irrefutable_let_patterns)]
14476 if let Capability::DataRouter(ref mut val) = self {
14477 fidl::decode!(
14478 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<DataRouterMarker>>,
14479 fidl::encoding::DefaultFuchsiaResourceDialect,
14480 val,
14481 decoder,
14482 _inner_offset,
14483 depth
14484 )?;
14485 } else {
14486 unreachable!()
14487 }
14488 }
14489 13 => {
14490 #[allow(irrefutable_let_patterns)]
14491 if let Capability::DirConnectorRouter(_) = self {
14492 } else {
14494 *self = Capability::DirConnectorRouter(fidl::new_empty!(
14496 fidl::encoding::Endpoint<
14497 fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
14498 >,
14499 fidl::encoding::DefaultFuchsiaResourceDialect
14500 ));
14501 }
14502 #[allow(irrefutable_let_patterns)]
14503 if let Capability::DirConnectorRouter(ref mut val) = self {
14504 fidl::decode!(
14505 fidl::encoding::Endpoint<
14506 fidl::endpoints::ClientEnd<DirConnectorRouterMarker>,
14507 >,
14508 fidl::encoding::DefaultFuchsiaResourceDialect,
14509 val,
14510 decoder,
14511 _inner_offset,
14512 depth
14513 )?;
14514 } else {
14515 unreachable!()
14516 }
14517 }
14518 #[allow(deprecated)]
14519 ordinal => {
14520 for _ in 0..num_handles {
14521 decoder.drop_next_handle()?;
14522 }
14523 *self = Capability::__SourceBreaking { unknown_ordinal: ordinal };
14524 }
14525 }
14526 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14527 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14528 }
14529 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14530 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14531 }
14532 Ok(())
14533 }
14534 }
14535
14536 impl fidl::encoding::ResourceTypeMarker for ConnectorRouterRouteResponse {
14537 type Borrowed<'a> = &'a mut Self;
14538 fn take_or_borrow<'a>(
14539 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14540 ) -> Self::Borrowed<'a> {
14541 value
14542 }
14543 }
14544
14545 unsafe impl fidl::encoding::TypeMarker for ConnectorRouterRouteResponse {
14546 type Owned = Self;
14547
14548 #[inline(always)]
14549 fn inline_align(_context: fidl::encoding::Context) -> usize {
14550 8
14551 }
14552
14553 #[inline(always)]
14554 fn inline_size(_context: fidl::encoding::Context) -> usize {
14555 16
14556 }
14557 }
14558
14559 unsafe impl
14560 fidl::encoding::Encode<
14561 ConnectorRouterRouteResponse,
14562 fidl::encoding::DefaultFuchsiaResourceDialect,
14563 > for &mut ConnectorRouterRouteResponse
14564 {
14565 #[inline]
14566 unsafe fn encode(
14567 self,
14568 encoder: &mut fidl::encoding::Encoder<
14569 '_,
14570 fidl::encoding::DefaultFuchsiaResourceDialect,
14571 >,
14572 offset: usize,
14573 _depth: fidl::encoding::Depth,
14574 ) -> fidl::Result<()> {
14575 encoder.debug_check_bounds::<ConnectorRouterRouteResponse>(offset);
14576 encoder.write_num::<u64>(self.ordinal(), offset);
14577 match self {
14578 ConnectorRouterRouteResponse::Connector(ref mut val) => {
14579 fidl::encoding::encode_in_envelope::<
14580 Connector,
14581 fidl::encoding::DefaultFuchsiaResourceDialect,
14582 >(
14583 <Connector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14584 encoder,
14585 offset + 8,
14586 _depth,
14587 )
14588 }
14589 ConnectorRouterRouteResponse::Unavailable(ref val) => {
14590 fidl::encoding::encode_in_envelope::<
14591 Unit,
14592 fidl::encoding::DefaultFuchsiaResourceDialect,
14593 >(
14594 <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14595 encoder,
14596 offset + 8,
14597 _depth,
14598 )
14599 }
14600 }
14601 }
14602 }
14603
14604 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14605 for ConnectorRouterRouteResponse
14606 {
14607 #[inline(always)]
14608 fn new_empty() -> Self {
14609 Self::Connector(fidl::new_empty!(
14610 Connector,
14611 fidl::encoding::DefaultFuchsiaResourceDialect
14612 ))
14613 }
14614
14615 #[inline]
14616 unsafe fn decode(
14617 &mut self,
14618 decoder: &mut fidl::encoding::Decoder<
14619 '_,
14620 fidl::encoding::DefaultFuchsiaResourceDialect,
14621 >,
14622 offset: usize,
14623 mut depth: fidl::encoding::Depth,
14624 ) -> fidl::Result<()> {
14625 decoder.debug_check_bounds::<Self>(offset);
14626 #[allow(unused_variables)]
14627 let next_out_of_line = decoder.next_out_of_line();
14628 let handles_before = decoder.remaining_handles();
14629 let (ordinal, inlined, num_bytes, num_handles) =
14630 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14631
14632 let member_inline_size = match ordinal {
14633 1 => <Connector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14634 2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14635 _ => return Err(fidl::Error::UnknownUnionTag),
14636 };
14637
14638 if inlined != (member_inline_size <= 4) {
14639 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14640 }
14641 let _inner_offset;
14642 if inlined {
14643 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14644 _inner_offset = offset + 8;
14645 } else {
14646 depth.increment()?;
14647 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14648 }
14649 match ordinal {
14650 1 => {
14651 #[allow(irrefutable_let_patterns)]
14652 if let ConnectorRouterRouteResponse::Connector(_) = self {
14653 } else {
14655 *self = ConnectorRouterRouteResponse::Connector(fidl::new_empty!(
14657 Connector,
14658 fidl::encoding::DefaultFuchsiaResourceDialect
14659 ));
14660 }
14661 #[allow(irrefutable_let_patterns)]
14662 if let ConnectorRouterRouteResponse::Connector(ref mut val) = self {
14663 fidl::decode!(
14664 Connector,
14665 fidl::encoding::DefaultFuchsiaResourceDialect,
14666 val,
14667 decoder,
14668 _inner_offset,
14669 depth
14670 )?;
14671 } else {
14672 unreachable!()
14673 }
14674 }
14675 2 => {
14676 #[allow(irrefutable_let_patterns)]
14677 if let ConnectorRouterRouteResponse::Unavailable(_) = self {
14678 } else {
14680 *self = ConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
14682 Unit,
14683 fidl::encoding::DefaultFuchsiaResourceDialect
14684 ));
14685 }
14686 #[allow(irrefutable_let_patterns)]
14687 if let ConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
14688 fidl::decode!(
14689 Unit,
14690 fidl::encoding::DefaultFuchsiaResourceDialect,
14691 val,
14692 decoder,
14693 _inner_offset,
14694 depth
14695 )?;
14696 } else {
14697 unreachable!()
14698 }
14699 }
14700 ordinal => panic!("unexpected ordinal {:?}", ordinal),
14701 }
14702 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14703 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14704 }
14705 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14706 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14707 }
14708 Ok(())
14709 }
14710 }
14711
14712 impl fidl::encoding::ResourceTypeMarker for DataRouterRouteResponse {
14713 type Borrowed<'a> = &'a mut Self;
14714 fn take_or_borrow<'a>(
14715 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14716 ) -> Self::Borrowed<'a> {
14717 value
14718 }
14719 }
14720
14721 unsafe impl fidl::encoding::TypeMarker for DataRouterRouteResponse {
14722 type Owned = Self;
14723
14724 #[inline(always)]
14725 fn inline_align(_context: fidl::encoding::Context) -> usize {
14726 8
14727 }
14728
14729 #[inline(always)]
14730 fn inline_size(_context: fidl::encoding::Context) -> usize {
14731 16
14732 }
14733 }
14734
14735 unsafe impl
14736 fidl::encoding::Encode<
14737 DataRouterRouteResponse,
14738 fidl::encoding::DefaultFuchsiaResourceDialect,
14739 > for &mut DataRouterRouteResponse
14740 {
14741 #[inline]
14742 unsafe fn encode(
14743 self,
14744 encoder: &mut fidl::encoding::Encoder<
14745 '_,
14746 fidl::encoding::DefaultFuchsiaResourceDialect,
14747 >,
14748 offset: usize,
14749 _depth: fidl::encoding::Depth,
14750 ) -> fidl::Result<()> {
14751 encoder.debug_check_bounds::<DataRouterRouteResponse>(offset);
14752 encoder.write_num::<u64>(self.ordinal(), offset);
14753 match self {
14754 DataRouterRouteResponse::Data(ref val) => fidl::encoding::encode_in_envelope::<
14755 Data,
14756 fidl::encoding::DefaultFuchsiaResourceDialect,
14757 >(
14758 <Data as fidl::encoding::ValueTypeMarker>::borrow(val),
14759 encoder,
14760 offset + 8,
14761 _depth,
14762 ),
14763 DataRouterRouteResponse::Unavailable(ref val) => {
14764 fidl::encoding::encode_in_envelope::<
14765 Unit,
14766 fidl::encoding::DefaultFuchsiaResourceDialect,
14767 >(
14768 <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14769 encoder,
14770 offset + 8,
14771 _depth,
14772 )
14773 }
14774 }
14775 }
14776 }
14777
14778 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14779 for DataRouterRouteResponse
14780 {
14781 #[inline(always)]
14782 fn new_empty() -> Self {
14783 Self::Data(fidl::new_empty!(Data, fidl::encoding::DefaultFuchsiaResourceDialect))
14784 }
14785
14786 #[inline]
14787 unsafe fn decode(
14788 &mut self,
14789 decoder: &mut fidl::encoding::Decoder<
14790 '_,
14791 fidl::encoding::DefaultFuchsiaResourceDialect,
14792 >,
14793 offset: usize,
14794 mut depth: fidl::encoding::Depth,
14795 ) -> fidl::Result<()> {
14796 decoder.debug_check_bounds::<Self>(offset);
14797 #[allow(unused_variables)]
14798 let next_out_of_line = decoder.next_out_of_line();
14799 let handles_before = decoder.remaining_handles();
14800 let (ordinal, inlined, num_bytes, num_handles) =
14801 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14802
14803 let member_inline_size = match ordinal {
14804 1 => <Data as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14805 2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14806 _ => return Err(fidl::Error::UnknownUnionTag),
14807 };
14808
14809 if inlined != (member_inline_size <= 4) {
14810 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14811 }
14812 let _inner_offset;
14813 if inlined {
14814 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14815 _inner_offset = offset + 8;
14816 } else {
14817 depth.increment()?;
14818 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14819 }
14820 match ordinal {
14821 1 => {
14822 #[allow(irrefutable_let_patterns)]
14823 if let DataRouterRouteResponse::Data(_) = self {
14824 } else {
14826 *self = DataRouterRouteResponse::Data(fidl::new_empty!(
14828 Data,
14829 fidl::encoding::DefaultFuchsiaResourceDialect
14830 ));
14831 }
14832 #[allow(irrefutable_let_patterns)]
14833 if let DataRouterRouteResponse::Data(ref mut val) = self {
14834 fidl::decode!(
14835 Data,
14836 fidl::encoding::DefaultFuchsiaResourceDialect,
14837 val,
14838 decoder,
14839 _inner_offset,
14840 depth
14841 )?;
14842 } else {
14843 unreachable!()
14844 }
14845 }
14846 2 => {
14847 #[allow(irrefutable_let_patterns)]
14848 if let DataRouterRouteResponse::Unavailable(_) = self {
14849 } else {
14851 *self = DataRouterRouteResponse::Unavailable(fidl::new_empty!(
14853 Unit,
14854 fidl::encoding::DefaultFuchsiaResourceDialect
14855 ));
14856 }
14857 #[allow(irrefutable_let_patterns)]
14858 if let DataRouterRouteResponse::Unavailable(ref mut val) = self {
14859 fidl::decode!(
14860 Unit,
14861 fidl::encoding::DefaultFuchsiaResourceDialect,
14862 val,
14863 decoder,
14864 _inner_offset,
14865 depth
14866 )?;
14867 } else {
14868 unreachable!()
14869 }
14870 }
14871 ordinal => panic!("unexpected ordinal {:?}", ordinal),
14872 }
14873 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14874 return Err(fidl::Error::InvalidNumBytesInEnvelope);
14875 }
14876 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14877 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14878 }
14879 Ok(())
14880 }
14881 }
14882
14883 impl fidl::encoding::ResourceTypeMarker for DictionaryRouterRouteResponse {
14884 type Borrowed<'a> = &'a mut Self;
14885 fn take_or_borrow<'a>(
14886 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
14887 ) -> Self::Borrowed<'a> {
14888 value
14889 }
14890 }
14891
14892 unsafe impl fidl::encoding::TypeMarker for DictionaryRouterRouteResponse {
14893 type Owned = Self;
14894
14895 #[inline(always)]
14896 fn inline_align(_context: fidl::encoding::Context) -> usize {
14897 8
14898 }
14899
14900 #[inline(always)]
14901 fn inline_size(_context: fidl::encoding::Context) -> usize {
14902 16
14903 }
14904 }
14905
14906 unsafe impl
14907 fidl::encoding::Encode<
14908 DictionaryRouterRouteResponse,
14909 fidl::encoding::DefaultFuchsiaResourceDialect,
14910 > for &mut DictionaryRouterRouteResponse
14911 {
14912 #[inline]
14913 unsafe fn encode(
14914 self,
14915 encoder: &mut fidl::encoding::Encoder<
14916 '_,
14917 fidl::encoding::DefaultFuchsiaResourceDialect,
14918 >,
14919 offset: usize,
14920 _depth: fidl::encoding::Depth,
14921 ) -> fidl::Result<()> {
14922 encoder.debug_check_bounds::<DictionaryRouterRouteResponse>(offset);
14923 encoder.write_num::<u64>(self.ordinal(), offset);
14924 match self {
14925 DictionaryRouterRouteResponse::Dictionary(ref mut val) => {
14926 fidl::encoding::encode_in_envelope::<
14927 DictionaryRef,
14928 fidl::encoding::DefaultFuchsiaResourceDialect,
14929 >(
14930 <DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
14931 encoder,
14932 offset + 8,
14933 _depth,
14934 )
14935 }
14936 DictionaryRouterRouteResponse::Unavailable(ref val) => {
14937 fidl::encoding::encode_in_envelope::<
14938 Unit,
14939 fidl::encoding::DefaultFuchsiaResourceDialect,
14940 >(
14941 <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
14942 encoder,
14943 offset + 8,
14944 _depth,
14945 )
14946 }
14947 }
14948 }
14949 }
14950
14951 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
14952 for DictionaryRouterRouteResponse
14953 {
14954 #[inline(always)]
14955 fn new_empty() -> Self {
14956 Self::Dictionary(fidl::new_empty!(
14957 DictionaryRef,
14958 fidl::encoding::DefaultFuchsiaResourceDialect
14959 ))
14960 }
14961
14962 #[inline]
14963 unsafe fn decode(
14964 &mut self,
14965 decoder: &mut fidl::encoding::Decoder<
14966 '_,
14967 fidl::encoding::DefaultFuchsiaResourceDialect,
14968 >,
14969 offset: usize,
14970 mut depth: fidl::encoding::Depth,
14971 ) -> fidl::Result<()> {
14972 decoder.debug_check_bounds::<Self>(offset);
14973 #[allow(unused_variables)]
14974 let next_out_of_line = decoder.next_out_of_line();
14975 let handles_before = decoder.remaining_handles();
14976 let (ordinal, inlined, num_bytes, num_handles) =
14977 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14978
14979 let member_inline_size = match ordinal {
14980 1 => <DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14981 2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14982 _ => return Err(fidl::Error::UnknownUnionTag),
14983 };
14984
14985 if inlined != (member_inline_size <= 4) {
14986 return Err(fidl::Error::InvalidInlineBitInEnvelope);
14987 }
14988 let _inner_offset;
14989 if inlined {
14990 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14991 _inner_offset = offset + 8;
14992 } else {
14993 depth.increment()?;
14994 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14995 }
14996 match ordinal {
14997 1 => {
14998 #[allow(irrefutable_let_patterns)]
14999 if let DictionaryRouterRouteResponse::Dictionary(_) = self {
15000 } else {
15002 *self = DictionaryRouterRouteResponse::Dictionary(fidl::new_empty!(
15004 DictionaryRef,
15005 fidl::encoding::DefaultFuchsiaResourceDialect
15006 ));
15007 }
15008 #[allow(irrefutable_let_patterns)]
15009 if let DictionaryRouterRouteResponse::Dictionary(ref mut val) = self {
15010 fidl::decode!(
15011 DictionaryRef,
15012 fidl::encoding::DefaultFuchsiaResourceDialect,
15013 val,
15014 decoder,
15015 _inner_offset,
15016 depth
15017 )?;
15018 } else {
15019 unreachable!()
15020 }
15021 }
15022 2 => {
15023 #[allow(irrefutable_let_patterns)]
15024 if let DictionaryRouterRouteResponse::Unavailable(_) = self {
15025 } else {
15027 *self = DictionaryRouterRouteResponse::Unavailable(fidl::new_empty!(
15029 Unit,
15030 fidl::encoding::DefaultFuchsiaResourceDialect
15031 ));
15032 }
15033 #[allow(irrefutable_let_patterns)]
15034 if let DictionaryRouterRouteResponse::Unavailable(ref mut val) = self {
15035 fidl::decode!(
15036 Unit,
15037 fidl::encoding::DefaultFuchsiaResourceDialect,
15038 val,
15039 decoder,
15040 _inner_offset,
15041 depth
15042 )?;
15043 } else {
15044 unreachable!()
15045 }
15046 }
15047 ordinal => panic!("unexpected ordinal {:?}", ordinal),
15048 }
15049 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15050 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15051 }
15052 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15053 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15054 }
15055 Ok(())
15056 }
15057 }
15058
15059 impl fidl::encoding::ResourceTypeMarker for DirConnectorRouterRouteResponse {
15060 type Borrowed<'a> = &'a mut Self;
15061 fn take_or_borrow<'a>(
15062 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15063 ) -> Self::Borrowed<'a> {
15064 value
15065 }
15066 }
15067
15068 unsafe impl fidl::encoding::TypeMarker for DirConnectorRouterRouteResponse {
15069 type Owned = Self;
15070
15071 #[inline(always)]
15072 fn inline_align(_context: fidl::encoding::Context) -> usize {
15073 8
15074 }
15075
15076 #[inline(always)]
15077 fn inline_size(_context: fidl::encoding::Context) -> usize {
15078 16
15079 }
15080 }
15081
15082 unsafe impl
15083 fidl::encoding::Encode<
15084 DirConnectorRouterRouteResponse,
15085 fidl::encoding::DefaultFuchsiaResourceDialect,
15086 > for &mut DirConnectorRouterRouteResponse
15087 {
15088 #[inline]
15089 unsafe fn encode(
15090 self,
15091 encoder: &mut fidl::encoding::Encoder<
15092 '_,
15093 fidl::encoding::DefaultFuchsiaResourceDialect,
15094 >,
15095 offset: usize,
15096 _depth: fidl::encoding::Depth,
15097 ) -> fidl::Result<()> {
15098 encoder.debug_check_bounds::<DirConnectorRouterRouteResponse>(offset);
15099 encoder.write_num::<u64>(self.ordinal(), offset);
15100 match self {
15101 DirConnectorRouterRouteResponse::DirConnector(ref mut val) => {
15102 fidl::encoding::encode_in_envelope::<
15103 DirConnector,
15104 fidl::encoding::DefaultFuchsiaResourceDialect,
15105 >(
15106 <DirConnector as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15107 encoder,
15108 offset + 8,
15109 _depth,
15110 )
15111 }
15112 DirConnectorRouterRouteResponse::Unavailable(ref val) => {
15113 fidl::encoding::encode_in_envelope::<
15114 Unit,
15115 fidl::encoding::DefaultFuchsiaResourceDialect,
15116 >(
15117 <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15118 encoder,
15119 offset + 8,
15120 _depth,
15121 )
15122 }
15123 }
15124 }
15125 }
15126
15127 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15128 for DirConnectorRouterRouteResponse
15129 {
15130 #[inline(always)]
15131 fn new_empty() -> Self {
15132 Self::DirConnector(fidl::new_empty!(
15133 DirConnector,
15134 fidl::encoding::DefaultFuchsiaResourceDialect
15135 ))
15136 }
15137
15138 #[inline]
15139 unsafe fn decode(
15140 &mut self,
15141 decoder: &mut fidl::encoding::Decoder<
15142 '_,
15143 fidl::encoding::DefaultFuchsiaResourceDialect,
15144 >,
15145 offset: usize,
15146 mut depth: fidl::encoding::Depth,
15147 ) -> fidl::Result<()> {
15148 decoder.debug_check_bounds::<Self>(offset);
15149 #[allow(unused_variables)]
15150 let next_out_of_line = decoder.next_out_of_line();
15151 let handles_before = decoder.remaining_handles();
15152 let (ordinal, inlined, num_bytes, num_handles) =
15153 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15154
15155 let member_inline_size = match ordinal {
15156 1 => <DirConnector as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15157 2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15158 _ => return Err(fidl::Error::UnknownUnionTag),
15159 };
15160
15161 if inlined != (member_inline_size <= 4) {
15162 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15163 }
15164 let _inner_offset;
15165 if inlined {
15166 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15167 _inner_offset = offset + 8;
15168 } else {
15169 depth.increment()?;
15170 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15171 }
15172 match ordinal {
15173 1 => {
15174 #[allow(irrefutable_let_patterns)]
15175 if let DirConnectorRouterRouteResponse::DirConnector(_) = self {
15176 } else {
15178 *self = DirConnectorRouterRouteResponse::DirConnector(fidl::new_empty!(
15180 DirConnector,
15181 fidl::encoding::DefaultFuchsiaResourceDialect
15182 ));
15183 }
15184 #[allow(irrefutable_let_patterns)]
15185 if let DirConnectorRouterRouteResponse::DirConnector(ref mut val) = self {
15186 fidl::decode!(
15187 DirConnector,
15188 fidl::encoding::DefaultFuchsiaResourceDialect,
15189 val,
15190 decoder,
15191 _inner_offset,
15192 depth
15193 )?;
15194 } else {
15195 unreachable!()
15196 }
15197 }
15198 2 => {
15199 #[allow(irrefutable_let_patterns)]
15200 if let DirConnectorRouterRouteResponse::Unavailable(_) = self {
15201 } else {
15203 *self = DirConnectorRouterRouteResponse::Unavailable(fidl::new_empty!(
15205 Unit,
15206 fidl::encoding::DefaultFuchsiaResourceDialect
15207 ));
15208 }
15209 #[allow(irrefutable_let_patterns)]
15210 if let DirConnectorRouterRouteResponse::Unavailable(ref mut val) = self {
15211 fidl::decode!(
15212 Unit,
15213 fidl::encoding::DefaultFuchsiaResourceDialect,
15214 val,
15215 decoder,
15216 _inner_offset,
15217 depth
15218 )?;
15219 } else {
15220 unreachable!()
15221 }
15222 }
15223 ordinal => panic!("unexpected ordinal {:?}", ordinal),
15224 }
15225 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15226 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15227 }
15228 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15229 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15230 }
15231 Ok(())
15232 }
15233 }
15234
15235 impl fidl::encoding::ResourceTypeMarker for DirEntryRouterRouteResponse {
15236 type Borrowed<'a> = &'a mut Self;
15237 fn take_or_borrow<'a>(
15238 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15239 ) -> Self::Borrowed<'a> {
15240 value
15241 }
15242 }
15243
15244 unsafe impl fidl::encoding::TypeMarker for DirEntryRouterRouteResponse {
15245 type Owned = Self;
15246
15247 #[inline(always)]
15248 fn inline_align(_context: fidl::encoding::Context) -> usize {
15249 8
15250 }
15251
15252 #[inline(always)]
15253 fn inline_size(_context: fidl::encoding::Context) -> usize {
15254 16
15255 }
15256 }
15257
15258 unsafe impl
15259 fidl::encoding::Encode<
15260 DirEntryRouterRouteResponse,
15261 fidl::encoding::DefaultFuchsiaResourceDialect,
15262 > for &mut DirEntryRouterRouteResponse
15263 {
15264 #[inline]
15265 unsafe fn encode(
15266 self,
15267 encoder: &mut fidl::encoding::Encoder<
15268 '_,
15269 fidl::encoding::DefaultFuchsiaResourceDialect,
15270 >,
15271 offset: usize,
15272 _depth: fidl::encoding::Depth,
15273 ) -> fidl::Result<()> {
15274 encoder.debug_check_bounds::<DirEntryRouterRouteResponse>(offset);
15275 encoder.write_num::<u64>(self.ordinal(), offset);
15276 match self {
15277 DirEntryRouterRouteResponse::DirEntry(ref mut val) => {
15278 fidl::encoding::encode_in_envelope::<
15279 DirEntry,
15280 fidl::encoding::DefaultFuchsiaResourceDialect,
15281 >(
15282 <DirEntry as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
15283 encoder,
15284 offset + 8,
15285 _depth,
15286 )
15287 }
15288 DirEntryRouterRouteResponse::Unavailable(ref val) => {
15289 fidl::encoding::encode_in_envelope::<
15290 Unit,
15291 fidl::encoding::DefaultFuchsiaResourceDialect,
15292 >(
15293 <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15294 encoder,
15295 offset + 8,
15296 _depth,
15297 )
15298 }
15299 }
15300 }
15301 }
15302
15303 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15304 for DirEntryRouterRouteResponse
15305 {
15306 #[inline(always)]
15307 fn new_empty() -> Self {
15308 Self::DirEntry(fidl::new_empty!(
15309 DirEntry,
15310 fidl::encoding::DefaultFuchsiaResourceDialect
15311 ))
15312 }
15313
15314 #[inline]
15315 unsafe fn decode(
15316 &mut self,
15317 decoder: &mut fidl::encoding::Decoder<
15318 '_,
15319 fidl::encoding::DefaultFuchsiaResourceDialect,
15320 >,
15321 offset: usize,
15322 mut depth: fidl::encoding::Depth,
15323 ) -> fidl::Result<()> {
15324 decoder.debug_check_bounds::<Self>(offset);
15325 #[allow(unused_variables)]
15326 let next_out_of_line = decoder.next_out_of_line();
15327 let handles_before = decoder.remaining_handles();
15328 let (ordinal, inlined, num_bytes, num_handles) =
15329 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15330
15331 let member_inline_size = match ordinal {
15332 1 => <DirEntry as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15333 2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15334 _ => return Err(fidl::Error::UnknownUnionTag),
15335 };
15336
15337 if inlined != (member_inline_size <= 4) {
15338 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15339 }
15340 let _inner_offset;
15341 if inlined {
15342 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15343 _inner_offset = offset + 8;
15344 } else {
15345 depth.increment()?;
15346 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15347 }
15348 match ordinal {
15349 1 => {
15350 #[allow(irrefutable_let_patterns)]
15351 if let DirEntryRouterRouteResponse::DirEntry(_) = self {
15352 } else {
15354 *self = DirEntryRouterRouteResponse::DirEntry(fidl::new_empty!(
15356 DirEntry,
15357 fidl::encoding::DefaultFuchsiaResourceDialect
15358 ));
15359 }
15360 #[allow(irrefutable_let_patterns)]
15361 if let DirEntryRouterRouteResponse::DirEntry(ref mut val) = self {
15362 fidl::decode!(
15363 DirEntry,
15364 fidl::encoding::DefaultFuchsiaResourceDialect,
15365 val,
15366 decoder,
15367 _inner_offset,
15368 depth
15369 )?;
15370 } else {
15371 unreachable!()
15372 }
15373 }
15374 2 => {
15375 #[allow(irrefutable_let_patterns)]
15376 if let DirEntryRouterRouteResponse::Unavailable(_) = self {
15377 } else {
15379 *self = DirEntryRouterRouteResponse::Unavailable(fidl::new_empty!(
15381 Unit,
15382 fidl::encoding::DefaultFuchsiaResourceDialect
15383 ));
15384 }
15385 #[allow(irrefutable_let_patterns)]
15386 if let DirEntryRouterRouteResponse::Unavailable(ref mut val) = self {
15387 fidl::decode!(
15388 Unit,
15389 fidl::encoding::DefaultFuchsiaResourceDialect,
15390 val,
15391 decoder,
15392 _inner_offset,
15393 depth
15394 )?;
15395 } else {
15396 unreachable!()
15397 }
15398 }
15399 ordinal => panic!("unexpected ordinal {:?}", ordinal),
15400 }
15401 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15402 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15403 }
15404 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15405 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15406 }
15407 Ok(())
15408 }
15409 }
15410
15411 impl fidl::encoding::ResourceTypeMarker for DirectoryRouterRouteResponse {
15412 type Borrowed<'a> = &'a mut Self;
15413 fn take_or_borrow<'a>(
15414 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
15415 ) -> Self::Borrowed<'a> {
15416 value
15417 }
15418 }
15419
15420 unsafe impl fidl::encoding::TypeMarker for DirectoryRouterRouteResponse {
15421 type Owned = Self;
15422
15423 #[inline(always)]
15424 fn inline_align(_context: fidl::encoding::Context) -> usize {
15425 8
15426 }
15427
15428 #[inline(always)]
15429 fn inline_size(_context: fidl::encoding::Context) -> usize {
15430 16
15431 }
15432 }
15433
15434 unsafe impl
15435 fidl::encoding::Encode<
15436 DirectoryRouterRouteResponse,
15437 fidl::encoding::DefaultFuchsiaResourceDialect,
15438 > for &mut DirectoryRouterRouteResponse
15439 {
15440 #[inline]
15441 unsafe fn encode(
15442 self,
15443 encoder: &mut fidl::encoding::Encoder<
15444 '_,
15445 fidl::encoding::DefaultFuchsiaResourceDialect,
15446 >,
15447 offset: usize,
15448 _depth: fidl::encoding::Depth,
15449 ) -> fidl::Result<()> {
15450 encoder.debug_check_bounds::<DirectoryRouterRouteResponse>(offset);
15451 encoder.write_num::<u64>(self.ordinal(), offset);
15452 match self {
15453 DirectoryRouterRouteResponse::Directory(ref mut val) => {
15454 fidl::encoding::encode_in_envelope::<
15455 fidl::encoding::Endpoint<
15456 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15457 >,
15458 fidl::encoding::DefaultFuchsiaResourceDialect,
15459 >(
15460 <fidl::encoding::Endpoint<
15461 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15462 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
15463 val
15464 ),
15465 encoder,
15466 offset + 8,
15467 _depth,
15468 )
15469 }
15470 DirectoryRouterRouteResponse::Unavailable(ref val) => {
15471 fidl::encoding::encode_in_envelope::<
15472 Unit,
15473 fidl::encoding::DefaultFuchsiaResourceDialect,
15474 >(
15475 <Unit as fidl::encoding::ValueTypeMarker>::borrow(val),
15476 encoder,
15477 offset + 8,
15478 _depth,
15479 )
15480 }
15481 }
15482 }
15483 }
15484
15485 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
15486 for DirectoryRouterRouteResponse
15487 {
15488 #[inline(always)]
15489 fn new_empty() -> Self {
15490 Self::Directory(fidl::new_empty!(
15491 fidl::encoding::Endpoint<
15492 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15493 >,
15494 fidl::encoding::DefaultFuchsiaResourceDialect
15495 ))
15496 }
15497
15498 #[inline]
15499 unsafe fn decode(
15500 &mut self,
15501 decoder: &mut fidl::encoding::Decoder<
15502 '_,
15503 fidl::encoding::DefaultFuchsiaResourceDialect,
15504 >,
15505 offset: usize,
15506 mut depth: fidl::encoding::Depth,
15507 ) -> fidl::Result<()> {
15508 decoder.debug_check_bounds::<Self>(offset);
15509 #[allow(unused_variables)]
15510 let next_out_of_line = decoder.next_out_of_line();
15511 let handles_before = decoder.remaining_handles();
15512 let (ordinal, inlined, num_bytes, num_handles) =
15513 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
15514
15515 let member_inline_size = match ordinal {
15516 1 => <fidl::encoding::Endpoint<
15517 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15518 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15519 2 => <Unit as fidl::encoding::TypeMarker>::inline_size(decoder.context),
15520 _ => return Err(fidl::Error::UnknownUnionTag),
15521 };
15522
15523 if inlined != (member_inline_size <= 4) {
15524 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15525 }
15526 let _inner_offset;
15527 if inlined {
15528 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
15529 _inner_offset = offset + 8;
15530 } else {
15531 depth.increment()?;
15532 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15533 }
15534 match ordinal {
15535 1 => {
15536 #[allow(irrefutable_let_patterns)]
15537 if let DirectoryRouterRouteResponse::Directory(_) = self {
15538 } else {
15540 *self = DirectoryRouterRouteResponse::Directory(fidl::new_empty!(
15542 fidl::encoding::Endpoint<
15543 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15544 >,
15545 fidl::encoding::DefaultFuchsiaResourceDialect
15546 ));
15547 }
15548 #[allow(irrefutable_let_patterns)]
15549 if let DirectoryRouterRouteResponse::Directory(ref mut val) = self {
15550 fidl::decode!(
15551 fidl::encoding::Endpoint<
15552 fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
15553 >,
15554 fidl::encoding::DefaultFuchsiaResourceDialect,
15555 val,
15556 decoder,
15557 _inner_offset,
15558 depth
15559 )?;
15560 } else {
15561 unreachable!()
15562 }
15563 }
15564 2 => {
15565 #[allow(irrefutable_let_patterns)]
15566 if let DirectoryRouterRouteResponse::Unavailable(_) = self {
15567 } else {
15569 *self = DirectoryRouterRouteResponse::Unavailable(fidl::new_empty!(
15571 Unit,
15572 fidl::encoding::DefaultFuchsiaResourceDialect
15573 ));
15574 }
15575 #[allow(irrefutable_let_patterns)]
15576 if let DirectoryRouterRouteResponse::Unavailable(ref mut val) = self {
15577 fidl::decode!(
15578 Unit,
15579 fidl::encoding::DefaultFuchsiaResourceDialect,
15580 val,
15581 decoder,
15582 _inner_offset,
15583 depth
15584 )?;
15585 } else {
15586 unreachable!()
15587 }
15588 }
15589 ordinal => panic!("unexpected ordinal {:?}", ordinal),
15590 }
15591 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
15592 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15593 }
15594 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15595 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15596 }
15597 Ok(())
15598 }
15599 }
15600}