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