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_sys2_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15#[repr(C)]
16pub struct CrashIntrospectFindComponentByThreadKoidRequest {
17 pub thread_koid: u64,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for CrashIntrospectFindComponentByThreadKoidRequest
22{
23}
24
25#[derive(Debug, PartialEq)]
26pub struct LifecycleControllerCreateInstanceRequest {
27 pub parent_moniker: String,
28 pub collection: fidl_fuchsia_component_decl::CollectionRef,
29 pub decl: fidl_fuchsia_component_decl::Child,
30 pub args: fidl_fuchsia_component::CreateChildArgs,
31}
32
33impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
34 for LifecycleControllerCreateInstanceRequest
35{
36}
37
38#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
39pub struct LifecycleControllerStartInstanceRequest {
40 pub moniker: String,
41 pub binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
42}
43
44impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
45 for LifecycleControllerStartInstanceRequest
46{
47}
48
49#[derive(Debug, PartialEq)]
50pub struct LifecycleControllerStartInstanceWithArgsRequest {
51 pub moniker: String,
52 pub binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
53 pub args: fidl_fuchsia_component::StartChildArgs,
54}
55
56impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
57 for LifecycleControllerStartInstanceWithArgsRequest
58{
59}
60
61#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
62pub struct RealmQueryConnectToStorageAdminRequest {
63 pub moniker: String,
64 pub storage_name: String,
65 pub server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
66}
67
68impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
69 for RealmQueryConnectToStorageAdminRequest
70{
71}
72
73#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
74pub struct RealmQueryDeprecatedOpenRequest {
75 pub moniker: String,
76 pub dir_type: OpenDirType,
77 pub flags: fidl_fuchsia_io::OpenFlags,
78 pub mode: fidl_fuchsia_io::ModeType,
79 pub path: String,
80 pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
81}
82
83impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
84 for RealmQueryDeprecatedOpenRequest
85{
86}
87
88#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
89pub struct RealmQueryOpenDirectoryRequest {
90 pub moniker: String,
91 pub dir_type: OpenDirType,
92 pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
93}
94
95impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
96 for RealmQueryOpenDirectoryRequest
97{
98}
99
100#[derive(Debug, PartialEq)]
101pub struct RealmQueryConstructNamespaceResponse {
102 pub namespace: Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>,
104}
105
106impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
107 for RealmQueryConstructNamespaceResponse
108{
109}
110
111#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
112pub struct RealmQueryGetAllInstancesResponse {
113 pub iterator: fidl::endpoints::ClientEnd<InstanceIteratorMarker>,
114}
115
116impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
117 for RealmQueryGetAllInstancesResponse
118{
119}
120
121#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
122pub struct RealmQueryGetManifestResponse {
123 pub iterator: fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
124}
125
126impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
127 for RealmQueryGetManifestResponse
128{
129}
130
131#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
132pub struct RealmQueryGetResolvedDeclarationResponse {
133 pub iterator: fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
134}
135
136impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
137 for RealmQueryGetResolvedDeclarationResponse
138{
139}
140
141#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
142pub struct RealmQueryResolveDeclarationResponse {
143 pub iterator: fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
144}
145
146impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
147 for RealmQueryResolveDeclarationResponse
148{
149}
150
151#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
152pub struct StorageAdminDeprecatedOpenComponentStorageRequest {
153 pub relative_moniker: String,
154 pub flags: fidl_fuchsia_io::OpenFlags,
155 pub mode: fidl_fuchsia_io::ModeType,
156 pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
157}
158
159impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
160 for StorageAdminDeprecatedOpenComponentStorageRequest
161{
162}
163
164#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
165pub struct StorageAdminListStorageInRealmRequest {
166 pub relative_moniker: String,
167 pub iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
168}
169
170impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
171 for StorageAdminListStorageInRealmRequest
172{
173}
174
175#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
176pub struct StorageAdminOpenComponentStorageByIdRequest {
177 pub id: String,
178 pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
179}
180
181impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
182 for StorageAdminOpenComponentStorageByIdRequest
183{
184}
185
186#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
187pub struct StorageAdminOpenStorageRequest {
188 pub relative_moniker: String,
189 pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
190}
191
192impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
193 for StorageAdminOpenStorageRequest
194{
195}
196
197#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
198pub struct ConfigOverrideMarker;
199
200impl fidl::endpoints::ProtocolMarker for ConfigOverrideMarker {
201 type Proxy = ConfigOverrideProxy;
202 type RequestStream = ConfigOverrideRequestStream;
203 #[cfg(target_os = "fuchsia")]
204 type SynchronousProxy = ConfigOverrideSynchronousProxy;
205
206 const DEBUG_NAME: &'static str = "fuchsia.sys2.ConfigOverride";
207}
208impl fidl::endpoints::DiscoverableProtocolMarker for ConfigOverrideMarker {}
209pub type ConfigOverrideSetStructuredConfigResult = Result<(), ConfigOverrideError>;
210pub type ConfigOverrideUnsetStructuredConfigResult = Result<(), ConfigOverrideError>;
211
212pub trait ConfigOverrideProxyInterface: Send + Sync {
213 type SetStructuredConfigResponseFut: std::future::Future<Output = Result<ConfigOverrideSetStructuredConfigResult, fidl::Error>>
214 + Send;
215 fn r#set_structured_config(
216 &self,
217 moniker: &str,
218 fields: &[fidl_fuchsia_component_decl::ConfigOverride],
219 ) -> Self::SetStructuredConfigResponseFut;
220 type UnsetStructuredConfigResponseFut: std::future::Future<Output = Result<ConfigOverrideUnsetStructuredConfigResult, fidl::Error>>
221 + Send;
222 fn r#unset_structured_config(&self, moniker: &str) -> Self::UnsetStructuredConfigResponseFut;
223}
224#[derive(Debug)]
225#[cfg(target_os = "fuchsia")]
226pub struct ConfigOverrideSynchronousProxy {
227 client: fidl::client::sync::Client,
228}
229
230#[cfg(target_os = "fuchsia")]
231impl fidl::endpoints::SynchronousProxy for ConfigOverrideSynchronousProxy {
232 type Proxy = ConfigOverrideProxy;
233 type Protocol = ConfigOverrideMarker;
234
235 fn from_channel(inner: fidl::Channel) -> Self {
236 Self::new(inner)
237 }
238
239 fn into_channel(self) -> fidl::Channel {
240 self.client.into_channel()
241 }
242
243 fn as_channel(&self) -> &fidl::Channel {
244 self.client.as_channel()
245 }
246}
247
248#[cfg(target_os = "fuchsia")]
249impl ConfigOverrideSynchronousProxy {
250 pub fn new(channel: fidl::Channel) -> Self {
251 let protocol_name = <ConfigOverrideMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
252 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
253 }
254
255 pub fn into_channel(self) -> fidl::Channel {
256 self.client.into_channel()
257 }
258
259 pub fn wait_for_event(
262 &self,
263 deadline: zx::MonotonicInstant,
264 ) -> Result<ConfigOverrideEvent, fidl::Error> {
265 ConfigOverrideEvent::decode(self.client.wait_for_event(deadline)?)
266 }
267
268 pub fn r#set_structured_config(
271 &self,
272 mut moniker: &str,
273 mut fields: &[fidl_fuchsia_component_decl::ConfigOverride],
274 ___deadline: zx::MonotonicInstant,
275 ) -> Result<ConfigOverrideSetStructuredConfigResult, fidl::Error> {
276 let _response = self.client.send_query::<
277 ConfigOverrideSetStructuredConfigRequest,
278 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, ConfigOverrideError>,
279 >(
280 (moniker, fields,),
281 0x2c6a138832d2e0ee,
282 fidl::encoding::DynamicFlags::FLEXIBLE,
283 ___deadline,
284 )?
285 .into_result::<ConfigOverrideMarker>("set_structured_config")?;
286 Ok(_response.map(|x| x))
287 }
288
289 pub fn r#unset_structured_config(
293 &self,
294 mut moniker: &str,
295 ___deadline: zx::MonotonicInstant,
296 ) -> Result<ConfigOverrideUnsetStructuredConfigResult, fidl::Error> {
297 let _response = self.client.send_query::<
298 ConfigOverrideUnsetStructuredConfigRequest,
299 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, ConfigOverrideError>,
300 >(
301 (moniker,),
302 0x342ec7d2bef05552,
303 fidl::encoding::DynamicFlags::FLEXIBLE,
304 ___deadline,
305 )?
306 .into_result::<ConfigOverrideMarker>("unset_structured_config")?;
307 Ok(_response.map(|x| x))
308 }
309}
310
311#[cfg(target_os = "fuchsia")]
312impl From<ConfigOverrideSynchronousProxy> for zx::Handle {
313 fn from(value: ConfigOverrideSynchronousProxy) -> Self {
314 value.into_channel().into()
315 }
316}
317
318#[cfg(target_os = "fuchsia")]
319impl From<fidl::Channel> for ConfigOverrideSynchronousProxy {
320 fn from(value: fidl::Channel) -> Self {
321 Self::new(value)
322 }
323}
324
325#[derive(Debug, Clone)]
326pub struct ConfigOverrideProxy {
327 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
328}
329
330impl fidl::endpoints::Proxy for ConfigOverrideProxy {
331 type Protocol = ConfigOverrideMarker;
332
333 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
334 Self::new(inner)
335 }
336
337 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
338 self.client.into_channel().map_err(|client| Self { client })
339 }
340
341 fn as_channel(&self) -> &::fidl::AsyncChannel {
342 self.client.as_channel()
343 }
344}
345
346impl ConfigOverrideProxy {
347 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
349 let protocol_name = <ConfigOverrideMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
350 Self { client: fidl::client::Client::new(channel, protocol_name) }
351 }
352
353 pub fn take_event_stream(&self) -> ConfigOverrideEventStream {
359 ConfigOverrideEventStream { event_receiver: self.client.take_event_receiver() }
360 }
361
362 pub fn r#set_structured_config(
365 &self,
366 mut moniker: &str,
367 mut fields: &[fidl_fuchsia_component_decl::ConfigOverride],
368 ) -> fidl::client::QueryResponseFut<
369 ConfigOverrideSetStructuredConfigResult,
370 fidl::encoding::DefaultFuchsiaResourceDialect,
371 > {
372 ConfigOverrideProxyInterface::r#set_structured_config(self, moniker, fields)
373 }
374
375 pub fn r#unset_structured_config(
379 &self,
380 mut moniker: &str,
381 ) -> fidl::client::QueryResponseFut<
382 ConfigOverrideUnsetStructuredConfigResult,
383 fidl::encoding::DefaultFuchsiaResourceDialect,
384 > {
385 ConfigOverrideProxyInterface::r#unset_structured_config(self, moniker)
386 }
387}
388
389impl ConfigOverrideProxyInterface for ConfigOverrideProxy {
390 type SetStructuredConfigResponseFut = fidl::client::QueryResponseFut<
391 ConfigOverrideSetStructuredConfigResult,
392 fidl::encoding::DefaultFuchsiaResourceDialect,
393 >;
394 fn r#set_structured_config(
395 &self,
396 mut moniker: &str,
397 mut fields: &[fidl_fuchsia_component_decl::ConfigOverride],
398 ) -> Self::SetStructuredConfigResponseFut {
399 fn _decode(
400 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
401 ) -> Result<ConfigOverrideSetStructuredConfigResult, fidl::Error> {
402 let _response = fidl::client::decode_transaction_body::<
403 fidl::encoding::FlexibleResultType<
404 fidl::encoding::EmptyStruct,
405 ConfigOverrideError,
406 >,
407 fidl::encoding::DefaultFuchsiaResourceDialect,
408 0x2c6a138832d2e0ee,
409 >(_buf?)?
410 .into_result::<ConfigOverrideMarker>("set_structured_config")?;
411 Ok(_response.map(|x| x))
412 }
413 self.client.send_query_and_decode::<
414 ConfigOverrideSetStructuredConfigRequest,
415 ConfigOverrideSetStructuredConfigResult,
416 >(
417 (moniker, fields,),
418 0x2c6a138832d2e0ee,
419 fidl::encoding::DynamicFlags::FLEXIBLE,
420 _decode,
421 )
422 }
423
424 type UnsetStructuredConfigResponseFut = fidl::client::QueryResponseFut<
425 ConfigOverrideUnsetStructuredConfigResult,
426 fidl::encoding::DefaultFuchsiaResourceDialect,
427 >;
428 fn r#unset_structured_config(
429 &self,
430 mut moniker: &str,
431 ) -> Self::UnsetStructuredConfigResponseFut {
432 fn _decode(
433 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
434 ) -> Result<ConfigOverrideUnsetStructuredConfigResult, fidl::Error> {
435 let _response = fidl::client::decode_transaction_body::<
436 fidl::encoding::FlexibleResultType<
437 fidl::encoding::EmptyStruct,
438 ConfigOverrideError,
439 >,
440 fidl::encoding::DefaultFuchsiaResourceDialect,
441 0x342ec7d2bef05552,
442 >(_buf?)?
443 .into_result::<ConfigOverrideMarker>("unset_structured_config")?;
444 Ok(_response.map(|x| x))
445 }
446 self.client.send_query_and_decode::<
447 ConfigOverrideUnsetStructuredConfigRequest,
448 ConfigOverrideUnsetStructuredConfigResult,
449 >(
450 (moniker,),
451 0x342ec7d2bef05552,
452 fidl::encoding::DynamicFlags::FLEXIBLE,
453 _decode,
454 )
455 }
456}
457
458pub struct ConfigOverrideEventStream {
459 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
460}
461
462impl std::marker::Unpin for ConfigOverrideEventStream {}
463
464impl futures::stream::FusedStream for ConfigOverrideEventStream {
465 fn is_terminated(&self) -> bool {
466 self.event_receiver.is_terminated()
467 }
468}
469
470impl futures::Stream for ConfigOverrideEventStream {
471 type Item = Result<ConfigOverrideEvent, fidl::Error>;
472
473 fn poll_next(
474 mut self: std::pin::Pin<&mut Self>,
475 cx: &mut std::task::Context<'_>,
476 ) -> std::task::Poll<Option<Self::Item>> {
477 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
478 &mut self.event_receiver,
479 cx
480 )?) {
481 Some(buf) => std::task::Poll::Ready(Some(ConfigOverrideEvent::decode(buf))),
482 None => std::task::Poll::Ready(None),
483 }
484 }
485}
486
487#[derive(Debug)]
488pub enum ConfigOverrideEvent {
489 #[non_exhaustive]
490 _UnknownEvent {
491 ordinal: u64,
493 },
494}
495
496impl ConfigOverrideEvent {
497 fn decode(
499 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
500 ) -> Result<ConfigOverrideEvent, fidl::Error> {
501 let (bytes, _handles) = buf.split_mut();
502 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
503 debug_assert_eq!(tx_header.tx_id, 0);
504 match tx_header.ordinal {
505 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
506 Ok(ConfigOverrideEvent::_UnknownEvent { ordinal: tx_header.ordinal })
507 }
508 _ => Err(fidl::Error::UnknownOrdinal {
509 ordinal: tx_header.ordinal,
510 protocol_name:
511 <ConfigOverrideMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
512 }),
513 }
514 }
515}
516
517pub struct ConfigOverrideRequestStream {
519 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
520 is_terminated: bool,
521}
522
523impl std::marker::Unpin for ConfigOverrideRequestStream {}
524
525impl futures::stream::FusedStream for ConfigOverrideRequestStream {
526 fn is_terminated(&self) -> bool {
527 self.is_terminated
528 }
529}
530
531impl fidl::endpoints::RequestStream for ConfigOverrideRequestStream {
532 type Protocol = ConfigOverrideMarker;
533 type ControlHandle = ConfigOverrideControlHandle;
534
535 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
536 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
537 }
538
539 fn control_handle(&self) -> Self::ControlHandle {
540 ConfigOverrideControlHandle { inner: self.inner.clone() }
541 }
542
543 fn into_inner(
544 self,
545 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
546 {
547 (self.inner, self.is_terminated)
548 }
549
550 fn from_inner(
551 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
552 is_terminated: bool,
553 ) -> Self {
554 Self { inner, is_terminated }
555 }
556}
557
558impl futures::Stream for ConfigOverrideRequestStream {
559 type Item = Result<ConfigOverrideRequest, fidl::Error>;
560
561 fn poll_next(
562 mut self: std::pin::Pin<&mut Self>,
563 cx: &mut std::task::Context<'_>,
564 ) -> std::task::Poll<Option<Self::Item>> {
565 let this = &mut *self;
566 if this.inner.check_shutdown(cx) {
567 this.is_terminated = true;
568 return std::task::Poll::Ready(None);
569 }
570 if this.is_terminated {
571 panic!("polled ConfigOverrideRequestStream after completion");
572 }
573 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
574 |bytes, handles| {
575 match this.inner.channel().read_etc(cx, bytes, handles) {
576 std::task::Poll::Ready(Ok(())) => {}
577 std::task::Poll::Pending => return std::task::Poll::Pending,
578 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
579 this.is_terminated = true;
580 return std::task::Poll::Ready(None);
581 }
582 std::task::Poll::Ready(Err(e)) => {
583 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
584 e.into(),
585 ))))
586 }
587 }
588
589 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
591
592 std::task::Poll::Ready(Some(match header.ordinal {
593 0x2c6a138832d2e0ee => {
594 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
595 let mut req = fidl::new_empty!(
596 ConfigOverrideSetStructuredConfigRequest,
597 fidl::encoding::DefaultFuchsiaResourceDialect
598 );
599 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConfigOverrideSetStructuredConfigRequest>(&header, _body_bytes, handles, &mut req)?;
600 let control_handle =
601 ConfigOverrideControlHandle { inner: this.inner.clone() };
602 Ok(ConfigOverrideRequest::SetStructuredConfig {
603 moniker: req.moniker,
604 fields: req.fields,
605
606 responder: ConfigOverrideSetStructuredConfigResponder {
607 control_handle: std::mem::ManuallyDrop::new(control_handle),
608 tx_id: header.tx_id,
609 },
610 })
611 }
612 0x342ec7d2bef05552 => {
613 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
614 let mut req = fidl::new_empty!(
615 ConfigOverrideUnsetStructuredConfigRequest,
616 fidl::encoding::DefaultFuchsiaResourceDialect
617 );
618 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConfigOverrideUnsetStructuredConfigRequest>(&header, _body_bytes, handles, &mut req)?;
619 let control_handle =
620 ConfigOverrideControlHandle { inner: this.inner.clone() };
621 Ok(ConfigOverrideRequest::UnsetStructuredConfig {
622 moniker: req.moniker,
623
624 responder: ConfigOverrideUnsetStructuredConfigResponder {
625 control_handle: std::mem::ManuallyDrop::new(control_handle),
626 tx_id: header.tx_id,
627 },
628 })
629 }
630 _ if header.tx_id == 0
631 && header
632 .dynamic_flags()
633 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
634 {
635 Ok(ConfigOverrideRequest::_UnknownMethod {
636 ordinal: header.ordinal,
637 control_handle: ConfigOverrideControlHandle {
638 inner: this.inner.clone(),
639 },
640 method_type: fidl::MethodType::OneWay,
641 })
642 }
643 _ if header
644 .dynamic_flags()
645 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
646 {
647 this.inner.send_framework_err(
648 fidl::encoding::FrameworkErr::UnknownMethod,
649 header.tx_id,
650 header.ordinal,
651 header.dynamic_flags(),
652 (bytes, handles),
653 )?;
654 Ok(ConfigOverrideRequest::_UnknownMethod {
655 ordinal: header.ordinal,
656 control_handle: ConfigOverrideControlHandle {
657 inner: this.inner.clone(),
658 },
659 method_type: fidl::MethodType::TwoWay,
660 })
661 }
662 _ => Err(fidl::Error::UnknownOrdinal {
663 ordinal: header.ordinal,
664 protocol_name:
665 <ConfigOverrideMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
666 }),
667 }))
668 },
669 )
670 }
671}
672
673#[derive(Debug)]
675pub enum ConfigOverrideRequest {
676 SetStructuredConfig {
679 moniker: String,
680 fields: Vec<fidl_fuchsia_component_decl::ConfigOverride>,
681 responder: ConfigOverrideSetStructuredConfigResponder,
682 },
683 UnsetStructuredConfig {
687 moniker: String,
688 responder: ConfigOverrideUnsetStructuredConfigResponder,
689 },
690 #[non_exhaustive]
692 _UnknownMethod {
693 ordinal: u64,
695 control_handle: ConfigOverrideControlHandle,
696 method_type: fidl::MethodType,
697 },
698}
699
700impl ConfigOverrideRequest {
701 #[allow(irrefutable_let_patterns)]
702 pub fn into_set_structured_config(
703 self,
704 ) -> Option<(
705 String,
706 Vec<fidl_fuchsia_component_decl::ConfigOverride>,
707 ConfigOverrideSetStructuredConfigResponder,
708 )> {
709 if let ConfigOverrideRequest::SetStructuredConfig { moniker, fields, responder } = self {
710 Some((moniker, fields, responder))
711 } else {
712 None
713 }
714 }
715
716 #[allow(irrefutable_let_patterns)]
717 pub fn into_unset_structured_config(
718 self,
719 ) -> Option<(String, ConfigOverrideUnsetStructuredConfigResponder)> {
720 if let ConfigOverrideRequest::UnsetStructuredConfig { moniker, responder } = self {
721 Some((moniker, responder))
722 } else {
723 None
724 }
725 }
726
727 pub fn method_name(&self) -> &'static str {
729 match *self {
730 ConfigOverrideRequest::SetStructuredConfig { .. } => "set_structured_config",
731 ConfigOverrideRequest::UnsetStructuredConfig { .. } => "unset_structured_config",
732 ConfigOverrideRequest::_UnknownMethod {
733 method_type: fidl::MethodType::OneWay, ..
734 } => "unknown one-way method",
735 ConfigOverrideRequest::_UnknownMethod {
736 method_type: fidl::MethodType::TwoWay, ..
737 } => "unknown two-way method",
738 }
739 }
740}
741
742#[derive(Debug, Clone)]
743pub struct ConfigOverrideControlHandle {
744 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
745}
746
747impl fidl::endpoints::ControlHandle for ConfigOverrideControlHandle {
748 fn shutdown(&self) {
749 self.inner.shutdown()
750 }
751 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
752 self.inner.shutdown_with_epitaph(status)
753 }
754
755 fn is_closed(&self) -> bool {
756 self.inner.channel().is_closed()
757 }
758 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
759 self.inner.channel().on_closed()
760 }
761
762 #[cfg(target_os = "fuchsia")]
763 fn signal_peer(
764 &self,
765 clear_mask: zx::Signals,
766 set_mask: zx::Signals,
767 ) -> Result<(), zx_status::Status> {
768 use fidl::Peered;
769 self.inner.channel().signal_peer(clear_mask, set_mask)
770 }
771}
772
773impl ConfigOverrideControlHandle {}
774
775#[must_use = "FIDL methods require a response to be sent"]
776#[derive(Debug)]
777pub struct ConfigOverrideSetStructuredConfigResponder {
778 control_handle: std::mem::ManuallyDrop<ConfigOverrideControlHandle>,
779 tx_id: u32,
780}
781
782impl std::ops::Drop for ConfigOverrideSetStructuredConfigResponder {
786 fn drop(&mut self) {
787 self.control_handle.shutdown();
788 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
790 }
791}
792
793impl fidl::endpoints::Responder for ConfigOverrideSetStructuredConfigResponder {
794 type ControlHandle = ConfigOverrideControlHandle;
795
796 fn control_handle(&self) -> &ConfigOverrideControlHandle {
797 &self.control_handle
798 }
799
800 fn drop_without_shutdown(mut self) {
801 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
803 std::mem::forget(self);
805 }
806}
807
808impl ConfigOverrideSetStructuredConfigResponder {
809 pub fn send(self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
813 let _result = self.send_raw(result);
814 if _result.is_err() {
815 self.control_handle.shutdown();
816 }
817 self.drop_without_shutdown();
818 _result
819 }
820
821 pub fn send_no_shutdown_on_err(
823 self,
824 mut result: Result<(), ConfigOverrideError>,
825 ) -> Result<(), fidl::Error> {
826 let _result = self.send_raw(result);
827 self.drop_without_shutdown();
828 _result
829 }
830
831 fn send_raw(&self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
832 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
833 fidl::encoding::EmptyStruct,
834 ConfigOverrideError,
835 >>(
836 fidl::encoding::FlexibleResult::new(result),
837 self.tx_id,
838 0x2c6a138832d2e0ee,
839 fidl::encoding::DynamicFlags::FLEXIBLE,
840 )
841 }
842}
843
844#[must_use = "FIDL methods require a response to be sent"]
845#[derive(Debug)]
846pub struct ConfigOverrideUnsetStructuredConfigResponder {
847 control_handle: std::mem::ManuallyDrop<ConfigOverrideControlHandle>,
848 tx_id: u32,
849}
850
851impl std::ops::Drop for ConfigOverrideUnsetStructuredConfigResponder {
855 fn drop(&mut self) {
856 self.control_handle.shutdown();
857 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
859 }
860}
861
862impl fidl::endpoints::Responder for ConfigOverrideUnsetStructuredConfigResponder {
863 type ControlHandle = ConfigOverrideControlHandle;
864
865 fn control_handle(&self) -> &ConfigOverrideControlHandle {
866 &self.control_handle
867 }
868
869 fn drop_without_shutdown(mut self) {
870 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
872 std::mem::forget(self);
874 }
875}
876
877impl ConfigOverrideUnsetStructuredConfigResponder {
878 pub fn send(self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
882 let _result = self.send_raw(result);
883 if _result.is_err() {
884 self.control_handle.shutdown();
885 }
886 self.drop_without_shutdown();
887 _result
888 }
889
890 pub fn send_no_shutdown_on_err(
892 self,
893 mut result: Result<(), ConfigOverrideError>,
894 ) -> Result<(), fidl::Error> {
895 let _result = self.send_raw(result);
896 self.drop_without_shutdown();
897 _result
898 }
899
900 fn send_raw(&self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
901 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
902 fidl::encoding::EmptyStruct,
903 ConfigOverrideError,
904 >>(
905 fidl::encoding::FlexibleResult::new(result),
906 self.tx_id,
907 0x342ec7d2bef05552,
908 fidl::encoding::DynamicFlags::FLEXIBLE,
909 )
910 }
911}
912
913#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
914pub struct CrashIntrospectMarker;
915
916impl fidl::endpoints::ProtocolMarker for CrashIntrospectMarker {
917 type Proxy = CrashIntrospectProxy;
918 type RequestStream = CrashIntrospectRequestStream;
919 #[cfg(target_os = "fuchsia")]
920 type SynchronousProxy = CrashIntrospectSynchronousProxy;
921
922 const DEBUG_NAME: &'static str = "fuchsia.sys2.CrashIntrospect";
923}
924impl fidl::endpoints::DiscoverableProtocolMarker for CrashIntrospectMarker {}
925pub type CrashIntrospectFindComponentByThreadKoidResult =
926 Result<ComponentCrashInfo, fidl_fuchsia_component::Error>;
927
928pub trait CrashIntrospectProxyInterface: Send + Sync {
929 type FindComponentByThreadKoidResponseFut: std::future::Future<
930 Output = Result<CrashIntrospectFindComponentByThreadKoidResult, fidl::Error>,
931 > + Send;
932 fn r#find_component_by_thread_koid(
933 &self,
934 thread_koid: u64,
935 ) -> Self::FindComponentByThreadKoidResponseFut;
936}
937#[derive(Debug)]
938#[cfg(target_os = "fuchsia")]
939pub struct CrashIntrospectSynchronousProxy {
940 client: fidl::client::sync::Client,
941}
942
943#[cfg(target_os = "fuchsia")]
944impl fidl::endpoints::SynchronousProxy for CrashIntrospectSynchronousProxy {
945 type Proxy = CrashIntrospectProxy;
946 type Protocol = CrashIntrospectMarker;
947
948 fn from_channel(inner: fidl::Channel) -> Self {
949 Self::new(inner)
950 }
951
952 fn into_channel(self) -> fidl::Channel {
953 self.client.into_channel()
954 }
955
956 fn as_channel(&self) -> &fidl::Channel {
957 self.client.as_channel()
958 }
959}
960
961#[cfg(target_os = "fuchsia")]
962impl CrashIntrospectSynchronousProxy {
963 pub fn new(channel: fidl::Channel) -> Self {
964 let protocol_name = <CrashIntrospectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
965 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
966 }
967
968 pub fn into_channel(self) -> fidl::Channel {
969 self.client.into_channel()
970 }
971
972 pub fn wait_for_event(
975 &self,
976 deadline: zx::MonotonicInstant,
977 ) -> Result<CrashIntrospectEvent, fidl::Error> {
978 CrashIntrospectEvent::decode(self.client.wait_for_event(deadline)?)
979 }
980
981 pub fn r#find_component_by_thread_koid(
990 &self,
991 mut thread_koid: u64,
992 ___deadline: zx::MonotonicInstant,
993 ) -> Result<CrashIntrospectFindComponentByThreadKoidResult, fidl::Error> {
994 let _response = self.client.send_query::<
995 CrashIntrospectFindComponentByThreadKoidRequest,
996 fidl::encoding::ResultType<CrashIntrospectFindComponentByThreadKoidResponse, fidl_fuchsia_component::Error>,
997 >(
998 (thread_koid,),
999 0x75d3ff081eca468d,
1000 fidl::encoding::DynamicFlags::empty(),
1001 ___deadline,
1002 )?;
1003 Ok(_response.map(|x| x.info))
1004 }
1005}
1006
1007#[cfg(target_os = "fuchsia")]
1008impl From<CrashIntrospectSynchronousProxy> for zx::Handle {
1009 fn from(value: CrashIntrospectSynchronousProxy) -> Self {
1010 value.into_channel().into()
1011 }
1012}
1013
1014#[cfg(target_os = "fuchsia")]
1015impl From<fidl::Channel> for CrashIntrospectSynchronousProxy {
1016 fn from(value: fidl::Channel) -> Self {
1017 Self::new(value)
1018 }
1019}
1020
1021#[derive(Debug, Clone)]
1022pub struct CrashIntrospectProxy {
1023 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1024}
1025
1026impl fidl::endpoints::Proxy for CrashIntrospectProxy {
1027 type Protocol = CrashIntrospectMarker;
1028
1029 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1030 Self::new(inner)
1031 }
1032
1033 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1034 self.client.into_channel().map_err(|client| Self { client })
1035 }
1036
1037 fn as_channel(&self) -> &::fidl::AsyncChannel {
1038 self.client.as_channel()
1039 }
1040}
1041
1042impl CrashIntrospectProxy {
1043 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1045 let protocol_name = <CrashIntrospectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1046 Self { client: fidl::client::Client::new(channel, protocol_name) }
1047 }
1048
1049 pub fn take_event_stream(&self) -> CrashIntrospectEventStream {
1055 CrashIntrospectEventStream { event_receiver: self.client.take_event_receiver() }
1056 }
1057
1058 pub fn r#find_component_by_thread_koid(
1067 &self,
1068 mut thread_koid: u64,
1069 ) -> fidl::client::QueryResponseFut<
1070 CrashIntrospectFindComponentByThreadKoidResult,
1071 fidl::encoding::DefaultFuchsiaResourceDialect,
1072 > {
1073 CrashIntrospectProxyInterface::r#find_component_by_thread_koid(self, thread_koid)
1074 }
1075}
1076
1077impl CrashIntrospectProxyInterface for CrashIntrospectProxy {
1078 type FindComponentByThreadKoidResponseFut = fidl::client::QueryResponseFut<
1079 CrashIntrospectFindComponentByThreadKoidResult,
1080 fidl::encoding::DefaultFuchsiaResourceDialect,
1081 >;
1082 fn r#find_component_by_thread_koid(
1083 &self,
1084 mut thread_koid: u64,
1085 ) -> Self::FindComponentByThreadKoidResponseFut {
1086 fn _decode(
1087 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1088 ) -> Result<CrashIntrospectFindComponentByThreadKoidResult, fidl::Error> {
1089 let _response = fidl::client::decode_transaction_body::<
1090 fidl::encoding::ResultType<
1091 CrashIntrospectFindComponentByThreadKoidResponse,
1092 fidl_fuchsia_component::Error,
1093 >,
1094 fidl::encoding::DefaultFuchsiaResourceDialect,
1095 0x75d3ff081eca468d,
1096 >(_buf?)?;
1097 Ok(_response.map(|x| x.info))
1098 }
1099 self.client.send_query_and_decode::<
1100 CrashIntrospectFindComponentByThreadKoidRequest,
1101 CrashIntrospectFindComponentByThreadKoidResult,
1102 >(
1103 (thread_koid,),
1104 0x75d3ff081eca468d,
1105 fidl::encoding::DynamicFlags::empty(),
1106 _decode,
1107 )
1108 }
1109}
1110
1111pub struct CrashIntrospectEventStream {
1112 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1113}
1114
1115impl std::marker::Unpin for CrashIntrospectEventStream {}
1116
1117impl futures::stream::FusedStream for CrashIntrospectEventStream {
1118 fn is_terminated(&self) -> bool {
1119 self.event_receiver.is_terminated()
1120 }
1121}
1122
1123impl futures::Stream for CrashIntrospectEventStream {
1124 type Item = Result<CrashIntrospectEvent, fidl::Error>;
1125
1126 fn poll_next(
1127 mut self: std::pin::Pin<&mut Self>,
1128 cx: &mut std::task::Context<'_>,
1129 ) -> std::task::Poll<Option<Self::Item>> {
1130 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1131 &mut self.event_receiver,
1132 cx
1133 )?) {
1134 Some(buf) => std::task::Poll::Ready(Some(CrashIntrospectEvent::decode(buf))),
1135 None => std::task::Poll::Ready(None),
1136 }
1137 }
1138}
1139
1140#[derive(Debug)]
1141pub enum CrashIntrospectEvent {}
1142
1143impl CrashIntrospectEvent {
1144 fn decode(
1146 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1147 ) -> Result<CrashIntrospectEvent, fidl::Error> {
1148 let (bytes, _handles) = buf.split_mut();
1149 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1150 debug_assert_eq!(tx_header.tx_id, 0);
1151 match tx_header.ordinal {
1152 _ => Err(fidl::Error::UnknownOrdinal {
1153 ordinal: tx_header.ordinal,
1154 protocol_name:
1155 <CrashIntrospectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1156 }),
1157 }
1158 }
1159}
1160
1161pub struct CrashIntrospectRequestStream {
1163 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1164 is_terminated: bool,
1165}
1166
1167impl std::marker::Unpin for CrashIntrospectRequestStream {}
1168
1169impl futures::stream::FusedStream for CrashIntrospectRequestStream {
1170 fn is_terminated(&self) -> bool {
1171 self.is_terminated
1172 }
1173}
1174
1175impl fidl::endpoints::RequestStream for CrashIntrospectRequestStream {
1176 type Protocol = CrashIntrospectMarker;
1177 type ControlHandle = CrashIntrospectControlHandle;
1178
1179 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1180 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1181 }
1182
1183 fn control_handle(&self) -> Self::ControlHandle {
1184 CrashIntrospectControlHandle { inner: self.inner.clone() }
1185 }
1186
1187 fn into_inner(
1188 self,
1189 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1190 {
1191 (self.inner, self.is_terminated)
1192 }
1193
1194 fn from_inner(
1195 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1196 is_terminated: bool,
1197 ) -> Self {
1198 Self { inner, is_terminated }
1199 }
1200}
1201
1202impl futures::Stream for CrashIntrospectRequestStream {
1203 type Item = Result<CrashIntrospectRequest, fidl::Error>;
1204
1205 fn poll_next(
1206 mut self: std::pin::Pin<&mut Self>,
1207 cx: &mut std::task::Context<'_>,
1208 ) -> std::task::Poll<Option<Self::Item>> {
1209 let this = &mut *self;
1210 if this.inner.check_shutdown(cx) {
1211 this.is_terminated = true;
1212 return std::task::Poll::Ready(None);
1213 }
1214 if this.is_terminated {
1215 panic!("polled CrashIntrospectRequestStream after completion");
1216 }
1217 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1218 |bytes, handles| {
1219 match this.inner.channel().read_etc(cx, bytes, handles) {
1220 std::task::Poll::Ready(Ok(())) => {}
1221 std::task::Poll::Pending => return std::task::Poll::Pending,
1222 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1223 this.is_terminated = true;
1224 return std::task::Poll::Ready(None);
1225 }
1226 std::task::Poll::Ready(Err(e)) => {
1227 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1228 e.into(),
1229 ))))
1230 }
1231 }
1232
1233 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1235
1236 std::task::Poll::Ready(Some(match header.ordinal {
1237 0x75d3ff081eca468d => {
1238 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1239 let mut req = fidl::new_empty!(
1240 CrashIntrospectFindComponentByThreadKoidRequest,
1241 fidl::encoding::DefaultFuchsiaResourceDialect
1242 );
1243 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CrashIntrospectFindComponentByThreadKoidRequest>(&header, _body_bytes, handles, &mut req)?;
1244 let control_handle =
1245 CrashIntrospectControlHandle { inner: this.inner.clone() };
1246 Ok(CrashIntrospectRequest::FindComponentByThreadKoid {
1247 thread_koid: req.thread_koid,
1248
1249 responder: CrashIntrospectFindComponentByThreadKoidResponder {
1250 control_handle: std::mem::ManuallyDrop::new(control_handle),
1251 tx_id: header.tx_id,
1252 },
1253 })
1254 }
1255 _ => Err(fidl::Error::UnknownOrdinal {
1256 ordinal: header.ordinal,
1257 protocol_name:
1258 <CrashIntrospectMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1259 }),
1260 }))
1261 },
1262 )
1263 }
1264}
1265
1266#[derive(Debug)]
1270pub enum CrashIntrospectRequest {
1271 FindComponentByThreadKoid {
1280 thread_koid: u64,
1281 responder: CrashIntrospectFindComponentByThreadKoidResponder,
1282 },
1283}
1284
1285impl CrashIntrospectRequest {
1286 #[allow(irrefutable_let_patterns)]
1287 pub fn into_find_component_by_thread_koid(
1288 self,
1289 ) -> Option<(u64, CrashIntrospectFindComponentByThreadKoidResponder)> {
1290 if let CrashIntrospectRequest::FindComponentByThreadKoid { thread_koid, responder } = self {
1291 Some((thread_koid, responder))
1292 } else {
1293 None
1294 }
1295 }
1296
1297 pub fn method_name(&self) -> &'static str {
1299 match *self {
1300 CrashIntrospectRequest::FindComponentByThreadKoid { .. } => {
1301 "find_component_by_thread_koid"
1302 }
1303 }
1304 }
1305}
1306
1307#[derive(Debug, Clone)]
1308pub struct CrashIntrospectControlHandle {
1309 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1310}
1311
1312impl fidl::endpoints::ControlHandle for CrashIntrospectControlHandle {
1313 fn shutdown(&self) {
1314 self.inner.shutdown()
1315 }
1316 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1317 self.inner.shutdown_with_epitaph(status)
1318 }
1319
1320 fn is_closed(&self) -> bool {
1321 self.inner.channel().is_closed()
1322 }
1323 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1324 self.inner.channel().on_closed()
1325 }
1326
1327 #[cfg(target_os = "fuchsia")]
1328 fn signal_peer(
1329 &self,
1330 clear_mask: zx::Signals,
1331 set_mask: zx::Signals,
1332 ) -> Result<(), zx_status::Status> {
1333 use fidl::Peered;
1334 self.inner.channel().signal_peer(clear_mask, set_mask)
1335 }
1336}
1337
1338impl CrashIntrospectControlHandle {}
1339
1340#[must_use = "FIDL methods require a response to be sent"]
1341#[derive(Debug)]
1342pub struct CrashIntrospectFindComponentByThreadKoidResponder {
1343 control_handle: std::mem::ManuallyDrop<CrashIntrospectControlHandle>,
1344 tx_id: u32,
1345}
1346
1347impl std::ops::Drop for CrashIntrospectFindComponentByThreadKoidResponder {
1351 fn drop(&mut self) {
1352 self.control_handle.shutdown();
1353 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1355 }
1356}
1357
1358impl fidl::endpoints::Responder for CrashIntrospectFindComponentByThreadKoidResponder {
1359 type ControlHandle = CrashIntrospectControlHandle;
1360
1361 fn control_handle(&self) -> &CrashIntrospectControlHandle {
1362 &self.control_handle
1363 }
1364
1365 fn drop_without_shutdown(mut self) {
1366 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1368 std::mem::forget(self);
1370 }
1371}
1372
1373impl CrashIntrospectFindComponentByThreadKoidResponder {
1374 pub fn send(
1378 self,
1379 mut result: Result<&ComponentCrashInfo, fidl_fuchsia_component::Error>,
1380 ) -> Result<(), fidl::Error> {
1381 let _result = self.send_raw(result);
1382 if _result.is_err() {
1383 self.control_handle.shutdown();
1384 }
1385 self.drop_without_shutdown();
1386 _result
1387 }
1388
1389 pub fn send_no_shutdown_on_err(
1391 self,
1392 mut result: Result<&ComponentCrashInfo, fidl_fuchsia_component::Error>,
1393 ) -> Result<(), fidl::Error> {
1394 let _result = self.send_raw(result);
1395 self.drop_without_shutdown();
1396 _result
1397 }
1398
1399 fn send_raw(
1400 &self,
1401 mut result: Result<&ComponentCrashInfo, fidl_fuchsia_component::Error>,
1402 ) -> Result<(), fidl::Error> {
1403 self.control_handle.inner.send::<fidl::encoding::ResultType<
1404 CrashIntrospectFindComponentByThreadKoidResponse,
1405 fidl_fuchsia_component::Error,
1406 >>(
1407 result.map(|info| (info,)),
1408 self.tx_id,
1409 0x75d3ff081eca468d,
1410 fidl::encoding::DynamicFlags::empty(),
1411 )
1412 }
1413}
1414
1415#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1416pub struct InstanceIteratorMarker;
1417
1418impl fidl::endpoints::ProtocolMarker for InstanceIteratorMarker {
1419 type Proxy = InstanceIteratorProxy;
1420 type RequestStream = InstanceIteratorRequestStream;
1421 #[cfg(target_os = "fuchsia")]
1422 type SynchronousProxy = InstanceIteratorSynchronousProxy;
1423
1424 const DEBUG_NAME: &'static str = "(anonymous) InstanceIterator";
1425}
1426
1427pub trait InstanceIteratorProxyInterface: Send + Sync {
1428 type NextResponseFut: std::future::Future<Output = Result<Vec<Instance>, fidl::Error>> + Send;
1429 fn r#next(&self) -> Self::NextResponseFut;
1430}
1431#[derive(Debug)]
1432#[cfg(target_os = "fuchsia")]
1433pub struct InstanceIteratorSynchronousProxy {
1434 client: fidl::client::sync::Client,
1435}
1436
1437#[cfg(target_os = "fuchsia")]
1438impl fidl::endpoints::SynchronousProxy for InstanceIteratorSynchronousProxy {
1439 type Proxy = InstanceIteratorProxy;
1440 type Protocol = InstanceIteratorMarker;
1441
1442 fn from_channel(inner: fidl::Channel) -> Self {
1443 Self::new(inner)
1444 }
1445
1446 fn into_channel(self) -> fidl::Channel {
1447 self.client.into_channel()
1448 }
1449
1450 fn as_channel(&self) -> &fidl::Channel {
1451 self.client.as_channel()
1452 }
1453}
1454
1455#[cfg(target_os = "fuchsia")]
1456impl InstanceIteratorSynchronousProxy {
1457 pub fn new(channel: fidl::Channel) -> Self {
1458 let protocol_name = <InstanceIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1459 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1460 }
1461
1462 pub fn into_channel(self) -> fidl::Channel {
1463 self.client.into_channel()
1464 }
1465
1466 pub fn wait_for_event(
1469 &self,
1470 deadline: zx::MonotonicInstant,
1471 ) -> Result<InstanceIteratorEvent, fidl::Error> {
1472 InstanceIteratorEvent::decode(self.client.wait_for_event(deadline)?)
1473 }
1474
1475 pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<Instance>, fidl::Error> {
1476 let _response =
1477 self.client.send_query::<fidl::encoding::EmptyPayload, InstanceIteratorNextResponse>(
1478 (),
1479 0x3a4e3d52432a52ee,
1480 fidl::encoding::DynamicFlags::empty(),
1481 ___deadline,
1482 )?;
1483 Ok(_response.infos)
1484 }
1485}
1486
1487#[cfg(target_os = "fuchsia")]
1488impl From<InstanceIteratorSynchronousProxy> for zx::Handle {
1489 fn from(value: InstanceIteratorSynchronousProxy) -> Self {
1490 value.into_channel().into()
1491 }
1492}
1493
1494#[cfg(target_os = "fuchsia")]
1495impl From<fidl::Channel> for InstanceIteratorSynchronousProxy {
1496 fn from(value: fidl::Channel) -> Self {
1497 Self::new(value)
1498 }
1499}
1500
1501#[derive(Debug, Clone)]
1502pub struct InstanceIteratorProxy {
1503 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1504}
1505
1506impl fidl::endpoints::Proxy for InstanceIteratorProxy {
1507 type Protocol = InstanceIteratorMarker;
1508
1509 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1510 Self::new(inner)
1511 }
1512
1513 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1514 self.client.into_channel().map_err(|client| Self { client })
1515 }
1516
1517 fn as_channel(&self) -> &::fidl::AsyncChannel {
1518 self.client.as_channel()
1519 }
1520}
1521
1522impl InstanceIteratorProxy {
1523 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1525 let protocol_name = <InstanceIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1526 Self { client: fidl::client::Client::new(channel, protocol_name) }
1527 }
1528
1529 pub fn take_event_stream(&self) -> InstanceIteratorEventStream {
1535 InstanceIteratorEventStream { event_receiver: self.client.take_event_receiver() }
1536 }
1537
1538 pub fn r#next(
1539 &self,
1540 ) -> fidl::client::QueryResponseFut<Vec<Instance>, fidl::encoding::DefaultFuchsiaResourceDialect>
1541 {
1542 InstanceIteratorProxyInterface::r#next(self)
1543 }
1544}
1545
1546impl InstanceIteratorProxyInterface for InstanceIteratorProxy {
1547 type NextResponseFut = fidl::client::QueryResponseFut<
1548 Vec<Instance>,
1549 fidl::encoding::DefaultFuchsiaResourceDialect,
1550 >;
1551 fn r#next(&self) -> Self::NextResponseFut {
1552 fn _decode(
1553 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1554 ) -> Result<Vec<Instance>, fidl::Error> {
1555 let _response = fidl::client::decode_transaction_body::<
1556 InstanceIteratorNextResponse,
1557 fidl::encoding::DefaultFuchsiaResourceDialect,
1558 0x3a4e3d52432a52ee,
1559 >(_buf?)?;
1560 Ok(_response.infos)
1561 }
1562 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Instance>>(
1563 (),
1564 0x3a4e3d52432a52ee,
1565 fidl::encoding::DynamicFlags::empty(),
1566 _decode,
1567 )
1568 }
1569}
1570
1571pub struct InstanceIteratorEventStream {
1572 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1573}
1574
1575impl std::marker::Unpin for InstanceIteratorEventStream {}
1576
1577impl futures::stream::FusedStream for InstanceIteratorEventStream {
1578 fn is_terminated(&self) -> bool {
1579 self.event_receiver.is_terminated()
1580 }
1581}
1582
1583impl futures::Stream for InstanceIteratorEventStream {
1584 type Item = Result<InstanceIteratorEvent, fidl::Error>;
1585
1586 fn poll_next(
1587 mut self: std::pin::Pin<&mut Self>,
1588 cx: &mut std::task::Context<'_>,
1589 ) -> std::task::Poll<Option<Self::Item>> {
1590 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1591 &mut self.event_receiver,
1592 cx
1593 )?) {
1594 Some(buf) => std::task::Poll::Ready(Some(InstanceIteratorEvent::decode(buf))),
1595 None => std::task::Poll::Ready(None),
1596 }
1597 }
1598}
1599
1600#[derive(Debug)]
1601pub enum InstanceIteratorEvent {}
1602
1603impl InstanceIteratorEvent {
1604 fn decode(
1606 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1607 ) -> Result<InstanceIteratorEvent, fidl::Error> {
1608 let (bytes, _handles) = buf.split_mut();
1609 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1610 debug_assert_eq!(tx_header.tx_id, 0);
1611 match tx_header.ordinal {
1612 _ => Err(fidl::Error::UnknownOrdinal {
1613 ordinal: tx_header.ordinal,
1614 protocol_name:
1615 <InstanceIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1616 }),
1617 }
1618 }
1619}
1620
1621pub struct InstanceIteratorRequestStream {
1623 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1624 is_terminated: bool,
1625}
1626
1627impl std::marker::Unpin for InstanceIteratorRequestStream {}
1628
1629impl futures::stream::FusedStream for InstanceIteratorRequestStream {
1630 fn is_terminated(&self) -> bool {
1631 self.is_terminated
1632 }
1633}
1634
1635impl fidl::endpoints::RequestStream for InstanceIteratorRequestStream {
1636 type Protocol = InstanceIteratorMarker;
1637 type ControlHandle = InstanceIteratorControlHandle;
1638
1639 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1640 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1641 }
1642
1643 fn control_handle(&self) -> Self::ControlHandle {
1644 InstanceIteratorControlHandle { inner: self.inner.clone() }
1645 }
1646
1647 fn into_inner(
1648 self,
1649 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1650 {
1651 (self.inner, self.is_terminated)
1652 }
1653
1654 fn from_inner(
1655 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1656 is_terminated: bool,
1657 ) -> Self {
1658 Self { inner, is_terminated }
1659 }
1660}
1661
1662impl futures::Stream for InstanceIteratorRequestStream {
1663 type Item = Result<InstanceIteratorRequest, fidl::Error>;
1664
1665 fn poll_next(
1666 mut self: std::pin::Pin<&mut Self>,
1667 cx: &mut std::task::Context<'_>,
1668 ) -> std::task::Poll<Option<Self::Item>> {
1669 let this = &mut *self;
1670 if this.inner.check_shutdown(cx) {
1671 this.is_terminated = true;
1672 return std::task::Poll::Ready(None);
1673 }
1674 if this.is_terminated {
1675 panic!("polled InstanceIteratorRequestStream after completion");
1676 }
1677 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1678 |bytes, handles| {
1679 match this.inner.channel().read_etc(cx, bytes, handles) {
1680 std::task::Poll::Ready(Ok(())) => {}
1681 std::task::Poll::Pending => return std::task::Poll::Pending,
1682 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1683 this.is_terminated = true;
1684 return std::task::Poll::Ready(None);
1685 }
1686 std::task::Poll::Ready(Err(e)) => {
1687 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1688 e.into(),
1689 ))))
1690 }
1691 }
1692
1693 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1695
1696 std::task::Poll::Ready(Some(match header.ordinal {
1697 0x3a4e3d52432a52ee => {
1698 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1699 let mut req = fidl::new_empty!(
1700 fidl::encoding::EmptyPayload,
1701 fidl::encoding::DefaultFuchsiaResourceDialect
1702 );
1703 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1704 let control_handle =
1705 InstanceIteratorControlHandle { inner: this.inner.clone() };
1706 Ok(InstanceIteratorRequest::Next {
1707 responder: InstanceIteratorNextResponder {
1708 control_handle: std::mem::ManuallyDrop::new(control_handle),
1709 tx_id: header.tx_id,
1710 },
1711 })
1712 }
1713 _ => Err(fidl::Error::UnknownOrdinal {
1714 ordinal: header.ordinal,
1715 protocol_name:
1716 <InstanceIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1717 }),
1718 }))
1719 },
1720 )
1721 }
1722}
1723
1724#[derive(Debug)]
1726pub enum InstanceIteratorRequest {
1727 Next { responder: InstanceIteratorNextResponder },
1728}
1729
1730impl InstanceIteratorRequest {
1731 #[allow(irrefutable_let_patterns)]
1732 pub fn into_next(self) -> Option<(InstanceIteratorNextResponder)> {
1733 if let InstanceIteratorRequest::Next { responder } = self {
1734 Some((responder))
1735 } else {
1736 None
1737 }
1738 }
1739
1740 pub fn method_name(&self) -> &'static str {
1742 match *self {
1743 InstanceIteratorRequest::Next { .. } => "next",
1744 }
1745 }
1746}
1747
1748#[derive(Debug, Clone)]
1749pub struct InstanceIteratorControlHandle {
1750 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1751}
1752
1753impl fidl::endpoints::ControlHandle for InstanceIteratorControlHandle {
1754 fn shutdown(&self) {
1755 self.inner.shutdown()
1756 }
1757 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1758 self.inner.shutdown_with_epitaph(status)
1759 }
1760
1761 fn is_closed(&self) -> bool {
1762 self.inner.channel().is_closed()
1763 }
1764 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1765 self.inner.channel().on_closed()
1766 }
1767
1768 #[cfg(target_os = "fuchsia")]
1769 fn signal_peer(
1770 &self,
1771 clear_mask: zx::Signals,
1772 set_mask: zx::Signals,
1773 ) -> Result<(), zx_status::Status> {
1774 use fidl::Peered;
1775 self.inner.channel().signal_peer(clear_mask, set_mask)
1776 }
1777}
1778
1779impl InstanceIteratorControlHandle {}
1780
1781#[must_use = "FIDL methods require a response to be sent"]
1782#[derive(Debug)]
1783pub struct InstanceIteratorNextResponder {
1784 control_handle: std::mem::ManuallyDrop<InstanceIteratorControlHandle>,
1785 tx_id: u32,
1786}
1787
1788impl std::ops::Drop for InstanceIteratorNextResponder {
1792 fn drop(&mut self) {
1793 self.control_handle.shutdown();
1794 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1796 }
1797}
1798
1799impl fidl::endpoints::Responder for InstanceIteratorNextResponder {
1800 type ControlHandle = InstanceIteratorControlHandle;
1801
1802 fn control_handle(&self) -> &InstanceIteratorControlHandle {
1803 &self.control_handle
1804 }
1805
1806 fn drop_without_shutdown(mut self) {
1807 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1809 std::mem::forget(self);
1811 }
1812}
1813
1814impl InstanceIteratorNextResponder {
1815 pub fn send(self, mut infos: &[Instance]) -> Result<(), fidl::Error> {
1819 let _result = self.send_raw(infos);
1820 if _result.is_err() {
1821 self.control_handle.shutdown();
1822 }
1823 self.drop_without_shutdown();
1824 _result
1825 }
1826
1827 pub fn send_no_shutdown_on_err(self, mut infos: &[Instance]) -> Result<(), fidl::Error> {
1829 let _result = self.send_raw(infos);
1830 self.drop_without_shutdown();
1831 _result
1832 }
1833
1834 fn send_raw(&self, mut infos: &[Instance]) -> Result<(), fidl::Error> {
1835 self.control_handle.inner.send::<InstanceIteratorNextResponse>(
1836 (infos,),
1837 self.tx_id,
1838 0x3a4e3d52432a52ee,
1839 fidl::encoding::DynamicFlags::empty(),
1840 )
1841 }
1842}
1843
1844#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1845pub struct LifecycleControllerMarker;
1846
1847impl fidl::endpoints::ProtocolMarker for LifecycleControllerMarker {
1848 type Proxy = LifecycleControllerProxy;
1849 type RequestStream = LifecycleControllerRequestStream;
1850 #[cfg(target_os = "fuchsia")]
1851 type SynchronousProxy = LifecycleControllerSynchronousProxy;
1852
1853 const DEBUG_NAME: &'static str = "fuchsia.sys2.LifecycleController";
1854}
1855impl fidl::endpoints::DiscoverableProtocolMarker for LifecycleControllerMarker {}
1856pub type LifecycleControllerStartInstanceResult = Result<(), StartError>;
1857pub type LifecycleControllerStartInstanceWithArgsResult = Result<(), StartError>;
1858pub type LifecycleControllerStopInstanceResult = Result<(), StopError>;
1859pub type LifecycleControllerResolveInstanceResult = Result<(), ResolveError>;
1860pub type LifecycleControllerUnresolveInstanceResult = Result<(), UnresolveError>;
1861pub type LifecycleControllerCreateInstanceResult = Result<(), CreateError>;
1862pub type LifecycleControllerDestroyInstanceResult = Result<(), DestroyError>;
1863
1864pub trait LifecycleControllerProxyInterface: Send + Sync {
1865 type StartInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerStartInstanceResult, fidl::Error>>
1866 + Send;
1867 fn r#start_instance(
1868 &self,
1869 moniker: &str,
1870 binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
1871 ) -> Self::StartInstanceResponseFut;
1872 type StartInstanceWithArgsResponseFut: std::future::Future<
1873 Output = Result<LifecycleControllerStartInstanceWithArgsResult, fidl::Error>,
1874 > + Send;
1875 fn r#start_instance_with_args(
1876 &self,
1877 moniker: &str,
1878 binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
1879 args: fidl_fuchsia_component::StartChildArgs,
1880 ) -> Self::StartInstanceWithArgsResponseFut;
1881 type StopInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerStopInstanceResult, fidl::Error>>
1882 + Send;
1883 fn r#stop_instance(&self, moniker: &str) -> Self::StopInstanceResponseFut;
1884 type ResolveInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerResolveInstanceResult, fidl::Error>>
1885 + Send;
1886 fn r#resolve_instance(&self, moniker: &str) -> Self::ResolveInstanceResponseFut;
1887 type UnresolveInstanceResponseFut: std::future::Future<
1888 Output = Result<LifecycleControllerUnresolveInstanceResult, fidl::Error>,
1889 > + Send;
1890 fn r#unresolve_instance(&self, moniker: &str) -> Self::UnresolveInstanceResponseFut;
1891 type CreateInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerCreateInstanceResult, fidl::Error>>
1892 + Send;
1893 fn r#create_instance(
1894 &self,
1895 parent_moniker: &str,
1896 collection: &fidl_fuchsia_component_decl::CollectionRef,
1897 decl: &fidl_fuchsia_component_decl::Child,
1898 args: fidl_fuchsia_component::CreateChildArgs,
1899 ) -> Self::CreateInstanceResponseFut;
1900 type DestroyInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerDestroyInstanceResult, fidl::Error>>
1901 + Send;
1902 fn r#destroy_instance(
1903 &self,
1904 parent_moniker: &str,
1905 child: &fidl_fuchsia_component_decl::ChildRef,
1906 ) -> Self::DestroyInstanceResponseFut;
1907}
1908#[derive(Debug)]
1909#[cfg(target_os = "fuchsia")]
1910pub struct LifecycleControllerSynchronousProxy {
1911 client: fidl::client::sync::Client,
1912}
1913
1914#[cfg(target_os = "fuchsia")]
1915impl fidl::endpoints::SynchronousProxy for LifecycleControllerSynchronousProxy {
1916 type Proxy = LifecycleControllerProxy;
1917 type Protocol = LifecycleControllerMarker;
1918
1919 fn from_channel(inner: fidl::Channel) -> Self {
1920 Self::new(inner)
1921 }
1922
1923 fn into_channel(self) -> fidl::Channel {
1924 self.client.into_channel()
1925 }
1926
1927 fn as_channel(&self) -> &fidl::Channel {
1928 self.client.as_channel()
1929 }
1930}
1931
1932#[cfg(target_os = "fuchsia")]
1933impl LifecycleControllerSynchronousProxy {
1934 pub fn new(channel: fidl::Channel) -> Self {
1935 let protocol_name =
1936 <LifecycleControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1937 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1938 }
1939
1940 pub fn into_channel(self) -> fidl::Channel {
1941 self.client.into_channel()
1942 }
1943
1944 pub fn wait_for_event(
1947 &self,
1948 deadline: zx::MonotonicInstant,
1949 ) -> Result<LifecycleControllerEvent, fidl::Error> {
1950 LifecycleControllerEvent::decode(self.client.wait_for_event(deadline)?)
1951 }
1952
1953 pub fn r#start_instance(
1964 &self,
1965 mut moniker: &str,
1966 mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
1967 ___deadline: zx::MonotonicInstant,
1968 ) -> Result<LifecycleControllerStartInstanceResult, fidl::Error> {
1969 let _response = self.client.send_query::<
1970 LifecycleControllerStartInstanceRequest,
1971 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
1972 >(
1973 (moniker, binder,),
1974 0x13fcb422876384bf,
1975 fidl::encoding::DynamicFlags::empty(),
1976 ___deadline,
1977 )?;
1978 Ok(_response.map(|x| x))
1979 }
1980
1981 pub fn r#start_instance_with_args(
1982 &self,
1983 mut moniker: &str,
1984 mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
1985 mut args: fidl_fuchsia_component::StartChildArgs,
1986 ___deadline: zx::MonotonicInstant,
1987 ) -> Result<LifecycleControllerStartInstanceWithArgsResult, fidl::Error> {
1988 let _response = self.client.send_query::<
1989 LifecycleControllerStartInstanceWithArgsRequest,
1990 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
1991 >(
1992 (moniker, binder, &mut args,),
1993 0xd3b467436223e9,
1994 fidl::encoding::DynamicFlags::empty(),
1995 ___deadline,
1996 )?;
1997 Ok(_response.map(|x| x))
1998 }
1999
2000 pub fn r#stop_instance(
2005 &self,
2006 mut moniker: &str,
2007 ___deadline: zx::MonotonicInstant,
2008 ) -> Result<LifecycleControllerStopInstanceResult, fidl::Error> {
2009 let _response = self.client.send_query::<
2010 LifecycleControllerStopInstanceRequest,
2011 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StopError>,
2012 >(
2013 (moniker,),
2014 0x1362ba9d0e3caf36,
2015 fidl::encoding::DynamicFlags::empty(),
2016 ___deadline,
2017 )?;
2018 Ok(_response.map(|x| x))
2019 }
2020
2021 pub fn r#resolve_instance(
2026 &self,
2027 mut moniker: &str,
2028 ___deadline: zx::MonotonicInstant,
2029 ) -> Result<LifecycleControllerResolveInstanceResult, fidl::Error> {
2030 let _response = self.client.send_query::<
2031 LifecycleControllerResolveInstanceRequest,
2032 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ResolveError>,
2033 >(
2034 (moniker,),
2035 0x426ab8dd53d8e737,
2036 fidl::encoding::DynamicFlags::empty(),
2037 ___deadline,
2038 )?;
2039 Ok(_response.map(|x| x))
2040 }
2041
2042 pub fn r#unresolve_instance(
2047 &self,
2048 mut moniker: &str,
2049 ___deadline: zx::MonotonicInstant,
2050 ) -> Result<LifecycleControllerUnresolveInstanceResult, fidl::Error> {
2051 let _response = self.client.send_query::<
2052 LifecycleControllerUnresolveInstanceRequest,
2053 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UnresolveError>,
2054 >(
2055 (moniker,),
2056 0x18166a2aa798cb99,
2057 fidl::encoding::DynamicFlags::empty(),
2058 ___deadline,
2059 )?;
2060 Ok(_response.map(|x| x))
2061 }
2062
2063 pub fn r#create_instance(
2068 &self,
2069 mut parent_moniker: &str,
2070 mut collection: &fidl_fuchsia_component_decl::CollectionRef,
2071 mut decl: &fidl_fuchsia_component_decl::Child,
2072 mut args: fidl_fuchsia_component::CreateChildArgs,
2073 ___deadline: zx::MonotonicInstant,
2074 ) -> Result<LifecycleControllerCreateInstanceResult, fidl::Error> {
2075 let _response = self.client.send_query::<
2076 LifecycleControllerCreateInstanceRequest,
2077 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, CreateError>,
2078 >(
2079 (parent_moniker, collection, decl, &mut args,),
2080 0x48d17ae777e4f9,
2081 fidl::encoding::DynamicFlags::empty(),
2082 ___deadline,
2083 )?;
2084 Ok(_response.map(|x| x))
2085 }
2086
2087 pub fn r#destroy_instance(
2092 &self,
2093 mut parent_moniker: &str,
2094 mut child: &fidl_fuchsia_component_decl::ChildRef,
2095 ___deadline: zx::MonotonicInstant,
2096 ) -> Result<LifecycleControllerDestroyInstanceResult, fidl::Error> {
2097 let _response = self.client.send_query::<
2098 LifecycleControllerDestroyInstanceRequest,
2099 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DestroyError>,
2100 >(
2101 (parent_moniker, child,),
2102 0x27640ae5889d7443,
2103 fidl::encoding::DynamicFlags::empty(),
2104 ___deadline,
2105 )?;
2106 Ok(_response.map(|x| x))
2107 }
2108}
2109
2110#[cfg(target_os = "fuchsia")]
2111impl From<LifecycleControllerSynchronousProxy> for zx::Handle {
2112 fn from(value: LifecycleControllerSynchronousProxy) -> Self {
2113 value.into_channel().into()
2114 }
2115}
2116
2117#[cfg(target_os = "fuchsia")]
2118impl From<fidl::Channel> for LifecycleControllerSynchronousProxy {
2119 fn from(value: fidl::Channel) -> Self {
2120 Self::new(value)
2121 }
2122}
2123
2124#[derive(Debug, Clone)]
2125pub struct LifecycleControllerProxy {
2126 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2127}
2128
2129impl fidl::endpoints::Proxy for LifecycleControllerProxy {
2130 type Protocol = LifecycleControllerMarker;
2131
2132 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2133 Self::new(inner)
2134 }
2135
2136 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2137 self.client.into_channel().map_err(|client| Self { client })
2138 }
2139
2140 fn as_channel(&self) -> &::fidl::AsyncChannel {
2141 self.client.as_channel()
2142 }
2143}
2144
2145impl LifecycleControllerProxy {
2146 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2148 let protocol_name =
2149 <LifecycleControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2150 Self { client: fidl::client::Client::new(channel, protocol_name) }
2151 }
2152
2153 pub fn take_event_stream(&self) -> LifecycleControllerEventStream {
2159 LifecycleControllerEventStream { event_receiver: self.client.take_event_receiver() }
2160 }
2161
2162 pub fn r#start_instance(
2173 &self,
2174 mut moniker: &str,
2175 mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
2176 ) -> fidl::client::QueryResponseFut<
2177 LifecycleControllerStartInstanceResult,
2178 fidl::encoding::DefaultFuchsiaResourceDialect,
2179 > {
2180 LifecycleControllerProxyInterface::r#start_instance(self, moniker, binder)
2181 }
2182
2183 pub fn r#start_instance_with_args(
2184 &self,
2185 mut moniker: &str,
2186 mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
2187 mut args: fidl_fuchsia_component::StartChildArgs,
2188 ) -> fidl::client::QueryResponseFut<
2189 LifecycleControllerStartInstanceWithArgsResult,
2190 fidl::encoding::DefaultFuchsiaResourceDialect,
2191 > {
2192 LifecycleControllerProxyInterface::r#start_instance_with_args(self, moniker, binder, args)
2193 }
2194
2195 pub fn r#stop_instance(
2200 &self,
2201 mut moniker: &str,
2202 ) -> fidl::client::QueryResponseFut<
2203 LifecycleControllerStopInstanceResult,
2204 fidl::encoding::DefaultFuchsiaResourceDialect,
2205 > {
2206 LifecycleControllerProxyInterface::r#stop_instance(self, moniker)
2207 }
2208
2209 pub fn r#resolve_instance(
2214 &self,
2215 mut moniker: &str,
2216 ) -> fidl::client::QueryResponseFut<
2217 LifecycleControllerResolveInstanceResult,
2218 fidl::encoding::DefaultFuchsiaResourceDialect,
2219 > {
2220 LifecycleControllerProxyInterface::r#resolve_instance(self, moniker)
2221 }
2222
2223 pub fn r#unresolve_instance(
2228 &self,
2229 mut moniker: &str,
2230 ) -> fidl::client::QueryResponseFut<
2231 LifecycleControllerUnresolveInstanceResult,
2232 fidl::encoding::DefaultFuchsiaResourceDialect,
2233 > {
2234 LifecycleControllerProxyInterface::r#unresolve_instance(self, moniker)
2235 }
2236
2237 pub fn r#create_instance(
2242 &self,
2243 mut parent_moniker: &str,
2244 mut collection: &fidl_fuchsia_component_decl::CollectionRef,
2245 mut decl: &fidl_fuchsia_component_decl::Child,
2246 mut args: fidl_fuchsia_component::CreateChildArgs,
2247 ) -> fidl::client::QueryResponseFut<
2248 LifecycleControllerCreateInstanceResult,
2249 fidl::encoding::DefaultFuchsiaResourceDialect,
2250 > {
2251 LifecycleControllerProxyInterface::r#create_instance(
2252 self,
2253 parent_moniker,
2254 collection,
2255 decl,
2256 args,
2257 )
2258 }
2259
2260 pub fn r#destroy_instance(
2265 &self,
2266 mut parent_moniker: &str,
2267 mut child: &fidl_fuchsia_component_decl::ChildRef,
2268 ) -> fidl::client::QueryResponseFut<
2269 LifecycleControllerDestroyInstanceResult,
2270 fidl::encoding::DefaultFuchsiaResourceDialect,
2271 > {
2272 LifecycleControllerProxyInterface::r#destroy_instance(self, parent_moniker, child)
2273 }
2274}
2275
2276impl LifecycleControllerProxyInterface for LifecycleControllerProxy {
2277 type StartInstanceResponseFut = fidl::client::QueryResponseFut<
2278 LifecycleControllerStartInstanceResult,
2279 fidl::encoding::DefaultFuchsiaResourceDialect,
2280 >;
2281 fn r#start_instance(
2282 &self,
2283 mut moniker: &str,
2284 mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
2285 ) -> Self::StartInstanceResponseFut {
2286 fn _decode(
2287 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2288 ) -> Result<LifecycleControllerStartInstanceResult, fidl::Error> {
2289 let _response = fidl::client::decode_transaction_body::<
2290 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
2291 fidl::encoding::DefaultFuchsiaResourceDialect,
2292 0x13fcb422876384bf,
2293 >(_buf?)?;
2294 Ok(_response.map(|x| x))
2295 }
2296 self.client.send_query_and_decode::<
2297 LifecycleControllerStartInstanceRequest,
2298 LifecycleControllerStartInstanceResult,
2299 >(
2300 (moniker, binder,),
2301 0x13fcb422876384bf,
2302 fidl::encoding::DynamicFlags::empty(),
2303 _decode,
2304 )
2305 }
2306
2307 type StartInstanceWithArgsResponseFut = fidl::client::QueryResponseFut<
2308 LifecycleControllerStartInstanceWithArgsResult,
2309 fidl::encoding::DefaultFuchsiaResourceDialect,
2310 >;
2311 fn r#start_instance_with_args(
2312 &self,
2313 mut moniker: &str,
2314 mut binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
2315 mut args: fidl_fuchsia_component::StartChildArgs,
2316 ) -> Self::StartInstanceWithArgsResponseFut {
2317 fn _decode(
2318 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2319 ) -> Result<LifecycleControllerStartInstanceWithArgsResult, fidl::Error> {
2320 let _response = fidl::client::decode_transaction_body::<
2321 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
2322 fidl::encoding::DefaultFuchsiaResourceDialect,
2323 0xd3b467436223e9,
2324 >(_buf?)?;
2325 Ok(_response.map(|x| x))
2326 }
2327 self.client.send_query_and_decode::<
2328 LifecycleControllerStartInstanceWithArgsRequest,
2329 LifecycleControllerStartInstanceWithArgsResult,
2330 >(
2331 (moniker, binder, &mut args,),
2332 0xd3b467436223e9,
2333 fidl::encoding::DynamicFlags::empty(),
2334 _decode,
2335 )
2336 }
2337
2338 type StopInstanceResponseFut = fidl::client::QueryResponseFut<
2339 LifecycleControllerStopInstanceResult,
2340 fidl::encoding::DefaultFuchsiaResourceDialect,
2341 >;
2342 fn r#stop_instance(&self, mut moniker: &str) -> Self::StopInstanceResponseFut {
2343 fn _decode(
2344 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2345 ) -> Result<LifecycleControllerStopInstanceResult, fidl::Error> {
2346 let _response = fidl::client::decode_transaction_body::<
2347 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StopError>,
2348 fidl::encoding::DefaultFuchsiaResourceDialect,
2349 0x1362ba9d0e3caf36,
2350 >(_buf?)?;
2351 Ok(_response.map(|x| x))
2352 }
2353 self.client.send_query_and_decode::<
2354 LifecycleControllerStopInstanceRequest,
2355 LifecycleControllerStopInstanceResult,
2356 >(
2357 (moniker,),
2358 0x1362ba9d0e3caf36,
2359 fidl::encoding::DynamicFlags::empty(),
2360 _decode,
2361 )
2362 }
2363
2364 type ResolveInstanceResponseFut = fidl::client::QueryResponseFut<
2365 LifecycleControllerResolveInstanceResult,
2366 fidl::encoding::DefaultFuchsiaResourceDialect,
2367 >;
2368 fn r#resolve_instance(&self, mut moniker: &str) -> Self::ResolveInstanceResponseFut {
2369 fn _decode(
2370 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2371 ) -> Result<LifecycleControllerResolveInstanceResult, fidl::Error> {
2372 let _response = fidl::client::decode_transaction_body::<
2373 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ResolveError>,
2374 fidl::encoding::DefaultFuchsiaResourceDialect,
2375 0x426ab8dd53d8e737,
2376 >(_buf?)?;
2377 Ok(_response.map(|x| x))
2378 }
2379 self.client.send_query_and_decode::<
2380 LifecycleControllerResolveInstanceRequest,
2381 LifecycleControllerResolveInstanceResult,
2382 >(
2383 (moniker,),
2384 0x426ab8dd53d8e737,
2385 fidl::encoding::DynamicFlags::empty(),
2386 _decode,
2387 )
2388 }
2389
2390 type UnresolveInstanceResponseFut = fidl::client::QueryResponseFut<
2391 LifecycleControllerUnresolveInstanceResult,
2392 fidl::encoding::DefaultFuchsiaResourceDialect,
2393 >;
2394 fn r#unresolve_instance(&self, mut moniker: &str) -> Self::UnresolveInstanceResponseFut {
2395 fn _decode(
2396 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2397 ) -> Result<LifecycleControllerUnresolveInstanceResult, fidl::Error> {
2398 let _response = fidl::client::decode_transaction_body::<
2399 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UnresolveError>,
2400 fidl::encoding::DefaultFuchsiaResourceDialect,
2401 0x18166a2aa798cb99,
2402 >(_buf?)?;
2403 Ok(_response.map(|x| x))
2404 }
2405 self.client.send_query_and_decode::<
2406 LifecycleControllerUnresolveInstanceRequest,
2407 LifecycleControllerUnresolveInstanceResult,
2408 >(
2409 (moniker,),
2410 0x18166a2aa798cb99,
2411 fidl::encoding::DynamicFlags::empty(),
2412 _decode,
2413 )
2414 }
2415
2416 type CreateInstanceResponseFut = fidl::client::QueryResponseFut<
2417 LifecycleControllerCreateInstanceResult,
2418 fidl::encoding::DefaultFuchsiaResourceDialect,
2419 >;
2420 fn r#create_instance(
2421 &self,
2422 mut parent_moniker: &str,
2423 mut collection: &fidl_fuchsia_component_decl::CollectionRef,
2424 mut decl: &fidl_fuchsia_component_decl::Child,
2425 mut args: fidl_fuchsia_component::CreateChildArgs,
2426 ) -> Self::CreateInstanceResponseFut {
2427 fn _decode(
2428 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2429 ) -> Result<LifecycleControllerCreateInstanceResult, fidl::Error> {
2430 let _response = fidl::client::decode_transaction_body::<
2431 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, CreateError>,
2432 fidl::encoding::DefaultFuchsiaResourceDialect,
2433 0x48d17ae777e4f9,
2434 >(_buf?)?;
2435 Ok(_response.map(|x| x))
2436 }
2437 self.client.send_query_and_decode::<
2438 LifecycleControllerCreateInstanceRequest,
2439 LifecycleControllerCreateInstanceResult,
2440 >(
2441 (parent_moniker, collection, decl, &mut args,),
2442 0x48d17ae777e4f9,
2443 fidl::encoding::DynamicFlags::empty(),
2444 _decode,
2445 )
2446 }
2447
2448 type DestroyInstanceResponseFut = fidl::client::QueryResponseFut<
2449 LifecycleControllerDestroyInstanceResult,
2450 fidl::encoding::DefaultFuchsiaResourceDialect,
2451 >;
2452 fn r#destroy_instance(
2453 &self,
2454 mut parent_moniker: &str,
2455 mut child: &fidl_fuchsia_component_decl::ChildRef,
2456 ) -> Self::DestroyInstanceResponseFut {
2457 fn _decode(
2458 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2459 ) -> Result<LifecycleControllerDestroyInstanceResult, fidl::Error> {
2460 let _response = fidl::client::decode_transaction_body::<
2461 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DestroyError>,
2462 fidl::encoding::DefaultFuchsiaResourceDialect,
2463 0x27640ae5889d7443,
2464 >(_buf?)?;
2465 Ok(_response.map(|x| x))
2466 }
2467 self.client.send_query_and_decode::<
2468 LifecycleControllerDestroyInstanceRequest,
2469 LifecycleControllerDestroyInstanceResult,
2470 >(
2471 (parent_moniker, child,),
2472 0x27640ae5889d7443,
2473 fidl::encoding::DynamicFlags::empty(),
2474 _decode,
2475 )
2476 }
2477}
2478
2479pub struct LifecycleControllerEventStream {
2480 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2481}
2482
2483impl std::marker::Unpin for LifecycleControllerEventStream {}
2484
2485impl futures::stream::FusedStream for LifecycleControllerEventStream {
2486 fn is_terminated(&self) -> bool {
2487 self.event_receiver.is_terminated()
2488 }
2489}
2490
2491impl futures::Stream for LifecycleControllerEventStream {
2492 type Item = Result<LifecycleControllerEvent, fidl::Error>;
2493
2494 fn poll_next(
2495 mut self: std::pin::Pin<&mut Self>,
2496 cx: &mut std::task::Context<'_>,
2497 ) -> std::task::Poll<Option<Self::Item>> {
2498 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2499 &mut self.event_receiver,
2500 cx
2501 )?) {
2502 Some(buf) => std::task::Poll::Ready(Some(LifecycleControllerEvent::decode(buf))),
2503 None => std::task::Poll::Ready(None),
2504 }
2505 }
2506}
2507
2508#[derive(Debug)]
2509pub enum LifecycleControllerEvent {}
2510
2511impl LifecycleControllerEvent {
2512 fn decode(
2514 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2515 ) -> Result<LifecycleControllerEvent, fidl::Error> {
2516 let (bytes, _handles) = buf.split_mut();
2517 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2518 debug_assert_eq!(tx_header.tx_id, 0);
2519 match tx_header.ordinal {
2520 _ => Err(fidl::Error::UnknownOrdinal {
2521 ordinal: tx_header.ordinal,
2522 protocol_name:
2523 <LifecycleControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2524 }),
2525 }
2526 }
2527}
2528
2529pub struct LifecycleControllerRequestStream {
2531 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2532 is_terminated: bool,
2533}
2534
2535impl std::marker::Unpin for LifecycleControllerRequestStream {}
2536
2537impl futures::stream::FusedStream for LifecycleControllerRequestStream {
2538 fn is_terminated(&self) -> bool {
2539 self.is_terminated
2540 }
2541}
2542
2543impl fidl::endpoints::RequestStream for LifecycleControllerRequestStream {
2544 type Protocol = LifecycleControllerMarker;
2545 type ControlHandle = LifecycleControllerControlHandle;
2546
2547 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2548 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2549 }
2550
2551 fn control_handle(&self) -> Self::ControlHandle {
2552 LifecycleControllerControlHandle { inner: self.inner.clone() }
2553 }
2554
2555 fn into_inner(
2556 self,
2557 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2558 {
2559 (self.inner, self.is_terminated)
2560 }
2561
2562 fn from_inner(
2563 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2564 is_terminated: bool,
2565 ) -> Self {
2566 Self { inner, is_terminated }
2567 }
2568}
2569
2570impl futures::Stream for LifecycleControllerRequestStream {
2571 type Item = Result<LifecycleControllerRequest, fidl::Error>;
2572
2573 fn poll_next(
2574 mut self: std::pin::Pin<&mut Self>,
2575 cx: &mut std::task::Context<'_>,
2576 ) -> std::task::Poll<Option<Self::Item>> {
2577 let this = &mut *self;
2578 if this.inner.check_shutdown(cx) {
2579 this.is_terminated = true;
2580 return std::task::Poll::Ready(None);
2581 }
2582 if this.is_terminated {
2583 panic!("polled LifecycleControllerRequestStream after completion");
2584 }
2585 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2586 |bytes, handles| {
2587 match this.inner.channel().read_etc(cx, bytes, handles) {
2588 std::task::Poll::Ready(Ok(())) => {}
2589 std::task::Poll::Pending => return std::task::Poll::Pending,
2590 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2591 this.is_terminated = true;
2592 return std::task::Poll::Ready(None);
2593 }
2594 std::task::Poll::Ready(Err(e)) => {
2595 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2596 e.into(),
2597 ))))
2598 }
2599 }
2600
2601 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2603
2604 std::task::Poll::Ready(Some(match header.ordinal {
2605 0x13fcb422876384bf => {
2606 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2607 let mut req = fidl::new_empty!(LifecycleControllerStartInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2608 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LifecycleControllerStartInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2609 let control_handle = LifecycleControllerControlHandle {
2610 inner: this.inner.clone(),
2611 };
2612 Ok(LifecycleControllerRequest::StartInstance {moniker: req.moniker,
2613binder: req.binder,
2614
2615 responder: LifecycleControllerStartInstanceResponder {
2616 control_handle: std::mem::ManuallyDrop::new(control_handle),
2617 tx_id: header.tx_id,
2618 },
2619 })
2620 }
2621 0xd3b467436223e9 => {
2622 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2623 let mut req = fidl::new_empty!(LifecycleControllerStartInstanceWithArgsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2624 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LifecycleControllerStartInstanceWithArgsRequest>(&header, _body_bytes, handles, &mut req)?;
2625 let control_handle = LifecycleControllerControlHandle {
2626 inner: this.inner.clone(),
2627 };
2628 Ok(LifecycleControllerRequest::StartInstanceWithArgs {moniker: req.moniker,
2629binder: req.binder,
2630args: req.args,
2631
2632 responder: LifecycleControllerStartInstanceWithArgsResponder {
2633 control_handle: std::mem::ManuallyDrop::new(control_handle),
2634 tx_id: header.tx_id,
2635 },
2636 })
2637 }
2638 0x1362ba9d0e3caf36 => {
2639 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2640 let mut req = fidl::new_empty!(LifecycleControllerStopInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2641 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LifecycleControllerStopInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2642 let control_handle = LifecycleControllerControlHandle {
2643 inner: this.inner.clone(),
2644 };
2645 Ok(LifecycleControllerRequest::StopInstance {moniker: req.moniker,
2646
2647 responder: LifecycleControllerStopInstanceResponder {
2648 control_handle: std::mem::ManuallyDrop::new(control_handle),
2649 tx_id: header.tx_id,
2650 },
2651 })
2652 }
2653 0x426ab8dd53d8e737 => {
2654 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2655 let mut req = fidl::new_empty!(LifecycleControllerResolveInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2656 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LifecycleControllerResolveInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2657 let control_handle = LifecycleControllerControlHandle {
2658 inner: this.inner.clone(),
2659 };
2660 Ok(LifecycleControllerRequest::ResolveInstance {moniker: req.moniker,
2661
2662 responder: LifecycleControllerResolveInstanceResponder {
2663 control_handle: std::mem::ManuallyDrop::new(control_handle),
2664 tx_id: header.tx_id,
2665 },
2666 })
2667 }
2668 0x18166a2aa798cb99 => {
2669 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2670 let mut req = fidl::new_empty!(LifecycleControllerUnresolveInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2671 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LifecycleControllerUnresolveInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2672 let control_handle = LifecycleControllerControlHandle {
2673 inner: this.inner.clone(),
2674 };
2675 Ok(LifecycleControllerRequest::UnresolveInstance {moniker: req.moniker,
2676
2677 responder: LifecycleControllerUnresolveInstanceResponder {
2678 control_handle: std::mem::ManuallyDrop::new(control_handle),
2679 tx_id: header.tx_id,
2680 },
2681 })
2682 }
2683 0x48d17ae777e4f9 => {
2684 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2685 let mut req = fidl::new_empty!(LifecycleControllerCreateInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2686 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LifecycleControllerCreateInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2687 let control_handle = LifecycleControllerControlHandle {
2688 inner: this.inner.clone(),
2689 };
2690 Ok(LifecycleControllerRequest::CreateInstance {parent_moniker: req.parent_moniker,
2691collection: req.collection,
2692decl: req.decl,
2693args: req.args,
2694
2695 responder: LifecycleControllerCreateInstanceResponder {
2696 control_handle: std::mem::ManuallyDrop::new(control_handle),
2697 tx_id: header.tx_id,
2698 },
2699 })
2700 }
2701 0x27640ae5889d7443 => {
2702 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2703 let mut req = fidl::new_empty!(LifecycleControllerDestroyInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2704 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LifecycleControllerDestroyInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2705 let control_handle = LifecycleControllerControlHandle {
2706 inner: this.inner.clone(),
2707 };
2708 Ok(LifecycleControllerRequest::DestroyInstance {parent_moniker: req.parent_moniker,
2709child: req.child,
2710
2711 responder: LifecycleControllerDestroyInstanceResponder {
2712 control_handle: std::mem::ManuallyDrop::new(control_handle),
2713 tx_id: header.tx_id,
2714 },
2715 })
2716 }
2717 _ => Err(fidl::Error::UnknownOrdinal {
2718 ordinal: header.ordinal,
2719 protocol_name: <LifecycleControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2720 }),
2721 }))
2722 },
2723 )
2724 }
2725}
2726
2727#[derive(Debug)]
2729pub enum LifecycleControllerRequest {
2730 StartInstance {
2741 moniker: String,
2742 binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
2743 responder: LifecycleControllerStartInstanceResponder,
2744 },
2745 StartInstanceWithArgs {
2746 moniker: String,
2747 binder: fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
2748 args: fidl_fuchsia_component::StartChildArgs,
2749 responder: LifecycleControllerStartInstanceWithArgsResponder,
2750 },
2751 StopInstance { moniker: String, responder: LifecycleControllerStopInstanceResponder },
2756 ResolveInstance { moniker: String, responder: LifecycleControllerResolveInstanceResponder },
2761 UnresolveInstance { moniker: String, responder: LifecycleControllerUnresolveInstanceResponder },
2766 CreateInstance {
2771 parent_moniker: String,
2772 collection: fidl_fuchsia_component_decl::CollectionRef,
2773 decl: fidl_fuchsia_component_decl::Child,
2774 args: fidl_fuchsia_component::CreateChildArgs,
2775 responder: LifecycleControllerCreateInstanceResponder,
2776 },
2777 DestroyInstance {
2782 parent_moniker: String,
2783 child: fidl_fuchsia_component_decl::ChildRef,
2784 responder: LifecycleControllerDestroyInstanceResponder,
2785 },
2786}
2787
2788impl LifecycleControllerRequest {
2789 #[allow(irrefutable_let_patterns)]
2790 pub fn into_start_instance(
2791 self,
2792 ) -> Option<(
2793 String,
2794 fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
2795 LifecycleControllerStartInstanceResponder,
2796 )> {
2797 if let LifecycleControllerRequest::StartInstance { moniker, binder, responder } = self {
2798 Some((moniker, binder, responder))
2799 } else {
2800 None
2801 }
2802 }
2803
2804 #[allow(irrefutable_let_patterns)]
2805 pub fn into_start_instance_with_args(
2806 self,
2807 ) -> Option<(
2808 String,
2809 fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
2810 fidl_fuchsia_component::StartChildArgs,
2811 LifecycleControllerStartInstanceWithArgsResponder,
2812 )> {
2813 if let LifecycleControllerRequest::StartInstanceWithArgs {
2814 moniker,
2815 binder,
2816 args,
2817 responder,
2818 } = self
2819 {
2820 Some((moniker, binder, args, responder))
2821 } else {
2822 None
2823 }
2824 }
2825
2826 #[allow(irrefutable_let_patterns)]
2827 pub fn into_stop_instance(self) -> Option<(String, LifecycleControllerStopInstanceResponder)> {
2828 if let LifecycleControllerRequest::StopInstance { moniker, responder } = self {
2829 Some((moniker, responder))
2830 } else {
2831 None
2832 }
2833 }
2834
2835 #[allow(irrefutable_let_patterns)]
2836 pub fn into_resolve_instance(
2837 self,
2838 ) -> Option<(String, LifecycleControllerResolveInstanceResponder)> {
2839 if let LifecycleControllerRequest::ResolveInstance { moniker, responder } = self {
2840 Some((moniker, responder))
2841 } else {
2842 None
2843 }
2844 }
2845
2846 #[allow(irrefutable_let_patterns)]
2847 pub fn into_unresolve_instance(
2848 self,
2849 ) -> Option<(String, LifecycleControllerUnresolveInstanceResponder)> {
2850 if let LifecycleControllerRequest::UnresolveInstance { moniker, responder } = self {
2851 Some((moniker, responder))
2852 } else {
2853 None
2854 }
2855 }
2856
2857 #[allow(irrefutable_let_patterns)]
2858 pub fn into_create_instance(
2859 self,
2860 ) -> Option<(
2861 String,
2862 fidl_fuchsia_component_decl::CollectionRef,
2863 fidl_fuchsia_component_decl::Child,
2864 fidl_fuchsia_component::CreateChildArgs,
2865 LifecycleControllerCreateInstanceResponder,
2866 )> {
2867 if let LifecycleControllerRequest::CreateInstance {
2868 parent_moniker,
2869 collection,
2870 decl,
2871 args,
2872 responder,
2873 } = self
2874 {
2875 Some((parent_moniker, collection, decl, args, responder))
2876 } else {
2877 None
2878 }
2879 }
2880
2881 #[allow(irrefutable_let_patterns)]
2882 pub fn into_destroy_instance(
2883 self,
2884 ) -> Option<(
2885 String,
2886 fidl_fuchsia_component_decl::ChildRef,
2887 LifecycleControllerDestroyInstanceResponder,
2888 )> {
2889 if let LifecycleControllerRequest::DestroyInstance { parent_moniker, child, responder } =
2890 self
2891 {
2892 Some((parent_moniker, child, responder))
2893 } else {
2894 None
2895 }
2896 }
2897
2898 pub fn method_name(&self) -> &'static str {
2900 match *self {
2901 LifecycleControllerRequest::StartInstance { .. } => "start_instance",
2902 LifecycleControllerRequest::StartInstanceWithArgs { .. } => "start_instance_with_args",
2903 LifecycleControllerRequest::StopInstance { .. } => "stop_instance",
2904 LifecycleControllerRequest::ResolveInstance { .. } => "resolve_instance",
2905 LifecycleControllerRequest::UnresolveInstance { .. } => "unresolve_instance",
2906 LifecycleControllerRequest::CreateInstance { .. } => "create_instance",
2907 LifecycleControllerRequest::DestroyInstance { .. } => "destroy_instance",
2908 }
2909 }
2910}
2911
2912#[derive(Debug, Clone)]
2913pub struct LifecycleControllerControlHandle {
2914 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2915}
2916
2917impl fidl::endpoints::ControlHandle for LifecycleControllerControlHandle {
2918 fn shutdown(&self) {
2919 self.inner.shutdown()
2920 }
2921 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2922 self.inner.shutdown_with_epitaph(status)
2923 }
2924
2925 fn is_closed(&self) -> bool {
2926 self.inner.channel().is_closed()
2927 }
2928 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2929 self.inner.channel().on_closed()
2930 }
2931
2932 #[cfg(target_os = "fuchsia")]
2933 fn signal_peer(
2934 &self,
2935 clear_mask: zx::Signals,
2936 set_mask: zx::Signals,
2937 ) -> Result<(), zx_status::Status> {
2938 use fidl::Peered;
2939 self.inner.channel().signal_peer(clear_mask, set_mask)
2940 }
2941}
2942
2943impl LifecycleControllerControlHandle {}
2944
2945#[must_use = "FIDL methods require a response to be sent"]
2946#[derive(Debug)]
2947pub struct LifecycleControllerStartInstanceResponder {
2948 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
2949 tx_id: u32,
2950}
2951
2952impl std::ops::Drop for LifecycleControllerStartInstanceResponder {
2956 fn drop(&mut self) {
2957 self.control_handle.shutdown();
2958 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2960 }
2961}
2962
2963impl fidl::endpoints::Responder for LifecycleControllerStartInstanceResponder {
2964 type ControlHandle = LifecycleControllerControlHandle;
2965
2966 fn control_handle(&self) -> &LifecycleControllerControlHandle {
2967 &self.control_handle
2968 }
2969
2970 fn drop_without_shutdown(mut self) {
2971 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2973 std::mem::forget(self);
2975 }
2976}
2977
2978impl LifecycleControllerStartInstanceResponder {
2979 pub fn send(self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
2983 let _result = self.send_raw(result);
2984 if _result.is_err() {
2985 self.control_handle.shutdown();
2986 }
2987 self.drop_without_shutdown();
2988 _result
2989 }
2990
2991 pub fn send_no_shutdown_on_err(
2993 self,
2994 mut result: Result<(), StartError>,
2995 ) -> Result<(), fidl::Error> {
2996 let _result = self.send_raw(result);
2997 self.drop_without_shutdown();
2998 _result
2999 }
3000
3001 fn send_raw(&self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
3002 self.control_handle
3003 .inner
3004 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>>(
3005 result,
3006 self.tx_id,
3007 0x13fcb422876384bf,
3008 fidl::encoding::DynamicFlags::empty(),
3009 )
3010 }
3011}
3012
3013#[must_use = "FIDL methods require a response to be sent"]
3014#[derive(Debug)]
3015pub struct LifecycleControllerStartInstanceWithArgsResponder {
3016 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3017 tx_id: u32,
3018}
3019
3020impl std::ops::Drop for LifecycleControllerStartInstanceWithArgsResponder {
3024 fn drop(&mut self) {
3025 self.control_handle.shutdown();
3026 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3028 }
3029}
3030
3031impl fidl::endpoints::Responder for LifecycleControllerStartInstanceWithArgsResponder {
3032 type ControlHandle = LifecycleControllerControlHandle;
3033
3034 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3035 &self.control_handle
3036 }
3037
3038 fn drop_without_shutdown(mut self) {
3039 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3041 std::mem::forget(self);
3043 }
3044}
3045
3046impl LifecycleControllerStartInstanceWithArgsResponder {
3047 pub fn send(self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
3051 let _result = self.send_raw(result);
3052 if _result.is_err() {
3053 self.control_handle.shutdown();
3054 }
3055 self.drop_without_shutdown();
3056 _result
3057 }
3058
3059 pub fn send_no_shutdown_on_err(
3061 self,
3062 mut result: Result<(), StartError>,
3063 ) -> Result<(), fidl::Error> {
3064 let _result = self.send_raw(result);
3065 self.drop_without_shutdown();
3066 _result
3067 }
3068
3069 fn send_raw(&self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
3070 self.control_handle
3071 .inner
3072 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>>(
3073 result,
3074 self.tx_id,
3075 0xd3b467436223e9,
3076 fidl::encoding::DynamicFlags::empty(),
3077 )
3078 }
3079}
3080
3081#[must_use = "FIDL methods require a response to be sent"]
3082#[derive(Debug)]
3083pub struct LifecycleControllerStopInstanceResponder {
3084 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3085 tx_id: u32,
3086}
3087
3088impl std::ops::Drop for LifecycleControllerStopInstanceResponder {
3092 fn drop(&mut self) {
3093 self.control_handle.shutdown();
3094 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3096 }
3097}
3098
3099impl fidl::endpoints::Responder for LifecycleControllerStopInstanceResponder {
3100 type ControlHandle = LifecycleControllerControlHandle;
3101
3102 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3103 &self.control_handle
3104 }
3105
3106 fn drop_without_shutdown(mut self) {
3107 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3109 std::mem::forget(self);
3111 }
3112}
3113
3114impl LifecycleControllerStopInstanceResponder {
3115 pub fn send(self, mut result: Result<(), StopError>) -> Result<(), fidl::Error> {
3119 let _result = self.send_raw(result);
3120 if _result.is_err() {
3121 self.control_handle.shutdown();
3122 }
3123 self.drop_without_shutdown();
3124 _result
3125 }
3126
3127 pub fn send_no_shutdown_on_err(
3129 self,
3130 mut result: Result<(), StopError>,
3131 ) -> Result<(), fidl::Error> {
3132 let _result = self.send_raw(result);
3133 self.drop_without_shutdown();
3134 _result
3135 }
3136
3137 fn send_raw(&self, mut result: Result<(), StopError>) -> Result<(), fidl::Error> {
3138 self.control_handle
3139 .inner
3140 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StopError>>(
3141 result,
3142 self.tx_id,
3143 0x1362ba9d0e3caf36,
3144 fidl::encoding::DynamicFlags::empty(),
3145 )
3146 }
3147}
3148
3149#[must_use = "FIDL methods require a response to be sent"]
3150#[derive(Debug)]
3151pub struct LifecycleControllerResolveInstanceResponder {
3152 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3153 tx_id: u32,
3154}
3155
3156impl std::ops::Drop for LifecycleControllerResolveInstanceResponder {
3160 fn drop(&mut self) {
3161 self.control_handle.shutdown();
3162 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3164 }
3165}
3166
3167impl fidl::endpoints::Responder for LifecycleControllerResolveInstanceResponder {
3168 type ControlHandle = LifecycleControllerControlHandle;
3169
3170 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3171 &self.control_handle
3172 }
3173
3174 fn drop_without_shutdown(mut self) {
3175 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3177 std::mem::forget(self);
3179 }
3180}
3181
3182impl LifecycleControllerResolveInstanceResponder {
3183 pub fn send(self, mut result: Result<(), ResolveError>) -> Result<(), fidl::Error> {
3187 let _result = self.send_raw(result);
3188 if _result.is_err() {
3189 self.control_handle.shutdown();
3190 }
3191 self.drop_without_shutdown();
3192 _result
3193 }
3194
3195 pub fn send_no_shutdown_on_err(
3197 self,
3198 mut result: Result<(), ResolveError>,
3199 ) -> Result<(), fidl::Error> {
3200 let _result = self.send_raw(result);
3201 self.drop_without_shutdown();
3202 _result
3203 }
3204
3205 fn send_raw(&self, mut result: Result<(), ResolveError>) -> Result<(), fidl::Error> {
3206 self.control_handle.inner.send::<fidl::encoding::ResultType<
3207 fidl::encoding::EmptyStruct,
3208 ResolveError,
3209 >>(
3210 result,
3211 self.tx_id,
3212 0x426ab8dd53d8e737,
3213 fidl::encoding::DynamicFlags::empty(),
3214 )
3215 }
3216}
3217
3218#[must_use = "FIDL methods require a response to be sent"]
3219#[derive(Debug)]
3220pub struct LifecycleControllerUnresolveInstanceResponder {
3221 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3222 tx_id: u32,
3223}
3224
3225impl std::ops::Drop for LifecycleControllerUnresolveInstanceResponder {
3229 fn drop(&mut self) {
3230 self.control_handle.shutdown();
3231 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3233 }
3234}
3235
3236impl fidl::endpoints::Responder for LifecycleControllerUnresolveInstanceResponder {
3237 type ControlHandle = LifecycleControllerControlHandle;
3238
3239 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3240 &self.control_handle
3241 }
3242
3243 fn drop_without_shutdown(mut self) {
3244 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3246 std::mem::forget(self);
3248 }
3249}
3250
3251impl LifecycleControllerUnresolveInstanceResponder {
3252 pub fn send(self, mut result: Result<(), UnresolveError>) -> Result<(), fidl::Error> {
3256 let _result = self.send_raw(result);
3257 if _result.is_err() {
3258 self.control_handle.shutdown();
3259 }
3260 self.drop_without_shutdown();
3261 _result
3262 }
3263
3264 pub fn send_no_shutdown_on_err(
3266 self,
3267 mut result: Result<(), UnresolveError>,
3268 ) -> Result<(), fidl::Error> {
3269 let _result = self.send_raw(result);
3270 self.drop_without_shutdown();
3271 _result
3272 }
3273
3274 fn send_raw(&self, mut result: Result<(), UnresolveError>) -> Result<(), fidl::Error> {
3275 self.control_handle.inner.send::<fidl::encoding::ResultType<
3276 fidl::encoding::EmptyStruct,
3277 UnresolveError,
3278 >>(
3279 result,
3280 self.tx_id,
3281 0x18166a2aa798cb99,
3282 fidl::encoding::DynamicFlags::empty(),
3283 )
3284 }
3285}
3286
3287#[must_use = "FIDL methods require a response to be sent"]
3288#[derive(Debug)]
3289pub struct LifecycleControllerCreateInstanceResponder {
3290 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3291 tx_id: u32,
3292}
3293
3294impl std::ops::Drop for LifecycleControllerCreateInstanceResponder {
3298 fn drop(&mut self) {
3299 self.control_handle.shutdown();
3300 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3302 }
3303}
3304
3305impl fidl::endpoints::Responder for LifecycleControllerCreateInstanceResponder {
3306 type ControlHandle = LifecycleControllerControlHandle;
3307
3308 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3309 &self.control_handle
3310 }
3311
3312 fn drop_without_shutdown(mut self) {
3313 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3315 std::mem::forget(self);
3317 }
3318}
3319
3320impl LifecycleControllerCreateInstanceResponder {
3321 pub fn send(self, mut result: Result<(), CreateError>) -> Result<(), fidl::Error> {
3325 let _result = self.send_raw(result);
3326 if _result.is_err() {
3327 self.control_handle.shutdown();
3328 }
3329 self.drop_without_shutdown();
3330 _result
3331 }
3332
3333 pub fn send_no_shutdown_on_err(
3335 self,
3336 mut result: Result<(), CreateError>,
3337 ) -> Result<(), fidl::Error> {
3338 let _result = self.send_raw(result);
3339 self.drop_without_shutdown();
3340 _result
3341 }
3342
3343 fn send_raw(&self, mut result: Result<(), CreateError>) -> Result<(), fidl::Error> {
3344 self.control_handle.inner.send::<fidl::encoding::ResultType<
3345 fidl::encoding::EmptyStruct,
3346 CreateError,
3347 >>(
3348 result,
3349 self.tx_id,
3350 0x48d17ae777e4f9,
3351 fidl::encoding::DynamicFlags::empty(),
3352 )
3353 }
3354}
3355
3356#[must_use = "FIDL methods require a response to be sent"]
3357#[derive(Debug)]
3358pub struct LifecycleControllerDestroyInstanceResponder {
3359 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3360 tx_id: u32,
3361}
3362
3363impl std::ops::Drop for LifecycleControllerDestroyInstanceResponder {
3367 fn drop(&mut self) {
3368 self.control_handle.shutdown();
3369 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3371 }
3372}
3373
3374impl fidl::endpoints::Responder for LifecycleControllerDestroyInstanceResponder {
3375 type ControlHandle = LifecycleControllerControlHandle;
3376
3377 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3378 &self.control_handle
3379 }
3380
3381 fn drop_without_shutdown(mut self) {
3382 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3384 std::mem::forget(self);
3386 }
3387}
3388
3389impl LifecycleControllerDestroyInstanceResponder {
3390 pub fn send(self, mut result: Result<(), DestroyError>) -> Result<(), fidl::Error> {
3394 let _result = self.send_raw(result);
3395 if _result.is_err() {
3396 self.control_handle.shutdown();
3397 }
3398 self.drop_without_shutdown();
3399 _result
3400 }
3401
3402 pub fn send_no_shutdown_on_err(
3404 self,
3405 mut result: Result<(), DestroyError>,
3406 ) -> Result<(), fidl::Error> {
3407 let _result = self.send_raw(result);
3408 self.drop_without_shutdown();
3409 _result
3410 }
3411
3412 fn send_raw(&self, mut result: Result<(), DestroyError>) -> Result<(), fidl::Error> {
3413 self.control_handle.inner.send::<fidl::encoding::ResultType<
3414 fidl::encoding::EmptyStruct,
3415 DestroyError,
3416 >>(
3417 result,
3418 self.tx_id,
3419 0x27640ae5889d7443,
3420 fidl::encoding::DynamicFlags::empty(),
3421 )
3422 }
3423}
3424
3425#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3426pub struct ManifestBytesIteratorMarker;
3427
3428impl fidl::endpoints::ProtocolMarker for ManifestBytesIteratorMarker {
3429 type Proxy = ManifestBytesIteratorProxy;
3430 type RequestStream = ManifestBytesIteratorRequestStream;
3431 #[cfg(target_os = "fuchsia")]
3432 type SynchronousProxy = ManifestBytesIteratorSynchronousProxy;
3433
3434 const DEBUG_NAME: &'static str = "(anonymous) ManifestBytesIterator";
3435}
3436
3437pub trait ManifestBytesIteratorProxyInterface: Send + Sync {
3438 type NextResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
3439 fn r#next(&self) -> Self::NextResponseFut;
3440}
3441#[derive(Debug)]
3442#[cfg(target_os = "fuchsia")]
3443pub struct ManifestBytesIteratorSynchronousProxy {
3444 client: fidl::client::sync::Client,
3445}
3446
3447#[cfg(target_os = "fuchsia")]
3448impl fidl::endpoints::SynchronousProxy for ManifestBytesIteratorSynchronousProxy {
3449 type Proxy = ManifestBytesIteratorProxy;
3450 type Protocol = ManifestBytesIteratorMarker;
3451
3452 fn from_channel(inner: fidl::Channel) -> Self {
3453 Self::new(inner)
3454 }
3455
3456 fn into_channel(self) -> fidl::Channel {
3457 self.client.into_channel()
3458 }
3459
3460 fn as_channel(&self) -> &fidl::Channel {
3461 self.client.as_channel()
3462 }
3463}
3464
3465#[cfg(target_os = "fuchsia")]
3466impl ManifestBytesIteratorSynchronousProxy {
3467 pub fn new(channel: fidl::Channel) -> Self {
3468 let protocol_name =
3469 <ManifestBytesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3470 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3471 }
3472
3473 pub fn into_channel(self) -> fidl::Channel {
3474 self.client.into_channel()
3475 }
3476
3477 pub fn wait_for_event(
3480 &self,
3481 deadline: zx::MonotonicInstant,
3482 ) -> Result<ManifestBytesIteratorEvent, fidl::Error> {
3483 ManifestBytesIteratorEvent::decode(self.client.wait_for_event(deadline)?)
3484 }
3485
3486 pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u8>, fidl::Error> {
3487 let _response = self
3488 .client
3489 .send_query::<fidl::encoding::EmptyPayload, ManifestBytesIteratorNextResponse>(
3490 (),
3491 0x4be4659549b15500,
3492 fidl::encoding::DynamicFlags::empty(),
3493 ___deadline,
3494 )?;
3495 Ok(_response.infos)
3496 }
3497}
3498
3499#[cfg(target_os = "fuchsia")]
3500impl From<ManifestBytesIteratorSynchronousProxy> for zx::Handle {
3501 fn from(value: ManifestBytesIteratorSynchronousProxy) -> Self {
3502 value.into_channel().into()
3503 }
3504}
3505
3506#[cfg(target_os = "fuchsia")]
3507impl From<fidl::Channel> for ManifestBytesIteratorSynchronousProxy {
3508 fn from(value: fidl::Channel) -> Self {
3509 Self::new(value)
3510 }
3511}
3512
3513#[derive(Debug, Clone)]
3514pub struct ManifestBytesIteratorProxy {
3515 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3516}
3517
3518impl fidl::endpoints::Proxy for ManifestBytesIteratorProxy {
3519 type Protocol = ManifestBytesIteratorMarker;
3520
3521 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3522 Self::new(inner)
3523 }
3524
3525 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3526 self.client.into_channel().map_err(|client| Self { client })
3527 }
3528
3529 fn as_channel(&self) -> &::fidl::AsyncChannel {
3530 self.client.as_channel()
3531 }
3532}
3533
3534impl ManifestBytesIteratorProxy {
3535 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3537 let protocol_name =
3538 <ManifestBytesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3539 Self { client: fidl::client::Client::new(channel, protocol_name) }
3540 }
3541
3542 pub fn take_event_stream(&self) -> ManifestBytesIteratorEventStream {
3548 ManifestBytesIteratorEventStream { event_receiver: self.client.take_event_receiver() }
3549 }
3550
3551 pub fn r#next(
3552 &self,
3553 ) -> fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>
3554 {
3555 ManifestBytesIteratorProxyInterface::r#next(self)
3556 }
3557}
3558
3559impl ManifestBytesIteratorProxyInterface for ManifestBytesIteratorProxy {
3560 type NextResponseFut =
3561 fidl::client::QueryResponseFut<Vec<u8>, fidl::encoding::DefaultFuchsiaResourceDialect>;
3562 fn r#next(&self) -> Self::NextResponseFut {
3563 fn _decode(
3564 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3565 ) -> Result<Vec<u8>, fidl::Error> {
3566 let _response = fidl::client::decode_transaction_body::<
3567 ManifestBytesIteratorNextResponse,
3568 fidl::encoding::DefaultFuchsiaResourceDialect,
3569 0x4be4659549b15500,
3570 >(_buf?)?;
3571 Ok(_response.infos)
3572 }
3573 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
3574 (),
3575 0x4be4659549b15500,
3576 fidl::encoding::DynamicFlags::empty(),
3577 _decode,
3578 )
3579 }
3580}
3581
3582pub struct ManifestBytesIteratorEventStream {
3583 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3584}
3585
3586impl std::marker::Unpin for ManifestBytesIteratorEventStream {}
3587
3588impl futures::stream::FusedStream for ManifestBytesIteratorEventStream {
3589 fn is_terminated(&self) -> bool {
3590 self.event_receiver.is_terminated()
3591 }
3592}
3593
3594impl futures::Stream for ManifestBytesIteratorEventStream {
3595 type Item = Result<ManifestBytesIteratorEvent, fidl::Error>;
3596
3597 fn poll_next(
3598 mut self: std::pin::Pin<&mut Self>,
3599 cx: &mut std::task::Context<'_>,
3600 ) -> std::task::Poll<Option<Self::Item>> {
3601 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3602 &mut self.event_receiver,
3603 cx
3604 )?) {
3605 Some(buf) => std::task::Poll::Ready(Some(ManifestBytesIteratorEvent::decode(buf))),
3606 None => std::task::Poll::Ready(None),
3607 }
3608 }
3609}
3610
3611#[derive(Debug)]
3612pub enum ManifestBytesIteratorEvent {}
3613
3614impl ManifestBytesIteratorEvent {
3615 fn decode(
3617 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3618 ) -> Result<ManifestBytesIteratorEvent, fidl::Error> {
3619 let (bytes, _handles) = buf.split_mut();
3620 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3621 debug_assert_eq!(tx_header.tx_id, 0);
3622 match tx_header.ordinal {
3623 _ => Err(fidl::Error::UnknownOrdinal {
3624 ordinal: tx_header.ordinal,
3625 protocol_name:
3626 <ManifestBytesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3627 }),
3628 }
3629 }
3630}
3631
3632pub struct ManifestBytesIteratorRequestStream {
3634 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3635 is_terminated: bool,
3636}
3637
3638impl std::marker::Unpin for ManifestBytesIteratorRequestStream {}
3639
3640impl futures::stream::FusedStream for ManifestBytesIteratorRequestStream {
3641 fn is_terminated(&self) -> bool {
3642 self.is_terminated
3643 }
3644}
3645
3646impl fidl::endpoints::RequestStream for ManifestBytesIteratorRequestStream {
3647 type Protocol = ManifestBytesIteratorMarker;
3648 type ControlHandle = ManifestBytesIteratorControlHandle;
3649
3650 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3651 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3652 }
3653
3654 fn control_handle(&self) -> Self::ControlHandle {
3655 ManifestBytesIteratorControlHandle { inner: self.inner.clone() }
3656 }
3657
3658 fn into_inner(
3659 self,
3660 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3661 {
3662 (self.inner, self.is_terminated)
3663 }
3664
3665 fn from_inner(
3666 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3667 is_terminated: bool,
3668 ) -> Self {
3669 Self { inner, is_terminated }
3670 }
3671}
3672
3673impl futures::Stream for ManifestBytesIteratorRequestStream {
3674 type Item = Result<ManifestBytesIteratorRequest, fidl::Error>;
3675
3676 fn poll_next(
3677 mut self: std::pin::Pin<&mut Self>,
3678 cx: &mut std::task::Context<'_>,
3679 ) -> std::task::Poll<Option<Self::Item>> {
3680 let this = &mut *self;
3681 if this.inner.check_shutdown(cx) {
3682 this.is_terminated = true;
3683 return std::task::Poll::Ready(None);
3684 }
3685 if this.is_terminated {
3686 panic!("polled ManifestBytesIteratorRequestStream after completion");
3687 }
3688 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3689 |bytes, handles| {
3690 match this.inner.channel().read_etc(cx, bytes, handles) {
3691 std::task::Poll::Ready(Ok(())) => {}
3692 std::task::Poll::Pending => return std::task::Poll::Pending,
3693 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3694 this.is_terminated = true;
3695 return std::task::Poll::Ready(None);
3696 }
3697 std::task::Poll::Ready(Err(e)) => {
3698 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3699 e.into(),
3700 ))))
3701 }
3702 }
3703
3704 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3706
3707 std::task::Poll::Ready(Some(match header.ordinal {
3708 0x4be4659549b15500 => {
3709 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3710 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3711 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3712 let control_handle = ManifestBytesIteratorControlHandle {
3713 inner: this.inner.clone(),
3714 };
3715 Ok(ManifestBytesIteratorRequest::Next {
3716 responder: ManifestBytesIteratorNextResponder {
3717 control_handle: std::mem::ManuallyDrop::new(control_handle),
3718 tx_id: header.tx_id,
3719 },
3720 })
3721 }
3722 _ => Err(fidl::Error::UnknownOrdinal {
3723 ordinal: header.ordinal,
3724 protocol_name: <ManifestBytesIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3725 }),
3726 }))
3727 },
3728 )
3729 }
3730}
3731
3732#[derive(Debug)]
3734pub enum ManifestBytesIteratorRequest {
3735 Next { responder: ManifestBytesIteratorNextResponder },
3736}
3737
3738impl ManifestBytesIteratorRequest {
3739 #[allow(irrefutable_let_patterns)]
3740 pub fn into_next(self) -> Option<(ManifestBytesIteratorNextResponder)> {
3741 if let ManifestBytesIteratorRequest::Next { responder } = self {
3742 Some((responder))
3743 } else {
3744 None
3745 }
3746 }
3747
3748 pub fn method_name(&self) -> &'static str {
3750 match *self {
3751 ManifestBytesIteratorRequest::Next { .. } => "next",
3752 }
3753 }
3754}
3755
3756#[derive(Debug, Clone)]
3757pub struct ManifestBytesIteratorControlHandle {
3758 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3759}
3760
3761impl fidl::endpoints::ControlHandle for ManifestBytesIteratorControlHandle {
3762 fn shutdown(&self) {
3763 self.inner.shutdown()
3764 }
3765 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3766 self.inner.shutdown_with_epitaph(status)
3767 }
3768
3769 fn is_closed(&self) -> bool {
3770 self.inner.channel().is_closed()
3771 }
3772 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3773 self.inner.channel().on_closed()
3774 }
3775
3776 #[cfg(target_os = "fuchsia")]
3777 fn signal_peer(
3778 &self,
3779 clear_mask: zx::Signals,
3780 set_mask: zx::Signals,
3781 ) -> Result<(), zx_status::Status> {
3782 use fidl::Peered;
3783 self.inner.channel().signal_peer(clear_mask, set_mask)
3784 }
3785}
3786
3787impl ManifestBytesIteratorControlHandle {}
3788
3789#[must_use = "FIDL methods require a response to be sent"]
3790#[derive(Debug)]
3791pub struct ManifestBytesIteratorNextResponder {
3792 control_handle: std::mem::ManuallyDrop<ManifestBytesIteratorControlHandle>,
3793 tx_id: u32,
3794}
3795
3796impl std::ops::Drop for ManifestBytesIteratorNextResponder {
3800 fn drop(&mut self) {
3801 self.control_handle.shutdown();
3802 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3804 }
3805}
3806
3807impl fidl::endpoints::Responder for ManifestBytesIteratorNextResponder {
3808 type ControlHandle = ManifestBytesIteratorControlHandle;
3809
3810 fn control_handle(&self) -> &ManifestBytesIteratorControlHandle {
3811 &self.control_handle
3812 }
3813
3814 fn drop_without_shutdown(mut self) {
3815 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3817 std::mem::forget(self);
3819 }
3820}
3821
3822impl ManifestBytesIteratorNextResponder {
3823 pub fn send(self, mut infos: &[u8]) -> Result<(), fidl::Error> {
3827 let _result = self.send_raw(infos);
3828 if _result.is_err() {
3829 self.control_handle.shutdown();
3830 }
3831 self.drop_without_shutdown();
3832 _result
3833 }
3834
3835 pub fn send_no_shutdown_on_err(self, mut infos: &[u8]) -> Result<(), fidl::Error> {
3837 let _result = self.send_raw(infos);
3838 self.drop_without_shutdown();
3839 _result
3840 }
3841
3842 fn send_raw(&self, mut infos: &[u8]) -> Result<(), fidl::Error> {
3843 self.control_handle.inner.send::<ManifestBytesIteratorNextResponse>(
3844 (infos,),
3845 self.tx_id,
3846 0x4be4659549b15500,
3847 fidl::encoding::DynamicFlags::empty(),
3848 )
3849 }
3850}
3851
3852#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3853pub struct RealmExplorerMarker;
3854
3855impl fidl::endpoints::ProtocolMarker for RealmExplorerMarker {
3856 type Proxy = RealmExplorerProxy;
3857 type RequestStream = RealmExplorerRequestStream;
3858 #[cfg(target_os = "fuchsia")]
3859 type SynchronousProxy = RealmExplorerSynchronousProxy;
3860
3861 const DEBUG_NAME: &'static str = "fuchsia.sys2.RealmExplorer";
3862}
3863impl fidl::endpoints::DiscoverableProtocolMarker for RealmExplorerMarker {}
3864
3865pub trait RealmExplorerProxyInterface: Send + Sync {}
3866#[derive(Debug)]
3867#[cfg(target_os = "fuchsia")]
3868pub struct RealmExplorerSynchronousProxy {
3869 client: fidl::client::sync::Client,
3870}
3871
3872#[cfg(target_os = "fuchsia")]
3873impl fidl::endpoints::SynchronousProxy for RealmExplorerSynchronousProxy {
3874 type Proxy = RealmExplorerProxy;
3875 type Protocol = RealmExplorerMarker;
3876
3877 fn from_channel(inner: fidl::Channel) -> Self {
3878 Self::new(inner)
3879 }
3880
3881 fn into_channel(self) -> fidl::Channel {
3882 self.client.into_channel()
3883 }
3884
3885 fn as_channel(&self) -> &fidl::Channel {
3886 self.client.as_channel()
3887 }
3888}
3889
3890#[cfg(target_os = "fuchsia")]
3891impl RealmExplorerSynchronousProxy {
3892 pub fn new(channel: fidl::Channel) -> Self {
3893 let protocol_name = <RealmExplorerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3894 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3895 }
3896
3897 pub fn into_channel(self) -> fidl::Channel {
3898 self.client.into_channel()
3899 }
3900
3901 pub fn wait_for_event(
3904 &self,
3905 deadline: zx::MonotonicInstant,
3906 ) -> Result<RealmExplorerEvent, fidl::Error> {
3907 RealmExplorerEvent::decode(self.client.wait_for_event(deadline)?)
3908 }
3909}
3910
3911#[cfg(target_os = "fuchsia")]
3912impl From<RealmExplorerSynchronousProxy> for zx::Handle {
3913 fn from(value: RealmExplorerSynchronousProxy) -> Self {
3914 value.into_channel().into()
3915 }
3916}
3917
3918#[cfg(target_os = "fuchsia")]
3919impl From<fidl::Channel> for RealmExplorerSynchronousProxy {
3920 fn from(value: fidl::Channel) -> Self {
3921 Self::new(value)
3922 }
3923}
3924
3925#[derive(Debug, Clone)]
3926pub struct RealmExplorerProxy {
3927 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3928}
3929
3930impl fidl::endpoints::Proxy for RealmExplorerProxy {
3931 type Protocol = RealmExplorerMarker;
3932
3933 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3934 Self::new(inner)
3935 }
3936
3937 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3938 self.client.into_channel().map_err(|client| Self { client })
3939 }
3940
3941 fn as_channel(&self) -> &::fidl::AsyncChannel {
3942 self.client.as_channel()
3943 }
3944}
3945
3946impl RealmExplorerProxy {
3947 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3949 let protocol_name = <RealmExplorerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3950 Self { client: fidl::client::Client::new(channel, protocol_name) }
3951 }
3952
3953 pub fn take_event_stream(&self) -> RealmExplorerEventStream {
3959 RealmExplorerEventStream { event_receiver: self.client.take_event_receiver() }
3960 }
3961}
3962
3963impl RealmExplorerProxyInterface for RealmExplorerProxy {}
3964
3965pub struct RealmExplorerEventStream {
3966 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3967}
3968
3969impl std::marker::Unpin for RealmExplorerEventStream {}
3970
3971impl futures::stream::FusedStream for RealmExplorerEventStream {
3972 fn is_terminated(&self) -> bool {
3973 self.event_receiver.is_terminated()
3974 }
3975}
3976
3977impl futures::Stream for RealmExplorerEventStream {
3978 type Item = Result<RealmExplorerEvent, fidl::Error>;
3979
3980 fn poll_next(
3981 mut self: std::pin::Pin<&mut Self>,
3982 cx: &mut std::task::Context<'_>,
3983 ) -> std::task::Poll<Option<Self::Item>> {
3984 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3985 &mut self.event_receiver,
3986 cx
3987 )?) {
3988 Some(buf) => std::task::Poll::Ready(Some(RealmExplorerEvent::decode(buf))),
3989 None => std::task::Poll::Ready(None),
3990 }
3991 }
3992}
3993
3994#[derive(Debug)]
3995pub enum RealmExplorerEvent {}
3996
3997impl RealmExplorerEvent {
3998 fn decode(
4000 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4001 ) -> Result<RealmExplorerEvent, fidl::Error> {
4002 let (bytes, _handles) = buf.split_mut();
4003 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4004 debug_assert_eq!(tx_header.tx_id, 0);
4005 match tx_header.ordinal {
4006 _ => Err(fidl::Error::UnknownOrdinal {
4007 ordinal: tx_header.ordinal,
4008 protocol_name: <RealmExplorerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4009 }),
4010 }
4011 }
4012}
4013
4014pub struct RealmExplorerRequestStream {
4016 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4017 is_terminated: bool,
4018}
4019
4020impl std::marker::Unpin for RealmExplorerRequestStream {}
4021
4022impl futures::stream::FusedStream for RealmExplorerRequestStream {
4023 fn is_terminated(&self) -> bool {
4024 self.is_terminated
4025 }
4026}
4027
4028impl fidl::endpoints::RequestStream for RealmExplorerRequestStream {
4029 type Protocol = RealmExplorerMarker;
4030 type ControlHandle = RealmExplorerControlHandle;
4031
4032 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4033 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4034 }
4035
4036 fn control_handle(&self) -> Self::ControlHandle {
4037 RealmExplorerControlHandle { inner: self.inner.clone() }
4038 }
4039
4040 fn into_inner(
4041 self,
4042 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4043 {
4044 (self.inner, self.is_terminated)
4045 }
4046
4047 fn from_inner(
4048 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4049 is_terminated: bool,
4050 ) -> Self {
4051 Self { inner, is_terminated }
4052 }
4053}
4054
4055impl futures::Stream for RealmExplorerRequestStream {
4056 type Item = Result<RealmExplorerRequest, fidl::Error>;
4057
4058 fn poll_next(
4059 mut self: std::pin::Pin<&mut Self>,
4060 cx: &mut std::task::Context<'_>,
4061 ) -> std::task::Poll<Option<Self::Item>> {
4062 let this = &mut *self;
4063 if this.inner.check_shutdown(cx) {
4064 this.is_terminated = true;
4065 return std::task::Poll::Ready(None);
4066 }
4067 if this.is_terminated {
4068 panic!("polled RealmExplorerRequestStream after completion");
4069 }
4070 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4071 |bytes, handles| {
4072 match this.inner.channel().read_etc(cx, bytes, handles) {
4073 std::task::Poll::Ready(Ok(())) => {}
4074 std::task::Poll::Pending => return std::task::Poll::Pending,
4075 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4076 this.is_terminated = true;
4077 return std::task::Poll::Ready(None);
4078 }
4079 std::task::Poll::Ready(Err(e)) => {
4080 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4081 e.into(),
4082 ))))
4083 }
4084 }
4085
4086 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4088
4089 std::task::Poll::Ready(Some(match header.ordinal {
4090 _ => Err(fidl::Error::UnknownOrdinal {
4091 ordinal: header.ordinal,
4092 protocol_name:
4093 <RealmExplorerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4094 }),
4095 }))
4096 },
4097 )
4098 }
4099}
4100
4101#[derive(Debug)]
4103pub enum RealmExplorerRequest {}
4104
4105impl RealmExplorerRequest {
4106 pub fn method_name(&self) -> &'static str {
4108 match *self {}
4109 }
4110}
4111
4112#[derive(Debug, Clone)]
4113pub struct RealmExplorerControlHandle {
4114 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4115}
4116
4117impl fidl::endpoints::ControlHandle for RealmExplorerControlHandle {
4118 fn shutdown(&self) {
4119 self.inner.shutdown()
4120 }
4121 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4122 self.inner.shutdown_with_epitaph(status)
4123 }
4124
4125 fn is_closed(&self) -> bool {
4126 self.inner.channel().is_closed()
4127 }
4128 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4129 self.inner.channel().on_closed()
4130 }
4131
4132 #[cfg(target_os = "fuchsia")]
4133 fn signal_peer(
4134 &self,
4135 clear_mask: zx::Signals,
4136 set_mask: zx::Signals,
4137 ) -> Result<(), zx_status::Status> {
4138 use fidl::Peered;
4139 self.inner.channel().signal_peer(clear_mask, set_mask)
4140 }
4141}
4142
4143impl RealmExplorerControlHandle {}
4144
4145#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4146pub struct RealmQueryMarker;
4147
4148impl fidl::endpoints::ProtocolMarker for RealmQueryMarker {
4149 type Proxy = RealmQueryProxy;
4150 type RequestStream = RealmQueryRequestStream;
4151 #[cfg(target_os = "fuchsia")]
4152 type SynchronousProxy = RealmQuerySynchronousProxy;
4153
4154 const DEBUG_NAME: &'static str = "fuchsia.sys2.RealmQuery";
4155}
4156impl fidl::endpoints::DiscoverableProtocolMarker for RealmQueryMarker {}
4157pub type RealmQueryGetInstanceResult = Result<Instance, GetInstanceError>;
4158pub type RealmQueryGetResolvedDeclarationResult =
4159 Result<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>, GetDeclarationError>;
4160pub type RealmQueryGetManifestResult =
4161 Result<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>, GetDeclarationError>;
4162pub type RealmQueryResolveDeclarationResult =
4163 Result<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>, GetDeclarationError>;
4164pub type RealmQueryGetStructuredConfigResult =
4165 Result<fidl_fuchsia_component_decl::ResolvedConfig, GetStructuredConfigError>;
4166pub type RealmQueryGetAllInstancesResult =
4167 Result<fidl::endpoints::ClientEnd<InstanceIteratorMarker>, GetAllInstancesError>;
4168pub type RealmQueryConstructNamespaceResult =
4169 Result<Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>, ConstructNamespaceError>;
4170pub type RealmQueryOpenDirectoryResult = Result<(), OpenError>;
4171pub type RealmQueryConnectToStorageAdminResult = Result<(), ConnectToStorageAdminError>;
4172pub type RealmQueryDeprecatedOpenResult = Result<(), OpenError>;
4173
4174pub trait RealmQueryProxyInterface: Send + Sync {
4175 type GetInstanceResponseFut: std::future::Future<Output = Result<RealmQueryGetInstanceResult, fidl::Error>>
4176 + Send;
4177 fn r#get_instance(&self, moniker: &str) -> Self::GetInstanceResponseFut;
4178 type GetResolvedDeclarationResponseFut: std::future::Future<Output = Result<RealmQueryGetResolvedDeclarationResult, fidl::Error>>
4179 + Send;
4180 fn r#get_resolved_declaration(&self, moniker: &str) -> Self::GetResolvedDeclarationResponseFut;
4181 type GetManifestResponseFut: std::future::Future<Output = Result<RealmQueryGetManifestResult, fidl::Error>>
4182 + Send;
4183 fn r#get_manifest(&self, moniker: &str) -> Self::GetManifestResponseFut;
4184 type ResolveDeclarationResponseFut: std::future::Future<Output = Result<RealmQueryResolveDeclarationResult, fidl::Error>>
4185 + Send;
4186 fn r#resolve_declaration(
4187 &self,
4188 parent: &str,
4189 child_location: &ChildLocation,
4190 url: &str,
4191 ) -> Self::ResolveDeclarationResponseFut;
4192 type GetStructuredConfigResponseFut: std::future::Future<Output = Result<RealmQueryGetStructuredConfigResult, fidl::Error>>
4193 + Send;
4194 fn r#get_structured_config(&self, moniker: &str) -> Self::GetStructuredConfigResponseFut;
4195 type GetAllInstancesResponseFut: std::future::Future<Output = Result<RealmQueryGetAllInstancesResult, fidl::Error>>
4196 + Send;
4197 fn r#get_all_instances(&self) -> Self::GetAllInstancesResponseFut;
4198 type ConstructNamespaceResponseFut: std::future::Future<Output = Result<RealmQueryConstructNamespaceResult, fidl::Error>>
4199 + Send;
4200 fn r#construct_namespace(&self, moniker: &str) -> Self::ConstructNamespaceResponseFut;
4201 type OpenDirectoryResponseFut: std::future::Future<Output = Result<RealmQueryOpenDirectoryResult, fidl::Error>>
4202 + Send;
4203 fn r#open_directory(
4204 &self,
4205 moniker: &str,
4206 dir_type: OpenDirType,
4207 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4208 ) -> Self::OpenDirectoryResponseFut;
4209 type ConnectToStorageAdminResponseFut: std::future::Future<Output = Result<RealmQueryConnectToStorageAdminResult, fidl::Error>>
4210 + Send;
4211 fn r#connect_to_storage_admin(
4212 &self,
4213 moniker: &str,
4214 storage_name: &str,
4215 server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
4216 ) -> Self::ConnectToStorageAdminResponseFut;
4217 type DeprecatedOpenResponseFut: std::future::Future<Output = Result<RealmQueryDeprecatedOpenResult, fidl::Error>>
4218 + Send;
4219 fn r#deprecated_open(
4220 &self,
4221 moniker: &str,
4222 dir_type: OpenDirType,
4223 flags: fidl_fuchsia_io::OpenFlags,
4224 mode: fidl_fuchsia_io::ModeType,
4225 path: &str,
4226 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
4227 ) -> Self::DeprecatedOpenResponseFut;
4228}
4229#[derive(Debug)]
4230#[cfg(target_os = "fuchsia")]
4231pub struct RealmQuerySynchronousProxy {
4232 client: fidl::client::sync::Client,
4233}
4234
4235#[cfg(target_os = "fuchsia")]
4236impl fidl::endpoints::SynchronousProxy for RealmQuerySynchronousProxy {
4237 type Proxy = RealmQueryProxy;
4238 type Protocol = RealmQueryMarker;
4239
4240 fn from_channel(inner: fidl::Channel) -> Self {
4241 Self::new(inner)
4242 }
4243
4244 fn into_channel(self) -> fidl::Channel {
4245 self.client.into_channel()
4246 }
4247
4248 fn as_channel(&self) -> &fidl::Channel {
4249 self.client.as_channel()
4250 }
4251}
4252
4253#[cfg(target_os = "fuchsia")]
4254impl RealmQuerySynchronousProxy {
4255 pub fn new(channel: fidl::Channel) -> Self {
4256 let protocol_name = <RealmQueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4257 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4258 }
4259
4260 pub fn into_channel(self) -> fidl::Channel {
4261 self.client.into_channel()
4262 }
4263
4264 pub fn wait_for_event(
4267 &self,
4268 deadline: zx::MonotonicInstant,
4269 ) -> Result<RealmQueryEvent, fidl::Error> {
4270 RealmQueryEvent::decode(self.client.wait_for_event(deadline)?)
4271 }
4272
4273 pub fn r#get_instance(
4275 &self,
4276 mut moniker: &str,
4277 ___deadline: zx::MonotonicInstant,
4278 ) -> Result<RealmQueryGetInstanceResult, fidl::Error> {
4279 let _response =
4280 self.client.send_query::<RealmQueryGetInstanceRequest, fidl::encoding::ResultType<
4281 RealmQueryGetInstanceResponse,
4282 GetInstanceError,
4283 >>(
4284 (moniker,),
4285 0x3496ca1e5a0c13a8,
4286 fidl::encoding::DynamicFlags::empty(),
4287 ___deadline,
4288 )?;
4289 Ok(_response.map(|x| x.instance))
4290 }
4291
4292 pub fn r#get_resolved_declaration(
4299 &self,
4300 mut moniker: &str,
4301 ___deadline: zx::MonotonicInstant,
4302 ) -> Result<RealmQueryGetResolvedDeclarationResult, fidl::Error> {
4303 let _response = self
4304 .client
4305 .send_query::<RealmQueryGetResolvedDeclarationRequest, fidl::encoding::ResultType<
4306 RealmQueryGetResolvedDeclarationResponse,
4307 GetDeclarationError,
4308 >>(
4309 (moniker,),
4310 0x31a493d284a0bc1f,
4311 fidl::encoding::DynamicFlags::empty(),
4312 ___deadline,
4313 )?;
4314 Ok(_response.map(|x| x.iterator))
4315 }
4316
4317 pub fn r#get_manifest(
4319 &self,
4320 mut moniker: &str,
4321 ___deadline: zx::MonotonicInstant,
4322 ) -> Result<RealmQueryGetManifestResult, fidl::Error> {
4323 let _response =
4324 self.client.send_query::<RealmQueryGetManifestRequest, fidl::encoding::ResultType<
4325 RealmQueryGetManifestResponse,
4326 GetDeclarationError,
4327 >>(
4328 (moniker,),
4329 0x640769a9f88685c7,
4330 fidl::encoding::DynamicFlags::empty(),
4331 ___deadline,
4332 )?;
4333 Ok(_response.map(|x| x.iterator))
4334 }
4335
4336 pub fn r#resolve_declaration(
4344 &self,
4345 mut parent: &str,
4346 mut child_location: &ChildLocation,
4347 mut url: &str,
4348 ___deadline: zx::MonotonicInstant,
4349 ) -> Result<RealmQueryResolveDeclarationResult, fidl::Error> {
4350 let _response =
4351 self.client
4352 .send_query::<RealmQueryResolveDeclarationRequest, fidl::encoding::ResultType<
4353 RealmQueryResolveDeclarationResponse,
4354 GetDeclarationError,
4355 >>(
4356 (parent, child_location, url),
4357 0x1ab1adf2a87d962d,
4358 fidl::encoding::DynamicFlags::empty(),
4359 ___deadline,
4360 )?;
4361 Ok(_response.map(|x| x.iterator))
4362 }
4363
4364 pub fn r#get_structured_config(
4366 &self,
4367 mut moniker: &str,
4368 ___deadline: zx::MonotonicInstant,
4369 ) -> Result<RealmQueryGetStructuredConfigResult, fidl::Error> {
4370 let _response = self
4371 .client
4372 .send_query::<RealmQueryGetStructuredConfigRequest, fidl::encoding::ResultType<
4373 RealmQueryGetStructuredConfigResponse,
4374 GetStructuredConfigError,
4375 >>(
4376 (moniker,), 0x16f88f6735bd204, fidl::encoding::DynamicFlags::empty(), ___deadline
4377 )?;
4378 Ok(_response.map(|x| x.config))
4379 }
4380
4381 pub fn r#get_all_instances(
4385 &self,
4386 ___deadline: zx::MonotonicInstant,
4387 ) -> Result<RealmQueryGetAllInstancesResult, fidl::Error> {
4388 let _response =
4389 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4390 RealmQueryGetAllInstancesResponse,
4391 GetAllInstancesError,
4392 >>(
4393 (),
4394 0x7b5a8775d30cad47,
4395 fidl::encoding::DynamicFlags::empty(),
4396 ___deadline,
4397 )?;
4398 Ok(_response.map(|x| x.iterator))
4399 }
4400
4401 pub fn r#construct_namespace(
4406 &self,
4407 mut moniker: &str,
4408 ___deadline: zx::MonotonicInstant,
4409 ) -> Result<RealmQueryConstructNamespaceResult, fidl::Error> {
4410 let _response = self
4411 .client
4412 .send_query::<RealmQueryConstructNamespaceRequest, fidl::encoding::ResultType<
4413 RealmQueryConstructNamespaceResponse,
4414 ConstructNamespaceError,
4415 >>(
4416 (moniker,),
4417 0x5ecb29c02c488eeb,
4418 fidl::encoding::DynamicFlags::empty(),
4419 ___deadline,
4420 )?;
4421 Ok(_response.map(|x| x.namespace))
4422 }
4423
4424 pub fn r#open_directory(
4426 &self,
4427 mut moniker: &str,
4428 mut dir_type: OpenDirType,
4429 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4430 ___deadline: zx::MonotonicInstant,
4431 ) -> Result<RealmQueryOpenDirectoryResult, fidl::Error> {
4432 let _response = self.client.send_query::<
4433 RealmQueryOpenDirectoryRequest,
4434 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
4435 >(
4436 (moniker, dir_type, object,),
4437 0x333d68f1deecec85,
4438 fidl::encoding::DynamicFlags::empty(),
4439 ___deadline,
4440 )?;
4441 Ok(_response.map(|x| x))
4442 }
4443
4444 pub fn r#connect_to_storage_admin(
4446 &self,
4447 mut moniker: &str,
4448 mut storage_name: &str,
4449 mut server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
4450 ___deadline: zx::MonotonicInstant,
4451 ) -> Result<RealmQueryConnectToStorageAdminResult, fidl::Error> {
4452 let _response =
4453 self.client
4454 .send_query::<RealmQueryConnectToStorageAdminRequest, fidl::encoding::ResultType<
4455 fidl::encoding::EmptyStruct,
4456 ConnectToStorageAdminError,
4457 >>(
4458 (moniker, storage_name, server_end),
4459 0x7807e6b4f623ace,
4460 fidl::encoding::DynamicFlags::empty(),
4461 ___deadline,
4462 )?;
4463 Ok(_response.map(|x| x))
4464 }
4465
4466 pub fn r#deprecated_open(
4470 &self,
4471 mut moniker: &str,
4472 mut dir_type: OpenDirType,
4473 mut flags: fidl_fuchsia_io::OpenFlags,
4474 mut mode: fidl_fuchsia_io::ModeType,
4475 mut path: &str,
4476 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
4477 ___deadline: zx::MonotonicInstant,
4478 ) -> Result<RealmQueryDeprecatedOpenResult, fidl::Error> {
4479 let _response = self.client.send_query::<
4480 RealmQueryDeprecatedOpenRequest,
4481 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
4482 >(
4483 (moniker, dir_type, flags, mode, path, object,),
4484 0x42a5517b78cf410,
4485 fidl::encoding::DynamicFlags::empty(),
4486 ___deadline,
4487 )?;
4488 Ok(_response.map(|x| x))
4489 }
4490}
4491
4492#[cfg(target_os = "fuchsia")]
4493impl From<RealmQuerySynchronousProxy> for zx::Handle {
4494 fn from(value: RealmQuerySynchronousProxy) -> Self {
4495 value.into_channel().into()
4496 }
4497}
4498
4499#[cfg(target_os = "fuchsia")]
4500impl From<fidl::Channel> for RealmQuerySynchronousProxy {
4501 fn from(value: fidl::Channel) -> Self {
4502 Self::new(value)
4503 }
4504}
4505
4506#[derive(Debug, Clone)]
4507pub struct RealmQueryProxy {
4508 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4509}
4510
4511impl fidl::endpoints::Proxy for RealmQueryProxy {
4512 type Protocol = RealmQueryMarker;
4513
4514 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4515 Self::new(inner)
4516 }
4517
4518 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4519 self.client.into_channel().map_err(|client| Self { client })
4520 }
4521
4522 fn as_channel(&self) -> &::fidl::AsyncChannel {
4523 self.client.as_channel()
4524 }
4525}
4526
4527impl RealmQueryProxy {
4528 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4530 let protocol_name = <RealmQueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4531 Self { client: fidl::client::Client::new(channel, protocol_name) }
4532 }
4533
4534 pub fn take_event_stream(&self) -> RealmQueryEventStream {
4540 RealmQueryEventStream { event_receiver: self.client.take_event_receiver() }
4541 }
4542
4543 pub fn r#get_instance(
4545 &self,
4546 mut moniker: &str,
4547 ) -> fidl::client::QueryResponseFut<
4548 RealmQueryGetInstanceResult,
4549 fidl::encoding::DefaultFuchsiaResourceDialect,
4550 > {
4551 RealmQueryProxyInterface::r#get_instance(self, moniker)
4552 }
4553
4554 pub fn r#get_resolved_declaration(
4561 &self,
4562 mut moniker: &str,
4563 ) -> fidl::client::QueryResponseFut<
4564 RealmQueryGetResolvedDeclarationResult,
4565 fidl::encoding::DefaultFuchsiaResourceDialect,
4566 > {
4567 RealmQueryProxyInterface::r#get_resolved_declaration(self, moniker)
4568 }
4569
4570 pub fn r#get_manifest(
4572 &self,
4573 mut moniker: &str,
4574 ) -> fidl::client::QueryResponseFut<
4575 RealmQueryGetManifestResult,
4576 fidl::encoding::DefaultFuchsiaResourceDialect,
4577 > {
4578 RealmQueryProxyInterface::r#get_manifest(self, moniker)
4579 }
4580
4581 pub fn r#resolve_declaration(
4589 &self,
4590 mut parent: &str,
4591 mut child_location: &ChildLocation,
4592 mut url: &str,
4593 ) -> fidl::client::QueryResponseFut<
4594 RealmQueryResolveDeclarationResult,
4595 fidl::encoding::DefaultFuchsiaResourceDialect,
4596 > {
4597 RealmQueryProxyInterface::r#resolve_declaration(self, parent, child_location, url)
4598 }
4599
4600 pub fn r#get_structured_config(
4602 &self,
4603 mut moniker: &str,
4604 ) -> fidl::client::QueryResponseFut<
4605 RealmQueryGetStructuredConfigResult,
4606 fidl::encoding::DefaultFuchsiaResourceDialect,
4607 > {
4608 RealmQueryProxyInterface::r#get_structured_config(self, moniker)
4609 }
4610
4611 pub fn r#get_all_instances(
4615 &self,
4616 ) -> fidl::client::QueryResponseFut<
4617 RealmQueryGetAllInstancesResult,
4618 fidl::encoding::DefaultFuchsiaResourceDialect,
4619 > {
4620 RealmQueryProxyInterface::r#get_all_instances(self)
4621 }
4622
4623 pub fn r#construct_namespace(
4628 &self,
4629 mut moniker: &str,
4630 ) -> fidl::client::QueryResponseFut<
4631 RealmQueryConstructNamespaceResult,
4632 fidl::encoding::DefaultFuchsiaResourceDialect,
4633 > {
4634 RealmQueryProxyInterface::r#construct_namespace(self, moniker)
4635 }
4636
4637 pub fn r#open_directory(
4639 &self,
4640 mut moniker: &str,
4641 mut dir_type: OpenDirType,
4642 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4643 ) -> fidl::client::QueryResponseFut<
4644 RealmQueryOpenDirectoryResult,
4645 fidl::encoding::DefaultFuchsiaResourceDialect,
4646 > {
4647 RealmQueryProxyInterface::r#open_directory(self, moniker, dir_type, object)
4648 }
4649
4650 pub fn r#connect_to_storage_admin(
4652 &self,
4653 mut moniker: &str,
4654 mut storage_name: &str,
4655 mut server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
4656 ) -> fidl::client::QueryResponseFut<
4657 RealmQueryConnectToStorageAdminResult,
4658 fidl::encoding::DefaultFuchsiaResourceDialect,
4659 > {
4660 RealmQueryProxyInterface::r#connect_to_storage_admin(
4661 self,
4662 moniker,
4663 storage_name,
4664 server_end,
4665 )
4666 }
4667
4668 pub fn r#deprecated_open(
4672 &self,
4673 mut moniker: &str,
4674 mut dir_type: OpenDirType,
4675 mut flags: fidl_fuchsia_io::OpenFlags,
4676 mut mode: fidl_fuchsia_io::ModeType,
4677 mut path: &str,
4678 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
4679 ) -> fidl::client::QueryResponseFut<
4680 RealmQueryDeprecatedOpenResult,
4681 fidl::encoding::DefaultFuchsiaResourceDialect,
4682 > {
4683 RealmQueryProxyInterface::r#deprecated_open(
4684 self, moniker, dir_type, flags, mode, path, object,
4685 )
4686 }
4687}
4688
4689impl RealmQueryProxyInterface for RealmQueryProxy {
4690 type GetInstanceResponseFut = fidl::client::QueryResponseFut<
4691 RealmQueryGetInstanceResult,
4692 fidl::encoding::DefaultFuchsiaResourceDialect,
4693 >;
4694 fn r#get_instance(&self, mut moniker: &str) -> Self::GetInstanceResponseFut {
4695 fn _decode(
4696 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4697 ) -> Result<RealmQueryGetInstanceResult, fidl::Error> {
4698 let _response = fidl::client::decode_transaction_body::<
4699 fidl::encoding::ResultType<RealmQueryGetInstanceResponse, GetInstanceError>,
4700 fidl::encoding::DefaultFuchsiaResourceDialect,
4701 0x3496ca1e5a0c13a8,
4702 >(_buf?)?;
4703 Ok(_response.map(|x| x.instance))
4704 }
4705 self.client
4706 .send_query_and_decode::<RealmQueryGetInstanceRequest, RealmQueryGetInstanceResult>(
4707 (moniker,),
4708 0x3496ca1e5a0c13a8,
4709 fidl::encoding::DynamicFlags::empty(),
4710 _decode,
4711 )
4712 }
4713
4714 type GetResolvedDeclarationResponseFut = fidl::client::QueryResponseFut<
4715 RealmQueryGetResolvedDeclarationResult,
4716 fidl::encoding::DefaultFuchsiaResourceDialect,
4717 >;
4718 fn r#get_resolved_declaration(
4719 &self,
4720 mut moniker: &str,
4721 ) -> Self::GetResolvedDeclarationResponseFut {
4722 fn _decode(
4723 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4724 ) -> Result<RealmQueryGetResolvedDeclarationResult, fidl::Error> {
4725 let _response = fidl::client::decode_transaction_body::<
4726 fidl::encoding::ResultType<
4727 RealmQueryGetResolvedDeclarationResponse,
4728 GetDeclarationError,
4729 >,
4730 fidl::encoding::DefaultFuchsiaResourceDialect,
4731 0x31a493d284a0bc1f,
4732 >(_buf?)?;
4733 Ok(_response.map(|x| x.iterator))
4734 }
4735 self.client.send_query_and_decode::<
4736 RealmQueryGetResolvedDeclarationRequest,
4737 RealmQueryGetResolvedDeclarationResult,
4738 >(
4739 (moniker,),
4740 0x31a493d284a0bc1f,
4741 fidl::encoding::DynamicFlags::empty(),
4742 _decode,
4743 )
4744 }
4745
4746 type GetManifestResponseFut = fidl::client::QueryResponseFut<
4747 RealmQueryGetManifestResult,
4748 fidl::encoding::DefaultFuchsiaResourceDialect,
4749 >;
4750 fn r#get_manifest(&self, mut moniker: &str) -> Self::GetManifestResponseFut {
4751 fn _decode(
4752 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4753 ) -> Result<RealmQueryGetManifestResult, fidl::Error> {
4754 let _response = fidl::client::decode_transaction_body::<
4755 fidl::encoding::ResultType<RealmQueryGetManifestResponse, GetDeclarationError>,
4756 fidl::encoding::DefaultFuchsiaResourceDialect,
4757 0x640769a9f88685c7,
4758 >(_buf?)?;
4759 Ok(_response.map(|x| x.iterator))
4760 }
4761 self.client
4762 .send_query_and_decode::<RealmQueryGetManifestRequest, RealmQueryGetManifestResult>(
4763 (moniker,),
4764 0x640769a9f88685c7,
4765 fidl::encoding::DynamicFlags::empty(),
4766 _decode,
4767 )
4768 }
4769
4770 type ResolveDeclarationResponseFut = fidl::client::QueryResponseFut<
4771 RealmQueryResolveDeclarationResult,
4772 fidl::encoding::DefaultFuchsiaResourceDialect,
4773 >;
4774 fn r#resolve_declaration(
4775 &self,
4776 mut parent: &str,
4777 mut child_location: &ChildLocation,
4778 mut url: &str,
4779 ) -> Self::ResolveDeclarationResponseFut {
4780 fn _decode(
4781 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4782 ) -> Result<RealmQueryResolveDeclarationResult, fidl::Error> {
4783 let _response = fidl::client::decode_transaction_body::<
4784 fidl::encoding::ResultType<
4785 RealmQueryResolveDeclarationResponse,
4786 GetDeclarationError,
4787 >,
4788 fidl::encoding::DefaultFuchsiaResourceDialect,
4789 0x1ab1adf2a87d962d,
4790 >(_buf?)?;
4791 Ok(_response.map(|x| x.iterator))
4792 }
4793 self.client.send_query_and_decode::<
4794 RealmQueryResolveDeclarationRequest,
4795 RealmQueryResolveDeclarationResult,
4796 >(
4797 (parent, child_location, url,),
4798 0x1ab1adf2a87d962d,
4799 fidl::encoding::DynamicFlags::empty(),
4800 _decode,
4801 )
4802 }
4803
4804 type GetStructuredConfigResponseFut = fidl::client::QueryResponseFut<
4805 RealmQueryGetStructuredConfigResult,
4806 fidl::encoding::DefaultFuchsiaResourceDialect,
4807 >;
4808 fn r#get_structured_config(&self, mut moniker: &str) -> Self::GetStructuredConfigResponseFut {
4809 fn _decode(
4810 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4811 ) -> Result<RealmQueryGetStructuredConfigResult, fidl::Error> {
4812 let _response = fidl::client::decode_transaction_body::<
4813 fidl::encoding::ResultType<
4814 RealmQueryGetStructuredConfigResponse,
4815 GetStructuredConfigError,
4816 >,
4817 fidl::encoding::DefaultFuchsiaResourceDialect,
4818 0x16f88f6735bd204,
4819 >(_buf?)?;
4820 Ok(_response.map(|x| x.config))
4821 }
4822 self.client.send_query_and_decode::<
4823 RealmQueryGetStructuredConfigRequest,
4824 RealmQueryGetStructuredConfigResult,
4825 >(
4826 (moniker,),
4827 0x16f88f6735bd204,
4828 fidl::encoding::DynamicFlags::empty(),
4829 _decode,
4830 )
4831 }
4832
4833 type GetAllInstancesResponseFut = fidl::client::QueryResponseFut<
4834 RealmQueryGetAllInstancesResult,
4835 fidl::encoding::DefaultFuchsiaResourceDialect,
4836 >;
4837 fn r#get_all_instances(&self) -> Self::GetAllInstancesResponseFut {
4838 fn _decode(
4839 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4840 ) -> Result<RealmQueryGetAllInstancesResult, fidl::Error> {
4841 let _response = fidl::client::decode_transaction_body::<
4842 fidl::encoding::ResultType<RealmQueryGetAllInstancesResponse, GetAllInstancesError>,
4843 fidl::encoding::DefaultFuchsiaResourceDialect,
4844 0x7b5a8775d30cad47,
4845 >(_buf?)?;
4846 Ok(_response.map(|x| x.iterator))
4847 }
4848 self.client
4849 .send_query_and_decode::<fidl::encoding::EmptyPayload, RealmQueryGetAllInstancesResult>(
4850 (),
4851 0x7b5a8775d30cad47,
4852 fidl::encoding::DynamicFlags::empty(),
4853 _decode,
4854 )
4855 }
4856
4857 type ConstructNamespaceResponseFut = fidl::client::QueryResponseFut<
4858 RealmQueryConstructNamespaceResult,
4859 fidl::encoding::DefaultFuchsiaResourceDialect,
4860 >;
4861 fn r#construct_namespace(&self, mut moniker: &str) -> Self::ConstructNamespaceResponseFut {
4862 fn _decode(
4863 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4864 ) -> Result<RealmQueryConstructNamespaceResult, fidl::Error> {
4865 let _response = fidl::client::decode_transaction_body::<
4866 fidl::encoding::ResultType<
4867 RealmQueryConstructNamespaceResponse,
4868 ConstructNamespaceError,
4869 >,
4870 fidl::encoding::DefaultFuchsiaResourceDialect,
4871 0x5ecb29c02c488eeb,
4872 >(_buf?)?;
4873 Ok(_response.map(|x| x.namespace))
4874 }
4875 self.client.send_query_and_decode::<
4876 RealmQueryConstructNamespaceRequest,
4877 RealmQueryConstructNamespaceResult,
4878 >(
4879 (moniker,),
4880 0x5ecb29c02c488eeb,
4881 fidl::encoding::DynamicFlags::empty(),
4882 _decode,
4883 )
4884 }
4885
4886 type OpenDirectoryResponseFut = fidl::client::QueryResponseFut<
4887 RealmQueryOpenDirectoryResult,
4888 fidl::encoding::DefaultFuchsiaResourceDialect,
4889 >;
4890 fn r#open_directory(
4891 &self,
4892 mut moniker: &str,
4893 mut dir_type: OpenDirType,
4894 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4895 ) -> Self::OpenDirectoryResponseFut {
4896 fn _decode(
4897 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4898 ) -> Result<RealmQueryOpenDirectoryResult, fidl::Error> {
4899 let _response = fidl::client::decode_transaction_body::<
4900 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
4901 fidl::encoding::DefaultFuchsiaResourceDialect,
4902 0x333d68f1deecec85,
4903 >(_buf?)?;
4904 Ok(_response.map(|x| x))
4905 }
4906 self.client
4907 .send_query_and_decode::<RealmQueryOpenDirectoryRequest, RealmQueryOpenDirectoryResult>(
4908 (moniker, dir_type, object),
4909 0x333d68f1deecec85,
4910 fidl::encoding::DynamicFlags::empty(),
4911 _decode,
4912 )
4913 }
4914
4915 type ConnectToStorageAdminResponseFut = fidl::client::QueryResponseFut<
4916 RealmQueryConnectToStorageAdminResult,
4917 fidl::encoding::DefaultFuchsiaResourceDialect,
4918 >;
4919 fn r#connect_to_storage_admin(
4920 &self,
4921 mut moniker: &str,
4922 mut storage_name: &str,
4923 mut server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
4924 ) -> Self::ConnectToStorageAdminResponseFut {
4925 fn _decode(
4926 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4927 ) -> Result<RealmQueryConnectToStorageAdminResult, fidl::Error> {
4928 let _response = fidl::client::decode_transaction_body::<
4929 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ConnectToStorageAdminError>,
4930 fidl::encoding::DefaultFuchsiaResourceDialect,
4931 0x7807e6b4f623ace,
4932 >(_buf?)?;
4933 Ok(_response.map(|x| x))
4934 }
4935 self.client.send_query_and_decode::<
4936 RealmQueryConnectToStorageAdminRequest,
4937 RealmQueryConnectToStorageAdminResult,
4938 >(
4939 (moniker, storage_name, server_end,),
4940 0x7807e6b4f623ace,
4941 fidl::encoding::DynamicFlags::empty(),
4942 _decode,
4943 )
4944 }
4945
4946 type DeprecatedOpenResponseFut = fidl::client::QueryResponseFut<
4947 RealmQueryDeprecatedOpenResult,
4948 fidl::encoding::DefaultFuchsiaResourceDialect,
4949 >;
4950 fn r#deprecated_open(
4951 &self,
4952 mut moniker: &str,
4953 mut dir_type: OpenDirType,
4954 mut flags: fidl_fuchsia_io::OpenFlags,
4955 mut mode: fidl_fuchsia_io::ModeType,
4956 mut path: &str,
4957 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
4958 ) -> Self::DeprecatedOpenResponseFut {
4959 fn _decode(
4960 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4961 ) -> Result<RealmQueryDeprecatedOpenResult, fidl::Error> {
4962 let _response = fidl::client::decode_transaction_body::<
4963 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
4964 fidl::encoding::DefaultFuchsiaResourceDialect,
4965 0x42a5517b78cf410,
4966 >(_buf?)?;
4967 Ok(_response.map(|x| x))
4968 }
4969 self.client.send_query_and_decode::<
4970 RealmQueryDeprecatedOpenRequest,
4971 RealmQueryDeprecatedOpenResult,
4972 >(
4973 (moniker, dir_type, flags, mode, path, object,),
4974 0x42a5517b78cf410,
4975 fidl::encoding::DynamicFlags::empty(),
4976 _decode,
4977 )
4978 }
4979}
4980
4981pub struct RealmQueryEventStream {
4982 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4983}
4984
4985impl std::marker::Unpin for RealmQueryEventStream {}
4986
4987impl futures::stream::FusedStream for RealmQueryEventStream {
4988 fn is_terminated(&self) -> bool {
4989 self.event_receiver.is_terminated()
4990 }
4991}
4992
4993impl futures::Stream for RealmQueryEventStream {
4994 type Item = Result<RealmQueryEvent, fidl::Error>;
4995
4996 fn poll_next(
4997 mut self: std::pin::Pin<&mut Self>,
4998 cx: &mut std::task::Context<'_>,
4999 ) -> std::task::Poll<Option<Self::Item>> {
5000 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5001 &mut self.event_receiver,
5002 cx
5003 )?) {
5004 Some(buf) => std::task::Poll::Ready(Some(RealmQueryEvent::decode(buf))),
5005 None => std::task::Poll::Ready(None),
5006 }
5007 }
5008}
5009
5010#[derive(Debug)]
5011pub enum RealmQueryEvent {}
5012
5013impl RealmQueryEvent {
5014 fn decode(
5016 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5017 ) -> Result<RealmQueryEvent, fidl::Error> {
5018 let (bytes, _handles) = buf.split_mut();
5019 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5020 debug_assert_eq!(tx_header.tx_id, 0);
5021 match tx_header.ordinal {
5022 _ => Err(fidl::Error::UnknownOrdinal {
5023 ordinal: tx_header.ordinal,
5024 protocol_name: <RealmQueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5025 }),
5026 }
5027 }
5028}
5029
5030pub struct RealmQueryRequestStream {
5032 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5033 is_terminated: bool,
5034}
5035
5036impl std::marker::Unpin for RealmQueryRequestStream {}
5037
5038impl futures::stream::FusedStream for RealmQueryRequestStream {
5039 fn is_terminated(&self) -> bool {
5040 self.is_terminated
5041 }
5042}
5043
5044impl fidl::endpoints::RequestStream for RealmQueryRequestStream {
5045 type Protocol = RealmQueryMarker;
5046 type ControlHandle = RealmQueryControlHandle;
5047
5048 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5049 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5050 }
5051
5052 fn control_handle(&self) -> Self::ControlHandle {
5053 RealmQueryControlHandle { inner: self.inner.clone() }
5054 }
5055
5056 fn into_inner(
5057 self,
5058 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5059 {
5060 (self.inner, self.is_terminated)
5061 }
5062
5063 fn from_inner(
5064 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5065 is_terminated: bool,
5066 ) -> Self {
5067 Self { inner, is_terminated }
5068 }
5069}
5070
5071impl futures::Stream for RealmQueryRequestStream {
5072 type Item = Result<RealmQueryRequest, fidl::Error>;
5073
5074 fn poll_next(
5075 mut self: std::pin::Pin<&mut Self>,
5076 cx: &mut std::task::Context<'_>,
5077 ) -> std::task::Poll<Option<Self::Item>> {
5078 let this = &mut *self;
5079 if this.inner.check_shutdown(cx) {
5080 this.is_terminated = true;
5081 return std::task::Poll::Ready(None);
5082 }
5083 if this.is_terminated {
5084 panic!("polled RealmQueryRequestStream after completion");
5085 }
5086 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5087 |bytes, handles| {
5088 match this.inner.channel().read_etc(cx, bytes, handles) {
5089 std::task::Poll::Ready(Ok(())) => {}
5090 std::task::Poll::Pending => return std::task::Poll::Pending,
5091 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5092 this.is_terminated = true;
5093 return std::task::Poll::Ready(None);
5094 }
5095 std::task::Poll::Ready(Err(e)) => {
5096 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5097 e.into(),
5098 ))))
5099 }
5100 }
5101
5102 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5104
5105 std::task::Poll::Ready(Some(match header.ordinal {
5106 0x3496ca1e5a0c13a8 => {
5107 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5108 let mut req = fidl::new_empty!(
5109 RealmQueryGetInstanceRequest,
5110 fidl::encoding::DefaultFuchsiaResourceDialect
5111 );
5112 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryGetInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
5113 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5114 Ok(RealmQueryRequest::GetInstance {
5115 moniker: req.moniker,
5116
5117 responder: RealmQueryGetInstanceResponder {
5118 control_handle: std::mem::ManuallyDrop::new(control_handle),
5119 tx_id: header.tx_id,
5120 },
5121 })
5122 }
5123 0x31a493d284a0bc1f => {
5124 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5125 let mut req = fidl::new_empty!(
5126 RealmQueryGetResolvedDeclarationRequest,
5127 fidl::encoding::DefaultFuchsiaResourceDialect
5128 );
5129 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryGetResolvedDeclarationRequest>(&header, _body_bytes, handles, &mut req)?;
5130 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5131 Ok(RealmQueryRequest::GetResolvedDeclaration {
5132 moniker: req.moniker,
5133
5134 responder: RealmQueryGetResolvedDeclarationResponder {
5135 control_handle: std::mem::ManuallyDrop::new(control_handle),
5136 tx_id: header.tx_id,
5137 },
5138 })
5139 }
5140 0x640769a9f88685c7 => {
5141 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5142 let mut req = fidl::new_empty!(
5143 RealmQueryGetManifestRequest,
5144 fidl::encoding::DefaultFuchsiaResourceDialect
5145 );
5146 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryGetManifestRequest>(&header, _body_bytes, handles, &mut req)?;
5147 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5148 Ok(RealmQueryRequest::GetManifest {
5149 moniker: req.moniker,
5150
5151 responder: RealmQueryGetManifestResponder {
5152 control_handle: std::mem::ManuallyDrop::new(control_handle),
5153 tx_id: header.tx_id,
5154 },
5155 })
5156 }
5157 0x1ab1adf2a87d962d => {
5158 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5159 let mut req = fidl::new_empty!(
5160 RealmQueryResolveDeclarationRequest,
5161 fidl::encoding::DefaultFuchsiaResourceDialect
5162 );
5163 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryResolveDeclarationRequest>(&header, _body_bytes, handles, &mut req)?;
5164 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5165 Ok(RealmQueryRequest::ResolveDeclaration {
5166 parent: req.parent,
5167 child_location: req.child_location,
5168 url: req.url,
5169
5170 responder: RealmQueryResolveDeclarationResponder {
5171 control_handle: std::mem::ManuallyDrop::new(control_handle),
5172 tx_id: header.tx_id,
5173 },
5174 })
5175 }
5176 0x16f88f6735bd204 => {
5177 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5178 let mut req = fidl::new_empty!(
5179 RealmQueryGetStructuredConfigRequest,
5180 fidl::encoding::DefaultFuchsiaResourceDialect
5181 );
5182 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryGetStructuredConfigRequest>(&header, _body_bytes, handles, &mut req)?;
5183 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5184 Ok(RealmQueryRequest::GetStructuredConfig {
5185 moniker: req.moniker,
5186
5187 responder: RealmQueryGetStructuredConfigResponder {
5188 control_handle: std::mem::ManuallyDrop::new(control_handle),
5189 tx_id: header.tx_id,
5190 },
5191 })
5192 }
5193 0x7b5a8775d30cad47 => {
5194 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5195 let mut req = fidl::new_empty!(
5196 fidl::encoding::EmptyPayload,
5197 fidl::encoding::DefaultFuchsiaResourceDialect
5198 );
5199 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5200 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5201 Ok(RealmQueryRequest::GetAllInstances {
5202 responder: RealmQueryGetAllInstancesResponder {
5203 control_handle: std::mem::ManuallyDrop::new(control_handle),
5204 tx_id: header.tx_id,
5205 },
5206 })
5207 }
5208 0x5ecb29c02c488eeb => {
5209 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5210 let mut req = fidl::new_empty!(
5211 RealmQueryConstructNamespaceRequest,
5212 fidl::encoding::DefaultFuchsiaResourceDialect
5213 );
5214 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryConstructNamespaceRequest>(&header, _body_bytes, handles, &mut req)?;
5215 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5216 Ok(RealmQueryRequest::ConstructNamespace {
5217 moniker: req.moniker,
5218
5219 responder: RealmQueryConstructNamespaceResponder {
5220 control_handle: std::mem::ManuallyDrop::new(control_handle),
5221 tx_id: header.tx_id,
5222 },
5223 })
5224 }
5225 0x333d68f1deecec85 => {
5226 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5227 let mut req = fidl::new_empty!(
5228 RealmQueryOpenDirectoryRequest,
5229 fidl::encoding::DefaultFuchsiaResourceDialect
5230 );
5231 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryOpenDirectoryRequest>(&header, _body_bytes, handles, &mut req)?;
5232 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5233 Ok(RealmQueryRequest::OpenDirectory {
5234 moniker: req.moniker,
5235 dir_type: req.dir_type,
5236 object: req.object,
5237
5238 responder: RealmQueryOpenDirectoryResponder {
5239 control_handle: std::mem::ManuallyDrop::new(control_handle),
5240 tx_id: header.tx_id,
5241 },
5242 })
5243 }
5244 0x7807e6b4f623ace => {
5245 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5246 let mut req = fidl::new_empty!(
5247 RealmQueryConnectToStorageAdminRequest,
5248 fidl::encoding::DefaultFuchsiaResourceDialect
5249 );
5250 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryConnectToStorageAdminRequest>(&header, _body_bytes, handles, &mut req)?;
5251 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5252 Ok(RealmQueryRequest::ConnectToStorageAdmin {
5253 moniker: req.moniker,
5254 storage_name: req.storage_name,
5255 server_end: req.server_end,
5256
5257 responder: RealmQueryConnectToStorageAdminResponder {
5258 control_handle: std::mem::ManuallyDrop::new(control_handle),
5259 tx_id: header.tx_id,
5260 },
5261 })
5262 }
5263 0x42a5517b78cf410 => {
5264 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5265 let mut req = fidl::new_empty!(
5266 RealmQueryDeprecatedOpenRequest,
5267 fidl::encoding::DefaultFuchsiaResourceDialect
5268 );
5269 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmQueryDeprecatedOpenRequest>(&header, _body_bytes, handles, &mut req)?;
5270 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
5271 Ok(RealmQueryRequest::DeprecatedOpen {
5272 moniker: req.moniker,
5273 dir_type: req.dir_type,
5274 flags: req.flags,
5275 mode: req.mode,
5276 path: req.path,
5277 object: req.object,
5278
5279 responder: RealmQueryDeprecatedOpenResponder {
5280 control_handle: std::mem::ManuallyDrop::new(control_handle),
5281 tx_id: header.tx_id,
5282 },
5283 })
5284 }
5285 _ => Err(fidl::Error::UnknownOrdinal {
5286 ordinal: header.ordinal,
5287 protocol_name:
5288 <RealmQueryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5289 }),
5290 }))
5291 },
5292 )
5293 }
5294}
5295
5296#[derive(Debug)]
5298pub enum RealmQueryRequest {
5299 GetInstance { moniker: String, responder: RealmQueryGetInstanceResponder },
5301 GetResolvedDeclaration { moniker: String, responder: RealmQueryGetResolvedDeclarationResponder },
5308 GetManifest { moniker: String, responder: RealmQueryGetManifestResponder },
5310 ResolveDeclaration {
5318 parent: String,
5319 child_location: ChildLocation,
5320 url: String,
5321 responder: RealmQueryResolveDeclarationResponder,
5322 },
5323 GetStructuredConfig { moniker: String, responder: RealmQueryGetStructuredConfigResponder },
5325 GetAllInstances { responder: RealmQueryGetAllInstancesResponder },
5329 ConstructNamespace { moniker: String, responder: RealmQueryConstructNamespaceResponder },
5334 OpenDirectory {
5336 moniker: String,
5337 dir_type: OpenDirType,
5338 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5339 responder: RealmQueryOpenDirectoryResponder,
5340 },
5341 ConnectToStorageAdmin {
5343 moniker: String,
5344 storage_name: String,
5345 server_end: fidl::endpoints::ServerEnd<StorageAdminMarker>,
5346 responder: RealmQueryConnectToStorageAdminResponder,
5347 },
5348 DeprecatedOpen {
5352 moniker: String,
5353 dir_type: OpenDirType,
5354 flags: fidl_fuchsia_io::OpenFlags,
5355 mode: fidl_fuchsia_io::ModeType,
5356 path: String,
5357 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
5358 responder: RealmQueryDeprecatedOpenResponder,
5359 },
5360}
5361
5362impl RealmQueryRequest {
5363 #[allow(irrefutable_let_patterns)]
5364 pub fn into_get_instance(self) -> Option<(String, RealmQueryGetInstanceResponder)> {
5365 if let RealmQueryRequest::GetInstance { moniker, responder } = self {
5366 Some((moniker, responder))
5367 } else {
5368 None
5369 }
5370 }
5371
5372 #[allow(irrefutable_let_patterns)]
5373 pub fn into_get_resolved_declaration(
5374 self,
5375 ) -> Option<(String, RealmQueryGetResolvedDeclarationResponder)> {
5376 if let RealmQueryRequest::GetResolvedDeclaration { moniker, responder } = self {
5377 Some((moniker, responder))
5378 } else {
5379 None
5380 }
5381 }
5382
5383 #[allow(irrefutable_let_patterns)]
5384 pub fn into_get_manifest(self) -> Option<(String, RealmQueryGetManifestResponder)> {
5385 if let RealmQueryRequest::GetManifest { moniker, responder } = self {
5386 Some((moniker, responder))
5387 } else {
5388 None
5389 }
5390 }
5391
5392 #[allow(irrefutable_let_patterns)]
5393 pub fn into_resolve_declaration(
5394 self,
5395 ) -> Option<(String, ChildLocation, String, RealmQueryResolveDeclarationResponder)> {
5396 if let RealmQueryRequest::ResolveDeclaration { parent, child_location, url, responder } =
5397 self
5398 {
5399 Some((parent, child_location, url, responder))
5400 } else {
5401 None
5402 }
5403 }
5404
5405 #[allow(irrefutable_let_patterns)]
5406 pub fn into_get_structured_config(
5407 self,
5408 ) -> Option<(String, RealmQueryGetStructuredConfigResponder)> {
5409 if let RealmQueryRequest::GetStructuredConfig { moniker, responder } = self {
5410 Some((moniker, responder))
5411 } else {
5412 None
5413 }
5414 }
5415
5416 #[allow(irrefutable_let_patterns)]
5417 pub fn into_get_all_instances(self) -> Option<(RealmQueryGetAllInstancesResponder)> {
5418 if let RealmQueryRequest::GetAllInstances { responder } = self {
5419 Some((responder))
5420 } else {
5421 None
5422 }
5423 }
5424
5425 #[allow(irrefutable_let_patterns)]
5426 pub fn into_construct_namespace(
5427 self,
5428 ) -> Option<(String, RealmQueryConstructNamespaceResponder)> {
5429 if let RealmQueryRequest::ConstructNamespace { moniker, responder } = self {
5430 Some((moniker, responder))
5431 } else {
5432 None
5433 }
5434 }
5435
5436 #[allow(irrefutable_let_patterns)]
5437 pub fn into_open_directory(
5438 self,
5439 ) -> Option<(
5440 String,
5441 OpenDirType,
5442 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5443 RealmQueryOpenDirectoryResponder,
5444 )> {
5445 if let RealmQueryRequest::OpenDirectory { moniker, dir_type, object, responder } = self {
5446 Some((moniker, dir_type, object, responder))
5447 } else {
5448 None
5449 }
5450 }
5451
5452 #[allow(irrefutable_let_patterns)]
5453 pub fn into_connect_to_storage_admin(
5454 self,
5455 ) -> Option<(
5456 String,
5457 String,
5458 fidl::endpoints::ServerEnd<StorageAdminMarker>,
5459 RealmQueryConnectToStorageAdminResponder,
5460 )> {
5461 if let RealmQueryRequest::ConnectToStorageAdmin {
5462 moniker,
5463 storage_name,
5464 server_end,
5465 responder,
5466 } = self
5467 {
5468 Some((moniker, storage_name, server_end, responder))
5469 } else {
5470 None
5471 }
5472 }
5473
5474 #[allow(irrefutable_let_patterns)]
5475 pub fn into_deprecated_open(
5476 self,
5477 ) -> Option<(
5478 String,
5479 OpenDirType,
5480 fidl_fuchsia_io::OpenFlags,
5481 fidl_fuchsia_io::ModeType,
5482 String,
5483 fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
5484 RealmQueryDeprecatedOpenResponder,
5485 )> {
5486 if let RealmQueryRequest::DeprecatedOpen {
5487 moniker,
5488 dir_type,
5489 flags,
5490 mode,
5491 path,
5492 object,
5493 responder,
5494 } = self
5495 {
5496 Some((moniker, dir_type, flags, mode, path, object, responder))
5497 } else {
5498 None
5499 }
5500 }
5501
5502 pub fn method_name(&self) -> &'static str {
5504 match *self {
5505 RealmQueryRequest::GetInstance { .. } => "get_instance",
5506 RealmQueryRequest::GetResolvedDeclaration { .. } => "get_resolved_declaration",
5507 RealmQueryRequest::GetManifest { .. } => "get_manifest",
5508 RealmQueryRequest::ResolveDeclaration { .. } => "resolve_declaration",
5509 RealmQueryRequest::GetStructuredConfig { .. } => "get_structured_config",
5510 RealmQueryRequest::GetAllInstances { .. } => "get_all_instances",
5511 RealmQueryRequest::ConstructNamespace { .. } => "construct_namespace",
5512 RealmQueryRequest::OpenDirectory { .. } => "open_directory",
5513 RealmQueryRequest::ConnectToStorageAdmin { .. } => "connect_to_storage_admin",
5514 RealmQueryRequest::DeprecatedOpen { .. } => "deprecated_open",
5515 }
5516 }
5517}
5518
5519#[derive(Debug, Clone)]
5520pub struct RealmQueryControlHandle {
5521 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5522}
5523
5524impl fidl::endpoints::ControlHandle for RealmQueryControlHandle {
5525 fn shutdown(&self) {
5526 self.inner.shutdown()
5527 }
5528 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5529 self.inner.shutdown_with_epitaph(status)
5530 }
5531
5532 fn is_closed(&self) -> bool {
5533 self.inner.channel().is_closed()
5534 }
5535 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5536 self.inner.channel().on_closed()
5537 }
5538
5539 #[cfg(target_os = "fuchsia")]
5540 fn signal_peer(
5541 &self,
5542 clear_mask: zx::Signals,
5543 set_mask: zx::Signals,
5544 ) -> Result<(), zx_status::Status> {
5545 use fidl::Peered;
5546 self.inner.channel().signal_peer(clear_mask, set_mask)
5547 }
5548}
5549
5550impl RealmQueryControlHandle {}
5551
5552#[must_use = "FIDL methods require a response to be sent"]
5553#[derive(Debug)]
5554pub struct RealmQueryGetInstanceResponder {
5555 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5556 tx_id: u32,
5557}
5558
5559impl std::ops::Drop for RealmQueryGetInstanceResponder {
5563 fn drop(&mut self) {
5564 self.control_handle.shutdown();
5565 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5567 }
5568}
5569
5570impl fidl::endpoints::Responder for RealmQueryGetInstanceResponder {
5571 type ControlHandle = RealmQueryControlHandle;
5572
5573 fn control_handle(&self) -> &RealmQueryControlHandle {
5574 &self.control_handle
5575 }
5576
5577 fn drop_without_shutdown(mut self) {
5578 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5580 std::mem::forget(self);
5582 }
5583}
5584
5585impl RealmQueryGetInstanceResponder {
5586 pub fn send(self, mut result: Result<&Instance, GetInstanceError>) -> Result<(), fidl::Error> {
5590 let _result = self.send_raw(result);
5591 if _result.is_err() {
5592 self.control_handle.shutdown();
5593 }
5594 self.drop_without_shutdown();
5595 _result
5596 }
5597
5598 pub fn send_no_shutdown_on_err(
5600 self,
5601 mut result: Result<&Instance, GetInstanceError>,
5602 ) -> Result<(), fidl::Error> {
5603 let _result = self.send_raw(result);
5604 self.drop_without_shutdown();
5605 _result
5606 }
5607
5608 fn send_raw(&self, mut result: Result<&Instance, GetInstanceError>) -> Result<(), fidl::Error> {
5609 self.control_handle.inner.send::<fidl::encoding::ResultType<
5610 RealmQueryGetInstanceResponse,
5611 GetInstanceError,
5612 >>(
5613 result.map(|instance| (instance,)),
5614 self.tx_id,
5615 0x3496ca1e5a0c13a8,
5616 fidl::encoding::DynamicFlags::empty(),
5617 )
5618 }
5619}
5620
5621#[must_use = "FIDL methods require a response to be sent"]
5622#[derive(Debug)]
5623pub struct RealmQueryGetResolvedDeclarationResponder {
5624 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5625 tx_id: u32,
5626}
5627
5628impl std::ops::Drop for RealmQueryGetResolvedDeclarationResponder {
5632 fn drop(&mut self) {
5633 self.control_handle.shutdown();
5634 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5636 }
5637}
5638
5639impl fidl::endpoints::Responder for RealmQueryGetResolvedDeclarationResponder {
5640 type ControlHandle = RealmQueryControlHandle;
5641
5642 fn control_handle(&self) -> &RealmQueryControlHandle {
5643 &self.control_handle
5644 }
5645
5646 fn drop_without_shutdown(mut self) {
5647 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5649 std::mem::forget(self);
5651 }
5652}
5653
5654impl RealmQueryGetResolvedDeclarationResponder {
5655 pub fn send(
5659 self,
5660 mut result: Result<
5661 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
5662 GetDeclarationError,
5663 >,
5664 ) -> Result<(), fidl::Error> {
5665 let _result = self.send_raw(result);
5666 if _result.is_err() {
5667 self.control_handle.shutdown();
5668 }
5669 self.drop_without_shutdown();
5670 _result
5671 }
5672
5673 pub fn send_no_shutdown_on_err(
5675 self,
5676 mut result: Result<
5677 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
5678 GetDeclarationError,
5679 >,
5680 ) -> Result<(), fidl::Error> {
5681 let _result = self.send_raw(result);
5682 self.drop_without_shutdown();
5683 _result
5684 }
5685
5686 fn send_raw(
5687 &self,
5688 mut result: Result<
5689 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
5690 GetDeclarationError,
5691 >,
5692 ) -> Result<(), fidl::Error> {
5693 self.control_handle.inner.send::<fidl::encoding::ResultType<
5694 RealmQueryGetResolvedDeclarationResponse,
5695 GetDeclarationError,
5696 >>(
5697 result.map(|iterator| (iterator,)),
5698 self.tx_id,
5699 0x31a493d284a0bc1f,
5700 fidl::encoding::DynamicFlags::empty(),
5701 )
5702 }
5703}
5704
5705#[must_use = "FIDL methods require a response to be sent"]
5706#[derive(Debug)]
5707pub struct RealmQueryGetManifestResponder {
5708 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5709 tx_id: u32,
5710}
5711
5712impl std::ops::Drop for RealmQueryGetManifestResponder {
5716 fn drop(&mut self) {
5717 self.control_handle.shutdown();
5718 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5720 }
5721}
5722
5723impl fidl::endpoints::Responder for RealmQueryGetManifestResponder {
5724 type ControlHandle = RealmQueryControlHandle;
5725
5726 fn control_handle(&self) -> &RealmQueryControlHandle {
5727 &self.control_handle
5728 }
5729
5730 fn drop_without_shutdown(mut self) {
5731 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5733 std::mem::forget(self);
5735 }
5736}
5737
5738impl RealmQueryGetManifestResponder {
5739 pub fn send(
5743 self,
5744 mut result: Result<
5745 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
5746 GetDeclarationError,
5747 >,
5748 ) -> Result<(), fidl::Error> {
5749 let _result = self.send_raw(result);
5750 if _result.is_err() {
5751 self.control_handle.shutdown();
5752 }
5753 self.drop_without_shutdown();
5754 _result
5755 }
5756
5757 pub fn send_no_shutdown_on_err(
5759 self,
5760 mut result: Result<
5761 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
5762 GetDeclarationError,
5763 >,
5764 ) -> Result<(), fidl::Error> {
5765 let _result = self.send_raw(result);
5766 self.drop_without_shutdown();
5767 _result
5768 }
5769
5770 fn send_raw(
5771 &self,
5772 mut result: Result<
5773 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
5774 GetDeclarationError,
5775 >,
5776 ) -> Result<(), fidl::Error> {
5777 self.control_handle.inner.send::<fidl::encoding::ResultType<
5778 RealmQueryGetManifestResponse,
5779 GetDeclarationError,
5780 >>(
5781 result.map(|iterator| (iterator,)),
5782 self.tx_id,
5783 0x640769a9f88685c7,
5784 fidl::encoding::DynamicFlags::empty(),
5785 )
5786 }
5787}
5788
5789#[must_use = "FIDL methods require a response to be sent"]
5790#[derive(Debug)]
5791pub struct RealmQueryResolveDeclarationResponder {
5792 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5793 tx_id: u32,
5794}
5795
5796impl std::ops::Drop for RealmQueryResolveDeclarationResponder {
5800 fn drop(&mut self) {
5801 self.control_handle.shutdown();
5802 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5804 }
5805}
5806
5807impl fidl::endpoints::Responder for RealmQueryResolveDeclarationResponder {
5808 type ControlHandle = RealmQueryControlHandle;
5809
5810 fn control_handle(&self) -> &RealmQueryControlHandle {
5811 &self.control_handle
5812 }
5813
5814 fn drop_without_shutdown(mut self) {
5815 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5817 std::mem::forget(self);
5819 }
5820}
5821
5822impl RealmQueryResolveDeclarationResponder {
5823 pub fn send(
5827 self,
5828 mut result: Result<
5829 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
5830 GetDeclarationError,
5831 >,
5832 ) -> Result<(), fidl::Error> {
5833 let _result = self.send_raw(result);
5834 if _result.is_err() {
5835 self.control_handle.shutdown();
5836 }
5837 self.drop_without_shutdown();
5838 _result
5839 }
5840
5841 pub fn send_no_shutdown_on_err(
5843 self,
5844 mut result: Result<
5845 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
5846 GetDeclarationError,
5847 >,
5848 ) -> Result<(), fidl::Error> {
5849 let _result = self.send_raw(result);
5850 self.drop_without_shutdown();
5851 _result
5852 }
5853
5854 fn send_raw(
5855 &self,
5856 mut result: Result<
5857 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
5858 GetDeclarationError,
5859 >,
5860 ) -> Result<(), fidl::Error> {
5861 self.control_handle.inner.send::<fidl::encoding::ResultType<
5862 RealmQueryResolveDeclarationResponse,
5863 GetDeclarationError,
5864 >>(
5865 result.map(|iterator| (iterator,)),
5866 self.tx_id,
5867 0x1ab1adf2a87d962d,
5868 fidl::encoding::DynamicFlags::empty(),
5869 )
5870 }
5871}
5872
5873#[must_use = "FIDL methods require a response to be sent"]
5874#[derive(Debug)]
5875pub struct RealmQueryGetStructuredConfigResponder {
5876 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5877 tx_id: u32,
5878}
5879
5880impl std::ops::Drop for RealmQueryGetStructuredConfigResponder {
5884 fn drop(&mut self) {
5885 self.control_handle.shutdown();
5886 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5888 }
5889}
5890
5891impl fidl::endpoints::Responder for RealmQueryGetStructuredConfigResponder {
5892 type ControlHandle = RealmQueryControlHandle;
5893
5894 fn control_handle(&self) -> &RealmQueryControlHandle {
5895 &self.control_handle
5896 }
5897
5898 fn drop_without_shutdown(mut self) {
5899 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5901 std::mem::forget(self);
5903 }
5904}
5905
5906impl RealmQueryGetStructuredConfigResponder {
5907 pub fn send(
5911 self,
5912 mut result: Result<&fidl_fuchsia_component_decl::ResolvedConfig, GetStructuredConfigError>,
5913 ) -> Result<(), fidl::Error> {
5914 let _result = self.send_raw(result);
5915 if _result.is_err() {
5916 self.control_handle.shutdown();
5917 }
5918 self.drop_without_shutdown();
5919 _result
5920 }
5921
5922 pub fn send_no_shutdown_on_err(
5924 self,
5925 mut result: Result<&fidl_fuchsia_component_decl::ResolvedConfig, GetStructuredConfigError>,
5926 ) -> Result<(), fidl::Error> {
5927 let _result = self.send_raw(result);
5928 self.drop_without_shutdown();
5929 _result
5930 }
5931
5932 fn send_raw(
5933 &self,
5934 mut result: Result<&fidl_fuchsia_component_decl::ResolvedConfig, GetStructuredConfigError>,
5935 ) -> Result<(), fidl::Error> {
5936 self.control_handle.inner.send::<fidl::encoding::ResultType<
5937 RealmQueryGetStructuredConfigResponse,
5938 GetStructuredConfigError,
5939 >>(
5940 result.map(|config| (config,)),
5941 self.tx_id,
5942 0x16f88f6735bd204,
5943 fidl::encoding::DynamicFlags::empty(),
5944 )
5945 }
5946}
5947
5948#[must_use = "FIDL methods require a response to be sent"]
5949#[derive(Debug)]
5950pub struct RealmQueryGetAllInstancesResponder {
5951 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5952 tx_id: u32,
5953}
5954
5955impl std::ops::Drop for RealmQueryGetAllInstancesResponder {
5959 fn drop(&mut self) {
5960 self.control_handle.shutdown();
5961 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5963 }
5964}
5965
5966impl fidl::endpoints::Responder for RealmQueryGetAllInstancesResponder {
5967 type ControlHandle = RealmQueryControlHandle;
5968
5969 fn control_handle(&self) -> &RealmQueryControlHandle {
5970 &self.control_handle
5971 }
5972
5973 fn drop_without_shutdown(mut self) {
5974 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5976 std::mem::forget(self);
5978 }
5979}
5980
5981impl RealmQueryGetAllInstancesResponder {
5982 pub fn send(
5986 self,
5987 mut result: Result<
5988 fidl::endpoints::ClientEnd<InstanceIteratorMarker>,
5989 GetAllInstancesError,
5990 >,
5991 ) -> Result<(), fidl::Error> {
5992 let _result = self.send_raw(result);
5993 if _result.is_err() {
5994 self.control_handle.shutdown();
5995 }
5996 self.drop_without_shutdown();
5997 _result
5998 }
5999
6000 pub fn send_no_shutdown_on_err(
6002 self,
6003 mut result: Result<
6004 fidl::endpoints::ClientEnd<InstanceIteratorMarker>,
6005 GetAllInstancesError,
6006 >,
6007 ) -> Result<(), fidl::Error> {
6008 let _result = self.send_raw(result);
6009 self.drop_without_shutdown();
6010 _result
6011 }
6012
6013 fn send_raw(
6014 &self,
6015 mut result: Result<
6016 fidl::endpoints::ClientEnd<InstanceIteratorMarker>,
6017 GetAllInstancesError,
6018 >,
6019 ) -> Result<(), fidl::Error> {
6020 self.control_handle.inner.send::<fidl::encoding::ResultType<
6021 RealmQueryGetAllInstancesResponse,
6022 GetAllInstancesError,
6023 >>(
6024 result.map(|iterator| (iterator,)),
6025 self.tx_id,
6026 0x7b5a8775d30cad47,
6027 fidl::encoding::DynamicFlags::empty(),
6028 )
6029 }
6030}
6031
6032#[must_use = "FIDL methods require a response to be sent"]
6033#[derive(Debug)]
6034pub struct RealmQueryConstructNamespaceResponder {
6035 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
6036 tx_id: u32,
6037}
6038
6039impl std::ops::Drop for RealmQueryConstructNamespaceResponder {
6043 fn drop(&mut self) {
6044 self.control_handle.shutdown();
6045 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6047 }
6048}
6049
6050impl fidl::endpoints::Responder for RealmQueryConstructNamespaceResponder {
6051 type ControlHandle = RealmQueryControlHandle;
6052
6053 fn control_handle(&self) -> &RealmQueryControlHandle {
6054 &self.control_handle
6055 }
6056
6057 fn drop_without_shutdown(mut self) {
6058 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6060 std::mem::forget(self);
6062 }
6063}
6064
6065impl RealmQueryConstructNamespaceResponder {
6066 pub fn send(
6070 self,
6071 mut result: Result<
6072 Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>,
6073 ConstructNamespaceError,
6074 >,
6075 ) -> Result<(), fidl::Error> {
6076 let _result = self.send_raw(result);
6077 if _result.is_err() {
6078 self.control_handle.shutdown();
6079 }
6080 self.drop_without_shutdown();
6081 _result
6082 }
6083
6084 pub fn send_no_shutdown_on_err(
6086 self,
6087 mut result: Result<
6088 Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>,
6089 ConstructNamespaceError,
6090 >,
6091 ) -> Result<(), fidl::Error> {
6092 let _result = self.send_raw(result);
6093 self.drop_without_shutdown();
6094 _result
6095 }
6096
6097 fn send_raw(
6098 &self,
6099 mut result: Result<
6100 Vec<fidl_fuchsia_component_runner::ComponentNamespaceEntry>,
6101 ConstructNamespaceError,
6102 >,
6103 ) -> Result<(), fidl::Error> {
6104 self.control_handle.inner.send::<fidl::encoding::ResultType<
6105 RealmQueryConstructNamespaceResponse,
6106 ConstructNamespaceError,
6107 >>(
6108 result.as_mut().map_err(|e| *e).map(|namespace| (namespace.as_mut_slice(),)),
6109 self.tx_id,
6110 0x5ecb29c02c488eeb,
6111 fidl::encoding::DynamicFlags::empty(),
6112 )
6113 }
6114}
6115
6116#[must_use = "FIDL methods require a response to be sent"]
6117#[derive(Debug)]
6118pub struct RealmQueryOpenDirectoryResponder {
6119 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
6120 tx_id: u32,
6121}
6122
6123impl std::ops::Drop for RealmQueryOpenDirectoryResponder {
6127 fn drop(&mut self) {
6128 self.control_handle.shutdown();
6129 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6131 }
6132}
6133
6134impl fidl::endpoints::Responder for RealmQueryOpenDirectoryResponder {
6135 type ControlHandle = RealmQueryControlHandle;
6136
6137 fn control_handle(&self) -> &RealmQueryControlHandle {
6138 &self.control_handle
6139 }
6140
6141 fn drop_without_shutdown(mut self) {
6142 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6144 std::mem::forget(self);
6146 }
6147}
6148
6149impl RealmQueryOpenDirectoryResponder {
6150 pub fn send(self, mut result: Result<(), OpenError>) -> Result<(), fidl::Error> {
6154 let _result = self.send_raw(result);
6155 if _result.is_err() {
6156 self.control_handle.shutdown();
6157 }
6158 self.drop_without_shutdown();
6159 _result
6160 }
6161
6162 pub fn send_no_shutdown_on_err(
6164 self,
6165 mut result: Result<(), OpenError>,
6166 ) -> Result<(), fidl::Error> {
6167 let _result = self.send_raw(result);
6168 self.drop_without_shutdown();
6169 _result
6170 }
6171
6172 fn send_raw(&self, mut result: Result<(), OpenError>) -> Result<(), fidl::Error> {
6173 self.control_handle
6174 .inner
6175 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>>(
6176 result,
6177 self.tx_id,
6178 0x333d68f1deecec85,
6179 fidl::encoding::DynamicFlags::empty(),
6180 )
6181 }
6182}
6183
6184#[must_use = "FIDL methods require a response to be sent"]
6185#[derive(Debug)]
6186pub struct RealmQueryConnectToStorageAdminResponder {
6187 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
6188 tx_id: u32,
6189}
6190
6191impl std::ops::Drop for RealmQueryConnectToStorageAdminResponder {
6195 fn drop(&mut self) {
6196 self.control_handle.shutdown();
6197 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6199 }
6200}
6201
6202impl fidl::endpoints::Responder for RealmQueryConnectToStorageAdminResponder {
6203 type ControlHandle = RealmQueryControlHandle;
6204
6205 fn control_handle(&self) -> &RealmQueryControlHandle {
6206 &self.control_handle
6207 }
6208
6209 fn drop_without_shutdown(mut self) {
6210 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6212 std::mem::forget(self);
6214 }
6215}
6216
6217impl RealmQueryConnectToStorageAdminResponder {
6218 pub fn send(
6222 self,
6223 mut result: Result<(), ConnectToStorageAdminError>,
6224 ) -> Result<(), fidl::Error> {
6225 let _result = self.send_raw(result);
6226 if _result.is_err() {
6227 self.control_handle.shutdown();
6228 }
6229 self.drop_without_shutdown();
6230 _result
6231 }
6232
6233 pub fn send_no_shutdown_on_err(
6235 self,
6236 mut result: Result<(), ConnectToStorageAdminError>,
6237 ) -> Result<(), fidl::Error> {
6238 let _result = self.send_raw(result);
6239 self.drop_without_shutdown();
6240 _result
6241 }
6242
6243 fn send_raw(
6244 &self,
6245 mut result: Result<(), ConnectToStorageAdminError>,
6246 ) -> Result<(), fidl::Error> {
6247 self.control_handle.inner.send::<fidl::encoding::ResultType<
6248 fidl::encoding::EmptyStruct,
6249 ConnectToStorageAdminError,
6250 >>(
6251 result,
6252 self.tx_id,
6253 0x7807e6b4f623ace,
6254 fidl::encoding::DynamicFlags::empty(),
6255 )
6256 }
6257}
6258
6259#[must_use = "FIDL methods require a response to be sent"]
6260#[derive(Debug)]
6261pub struct RealmQueryDeprecatedOpenResponder {
6262 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
6263 tx_id: u32,
6264}
6265
6266impl std::ops::Drop for RealmQueryDeprecatedOpenResponder {
6270 fn drop(&mut self) {
6271 self.control_handle.shutdown();
6272 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6274 }
6275}
6276
6277impl fidl::endpoints::Responder for RealmQueryDeprecatedOpenResponder {
6278 type ControlHandle = RealmQueryControlHandle;
6279
6280 fn control_handle(&self) -> &RealmQueryControlHandle {
6281 &self.control_handle
6282 }
6283
6284 fn drop_without_shutdown(mut self) {
6285 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6287 std::mem::forget(self);
6289 }
6290}
6291
6292impl RealmQueryDeprecatedOpenResponder {
6293 pub fn send(self, mut result: Result<(), OpenError>) -> Result<(), fidl::Error> {
6297 let _result = self.send_raw(result);
6298 if _result.is_err() {
6299 self.control_handle.shutdown();
6300 }
6301 self.drop_without_shutdown();
6302 _result
6303 }
6304
6305 pub fn send_no_shutdown_on_err(
6307 self,
6308 mut result: Result<(), OpenError>,
6309 ) -> Result<(), fidl::Error> {
6310 let _result = self.send_raw(result);
6311 self.drop_without_shutdown();
6312 _result
6313 }
6314
6315 fn send_raw(&self, mut result: Result<(), OpenError>) -> Result<(), fidl::Error> {
6316 self.control_handle
6317 .inner
6318 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>>(
6319 result,
6320 self.tx_id,
6321 0x42a5517b78cf410,
6322 fidl::encoding::DynamicFlags::empty(),
6323 )
6324 }
6325}
6326
6327#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6328pub struct RouteValidatorMarker;
6329
6330impl fidl::endpoints::ProtocolMarker for RouteValidatorMarker {
6331 type Proxy = RouteValidatorProxy;
6332 type RequestStream = RouteValidatorRequestStream;
6333 #[cfg(target_os = "fuchsia")]
6334 type SynchronousProxy = RouteValidatorSynchronousProxy;
6335
6336 const DEBUG_NAME: &'static str = "fuchsia.sys2.RouteValidator";
6337}
6338impl fidl::endpoints::DiscoverableProtocolMarker for RouteValidatorMarker {}
6339pub type RouteValidatorValidateResult = Result<Vec<RouteReport>, fidl_fuchsia_component::Error>;
6340pub type RouteValidatorRouteResult = Result<Vec<RouteReport>, RouteValidatorError>;
6341
6342pub trait RouteValidatorProxyInterface: Send + Sync {
6343 type ValidateResponseFut: std::future::Future<Output = Result<RouteValidatorValidateResult, fidl::Error>>
6344 + Send;
6345 fn r#validate(&self, moniker: &str) -> Self::ValidateResponseFut;
6346 type RouteResponseFut: std::future::Future<Output = Result<RouteValidatorRouteResult, fidl::Error>>
6347 + Send;
6348 fn r#route(&self, moniker: &str, targets: &[RouteTarget]) -> Self::RouteResponseFut;
6349}
6350#[derive(Debug)]
6351#[cfg(target_os = "fuchsia")]
6352pub struct RouteValidatorSynchronousProxy {
6353 client: fidl::client::sync::Client,
6354}
6355
6356#[cfg(target_os = "fuchsia")]
6357impl fidl::endpoints::SynchronousProxy for RouteValidatorSynchronousProxy {
6358 type Proxy = RouteValidatorProxy;
6359 type Protocol = RouteValidatorMarker;
6360
6361 fn from_channel(inner: fidl::Channel) -> Self {
6362 Self::new(inner)
6363 }
6364
6365 fn into_channel(self) -> fidl::Channel {
6366 self.client.into_channel()
6367 }
6368
6369 fn as_channel(&self) -> &fidl::Channel {
6370 self.client.as_channel()
6371 }
6372}
6373
6374#[cfg(target_os = "fuchsia")]
6375impl RouteValidatorSynchronousProxy {
6376 pub fn new(channel: fidl::Channel) -> Self {
6377 let protocol_name = <RouteValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6378 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6379 }
6380
6381 pub fn into_channel(self) -> fidl::Channel {
6382 self.client.into_channel()
6383 }
6384
6385 pub fn wait_for_event(
6388 &self,
6389 deadline: zx::MonotonicInstant,
6390 ) -> Result<RouteValidatorEvent, fidl::Error> {
6391 RouteValidatorEvent::decode(self.client.wait_for_event(deadline)?)
6392 }
6393
6394 pub fn r#validate(
6402 &self,
6403 mut moniker: &str,
6404 ___deadline: zx::MonotonicInstant,
6405 ) -> Result<RouteValidatorValidateResult, fidl::Error> {
6406 let _response =
6407 self.client.send_query::<RouteValidatorValidateRequest, fidl::encoding::ResultType<
6408 RouteValidatorValidateResponse,
6409 fidl_fuchsia_component::Error,
6410 >>(
6411 (moniker,),
6412 0x3360b96d5f86cdf4,
6413 fidl::encoding::DynamicFlags::empty(),
6414 ___deadline,
6415 )?;
6416 Ok(_response.map(|x| x.reports))
6417 }
6418
6419 pub fn r#route(
6435 &self,
6436 mut moniker: &str,
6437 mut targets: &[RouteTarget],
6438 ___deadline: zx::MonotonicInstant,
6439 ) -> Result<RouteValidatorRouteResult, fidl::Error> {
6440 let _response =
6441 self.client.send_query::<RouteValidatorRouteRequest, fidl::encoding::ResultType<
6442 RouteValidatorRouteResponse,
6443 RouteValidatorError,
6444 >>(
6445 (moniker, targets),
6446 0x51c9b268216d8239,
6447 fidl::encoding::DynamicFlags::empty(),
6448 ___deadline,
6449 )?;
6450 Ok(_response.map(|x| x.reports))
6451 }
6452}
6453
6454#[cfg(target_os = "fuchsia")]
6455impl From<RouteValidatorSynchronousProxy> for zx::Handle {
6456 fn from(value: RouteValidatorSynchronousProxy) -> Self {
6457 value.into_channel().into()
6458 }
6459}
6460
6461#[cfg(target_os = "fuchsia")]
6462impl From<fidl::Channel> for RouteValidatorSynchronousProxy {
6463 fn from(value: fidl::Channel) -> Self {
6464 Self::new(value)
6465 }
6466}
6467
6468#[derive(Debug, Clone)]
6469pub struct RouteValidatorProxy {
6470 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6471}
6472
6473impl fidl::endpoints::Proxy for RouteValidatorProxy {
6474 type Protocol = RouteValidatorMarker;
6475
6476 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6477 Self::new(inner)
6478 }
6479
6480 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6481 self.client.into_channel().map_err(|client| Self { client })
6482 }
6483
6484 fn as_channel(&self) -> &::fidl::AsyncChannel {
6485 self.client.as_channel()
6486 }
6487}
6488
6489impl RouteValidatorProxy {
6490 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6492 let protocol_name = <RouteValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6493 Self { client: fidl::client::Client::new(channel, protocol_name) }
6494 }
6495
6496 pub fn take_event_stream(&self) -> RouteValidatorEventStream {
6502 RouteValidatorEventStream { event_receiver: self.client.take_event_receiver() }
6503 }
6504
6505 pub fn r#validate(
6513 &self,
6514 mut moniker: &str,
6515 ) -> fidl::client::QueryResponseFut<
6516 RouteValidatorValidateResult,
6517 fidl::encoding::DefaultFuchsiaResourceDialect,
6518 > {
6519 RouteValidatorProxyInterface::r#validate(self, moniker)
6520 }
6521
6522 pub fn r#route(
6538 &self,
6539 mut moniker: &str,
6540 mut targets: &[RouteTarget],
6541 ) -> fidl::client::QueryResponseFut<
6542 RouteValidatorRouteResult,
6543 fidl::encoding::DefaultFuchsiaResourceDialect,
6544 > {
6545 RouteValidatorProxyInterface::r#route(self, moniker, targets)
6546 }
6547}
6548
6549impl RouteValidatorProxyInterface for RouteValidatorProxy {
6550 type ValidateResponseFut = fidl::client::QueryResponseFut<
6551 RouteValidatorValidateResult,
6552 fidl::encoding::DefaultFuchsiaResourceDialect,
6553 >;
6554 fn r#validate(&self, mut moniker: &str) -> Self::ValidateResponseFut {
6555 fn _decode(
6556 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6557 ) -> Result<RouteValidatorValidateResult, fidl::Error> {
6558 let _response = fidl::client::decode_transaction_body::<
6559 fidl::encoding::ResultType<
6560 RouteValidatorValidateResponse,
6561 fidl_fuchsia_component::Error,
6562 >,
6563 fidl::encoding::DefaultFuchsiaResourceDialect,
6564 0x3360b96d5f86cdf4,
6565 >(_buf?)?;
6566 Ok(_response.map(|x| x.reports))
6567 }
6568 self.client
6569 .send_query_and_decode::<RouteValidatorValidateRequest, RouteValidatorValidateResult>(
6570 (moniker,),
6571 0x3360b96d5f86cdf4,
6572 fidl::encoding::DynamicFlags::empty(),
6573 _decode,
6574 )
6575 }
6576
6577 type RouteResponseFut = fidl::client::QueryResponseFut<
6578 RouteValidatorRouteResult,
6579 fidl::encoding::DefaultFuchsiaResourceDialect,
6580 >;
6581 fn r#route(&self, mut moniker: &str, mut targets: &[RouteTarget]) -> Self::RouteResponseFut {
6582 fn _decode(
6583 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6584 ) -> Result<RouteValidatorRouteResult, fidl::Error> {
6585 let _response = fidl::client::decode_transaction_body::<
6586 fidl::encoding::ResultType<RouteValidatorRouteResponse, RouteValidatorError>,
6587 fidl::encoding::DefaultFuchsiaResourceDialect,
6588 0x51c9b268216d8239,
6589 >(_buf?)?;
6590 Ok(_response.map(|x| x.reports))
6591 }
6592 self.client.send_query_and_decode::<RouteValidatorRouteRequest, RouteValidatorRouteResult>(
6593 (moniker, targets),
6594 0x51c9b268216d8239,
6595 fidl::encoding::DynamicFlags::empty(),
6596 _decode,
6597 )
6598 }
6599}
6600
6601pub struct RouteValidatorEventStream {
6602 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6603}
6604
6605impl std::marker::Unpin for RouteValidatorEventStream {}
6606
6607impl futures::stream::FusedStream for RouteValidatorEventStream {
6608 fn is_terminated(&self) -> bool {
6609 self.event_receiver.is_terminated()
6610 }
6611}
6612
6613impl futures::Stream for RouteValidatorEventStream {
6614 type Item = Result<RouteValidatorEvent, fidl::Error>;
6615
6616 fn poll_next(
6617 mut self: std::pin::Pin<&mut Self>,
6618 cx: &mut std::task::Context<'_>,
6619 ) -> std::task::Poll<Option<Self::Item>> {
6620 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6621 &mut self.event_receiver,
6622 cx
6623 )?) {
6624 Some(buf) => std::task::Poll::Ready(Some(RouteValidatorEvent::decode(buf))),
6625 None => std::task::Poll::Ready(None),
6626 }
6627 }
6628}
6629
6630#[derive(Debug)]
6631pub enum RouteValidatorEvent {}
6632
6633impl RouteValidatorEvent {
6634 fn decode(
6636 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6637 ) -> Result<RouteValidatorEvent, fidl::Error> {
6638 let (bytes, _handles) = buf.split_mut();
6639 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6640 debug_assert_eq!(tx_header.tx_id, 0);
6641 match tx_header.ordinal {
6642 _ => Err(fidl::Error::UnknownOrdinal {
6643 ordinal: tx_header.ordinal,
6644 protocol_name:
6645 <RouteValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6646 }),
6647 }
6648 }
6649}
6650
6651pub struct RouteValidatorRequestStream {
6653 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6654 is_terminated: bool,
6655}
6656
6657impl std::marker::Unpin for RouteValidatorRequestStream {}
6658
6659impl futures::stream::FusedStream for RouteValidatorRequestStream {
6660 fn is_terminated(&self) -> bool {
6661 self.is_terminated
6662 }
6663}
6664
6665impl fidl::endpoints::RequestStream for RouteValidatorRequestStream {
6666 type Protocol = RouteValidatorMarker;
6667 type ControlHandle = RouteValidatorControlHandle;
6668
6669 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6670 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6671 }
6672
6673 fn control_handle(&self) -> Self::ControlHandle {
6674 RouteValidatorControlHandle { inner: self.inner.clone() }
6675 }
6676
6677 fn into_inner(
6678 self,
6679 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6680 {
6681 (self.inner, self.is_terminated)
6682 }
6683
6684 fn from_inner(
6685 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6686 is_terminated: bool,
6687 ) -> Self {
6688 Self { inner, is_terminated }
6689 }
6690}
6691
6692impl futures::Stream for RouteValidatorRequestStream {
6693 type Item = Result<RouteValidatorRequest, fidl::Error>;
6694
6695 fn poll_next(
6696 mut self: std::pin::Pin<&mut Self>,
6697 cx: &mut std::task::Context<'_>,
6698 ) -> std::task::Poll<Option<Self::Item>> {
6699 let this = &mut *self;
6700 if this.inner.check_shutdown(cx) {
6701 this.is_terminated = true;
6702 return std::task::Poll::Ready(None);
6703 }
6704 if this.is_terminated {
6705 panic!("polled RouteValidatorRequestStream after completion");
6706 }
6707 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6708 |bytes, handles| {
6709 match this.inner.channel().read_etc(cx, bytes, handles) {
6710 std::task::Poll::Ready(Ok(())) => {}
6711 std::task::Poll::Pending => return std::task::Poll::Pending,
6712 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6713 this.is_terminated = true;
6714 return std::task::Poll::Ready(None);
6715 }
6716 std::task::Poll::Ready(Err(e)) => {
6717 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6718 e.into(),
6719 ))))
6720 }
6721 }
6722
6723 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6725
6726 std::task::Poll::Ready(Some(match header.ordinal {
6727 0x3360b96d5f86cdf4 => {
6728 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6729 let mut req = fidl::new_empty!(
6730 RouteValidatorValidateRequest,
6731 fidl::encoding::DefaultFuchsiaResourceDialect
6732 );
6733 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteValidatorValidateRequest>(&header, _body_bytes, handles, &mut req)?;
6734 let control_handle =
6735 RouteValidatorControlHandle { inner: this.inner.clone() };
6736 Ok(RouteValidatorRequest::Validate {
6737 moniker: req.moniker,
6738
6739 responder: RouteValidatorValidateResponder {
6740 control_handle: std::mem::ManuallyDrop::new(control_handle),
6741 tx_id: header.tx_id,
6742 },
6743 })
6744 }
6745 0x51c9b268216d8239 => {
6746 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6747 let mut req = fidl::new_empty!(
6748 RouteValidatorRouteRequest,
6749 fidl::encoding::DefaultFuchsiaResourceDialect
6750 );
6751 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RouteValidatorRouteRequest>(&header, _body_bytes, handles, &mut req)?;
6752 let control_handle =
6753 RouteValidatorControlHandle { inner: this.inner.clone() };
6754 Ok(RouteValidatorRequest::Route {
6755 moniker: req.moniker,
6756 targets: req.targets,
6757
6758 responder: RouteValidatorRouteResponder {
6759 control_handle: std::mem::ManuallyDrop::new(control_handle),
6760 tx_id: header.tx_id,
6761 },
6762 })
6763 }
6764 _ => Err(fidl::Error::UnknownOrdinal {
6765 ordinal: header.ordinal,
6766 protocol_name:
6767 <RouteValidatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6768 }),
6769 }))
6770 },
6771 )
6772 }
6773}
6774
6775#[derive(Debug)]
6776pub enum RouteValidatorRequest {
6777 Validate { moniker: String, responder: RouteValidatorValidateResponder },
6785 Route { moniker: String, targets: Vec<RouteTarget>, responder: RouteValidatorRouteResponder },
6801}
6802
6803impl RouteValidatorRequest {
6804 #[allow(irrefutable_let_patterns)]
6805 pub fn into_validate(self) -> Option<(String, RouteValidatorValidateResponder)> {
6806 if let RouteValidatorRequest::Validate { moniker, responder } = self {
6807 Some((moniker, responder))
6808 } else {
6809 None
6810 }
6811 }
6812
6813 #[allow(irrefutable_let_patterns)]
6814 pub fn into_route(self) -> Option<(String, Vec<RouteTarget>, RouteValidatorRouteResponder)> {
6815 if let RouteValidatorRequest::Route { moniker, targets, responder } = self {
6816 Some((moniker, targets, responder))
6817 } else {
6818 None
6819 }
6820 }
6821
6822 pub fn method_name(&self) -> &'static str {
6824 match *self {
6825 RouteValidatorRequest::Validate { .. } => "validate",
6826 RouteValidatorRequest::Route { .. } => "route",
6827 }
6828 }
6829}
6830
6831#[derive(Debug, Clone)]
6832pub struct RouteValidatorControlHandle {
6833 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6834}
6835
6836impl fidl::endpoints::ControlHandle for RouteValidatorControlHandle {
6837 fn shutdown(&self) {
6838 self.inner.shutdown()
6839 }
6840 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6841 self.inner.shutdown_with_epitaph(status)
6842 }
6843
6844 fn is_closed(&self) -> bool {
6845 self.inner.channel().is_closed()
6846 }
6847 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6848 self.inner.channel().on_closed()
6849 }
6850
6851 #[cfg(target_os = "fuchsia")]
6852 fn signal_peer(
6853 &self,
6854 clear_mask: zx::Signals,
6855 set_mask: zx::Signals,
6856 ) -> Result<(), zx_status::Status> {
6857 use fidl::Peered;
6858 self.inner.channel().signal_peer(clear_mask, set_mask)
6859 }
6860}
6861
6862impl RouteValidatorControlHandle {}
6863
6864#[must_use = "FIDL methods require a response to be sent"]
6865#[derive(Debug)]
6866pub struct RouteValidatorValidateResponder {
6867 control_handle: std::mem::ManuallyDrop<RouteValidatorControlHandle>,
6868 tx_id: u32,
6869}
6870
6871impl std::ops::Drop for RouteValidatorValidateResponder {
6875 fn drop(&mut self) {
6876 self.control_handle.shutdown();
6877 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6879 }
6880}
6881
6882impl fidl::endpoints::Responder for RouteValidatorValidateResponder {
6883 type ControlHandle = RouteValidatorControlHandle;
6884
6885 fn control_handle(&self) -> &RouteValidatorControlHandle {
6886 &self.control_handle
6887 }
6888
6889 fn drop_without_shutdown(mut self) {
6890 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6892 std::mem::forget(self);
6894 }
6895}
6896
6897impl RouteValidatorValidateResponder {
6898 pub fn send(
6902 self,
6903 mut result: Result<&[RouteReport], fidl_fuchsia_component::Error>,
6904 ) -> Result<(), fidl::Error> {
6905 let _result = self.send_raw(result);
6906 if _result.is_err() {
6907 self.control_handle.shutdown();
6908 }
6909 self.drop_without_shutdown();
6910 _result
6911 }
6912
6913 pub fn send_no_shutdown_on_err(
6915 self,
6916 mut result: Result<&[RouteReport], fidl_fuchsia_component::Error>,
6917 ) -> Result<(), fidl::Error> {
6918 let _result = self.send_raw(result);
6919 self.drop_without_shutdown();
6920 _result
6921 }
6922
6923 fn send_raw(
6924 &self,
6925 mut result: Result<&[RouteReport], fidl_fuchsia_component::Error>,
6926 ) -> Result<(), fidl::Error> {
6927 self.control_handle.inner.send::<fidl::encoding::ResultType<
6928 RouteValidatorValidateResponse,
6929 fidl_fuchsia_component::Error,
6930 >>(
6931 result.map(|reports| (reports,)),
6932 self.tx_id,
6933 0x3360b96d5f86cdf4,
6934 fidl::encoding::DynamicFlags::empty(),
6935 )
6936 }
6937}
6938
6939#[must_use = "FIDL methods require a response to be sent"]
6940#[derive(Debug)]
6941pub struct RouteValidatorRouteResponder {
6942 control_handle: std::mem::ManuallyDrop<RouteValidatorControlHandle>,
6943 tx_id: u32,
6944}
6945
6946impl std::ops::Drop for RouteValidatorRouteResponder {
6950 fn drop(&mut self) {
6951 self.control_handle.shutdown();
6952 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6954 }
6955}
6956
6957impl fidl::endpoints::Responder for RouteValidatorRouteResponder {
6958 type ControlHandle = RouteValidatorControlHandle;
6959
6960 fn control_handle(&self) -> &RouteValidatorControlHandle {
6961 &self.control_handle
6962 }
6963
6964 fn drop_without_shutdown(mut self) {
6965 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6967 std::mem::forget(self);
6969 }
6970}
6971
6972impl RouteValidatorRouteResponder {
6973 pub fn send(
6977 self,
6978 mut result: Result<&[RouteReport], RouteValidatorError>,
6979 ) -> Result<(), fidl::Error> {
6980 let _result = self.send_raw(result);
6981 if _result.is_err() {
6982 self.control_handle.shutdown();
6983 }
6984 self.drop_without_shutdown();
6985 _result
6986 }
6987
6988 pub fn send_no_shutdown_on_err(
6990 self,
6991 mut result: Result<&[RouteReport], RouteValidatorError>,
6992 ) -> Result<(), fidl::Error> {
6993 let _result = self.send_raw(result);
6994 self.drop_without_shutdown();
6995 _result
6996 }
6997
6998 fn send_raw(
6999 &self,
7000 mut result: Result<&[RouteReport], RouteValidatorError>,
7001 ) -> Result<(), fidl::Error> {
7002 self.control_handle.inner.send::<fidl::encoding::ResultType<
7003 RouteValidatorRouteResponse,
7004 RouteValidatorError,
7005 >>(
7006 result.map(|reports| (reports,)),
7007 self.tx_id,
7008 0x51c9b268216d8239,
7009 fidl::encoding::DynamicFlags::empty(),
7010 )
7011 }
7012}
7013
7014#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7015pub struct StorageAdminMarker;
7016
7017impl fidl::endpoints::ProtocolMarker for StorageAdminMarker {
7018 type Proxy = StorageAdminProxy;
7019 type RequestStream = StorageAdminRequestStream;
7020 #[cfg(target_os = "fuchsia")]
7021 type SynchronousProxy = StorageAdminSynchronousProxy;
7022
7023 const DEBUG_NAME: &'static str = "fuchsia.sys2.StorageAdmin";
7024}
7025impl fidl::endpoints::DiscoverableProtocolMarker for StorageAdminMarker {}
7026pub type StorageAdminOpenStorageResult = Result<(), fidl_fuchsia_component::Error>;
7027pub type StorageAdminListStorageInRealmResult = Result<(), fidl_fuchsia_component::Error>;
7028pub type StorageAdminOpenComponentStorageByIdResult = Result<(), fidl_fuchsia_component::Error>;
7029pub type StorageAdminDeleteComponentStorageResult = Result<(), fidl_fuchsia_component::Error>;
7030pub type StorageAdminGetStatusResult = Result<StorageStatus, StatusError>;
7031pub type StorageAdminDeleteAllStorageContentsResult = Result<(), DeletionError>;
7032
7033pub trait StorageAdminProxyInterface: Send + Sync {
7034 type OpenStorageResponseFut: std::future::Future<Output = Result<StorageAdminOpenStorageResult, fidl::Error>>
7035 + Send;
7036 fn r#open_storage(
7037 &self,
7038 relative_moniker: &str,
7039 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7040 ) -> Self::OpenStorageResponseFut;
7041 type ListStorageInRealmResponseFut: std::future::Future<Output = Result<StorageAdminListStorageInRealmResult, fidl::Error>>
7042 + Send;
7043 fn r#list_storage_in_realm(
7044 &self,
7045 relative_moniker: &str,
7046 iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7047 ) -> Self::ListStorageInRealmResponseFut;
7048 type OpenComponentStorageByIdResponseFut: std::future::Future<
7049 Output = Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error>,
7050 > + Send;
7051 fn r#open_component_storage_by_id(
7052 &self,
7053 id: &str,
7054 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7055 ) -> Self::OpenComponentStorageByIdResponseFut;
7056 type DeleteComponentStorageResponseFut: std::future::Future<Output = Result<StorageAdminDeleteComponentStorageResult, fidl::Error>>
7057 + Send;
7058 fn r#delete_component_storage(
7059 &self,
7060 relative_moniker: &str,
7061 ) -> Self::DeleteComponentStorageResponseFut;
7062 type GetStatusResponseFut: std::future::Future<Output = Result<StorageAdminGetStatusResult, fidl::Error>>
7063 + Send;
7064 fn r#get_status(&self) -> Self::GetStatusResponseFut;
7065 type DeleteAllStorageContentsResponseFut: std::future::Future<
7066 Output = Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error>,
7067 > + Send;
7068 fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut;
7069 fn r#deprecated_open_component_storage(
7070 &self,
7071 relative_moniker: &str,
7072 flags: fidl_fuchsia_io::OpenFlags,
7073 mode: fidl_fuchsia_io::ModeType,
7074 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7075 ) -> Result<(), fidl::Error>;
7076}
7077#[derive(Debug)]
7078#[cfg(target_os = "fuchsia")]
7079pub struct StorageAdminSynchronousProxy {
7080 client: fidl::client::sync::Client,
7081}
7082
7083#[cfg(target_os = "fuchsia")]
7084impl fidl::endpoints::SynchronousProxy for StorageAdminSynchronousProxy {
7085 type Proxy = StorageAdminProxy;
7086 type Protocol = StorageAdminMarker;
7087
7088 fn from_channel(inner: fidl::Channel) -> Self {
7089 Self::new(inner)
7090 }
7091
7092 fn into_channel(self) -> fidl::Channel {
7093 self.client.into_channel()
7094 }
7095
7096 fn as_channel(&self) -> &fidl::Channel {
7097 self.client.as_channel()
7098 }
7099}
7100
7101#[cfg(target_os = "fuchsia")]
7102impl StorageAdminSynchronousProxy {
7103 pub fn new(channel: fidl::Channel) -> Self {
7104 let protocol_name = <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7105 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7106 }
7107
7108 pub fn into_channel(self) -> fidl::Channel {
7109 self.client.into_channel()
7110 }
7111
7112 pub fn wait_for_event(
7115 &self,
7116 deadline: zx::MonotonicInstant,
7117 ) -> Result<StorageAdminEvent, fidl::Error> {
7118 StorageAdminEvent::decode(self.client.wait_for_event(deadline)?)
7119 }
7120
7121 pub fn r#open_storage(
7124 &self,
7125 mut relative_moniker: &str,
7126 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7127 ___deadline: zx::MonotonicInstant,
7128 ) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
7129 let _response =
7130 self.client.send_query::<StorageAdminOpenStorageRequest, fidl::encoding::ResultType<
7131 fidl::encoding::EmptyStruct,
7132 fidl_fuchsia_component::Error,
7133 >>(
7134 (relative_moniker, object),
7135 0x6ceaa5904cfe4377,
7136 fidl::encoding::DynamicFlags::empty(),
7137 ___deadline,
7138 )?;
7139 Ok(_response.map(|x| x))
7140 }
7141
7142 pub fn r#list_storage_in_realm(
7147 &self,
7148 mut relative_moniker: &str,
7149 mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7150 ___deadline: zx::MonotonicInstant,
7151 ) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
7152 let _response = self
7153 .client
7154 .send_query::<StorageAdminListStorageInRealmRequest, fidl::encoding::ResultType<
7155 fidl::encoding::EmptyStruct,
7156 fidl_fuchsia_component::Error,
7157 >>(
7158 (relative_moniker, iterator),
7159 0x764f6d1f083e8bfb,
7160 fidl::encoding::DynamicFlags::empty(),
7161 ___deadline,
7162 )?;
7163 Ok(_response.map(|x| x))
7164 }
7165
7166 pub fn r#open_component_storage_by_id(
7169 &self,
7170 mut id: &str,
7171 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7172 ___deadline: zx::MonotonicInstant,
7173 ) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
7174 let _response = self
7175 .client
7176 .send_query::<StorageAdminOpenComponentStorageByIdRequest, fidl::encoding::ResultType<
7177 fidl::encoding::EmptyStruct,
7178 fidl_fuchsia_component::Error,
7179 >>(
7180 (id, object),
7181 0x4802102cc55d5df1,
7182 fidl::encoding::DynamicFlags::empty(),
7183 ___deadline,
7184 )?;
7185 Ok(_response.map(|x| x))
7186 }
7187
7188 pub fn r#delete_component_storage(
7192 &self,
7193 mut relative_moniker: &str,
7194 ___deadline: zx::MonotonicInstant,
7195 ) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
7196 let _response = self
7197 .client
7198 .send_query::<StorageAdminDeleteComponentStorageRequest, fidl::encoding::ResultType<
7199 fidl::encoding::EmptyStruct,
7200 fidl_fuchsia_component::Error,
7201 >>(
7202 (relative_moniker,),
7203 0x1677c1cdfcdbf45a,
7204 fidl::encoding::DynamicFlags::empty(),
7205 ___deadline,
7206 )?;
7207 Ok(_response.map(|x| x))
7208 }
7209
7210 pub fn r#get_status(
7212 &self,
7213 ___deadline: zx::MonotonicInstant,
7214 ) -> Result<StorageAdminGetStatusResult, fidl::Error> {
7215 let _response = self.client.send_query::<
7216 fidl::encoding::EmptyPayload,
7217 fidl::encoding::ResultType<StorageStatus, StatusError>,
7218 >(
7219 (),
7220 0x7729e325a6c526c8,
7221 fidl::encoding::DynamicFlags::empty(),
7222 ___deadline,
7223 )?;
7224 Ok(_response.map(|x| x))
7225 }
7226
7227 pub fn r#delete_all_storage_contents(
7232 &self,
7233 ___deadline: zx::MonotonicInstant,
7234 ) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
7235 let _response = self.client.send_query::<
7236 fidl::encoding::EmptyPayload,
7237 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
7238 >(
7239 (),
7240 0x2ee980b4b2d24adb,
7241 fidl::encoding::DynamicFlags::empty(),
7242 ___deadline,
7243 )?;
7244 Ok(_response.map(|x| x))
7245 }
7246
7247 pub fn r#deprecated_open_component_storage(
7252 &self,
7253 mut relative_moniker: &str,
7254 mut flags: fidl_fuchsia_io::OpenFlags,
7255 mut mode: fidl_fuchsia_io::ModeType,
7256 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7257 ) -> Result<(), fidl::Error> {
7258 self.client.send::<StorageAdminDeprecatedOpenComponentStorageRequest>(
7259 (relative_moniker, flags, mode, object),
7260 0x3e0295bd35836b1d,
7261 fidl::encoding::DynamicFlags::empty(),
7262 )
7263 }
7264}
7265
7266#[cfg(target_os = "fuchsia")]
7267impl From<StorageAdminSynchronousProxy> for zx::Handle {
7268 fn from(value: StorageAdminSynchronousProxy) -> Self {
7269 value.into_channel().into()
7270 }
7271}
7272
7273#[cfg(target_os = "fuchsia")]
7274impl From<fidl::Channel> for StorageAdminSynchronousProxy {
7275 fn from(value: fidl::Channel) -> Self {
7276 Self::new(value)
7277 }
7278}
7279
7280#[derive(Debug, Clone)]
7281pub struct StorageAdminProxy {
7282 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7283}
7284
7285impl fidl::endpoints::Proxy for StorageAdminProxy {
7286 type Protocol = StorageAdminMarker;
7287
7288 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7289 Self::new(inner)
7290 }
7291
7292 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7293 self.client.into_channel().map_err(|client| Self { client })
7294 }
7295
7296 fn as_channel(&self) -> &::fidl::AsyncChannel {
7297 self.client.as_channel()
7298 }
7299}
7300
7301impl StorageAdminProxy {
7302 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7304 let protocol_name = <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7305 Self { client: fidl::client::Client::new(channel, protocol_name) }
7306 }
7307
7308 pub fn take_event_stream(&self) -> StorageAdminEventStream {
7314 StorageAdminEventStream { event_receiver: self.client.take_event_receiver() }
7315 }
7316
7317 pub fn r#open_storage(
7320 &self,
7321 mut relative_moniker: &str,
7322 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7323 ) -> fidl::client::QueryResponseFut<
7324 StorageAdminOpenStorageResult,
7325 fidl::encoding::DefaultFuchsiaResourceDialect,
7326 > {
7327 StorageAdminProxyInterface::r#open_storage(self, relative_moniker, object)
7328 }
7329
7330 pub fn r#list_storage_in_realm(
7335 &self,
7336 mut relative_moniker: &str,
7337 mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7338 ) -> fidl::client::QueryResponseFut<
7339 StorageAdminListStorageInRealmResult,
7340 fidl::encoding::DefaultFuchsiaResourceDialect,
7341 > {
7342 StorageAdminProxyInterface::r#list_storage_in_realm(self, relative_moniker, iterator)
7343 }
7344
7345 pub fn r#open_component_storage_by_id(
7348 &self,
7349 mut id: &str,
7350 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7351 ) -> fidl::client::QueryResponseFut<
7352 StorageAdminOpenComponentStorageByIdResult,
7353 fidl::encoding::DefaultFuchsiaResourceDialect,
7354 > {
7355 StorageAdminProxyInterface::r#open_component_storage_by_id(self, id, object)
7356 }
7357
7358 pub fn r#delete_component_storage(
7362 &self,
7363 mut relative_moniker: &str,
7364 ) -> fidl::client::QueryResponseFut<
7365 StorageAdminDeleteComponentStorageResult,
7366 fidl::encoding::DefaultFuchsiaResourceDialect,
7367 > {
7368 StorageAdminProxyInterface::r#delete_component_storage(self, relative_moniker)
7369 }
7370
7371 pub fn r#get_status(
7373 &self,
7374 ) -> fidl::client::QueryResponseFut<
7375 StorageAdminGetStatusResult,
7376 fidl::encoding::DefaultFuchsiaResourceDialect,
7377 > {
7378 StorageAdminProxyInterface::r#get_status(self)
7379 }
7380
7381 pub fn r#delete_all_storage_contents(
7386 &self,
7387 ) -> fidl::client::QueryResponseFut<
7388 StorageAdminDeleteAllStorageContentsResult,
7389 fidl::encoding::DefaultFuchsiaResourceDialect,
7390 > {
7391 StorageAdminProxyInterface::r#delete_all_storage_contents(self)
7392 }
7393
7394 pub fn r#deprecated_open_component_storage(
7399 &self,
7400 mut relative_moniker: &str,
7401 mut flags: fidl_fuchsia_io::OpenFlags,
7402 mut mode: fidl_fuchsia_io::ModeType,
7403 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7404 ) -> Result<(), fidl::Error> {
7405 StorageAdminProxyInterface::r#deprecated_open_component_storage(
7406 self,
7407 relative_moniker,
7408 flags,
7409 mode,
7410 object,
7411 )
7412 }
7413}
7414
7415impl StorageAdminProxyInterface for StorageAdminProxy {
7416 type OpenStorageResponseFut = fidl::client::QueryResponseFut<
7417 StorageAdminOpenStorageResult,
7418 fidl::encoding::DefaultFuchsiaResourceDialect,
7419 >;
7420 fn r#open_storage(
7421 &self,
7422 mut relative_moniker: &str,
7423 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7424 ) -> Self::OpenStorageResponseFut {
7425 fn _decode(
7426 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7427 ) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
7428 let _response = fidl::client::decode_transaction_body::<
7429 fidl::encoding::ResultType<
7430 fidl::encoding::EmptyStruct,
7431 fidl_fuchsia_component::Error,
7432 >,
7433 fidl::encoding::DefaultFuchsiaResourceDialect,
7434 0x6ceaa5904cfe4377,
7435 >(_buf?)?;
7436 Ok(_response.map(|x| x))
7437 }
7438 self.client
7439 .send_query_and_decode::<StorageAdminOpenStorageRequest, StorageAdminOpenStorageResult>(
7440 (relative_moniker, object),
7441 0x6ceaa5904cfe4377,
7442 fidl::encoding::DynamicFlags::empty(),
7443 _decode,
7444 )
7445 }
7446
7447 type ListStorageInRealmResponseFut = fidl::client::QueryResponseFut<
7448 StorageAdminListStorageInRealmResult,
7449 fidl::encoding::DefaultFuchsiaResourceDialect,
7450 >;
7451 fn r#list_storage_in_realm(
7452 &self,
7453 mut relative_moniker: &str,
7454 mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7455 ) -> Self::ListStorageInRealmResponseFut {
7456 fn _decode(
7457 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7458 ) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
7459 let _response = fidl::client::decode_transaction_body::<
7460 fidl::encoding::ResultType<
7461 fidl::encoding::EmptyStruct,
7462 fidl_fuchsia_component::Error,
7463 >,
7464 fidl::encoding::DefaultFuchsiaResourceDialect,
7465 0x764f6d1f083e8bfb,
7466 >(_buf?)?;
7467 Ok(_response.map(|x| x))
7468 }
7469 self.client.send_query_and_decode::<
7470 StorageAdminListStorageInRealmRequest,
7471 StorageAdminListStorageInRealmResult,
7472 >(
7473 (relative_moniker, iterator,),
7474 0x764f6d1f083e8bfb,
7475 fidl::encoding::DynamicFlags::empty(),
7476 _decode,
7477 )
7478 }
7479
7480 type OpenComponentStorageByIdResponseFut = fidl::client::QueryResponseFut<
7481 StorageAdminOpenComponentStorageByIdResult,
7482 fidl::encoding::DefaultFuchsiaResourceDialect,
7483 >;
7484 fn r#open_component_storage_by_id(
7485 &self,
7486 mut id: &str,
7487 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7488 ) -> Self::OpenComponentStorageByIdResponseFut {
7489 fn _decode(
7490 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7491 ) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
7492 let _response = fidl::client::decode_transaction_body::<
7493 fidl::encoding::ResultType<
7494 fidl::encoding::EmptyStruct,
7495 fidl_fuchsia_component::Error,
7496 >,
7497 fidl::encoding::DefaultFuchsiaResourceDialect,
7498 0x4802102cc55d5df1,
7499 >(_buf?)?;
7500 Ok(_response.map(|x| x))
7501 }
7502 self.client.send_query_and_decode::<
7503 StorageAdminOpenComponentStorageByIdRequest,
7504 StorageAdminOpenComponentStorageByIdResult,
7505 >(
7506 (id, object,),
7507 0x4802102cc55d5df1,
7508 fidl::encoding::DynamicFlags::empty(),
7509 _decode,
7510 )
7511 }
7512
7513 type DeleteComponentStorageResponseFut = fidl::client::QueryResponseFut<
7514 StorageAdminDeleteComponentStorageResult,
7515 fidl::encoding::DefaultFuchsiaResourceDialect,
7516 >;
7517 fn r#delete_component_storage(
7518 &self,
7519 mut relative_moniker: &str,
7520 ) -> Self::DeleteComponentStorageResponseFut {
7521 fn _decode(
7522 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7523 ) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
7524 let _response = fidl::client::decode_transaction_body::<
7525 fidl::encoding::ResultType<
7526 fidl::encoding::EmptyStruct,
7527 fidl_fuchsia_component::Error,
7528 >,
7529 fidl::encoding::DefaultFuchsiaResourceDialect,
7530 0x1677c1cdfcdbf45a,
7531 >(_buf?)?;
7532 Ok(_response.map(|x| x))
7533 }
7534 self.client.send_query_and_decode::<
7535 StorageAdminDeleteComponentStorageRequest,
7536 StorageAdminDeleteComponentStorageResult,
7537 >(
7538 (relative_moniker,),
7539 0x1677c1cdfcdbf45a,
7540 fidl::encoding::DynamicFlags::empty(),
7541 _decode,
7542 )
7543 }
7544
7545 type GetStatusResponseFut = fidl::client::QueryResponseFut<
7546 StorageAdminGetStatusResult,
7547 fidl::encoding::DefaultFuchsiaResourceDialect,
7548 >;
7549 fn r#get_status(&self) -> Self::GetStatusResponseFut {
7550 fn _decode(
7551 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7552 ) -> Result<StorageAdminGetStatusResult, fidl::Error> {
7553 let _response = fidl::client::decode_transaction_body::<
7554 fidl::encoding::ResultType<StorageStatus, StatusError>,
7555 fidl::encoding::DefaultFuchsiaResourceDialect,
7556 0x7729e325a6c526c8,
7557 >(_buf?)?;
7558 Ok(_response.map(|x| x))
7559 }
7560 self.client
7561 .send_query_and_decode::<fidl::encoding::EmptyPayload, StorageAdminGetStatusResult>(
7562 (),
7563 0x7729e325a6c526c8,
7564 fidl::encoding::DynamicFlags::empty(),
7565 _decode,
7566 )
7567 }
7568
7569 type DeleteAllStorageContentsResponseFut = fidl::client::QueryResponseFut<
7570 StorageAdminDeleteAllStorageContentsResult,
7571 fidl::encoding::DefaultFuchsiaResourceDialect,
7572 >;
7573 fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut {
7574 fn _decode(
7575 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7576 ) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
7577 let _response = fidl::client::decode_transaction_body::<
7578 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
7579 fidl::encoding::DefaultFuchsiaResourceDialect,
7580 0x2ee980b4b2d24adb,
7581 >(_buf?)?;
7582 Ok(_response.map(|x| x))
7583 }
7584 self.client.send_query_and_decode::<
7585 fidl::encoding::EmptyPayload,
7586 StorageAdminDeleteAllStorageContentsResult,
7587 >(
7588 (),
7589 0x2ee980b4b2d24adb,
7590 fidl::encoding::DynamicFlags::empty(),
7591 _decode,
7592 )
7593 }
7594
7595 fn r#deprecated_open_component_storage(
7596 &self,
7597 mut relative_moniker: &str,
7598 mut flags: fidl_fuchsia_io::OpenFlags,
7599 mut mode: fidl_fuchsia_io::ModeType,
7600 mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7601 ) -> Result<(), fidl::Error> {
7602 self.client.send::<StorageAdminDeprecatedOpenComponentStorageRequest>(
7603 (relative_moniker, flags, mode, object),
7604 0x3e0295bd35836b1d,
7605 fidl::encoding::DynamicFlags::empty(),
7606 )
7607 }
7608}
7609
7610pub struct StorageAdminEventStream {
7611 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7612}
7613
7614impl std::marker::Unpin for StorageAdminEventStream {}
7615
7616impl futures::stream::FusedStream for StorageAdminEventStream {
7617 fn is_terminated(&self) -> bool {
7618 self.event_receiver.is_terminated()
7619 }
7620}
7621
7622impl futures::Stream for StorageAdminEventStream {
7623 type Item = Result<StorageAdminEvent, fidl::Error>;
7624
7625 fn poll_next(
7626 mut self: std::pin::Pin<&mut Self>,
7627 cx: &mut std::task::Context<'_>,
7628 ) -> std::task::Poll<Option<Self::Item>> {
7629 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7630 &mut self.event_receiver,
7631 cx
7632 )?) {
7633 Some(buf) => std::task::Poll::Ready(Some(StorageAdminEvent::decode(buf))),
7634 None => std::task::Poll::Ready(None),
7635 }
7636 }
7637}
7638
7639#[derive(Debug)]
7640pub enum StorageAdminEvent {}
7641
7642impl StorageAdminEvent {
7643 fn decode(
7645 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7646 ) -> Result<StorageAdminEvent, fidl::Error> {
7647 let (bytes, _handles) = buf.split_mut();
7648 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7649 debug_assert_eq!(tx_header.tx_id, 0);
7650 match tx_header.ordinal {
7651 _ => Err(fidl::Error::UnknownOrdinal {
7652 ordinal: tx_header.ordinal,
7653 protocol_name: <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7654 }),
7655 }
7656 }
7657}
7658
7659pub struct StorageAdminRequestStream {
7661 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7662 is_terminated: bool,
7663}
7664
7665impl std::marker::Unpin for StorageAdminRequestStream {}
7666
7667impl futures::stream::FusedStream for StorageAdminRequestStream {
7668 fn is_terminated(&self) -> bool {
7669 self.is_terminated
7670 }
7671}
7672
7673impl fidl::endpoints::RequestStream for StorageAdminRequestStream {
7674 type Protocol = StorageAdminMarker;
7675 type ControlHandle = StorageAdminControlHandle;
7676
7677 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7678 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7679 }
7680
7681 fn control_handle(&self) -> Self::ControlHandle {
7682 StorageAdminControlHandle { inner: self.inner.clone() }
7683 }
7684
7685 fn into_inner(
7686 self,
7687 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7688 {
7689 (self.inner, self.is_terminated)
7690 }
7691
7692 fn from_inner(
7693 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7694 is_terminated: bool,
7695 ) -> Self {
7696 Self { inner, is_terminated }
7697 }
7698}
7699
7700impl futures::Stream for StorageAdminRequestStream {
7701 type Item = Result<StorageAdminRequest, fidl::Error>;
7702
7703 fn poll_next(
7704 mut self: std::pin::Pin<&mut Self>,
7705 cx: &mut std::task::Context<'_>,
7706 ) -> std::task::Poll<Option<Self::Item>> {
7707 let this = &mut *self;
7708 if this.inner.check_shutdown(cx) {
7709 this.is_terminated = true;
7710 return std::task::Poll::Ready(None);
7711 }
7712 if this.is_terminated {
7713 panic!("polled StorageAdminRequestStream after completion");
7714 }
7715 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7716 |bytes, handles| {
7717 match this.inner.channel().read_etc(cx, bytes, handles) {
7718 std::task::Poll::Ready(Ok(())) => {}
7719 std::task::Poll::Pending => return std::task::Poll::Pending,
7720 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7721 this.is_terminated = true;
7722 return std::task::Poll::Ready(None);
7723 }
7724 std::task::Poll::Ready(Err(e)) => {
7725 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7726 e.into(),
7727 ))))
7728 }
7729 }
7730
7731 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7733
7734 std::task::Poll::Ready(Some(match header.ordinal {
7735 0x6ceaa5904cfe4377 => {
7736 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7737 let mut req = fidl::new_empty!(
7738 StorageAdminOpenStorageRequest,
7739 fidl::encoding::DefaultFuchsiaResourceDialect
7740 );
7741 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminOpenStorageRequest>(&header, _body_bytes, handles, &mut req)?;
7742 let control_handle =
7743 StorageAdminControlHandle { inner: this.inner.clone() };
7744 Ok(StorageAdminRequest::OpenStorage {
7745 relative_moniker: req.relative_moniker,
7746 object: req.object,
7747
7748 responder: StorageAdminOpenStorageResponder {
7749 control_handle: std::mem::ManuallyDrop::new(control_handle),
7750 tx_id: header.tx_id,
7751 },
7752 })
7753 }
7754 0x764f6d1f083e8bfb => {
7755 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7756 let mut req = fidl::new_empty!(
7757 StorageAdminListStorageInRealmRequest,
7758 fidl::encoding::DefaultFuchsiaResourceDialect
7759 );
7760 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminListStorageInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
7761 let control_handle =
7762 StorageAdminControlHandle { inner: this.inner.clone() };
7763 Ok(StorageAdminRequest::ListStorageInRealm {
7764 relative_moniker: req.relative_moniker,
7765 iterator: req.iterator,
7766
7767 responder: StorageAdminListStorageInRealmResponder {
7768 control_handle: std::mem::ManuallyDrop::new(control_handle),
7769 tx_id: header.tx_id,
7770 },
7771 })
7772 }
7773 0x4802102cc55d5df1 => {
7774 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7775 let mut req = fidl::new_empty!(
7776 StorageAdminOpenComponentStorageByIdRequest,
7777 fidl::encoding::DefaultFuchsiaResourceDialect
7778 );
7779 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminOpenComponentStorageByIdRequest>(&header, _body_bytes, handles, &mut req)?;
7780 let control_handle =
7781 StorageAdminControlHandle { inner: this.inner.clone() };
7782 Ok(StorageAdminRequest::OpenComponentStorageById {
7783 id: req.id,
7784 object: req.object,
7785
7786 responder: StorageAdminOpenComponentStorageByIdResponder {
7787 control_handle: std::mem::ManuallyDrop::new(control_handle),
7788 tx_id: header.tx_id,
7789 },
7790 })
7791 }
7792 0x1677c1cdfcdbf45a => {
7793 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7794 let mut req = fidl::new_empty!(
7795 StorageAdminDeleteComponentStorageRequest,
7796 fidl::encoding::DefaultFuchsiaResourceDialect
7797 );
7798 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminDeleteComponentStorageRequest>(&header, _body_bytes, handles, &mut req)?;
7799 let control_handle =
7800 StorageAdminControlHandle { inner: this.inner.clone() };
7801 Ok(StorageAdminRequest::DeleteComponentStorage {
7802 relative_moniker: req.relative_moniker,
7803
7804 responder: StorageAdminDeleteComponentStorageResponder {
7805 control_handle: std::mem::ManuallyDrop::new(control_handle),
7806 tx_id: header.tx_id,
7807 },
7808 })
7809 }
7810 0x7729e325a6c526c8 => {
7811 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7812 let mut req = fidl::new_empty!(
7813 fidl::encoding::EmptyPayload,
7814 fidl::encoding::DefaultFuchsiaResourceDialect
7815 );
7816 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7817 let control_handle =
7818 StorageAdminControlHandle { inner: this.inner.clone() };
7819 Ok(StorageAdminRequest::GetStatus {
7820 responder: StorageAdminGetStatusResponder {
7821 control_handle: std::mem::ManuallyDrop::new(control_handle),
7822 tx_id: header.tx_id,
7823 },
7824 })
7825 }
7826 0x2ee980b4b2d24adb => {
7827 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7828 let mut req = fidl::new_empty!(
7829 fidl::encoding::EmptyPayload,
7830 fidl::encoding::DefaultFuchsiaResourceDialect
7831 );
7832 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7833 let control_handle =
7834 StorageAdminControlHandle { inner: this.inner.clone() };
7835 Ok(StorageAdminRequest::DeleteAllStorageContents {
7836 responder: StorageAdminDeleteAllStorageContentsResponder {
7837 control_handle: std::mem::ManuallyDrop::new(control_handle),
7838 tx_id: header.tx_id,
7839 },
7840 })
7841 }
7842 0x3e0295bd35836b1d => {
7843 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7844 let mut req = fidl::new_empty!(
7845 StorageAdminDeprecatedOpenComponentStorageRequest,
7846 fidl::encoding::DefaultFuchsiaResourceDialect
7847 );
7848 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminDeprecatedOpenComponentStorageRequest>(&header, _body_bytes, handles, &mut req)?;
7849 let control_handle =
7850 StorageAdminControlHandle { inner: this.inner.clone() };
7851 Ok(StorageAdminRequest::DeprecatedOpenComponentStorage {
7852 relative_moniker: req.relative_moniker,
7853 flags: req.flags,
7854 mode: req.mode,
7855 object: req.object,
7856
7857 control_handle,
7858 })
7859 }
7860 _ => Err(fidl::Error::UnknownOrdinal {
7861 ordinal: header.ordinal,
7862 protocol_name:
7863 <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7864 }),
7865 }))
7866 },
7867 )
7868 }
7869}
7870
7871#[derive(Debug)]
7872pub enum StorageAdminRequest {
7873 OpenStorage {
7876 relative_moniker: String,
7877 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7878 responder: StorageAdminOpenStorageResponder,
7879 },
7880 ListStorageInRealm {
7885 relative_moniker: String,
7886 iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7887 responder: StorageAdminListStorageInRealmResponder,
7888 },
7889 OpenComponentStorageById {
7892 id: String,
7893 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7894 responder: StorageAdminOpenComponentStorageByIdResponder,
7895 },
7896 DeleteComponentStorage {
7900 relative_moniker: String,
7901 responder: StorageAdminDeleteComponentStorageResponder,
7902 },
7903 GetStatus { responder: StorageAdminGetStatusResponder },
7905 DeleteAllStorageContents { responder: StorageAdminDeleteAllStorageContentsResponder },
7910 DeprecatedOpenComponentStorage {
7915 relative_moniker: String,
7916 flags: fidl_fuchsia_io::OpenFlags,
7917 mode: fidl_fuchsia_io::ModeType,
7918 object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7919 control_handle: StorageAdminControlHandle,
7920 },
7921}
7922
7923impl StorageAdminRequest {
7924 #[allow(irrefutable_let_patterns)]
7925 pub fn into_open_storage(
7926 self,
7927 ) -> Option<(
7928 String,
7929 fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7930 StorageAdminOpenStorageResponder,
7931 )> {
7932 if let StorageAdminRequest::OpenStorage { relative_moniker, object, responder } = self {
7933 Some((relative_moniker, object, responder))
7934 } else {
7935 None
7936 }
7937 }
7938
7939 #[allow(irrefutable_let_patterns)]
7940 pub fn into_list_storage_in_realm(
7941 self,
7942 ) -> Option<(
7943 String,
7944 fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7945 StorageAdminListStorageInRealmResponder,
7946 )> {
7947 if let StorageAdminRequest::ListStorageInRealm { relative_moniker, iterator, responder } =
7948 self
7949 {
7950 Some((relative_moniker, iterator, responder))
7951 } else {
7952 None
7953 }
7954 }
7955
7956 #[allow(irrefutable_let_patterns)]
7957 pub fn into_open_component_storage_by_id(
7958 self,
7959 ) -> Option<(
7960 String,
7961 fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7962 StorageAdminOpenComponentStorageByIdResponder,
7963 )> {
7964 if let StorageAdminRequest::OpenComponentStorageById { id, object, responder } = self {
7965 Some((id, object, responder))
7966 } else {
7967 None
7968 }
7969 }
7970
7971 #[allow(irrefutable_let_patterns)]
7972 pub fn into_delete_component_storage(
7973 self,
7974 ) -> Option<(String, StorageAdminDeleteComponentStorageResponder)> {
7975 if let StorageAdminRequest::DeleteComponentStorage { relative_moniker, responder } = self {
7976 Some((relative_moniker, responder))
7977 } else {
7978 None
7979 }
7980 }
7981
7982 #[allow(irrefutable_let_patterns)]
7983 pub fn into_get_status(self) -> Option<(StorageAdminGetStatusResponder)> {
7984 if let StorageAdminRequest::GetStatus { responder } = self {
7985 Some((responder))
7986 } else {
7987 None
7988 }
7989 }
7990
7991 #[allow(irrefutable_let_patterns)]
7992 pub fn into_delete_all_storage_contents(
7993 self,
7994 ) -> Option<(StorageAdminDeleteAllStorageContentsResponder)> {
7995 if let StorageAdminRequest::DeleteAllStorageContents { responder } = self {
7996 Some((responder))
7997 } else {
7998 None
7999 }
8000 }
8001
8002 #[allow(irrefutable_let_patterns)]
8003 pub fn into_deprecated_open_component_storage(
8004 self,
8005 ) -> Option<(
8006 String,
8007 fidl_fuchsia_io::OpenFlags,
8008 fidl_fuchsia_io::ModeType,
8009 fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
8010 StorageAdminControlHandle,
8011 )> {
8012 if let StorageAdminRequest::DeprecatedOpenComponentStorage {
8013 relative_moniker,
8014 flags,
8015 mode,
8016 object,
8017 control_handle,
8018 } = self
8019 {
8020 Some((relative_moniker, flags, mode, object, control_handle))
8021 } else {
8022 None
8023 }
8024 }
8025
8026 pub fn method_name(&self) -> &'static str {
8028 match *self {
8029 StorageAdminRequest::OpenStorage { .. } => "open_storage",
8030 StorageAdminRequest::ListStorageInRealm { .. } => "list_storage_in_realm",
8031 StorageAdminRequest::OpenComponentStorageById { .. } => "open_component_storage_by_id",
8032 StorageAdminRequest::DeleteComponentStorage { .. } => "delete_component_storage",
8033 StorageAdminRequest::GetStatus { .. } => "get_status",
8034 StorageAdminRequest::DeleteAllStorageContents { .. } => "delete_all_storage_contents",
8035 StorageAdminRequest::DeprecatedOpenComponentStorage { .. } => {
8036 "deprecated_open_component_storage"
8037 }
8038 }
8039 }
8040}
8041
8042#[derive(Debug, Clone)]
8043pub struct StorageAdminControlHandle {
8044 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8045}
8046
8047impl fidl::endpoints::ControlHandle for StorageAdminControlHandle {
8048 fn shutdown(&self) {
8049 self.inner.shutdown()
8050 }
8051 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8052 self.inner.shutdown_with_epitaph(status)
8053 }
8054
8055 fn is_closed(&self) -> bool {
8056 self.inner.channel().is_closed()
8057 }
8058 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8059 self.inner.channel().on_closed()
8060 }
8061
8062 #[cfg(target_os = "fuchsia")]
8063 fn signal_peer(
8064 &self,
8065 clear_mask: zx::Signals,
8066 set_mask: zx::Signals,
8067 ) -> Result<(), zx_status::Status> {
8068 use fidl::Peered;
8069 self.inner.channel().signal_peer(clear_mask, set_mask)
8070 }
8071}
8072
8073impl StorageAdminControlHandle {}
8074
8075#[must_use = "FIDL methods require a response to be sent"]
8076#[derive(Debug)]
8077pub struct StorageAdminOpenStorageResponder {
8078 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
8079 tx_id: u32,
8080}
8081
8082impl std::ops::Drop for StorageAdminOpenStorageResponder {
8086 fn drop(&mut self) {
8087 self.control_handle.shutdown();
8088 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8090 }
8091}
8092
8093impl fidl::endpoints::Responder for StorageAdminOpenStorageResponder {
8094 type ControlHandle = StorageAdminControlHandle;
8095
8096 fn control_handle(&self) -> &StorageAdminControlHandle {
8097 &self.control_handle
8098 }
8099
8100 fn drop_without_shutdown(mut self) {
8101 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8103 std::mem::forget(self);
8105 }
8106}
8107
8108impl StorageAdminOpenStorageResponder {
8109 pub fn send(
8113 self,
8114 mut result: Result<(), fidl_fuchsia_component::Error>,
8115 ) -> Result<(), fidl::Error> {
8116 let _result = self.send_raw(result);
8117 if _result.is_err() {
8118 self.control_handle.shutdown();
8119 }
8120 self.drop_without_shutdown();
8121 _result
8122 }
8123
8124 pub fn send_no_shutdown_on_err(
8126 self,
8127 mut result: Result<(), fidl_fuchsia_component::Error>,
8128 ) -> Result<(), fidl::Error> {
8129 let _result = self.send_raw(result);
8130 self.drop_without_shutdown();
8131 _result
8132 }
8133
8134 fn send_raw(
8135 &self,
8136 mut result: Result<(), fidl_fuchsia_component::Error>,
8137 ) -> Result<(), fidl::Error> {
8138 self.control_handle.inner.send::<fidl::encoding::ResultType<
8139 fidl::encoding::EmptyStruct,
8140 fidl_fuchsia_component::Error,
8141 >>(
8142 result,
8143 self.tx_id,
8144 0x6ceaa5904cfe4377,
8145 fidl::encoding::DynamicFlags::empty(),
8146 )
8147 }
8148}
8149
8150#[must_use = "FIDL methods require a response to be sent"]
8151#[derive(Debug)]
8152pub struct StorageAdminListStorageInRealmResponder {
8153 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
8154 tx_id: u32,
8155}
8156
8157impl std::ops::Drop for StorageAdminListStorageInRealmResponder {
8161 fn drop(&mut self) {
8162 self.control_handle.shutdown();
8163 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8165 }
8166}
8167
8168impl fidl::endpoints::Responder for StorageAdminListStorageInRealmResponder {
8169 type ControlHandle = StorageAdminControlHandle;
8170
8171 fn control_handle(&self) -> &StorageAdminControlHandle {
8172 &self.control_handle
8173 }
8174
8175 fn drop_without_shutdown(mut self) {
8176 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8178 std::mem::forget(self);
8180 }
8181}
8182
8183impl StorageAdminListStorageInRealmResponder {
8184 pub fn send(
8188 self,
8189 mut result: Result<(), fidl_fuchsia_component::Error>,
8190 ) -> Result<(), fidl::Error> {
8191 let _result = self.send_raw(result);
8192 if _result.is_err() {
8193 self.control_handle.shutdown();
8194 }
8195 self.drop_without_shutdown();
8196 _result
8197 }
8198
8199 pub fn send_no_shutdown_on_err(
8201 self,
8202 mut result: Result<(), fidl_fuchsia_component::Error>,
8203 ) -> Result<(), fidl::Error> {
8204 let _result = self.send_raw(result);
8205 self.drop_without_shutdown();
8206 _result
8207 }
8208
8209 fn send_raw(
8210 &self,
8211 mut result: Result<(), fidl_fuchsia_component::Error>,
8212 ) -> Result<(), fidl::Error> {
8213 self.control_handle.inner.send::<fidl::encoding::ResultType<
8214 fidl::encoding::EmptyStruct,
8215 fidl_fuchsia_component::Error,
8216 >>(
8217 result,
8218 self.tx_id,
8219 0x764f6d1f083e8bfb,
8220 fidl::encoding::DynamicFlags::empty(),
8221 )
8222 }
8223}
8224
8225#[must_use = "FIDL methods require a response to be sent"]
8226#[derive(Debug)]
8227pub struct StorageAdminOpenComponentStorageByIdResponder {
8228 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
8229 tx_id: u32,
8230}
8231
8232impl std::ops::Drop for StorageAdminOpenComponentStorageByIdResponder {
8236 fn drop(&mut self) {
8237 self.control_handle.shutdown();
8238 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8240 }
8241}
8242
8243impl fidl::endpoints::Responder for StorageAdminOpenComponentStorageByIdResponder {
8244 type ControlHandle = StorageAdminControlHandle;
8245
8246 fn control_handle(&self) -> &StorageAdminControlHandle {
8247 &self.control_handle
8248 }
8249
8250 fn drop_without_shutdown(mut self) {
8251 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8253 std::mem::forget(self);
8255 }
8256}
8257
8258impl StorageAdminOpenComponentStorageByIdResponder {
8259 pub fn send(
8263 self,
8264 mut result: Result<(), fidl_fuchsia_component::Error>,
8265 ) -> Result<(), fidl::Error> {
8266 let _result = self.send_raw(result);
8267 if _result.is_err() {
8268 self.control_handle.shutdown();
8269 }
8270 self.drop_without_shutdown();
8271 _result
8272 }
8273
8274 pub fn send_no_shutdown_on_err(
8276 self,
8277 mut result: Result<(), fidl_fuchsia_component::Error>,
8278 ) -> Result<(), fidl::Error> {
8279 let _result = self.send_raw(result);
8280 self.drop_without_shutdown();
8281 _result
8282 }
8283
8284 fn send_raw(
8285 &self,
8286 mut result: Result<(), fidl_fuchsia_component::Error>,
8287 ) -> Result<(), fidl::Error> {
8288 self.control_handle.inner.send::<fidl::encoding::ResultType<
8289 fidl::encoding::EmptyStruct,
8290 fidl_fuchsia_component::Error,
8291 >>(
8292 result,
8293 self.tx_id,
8294 0x4802102cc55d5df1,
8295 fidl::encoding::DynamicFlags::empty(),
8296 )
8297 }
8298}
8299
8300#[must_use = "FIDL methods require a response to be sent"]
8301#[derive(Debug)]
8302pub struct StorageAdminDeleteComponentStorageResponder {
8303 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
8304 tx_id: u32,
8305}
8306
8307impl std::ops::Drop for StorageAdminDeleteComponentStorageResponder {
8311 fn drop(&mut self) {
8312 self.control_handle.shutdown();
8313 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8315 }
8316}
8317
8318impl fidl::endpoints::Responder for StorageAdminDeleteComponentStorageResponder {
8319 type ControlHandle = StorageAdminControlHandle;
8320
8321 fn control_handle(&self) -> &StorageAdminControlHandle {
8322 &self.control_handle
8323 }
8324
8325 fn drop_without_shutdown(mut self) {
8326 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8328 std::mem::forget(self);
8330 }
8331}
8332
8333impl StorageAdminDeleteComponentStorageResponder {
8334 pub fn send(
8338 self,
8339 mut result: Result<(), fidl_fuchsia_component::Error>,
8340 ) -> Result<(), fidl::Error> {
8341 let _result = self.send_raw(result);
8342 if _result.is_err() {
8343 self.control_handle.shutdown();
8344 }
8345 self.drop_without_shutdown();
8346 _result
8347 }
8348
8349 pub fn send_no_shutdown_on_err(
8351 self,
8352 mut result: Result<(), fidl_fuchsia_component::Error>,
8353 ) -> Result<(), fidl::Error> {
8354 let _result = self.send_raw(result);
8355 self.drop_without_shutdown();
8356 _result
8357 }
8358
8359 fn send_raw(
8360 &self,
8361 mut result: Result<(), fidl_fuchsia_component::Error>,
8362 ) -> Result<(), fidl::Error> {
8363 self.control_handle.inner.send::<fidl::encoding::ResultType<
8364 fidl::encoding::EmptyStruct,
8365 fidl_fuchsia_component::Error,
8366 >>(
8367 result,
8368 self.tx_id,
8369 0x1677c1cdfcdbf45a,
8370 fidl::encoding::DynamicFlags::empty(),
8371 )
8372 }
8373}
8374
8375#[must_use = "FIDL methods require a response to be sent"]
8376#[derive(Debug)]
8377pub struct StorageAdminGetStatusResponder {
8378 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
8379 tx_id: u32,
8380}
8381
8382impl std::ops::Drop for StorageAdminGetStatusResponder {
8386 fn drop(&mut self) {
8387 self.control_handle.shutdown();
8388 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8390 }
8391}
8392
8393impl fidl::endpoints::Responder for StorageAdminGetStatusResponder {
8394 type ControlHandle = StorageAdminControlHandle;
8395
8396 fn control_handle(&self) -> &StorageAdminControlHandle {
8397 &self.control_handle
8398 }
8399
8400 fn drop_without_shutdown(mut self) {
8401 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8403 std::mem::forget(self);
8405 }
8406}
8407
8408impl StorageAdminGetStatusResponder {
8409 pub fn send(self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
8413 let _result = self.send_raw(result);
8414 if _result.is_err() {
8415 self.control_handle.shutdown();
8416 }
8417 self.drop_without_shutdown();
8418 _result
8419 }
8420
8421 pub fn send_no_shutdown_on_err(
8423 self,
8424 mut result: Result<&StorageStatus, StatusError>,
8425 ) -> Result<(), fidl::Error> {
8426 let _result = self.send_raw(result);
8427 self.drop_without_shutdown();
8428 _result
8429 }
8430
8431 fn send_raw(&self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
8432 self.control_handle.inner.send::<fidl::encoding::ResultType<StorageStatus, StatusError>>(
8433 result,
8434 self.tx_id,
8435 0x7729e325a6c526c8,
8436 fidl::encoding::DynamicFlags::empty(),
8437 )
8438 }
8439}
8440
8441#[must_use = "FIDL methods require a response to be sent"]
8442#[derive(Debug)]
8443pub struct StorageAdminDeleteAllStorageContentsResponder {
8444 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
8445 tx_id: u32,
8446}
8447
8448impl std::ops::Drop for StorageAdminDeleteAllStorageContentsResponder {
8452 fn drop(&mut self) {
8453 self.control_handle.shutdown();
8454 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8456 }
8457}
8458
8459impl fidl::endpoints::Responder for StorageAdminDeleteAllStorageContentsResponder {
8460 type ControlHandle = StorageAdminControlHandle;
8461
8462 fn control_handle(&self) -> &StorageAdminControlHandle {
8463 &self.control_handle
8464 }
8465
8466 fn drop_without_shutdown(mut self) {
8467 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8469 std::mem::forget(self);
8471 }
8472}
8473
8474impl StorageAdminDeleteAllStorageContentsResponder {
8475 pub fn send(self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
8479 let _result = self.send_raw(result);
8480 if _result.is_err() {
8481 self.control_handle.shutdown();
8482 }
8483 self.drop_without_shutdown();
8484 _result
8485 }
8486
8487 pub fn send_no_shutdown_on_err(
8489 self,
8490 mut result: Result<(), DeletionError>,
8491 ) -> Result<(), fidl::Error> {
8492 let _result = self.send_raw(result);
8493 self.drop_without_shutdown();
8494 _result
8495 }
8496
8497 fn send_raw(&self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
8498 self.control_handle.inner.send::<fidl::encoding::ResultType<
8499 fidl::encoding::EmptyStruct,
8500 DeletionError,
8501 >>(
8502 result,
8503 self.tx_id,
8504 0x2ee980b4b2d24adb,
8505 fidl::encoding::DynamicFlags::empty(),
8506 )
8507 }
8508}
8509
8510#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8511pub struct StorageIteratorMarker;
8512
8513impl fidl::endpoints::ProtocolMarker for StorageIteratorMarker {
8514 type Proxy = StorageIteratorProxy;
8515 type RequestStream = StorageIteratorRequestStream;
8516 #[cfg(target_os = "fuchsia")]
8517 type SynchronousProxy = StorageIteratorSynchronousProxy;
8518
8519 const DEBUG_NAME: &'static str = "(anonymous) StorageIterator";
8520}
8521
8522pub trait StorageIteratorProxyInterface: Send + Sync {
8523 type NextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
8524 fn r#next(&self) -> Self::NextResponseFut;
8525}
8526#[derive(Debug)]
8527#[cfg(target_os = "fuchsia")]
8528pub struct StorageIteratorSynchronousProxy {
8529 client: fidl::client::sync::Client,
8530}
8531
8532#[cfg(target_os = "fuchsia")]
8533impl fidl::endpoints::SynchronousProxy for StorageIteratorSynchronousProxy {
8534 type Proxy = StorageIteratorProxy;
8535 type Protocol = StorageIteratorMarker;
8536
8537 fn from_channel(inner: fidl::Channel) -> Self {
8538 Self::new(inner)
8539 }
8540
8541 fn into_channel(self) -> fidl::Channel {
8542 self.client.into_channel()
8543 }
8544
8545 fn as_channel(&self) -> &fidl::Channel {
8546 self.client.as_channel()
8547 }
8548}
8549
8550#[cfg(target_os = "fuchsia")]
8551impl StorageIteratorSynchronousProxy {
8552 pub fn new(channel: fidl::Channel) -> Self {
8553 let protocol_name = <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8554 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8555 }
8556
8557 pub fn into_channel(self) -> fidl::Channel {
8558 self.client.into_channel()
8559 }
8560
8561 pub fn wait_for_event(
8564 &self,
8565 deadline: zx::MonotonicInstant,
8566 ) -> Result<StorageIteratorEvent, fidl::Error> {
8567 StorageIteratorEvent::decode(self.client.wait_for_event(deadline)?)
8568 }
8569
8570 pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<String>, fidl::Error> {
8574 let _response =
8575 self.client.send_query::<fidl::encoding::EmptyPayload, StorageIteratorNextResponse>(
8576 (),
8577 0x7a6b21f15fd01b72,
8578 fidl::encoding::DynamicFlags::empty(),
8579 ___deadline,
8580 )?;
8581 Ok(_response.relative_monikers)
8582 }
8583}
8584
8585#[cfg(target_os = "fuchsia")]
8586impl From<StorageIteratorSynchronousProxy> for zx::Handle {
8587 fn from(value: StorageIteratorSynchronousProxy) -> Self {
8588 value.into_channel().into()
8589 }
8590}
8591
8592#[cfg(target_os = "fuchsia")]
8593impl From<fidl::Channel> for StorageIteratorSynchronousProxy {
8594 fn from(value: fidl::Channel) -> Self {
8595 Self::new(value)
8596 }
8597}
8598
8599#[derive(Debug, Clone)]
8600pub struct StorageIteratorProxy {
8601 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8602}
8603
8604impl fidl::endpoints::Proxy for StorageIteratorProxy {
8605 type Protocol = StorageIteratorMarker;
8606
8607 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8608 Self::new(inner)
8609 }
8610
8611 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8612 self.client.into_channel().map_err(|client| Self { client })
8613 }
8614
8615 fn as_channel(&self) -> &::fidl::AsyncChannel {
8616 self.client.as_channel()
8617 }
8618}
8619
8620impl StorageIteratorProxy {
8621 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8623 let protocol_name = <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8624 Self { client: fidl::client::Client::new(channel, protocol_name) }
8625 }
8626
8627 pub fn take_event_stream(&self) -> StorageIteratorEventStream {
8633 StorageIteratorEventStream { event_receiver: self.client.take_event_receiver() }
8634 }
8635
8636 pub fn r#next(
8640 &self,
8641 ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
8642 {
8643 StorageIteratorProxyInterface::r#next(self)
8644 }
8645}
8646
8647impl StorageIteratorProxyInterface for StorageIteratorProxy {
8648 type NextResponseFut =
8649 fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8650 fn r#next(&self) -> Self::NextResponseFut {
8651 fn _decode(
8652 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8653 ) -> Result<Vec<String>, fidl::Error> {
8654 let _response = fidl::client::decode_transaction_body::<
8655 StorageIteratorNextResponse,
8656 fidl::encoding::DefaultFuchsiaResourceDialect,
8657 0x7a6b21f15fd01b72,
8658 >(_buf?)?;
8659 Ok(_response.relative_monikers)
8660 }
8661 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
8662 (),
8663 0x7a6b21f15fd01b72,
8664 fidl::encoding::DynamicFlags::empty(),
8665 _decode,
8666 )
8667 }
8668}
8669
8670pub struct StorageIteratorEventStream {
8671 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8672}
8673
8674impl std::marker::Unpin for StorageIteratorEventStream {}
8675
8676impl futures::stream::FusedStream for StorageIteratorEventStream {
8677 fn is_terminated(&self) -> bool {
8678 self.event_receiver.is_terminated()
8679 }
8680}
8681
8682impl futures::Stream for StorageIteratorEventStream {
8683 type Item = Result<StorageIteratorEvent, fidl::Error>;
8684
8685 fn poll_next(
8686 mut self: std::pin::Pin<&mut Self>,
8687 cx: &mut std::task::Context<'_>,
8688 ) -> std::task::Poll<Option<Self::Item>> {
8689 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8690 &mut self.event_receiver,
8691 cx
8692 )?) {
8693 Some(buf) => std::task::Poll::Ready(Some(StorageIteratorEvent::decode(buf))),
8694 None => std::task::Poll::Ready(None),
8695 }
8696 }
8697}
8698
8699#[derive(Debug)]
8700pub enum StorageIteratorEvent {}
8701
8702impl StorageIteratorEvent {
8703 fn decode(
8705 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8706 ) -> Result<StorageIteratorEvent, fidl::Error> {
8707 let (bytes, _handles) = buf.split_mut();
8708 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8709 debug_assert_eq!(tx_header.tx_id, 0);
8710 match tx_header.ordinal {
8711 _ => Err(fidl::Error::UnknownOrdinal {
8712 ordinal: tx_header.ordinal,
8713 protocol_name:
8714 <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8715 }),
8716 }
8717 }
8718}
8719
8720pub struct StorageIteratorRequestStream {
8722 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8723 is_terminated: bool,
8724}
8725
8726impl std::marker::Unpin for StorageIteratorRequestStream {}
8727
8728impl futures::stream::FusedStream for StorageIteratorRequestStream {
8729 fn is_terminated(&self) -> bool {
8730 self.is_terminated
8731 }
8732}
8733
8734impl fidl::endpoints::RequestStream for StorageIteratorRequestStream {
8735 type Protocol = StorageIteratorMarker;
8736 type ControlHandle = StorageIteratorControlHandle;
8737
8738 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8739 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8740 }
8741
8742 fn control_handle(&self) -> Self::ControlHandle {
8743 StorageIteratorControlHandle { inner: self.inner.clone() }
8744 }
8745
8746 fn into_inner(
8747 self,
8748 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8749 {
8750 (self.inner, self.is_terminated)
8751 }
8752
8753 fn from_inner(
8754 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8755 is_terminated: bool,
8756 ) -> Self {
8757 Self { inner, is_terminated }
8758 }
8759}
8760
8761impl futures::Stream for StorageIteratorRequestStream {
8762 type Item = Result<StorageIteratorRequest, fidl::Error>;
8763
8764 fn poll_next(
8765 mut self: std::pin::Pin<&mut Self>,
8766 cx: &mut std::task::Context<'_>,
8767 ) -> std::task::Poll<Option<Self::Item>> {
8768 let this = &mut *self;
8769 if this.inner.check_shutdown(cx) {
8770 this.is_terminated = true;
8771 return std::task::Poll::Ready(None);
8772 }
8773 if this.is_terminated {
8774 panic!("polled StorageIteratorRequestStream after completion");
8775 }
8776 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8777 |bytes, handles| {
8778 match this.inner.channel().read_etc(cx, bytes, handles) {
8779 std::task::Poll::Ready(Ok(())) => {}
8780 std::task::Poll::Pending => return std::task::Poll::Pending,
8781 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8782 this.is_terminated = true;
8783 return std::task::Poll::Ready(None);
8784 }
8785 std::task::Poll::Ready(Err(e)) => {
8786 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8787 e.into(),
8788 ))))
8789 }
8790 }
8791
8792 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8794
8795 std::task::Poll::Ready(Some(match header.ordinal {
8796 0x7a6b21f15fd01b72 => {
8797 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8798 let mut req = fidl::new_empty!(
8799 fidl::encoding::EmptyPayload,
8800 fidl::encoding::DefaultFuchsiaResourceDialect
8801 );
8802 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8803 let control_handle =
8804 StorageIteratorControlHandle { inner: this.inner.clone() };
8805 Ok(StorageIteratorRequest::Next {
8806 responder: StorageIteratorNextResponder {
8807 control_handle: std::mem::ManuallyDrop::new(control_handle),
8808 tx_id: header.tx_id,
8809 },
8810 })
8811 }
8812 _ => Err(fidl::Error::UnknownOrdinal {
8813 ordinal: header.ordinal,
8814 protocol_name:
8815 <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8816 }),
8817 }))
8818 },
8819 )
8820 }
8821}
8822
8823#[derive(Debug)]
8826pub enum StorageIteratorRequest {
8827 Next { responder: StorageIteratorNextResponder },
8831}
8832
8833impl StorageIteratorRequest {
8834 #[allow(irrefutable_let_patterns)]
8835 pub fn into_next(self) -> Option<(StorageIteratorNextResponder)> {
8836 if let StorageIteratorRequest::Next { responder } = self {
8837 Some((responder))
8838 } else {
8839 None
8840 }
8841 }
8842
8843 pub fn method_name(&self) -> &'static str {
8845 match *self {
8846 StorageIteratorRequest::Next { .. } => "next",
8847 }
8848 }
8849}
8850
8851#[derive(Debug, Clone)]
8852pub struct StorageIteratorControlHandle {
8853 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8854}
8855
8856impl fidl::endpoints::ControlHandle for StorageIteratorControlHandle {
8857 fn shutdown(&self) {
8858 self.inner.shutdown()
8859 }
8860 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8861 self.inner.shutdown_with_epitaph(status)
8862 }
8863
8864 fn is_closed(&self) -> bool {
8865 self.inner.channel().is_closed()
8866 }
8867 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8868 self.inner.channel().on_closed()
8869 }
8870
8871 #[cfg(target_os = "fuchsia")]
8872 fn signal_peer(
8873 &self,
8874 clear_mask: zx::Signals,
8875 set_mask: zx::Signals,
8876 ) -> Result<(), zx_status::Status> {
8877 use fidl::Peered;
8878 self.inner.channel().signal_peer(clear_mask, set_mask)
8879 }
8880}
8881
8882impl StorageIteratorControlHandle {}
8883
8884#[must_use = "FIDL methods require a response to be sent"]
8885#[derive(Debug)]
8886pub struct StorageIteratorNextResponder {
8887 control_handle: std::mem::ManuallyDrop<StorageIteratorControlHandle>,
8888 tx_id: u32,
8889}
8890
8891impl std::ops::Drop for StorageIteratorNextResponder {
8895 fn drop(&mut self) {
8896 self.control_handle.shutdown();
8897 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8899 }
8900}
8901
8902impl fidl::endpoints::Responder for StorageIteratorNextResponder {
8903 type ControlHandle = StorageIteratorControlHandle;
8904
8905 fn control_handle(&self) -> &StorageIteratorControlHandle {
8906 &self.control_handle
8907 }
8908
8909 fn drop_without_shutdown(mut self) {
8910 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8912 std::mem::forget(self);
8914 }
8915}
8916
8917impl StorageIteratorNextResponder {
8918 pub fn send(self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
8922 let _result = self.send_raw(relative_monikers);
8923 if _result.is_err() {
8924 self.control_handle.shutdown();
8925 }
8926 self.drop_without_shutdown();
8927 _result
8928 }
8929
8930 pub fn send_no_shutdown_on_err(
8932 self,
8933 mut relative_monikers: &[String],
8934 ) -> Result<(), fidl::Error> {
8935 let _result = self.send_raw(relative_monikers);
8936 self.drop_without_shutdown();
8937 _result
8938 }
8939
8940 fn send_raw(&self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
8941 self.control_handle.inner.send::<StorageIteratorNextResponse>(
8942 (relative_monikers,),
8943 self.tx_id,
8944 0x7a6b21f15fd01b72,
8945 fidl::encoding::DynamicFlags::empty(),
8946 )
8947 }
8948}
8949
8950#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8951pub struct SystemControllerMarker;
8952
8953impl fidl::endpoints::ProtocolMarker for SystemControllerMarker {
8954 type Proxy = SystemControllerProxy;
8955 type RequestStream = SystemControllerRequestStream;
8956 #[cfg(target_os = "fuchsia")]
8957 type SynchronousProxy = SystemControllerSynchronousProxy;
8958
8959 const DEBUG_NAME: &'static str = "fuchsia.sys2.SystemController";
8960}
8961impl fidl::endpoints::DiscoverableProtocolMarker for SystemControllerMarker {}
8962
8963pub trait SystemControllerProxyInterface: Send + Sync {
8964 type ShutdownResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
8965 fn r#shutdown(&self) -> Self::ShutdownResponseFut;
8966}
8967#[derive(Debug)]
8968#[cfg(target_os = "fuchsia")]
8969pub struct SystemControllerSynchronousProxy {
8970 client: fidl::client::sync::Client,
8971}
8972
8973#[cfg(target_os = "fuchsia")]
8974impl fidl::endpoints::SynchronousProxy for SystemControllerSynchronousProxy {
8975 type Proxy = SystemControllerProxy;
8976 type Protocol = SystemControllerMarker;
8977
8978 fn from_channel(inner: fidl::Channel) -> Self {
8979 Self::new(inner)
8980 }
8981
8982 fn into_channel(self) -> fidl::Channel {
8983 self.client.into_channel()
8984 }
8985
8986 fn as_channel(&self) -> &fidl::Channel {
8987 self.client.as_channel()
8988 }
8989}
8990
8991#[cfg(target_os = "fuchsia")]
8992impl SystemControllerSynchronousProxy {
8993 pub fn new(channel: fidl::Channel) -> Self {
8994 let protocol_name = <SystemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8995 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8996 }
8997
8998 pub fn into_channel(self) -> fidl::Channel {
8999 self.client.into_channel()
9000 }
9001
9002 pub fn wait_for_event(
9005 &self,
9006 deadline: zx::MonotonicInstant,
9007 ) -> Result<SystemControllerEvent, fidl::Error> {
9008 SystemControllerEvent::decode(self.client.wait_for_event(deadline)?)
9009 }
9010
9011 pub fn r#shutdown(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
9015 let _response =
9016 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
9017 (),
9018 0x25f56c938344e549,
9019 fidl::encoding::DynamicFlags::empty(),
9020 ___deadline,
9021 )?;
9022 Ok(_response)
9023 }
9024}
9025
9026#[cfg(target_os = "fuchsia")]
9027impl From<SystemControllerSynchronousProxy> for zx::Handle {
9028 fn from(value: SystemControllerSynchronousProxy) -> Self {
9029 value.into_channel().into()
9030 }
9031}
9032
9033#[cfg(target_os = "fuchsia")]
9034impl From<fidl::Channel> for SystemControllerSynchronousProxy {
9035 fn from(value: fidl::Channel) -> Self {
9036 Self::new(value)
9037 }
9038}
9039
9040#[derive(Debug, Clone)]
9041pub struct SystemControllerProxy {
9042 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9043}
9044
9045impl fidl::endpoints::Proxy for SystemControllerProxy {
9046 type Protocol = SystemControllerMarker;
9047
9048 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9049 Self::new(inner)
9050 }
9051
9052 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9053 self.client.into_channel().map_err(|client| Self { client })
9054 }
9055
9056 fn as_channel(&self) -> &::fidl::AsyncChannel {
9057 self.client.as_channel()
9058 }
9059}
9060
9061impl SystemControllerProxy {
9062 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9064 let protocol_name = <SystemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9065 Self { client: fidl::client::Client::new(channel, protocol_name) }
9066 }
9067
9068 pub fn take_event_stream(&self) -> SystemControllerEventStream {
9074 SystemControllerEventStream { event_receiver: self.client.take_event_receiver() }
9075 }
9076
9077 pub fn r#shutdown(
9081 &self,
9082 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9083 SystemControllerProxyInterface::r#shutdown(self)
9084 }
9085}
9086
9087impl SystemControllerProxyInterface for SystemControllerProxy {
9088 type ShutdownResponseFut =
9089 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9090 fn r#shutdown(&self) -> Self::ShutdownResponseFut {
9091 fn _decode(
9092 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9093 ) -> Result<(), fidl::Error> {
9094 let _response = fidl::client::decode_transaction_body::<
9095 fidl::encoding::EmptyPayload,
9096 fidl::encoding::DefaultFuchsiaResourceDialect,
9097 0x25f56c938344e549,
9098 >(_buf?)?;
9099 Ok(_response)
9100 }
9101 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
9102 (),
9103 0x25f56c938344e549,
9104 fidl::encoding::DynamicFlags::empty(),
9105 _decode,
9106 )
9107 }
9108}
9109
9110pub struct SystemControllerEventStream {
9111 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9112}
9113
9114impl std::marker::Unpin for SystemControllerEventStream {}
9115
9116impl futures::stream::FusedStream for SystemControllerEventStream {
9117 fn is_terminated(&self) -> bool {
9118 self.event_receiver.is_terminated()
9119 }
9120}
9121
9122impl futures::Stream for SystemControllerEventStream {
9123 type Item = Result<SystemControllerEvent, fidl::Error>;
9124
9125 fn poll_next(
9126 mut self: std::pin::Pin<&mut Self>,
9127 cx: &mut std::task::Context<'_>,
9128 ) -> std::task::Poll<Option<Self::Item>> {
9129 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9130 &mut self.event_receiver,
9131 cx
9132 )?) {
9133 Some(buf) => std::task::Poll::Ready(Some(SystemControllerEvent::decode(buf))),
9134 None => std::task::Poll::Ready(None),
9135 }
9136 }
9137}
9138
9139#[derive(Debug)]
9140pub enum SystemControllerEvent {}
9141
9142impl SystemControllerEvent {
9143 fn decode(
9145 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9146 ) -> Result<SystemControllerEvent, fidl::Error> {
9147 let (bytes, _handles) = buf.split_mut();
9148 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9149 debug_assert_eq!(tx_header.tx_id, 0);
9150 match tx_header.ordinal {
9151 _ => Err(fidl::Error::UnknownOrdinal {
9152 ordinal: tx_header.ordinal,
9153 protocol_name:
9154 <SystemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9155 }),
9156 }
9157 }
9158}
9159
9160pub struct SystemControllerRequestStream {
9162 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9163 is_terminated: bool,
9164}
9165
9166impl std::marker::Unpin for SystemControllerRequestStream {}
9167
9168impl futures::stream::FusedStream for SystemControllerRequestStream {
9169 fn is_terminated(&self) -> bool {
9170 self.is_terminated
9171 }
9172}
9173
9174impl fidl::endpoints::RequestStream for SystemControllerRequestStream {
9175 type Protocol = SystemControllerMarker;
9176 type ControlHandle = SystemControllerControlHandle;
9177
9178 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9179 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9180 }
9181
9182 fn control_handle(&self) -> Self::ControlHandle {
9183 SystemControllerControlHandle { inner: self.inner.clone() }
9184 }
9185
9186 fn into_inner(
9187 self,
9188 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9189 {
9190 (self.inner, self.is_terminated)
9191 }
9192
9193 fn from_inner(
9194 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9195 is_terminated: bool,
9196 ) -> Self {
9197 Self { inner, is_terminated }
9198 }
9199}
9200
9201impl futures::Stream for SystemControllerRequestStream {
9202 type Item = Result<SystemControllerRequest, fidl::Error>;
9203
9204 fn poll_next(
9205 mut self: std::pin::Pin<&mut Self>,
9206 cx: &mut std::task::Context<'_>,
9207 ) -> std::task::Poll<Option<Self::Item>> {
9208 let this = &mut *self;
9209 if this.inner.check_shutdown(cx) {
9210 this.is_terminated = true;
9211 return std::task::Poll::Ready(None);
9212 }
9213 if this.is_terminated {
9214 panic!("polled SystemControllerRequestStream after completion");
9215 }
9216 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9217 |bytes, handles| {
9218 match this.inner.channel().read_etc(cx, bytes, handles) {
9219 std::task::Poll::Ready(Ok(())) => {}
9220 std::task::Poll::Pending => return std::task::Poll::Pending,
9221 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9222 this.is_terminated = true;
9223 return std::task::Poll::Ready(None);
9224 }
9225 std::task::Poll::Ready(Err(e)) => {
9226 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9227 e.into(),
9228 ))))
9229 }
9230 }
9231
9232 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9234
9235 std::task::Poll::Ready(Some(match header.ordinal {
9236 0x25f56c938344e549 => {
9237 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9238 let mut req = fidl::new_empty!(
9239 fidl::encoding::EmptyPayload,
9240 fidl::encoding::DefaultFuchsiaResourceDialect
9241 );
9242 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9243 let control_handle =
9244 SystemControllerControlHandle { inner: this.inner.clone() };
9245 Ok(SystemControllerRequest::Shutdown {
9246 responder: SystemControllerShutdownResponder {
9247 control_handle: std::mem::ManuallyDrop::new(control_handle),
9248 tx_id: header.tx_id,
9249 },
9250 })
9251 }
9252 _ => Err(fidl::Error::UnknownOrdinal {
9253 ordinal: header.ordinal,
9254 protocol_name:
9255 <SystemControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9256 }),
9257 }))
9258 },
9259 )
9260 }
9261}
9262
9263#[derive(Debug)]
9266pub enum SystemControllerRequest {
9267 Shutdown { responder: SystemControllerShutdownResponder },
9271}
9272
9273impl SystemControllerRequest {
9274 #[allow(irrefutable_let_patterns)]
9275 pub fn into_shutdown(self) -> Option<(SystemControllerShutdownResponder)> {
9276 if let SystemControllerRequest::Shutdown { responder } = self {
9277 Some((responder))
9278 } else {
9279 None
9280 }
9281 }
9282
9283 pub fn method_name(&self) -> &'static str {
9285 match *self {
9286 SystemControllerRequest::Shutdown { .. } => "shutdown",
9287 }
9288 }
9289}
9290
9291#[derive(Debug, Clone)]
9292pub struct SystemControllerControlHandle {
9293 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9294}
9295
9296impl fidl::endpoints::ControlHandle for SystemControllerControlHandle {
9297 fn shutdown(&self) {
9298 self.inner.shutdown()
9299 }
9300 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9301 self.inner.shutdown_with_epitaph(status)
9302 }
9303
9304 fn is_closed(&self) -> bool {
9305 self.inner.channel().is_closed()
9306 }
9307 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9308 self.inner.channel().on_closed()
9309 }
9310
9311 #[cfg(target_os = "fuchsia")]
9312 fn signal_peer(
9313 &self,
9314 clear_mask: zx::Signals,
9315 set_mask: zx::Signals,
9316 ) -> Result<(), zx_status::Status> {
9317 use fidl::Peered;
9318 self.inner.channel().signal_peer(clear_mask, set_mask)
9319 }
9320}
9321
9322impl SystemControllerControlHandle {}
9323
9324#[must_use = "FIDL methods require a response to be sent"]
9325#[derive(Debug)]
9326pub struct SystemControllerShutdownResponder {
9327 control_handle: std::mem::ManuallyDrop<SystemControllerControlHandle>,
9328 tx_id: u32,
9329}
9330
9331impl std::ops::Drop for SystemControllerShutdownResponder {
9335 fn drop(&mut self) {
9336 self.control_handle.shutdown();
9337 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9339 }
9340}
9341
9342impl fidl::endpoints::Responder for SystemControllerShutdownResponder {
9343 type ControlHandle = SystemControllerControlHandle;
9344
9345 fn control_handle(&self) -> &SystemControllerControlHandle {
9346 &self.control_handle
9347 }
9348
9349 fn drop_without_shutdown(mut self) {
9350 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9352 std::mem::forget(self);
9354 }
9355}
9356
9357impl SystemControllerShutdownResponder {
9358 pub fn send(self) -> Result<(), fidl::Error> {
9362 let _result = self.send_raw();
9363 if _result.is_err() {
9364 self.control_handle.shutdown();
9365 }
9366 self.drop_without_shutdown();
9367 _result
9368 }
9369
9370 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9372 let _result = self.send_raw();
9373 self.drop_without_shutdown();
9374 _result
9375 }
9376
9377 fn send_raw(&self) -> Result<(), fidl::Error> {
9378 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9379 (),
9380 self.tx_id,
9381 0x25f56c938344e549,
9382 fidl::encoding::DynamicFlags::empty(),
9383 )
9384 }
9385}
9386
9387mod internal {
9388 use super::*;
9389
9390 impl fidl::encoding::ResourceTypeMarker for CrashIntrospectFindComponentByThreadKoidRequest {
9391 type Borrowed<'a> = &'a mut Self;
9392 fn take_or_borrow<'a>(
9393 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9394 ) -> Self::Borrowed<'a> {
9395 value
9396 }
9397 }
9398
9399 unsafe impl fidl::encoding::TypeMarker for CrashIntrospectFindComponentByThreadKoidRequest {
9400 type Owned = Self;
9401
9402 #[inline(always)]
9403 fn inline_align(_context: fidl::encoding::Context) -> usize {
9404 8
9405 }
9406
9407 #[inline(always)]
9408 fn inline_size(_context: fidl::encoding::Context) -> usize {
9409 8
9410 }
9411 #[inline(always)]
9412 fn encode_is_copy() -> bool {
9413 true
9414 }
9415
9416 #[inline(always)]
9417 fn decode_is_copy() -> bool {
9418 true
9419 }
9420 }
9421
9422 unsafe impl
9423 fidl::encoding::Encode<
9424 CrashIntrospectFindComponentByThreadKoidRequest,
9425 fidl::encoding::DefaultFuchsiaResourceDialect,
9426 > for &mut CrashIntrospectFindComponentByThreadKoidRequest
9427 {
9428 #[inline]
9429 unsafe fn encode(
9430 self,
9431 encoder: &mut fidl::encoding::Encoder<
9432 '_,
9433 fidl::encoding::DefaultFuchsiaResourceDialect,
9434 >,
9435 offset: usize,
9436 _depth: fidl::encoding::Depth,
9437 ) -> fidl::Result<()> {
9438 encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidRequest>(offset);
9439 unsafe {
9440 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9442 (buf_ptr as *mut CrashIntrospectFindComponentByThreadKoidRequest).write_unaligned(
9443 (self as *const CrashIntrospectFindComponentByThreadKoidRequest).read(),
9444 );
9445 }
9448 Ok(())
9449 }
9450 }
9451 unsafe impl<T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>>
9452 fidl::encoding::Encode<
9453 CrashIntrospectFindComponentByThreadKoidRequest,
9454 fidl::encoding::DefaultFuchsiaResourceDialect,
9455 > for (T0,)
9456 {
9457 #[inline]
9458 unsafe fn encode(
9459 self,
9460 encoder: &mut fidl::encoding::Encoder<
9461 '_,
9462 fidl::encoding::DefaultFuchsiaResourceDialect,
9463 >,
9464 offset: usize,
9465 depth: fidl::encoding::Depth,
9466 ) -> fidl::Result<()> {
9467 encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidRequest>(offset);
9468 self.0.encode(encoder, offset + 0, depth)?;
9472 Ok(())
9473 }
9474 }
9475
9476 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9477 for CrashIntrospectFindComponentByThreadKoidRequest
9478 {
9479 #[inline(always)]
9480 fn new_empty() -> Self {
9481 Self {
9482 thread_koid: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
9483 }
9484 }
9485
9486 #[inline]
9487 unsafe fn decode(
9488 &mut self,
9489 decoder: &mut fidl::encoding::Decoder<
9490 '_,
9491 fidl::encoding::DefaultFuchsiaResourceDialect,
9492 >,
9493 offset: usize,
9494 _depth: fidl::encoding::Depth,
9495 ) -> fidl::Result<()> {
9496 decoder.debug_check_bounds::<Self>(offset);
9497 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9498 unsafe {
9501 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9502 }
9503 Ok(())
9504 }
9505 }
9506
9507 impl fidl::encoding::ResourceTypeMarker for LifecycleControllerCreateInstanceRequest {
9508 type Borrowed<'a> = &'a mut Self;
9509 fn take_or_borrow<'a>(
9510 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9511 ) -> Self::Borrowed<'a> {
9512 value
9513 }
9514 }
9515
9516 unsafe impl fidl::encoding::TypeMarker for LifecycleControllerCreateInstanceRequest {
9517 type Owned = Self;
9518
9519 #[inline(always)]
9520 fn inline_align(_context: fidl::encoding::Context) -> usize {
9521 8
9522 }
9523
9524 #[inline(always)]
9525 fn inline_size(_context: fidl::encoding::Context) -> usize {
9526 64
9527 }
9528 }
9529
9530 unsafe impl
9531 fidl::encoding::Encode<
9532 LifecycleControllerCreateInstanceRequest,
9533 fidl::encoding::DefaultFuchsiaResourceDialect,
9534 > for &mut LifecycleControllerCreateInstanceRequest
9535 {
9536 #[inline]
9537 unsafe fn encode(
9538 self,
9539 encoder: &mut fidl::encoding::Encoder<
9540 '_,
9541 fidl::encoding::DefaultFuchsiaResourceDialect,
9542 >,
9543 offset: usize,
9544 _depth: fidl::encoding::Depth,
9545 ) -> fidl::Result<()> {
9546 encoder.debug_check_bounds::<LifecycleControllerCreateInstanceRequest>(offset);
9547 fidl::encoding::Encode::<LifecycleControllerCreateInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9549 (
9550 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.parent_moniker),
9551 <fidl_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
9552 <fidl_fuchsia_component_decl::Child as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
9553 <fidl_fuchsia_component::CreateChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
9554 ),
9555 encoder, offset, _depth
9556 )
9557 }
9558 }
9559 unsafe impl<
9560 T0: fidl::encoding::Encode<
9561 fidl::encoding::BoundedString<4096>,
9562 fidl::encoding::DefaultFuchsiaResourceDialect,
9563 >,
9564 T1: fidl::encoding::Encode<
9565 fidl_fuchsia_component_decl::CollectionRef,
9566 fidl::encoding::DefaultFuchsiaResourceDialect,
9567 >,
9568 T2: fidl::encoding::Encode<
9569 fidl_fuchsia_component_decl::Child,
9570 fidl::encoding::DefaultFuchsiaResourceDialect,
9571 >,
9572 T3: fidl::encoding::Encode<
9573 fidl_fuchsia_component::CreateChildArgs,
9574 fidl::encoding::DefaultFuchsiaResourceDialect,
9575 >,
9576 >
9577 fidl::encoding::Encode<
9578 LifecycleControllerCreateInstanceRequest,
9579 fidl::encoding::DefaultFuchsiaResourceDialect,
9580 > for (T0, T1, T2, T3)
9581 {
9582 #[inline]
9583 unsafe fn encode(
9584 self,
9585 encoder: &mut fidl::encoding::Encoder<
9586 '_,
9587 fidl::encoding::DefaultFuchsiaResourceDialect,
9588 >,
9589 offset: usize,
9590 depth: fidl::encoding::Depth,
9591 ) -> fidl::Result<()> {
9592 encoder.debug_check_bounds::<LifecycleControllerCreateInstanceRequest>(offset);
9593 self.0.encode(encoder, offset + 0, depth)?;
9597 self.1.encode(encoder, offset + 16, depth)?;
9598 self.2.encode(encoder, offset + 32, depth)?;
9599 self.3.encode(encoder, offset + 48, depth)?;
9600 Ok(())
9601 }
9602 }
9603
9604 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9605 for LifecycleControllerCreateInstanceRequest
9606 {
9607 #[inline(always)]
9608 fn new_empty() -> Self {
9609 Self {
9610 parent_moniker: fidl::new_empty!(
9611 fidl::encoding::BoundedString<4096>,
9612 fidl::encoding::DefaultFuchsiaResourceDialect
9613 ),
9614 collection: fidl::new_empty!(
9615 fidl_fuchsia_component_decl::CollectionRef,
9616 fidl::encoding::DefaultFuchsiaResourceDialect
9617 ),
9618 decl: fidl::new_empty!(
9619 fidl_fuchsia_component_decl::Child,
9620 fidl::encoding::DefaultFuchsiaResourceDialect
9621 ),
9622 args: fidl::new_empty!(
9623 fidl_fuchsia_component::CreateChildArgs,
9624 fidl::encoding::DefaultFuchsiaResourceDialect
9625 ),
9626 }
9627 }
9628
9629 #[inline]
9630 unsafe fn decode(
9631 &mut self,
9632 decoder: &mut fidl::encoding::Decoder<
9633 '_,
9634 fidl::encoding::DefaultFuchsiaResourceDialect,
9635 >,
9636 offset: usize,
9637 _depth: fidl::encoding::Depth,
9638 ) -> fidl::Result<()> {
9639 decoder.debug_check_bounds::<Self>(offset);
9640 fidl::decode!(
9642 fidl::encoding::BoundedString<4096>,
9643 fidl::encoding::DefaultFuchsiaResourceDialect,
9644 &mut self.parent_moniker,
9645 decoder,
9646 offset + 0,
9647 _depth
9648 )?;
9649 fidl::decode!(
9650 fidl_fuchsia_component_decl::CollectionRef,
9651 fidl::encoding::DefaultFuchsiaResourceDialect,
9652 &mut self.collection,
9653 decoder,
9654 offset + 16,
9655 _depth
9656 )?;
9657 fidl::decode!(
9658 fidl_fuchsia_component_decl::Child,
9659 fidl::encoding::DefaultFuchsiaResourceDialect,
9660 &mut self.decl,
9661 decoder,
9662 offset + 32,
9663 _depth
9664 )?;
9665 fidl::decode!(
9666 fidl_fuchsia_component::CreateChildArgs,
9667 fidl::encoding::DefaultFuchsiaResourceDialect,
9668 &mut self.args,
9669 decoder,
9670 offset + 48,
9671 _depth
9672 )?;
9673 Ok(())
9674 }
9675 }
9676
9677 impl fidl::encoding::ResourceTypeMarker for LifecycleControllerStartInstanceRequest {
9678 type Borrowed<'a> = &'a mut Self;
9679 fn take_or_borrow<'a>(
9680 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9681 ) -> Self::Borrowed<'a> {
9682 value
9683 }
9684 }
9685
9686 unsafe impl fidl::encoding::TypeMarker for LifecycleControllerStartInstanceRequest {
9687 type Owned = Self;
9688
9689 #[inline(always)]
9690 fn inline_align(_context: fidl::encoding::Context) -> usize {
9691 8
9692 }
9693
9694 #[inline(always)]
9695 fn inline_size(_context: fidl::encoding::Context) -> usize {
9696 24
9697 }
9698 }
9699
9700 unsafe impl
9701 fidl::encoding::Encode<
9702 LifecycleControllerStartInstanceRequest,
9703 fidl::encoding::DefaultFuchsiaResourceDialect,
9704 > for &mut LifecycleControllerStartInstanceRequest
9705 {
9706 #[inline]
9707 unsafe fn encode(
9708 self,
9709 encoder: &mut fidl::encoding::Encoder<
9710 '_,
9711 fidl::encoding::DefaultFuchsiaResourceDialect,
9712 >,
9713 offset: usize,
9714 _depth: fidl::encoding::Depth,
9715 ) -> fidl::Result<()> {
9716 encoder.debug_check_bounds::<LifecycleControllerStartInstanceRequest>(offset);
9717 fidl::encoding::Encode::<LifecycleControllerStartInstanceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9719 (
9720 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
9721 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.binder),
9722 ),
9723 encoder, offset, _depth
9724 )
9725 }
9726 }
9727 unsafe impl<
9728 T0: fidl::encoding::Encode<
9729 fidl::encoding::BoundedString<4096>,
9730 fidl::encoding::DefaultFuchsiaResourceDialect,
9731 >,
9732 T1: fidl::encoding::Encode<
9733 fidl::encoding::Endpoint<
9734 fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
9735 >,
9736 fidl::encoding::DefaultFuchsiaResourceDialect,
9737 >,
9738 >
9739 fidl::encoding::Encode<
9740 LifecycleControllerStartInstanceRequest,
9741 fidl::encoding::DefaultFuchsiaResourceDialect,
9742 > for (T0, T1)
9743 {
9744 #[inline]
9745 unsafe fn encode(
9746 self,
9747 encoder: &mut fidl::encoding::Encoder<
9748 '_,
9749 fidl::encoding::DefaultFuchsiaResourceDialect,
9750 >,
9751 offset: usize,
9752 depth: fidl::encoding::Depth,
9753 ) -> fidl::Result<()> {
9754 encoder.debug_check_bounds::<LifecycleControllerStartInstanceRequest>(offset);
9755 unsafe {
9758 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9759 (ptr as *mut u64).write_unaligned(0);
9760 }
9761 self.0.encode(encoder, offset + 0, depth)?;
9763 self.1.encode(encoder, offset + 16, depth)?;
9764 Ok(())
9765 }
9766 }
9767
9768 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9769 for LifecycleControllerStartInstanceRequest
9770 {
9771 #[inline(always)]
9772 fn new_empty() -> Self {
9773 Self {
9774 moniker: fidl::new_empty!(
9775 fidl::encoding::BoundedString<4096>,
9776 fidl::encoding::DefaultFuchsiaResourceDialect
9777 ),
9778 binder: fidl::new_empty!(
9779 fidl::encoding::Endpoint<
9780 fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
9781 >,
9782 fidl::encoding::DefaultFuchsiaResourceDialect
9783 ),
9784 }
9785 }
9786
9787 #[inline]
9788 unsafe fn decode(
9789 &mut self,
9790 decoder: &mut fidl::encoding::Decoder<
9791 '_,
9792 fidl::encoding::DefaultFuchsiaResourceDialect,
9793 >,
9794 offset: usize,
9795 _depth: fidl::encoding::Depth,
9796 ) -> fidl::Result<()> {
9797 decoder.debug_check_bounds::<Self>(offset);
9798 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9800 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9801 let mask = 0xffffffff00000000u64;
9802 let maskedval = padval & mask;
9803 if maskedval != 0 {
9804 return Err(fidl::Error::NonZeroPadding {
9805 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9806 });
9807 }
9808 fidl::decode!(
9809 fidl::encoding::BoundedString<4096>,
9810 fidl::encoding::DefaultFuchsiaResourceDialect,
9811 &mut self.moniker,
9812 decoder,
9813 offset + 0,
9814 _depth
9815 )?;
9816 fidl::decode!(
9817 fidl::encoding::Endpoint<
9818 fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
9819 >,
9820 fidl::encoding::DefaultFuchsiaResourceDialect,
9821 &mut self.binder,
9822 decoder,
9823 offset + 16,
9824 _depth
9825 )?;
9826 Ok(())
9827 }
9828 }
9829
9830 impl fidl::encoding::ResourceTypeMarker for LifecycleControllerStartInstanceWithArgsRequest {
9831 type Borrowed<'a> = &'a mut Self;
9832 fn take_or_borrow<'a>(
9833 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9834 ) -> Self::Borrowed<'a> {
9835 value
9836 }
9837 }
9838
9839 unsafe impl fidl::encoding::TypeMarker for LifecycleControllerStartInstanceWithArgsRequest {
9840 type Owned = Self;
9841
9842 #[inline(always)]
9843 fn inline_align(_context: fidl::encoding::Context) -> usize {
9844 8
9845 }
9846
9847 #[inline(always)]
9848 fn inline_size(_context: fidl::encoding::Context) -> usize {
9849 40
9850 }
9851 }
9852
9853 unsafe impl
9854 fidl::encoding::Encode<
9855 LifecycleControllerStartInstanceWithArgsRequest,
9856 fidl::encoding::DefaultFuchsiaResourceDialect,
9857 > for &mut LifecycleControllerStartInstanceWithArgsRequest
9858 {
9859 #[inline]
9860 unsafe fn encode(
9861 self,
9862 encoder: &mut fidl::encoding::Encoder<
9863 '_,
9864 fidl::encoding::DefaultFuchsiaResourceDialect,
9865 >,
9866 offset: usize,
9867 _depth: fidl::encoding::Depth,
9868 ) -> fidl::Result<()> {
9869 encoder.debug_check_bounds::<LifecycleControllerStartInstanceWithArgsRequest>(offset);
9870 fidl::encoding::Encode::<LifecycleControllerStartInstanceWithArgsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9872 (
9873 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
9874 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.binder),
9875 <fidl_fuchsia_component::StartChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
9876 ),
9877 encoder, offset, _depth
9878 )
9879 }
9880 }
9881 unsafe impl<
9882 T0: fidl::encoding::Encode<
9883 fidl::encoding::BoundedString<4096>,
9884 fidl::encoding::DefaultFuchsiaResourceDialect,
9885 >,
9886 T1: fidl::encoding::Encode<
9887 fidl::encoding::Endpoint<
9888 fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
9889 >,
9890 fidl::encoding::DefaultFuchsiaResourceDialect,
9891 >,
9892 T2: fidl::encoding::Encode<
9893 fidl_fuchsia_component::StartChildArgs,
9894 fidl::encoding::DefaultFuchsiaResourceDialect,
9895 >,
9896 >
9897 fidl::encoding::Encode<
9898 LifecycleControllerStartInstanceWithArgsRequest,
9899 fidl::encoding::DefaultFuchsiaResourceDialect,
9900 > for (T0, T1, T2)
9901 {
9902 #[inline]
9903 unsafe fn encode(
9904 self,
9905 encoder: &mut fidl::encoding::Encoder<
9906 '_,
9907 fidl::encoding::DefaultFuchsiaResourceDialect,
9908 >,
9909 offset: usize,
9910 depth: fidl::encoding::Depth,
9911 ) -> fidl::Result<()> {
9912 encoder.debug_check_bounds::<LifecycleControllerStartInstanceWithArgsRequest>(offset);
9913 unsafe {
9916 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9917 (ptr as *mut u64).write_unaligned(0);
9918 }
9919 self.0.encode(encoder, offset + 0, depth)?;
9921 self.1.encode(encoder, offset + 16, depth)?;
9922 self.2.encode(encoder, offset + 24, depth)?;
9923 Ok(())
9924 }
9925 }
9926
9927 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9928 for LifecycleControllerStartInstanceWithArgsRequest
9929 {
9930 #[inline(always)]
9931 fn new_empty() -> Self {
9932 Self {
9933 moniker: fidl::new_empty!(
9934 fidl::encoding::BoundedString<4096>,
9935 fidl::encoding::DefaultFuchsiaResourceDialect
9936 ),
9937 binder: fidl::new_empty!(
9938 fidl::encoding::Endpoint<
9939 fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
9940 >,
9941 fidl::encoding::DefaultFuchsiaResourceDialect
9942 ),
9943 args: fidl::new_empty!(
9944 fidl_fuchsia_component::StartChildArgs,
9945 fidl::encoding::DefaultFuchsiaResourceDialect
9946 ),
9947 }
9948 }
9949
9950 #[inline]
9951 unsafe fn decode(
9952 &mut self,
9953 decoder: &mut fidl::encoding::Decoder<
9954 '_,
9955 fidl::encoding::DefaultFuchsiaResourceDialect,
9956 >,
9957 offset: usize,
9958 _depth: fidl::encoding::Depth,
9959 ) -> fidl::Result<()> {
9960 decoder.debug_check_bounds::<Self>(offset);
9961 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9963 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9964 let mask = 0xffffffff00000000u64;
9965 let maskedval = padval & mask;
9966 if maskedval != 0 {
9967 return Err(fidl::Error::NonZeroPadding {
9968 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9969 });
9970 }
9971 fidl::decode!(
9972 fidl::encoding::BoundedString<4096>,
9973 fidl::encoding::DefaultFuchsiaResourceDialect,
9974 &mut self.moniker,
9975 decoder,
9976 offset + 0,
9977 _depth
9978 )?;
9979 fidl::decode!(
9980 fidl::encoding::Endpoint<
9981 fidl::endpoints::ServerEnd<fidl_fuchsia_component::BinderMarker>,
9982 >,
9983 fidl::encoding::DefaultFuchsiaResourceDialect,
9984 &mut self.binder,
9985 decoder,
9986 offset + 16,
9987 _depth
9988 )?;
9989 fidl::decode!(
9990 fidl_fuchsia_component::StartChildArgs,
9991 fidl::encoding::DefaultFuchsiaResourceDialect,
9992 &mut self.args,
9993 decoder,
9994 offset + 24,
9995 _depth
9996 )?;
9997 Ok(())
9998 }
9999 }
10000
10001 impl fidl::encoding::ResourceTypeMarker for RealmQueryConnectToStorageAdminRequest {
10002 type Borrowed<'a> = &'a mut Self;
10003 fn take_or_borrow<'a>(
10004 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10005 ) -> Self::Borrowed<'a> {
10006 value
10007 }
10008 }
10009
10010 unsafe impl fidl::encoding::TypeMarker for RealmQueryConnectToStorageAdminRequest {
10011 type Owned = Self;
10012
10013 #[inline(always)]
10014 fn inline_align(_context: fidl::encoding::Context) -> usize {
10015 8
10016 }
10017
10018 #[inline(always)]
10019 fn inline_size(_context: fidl::encoding::Context) -> usize {
10020 40
10021 }
10022 }
10023
10024 unsafe impl
10025 fidl::encoding::Encode<
10026 RealmQueryConnectToStorageAdminRequest,
10027 fidl::encoding::DefaultFuchsiaResourceDialect,
10028 > for &mut RealmQueryConnectToStorageAdminRequest
10029 {
10030 #[inline]
10031 unsafe fn encode(
10032 self,
10033 encoder: &mut fidl::encoding::Encoder<
10034 '_,
10035 fidl::encoding::DefaultFuchsiaResourceDialect,
10036 >,
10037 offset: usize,
10038 _depth: fidl::encoding::Depth,
10039 ) -> fidl::Result<()> {
10040 encoder.debug_check_bounds::<RealmQueryConnectToStorageAdminRequest>(offset);
10041 fidl::encoding::Encode::<RealmQueryConnectToStorageAdminRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10043 (
10044 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
10045 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(&self.storage_name),
10046 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
10047 ),
10048 encoder, offset, _depth
10049 )
10050 }
10051 }
10052 unsafe impl<
10053 T0: fidl::encoding::Encode<
10054 fidl::encoding::BoundedString<4096>,
10055 fidl::encoding::DefaultFuchsiaResourceDialect,
10056 >,
10057 T1: fidl::encoding::Encode<
10058 fidl::encoding::BoundedString<100>,
10059 fidl::encoding::DefaultFuchsiaResourceDialect,
10060 >,
10061 T2: fidl::encoding::Encode<
10062 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>>,
10063 fidl::encoding::DefaultFuchsiaResourceDialect,
10064 >,
10065 >
10066 fidl::encoding::Encode<
10067 RealmQueryConnectToStorageAdminRequest,
10068 fidl::encoding::DefaultFuchsiaResourceDialect,
10069 > for (T0, T1, T2)
10070 {
10071 #[inline]
10072 unsafe fn encode(
10073 self,
10074 encoder: &mut fidl::encoding::Encoder<
10075 '_,
10076 fidl::encoding::DefaultFuchsiaResourceDialect,
10077 >,
10078 offset: usize,
10079 depth: fidl::encoding::Depth,
10080 ) -> fidl::Result<()> {
10081 encoder.debug_check_bounds::<RealmQueryConnectToStorageAdminRequest>(offset);
10082 unsafe {
10085 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
10086 (ptr as *mut u64).write_unaligned(0);
10087 }
10088 self.0.encode(encoder, offset + 0, depth)?;
10090 self.1.encode(encoder, offset + 16, depth)?;
10091 self.2.encode(encoder, offset + 32, depth)?;
10092 Ok(())
10093 }
10094 }
10095
10096 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10097 for RealmQueryConnectToStorageAdminRequest
10098 {
10099 #[inline(always)]
10100 fn new_empty() -> Self {
10101 Self {
10102 moniker: fidl::new_empty!(
10103 fidl::encoding::BoundedString<4096>,
10104 fidl::encoding::DefaultFuchsiaResourceDialect
10105 ),
10106 storage_name: fidl::new_empty!(
10107 fidl::encoding::BoundedString<100>,
10108 fidl::encoding::DefaultFuchsiaResourceDialect
10109 ),
10110 server_end: fidl::new_empty!(
10111 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>>,
10112 fidl::encoding::DefaultFuchsiaResourceDialect
10113 ),
10114 }
10115 }
10116
10117 #[inline]
10118 unsafe fn decode(
10119 &mut self,
10120 decoder: &mut fidl::encoding::Decoder<
10121 '_,
10122 fidl::encoding::DefaultFuchsiaResourceDialect,
10123 >,
10124 offset: usize,
10125 _depth: fidl::encoding::Depth,
10126 ) -> fidl::Result<()> {
10127 decoder.debug_check_bounds::<Self>(offset);
10128 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
10130 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10131 let mask = 0xffffffff00000000u64;
10132 let maskedval = padval & mask;
10133 if maskedval != 0 {
10134 return Err(fidl::Error::NonZeroPadding {
10135 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
10136 });
10137 }
10138 fidl::decode!(
10139 fidl::encoding::BoundedString<4096>,
10140 fidl::encoding::DefaultFuchsiaResourceDialect,
10141 &mut self.moniker,
10142 decoder,
10143 offset + 0,
10144 _depth
10145 )?;
10146 fidl::decode!(
10147 fidl::encoding::BoundedString<100>,
10148 fidl::encoding::DefaultFuchsiaResourceDialect,
10149 &mut self.storage_name,
10150 decoder,
10151 offset + 16,
10152 _depth
10153 )?;
10154 fidl::decode!(
10155 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageAdminMarker>>,
10156 fidl::encoding::DefaultFuchsiaResourceDialect,
10157 &mut self.server_end,
10158 decoder,
10159 offset + 32,
10160 _depth
10161 )?;
10162 Ok(())
10163 }
10164 }
10165
10166 impl fidl::encoding::ResourceTypeMarker for RealmQueryDeprecatedOpenRequest {
10167 type Borrowed<'a> = &'a mut Self;
10168 fn take_or_borrow<'a>(
10169 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10170 ) -> Self::Borrowed<'a> {
10171 value
10172 }
10173 }
10174
10175 unsafe impl fidl::encoding::TypeMarker for RealmQueryDeprecatedOpenRequest {
10176 type Owned = Self;
10177
10178 #[inline(always)]
10179 fn inline_align(_context: fidl::encoding::Context) -> usize {
10180 8
10181 }
10182
10183 #[inline(always)]
10184 fn inline_size(_context: fidl::encoding::Context) -> usize {
10185 56
10186 }
10187 }
10188
10189 unsafe impl
10190 fidl::encoding::Encode<
10191 RealmQueryDeprecatedOpenRequest,
10192 fidl::encoding::DefaultFuchsiaResourceDialect,
10193 > for &mut RealmQueryDeprecatedOpenRequest
10194 {
10195 #[inline]
10196 unsafe fn encode(
10197 self,
10198 encoder: &mut fidl::encoding::Encoder<
10199 '_,
10200 fidl::encoding::DefaultFuchsiaResourceDialect,
10201 >,
10202 offset: usize,
10203 _depth: fidl::encoding::Depth,
10204 ) -> fidl::Result<()> {
10205 encoder.debug_check_bounds::<RealmQueryDeprecatedOpenRequest>(offset);
10206 fidl::encoding::Encode::<RealmQueryDeprecatedOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10208 (
10209 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
10210 <OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.dir_type),
10211 <fidl_fuchsia_io::OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
10212 <fidl_fuchsia_io::ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
10213 <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
10214 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
10215 ),
10216 encoder, offset, _depth
10217 )
10218 }
10219 }
10220 unsafe impl<
10221 T0: fidl::encoding::Encode<
10222 fidl::encoding::BoundedString<4096>,
10223 fidl::encoding::DefaultFuchsiaResourceDialect,
10224 >,
10225 T1: fidl::encoding::Encode<OpenDirType, fidl::encoding::DefaultFuchsiaResourceDialect>,
10226 T2: fidl::encoding::Encode<
10227 fidl_fuchsia_io::OpenFlags,
10228 fidl::encoding::DefaultFuchsiaResourceDialect,
10229 >,
10230 T3: fidl::encoding::Encode<
10231 fidl_fuchsia_io::ModeType,
10232 fidl::encoding::DefaultFuchsiaResourceDialect,
10233 >,
10234 T4: fidl::encoding::Encode<
10235 fidl::encoding::BoundedString<4095>,
10236 fidl::encoding::DefaultFuchsiaResourceDialect,
10237 >,
10238 T5: fidl::encoding::Encode<
10239 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
10240 fidl::encoding::DefaultFuchsiaResourceDialect,
10241 >,
10242 >
10243 fidl::encoding::Encode<
10244 RealmQueryDeprecatedOpenRequest,
10245 fidl::encoding::DefaultFuchsiaResourceDialect,
10246 > for (T0, T1, T2, T3, T4, T5)
10247 {
10248 #[inline]
10249 unsafe fn encode(
10250 self,
10251 encoder: &mut fidl::encoding::Encoder<
10252 '_,
10253 fidl::encoding::DefaultFuchsiaResourceDialect,
10254 >,
10255 offset: usize,
10256 depth: fidl::encoding::Depth,
10257 ) -> fidl::Result<()> {
10258 encoder.debug_check_bounds::<RealmQueryDeprecatedOpenRequest>(offset);
10259 unsafe {
10262 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
10263 (ptr as *mut u64).write_unaligned(0);
10264 }
10265 unsafe {
10266 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
10267 (ptr as *mut u64).write_unaligned(0);
10268 }
10269 self.0.encode(encoder, offset + 0, depth)?;
10271 self.1.encode(encoder, offset + 16, depth)?;
10272 self.2.encode(encoder, offset + 20, depth)?;
10273 self.3.encode(encoder, offset + 24, depth)?;
10274 self.4.encode(encoder, offset + 32, depth)?;
10275 self.5.encode(encoder, offset + 48, depth)?;
10276 Ok(())
10277 }
10278 }
10279
10280 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10281 for RealmQueryDeprecatedOpenRequest
10282 {
10283 #[inline(always)]
10284 fn new_empty() -> Self {
10285 Self {
10286 moniker: fidl::new_empty!(
10287 fidl::encoding::BoundedString<4096>,
10288 fidl::encoding::DefaultFuchsiaResourceDialect
10289 ),
10290 dir_type: fidl::new_empty!(
10291 OpenDirType,
10292 fidl::encoding::DefaultFuchsiaResourceDialect
10293 ),
10294 flags: fidl::new_empty!(
10295 fidl_fuchsia_io::OpenFlags,
10296 fidl::encoding::DefaultFuchsiaResourceDialect
10297 ),
10298 mode: fidl::new_empty!(
10299 fidl_fuchsia_io::ModeType,
10300 fidl::encoding::DefaultFuchsiaResourceDialect
10301 ),
10302 path: fidl::new_empty!(
10303 fidl::encoding::BoundedString<4095>,
10304 fidl::encoding::DefaultFuchsiaResourceDialect
10305 ),
10306 object: fidl::new_empty!(
10307 fidl::encoding::Endpoint<
10308 fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
10309 >,
10310 fidl::encoding::DefaultFuchsiaResourceDialect
10311 ),
10312 }
10313 }
10314
10315 #[inline]
10316 unsafe fn decode(
10317 &mut self,
10318 decoder: &mut fidl::encoding::Decoder<
10319 '_,
10320 fidl::encoding::DefaultFuchsiaResourceDialect,
10321 >,
10322 offset: usize,
10323 _depth: fidl::encoding::Depth,
10324 ) -> fidl::Result<()> {
10325 decoder.debug_check_bounds::<Self>(offset);
10326 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
10328 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10329 let mask = 0xffffffff00000000u64;
10330 let maskedval = padval & mask;
10331 if maskedval != 0 {
10332 return Err(fidl::Error::NonZeroPadding {
10333 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
10334 });
10335 }
10336 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
10337 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10338 let mask = 0xffffffff00000000u64;
10339 let maskedval = padval & mask;
10340 if maskedval != 0 {
10341 return Err(fidl::Error::NonZeroPadding {
10342 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
10343 });
10344 }
10345 fidl::decode!(
10346 fidl::encoding::BoundedString<4096>,
10347 fidl::encoding::DefaultFuchsiaResourceDialect,
10348 &mut self.moniker,
10349 decoder,
10350 offset + 0,
10351 _depth
10352 )?;
10353 fidl::decode!(
10354 OpenDirType,
10355 fidl::encoding::DefaultFuchsiaResourceDialect,
10356 &mut self.dir_type,
10357 decoder,
10358 offset + 16,
10359 _depth
10360 )?;
10361 fidl::decode!(
10362 fidl_fuchsia_io::OpenFlags,
10363 fidl::encoding::DefaultFuchsiaResourceDialect,
10364 &mut self.flags,
10365 decoder,
10366 offset + 20,
10367 _depth
10368 )?;
10369 fidl::decode!(
10370 fidl_fuchsia_io::ModeType,
10371 fidl::encoding::DefaultFuchsiaResourceDialect,
10372 &mut self.mode,
10373 decoder,
10374 offset + 24,
10375 _depth
10376 )?;
10377 fidl::decode!(
10378 fidl::encoding::BoundedString<4095>,
10379 fidl::encoding::DefaultFuchsiaResourceDialect,
10380 &mut self.path,
10381 decoder,
10382 offset + 32,
10383 _depth
10384 )?;
10385 fidl::decode!(
10386 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
10387 fidl::encoding::DefaultFuchsiaResourceDialect,
10388 &mut self.object,
10389 decoder,
10390 offset + 48,
10391 _depth
10392 )?;
10393 Ok(())
10394 }
10395 }
10396
10397 impl fidl::encoding::ResourceTypeMarker for RealmQueryOpenDirectoryRequest {
10398 type Borrowed<'a> = &'a mut Self;
10399 fn take_or_borrow<'a>(
10400 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10401 ) -> Self::Borrowed<'a> {
10402 value
10403 }
10404 }
10405
10406 unsafe impl fidl::encoding::TypeMarker for RealmQueryOpenDirectoryRequest {
10407 type Owned = Self;
10408
10409 #[inline(always)]
10410 fn inline_align(_context: fidl::encoding::Context) -> usize {
10411 8
10412 }
10413
10414 #[inline(always)]
10415 fn inline_size(_context: fidl::encoding::Context) -> usize {
10416 24
10417 }
10418 }
10419
10420 unsafe impl
10421 fidl::encoding::Encode<
10422 RealmQueryOpenDirectoryRequest,
10423 fidl::encoding::DefaultFuchsiaResourceDialect,
10424 > for &mut RealmQueryOpenDirectoryRequest
10425 {
10426 #[inline]
10427 unsafe fn encode(
10428 self,
10429 encoder: &mut fidl::encoding::Encoder<
10430 '_,
10431 fidl::encoding::DefaultFuchsiaResourceDialect,
10432 >,
10433 offset: usize,
10434 _depth: fidl::encoding::Depth,
10435 ) -> fidl::Result<()> {
10436 encoder.debug_check_bounds::<RealmQueryOpenDirectoryRequest>(offset);
10437 fidl::encoding::Encode::<RealmQueryOpenDirectoryRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10439 (
10440 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
10441 <OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.dir_type),
10442 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
10443 ),
10444 encoder, offset, _depth
10445 )
10446 }
10447 }
10448 unsafe impl<
10449 T0: fidl::encoding::Encode<
10450 fidl::encoding::BoundedString<4096>,
10451 fidl::encoding::DefaultFuchsiaResourceDialect,
10452 >,
10453 T1: fidl::encoding::Encode<OpenDirType, fidl::encoding::DefaultFuchsiaResourceDialect>,
10454 T2: fidl::encoding::Encode<
10455 fidl::encoding::Endpoint<
10456 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
10457 >,
10458 fidl::encoding::DefaultFuchsiaResourceDialect,
10459 >,
10460 >
10461 fidl::encoding::Encode<
10462 RealmQueryOpenDirectoryRequest,
10463 fidl::encoding::DefaultFuchsiaResourceDialect,
10464 > for (T0, T1, T2)
10465 {
10466 #[inline]
10467 unsafe fn encode(
10468 self,
10469 encoder: &mut fidl::encoding::Encoder<
10470 '_,
10471 fidl::encoding::DefaultFuchsiaResourceDialect,
10472 >,
10473 offset: usize,
10474 depth: fidl::encoding::Depth,
10475 ) -> fidl::Result<()> {
10476 encoder.debug_check_bounds::<RealmQueryOpenDirectoryRequest>(offset);
10477 self.0.encode(encoder, offset + 0, depth)?;
10481 self.1.encode(encoder, offset + 16, depth)?;
10482 self.2.encode(encoder, offset + 20, depth)?;
10483 Ok(())
10484 }
10485 }
10486
10487 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10488 for RealmQueryOpenDirectoryRequest
10489 {
10490 #[inline(always)]
10491 fn new_empty() -> Self {
10492 Self {
10493 moniker: fidl::new_empty!(
10494 fidl::encoding::BoundedString<4096>,
10495 fidl::encoding::DefaultFuchsiaResourceDialect
10496 ),
10497 dir_type: fidl::new_empty!(
10498 OpenDirType,
10499 fidl::encoding::DefaultFuchsiaResourceDialect
10500 ),
10501 object: fidl::new_empty!(
10502 fidl::encoding::Endpoint<
10503 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
10504 >,
10505 fidl::encoding::DefaultFuchsiaResourceDialect
10506 ),
10507 }
10508 }
10509
10510 #[inline]
10511 unsafe fn decode(
10512 &mut self,
10513 decoder: &mut fidl::encoding::Decoder<
10514 '_,
10515 fidl::encoding::DefaultFuchsiaResourceDialect,
10516 >,
10517 offset: usize,
10518 _depth: fidl::encoding::Depth,
10519 ) -> fidl::Result<()> {
10520 decoder.debug_check_bounds::<Self>(offset);
10521 fidl::decode!(
10523 fidl::encoding::BoundedString<4096>,
10524 fidl::encoding::DefaultFuchsiaResourceDialect,
10525 &mut self.moniker,
10526 decoder,
10527 offset + 0,
10528 _depth
10529 )?;
10530 fidl::decode!(
10531 OpenDirType,
10532 fidl::encoding::DefaultFuchsiaResourceDialect,
10533 &mut self.dir_type,
10534 decoder,
10535 offset + 16,
10536 _depth
10537 )?;
10538 fidl::decode!(
10539 fidl::encoding::Endpoint<
10540 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
10541 >,
10542 fidl::encoding::DefaultFuchsiaResourceDialect,
10543 &mut self.object,
10544 decoder,
10545 offset + 20,
10546 _depth
10547 )?;
10548 Ok(())
10549 }
10550 }
10551
10552 impl fidl::encoding::ResourceTypeMarker for RealmQueryConstructNamespaceResponse {
10553 type Borrowed<'a> = &'a mut Self;
10554 fn take_or_borrow<'a>(
10555 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10556 ) -> Self::Borrowed<'a> {
10557 value
10558 }
10559 }
10560
10561 unsafe impl fidl::encoding::TypeMarker for RealmQueryConstructNamespaceResponse {
10562 type Owned = Self;
10563
10564 #[inline(always)]
10565 fn inline_align(_context: fidl::encoding::Context) -> usize {
10566 8
10567 }
10568
10569 #[inline(always)]
10570 fn inline_size(_context: fidl::encoding::Context) -> usize {
10571 16
10572 }
10573 }
10574
10575 unsafe impl
10576 fidl::encoding::Encode<
10577 RealmQueryConstructNamespaceResponse,
10578 fidl::encoding::DefaultFuchsiaResourceDialect,
10579 > for &mut RealmQueryConstructNamespaceResponse
10580 {
10581 #[inline]
10582 unsafe fn encode(
10583 self,
10584 encoder: &mut fidl::encoding::Encoder<
10585 '_,
10586 fidl::encoding::DefaultFuchsiaResourceDialect,
10587 >,
10588 offset: usize,
10589 _depth: fidl::encoding::Depth,
10590 ) -> fidl::Result<()> {
10591 encoder.debug_check_bounds::<RealmQueryConstructNamespaceResponse>(offset);
10592 fidl::encoding::Encode::<
10594 RealmQueryConstructNamespaceResponse,
10595 fidl::encoding::DefaultFuchsiaResourceDialect,
10596 >::encode(
10597 (<fidl::encoding::UnboundedVector<
10598 fidl_fuchsia_component_runner::ComponentNamespaceEntry,
10599 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10600 &mut self.namespace
10601 ),),
10602 encoder,
10603 offset,
10604 _depth,
10605 )
10606 }
10607 }
10608 unsafe impl<
10609 T0: fidl::encoding::Encode<
10610 fidl::encoding::UnboundedVector<
10611 fidl_fuchsia_component_runner::ComponentNamespaceEntry,
10612 >,
10613 fidl::encoding::DefaultFuchsiaResourceDialect,
10614 >,
10615 >
10616 fidl::encoding::Encode<
10617 RealmQueryConstructNamespaceResponse,
10618 fidl::encoding::DefaultFuchsiaResourceDialect,
10619 > for (T0,)
10620 {
10621 #[inline]
10622 unsafe fn encode(
10623 self,
10624 encoder: &mut fidl::encoding::Encoder<
10625 '_,
10626 fidl::encoding::DefaultFuchsiaResourceDialect,
10627 >,
10628 offset: usize,
10629 depth: fidl::encoding::Depth,
10630 ) -> fidl::Result<()> {
10631 encoder.debug_check_bounds::<RealmQueryConstructNamespaceResponse>(offset);
10632 self.0.encode(encoder, offset + 0, depth)?;
10636 Ok(())
10637 }
10638 }
10639
10640 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10641 for RealmQueryConstructNamespaceResponse
10642 {
10643 #[inline(always)]
10644 fn new_empty() -> Self {
10645 Self {
10646 namespace: fidl::new_empty!(
10647 fidl::encoding::UnboundedVector<
10648 fidl_fuchsia_component_runner::ComponentNamespaceEntry,
10649 >,
10650 fidl::encoding::DefaultFuchsiaResourceDialect
10651 ),
10652 }
10653 }
10654
10655 #[inline]
10656 unsafe fn decode(
10657 &mut self,
10658 decoder: &mut fidl::encoding::Decoder<
10659 '_,
10660 fidl::encoding::DefaultFuchsiaResourceDialect,
10661 >,
10662 offset: usize,
10663 _depth: fidl::encoding::Depth,
10664 ) -> fidl::Result<()> {
10665 decoder.debug_check_bounds::<Self>(offset);
10666 fidl::decode!(
10668 fidl::encoding::UnboundedVector<
10669 fidl_fuchsia_component_runner::ComponentNamespaceEntry,
10670 >,
10671 fidl::encoding::DefaultFuchsiaResourceDialect,
10672 &mut self.namespace,
10673 decoder,
10674 offset + 0,
10675 _depth
10676 )?;
10677 Ok(())
10678 }
10679 }
10680
10681 impl fidl::encoding::ResourceTypeMarker for RealmQueryGetAllInstancesResponse {
10682 type Borrowed<'a> = &'a mut Self;
10683 fn take_or_borrow<'a>(
10684 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10685 ) -> Self::Borrowed<'a> {
10686 value
10687 }
10688 }
10689
10690 unsafe impl fidl::encoding::TypeMarker for RealmQueryGetAllInstancesResponse {
10691 type Owned = Self;
10692
10693 #[inline(always)]
10694 fn inline_align(_context: fidl::encoding::Context) -> usize {
10695 4
10696 }
10697
10698 #[inline(always)]
10699 fn inline_size(_context: fidl::encoding::Context) -> usize {
10700 4
10701 }
10702 }
10703
10704 unsafe impl
10705 fidl::encoding::Encode<
10706 RealmQueryGetAllInstancesResponse,
10707 fidl::encoding::DefaultFuchsiaResourceDialect,
10708 > for &mut RealmQueryGetAllInstancesResponse
10709 {
10710 #[inline]
10711 unsafe fn encode(
10712 self,
10713 encoder: &mut fidl::encoding::Encoder<
10714 '_,
10715 fidl::encoding::DefaultFuchsiaResourceDialect,
10716 >,
10717 offset: usize,
10718 _depth: fidl::encoding::Depth,
10719 ) -> fidl::Result<()> {
10720 encoder.debug_check_bounds::<RealmQueryGetAllInstancesResponse>(offset);
10721 fidl::encoding::Encode::<RealmQueryGetAllInstancesResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10723 (
10724 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
10725 ),
10726 encoder, offset, _depth
10727 )
10728 }
10729 }
10730 unsafe impl<
10731 T0: fidl::encoding::Encode<
10732 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>>,
10733 fidl::encoding::DefaultFuchsiaResourceDialect,
10734 >,
10735 >
10736 fidl::encoding::Encode<
10737 RealmQueryGetAllInstancesResponse,
10738 fidl::encoding::DefaultFuchsiaResourceDialect,
10739 > for (T0,)
10740 {
10741 #[inline]
10742 unsafe fn encode(
10743 self,
10744 encoder: &mut fidl::encoding::Encoder<
10745 '_,
10746 fidl::encoding::DefaultFuchsiaResourceDialect,
10747 >,
10748 offset: usize,
10749 depth: fidl::encoding::Depth,
10750 ) -> fidl::Result<()> {
10751 encoder.debug_check_bounds::<RealmQueryGetAllInstancesResponse>(offset);
10752 self.0.encode(encoder, offset + 0, depth)?;
10756 Ok(())
10757 }
10758 }
10759
10760 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10761 for RealmQueryGetAllInstancesResponse
10762 {
10763 #[inline(always)]
10764 fn new_empty() -> Self {
10765 Self {
10766 iterator: fidl::new_empty!(
10767 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>>,
10768 fidl::encoding::DefaultFuchsiaResourceDialect
10769 ),
10770 }
10771 }
10772
10773 #[inline]
10774 unsafe fn decode(
10775 &mut self,
10776 decoder: &mut fidl::encoding::Decoder<
10777 '_,
10778 fidl::encoding::DefaultFuchsiaResourceDialect,
10779 >,
10780 offset: usize,
10781 _depth: fidl::encoding::Depth,
10782 ) -> fidl::Result<()> {
10783 decoder.debug_check_bounds::<Self>(offset);
10784 fidl::decode!(
10786 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<InstanceIteratorMarker>>,
10787 fidl::encoding::DefaultFuchsiaResourceDialect,
10788 &mut self.iterator,
10789 decoder,
10790 offset + 0,
10791 _depth
10792 )?;
10793 Ok(())
10794 }
10795 }
10796
10797 impl fidl::encoding::ResourceTypeMarker for RealmQueryGetManifestResponse {
10798 type Borrowed<'a> = &'a mut Self;
10799 fn take_or_borrow<'a>(
10800 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10801 ) -> Self::Borrowed<'a> {
10802 value
10803 }
10804 }
10805
10806 unsafe impl fidl::encoding::TypeMarker for RealmQueryGetManifestResponse {
10807 type Owned = Self;
10808
10809 #[inline(always)]
10810 fn inline_align(_context: fidl::encoding::Context) -> usize {
10811 4
10812 }
10813
10814 #[inline(always)]
10815 fn inline_size(_context: fidl::encoding::Context) -> usize {
10816 4
10817 }
10818 }
10819
10820 unsafe impl
10821 fidl::encoding::Encode<
10822 RealmQueryGetManifestResponse,
10823 fidl::encoding::DefaultFuchsiaResourceDialect,
10824 > for &mut RealmQueryGetManifestResponse
10825 {
10826 #[inline]
10827 unsafe fn encode(
10828 self,
10829 encoder: &mut fidl::encoding::Encoder<
10830 '_,
10831 fidl::encoding::DefaultFuchsiaResourceDialect,
10832 >,
10833 offset: usize,
10834 _depth: fidl::encoding::Depth,
10835 ) -> fidl::Result<()> {
10836 encoder.debug_check_bounds::<RealmQueryGetManifestResponse>(offset);
10837 fidl::encoding::Encode::<
10839 RealmQueryGetManifestResponse,
10840 fidl::encoding::DefaultFuchsiaResourceDialect,
10841 >::encode(
10842 (
10843 <fidl::encoding::Endpoint<
10844 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
10845 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10846 &mut self.iterator
10847 ),
10848 ),
10849 encoder,
10850 offset,
10851 _depth,
10852 )
10853 }
10854 }
10855 unsafe impl<
10856 T0: fidl::encoding::Encode<
10857 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
10858 fidl::encoding::DefaultFuchsiaResourceDialect,
10859 >,
10860 >
10861 fidl::encoding::Encode<
10862 RealmQueryGetManifestResponse,
10863 fidl::encoding::DefaultFuchsiaResourceDialect,
10864 > for (T0,)
10865 {
10866 #[inline]
10867 unsafe fn encode(
10868 self,
10869 encoder: &mut fidl::encoding::Encoder<
10870 '_,
10871 fidl::encoding::DefaultFuchsiaResourceDialect,
10872 >,
10873 offset: usize,
10874 depth: fidl::encoding::Depth,
10875 ) -> fidl::Result<()> {
10876 encoder.debug_check_bounds::<RealmQueryGetManifestResponse>(offset);
10877 self.0.encode(encoder, offset + 0, depth)?;
10881 Ok(())
10882 }
10883 }
10884
10885 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10886 for RealmQueryGetManifestResponse
10887 {
10888 #[inline(always)]
10889 fn new_empty() -> Self {
10890 Self {
10891 iterator: fidl::new_empty!(
10892 fidl::encoding::Endpoint<
10893 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
10894 >,
10895 fidl::encoding::DefaultFuchsiaResourceDialect
10896 ),
10897 }
10898 }
10899
10900 #[inline]
10901 unsafe fn decode(
10902 &mut self,
10903 decoder: &mut fidl::encoding::Decoder<
10904 '_,
10905 fidl::encoding::DefaultFuchsiaResourceDialect,
10906 >,
10907 offset: usize,
10908 _depth: fidl::encoding::Depth,
10909 ) -> fidl::Result<()> {
10910 decoder.debug_check_bounds::<Self>(offset);
10911 fidl::decode!(
10913 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
10914 fidl::encoding::DefaultFuchsiaResourceDialect,
10915 &mut self.iterator,
10916 decoder,
10917 offset + 0,
10918 _depth
10919 )?;
10920 Ok(())
10921 }
10922 }
10923
10924 impl fidl::encoding::ResourceTypeMarker for RealmQueryGetResolvedDeclarationResponse {
10925 type Borrowed<'a> = &'a mut Self;
10926 fn take_or_borrow<'a>(
10927 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10928 ) -> Self::Borrowed<'a> {
10929 value
10930 }
10931 }
10932
10933 unsafe impl fidl::encoding::TypeMarker for RealmQueryGetResolvedDeclarationResponse {
10934 type Owned = Self;
10935
10936 #[inline(always)]
10937 fn inline_align(_context: fidl::encoding::Context) -> usize {
10938 4
10939 }
10940
10941 #[inline(always)]
10942 fn inline_size(_context: fidl::encoding::Context) -> usize {
10943 4
10944 }
10945 }
10946
10947 unsafe impl
10948 fidl::encoding::Encode<
10949 RealmQueryGetResolvedDeclarationResponse,
10950 fidl::encoding::DefaultFuchsiaResourceDialect,
10951 > for &mut RealmQueryGetResolvedDeclarationResponse
10952 {
10953 #[inline]
10954 unsafe fn encode(
10955 self,
10956 encoder: &mut fidl::encoding::Encoder<
10957 '_,
10958 fidl::encoding::DefaultFuchsiaResourceDialect,
10959 >,
10960 offset: usize,
10961 _depth: fidl::encoding::Depth,
10962 ) -> fidl::Result<()> {
10963 encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationResponse>(offset);
10964 fidl::encoding::Encode::<
10966 RealmQueryGetResolvedDeclarationResponse,
10967 fidl::encoding::DefaultFuchsiaResourceDialect,
10968 >::encode(
10969 (
10970 <fidl::encoding::Endpoint<
10971 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
10972 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10973 &mut self.iterator
10974 ),
10975 ),
10976 encoder,
10977 offset,
10978 _depth,
10979 )
10980 }
10981 }
10982 unsafe impl<
10983 T0: fidl::encoding::Encode<
10984 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
10985 fidl::encoding::DefaultFuchsiaResourceDialect,
10986 >,
10987 >
10988 fidl::encoding::Encode<
10989 RealmQueryGetResolvedDeclarationResponse,
10990 fidl::encoding::DefaultFuchsiaResourceDialect,
10991 > for (T0,)
10992 {
10993 #[inline]
10994 unsafe fn encode(
10995 self,
10996 encoder: &mut fidl::encoding::Encoder<
10997 '_,
10998 fidl::encoding::DefaultFuchsiaResourceDialect,
10999 >,
11000 offset: usize,
11001 depth: fidl::encoding::Depth,
11002 ) -> fidl::Result<()> {
11003 encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationResponse>(offset);
11004 self.0.encode(encoder, offset + 0, depth)?;
11008 Ok(())
11009 }
11010 }
11011
11012 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11013 for RealmQueryGetResolvedDeclarationResponse
11014 {
11015 #[inline(always)]
11016 fn new_empty() -> Self {
11017 Self {
11018 iterator: fidl::new_empty!(
11019 fidl::encoding::Endpoint<
11020 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
11021 >,
11022 fidl::encoding::DefaultFuchsiaResourceDialect
11023 ),
11024 }
11025 }
11026
11027 #[inline]
11028 unsafe fn decode(
11029 &mut self,
11030 decoder: &mut fidl::encoding::Decoder<
11031 '_,
11032 fidl::encoding::DefaultFuchsiaResourceDialect,
11033 >,
11034 offset: usize,
11035 _depth: fidl::encoding::Depth,
11036 ) -> fidl::Result<()> {
11037 decoder.debug_check_bounds::<Self>(offset);
11038 fidl::decode!(
11040 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
11041 fidl::encoding::DefaultFuchsiaResourceDialect,
11042 &mut self.iterator,
11043 decoder,
11044 offset + 0,
11045 _depth
11046 )?;
11047 Ok(())
11048 }
11049 }
11050
11051 impl fidl::encoding::ResourceTypeMarker for RealmQueryResolveDeclarationResponse {
11052 type Borrowed<'a> = &'a mut Self;
11053 fn take_or_borrow<'a>(
11054 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11055 ) -> Self::Borrowed<'a> {
11056 value
11057 }
11058 }
11059
11060 unsafe impl fidl::encoding::TypeMarker for RealmQueryResolveDeclarationResponse {
11061 type Owned = Self;
11062
11063 #[inline(always)]
11064 fn inline_align(_context: fidl::encoding::Context) -> usize {
11065 4
11066 }
11067
11068 #[inline(always)]
11069 fn inline_size(_context: fidl::encoding::Context) -> usize {
11070 4
11071 }
11072 }
11073
11074 unsafe impl
11075 fidl::encoding::Encode<
11076 RealmQueryResolveDeclarationResponse,
11077 fidl::encoding::DefaultFuchsiaResourceDialect,
11078 > for &mut RealmQueryResolveDeclarationResponse
11079 {
11080 #[inline]
11081 unsafe fn encode(
11082 self,
11083 encoder: &mut fidl::encoding::Encoder<
11084 '_,
11085 fidl::encoding::DefaultFuchsiaResourceDialect,
11086 >,
11087 offset: usize,
11088 _depth: fidl::encoding::Depth,
11089 ) -> fidl::Result<()> {
11090 encoder.debug_check_bounds::<RealmQueryResolveDeclarationResponse>(offset);
11091 fidl::encoding::Encode::<
11093 RealmQueryResolveDeclarationResponse,
11094 fidl::encoding::DefaultFuchsiaResourceDialect,
11095 >::encode(
11096 (
11097 <fidl::encoding::Endpoint<
11098 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
11099 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11100 &mut self.iterator
11101 ),
11102 ),
11103 encoder,
11104 offset,
11105 _depth,
11106 )
11107 }
11108 }
11109 unsafe impl<
11110 T0: fidl::encoding::Encode<
11111 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
11112 fidl::encoding::DefaultFuchsiaResourceDialect,
11113 >,
11114 >
11115 fidl::encoding::Encode<
11116 RealmQueryResolveDeclarationResponse,
11117 fidl::encoding::DefaultFuchsiaResourceDialect,
11118 > for (T0,)
11119 {
11120 #[inline]
11121 unsafe fn encode(
11122 self,
11123 encoder: &mut fidl::encoding::Encoder<
11124 '_,
11125 fidl::encoding::DefaultFuchsiaResourceDialect,
11126 >,
11127 offset: usize,
11128 depth: fidl::encoding::Depth,
11129 ) -> fidl::Result<()> {
11130 encoder.debug_check_bounds::<RealmQueryResolveDeclarationResponse>(offset);
11131 self.0.encode(encoder, offset + 0, depth)?;
11135 Ok(())
11136 }
11137 }
11138
11139 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11140 for RealmQueryResolveDeclarationResponse
11141 {
11142 #[inline(always)]
11143 fn new_empty() -> Self {
11144 Self {
11145 iterator: fidl::new_empty!(
11146 fidl::encoding::Endpoint<
11147 fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>,
11148 >,
11149 fidl::encoding::DefaultFuchsiaResourceDialect
11150 ),
11151 }
11152 }
11153
11154 #[inline]
11155 unsafe fn decode(
11156 &mut self,
11157 decoder: &mut fidl::encoding::Decoder<
11158 '_,
11159 fidl::encoding::DefaultFuchsiaResourceDialect,
11160 >,
11161 offset: usize,
11162 _depth: fidl::encoding::Depth,
11163 ) -> fidl::Result<()> {
11164 decoder.debug_check_bounds::<Self>(offset);
11165 fidl::decode!(
11167 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<ManifestBytesIteratorMarker>>,
11168 fidl::encoding::DefaultFuchsiaResourceDialect,
11169 &mut self.iterator,
11170 decoder,
11171 offset + 0,
11172 _depth
11173 )?;
11174 Ok(())
11175 }
11176 }
11177
11178 impl fidl::encoding::ResourceTypeMarker for StorageAdminDeprecatedOpenComponentStorageRequest {
11179 type Borrowed<'a> = &'a mut Self;
11180 fn take_or_borrow<'a>(
11181 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11182 ) -> Self::Borrowed<'a> {
11183 value
11184 }
11185 }
11186
11187 unsafe impl fidl::encoding::TypeMarker for StorageAdminDeprecatedOpenComponentStorageRequest {
11188 type Owned = Self;
11189
11190 #[inline(always)]
11191 fn inline_align(_context: fidl::encoding::Context) -> usize {
11192 8
11193 }
11194
11195 #[inline(always)]
11196 fn inline_size(_context: fidl::encoding::Context) -> usize {
11197 32
11198 }
11199 }
11200
11201 unsafe impl
11202 fidl::encoding::Encode<
11203 StorageAdminDeprecatedOpenComponentStorageRequest,
11204 fidl::encoding::DefaultFuchsiaResourceDialect,
11205 > for &mut StorageAdminDeprecatedOpenComponentStorageRequest
11206 {
11207 #[inline]
11208 unsafe fn encode(
11209 self,
11210 encoder: &mut fidl::encoding::Encoder<
11211 '_,
11212 fidl::encoding::DefaultFuchsiaResourceDialect,
11213 >,
11214 offset: usize,
11215 _depth: fidl::encoding::Depth,
11216 ) -> fidl::Result<()> {
11217 encoder.debug_check_bounds::<StorageAdminDeprecatedOpenComponentStorageRequest>(offset);
11218 fidl::encoding::Encode::<StorageAdminDeprecatedOpenComponentStorageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11220 (
11221 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
11222 <fidl_fuchsia_io::OpenFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
11223 <fidl_fuchsia_io::ModeType as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
11224 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
11225 ),
11226 encoder, offset, _depth
11227 )
11228 }
11229 }
11230 unsafe impl<
11231 T0: fidl::encoding::Encode<
11232 fidl::encoding::BoundedString<4096>,
11233 fidl::encoding::DefaultFuchsiaResourceDialect,
11234 >,
11235 T1: fidl::encoding::Encode<
11236 fidl_fuchsia_io::OpenFlags,
11237 fidl::encoding::DefaultFuchsiaResourceDialect,
11238 >,
11239 T2: fidl::encoding::Encode<
11240 fidl_fuchsia_io::ModeType,
11241 fidl::encoding::DefaultFuchsiaResourceDialect,
11242 >,
11243 T3: fidl::encoding::Encode<
11244 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11245 fidl::encoding::DefaultFuchsiaResourceDialect,
11246 >,
11247 >
11248 fidl::encoding::Encode<
11249 StorageAdminDeprecatedOpenComponentStorageRequest,
11250 fidl::encoding::DefaultFuchsiaResourceDialect,
11251 > for (T0, T1, T2, T3)
11252 {
11253 #[inline]
11254 unsafe fn encode(
11255 self,
11256 encoder: &mut fidl::encoding::Encoder<
11257 '_,
11258 fidl::encoding::DefaultFuchsiaResourceDialect,
11259 >,
11260 offset: usize,
11261 depth: fidl::encoding::Depth,
11262 ) -> fidl::Result<()> {
11263 encoder.debug_check_bounds::<StorageAdminDeprecatedOpenComponentStorageRequest>(offset);
11264 unsafe {
11267 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
11268 (ptr as *mut u64).write_unaligned(0);
11269 }
11270 self.0.encode(encoder, offset + 0, depth)?;
11272 self.1.encode(encoder, offset + 16, depth)?;
11273 self.2.encode(encoder, offset + 20, depth)?;
11274 self.3.encode(encoder, offset + 24, depth)?;
11275 Ok(())
11276 }
11277 }
11278
11279 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11280 for StorageAdminDeprecatedOpenComponentStorageRequest
11281 {
11282 #[inline(always)]
11283 fn new_empty() -> Self {
11284 Self {
11285 relative_moniker: fidl::new_empty!(
11286 fidl::encoding::BoundedString<4096>,
11287 fidl::encoding::DefaultFuchsiaResourceDialect
11288 ),
11289 flags: fidl::new_empty!(
11290 fidl_fuchsia_io::OpenFlags,
11291 fidl::encoding::DefaultFuchsiaResourceDialect
11292 ),
11293 mode: fidl::new_empty!(
11294 fidl_fuchsia_io::ModeType,
11295 fidl::encoding::DefaultFuchsiaResourceDialect
11296 ),
11297 object: fidl::new_empty!(
11298 fidl::encoding::Endpoint<
11299 fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
11300 >,
11301 fidl::encoding::DefaultFuchsiaResourceDialect
11302 ),
11303 }
11304 }
11305
11306 #[inline]
11307 unsafe fn decode(
11308 &mut self,
11309 decoder: &mut fidl::encoding::Decoder<
11310 '_,
11311 fidl::encoding::DefaultFuchsiaResourceDialect,
11312 >,
11313 offset: usize,
11314 _depth: fidl::encoding::Depth,
11315 ) -> fidl::Result<()> {
11316 decoder.debug_check_bounds::<Self>(offset);
11317 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
11319 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11320 let mask = 0xffffffff00000000u64;
11321 let maskedval = padval & mask;
11322 if maskedval != 0 {
11323 return Err(fidl::Error::NonZeroPadding {
11324 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
11325 });
11326 }
11327 fidl::decode!(
11328 fidl::encoding::BoundedString<4096>,
11329 fidl::encoding::DefaultFuchsiaResourceDialect,
11330 &mut self.relative_moniker,
11331 decoder,
11332 offset + 0,
11333 _depth
11334 )?;
11335 fidl::decode!(
11336 fidl_fuchsia_io::OpenFlags,
11337 fidl::encoding::DefaultFuchsiaResourceDialect,
11338 &mut self.flags,
11339 decoder,
11340 offset + 16,
11341 _depth
11342 )?;
11343 fidl::decode!(
11344 fidl_fuchsia_io::ModeType,
11345 fidl::encoding::DefaultFuchsiaResourceDialect,
11346 &mut self.mode,
11347 decoder,
11348 offset + 20,
11349 _depth
11350 )?;
11351 fidl::decode!(
11352 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11353 fidl::encoding::DefaultFuchsiaResourceDialect,
11354 &mut self.object,
11355 decoder,
11356 offset + 24,
11357 _depth
11358 )?;
11359 Ok(())
11360 }
11361 }
11362
11363 impl fidl::encoding::ResourceTypeMarker for StorageAdminListStorageInRealmRequest {
11364 type Borrowed<'a> = &'a mut Self;
11365 fn take_or_borrow<'a>(
11366 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11367 ) -> Self::Borrowed<'a> {
11368 value
11369 }
11370 }
11371
11372 unsafe impl fidl::encoding::TypeMarker for StorageAdminListStorageInRealmRequest {
11373 type Owned = Self;
11374
11375 #[inline(always)]
11376 fn inline_align(_context: fidl::encoding::Context) -> usize {
11377 8
11378 }
11379
11380 #[inline(always)]
11381 fn inline_size(_context: fidl::encoding::Context) -> usize {
11382 24
11383 }
11384 }
11385
11386 unsafe impl
11387 fidl::encoding::Encode<
11388 StorageAdminListStorageInRealmRequest,
11389 fidl::encoding::DefaultFuchsiaResourceDialect,
11390 > for &mut StorageAdminListStorageInRealmRequest
11391 {
11392 #[inline]
11393 unsafe fn encode(
11394 self,
11395 encoder: &mut fidl::encoding::Encoder<
11396 '_,
11397 fidl::encoding::DefaultFuchsiaResourceDialect,
11398 >,
11399 offset: usize,
11400 _depth: fidl::encoding::Depth,
11401 ) -> fidl::Result<()> {
11402 encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
11403 fidl::encoding::Encode::<StorageAdminListStorageInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11405 (
11406 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
11407 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
11408 ),
11409 encoder, offset, _depth
11410 )
11411 }
11412 }
11413 unsafe impl<
11414 T0: fidl::encoding::Encode<
11415 fidl::encoding::BoundedString<4096>,
11416 fidl::encoding::DefaultFuchsiaResourceDialect,
11417 >,
11418 T1: fidl::encoding::Encode<
11419 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
11420 fidl::encoding::DefaultFuchsiaResourceDialect,
11421 >,
11422 >
11423 fidl::encoding::Encode<
11424 StorageAdminListStorageInRealmRequest,
11425 fidl::encoding::DefaultFuchsiaResourceDialect,
11426 > for (T0, T1)
11427 {
11428 #[inline]
11429 unsafe fn encode(
11430 self,
11431 encoder: &mut fidl::encoding::Encoder<
11432 '_,
11433 fidl::encoding::DefaultFuchsiaResourceDialect,
11434 >,
11435 offset: usize,
11436 depth: fidl::encoding::Depth,
11437 ) -> fidl::Result<()> {
11438 encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
11439 unsafe {
11442 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11443 (ptr as *mut u64).write_unaligned(0);
11444 }
11445 self.0.encode(encoder, offset + 0, depth)?;
11447 self.1.encode(encoder, offset + 16, depth)?;
11448 Ok(())
11449 }
11450 }
11451
11452 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11453 for StorageAdminListStorageInRealmRequest
11454 {
11455 #[inline(always)]
11456 fn new_empty() -> Self {
11457 Self {
11458 relative_moniker: fidl::new_empty!(
11459 fidl::encoding::BoundedString<4096>,
11460 fidl::encoding::DefaultFuchsiaResourceDialect
11461 ),
11462 iterator: fidl::new_empty!(
11463 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
11464 fidl::encoding::DefaultFuchsiaResourceDialect
11465 ),
11466 }
11467 }
11468
11469 #[inline]
11470 unsafe fn decode(
11471 &mut self,
11472 decoder: &mut fidl::encoding::Decoder<
11473 '_,
11474 fidl::encoding::DefaultFuchsiaResourceDialect,
11475 >,
11476 offset: usize,
11477 _depth: fidl::encoding::Depth,
11478 ) -> fidl::Result<()> {
11479 decoder.debug_check_bounds::<Self>(offset);
11480 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11482 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11483 let mask = 0xffffffff00000000u64;
11484 let maskedval = padval & mask;
11485 if maskedval != 0 {
11486 return Err(fidl::Error::NonZeroPadding {
11487 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11488 });
11489 }
11490 fidl::decode!(
11491 fidl::encoding::BoundedString<4096>,
11492 fidl::encoding::DefaultFuchsiaResourceDialect,
11493 &mut self.relative_moniker,
11494 decoder,
11495 offset + 0,
11496 _depth
11497 )?;
11498 fidl::decode!(
11499 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
11500 fidl::encoding::DefaultFuchsiaResourceDialect,
11501 &mut self.iterator,
11502 decoder,
11503 offset + 16,
11504 _depth
11505 )?;
11506 Ok(())
11507 }
11508 }
11509
11510 impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenComponentStorageByIdRequest {
11511 type Borrowed<'a> = &'a mut Self;
11512 fn take_or_borrow<'a>(
11513 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11514 ) -> Self::Borrowed<'a> {
11515 value
11516 }
11517 }
11518
11519 unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenComponentStorageByIdRequest {
11520 type Owned = Self;
11521
11522 #[inline(always)]
11523 fn inline_align(_context: fidl::encoding::Context) -> usize {
11524 8
11525 }
11526
11527 #[inline(always)]
11528 fn inline_size(_context: fidl::encoding::Context) -> usize {
11529 24
11530 }
11531 }
11532
11533 unsafe impl
11534 fidl::encoding::Encode<
11535 StorageAdminOpenComponentStorageByIdRequest,
11536 fidl::encoding::DefaultFuchsiaResourceDialect,
11537 > for &mut StorageAdminOpenComponentStorageByIdRequest
11538 {
11539 #[inline]
11540 unsafe fn encode(
11541 self,
11542 encoder: &mut fidl::encoding::Encoder<
11543 '_,
11544 fidl::encoding::DefaultFuchsiaResourceDialect,
11545 >,
11546 offset: usize,
11547 _depth: fidl::encoding::Depth,
11548 ) -> fidl::Result<()> {
11549 encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
11550 fidl::encoding::Encode::<
11552 StorageAdminOpenComponentStorageByIdRequest,
11553 fidl::encoding::DefaultFuchsiaResourceDialect,
11554 >::encode(
11555 (
11556 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
11557 &self.id,
11558 ),
11559 <fidl::encoding::Endpoint<
11560 fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
11561 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11562 &mut self.object
11563 ),
11564 ),
11565 encoder,
11566 offset,
11567 _depth,
11568 )
11569 }
11570 }
11571 unsafe impl<
11572 T0: fidl::encoding::Encode<
11573 fidl::encoding::BoundedString<64>,
11574 fidl::encoding::DefaultFuchsiaResourceDialect,
11575 >,
11576 T1: fidl::encoding::Encode<
11577 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11578 fidl::encoding::DefaultFuchsiaResourceDialect,
11579 >,
11580 >
11581 fidl::encoding::Encode<
11582 StorageAdminOpenComponentStorageByIdRequest,
11583 fidl::encoding::DefaultFuchsiaResourceDialect,
11584 > for (T0, T1)
11585 {
11586 #[inline]
11587 unsafe fn encode(
11588 self,
11589 encoder: &mut fidl::encoding::Encoder<
11590 '_,
11591 fidl::encoding::DefaultFuchsiaResourceDialect,
11592 >,
11593 offset: usize,
11594 depth: fidl::encoding::Depth,
11595 ) -> fidl::Result<()> {
11596 encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
11597 unsafe {
11600 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11601 (ptr as *mut u64).write_unaligned(0);
11602 }
11603 self.0.encode(encoder, offset + 0, depth)?;
11605 self.1.encode(encoder, offset + 16, depth)?;
11606 Ok(())
11607 }
11608 }
11609
11610 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11611 for StorageAdminOpenComponentStorageByIdRequest
11612 {
11613 #[inline(always)]
11614 fn new_empty() -> Self {
11615 Self {
11616 id: fidl::new_empty!(
11617 fidl::encoding::BoundedString<64>,
11618 fidl::encoding::DefaultFuchsiaResourceDialect
11619 ),
11620 object: fidl::new_empty!(
11621 fidl::encoding::Endpoint<
11622 fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
11623 >,
11624 fidl::encoding::DefaultFuchsiaResourceDialect
11625 ),
11626 }
11627 }
11628
11629 #[inline]
11630 unsafe fn decode(
11631 &mut self,
11632 decoder: &mut fidl::encoding::Decoder<
11633 '_,
11634 fidl::encoding::DefaultFuchsiaResourceDialect,
11635 >,
11636 offset: usize,
11637 _depth: fidl::encoding::Depth,
11638 ) -> fidl::Result<()> {
11639 decoder.debug_check_bounds::<Self>(offset);
11640 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11642 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11643 let mask = 0xffffffff00000000u64;
11644 let maskedval = padval & mask;
11645 if maskedval != 0 {
11646 return Err(fidl::Error::NonZeroPadding {
11647 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11648 });
11649 }
11650 fidl::decode!(
11651 fidl::encoding::BoundedString<64>,
11652 fidl::encoding::DefaultFuchsiaResourceDialect,
11653 &mut self.id,
11654 decoder,
11655 offset + 0,
11656 _depth
11657 )?;
11658 fidl::decode!(
11659 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11660 fidl::encoding::DefaultFuchsiaResourceDialect,
11661 &mut self.object,
11662 decoder,
11663 offset + 16,
11664 _depth
11665 )?;
11666 Ok(())
11667 }
11668 }
11669
11670 impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenStorageRequest {
11671 type Borrowed<'a> = &'a mut Self;
11672 fn take_or_borrow<'a>(
11673 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11674 ) -> Self::Borrowed<'a> {
11675 value
11676 }
11677 }
11678
11679 unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenStorageRequest {
11680 type Owned = Self;
11681
11682 #[inline(always)]
11683 fn inline_align(_context: fidl::encoding::Context) -> usize {
11684 8
11685 }
11686
11687 #[inline(always)]
11688 fn inline_size(_context: fidl::encoding::Context) -> usize {
11689 24
11690 }
11691 }
11692
11693 unsafe impl
11694 fidl::encoding::Encode<
11695 StorageAdminOpenStorageRequest,
11696 fidl::encoding::DefaultFuchsiaResourceDialect,
11697 > for &mut StorageAdminOpenStorageRequest
11698 {
11699 #[inline]
11700 unsafe fn encode(
11701 self,
11702 encoder: &mut fidl::encoding::Encoder<
11703 '_,
11704 fidl::encoding::DefaultFuchsiaResourceDialect,
11705 >,
11706 offset: usize,
11707 _depth: fidl::encoding::Depth,
11708 ) -> fidl::Result<()> {
11709 encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
11710 fidl::encoding::Encode::<StorageAdminOpenStorageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11712 (
11713 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
11714 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
11715 ),
11716 encoder, offset, _depth
11717 )
11718 }
11719 }
11720 unsafe impl<
11721 T0: fidl::encoding::Encode<
11722 fidl::encoding::BoundedString<4096>,
11723 fidl::encoding::DefaultFuchsiaResourceDialect,
11724 >,
11725 T1: fidl::encoding::Encode<
11726 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11727 fidl::encoding::DefaultFuchsiaResourceDialect,
11728 >,
11729 >
11730 fidl::encoding::Encode<
11731 StorageAdminOpenStorageRequest,
11732 fidl::encoding::DefaultFuchsiaResourceDialect,
11733 > for (T0, T1)
11734 {
11735 #[inline]
11736 unsafe fn encode(
11737 self,
11738 encoder: &mut fidl::encoding::Encoder<
11739 '_,
11740 fidl::encoding::DefaultFuchsiaResourceDialect,
11741 >,
11742 offset: usize,
11743 depth: fidl::encoding::Depth,
11744 ) -> fidl::Result<()> {
11745 encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
11746 unsafe {
11749 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11750 (ptr as *mut u64).write_unaligned(0);
11751 }
11752 self.0.encode(encoder, offset + 0, depth)?;
11754 self.1.encode(encoder, offset + 16, depth)?;
11755 Ok(())
11756 }
11757 }
11758
11759 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11760 for StorageAdminOpenStorageRequest
11761 {
11762 #[inline(always)]
11763 fn new_empty() -> Self {
11764 Self {
11765 relative_moniker: fidl::new_empty!(
11766 fidl::encoding::BoundedString<4096>,
11767 fidl::encoding::DefaultFuchsiaResourceDialect
11768 ),
11769 object: fidl::new_empty!(
11770 fidl::encoding::Endpoint<
11771 fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
11772 >,
11773 fidl::encoding::DefaultFuchsiaResourceDialect
11774 ),
11775 }
11776 }
11777
11778 #[inline]
11779 unsafe fn decode(
11780 &mut self,
11781 decoder: &mut fidl::encoding::Decoder<
11782 '_,
11783 fidl::encoding::DefaultFuchsiaResourceDialect,
11784 >,
11785 offset: usize,
11786 _depth: fidl::encoding::Depth,
11787 ) -> fidl::Result<()> {
11788 decoder.debug_check_bounds::<Self>(offset);
11789 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11791 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11792 let mask = 0xffffffff00000000u64;
11793 let maskedval = padval & mask;
11794 if maskedval != 0 {
11795 return Err(fidl::Error::NonZeroPadding {
11796 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11797 });
11798 }
11799 fidl::decode!(
11800 fidl::encoding::BoundedString<4096>,
11801 fidl::encoding::DefaultFuchsiaResourceDialect,
11802 &mut self.relative_moniker,
11803 decoder,
11804 offset + 0,
11805 _depth
11806 )?;
11807 fidl::decode!(
11808 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11809 fidl::encoding::DefaultFuchsiaResourceDialect,
11810 &mut self.object,
11811 decoder,
11812 offset + 16,
11813 _depth
11814 )?;
11815 Ok(())
11816 }
11817 }
11818}