1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fdomain_client::fidl::{ControlHandle as _, FDomainFlexibleIntoResult as _, Responder as _};
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9pub use fidl_fuchsia_sys2_common::*;
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14#[repr(C)]
15pub struct CrashIntrospectFindComponentByThreadKoidRequest {
16 pub thread_koid: u64,
17}
18
19impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
20 for CrashIntrospectFindComponentByThreadKoidRequest
21{
22}
23
24#[derive(Debug, PartialEq)]
25pub struct LifecycleControllerCreateInstanceRequest {
26 pub parent_moniker: String,
27 pub collection: fdomain_fuchsia_component_decl::CollectionRef,
28 pub decl: fdomain_fuchsia_component_decl::Child,
29 pub args: fdomain_fuchsia_component::CreateChildArgs,
30}
31
32impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
33 for LifecycleControllerCreateInstanceRequest
34{
35}
36
37#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
38pub struct LifecycleControllerStartInstanceRequest {
39 pub moniker: String,
40 pub binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
41}
42
43impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
44 for LifecycleControllerStartInstanceRequest
45{
46}
47
48#[derive(Debug, PartialEq)]
49pub struct LifecycleControllerStartInstanceWithArgsRequest {
50 pub moniker: String,
51 pub binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
52 pub args: fdomain_fuchsia_component::StartChildArgs,
53}
54
55impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
56 for LifecycleControllerStartInstanceWithArgsRequest
57{
58}
59
60#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
61pub struct RealmQueryConnectToStorageAdminRequest {
62 pub moniker: String,
63 pub storage_name: String,
64 pub server_end: fdomain_client::fidl::ServerEnd<StorageAdminMarker>,
65}
66
67impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
68 for RealmQueryConnectToStorageAdminRequest
69{
70}
71
72#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
73pub struct RealmQueryOpenDirectoryRequest {
74 pub moniker: String,
75 pub dir_type: OpenDirType,
76 pub object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
77}
78
79impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
80 for RealmQueryOpenDirectoryRequest
81{
82}
83
84#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85pub struct RealmQueryOpenStorageAdminRequest {
86 pub moniker: String,
87 pub storage_name: String,
88 pub server_end: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::StorageAdminMarker>,
89}
90
91impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
92 for RealmQueryOpenStorageAdminRequest
93{
94}
95
96#[derive(Debug, PartialEq)]
97pub struct RealmQueryConstructNamespaceResponse {
98 pub namespace: Vec<fdomain_fuchsia_component_runner::ComponentNamespaceEntry>,
100}
101
102impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
103 for RealmQueryConstructNamespaceResponse
104{
105}
106
107#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
108pub struct RealmQueryGetAllInstancesResponse {
109 pub iterator: fdomain_client::fidl::ClientEnd<InstanceIteratorMarker>,
110}
111
112impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
113 for RealmQueryGetAllInstancesResponse
114{
115}
116
117#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
118pub struct RealmQueryGetResolvedDeclarationResponse {
119 pub iterator: fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
120}
121
122impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
123 for RealmQueryGetResolvedDeclarationResponse
124{
125}
126
127#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
128pub struct RealmQueryResolveDeclarationResponse {
129 pub iterator: fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
130}
131
132impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
133 for RealmQueryResolveDeclarationResponse
134{
135}
136
137#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
138pub struct StorageAdminListStorageInRealmRequest {
139 pub relative_moniker: String,
140 pub iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
141}
142
143impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
144 for StorageAdminListStorageInRealmRequest
145{
146}
147
148#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
149pub struct StorageAdminOpenComponentStorageByIdRequest {
150 pub id: String,
151 pub object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
152}
153
154impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
155 for StorageAdminOpenComponentStorageByIdRequest
156{
157}
158
159#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
160pub struct StorageAdminOpenStorageRequest {
161 pub relative_moniker: String,
162 pub object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
163}
164
165impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
166 for StorageAdminOpenStorageRequest
167{
168}
169
170#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
171pub struct BootControllerMarker;
172
173impl fdomain_client::fidl::ProtocolMarker for BootControllerMarker {
174 type Proxy = BootControllerProxy;
175 type RequestStream = BootControllerRequestStream;
176
177 const DEBUG_NAME: &'static str = "fuchsia.sys2.BootController";
178}
179impl fdomain_client::fidl::DiscoverableProtocolMarker for BootControllerMarker {}
180
181pub trait BootControllerProxyInterface: Send + Sync {
182 type NotifyResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
183 fn r#notify(&self) -> Self::NotifyResponseFut;
184}
185
186#[derive(Debug, Clone)]
187pub struct BootControllerProxy {
188 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
189}
190
191impl fdomain_client::fidl::Proxy for BootControllerProxy {
192 type Protocol = BootControllerMarker;
193
194 fn from_channel(inner: fdomain_client::Channel) -> Self {
195 Self::new(inner)
196 }
197
198 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
199 self.client.into_channel().map_err(|client| Self { client })
200 }
201
202 fn as_channel(&self) -> &fdomain_client::Channel {
203 self.client.as_channel()
204 }
205}
206
207impl BootControllerProxy {
208 pub fn new(channel: fdomain_client::Channel) -> Self {
210 let protocol_name =
211 <BootControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
212 Self { client: fidl::client::Client::new(channel, protocol_name) }
213 }
214
215 pub fn take_event_stream(&self) -> BootControllerEventStream {
221 BootControllerEventStream { event_receiver: self.client.take_event_receiver() }
222 }
223
224 pub fn r#notify(
225 &self,
226 ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
227 BootControllerProxyInterface::r#notify(self)
228 }
229}
230
231impl BootControllerProxyInterface for BootControllerProxy {
232 type NotifyResponseFut =
233 fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
234 fn r#notify(&self) -> Self::NotifyResponseFut {
235 fn _decode(
236 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
237 ) -> Result<(), fidl::Error> {
238 let _response = fidl::client::decode_transaction_body::<
239 fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>,
240 fdomain_client::fidl::FDomainResourceDialect,
241 0x55173ddd1d9ed8de,
242 >(_buf?)?
243 .into_result_fdomain::<BootControllerMarker>("notify")?;
244 Ok(_response)
245 }
246 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
247 (),
248 0x55173ddd1d9ed8de,
249 fidl::encoding::DynamicFlags::FLEXIBLE,
250 _decode,
251 )
252 }
253}
254
255pub struct BootControllerEventStream {
256 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
257}
258
259impl std::marker::Unpin for BootControllerEventStream {}
260
261impl futures::stream::FusedStream for BootControllerEventStream {
262 fn is_terminated(&self) -> bool {
263 self.event_receiver.is_terminated()
264 }
265}
266
267impl futures::Stream for BootControllerEventStream {
268 type Item = Result<BootControllerEvent, fidl::Error>;
269
270 fn poll_next(
271 mut self: std::pin::Pin<&mut Self>,
272 cx: &mut std::task::Context<'_>,
273 ) -> std::task::Poll<Option<Self::Item>> {
274 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
275 &mut self.event_receiver,
276 cx
277 )?) {
278 Some(buf) => std::task::Poll::Ready(Some(BootControllerEvent::decode(buf))),
279 None => std::task::Poll::Ready(None),
280 }
281 }
282}
283
284#[derive(Debug)]
285pub enum BootControllerEvent {
286 #[non_exhaustive]
287 _UnknownEvent {
288 ordinal: u64,
290 },
291}
292
293impl BootControllerEvent {
294 fn decode(
296 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
297 ) -> Result<BootControllerEvent, fidl::Error> {
298 let (bytes, _handles) = buf.split_mut();
299 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
300 debug_assert_eq!(tx_header.tx_id, 0);
301 match tx_header.ordinal {
302 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
303 Ok(BootControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
304 }
305 _ => Err(fidl::Error::UnknownOrdinal {
306 ordinal: tx_header.ordinal,
307 protocol_name:
308 <BootControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
309 }),
310 }
311 }
312}
313
314pub struct BootControllerRequestStream {
316 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
317 is_terminated: bool,
318}
319
320impl std::marker::Unpin for BootControllerRequestStream {}
321
322impl futures::stream::FusedStream for BootControllerRequestStream {
323 fn is_terminated(&self) -> bool {
324 self.is_terminated
325 }
326}
327
328impl fdomain_client::fidl::RequestStream for BootControllerRequestStream {
329 type Protocol = BootControllerMarker;
330 type ControlHandle = BootControllerControlHandle;
331
332 fn from_channel(channel: fdomain_client::Channel) -> Self {
333 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
334 }
335
336 fn control_handle(&self) -> Self::ControlHandle {
337 BootControllerControlHandle { inner: self.inner.clone() }
338 }
339
340 fn into_inner(
341 self,
342 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
343 {
344 (self.inner, self.is_terminated)
345 }
346
347 fn from_inner(
348 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
349 is_terminated: bool,
350 ) -> Self {
351 Self { inner, is_terminated }
352 }
353}
354
355impl futures::Stream for BootControllerRequestStream {
356 type Item = Result<BootControllerRequest, fidl::Error>;
357
358 fn poll_next(
359 mut self: std::pin::Pin<&mut Self>,
360 cx: &mut std::task::Context<'_>,
361 ) -> std::task::Poll<Option<Self::Item>> {
362 let this = &mut *self;
363 if this.inner.check_shutdown(cx) {
364 this.is_terminated = true;
365 return std::task::Poll::Ready(None);
366 }
367 if this.is_terminated {
368 panic!("polled BootControllerRequestStream after completion");
369 }
370 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
371 |bytes, handles| {
372 match this.inner.channel().read_etc(cx, bytes, handles) {
373 std::task::Poll::Ready(Ok(())) => {}
374 std::task::Poll::Pending => return std::task::Poll::Pending,
375 std::task::Poll::Ready(Err(None)) => {
376 this.is_terminated = true;
377 return std::task::Poll::Ready(None);
378 }
379 std::task::Poll::Ready(Err(Some(e))) => {
380 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
381 e.into(),
382 ))));
383 }
384 }
385
386 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
388
389 std::task::Poll::Ready(Some(match header.ordinal {
390 0x55173ddd1d9ed8de => {
391 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
392 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
393 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
394 let control_handle = BootControllerControlHandle {
395 inner: this.inner.clone(),
396 };
397 Ok(BootControllerRequest::Notify {
398 responder: BootControllerNotifyResponder {
399 control_handle: std::mem::ManuallyDrop::new(control_handle),
400 tx_id: header.tx_id,
401 },
402 })
403 }
404 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
405 Ok(BootControllerRequest::_UnknownMethod {
406 ordinal: header.ordinal,
407 control_handle: BootControllerControlHandle { inner: this.inner.clone() },
408 method_type: fidl::MethodType::OneWay,
409 })
410 }
411 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
412 this.inner.send_framework_err(
413 fidl::encoding::FrameworkErr::UnknownMethod,
414 header.tx_id,
415 header.ordinal,
416 header.dynamic_flags(),
417 (bytes, handles),
418 )?;
419 Ok(BootControllerRequest::_UnknownMethod {
420 ordinal: header.ordinal,
421 control_handle: BootControllerControlHandle { inner: this.inner.clone() },
422 method_type: fidl::MethodType::TwoWay,
423 })
424 }
425 _ => Err(fidl::Error::UnknownOrdinal {
426 ordinal: header.ordinal,
427 protocol_name: <BootControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
428 }),
429 }))
430 },
431 )
432 }
433}
434
435#[derive(Debug)]
436pub enum BootControllerRequest {
437 Notify {
438 responder: BootControllerNotifyResponder,
439 },
440 #[non_exhaustive]
442 _UnknownMethod {
443 ordinal: u64,
445 control_handle: BootControllerControlHandle,
446 method_type: fidl::MethodType,
447 },
448}
449
450impl BootControllerRequest {
451 #[allow(irrefutable_let_patterns)]
452 pub fn into_notify(self) -> Option<(BootControllerNotifyResponder)> {
453 if let BootControllerRequest::Notify { responder } = self {
454 Some((responder))
455 } else {
456 None
457 }
458 }
459
460 pub fn method_name(&self) -> &'static str {
462 match *self {
463 BootControllerRequest::Notify { .. } => "notify",
464 BootControllerRequest::_UnknownMethod {
465 method_type: fidl::MethodType::OneWay, ..
466 } => "unknown one-way method",
467 BootControllerRequest::_UnknownMethod {
468 method_type: fidl::MethodType::TwoWay, ..
469 } => "unknown two-way method",
470 }
471 }
472}
473
474#[derive(Debug, Clone)]
475pub struct BootControllerControlHandle {
476 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
477}
478
479impl BootControllerControlHandle {
480 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
481 self.inner.shutdown_with_epitaph(status.into())
482 }
483}
484
485impl fdomain_client::fidl::ControlHandle for BootControllerControlHandle {
486 fn shutdown(&self) {
487 self.inner.shutdown()
488 }
489
490 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
491 self.inner.shutdown_with_epitaph(status)
492 }
493
494 fn is_closed(&self) -> bool {
495 self.inner.channel().is_closed()
496 }
497 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
498 self.inner.channel().on_closed()
499 }
500}
501
502impl BootControllerControlHandle {}
503
504#[must_use = "FIDL methods require a response to be sent"]
505#[derive(Debug)]
506pub struct BootControllerNotifyResponder {
507 control_handle: std::mem::ManuallyDrop<BootControllerControlHandle>,
508 tx_id: u32,
509}
510
511impl std::ops::Drop for BootControllerNotifyResponder {
515 fn drop(&mut self) {
516 self.control_handle.shutdown();
517 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
519 }
520}
521
522impl fdomain_client::fidl::Responder for BootControllerNotifyResponder {
523 type ControlHandle = BootControllerControlHandle;
524
525 fn control_handle(&self) -> &BootControllerControlHandle {
526 &self.control_handle
527 }
528
529 fn drop_without_shutdown(mut self) {
530 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
532 std::mem::forget(self);
534 }
535}
536
537impl BootControllerNotifyResponder {
538 pub fn send(self) -> Result<(), fidl::Error> {
542 let _result = self.send_raw();
543 if _result.is_err() {
544 self.control_handle.shutdown();
545 }
546 self.drop_without_shutdown();
547 _result
548 }
549
550 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
552 let _result = self.send_raw();
553 self.drop_without_shutdown();
554 _result
555 }
556
557 fn send_raw(&self) -> Result<(), fidl::Error> {
558 self.control_handle.inner.send::<fidl::encoding::FlexibleType<fidl::encoding::EmptyStruct>>(
559 fidl::encoding::Flexible::new(()),
560 self.tx_id,
561 0x55173ddd1d9ed8de,
562 fidl::encoding::DynamicFlags::FLEXIBLE,
563 )
564 }
565}
566
567#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
568pub struct ConfigOverrideMarker;
569
570impl fdomain_client::fidl::ProtocolMarker for ConfigOverrideMarker {
571 type Proxy = ConfigOverrideProxy;
572 type RequestStream = ConfigOverrideRequestStream;
573
574 const DEBUG_NAME: &'static str = "fuchsia.sys2.ConfigOverride";
575}
576impl fdomain_client::fidl::DiscoverableProtocolMarker for ConfigOverrideMarker {}
577pub type ConfigOverrideSetStructuredConfigResult = Result<(), ConfigOverrideError>;
578pub type ConfigOverrideUnsetStructuredConfigResult = Result<(), ConfigOverrideError>;
579
580pub trait ConfigOverrideProxyInterface: Send + Sync {
581 type SetStructuredConfigResponseFut: std::future::Future<Output = Result<ConfigOverrideSetStructuredConfigResult, fidl::Error>>
582 + Send;
583 fn r#set_structured_config(
584 &self,
585 moniker: &str,
586 fields: &[fdomain_fuchsia_component_decl::ConfigOverride],
587 ) -> Self::SetStructuredConfigResponseFut;
588 type UnsetStructuredConfigResponseFut: std::future::Future<Output = Result<ConfigOverrideUnsetStructuredConfigResult, fidl::Error>>
589 + Send;
590 fn r#unset_structured_config(&self, moniker: &str) -> Self::UnsetStructuredConfigResponseFut;
591}
592
593#[derive(Debug, Clone)]
594pub struct ConfigOverrideProxy {
595 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
596}
597
598impl fdomain_client::fidl::Proxy for ConfigOverrideProxy {
599 type Protocol = ConfigOverrideMarker;
600
601 fn from_channel(inner: fdomain_client::Channel) -> Self {
602 Self::new(inner)
603 }
604
605 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
606 self.client.into_channel().map_err(|client| Self { client })
607 }
608
609 fn as_channel(&self) -> &fdomain_client::Channel {
610 self.client.as_channel()
611 }
612}
613
614impl ConfigOverrideProxy {
615 pub fn new(channel: fdomain_client::Channel) -> Self {
617 let protocol_name =
618 <ConfigOverrideMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
619 Self { client: fidl::client::Client::new(channel, protocol_name) }
620 }
621
622 pub fn take_event_stream(&self) -> ConfigOverrideEventStream {
628 ConfigOverrideEventStream { event_receiver: self.client.take_event_receiver() }
629 }
630
631 pub fn r#set_structured_config(
634 &self,
635 mut moniker: &str,
636 mut fields: &[fdomain_fuchsia_component_decl::ConfigOverride],
637 ) -> fidl::client::QueryResponseFut<
638 ConfigOverrideSetStructuredConfigResult,
639 fdomain_client::fidl::FDomainResourceDialect,
640 > {
641 ConfigOverrideProxyInterface::r#set_structured_config(self, moniker, fields)
642 }
643
644 pub fn r#unset_structured_config(
648 &self,
649 mut moniker: &str,
650 ) -> fidl::client::QueryResponseFut<
651 ConfigOverrideUnsetStructuredConfigResult,
652 fdomain_client::fidl::FDomainResourceDialect,
653 > {
654 ConfigOverrideProxyInterface::r#unset_structured_config(self, moniker)
655 }
656}
657
658impl ConfigOverrideProxyInterface for ConfigOverrideProxy {
659 type SetStructuredConfigResponseFut = fidl::client::QueryResponseFut<
660 ConfigOverrideSetStructuredConfigResult,
661 fdomain_client::fidl::FDomainResourceDialect,
662 >;
663 fn r#set_structured_config(
664 &self,
665 mut moniker: &str,
666 mut fields: &[fdomain_fuchsia_component_decl::ConfigOverride],
667 ) -> Self::SetStructuredConfigResponseFut {
668 fn _decode(
669 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
670 ) -> Result<ConfigOverrideSetStructuredConfigResult, fidl::Error> {
671 let _response = fidl::client::decode_transaction_body::<
672 fidl::encoding::FlexibleResultType<
673 fidl::encoding::EmptyStruct,
674 ConfigOverrideError,
675 >,
676 fdomain_client::fidl::FDomainResourceDialect,
677 0x2c6a138832d2e0ee,
678 >(_buf?)?
679 .into_result_fdomain::<ConfigOverrideMarker>("set_structured_config")?;
680 Ok(_response.map(|x| x))
681 }
682 self.client.send_query_and_decode::<
683 ConfigOverrideSetStructuredConfigRequest,
684 ConfigOverrideSetStructuredConfigResult,
685 >(
686 (moniker, fields,),
687 0x2c6a138832d2e0ee,
688 fidl::encoding::DynamicFlags::FLEXIBLE,
689 _decode,
690 )
691 }
692
693 type UnsetStructuredConfigResponseFut = fidl::client::QueryResponseFut<
694 ConfigOverrideUnsetStructuredConfigResult,
695 fdomain_client::fidl::FDomainResourceDialect,
696 >;
697 fn r#unset_structured_config(
698 &self,
699 mut moniker: &str,
700 ) -> Self::UnsetStructuredConfigResponseFut {
701 fn _decode(
702 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
703 ) -> Result<ConfigOverrideUnsetStructuredConfigResult, fidl::Error> {
704 let _response = fidl::client::decode_transaction_body::<
705 fidl::encoding::FlexibleResultType<
706 fidl::encoding::EmptyStruct,
707 ConfigOverrideError,
708 >,
709 fdomain_client::fidl::FDomainResourceDialect,
710 0x342ec7d2bef05552,
711 >(_buf?)?
712 .into_result_fdomain::<ConfigOverrideMarker>("unset_structured_config")?;
713 Ok(_response.map(|x| x))
714 }
715 self.client.send_query_and_decode::<
716 ConfigOverrideUnsetStructuredConfigRequest,
717 ConfigOverrideUnsetStructuredConfigResult,
718 >(
719 (moniker,),
720 0x342ec7d2bef05552,
721 fidl::encoding::DynamicFlags::FLEXIBLE,
722 _decode,
723 )
724 }
725}
726
727pub struct ConfigOverrideEventStream {
728 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
729}
730
731impl std::marker::Unpin for ConfigOverrideEventStream {}
732
733impl futures::stream::FusedStream for ConfigOverrideEventStream {
734 fn is_terminated(&self) -> bool {
735 self.event_receiver.is_terminated()
736 }
737}
738
739impl futures::Stream for ConfigOverrideEventStream {
740 type Item = Result<ConfigOverrideEvent, fidl::Error>;
741
742 fn poll_next(
743 mut self: std::pin::Pin<&mut Self>,
744 cx: &mut std::task::Context<'_>,
745 ) -> std::task::Poll<Option<Self::Item>> {
746 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
747 &mut self.event_receiver,
748 cx
749 )?) {
750 Some(buf) => std::task::Poll::Ready(Some(ConfigOverrideEvent::decode(buf))),
751 None => std::task::Poll::Ready(None),
752 }
753 }
754}
755
756#[derive(Debug)]
757pub enum ConfigOverrideEvent {
758 #[non_exhaustive]
759 _UnknownEvent {
760 ordinal: u64,
762 },
763}
764
765impl ConfigOverrideEvent {
766 fn decode(
768 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
769 ) -> Result<ConfigOverrideEvent, fidl::Error> {
770 let (bytes, _handles) = buf.split_mut();
771 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
772 debug_assert_eq!(tx_header.tx_id, 0);
773 match tx_header.ordinal {
774 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
775 Ok(ConfigOverrideEvent::_UnknownEvent { ordinal: tx_header.ordinal })
776 }
777 _ => Err(fidl::Error::UnknownOrdinal {
778 ordinal: tx_header.ordinal,
779 protocol_name:
780 <ConfigOverrideMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
781 }),
782 }
783 }
784}
785
786pub struct ConfigOverrideRequestStream {
788 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
789 is_terminated: bool,
790}
791
792impl std::marker::Unpin for ConfigOverrideRequestStream {}
793
794impl futures::stream::FusedStream for ConfigOverrideRequestStream {
795 fn is_terminated(&self) -> bool {
796 self.is_terminated
797 }
798}
799
800impl fdomain_client::fidl::RequestStream for ConfigOverrideRequestStream {
801 type Protocol = ConfigOverrideMarker;
802 type ControlHandle = ConfigOverrideControlHandle;
803
804 fn from_channel(channel: fdomain_client::Channel) -> Self {
805 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
806 }
807
808 fn control_handle(&self) -> Self::ControlHandle {
809 ConfigOverrideControlHandle { inner: self.inner.clone() }
810 }
811
812 fn into_inner(
813 self,
814 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
815 {
816 (self.inner, self.is_terminated)
817 }
818
819 fn from_inner(
820 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
821 is_terminated: bool,
822 ) -> Self {
823 Self { inner, is_terminated }
824 }
825}
826
827impl futures::Stream for ConfigOverrideRequestStream {
828 type Item = Result<ConfigOverrideRequest, fidl::Error>;
829
830 fn poll_next(
831 mut self: std::pin::Pin<&mut Self>,
832 cx: &mut std::task::Context<'_>,
833 ) -> std::task::Poll<Option<Self::Item>> {
834 let this = &mut *self;
835 if this.inner.check_shutdown(cx) {
836 this.is_terminated = true;
837 return std::task::Poll::Ready(None);
838 }
839 if this.is_terminated {
840 panic!("polled ConfigOverrideRequestStream after completion");
841 }
842 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
843 |bytes, handles| {
844 match this.inner.channel().read_etc(cx, bytes, handles) {
845 std::task::Poll::Ready(Ok(())) => {}
846 std::task::Poll::Pending => return std::task::Poll::Pending,
847 std::task::Poll::Ready(Err(None)) => {
848 this.is_terminated = true;
849 return std::task::Poll::Ready(None);
850 }
851 std::task::Poll::Ready(Err(Some(e))) => {
852 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
853 e.into(),
854 ))));
855 }
856 }
857
858 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
860
861 std::task::Poll::Ready(Some(match header.ordinal {
862 0x2c6a138832d2e0ee => {
863 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
864 let mut req = fidl::new_empty!(ConfigOverrideSetStructuredConfigRequest, fdomain_client::fidl::FDomainResourceDialect);
865 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ConfigOverrideSetStructuredConfigRequest>(&header, _body_bytes, handles, &mut req)?;
866 let control_handle = ConfigOverrideControlHandle {
867 inner: this.inner.clone(),
868 };
869 Ok(ConfigOverrideRequest::SetStructuredConfig {moniker: req.moniker,
870fields: req.fields,
871
872 responder: ConfigOverrideSetStructuredConfigResponder {
873 control_handle: std::mem::ManuallyDrop::new(control_handle),
874 tx_id: header.tx_id,
875 },
876 })
877 }
878 0x342ec7d2bef05552 => {
879 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
880 let mut req = fidl::new_empty!(ConfigOverrideUnsetStructuredConfigRequest, fdomain_client::fidl::FDomainResourceDialect);
881 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ConfigOverrideUnsetStructuredConfigRequest>(&header, _body_bytes, handles, &mut req)?;
882 let control_handle = ConfigOverrideControlHandle {
883 inner: this.inner.clone(),
884 };
885 Ok(ConfigOverrideRequest::UnsetStructuredConfig {moniker: req.moniker,
886
887 responder: ConfigOverrideUnsetStructuredConfigResponder {
888 control_handle: std::mem::ManuallyDrop::new(control_handle),
889 tx_id: header.tx_id,
890 },
891 })
892 }
893 _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
894 Ok(ConfigOverrideRequest::_UnknownMethod {
895 ordinal: header.ordinal,
896 control_handle: ConfigOverrideControlHandle { inner: this.inner.clone() },
897 method_type: fidl::MethodType::OneWay,
898 })
899 }
900 _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
901 this.inner.send_framework_err(
902 fidl::encoding::FrameworkErr::UnknownMethod,
903 header.tx_id,
904 header.ordinal,
905 header.dynamic_flags(),
906 (bytes, handles),
907 )?;
908 Ok(ConfigOverrideRequest::_UnknownMethod {
909 ordinal: header.ordinal,
910 control_handle: ConfigOverrideControlHandle { inner: this.inner.clone() },
911 method_type: fidl::MethodType::TwoWay,
912 })
913 }
914 _ => Err(fidl::Error::UnknownOrdinal {
915 ordinal: header.ordinal,
916 protocol_name: <ConfigOverrideMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
917 }),
918 }))
919 },
920 )
921 }
922}
923
924#[derive(Debug)]
926pub enum ConfigOverrideRequest {
927 SetStructuredConfig {
930 moniker: String,
931 fields: Vec<fdomain_fuchsia_component_decl::ConfigOverride>,
932 responder: ConfigOverrideSetStructuredConfigResponder,
933 },
934 UnsetStructuredConfig {
938 moniker: String,
939 responder: ConfigOverrideUnsetStructuredConfigResponder,
940 },
941 #[non_exhaustive]
943 _UnknownMethod {
944 ordinal: u64,
946 control_handle: ConfigOverrideControlHandle,
947 method_type: fidl::MethodType,
948 },
949}
950
951impl ConfigOverrideRequest {
952 #[allow(irrefutable_let_patterns)]
953 pub fn into_set_structured_config(
954 self,
955 ) -> Option<(
956 String,
957 Vec<fdomain_fuchsia_component_decl::ConfigOverride>,
958 ConfigOverrideSetStructuredConfigResponder,
959 )> {
960 if let ConfigOverrideRequest::SetStructuredConfig { moniker, fields, responder } = self {
961 Some((moniker, fields, responder))
962 } else {
963 None
964 }
965 }
966
967 #[allow(irrefutable_let_patterns)]
968 pub fn into_unset_structured_config(
969 self,
970 ) -> Option<(String, ConfigOverrideUnsetStructuredConfigResponder)> {
971 if let ConfigOverrideRequest::UnsetStructuredConfig { moniker, responder } = self {
972 Some((moniker, responder))
973 } else {
974 None
975 }
976 }
977
978 pub fn method_name(&self) -> &'static str {
980 match *self {
981 ConfigOverrideRequest::SetStructuredConfig { .. } => "set_structured_config",
982 ConfigOverrideRequest::UnsetStructuredConfig { .. } => "unset_structured_config",
983 ConfigOverrideRequest::_UnknownMethod {
984 method_type: fidl::MethodType::OneWay, ..
985 } => "unknown one-way method",
986 ConfigOverrideRequest::_UnknownMethod {
987 method_type: fidl::MethodType::TwoWay, ..
988 } => "unknown two-way method",
989 }
990 }
991}
992
993#[derive(Debug, Clone)]
994pub struct ConfigOverrideControlHandle {
995 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
996}
997
998impl ConfigOverrideControlHandle {
999 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1000 self.inner.shutdown_with_epitaph(status.into())
1001 }
1002}
1003
1004impl fdomain_client::fidl::ControlHandle for ConfigOverrideControlHandle {
1005 fn shutdown(&self) {
1006 self.inner.shutdown()
1007 }
1008
1009 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1010 self.inner.shutdown_with_epitaph(status)
1011 }
1012
1013 fn is_closed(&self) -> bool {
1014 self.inner.channel().is_closed()
1015 }
1016 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1017 self.inner.channel().on_closed()
1018 }
1019}
1020
1021impl ConfigOverrideControlHandle {}
1022
1023#[must_use = "FIDL methods require a response to be sent"]
1024#[derive(Debug)]
1025pub struct ConfigOverrideSetStructuredConfigResponder {
1026 control_handle: std::mem::ManuallyDrop<ConfigOverrideControlHandle>,
1027 tx_id: u32,
1028}
1029
1030impl std::ops::Drop for ConfigOverrideSetStructuredConfigResponder {
1034 fn drop(&mut self) {
1035 self.control_handle.shutdown();
1036 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1038 }
1039}
1040
1041impl fdomain_client::fidl::Responder for ConfigOverrideSetStructuredConfigResponder {
1042 type ControlHandle = ConfigOverrideControlHandle;
1043
1044 fn control_handle(&self) -> &ConfigOverrideControlHandle {
1045 &self.control_handle
1046 }
1047
1048 fn drop_without_shutdown(mut self) {
1049 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1051 std::mem::forget(self);
1053 }
1054}
1055
1056impl ConfigOverrideSetStructuredConfigResponder {
1057 pub fn send(self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
1061 let _result = self.send_raw(result);
1062 if _result.is_err() {
1063 self.control_handle.shutdown();
1064 }
1065 self.drop_without_shutdown();
1066 _result
1067 }
1068
1069 pub fn send_no_shutdown_on_err(
1071 self,
1072 mut result: Result<(), ConfigOverrideError>,
1073 ) -> Result<(), fidl::Error> {
1074 let _result = self.send_raw(result);
1075 self.drop_without_shutdown();
1076 _result
1077 }
1078
1079 fn send_raw(&self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
1080 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1081 fidl::encoding::EmptyStruct,
1082 ConfigOverrideError,
1083 >>(
1084 fidl::encoding::FlexibleResult::new(result),
1085 self.tx_id,
1086 0x2c6a138832d2e0ee,
1087 fidl::encoding::DynamicFlags::FLEXIBLE,
1088 )
1089 }
1090}
1091
1092#[must_use = "FIDL methods require a response to be sent"]
1093#[derive(Debug)]
1094pub struct ConfigOverrideUnsetStructuredConfigResponder {
1095 control_handle: std::mem::ManuallyDrop<ConfigOverrideControlHandle>,
1096 tx_id: u32,
1097}
1098
1099impl std::ops::Drop for ConfigOverrideUnsetStructuredConfigResponder {
1103 fn drop(&mut self) {
1104 self.control_handle.shutdown();
1105 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1107 }
1108}
1109
1110impl fdomain_client::fidl::Responder for ConfigOverrideUnsetStructuredConfigResponder {
1111 type ControlHandle = ConfigOverrideControlHandle;
1112
1113 fn control_handle(&self) -> &ConfigOverrideControlHandle {
1114 &self.control_handle
1115 }
1116
1117 fn drop_without_shutdown(mut self) {
1118 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1120 std::mem::forget(self);
1122 }
1123}
1124
1125impl ConfigOverrideUnsetStructuredConfigResponder {
1126 pub fn send(self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
1130 let _result = self.send_raw(result);
1131 if _result.is_err() {
1132 self.control_handle.shutdown();
1133 }
1134 self.drop_without_shutdown();
1135 _result
1136 }
1137
1138 pub fn send_no_shutdown_on_err(
1140 self,
1141 mut result: Result<(), ConfigOverrideError>,
1142 ) -> Result<(), fidl::Error> {
1143 let _result = self.send_raw(result);
1144 self.drop_without_shutdown();
1145 _result
1146 }
1147
1148 fn send_raw(&self, mut result: Result<(), ConfigOverrideError>) -> Result<(), fidl::Error> {
1149 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1150 fidl::encoding::EmptyStruct,
1151 ConfigOverrideError,
1152 >>(
1153 fidl::encoding::FlexibleResult::new(result),
1154 self.tx_id,
1155 0x342ec7d2bef05552,
1156 fidl::encoding::DynamicFlags::FLEXIBLE,
1157 )
1158 }
1159}
1160
1161#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1162pub struct CrashIntrospectMarker;
1163
1164impl fdomain_client::fidl::ProtocolMarker for CrashIntrospectMarker {
1165 type Proxy = CrashIntrospectProxy;
1166 type RequestStream = CrashIntrospectRequestStream;
1167
1168 const DEBUG_NAME: &'static str = "fuchsia.sys2.CrashIntrospect";
1169}
1170impl fdomain_client::fidl::DiscoverableProtocolMarker for CrashIntrospectMarker {}
1171pub type CrashIntrospectFindComponentByThreadKoidResult =
1172 Result<ComponentCrashInfo, fdomain_fuchsia_component::Error>;
1173
1174pub trait CrashIntrospectProxyInterface: Send + Sync {
1175 type FindComponentByThreadKoidResponseFut: std::future::Future<
1176 Output = Result<CrashIntrospectFindComponentByThreadKoidResult, fidl::Error>,
1177 > + Send;
1178 fn r#find_component_by_thread_koid(
1179 &self,
1180 thread_koid: u64,
1181 ) -> Self::FindComponentByThreadKoidResponseFut;
1182}
1183
1184#[derive(Debug, Clone)]
1185pub struct CrashIntrospectProxy {
1186 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1187}
1188
1189impl fdomain_client::fidl::Proxy for CrashIntrospectProxy {
1190 type Protocol = CrashIntrospectMarker;
1191
1192 fn from_channel(inner: fdomain_client::Channel) -> Self {
1193 Self::new(inner)
1194 }
1195
1196 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1197 self.client.into_channel().map_err(|client| Self { client })
1198 }
1199
1200 fn as_channel(&self) -> &fdomain_client::Channel {
1201 self.client.as_channel()
1202 }
1203}
1204
1205impl CrashIntrospectProxy {
1206 pub fn new(channel: fdomain_client::Channel) -> Self {
1208 let protocol_name =
1209 <CrashIntrospectMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1210 Self { client: fidl::client::Client::new(channel, protocol_name) }
1211 }
1212
1213 pub fn take_event_stream(&self) -> CrashIntrospectEventStream {
1219 CrashIntrospectEventStream { event_receiver: self.client.take_event_receiver() }
1220 }
1221
1222 pub fn r#find_component_by_thread_koid(
1231 &self,
1232 mut thread_koid: u64,
1233 ) -> fidl::client::QueryResponseFut<
1234 CrashIntrospectFindComponentByThreadKoidResult,
1235 fdomain_client::fidl::FDomainResourceDialect,
1236 > {
1237 CrashIntrospectProxyInterface::r#find_component_by_thread_koid(self, thread_koid)
1238 }
1239}
1240
1241impl CrashIntrospectProxyInterface for CrashIntrospectProxy {
1242 type FindComponentByThreadKoidResponseFut = fidl::client::QueryResponseFut<
1243 CrashIntrospectFindComponentByThreadKoidResult,
1244 fdomain_client::fidl::FDomainResourceDialect,
1245 >;
1246 fn r#find_component_by_thread_koid(
1247 &self,
1248 mut thread_koid: u64,
1249 ) -> Self::FindComponentByThreadKoidResponseFut {
1250 fn _decode(
1251 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1252 ) -> Result<CrashIntrospectFindComponentByThreadKoidResult, fidl::Error> {
1253 let _response = fidl::client::decode_transaction_body::<
1254 fidl::encoding::ResultType<
1255 CrashIntrospectFindComponentByThreadKoidResponse,
1256 fdomain_fuchsia_component::Error,
1257 >,
1258 fdomain_client::fidl::FDomainResourceDialect,
1259 0x75d3ff081eca468d,
1260 >(_buf?)?;
1261 Ok(_response.map(|x| x.info))
1262 }
1263 self.client.send_query_and_decode::<
1264 CrashIntrospectFindComponentByThreadKoidRequest,
1265 CrashIntrospectFindComponentByThreadKoidResult,
1266 >(
1267 (thread_koid,),
1268 0x75d3ff081eca468d,
1269 fidl::encoding::DynamicFlags::empty(),
1270 _decode,
1271 )
1272 }
1273}
1274
1275pub struct CrashIntrospectEventStream {
1276 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1277}
1278
1279impl std::marker::Unpin for CrashIntrospectEventStream {}
1280
1281impl futures::stream::FusedStream for CrashIntrospectEventStream {
1282 fn is_terminated(&self) -> bool {
1283 self.event_receiver.is_terminated()
1284 }
1285}
1286
1287impl futures::Stream for CrashIntrospectEventStream {
1288 type Item = Result<CrashIntrospectEvent, fidl::Error>;
1289
1290 fn poll_next(
1291 mut self: std::pin::Pin<&mut Self>,
1292 cx: &mut std::task::Context<'_>,
1293 ) -> std::task::Poll<Option<Self::Item>> {
1294 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1295 &mut self.event_receiver,
1296 cx
1297 )?) {
1298 Some(buf) => std::task::Poll::Ready(Some(CrashIntrospectEvent::decode(buf))),
1299 None => std::task::Poll::Ready(None),
1300 }
1301 }
1302}
1303
1304#[derive(Debug)]
1305pub enum CrashIntrospectEvent {}
1306
1307impl CrashIntrospectEvent {
1308 fn decode(
1310 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1311 ) -> Result<CrashIntrospectEvent, fidl::Error> {
1312 let (bytes, _handles) = buf.split_mut();
1313 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1314 debug_assert_eq!(tx_header.tx_id, 0);
1315 match tx_header.ordinal {
1316 _ => Err(fidl::Error::UnknownOrdinal {
1317 ordinal: tx_header.ordinal,
1318 protocol_name:
1319 <CrashIntrospectMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1320 }),
1321 }
1322 }
1323}
1324
1325pub struct CrashIntrospectRequestStream {
1327 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1328 is_terminated: bool,
1329}
1330
1331impl std::marker::Unpin for CrashIntrospectRequestStream {}
1332
1333impl futures::stream::FusedStream for CrashIntrospectRequestStream {
1334 fn is_terminated(&self) -> bool {
1335 self.is_terminated
1336 }
1337}
1338
1339impl fdomain_client::fidl::RequestStream for CrashIntrospectRequestStream {
1340 type Protocol = CrashIntrospectMarker;
1341 type ControlHandle = CrashIntrospectControlHandle;
1342
1343 fn from_channel(channel: fdomain_client::Channel) -> Self {
1344 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1345 }
1346
1347 fn control_handle(&self) -> Self::ControlHandle {
1348 CrashIntrospectControlHandle { inner: self.inner.clone() }
1349 }
1350
1351 fn into_inner(
1352 self,
1353 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1354 {
1355 (self.inner, self.is_terminated)
1356 }
1357
1358 fn from_inner(
1359 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1360 is_terminated: bool,
1361 ) -> Self {
1362 Self { inner, is_terminated }
1363 }
1364}
1365
1366impl futures::Stream for CrashIntrospectRequestStream {
1367 type Item = Result<CrashIntrospectRequest, fidl::Error>;
1368
1369 fn poll_next(
1370 mut self: std::pin::Pin<&mut Self>,
1371 cx: &mut std::task::Context<'_>,
1372 ) -> std::task::Poll<Option<Self::Item>> {
1373 let this = &mut *self;
1374 if this.inner.check_shutdown(cx) {
1375 this.is_terminated = true;
1376 return std::task::Poll::Ready(None);
1377 }
1378 if this.is_terminated {
1379 panic!("polled CrashIntrospectRequestStream after completion");
1380 }
1381 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1382 |bytes, handles| {
1383 match this.inner.channel().read_etc(cx, bytes, handles) {
1384 std::task::Poll::Ready(Ok(())) => {}
1385 std::task::Poll::Pending => return std::task::Poll::Pending,
1386 std::task::Poll::Ready(Err(None)) => {
1387 this.is_terminated = true;
1388 return std::task::Poll::Ready(None);
1389 }
1390 std::task::Poll::Ready(Err(Some(e))) => {
1391 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1392 e.into(),
1393 ))));
1394 }
1395 }
1396
1397 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1399
1400 std::task::Poll::Ready(Some(match header.ordinal {
1401 0x75d3ff081eca468d => {
1402 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1403 let mut req = fidl::new_empty!(CrashIntrospectFindComponentByThreadKoidRequest, fdomain_client::fidl::FDomainResourceDialect);
1404 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<CrashIntrospectFindComponentByThreadKoidRequest>(&header, _body_bytes, handles, &mut req)?;
1405 let control_handle = CrashIntrospectControlHandle {
1406 inner: this.inner.clone(),
1407 };
1408 Ok(CrashIntrospectRequest::FindComponentByThreadKoid {thread_koid: req.thread_koid,
1409
1410 responder: CrashIntrospectFindComponentByThreadKoidResponder {
1411 control_handle: std::mem::ManuallyDrop::new(control_handle),
1412 tx_id: header.tx_id,
1413 },
1414 })
1415 }
1416 _ => Err(fidl::Error::UnknownOrdinal {
1417 ordinal: header.ordinal,
1418 protocol_name: <CrashIntrospectMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1419 }),
1420 }))
1421 },
1422 )
1423 }
1424}
1425
1426#[derive(Debug)]
1430pub enum CrashIntrospectRequest {
1431 FindComponentByThreadKoid {
1440 thread_koid: u64,
1441 responder: CrashIntrospectFindComponentByThreadKoidResponder,
1442 },
1443}
1444
1445impl CrashIntrospectRequest {
1446 #[allow(irrefutable_let_patterns)]
1447 pub fn into_find_component_by_thread_koid(
1448 self,
1449 ) -> Option<(u64, CrashIntrospectFindComponentByThreadKoidResponder)> {
1450 if let CrashIntrospectRequest::FindComponentByThreadKoid { thread_koid, responder } = self {
1451 Some((thread_koid, responder))
1452 } else {
1453 None
1454 }
1455 }
1456
1457 pub fn method_name(&self) -> &'static str {
1459 match *self {
1460 CrashIntrospectRequest::FindComponentByThreadKoid { .. } => {
1461 "find_component_by_thread_koid"
1462 }
1463 }
1464 }
1465}
1466
1467#[derive(Debug, Clone)]
1468pub struct CrashIntrospectControlHandle {
1469 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1470}
1471
1472impl CrashIntrospectControlHandle {
1473 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1474 self.inner.shutdown_with_epitaph(status.into())
1475 }
1476}
1477
1478impl fdomain_client::fidl::ControlHandle for CrashIntrospectControlHandle {
1479 fn shutdown(&self) {
1480 self.inner.shutdown()
1481 }
1482
1483 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1484 self.inner.shutdown_with_epitaph(status)
1485 }
1486
1487 fn is_closed(&self) -> bool {
1488 self.inner.channel().is_closed()
1489 }
1490 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1491 self.inner.channel().on_closed()
1492 }
1493}
1494
1495impl CrashIntrospectControlHandle {}
1496
1497#[must_use = "FIDL methods require a response to be sent"]
1498#[derive(Debug)]
1499pub struct CrashIntrospectFindComponentByThreadKoidResponder {
1500 control_handle: std::mem::ManuallyDrop<CrashIntrospectControlHandle>,
1501 tx_id: u32,
1502}
1503
1504impl std::ops::Drop for CrashIntrospectFindComponentByThreadKoidResponder {
1508 fn drop(&mut self) {
1509 self.control_handle.shutdown();
1510 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1512 }
1513}
1514
1515impl fdomain_client::fidl::Responder for CrashIntrospectFindComponentByThreadKoidResponder {
1516 type ControlHandle = CrashIntrospectControlHandle;
1517
1518 fn control_handle(&self) -> &CrashIntrospectControlHandle {
1519 &self.control_handle
1520 }
1521
1522 fn drop_without_shutdown(mut self) {
1523 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1525 std::mem::forget(self);
1527 }
1528}
1529
1530impl CrashIntrospectFindComponentByThreadKoidResponder {
1531 pub fn send(
1535 self,
1536 mut result: Result<&ComponentCrashInfo, fdomain_fuchsia_component::Error>,
1537 ) -> Result<(), fidl::Error> {
1538 let _result = self.send_raw(result);
1539 if _result.is_err() {
1540 self.control_handle.shutdown();
1541 }
1542 self.drop_without_shutdown();
1543 _result
1544 }
1545
1546 pub fn send_no_shutdown_on_err(
1548 self,
1549 mut result: Result<&ComponentCrashInfo, fdomain_fuchsia_component::Error>,
1550 ) -> Result<(), fidl::Error> {
1551 let _result = self.send_raw(result);
1552 self.drop_without_shutdown();
1553 _result
1554 }
1555
1556 fn send_raw(
1557 &self,
1558 mut result: Result<&ComponentCrashInfo, fdomain_fuchsia_component::Error>,
1559 ) -> Result<(), fidl::Error> {
1560 self.control_handle.inner.send::<fidl::encoding::ResultType<
1561 CrashIntrospectFindComponentByThreadKoidResponse,
1562 fdomain_fuchsia_component::Error,
1563 >>(
1564 result.map(|info| (info,)),
1565 self.tx_id,
1566 0x75d3ff081eca468d,
1567 fidl::encoding::DynamicFlags::empty(),
1568 )
1569 }
1570}
1571
1572#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1573pub struct InstanceIteratorMarker;
1574
1575impl fdomain_client::fidl::ProtocolMarker for InstanceIteratorMarker {
1576 type Proxy = InstanceIteratorProxy;
1577 type RequestStream = InstanceIteratorRequestStream;
1578
1579 const DEBUG_NAME: &'static str = "(anonymous) InstanceIterator";
1580}
1581
1582pub trait InstanceIteratorProxyInterface: Send + Sync {
1583 type NextResponseFut: std::future::Future<Output = Result<Vec<Instance>, fidl::Error>> + Send;
1584 fn r#next(&self) -> Self::NextResponseFut;
1585}
1586
1587#[derive(Debug, Clone)]
1588pub struct InstanceIteratorProxy {
1589 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1590}
1591
1592impl fdomain_client::fidl::Proxy for InstanceIteratorProxy {
1593 type Protocol = InstanceIteratorMarker;
1594
1595 fn from_channel(inner: fdomain_client::Channel) -> Self {
1596 Self::new(inner)
1597 }
1598
1599 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1600 self.client.into_channel().map_err(|client| Self { client })
1601 }
1602
1603 fn as_channel(&self) -> &fdomain_client::Channel {
1604 self.client.as_channel()
1605 }
1606}
1607
1608impl InstanceIteratorProxy {
1609 pub fn new(channel: fdomain_client::Channel) -> Self {
1611 let protocol_name =
1612 <InstanceIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1613 Self { client: fidl::client::Client::new(channel, protocol_name) }
1614 }
1615
1616 pub fn take_event_stream(&self) -> InstanceIteratorEventStream {
1622 InstanceIteratorEventStream { event_receiver: self.client.take_event_receiver() }
1623 }
1624
1625 pub fn r#next(
1626 &self,
1627 ) -> fidl::client::QueryResponseFut<Vec<Instance>, fdomain_client::fidl::FDomainResourceDialect>
1628 {
1629 InstanceIteratorProxyInterface::r#next(self)
1630 }
1631}
1632
1633impl InstanceIteratorProxyInterface for InstanceIteratorProxy {
1634 type NextResponseFut =
1635 fidl::client::QueryResponseFut<Vec<Instance>, fdomain_client::fidl::FDomainResourceDialect>;
1636 fn r#next(&self) -> Self::NextResponseFut {
1637 fn _decode(
1638 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1639 ) -> Result<Vec<Instance>, fidl::Error> {
1640 let _response = fidl::client::decode_transaction_body::<
1641 InstanceIteratorNextResponse,
1642 fdomain_client::fidl::FDomainResourceDialect,
1643 0x3a4e3d52432a52ee,
1644 >(_buf?)?;
1645 Ok(_response.infos)
1646 }
1647 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Instance>>(
1648 (),
1649 0x3a4e3d52432a52ee,
1650 fidl::encoding::DynamicFlags::empty(),
1651 _decode,
1652 )
1653 }
1654}
1655
1656pub struct InstanceIteratorEventStream {
1657 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1658}
1659
1660impl std::marker::Unpin for InstanceIteratorEventStream {}
1661
1662impl futures::stream::FusedStream for InstanceIteratorEventStream {
1663 fn is_terminated(&self) -> bool {
1664 self.event_receiver.is_terminated()
1665 }
1666}
1667
1668impl futures::Stream for InstanceIteratorEventStream {
1669 type Item = Result<InstanceIteratorEvent, fidl::Error>;
1670
1671 fn poll_next(
1672 mut self: std::pin::Pin<&mut Self>,
1673 cx: &mut std::task::Context<'_>,
1674 ) -> std::task::Poll<Option<Self::Item>> {
1675 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1676 &mut self.event_receiver,
1677 cx
1678 )?) {
1679 Some(buf) => std::task::Poll::Ready(Some(InstanceIteratorEvent::decode(buf))),
1680 None => std::task::Poll::Ready(None),
1681 }
1682 }
1683}
1684
1685#[derive(Debug)]
1686pub enum InstanceIteratorEvent {}
1687
1688impl InstanceIteratorEvent {
1689 fn decode(
1691 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1692 ) -> Result<InstanceIteratorEvent, fidl::Error> {
1693 let (bytes, _handles) = buf.split_mut();
1694 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1695 debug_assert_eq!(tx_header.tx_id, 0);
1696 match tx_header.ordinal {
1697 _ => Err(fidl::Error::UnknownOrdinal {
1698 ordinal: tx_header.ordinal,
1699 protocol_name:
1700 <InstanceIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1701 }),
1702 }
1703 }
1704}
1705
1706pub struct InstanceIteratorRequestStream {
1708 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1709 is_terminated: bool,
1710}
1711
1712impl std::marker::Unpin for InstanceIteratorRequestStream {}
1713
1714impl futures::stream::FusedStream for InstanceIteratorRequestStream {
1715 fn is_terminated(&self) -> bool {
1716 self.is_terminated
1717 }
1718}
1719
1720impl fdomain_client::fidl::RequestStream for InstanceIteratorRequestStream {
1721 type Protocol = InstanceIteratorMarker;
1722 type ControlHandle = InstanceIteratorControlHandle;
1723
1724 fn from_channel(channel: fdomain_client::Channel) -> Self {
1725 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1726 }
1727
1728 fn control_handle(&self) -> Self::ControlHandle {
1729 InstanceIteratorControlHandle { inner: self.inner.clone() }
1730 }
1731
1732 fn into_inner(
1733 self,
1734 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1735 {
1736 (self.inner, self.is_terminated)
1737 }
1738
1739 fn from_inner(
1740 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1741 is_terminated: bool,
1742 ) -> Self {
1743 Self { inner, is_terminated }
1744 }
1745}
1746
1747impl futures::Stream for InstanceIteratorRequestStream {
1748 type Item = Result<InstanceIteratorRequest, fidl::Error>;
1749
1750 fn poll_next(
1751 mut self: std::pin::Pin<&mut Self>,
1752 cx: &mut std::task::Context<'_>,
1753 ) -> std::task::Poll<Option<Self::Item>> {
1754 let this = &mut *self;
1755 if this.inner.check_shutdown(cx) {
1756 this.is_terminated = true;
1757 return std::task::Poll::Ready(None);
1758 }
1759 if this.is_terminated {
1760 panic!("polled InstanceIteratorRequestStream after completion");
1761 }
1762 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1763 |bytes, handles| {
1764 match this.inner.channel().read_etc(cx, bytes, handles) {
1765 std::task::Poll::Ready(Ok(())) => {}
1766 std::task::Poll::Pending => return std::task::Poll::Pending,
1767 std::task::Poll::Ready(Err(None)) => {
1768 this.is_terminated = true;
1769 return std::task::Poll::Ready(None);
1770 }
1771 std::task::Poll::Ready(Err(Some(e))) => {
1772 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1773 e.into(),
1774 ))));
1775 }
1776 }
1777
1778 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1780
1781 std::task::Poll::Ready(Some(match header.ordinal {
1782 0x3a4e3d52432a52ee => {
1783 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1784 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
1785 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1786 let control_handle = InstanceIteratorControlHandle {
1787 inner: this.inner.clone(),
1788 };
1789 Ok(InstanceIteratorRequest::Next {
1790 responder: InstanceIteratorNextResponder {
1791 control_handle: std::mem::ManuallyDrop::new(control_handle),
1792 tx_id: header.tx_id,
1793 },
1794 })
1795 }
1796 _ => Err(fidl::Error::UnknownOrdinal {
1797 ordinal: header.ordinal,
1798 protocol_name: <InstanceIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1799 }),
1800 }))
1801 },
1802 )
1803 }
1804}
1805
1806#[derive(Debug)]
1808pub enum InstanceIteratorRequest {
1809 Next { responder: InstanceIteratorNextResponder },
1810}
1811
1812impl InstanceIteratorRequest {
1813 #[allow(irrefutable_let_patterns)]
1814 pub fn into_next(self) -> Option<(InstanceIteratorNextResponder)> {
1815 if let InstanceIteratorRequest::Next { responder } = self {
1816 Some((responder))
1817 } else {
1818 None
1819 }
1820 }
1821
1822 pub fn method_name(&self) -> &'static str {
1824 match *self {
1825 InstanceIteratorRequest::Next { .. } => "next",
1826 }
1827 }
1828}
1829
1830#[derive(Debug, Clone)]
1831pub struct InstanceIteratorControlHandle {
1832 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1833}
1834
1835impl InstanceIteratorControlHandle {
1836 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1837 self.inner.shutdown_with_epitaph(status.into())
1838 }
1839}
1840
1841impl fdomain_client::fidl::ControlHandle for InstanceIteratorControlHandle {
1842 fn shutdown(&self) {
1843 self.inner.shutdown()
1844 }
1845
1846 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1847 self.inner.shutdown_with_epitaph(status)
1848 }
1849
1850 fn is_closed(&self) -> bool {
1851 self.inner.channel().is_closed()
1852 }
1853 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1854 self.inner.channel().on_closed()
1855 }
1856}
1857
1858impl InstanceIteratorControlHandle {}
1859
1860#[must_use = "FIDL methods require a response to be sent"]
1861#[derive(Debug)]
1862pub struct InstanceIteratorNextResponder {
1863 control_handle: std::mem::ManuallyDrop<InstanceIteratorControlHandle>,
1864 tx_id: u32,
1865}
1866
1867impl std::ops::Drop for InstanceIteratorNextResponder {
1871 fn drop(&mut self) {
1872 self.control_handle.shutdown();
1873 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1875 }
1876}
1877
1878impl fdomain_client::fidl::Responder for InstanceIteratorNextResponder {
1879 type ControlHandle = InstanceIteratorControlHandle;
1880
1881 fn control_handle(&self) -> &InstanceIteratorControlHandle {
1882 &self.control_handle
1883 }
1884
1885 fn drop_without_shutdown(mut self) {
1886 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1888 std::mem::forget(self);
1890 }
1891}
1892
1893impl InstanceIteratorNextResponder {
1894 pub fn send(self, mut infos: &[Instance]) -> Result<(), fidl::Error> {
1898 let _result = self.send_raw(infos);
1899 if _result.is_err() {
1900 self.control_handle.shutdown();
1901 }
1902 self.drop_without_shutdown();
1903 _result
1904 }
1905
1906 pub fn send_no_shutdown_on_err(self, mut infos: &[Instance]) -> Result<(), fidl::Error> {
1908 let _result = self.send_raw(infos);
1909 self.drop_without_shutdown();
1910 _result
1911 }
1912
1913 fn send_raw(&self, mut infos: &[Instance]) -> Result<(), fidl::Error> {
1914 self.control_handle.inner.send::<InstanceIteratorNextResponse>(
1915 (infos,),
1916 self.tx_id,
1917 0x3a4e3d52432a52ee,
1918 fidl::encoding::DynamicFlags::empty(),
1919 )
1920 }
1921}
1922
1923#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1924pub struct LifecycleControllerMarker;
1925
1926impl fdomain_client::fidl::ProtocolMarker for LifecycleControllerMarker {
1927 type Proxy = LifecycleControllerProxy;
1928 type RequestStream = LifecycleControllerRequestStream;
1929
1930 const DEBUG_NAME: &'static str = "fuchsia.sys2.LifecycleController";
1931}
1932impl fdomain_client::fidl::DiscoverableProtocolMarker for LifecycleControllerMarker {}
1933pub type LifecycleControllerStartInstanceResult = Result<(), StartError>;
1934pub type LifecycleControllerStartInstanceWithArgsResult = Result<(), StartError>;
1935pub type LifecycleControllerStopInstanceResult = Result<(), StopError>;
1936pub type LifecycleControllerResolveInstanceResult = Result<(), ResolveError>;
1937pub type LifecycleControllerUnresolveInstanceResult = Result<(), UnresolveError>;
1938pub type LifecycleControllerCreateInstanceResult = Result<(), CreateError>;
1939pub type LifecycleControllerDestroyInstanceResult = Result<(), DestroyError>;
1940
1941pub trait LifecycleControllerProxyInterface: Send + Sync {
1942 type StartInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerStartInstanceResult, fidl::Error>>
1943 + Send;
1944 fn r#start_instance(
1945 &self,
1946 moniker: &str,
1947 binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
1948 ) -> Self::StartInstanceResponseFut;
1949 type StartInstanceWithArgsResponseFut: std::future::Future<
1950 Output = Result<LifecycleControllerStartInstanceWithArgsResult, fidl::Error>,
1951 > + Send;
1952 fn r#start_instance_with_args(
1953 &self,
1954 moniker: &str,
1955 binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
1956 args: fdomain_fuchsia_component::StartChildArgs,
1957 ) -> Self::StartInstanceWithArgsResponseFut;
1958 type StopInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerStopInstanceResult, fidl::Error>>
1959 + Send;
1960 fn r#stop_instance(&self, moniker: &str) -> Self::StopInstanceResponseFut;
1961 type ResolveInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerResolveInstanceResult, fidl::Error>>
1962 + Send;
1963 fn r#resolve_instance(&self, moniker: &str) -> Self::ResolveInstanceResponseFut;
1964 type UnresolveInstanceResponseFut: std::future::Future<
1965 Output = Result<LifecycleControllerUnresolveInstanceResult, fidl::Error>,
1966 > + Send;
1967 fn r#unresolve_instance(&self, moniker: &str) -> Self::UnresolveInstanceResponseFut;
1968 type CreateInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerCreateInstanceResult, fidl::Error>>
1969 + Send;
1970 fn r#create_instance(
1971 &self,
1972 parent_moniker: &str,
1973 collection: &fdomain_fuchsia_component_decl::CollectionRef,
1974 decl: &fdomain_fuchsia_component_decl::Child,
1975 args: fdomain_fuchsia_component::CreateChildArgs,
1976 ) -> Self::CreateInstanceResponseFut;
1977 type DestroyInstanceResponseFut: std::future::Future<Output = Result<LifecycleControllerDestroyInstanceResult, fidl::Error>>
1978 + Send;
1979 fn r#destroy_instance(
1980 &self,
1981 parent_moniker: &str,
1982 child: &fdomain_fuchsia_component_decl::ChildRef,
1983 ) -> Self::DestroyInstanceResponseFut;
1984}
1985
1986#[derive(Debug, Clone)]
1987pub struct LifecycleControllerProxy {
1988 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1989}
1990
1991impl fdomain_client::fidl::Proxy for LifecycleControllerProxy {
1992 type Protocol = LifecycleControllerMarker;
1993
1994 fn from_channel(inner: fdomain_client::Channel) -> Self {
1995 Self::new(inner)
1996 }
1997
1998 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1999 self.client.into_channel().map_err(|client| Self { client })
2000 }
2001
2002 fn as_channel(&self) -> &fdomain_client::Channel {
2003 self.client.as_channel()
2004 }
2005}
2006
2007impl LifecycleControllerProxy {
2008 pub fn new(channel: fdomain_client::Channel) -> Self {
2010 let protocol_name =
2011 <LifecycleControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
2012 Self { client: fidl::client::Client::new(channel, protocol_name) }
2013 }
2014
2015 pub fn take_event_stream(&self) -> LifecycleControllerEventStream {
2021 LifecycleControllerEventStream { event_receiver: self.client.take_event_receiver() }
2022 }
2023
2024 pub fn r#start_instance(
2035 &self,
2036 mut moniker: &str,
2037 mut binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
2038 ) -> fidl::client::QueryResponseFut<
2039 LifecycleControllerStartInstanceResult,
2040 fdomain_client::fidl::FDomainResourceDialect,
2041 > {
2042 LifecycleControllerProxyInterface::r#start_instance(self, moniker, binder)
2043 }
2044
2045 pub fn r#start_instance_with_args(
2046 &self,
2047 mut moniker: &str,
2048 mut binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
2049 mut args: fdomain_fuchsia_component::StartChildArgs,
2050 ) -> fidl::client::QueryResponseFut<
2051 LifecycleControllerStartInstanceWithArgsResult,
2052 fdomain_client::fidl::FDomainResourceDialect,
2053 > {
2054 LifecycleControllerProxyInterface::r#start_instance_with_args(self, moniker, binder, args)
2055 }
2056
2057 pub fn r#stop_instance(
2062 &self,
2063 mut moniker: &str,
2064 ) -> fidl::client::QueryResponseFut<
2065 LifecycleControllerStopInstanceResult,
2066 fdomain_client::fidl::FDomainResourceDialect,
2067 > {
2068 LifecycleControllerProxyInterface::r#stop_instance(self, moniker)
2069 }
2070
2071 pub fn r#resolve_instance(
2076 &self,
2077 mut moniker: &str,
2078 ) -> fidl::client::QueryResponseFut<
2079 LifecycleControllerResolveInstanceResult,
2080 fdomain_client::fidl::FDomainResourceDialect,
2081 > {
2082 LifecycleControllerProxyInterface::r#resolve_instance(self, moniker)
2083 }
2084
2085 pub fn r#unresolve_instance(
2090 &self,
2091 mut moniker: &str,
2092 ) -> fidl::client::QueryResponseFut<
2093 LifecycleControllerUnresolveInstanceResult,
2094 fdomain_client::fidl::FDomainResourceDialect,
2095 > {
2096 LifecycleControllerProxyInterface::r#unresolve_instance(self, moniker)
2097 }
2098
2099 pub fn r#create_instance(
2104 &self,
2105 mut parent_moniker: &str,
2106 mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
2107 mut decl: &fdomain_fuchsia_component_decl::Child,
2108 mut args: fdomain_fuchsia_component::CreateChildArgs,
2109 ) -> fidl::client::QueryResponseFut<
2110 LifecycleControllerCreateInstanceResult,
2111 fdomain_client::fidl::FDomainResourceDialect,
2112 > {
2113 LifecycleControllerProxyInterface::r#create_instance(
2114 self,
2115 parent_moniker,
2116 collection,
2117 decl,
2118 args,
2119 )
2120 }
2121
2122 pub fn r#destroy_instance(
2127 &self,
2128 mut parent_moniker: &str,
2129 mut child: &fdomain_fuchsia_component_decl::ChildRef,
2130 ) -> fidl::client::QueryResponseFut<
2131 LifecycleControllerDestroyInstanceResult,
2132 fdomain_client::fidl::FDomainResourceDialect,
2133 > {
2134 LifecycleControllerProxyInterface::r#destroy_instance(self, parent_moniker, child)
2135 }
2136}
2137
2138impl LifecycleControllerProxyInterface for LifecycleControllerProxy {
2139 type StartInstanceResponseFut = fidl::client::QueryResponseFut<
2140 LifecycleControllerStartInstanceResult,
2141 fdomain_client::fidl::FDomainResourceDialect,
2142 >;
2143 fn r#start_instance(
2144 &self,
2145 mut moniker: &str,
2146 mut binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
2147 ) -> Self::StartInstanceResponseFut {
2148 fn _decode(
2149 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2150 ) -> Result<LifecycleControllerStartInstanceResult, fidl::Error> {
2151 let _response = fidl::client::decode_transaction_body::<
2152 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
2153 fdomain_client::fidl::FDomainResourceDialect,
2154 0x13fcb422876384bf,
2155 >(_buf?)?;
2156 Ok(_response.map(|x| x))
2157 }
2158 self.client.send_query_and_decode::<
2159 LifecycleControllerStartInstanceRequest,
2160 LifecycleControllerStartInstanceResult,
2161 >(
2162 (moniker, binder,),
2163 0x13fcb422876384bf,
2164 fidl::encoding::DynamicFlags::empty(),
2165 _decode,
2166 )
2167 }
2168
2169 type StartInstanceWithArgsResponseFut = fidl::client::QueryResponseFut<
2170 LifecycleControllerStartInstanceWithArgsResult,
2171 fdomain_client::fidl::FDomainResourceDialect,
2172 >;
2173 fn r#start_instance_with_args(
2174 &self,
2175 mut moniker: &str,
2176 mut binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
2177 mut args: fdomain_fuchsia_component::StartChildArgs,
2178 ) -> Self::StartInstanceWithArgsResponseFut {
2179 fn _decode(
2180 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2181 ) -> Result<LifecycleControllerStartInstanceWithArgsResult, fidl::Error> {
2182 let _response = fidl::client::decode_transaction_body::<
2183 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>,
2184 fdomain_client::fidl::FDomainResourceDialect,
2185 0xd3b467436223e9,
2186 >(_buf?)?;
2187 Ok(_response.map(|x| x))
2188 }
2189 self.client.send_query_and_decode::<
2190 LifecycleControllerStartInstanceWithArgsRequest,
2191 LifecycleControllerStartInstanceWithArgsResult,
2192 >(
2193 (moniker, binder, &mut args,),
2194 0xd3b467436223e9,
2195 fidl::encoding::DynamicFlags::empty(),
2196 _decode,
2197 )
2198 }
2199
2200 type StopInstanceResponseFut = fidl::client::QueryResponseFut<
2201 LifecycleControllerStopInstanceResult,
2202 fdomain_client::fidl::FDomainResourceDialect,
2203 >;
2204 fn r#stop_instance(&self, mut moniker: &str) -> Self::StopInstanceResponseFut {
2205 fn _decode(
2206 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2207 ) -> Result<LifecycleControllerStopInstanceResult, fidl::Error> {
2208 let _response = fidl::client::decode_transaction_body::<
2209 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StopError>,
2210 fdomain_client::fidl::FDomainResourceDialect,
2211 0x1362ba9d0e3caf36,
2212 >(_buf?)?;
2213 Ok(_response.map(|x| x))
2214 }
2215 self.client.send_query_and_decode::<
2216 LifecycleControllerStopInstanceRequest,
2217 LifecycleControllerStopInstanceResult,
2218 >(
2219 (moniker,),
2220 0x1362ba9d0e3caf36,
2221 fidl::encoding::DynamicFlags::empty(),
2222 _decode,
2223 )
2224 }
2225
2226 type ResolveInstanceResponseFut = fidl::client::QueryResponseFut<
2227 LifecycleControllerResolveInstanceResult,
2228 fdomain_client::fidl::FDomainResourceDialect,
2229 >;
2230 fn r#resolve_instance(&self, mut moniker: &str) -> Self::ResolveInstanceResponseFut {
2231 fn _decode(
2232 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2233 ) -> Result<LifecycleControllerResolveInstanceResult, fidl::Error> {
2234 let _response = fidl::client::decode_transaction_body::<
2235 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ResolveError>,
2236 fdomain_client::fidl::FDomainResourceDialect,
2237 0x426ab8dd53d8e737,
2238 >(_buf?)?;
2239 Ok(_response.map(|x| x))
2240 }
2241 self.client.send_query_and_decode::<
2242 LifecycleControllerResolveInstanceRequest,
2243 LifecycleControllerResolveInstanceResult,
2244 >(
2245 (moniker,),
2246 0x426ab8dd53d8e737,
2247 fidl::encoding::DynamicFlags::empty(),
2248 _decode,
2249 )
2250 }
2251
2252 type UnresolveInstanceResponseFut = fidl::client::QueryResponseFut<
2253 LifecycleControllerUnresolveInstanceResult,
2254 fdomain_client::fidl::FDomainResourceDialect,
2255 >;
2256 fn r#unresolve_instance(&self, mut moniker: &str) -> Self::UnresolveInstanceResponseFut {
2257 fn _decode(
2258 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2259 ) -> Result<LifecycleControllerUnresolveInstanceResult, fidl::Error> {
2260 let _response = fidl::client::decode_transaction_body::<
2261 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UnresolveError>,
2262 fdomain_client::fidl::FDomainResourceDialect,
2263 0x18166a2aa798cb99,
2264 >(_buf?)?;
2265 Ok(_response.map(|x| x))
2266 }
2267 self.client.send_query_and_decode::<
2268 LifecycleControllerUnresolveInstanceRequest,
2269 LifecycleControllerUnresolveInstanceResult,
2270 >(
2271 (moniker,),
2272 0x18166a2aa798cb99,
2273 fidl::encoding::DynamicFlags::empty(),
2274 _decode,
2275 )
2276 }
2277
2278 type CreateInstanceResponseFut = fidl::client::QueryResponseFut<
2279 LifecycleControllerCreateInstanceResult,
2280 fdomain_client::fidl::FDomainResourceDialect,
2281 >;
2282 fn r#create_instance(
2283 &self,
2284 mut parent_moniker: &str,
2285 mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
2286 mut decl: &fdomain_fuchsia_component_decl::Child,
2287 mut args: fdomain_fuchsia_component::CreateChildArgs,
2288 ) -> Self::CreateInstanceResponseFut {
2289 fn _decode(
2290 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2291 ) -> Result<LifecycleControllerCreateInstanceResult, fidl::Error> {
2292 let _response = fidl::client::decode_transaction_body::<
2293 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, CreateError>,
2294 fdomain_client::fidl::FDomainResourceDialect,
2295 0x48d17ae777e4f9,
2296 >(_buf?)?;
2297 Ok(_response.map(|x| x))
2298 }
2299 self.client.send_query_and_decode::<
2300 LifecycleControllerCreateInstanceRequest,
2301 LifecycleControllerCreateInstanceResult,
2302 >(
2303 (parent_moniker, collection, decl, &mut args,),
2304 0x48d17ae777e4f9,
2305 fidl::encoding::DynamicFlags::empty(),
2306 _decode,
2307 )
2308 }
2309
2310 type DestroyInstanceResponseFut = fidl::client::QueryResponseFut<
2311 LifecycleControllerDestroyInstanceResult,
2312 fdomain_client::fidl::FDomainResourceDialect,
2313 >;
2314 fn r#destroy_instance(
2315 &self,
2316 mut parent_moniker: &str,
2317 mut child: &fdomain_fuchsia_component_decl::ChildRef,
2318 ) -> Self::DestroyInstanceResponseFut {
2319 fn _decode(
2320 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2321 ) -> Result<LifecycleControllerDestroyInstanceResult, fidl::Error> {
2322 let _response = fidl::client::decode_transaction_body::<
2323 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DestroyError>,
2324 fdomain_client::fidl::FDomainResourceDialect,
2325 0x27640ae5889d7443,
2326 >(_buf?)?;
2327 Ok(_response.map(|x| x))
2328 }
2329 self.client.send_query_and_decode::<
2330 LifecycleControllerDestroyInstanceRequest,
2331 LifecycleControllerDestroyInstanceResult,
2332 >(
2333 (parent_moniker, child,),
2334 0x27640ae5889d7443,
2335 fidl::encoding::DynamicFlags::empty(),
2336 _decode,
2337 )
2338 }
2339}
2340
2341pub struct LifecycleControllerEventStream {
2342 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2343}
2344
2345impl std::marker::Unpin for LifecycleControllerEventStream {}
2346
2347impl futures::stream::FusedStream for LifecycleControllerEventStream {
2348 fn is_terminated(&self) -> bool {
2349 self.event_receiver.is_terminated()
2350 }
2351}
2352
2353impl futures::Stream for LifecycleControllerEventStream {
2354 type Item = Result<LifecycleControllerEvent, fidl::Error>;
2355
2356 fn poll_next(
2357 mut self: std::pin::Pin<&mut Self>,
2358 cx: &mut std::task::Context<'_>,
2359 ) -> std::task::Poll<Option<Self::Item>> {
2360 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2361 &mut self.event_receiver,
2362 cx
2363 )?) {
2364 Some(buf) => std::task::Poll::Ready(Some(LifecycleControllerEvent::decode(buf))),
2365 None => std::task::Poll::Ready(None),
2366 }
2367 }
2368}
2369
2370#[derive(Debug)]
2371pub enum LifecycleControllerEvent {}
2372
2373impl LifecycleControllerEvent {
2374 fn decode(
2376 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2377 ) -> Result<LifecycleControllerEvent, fidl::Error> {
2378 let (bytes, _handles) = buf.split_mut();
2379 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2380 debug_assert_eq!(tx_header.tx_id, 0);
2381 match tx_header.ordinal {
2382 _ => Err(fidl::Error::UnknownOrdinal {
2383 ordinal: tx_header.ordinal,
2384 protocol_name:
2385 <LifecycleControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2386 }),
2387 }
2388 }
2389}
2390
2391pub struct LifecycleControllerRequestStream {
2393 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2394 is_terminated: bool,
2395}
2396
2397impl std::marker::Unpin for LifecycleControllerRequestStream {}
2398
2399impl futures::stream::FusedStream for LifecycleControllerRequestStream {
2400 fn is_terminated(&self) -> bool {
2401 self.is_terminated
2402 }
2403}
2404
2405impl fdomain_client::fidl::RequestStream for LifecycleControllerRequestStream {
2406 type Protocol = LifecycleControllerMarker;
2407 type ControlHandle = LifecycleControllerControlHandle;
2408
2409 fn from_channel(channel: fdomain_client::Channel) -> Self {
2410 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2411 }
2412
2413 fn control_handle(&self) -> Self::ControlHandle {
2414 LifecycleControllerControlHandle { inner: self.inner.clone() }
2415 }
2416
2417 fn into_inner(
2418 self,
2419 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2420 {
2421 (self.inner, self.is_terminated)
2422 }
2423
2424 fn from_inner(
2425 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2426 is_terminated: bool,
2427 ) -> Self {
2428 Self { inner, is_terminated }
2429 }
2430}
2431
2432impl futures::Stream for LifecycleControllerRequestStream {
2433 type Item = Result<LifecycleControllerRequest, fidl::Error>;
2434
2435 fn poll_next(
2436 mut self: std::pin::Pin<&mut Self>,
2437 cx: &mut std::task::Context<'_>,
2438 ) -> std::task::Poll<Option<Self::Item>> {
2439 let this = &mut *self;
2440 if this.inner.check_shutdown(cx) {
2441 this.is_terminated = true;
2442 return std::task::Poll::Ready(None);
2443 }
2444 if this.is_terminated {
2445 panic!("polled LifecycleControllerRequestStream after completion");
2446 }
2447 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2448 |bytes, handles| {
2449 match this.inner.channel().read_etc(cx, bytes, handles) {
2450 std::task::Poll::Ready(Ok(())) => {}
2451 std::task::Poll::Pending => return std::task::Poll::Pending,
2452 std::task::Poll::Ready(Err(None)) => {
2453 this.is_terminated = true;
2454 return std::task::Poll::Ready(None);
2455 }
2456 std::task::Poll::Ready(Err(Some(e))) => {
2457 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2458 e.into(),
2459 ))));
2460 }
2461 }
2462
2463 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2465
2466 std::task::Poll::Ready(Some(match header.ordinal {
2467 0x13fcb422876384bf => {
2468 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2469 let mut req = fidl::new_empty!(LifecycleControllerStartInstanceRequest, fdomain_client::fidl::FDomainResourceDialect);
2470 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LifecycleControllerStartInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2471 let control_handle = LifecycleControllerControlHandle {
2472 inner: this.inner.clone(),
2473 };
2474 Ok(LifecycleControllerRequest::StartInstance {moniker: req.moniker,
2475binder: req.binder,
2476
2477 responder: LifecycleControllerStartInstanceResponder {
2478 control_handle: std::mem::ManuallyDrop::new(control_handle),
2479 tx_id: header.tx_id,
2480 },
2481 })
2482 }
2483 0xd3b467436223e9 => {
2484 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2485 let mut req = fidl::new_empty!(LifecycleControllerStartInstanceWithArgsRequest, fdomain_client::fidl::FDomainResourceDialect);
2486 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LifecycleControllerStartInstanceWithArgsRequest>(&header, _body_bytes, handles, &mut req)?;
2487 let control_handle = LifecycleControllerControlHandle {
2488 inner: this.inner.clone(),
2489 };
2490 Ok(LifecycleControllerRequest::StartInstanceWithArgs {moniker: req.moniker,
2491binder: req.binder,
2492args: req.args,
2493
2494 responder: LifecycleControllerStartInstanceWithArgsResponder {
2495 control_handle: std::mem::ManuallyDrop::new(control_handle),
2496 tx_id: header.tx_id,
2497 },
2498 })
2499 }
2500 0x1362ba9d0e3caf36 => {
2501 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2502 let mut req = fidl::new_empty!(LifecycleControllerStopInstanceRequest, fdomain_client::fidl::FDomainResourceDialect);
2503 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LifecycleControllerStopInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2504 let control_handle = LifecycleControllerControlHandle {
2505 inner: this.inner.clone(),
2506 };
2507 Ok(LifecycleControllerRequest::StopInstance {moniker: req.moniker,
2508
2509 responder: LifecycleControllerStopInstanceResponder {
2510 control_handle: std::mem::ManuallyDrop::new(control_handle),
2511 tx_id: header.tx_id,
2512 },
2513 })
2514 }
2515 0x426ab8dd53d8e737 => {
2516 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2517 let mut req = fidl::new_empty!(LifecycleControllerResolveInstanceRequest, fdomain_client::fidl::FDomainResourceDialect);
2518 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LifecycleControllerResolveInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2519 let control_handle = LifecycleControllerControlHandle {
2520 inner: this.inner.clone(),
2521 };
2522 Ok(LifecycleControllerRequest::ResolveInstance {moniker: req.moniker,
2523
2524 responder: LifecycleControllerResolveInstanceResponder {
2525 control_handle: std::mem::ManuallyDrop::new(control_handle),
2526 tx_id: header.tx_id,
2527 },
2528 })
2529 }
2530 0x18166a2aa798cb99 => {
2531 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2532 let mut req = fidl::new_empty!(LifecycleControllerUnresolveInstanceRequest, fdomain_client::fidl::FDomainResourceDialect);
2533 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LifecycleControllerUnresolveInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2534 let control_handle = LifecycleControllerControlHandle {
2535 inner: this.inner.clone(),
2536 };
2537 Ok(LifecycleControllerRequest::UnresolveInstance {moniker: req.moniker,
2538
2539 responder: LifecycleControllerUnresolveInstanceResponder {
2540 control_handle: std::mem::ManuallyDrop::new(control_handle),
2541 tx_id: header.tx_id,
2542 },
2543 })
2544 }
2545 0x48d17ae777e4f9 => {
2546 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2547 let mut req = fidl::new_empty!(LifecycleControllerCreateInstanceRequest, fdomain_client::fidl::FDomainResourceDialect);
2548 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LifecycleControllerCreateInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2549 let control_handle = LifecycleControllerControlHandle {
2550 inner: this.inner.clone(),
2551 };
2552 Ok(LifecycleControllerRequest::CreateInstance {parent_moniker: req.parent_moniker,
2553collection: req.collection,
2554decl: req.decl,
2555args: req.args,
2556
2557 responder: LifecycleControllerCreateInstanceResponder {
2558 control_handle: std::mem::ManuallyDrop::new(control_handle),
2559 tx_id: header.tx_id,
2560 },
2561 })
2562 }
2563 0x27640ae5889d7443 => {
2564 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2565 let mut req = fidl::new_empty!(LifecycleControllerDestroyInstanceRequest, fdomain_client::fidl::FDomainResourceDialect);
2566 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<LifecycleControllerDestroyInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
2567 let control_handle = LifecycleControllerControlHandle {
2568 inner: this.inner.clone(),
2569 };
2570 Ok(LifecycleControllerRequest::DestroyInstance {parent_moniker: req.parent_moniker,
2571child: req.child,
2572
2573 responder: LifecycleControllerDestroyInstanceResponder {
2574 control_handle: std::mem::ManuallyDrop::new(control_handle),
2575 tx_id: header.tx_id,
2576 },
2577 })
2578 }
2579 _ => Err(fidl::Error::UnknownOrdinal {
2580 ordinal: header.ordinal,
2581 protocol_name: <LifecycleControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2582 }),
2583 }))
2584 },
2585 )
2586 }
2587}
2588
2589#[derive(Debug)]
2591pub enum LifecycleControllerRequest {
2592 StartInstance {
2603 moniker: String,
2604 binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
2605 responder: LifecycleControllerStartInstanceResponder,
2606 },
2607 StartInstanceWithArgs {
2608 moniker: String,
2609 binder: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
2610 args: fdomain_fuchsia_component::StartChildArgs,
2611 responder: LifecycleControllerStartInstanceWithArgsResponder,
2612 },
2613 StopInstance { moniker: String, responder: LifecycleControllerStopInstanceResponder },
2618 ResolveInstance { moniker: String, responder: LifecycleControllerResolveInstanceResponder },
2623 UnresolveInstance { moniker: String, responder: LifecycleControllerUnresolveInstanceResponder },
2628 CreateInstance {
2633 parent_moniker: String,
2634 collection: fdomain_fuchsia_component_decl::CollectionRef,
2635 decl: fdomain_fuchsia_component_decl::Child,
2636 args: fdomain_fuchsia_component::CreateChildArgs,
2637 responder: LifecycleControllerCreateInstanceResponder,
2638 },
2639 DestroyInstance {
2644 parent_moniker: String,
2645 child: fdomain_fuchsia_component_decl::ChildRef,
2646 responder: LifecycleControllerDestroyInstanceResponder,
2647 },
2648}
2649
2650impl LifecycleControllerRequest {
2651 #[allow(irrefutable_let_patterns)]
2652 pub fn into_start_instance(
2653 self,
2654 ) -> Option<(
2655 String,
2656 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
2657 LifecycleControllerStartInstanceResponder,
2658 )> {
2659 if let LifecycleControllerRequest::StartInstance { moniker, binder, responder } = self {
2660 Some((moniker, binder, responder))
2661 } else {
2662 None
2663 }
2664 }
2665
2666 #[allow(irrefutable_let_patterns)]
2667 pub fn into_start_instance_with_args(
2668 self,
2669 ) -> Option<(
2670 String,
2671 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
2672 fdomain_fuchsia_component::StartChildArgs,
2673 LifecycleControllerStartInstanceWithArgsResponder,
2674 )> {
2675 if let LifecycleControllerRequest::StartInstanceWithArgs {
2676 moniker,
2677 binder,
2678 args,
2679 responder,
2680 } = self
2681 {
2682 Some((moniker, binder, args, responder))
2683 } else {
2684 None
2685 }
2686 }
2687
2688 #[allow(irrefutable_let_patterns)]
2689 pub fn into_stop_instance(self) -> Option<(String, LifecycleControllerStopInstanceResponder)> {
2690 if let LifecycleControllerRequest::StopInstance { moniker, responder } = self {
2691 Some((moniker, responder))
2692 } else {
2693 None
2694 }
2695 }
2696
2697 #[allow(irrefutable_let_patterns)]
2698 pub fn into_resolve_instance(
2699 self,
2700 ) -> Option<(String, LifecycleControllerResolveInstanceResponder)> {
2701 if let LifecycleControllerRequest::ResolveInstance { moniker, responder } = self {
2702 Some((moniker, responder))
2703 } else {
2704 None
2705 }
2706 }
2707
2708 #[allow(irrefutable_let_patterns)]
2709 pub fn into_unresolve_instance(
2710 self,
2711 ) -> Option<(String, LifecycleControllerUnresolveInstanceResponder)> {
2712 if let LifecycleControllerRequest::UnresolveInstance { moniker, responder } = self {
2713 Some((moniker, responder))
2714 } else {
2715 None
2716 }
2717 }
2718
2719 #[allow(irrefutable_let_patterns)]
2720 pub fn into_create_instance(
2721 self,
2722 ) -> Option<(
2723 String,
2724 fdomain_fuchsia_component_decl::CollectionRef,
2725 fdomain_fuchsia_component_decl::Child,
2726 fdomain_fuchsia_component::CreateChildArgs,
2727 LifecycleControllerCreateInstanceResponder,
2728 )> {
2729 if let LifecycleControllerRequest::CreateInstance {
2730 parent_moniker,
2731 collection,
2732 decl,
2733 args,
2734 responder,
2735 } = self
2736 {
2737 Some((parent_moniker, collection, decl, args, responder))
2738 } else {
2739 None
2740 }
2741 }
2742
2743 #[allow(irrefutable_let_patterns)]
2744 pub fn into_destroy_instance(
2745 self,
2746 ) -> Option<(
2747 String,
2748 fdomain_fuchsia_component_decl::ChildRef,
2749 LifecycleControllerDestroyInstanceResponder,
2750 )> {
2751 if let LifecycleControllerRequest::DestroyInstance { parent_moniker, child, responder } =
2752 self
2753 {
2754 Some((parent_moniker, child, responder))
2755 } else {
2756 None
2757 }
2758 }
2759
2760 pub fn method_name(&self) -> &'static str {
2762 match *self {
2763 LifecycleControllerRequest::StartInstance { .. } => "start_instance",
2764 LifecycleControllerRequest::StartInstanceWithArgs { .. } => "start_instance_with_args",
2765 LifecycleControllerRequest::StopInstance { .. } => "stop_instance",
2766 LifecycleControllerRequest::ResolveInstance { .. } => "resolve_instance",
2767 LifecycleControllerRequest::UnresolveInstance { .. } => "unresolve_instance",
2768 LifecycleControllerRequest::CreateInstance { .. } => "create_instance",
2769 LifecycleControllerRequest::DestroyInstance { .. } => "destroy_instance",
2770 }
2771 }
2772}
2773
2774#[derive(Debug, Clone)]
2775pub struct LifecycleControllerControlHandle {
2776 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2777}
2778
2779impl LifecycleControllerControlHandle {
2780 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2781 self.inner.shutdown_with_epitaph(status.into())
2782 }
2783}
2784
2785impl fdomain_client::fidl::ControlHandle for LifecycleControllerControlHandle {
2786 fn shutdown(&self) {
2787 self.inner.shutdown()
2788 }
2789
2790 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2791 self.inner.shutdown_with_epitaph(status)
2792 }
2793
2794 fn is_closed(&self) -> bool {
2795 self.inner.channel().is_closed()
2796 }
2797 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2798 self.inner.channel().on_closed()
2799 }
2800}
2801
2802impl LifecycleControllerControlHandle {}
2803
2804#[must_use = "FIDL methods require a response to be sent"]
2805#[derive(Debug)]
2806pub struct LifecycleControllerStartInstanceResponder {
2807 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
2808 tx_id: u32,
2809}
2810
2811impl std::ops::Drop for LifecycleControllerStartInstanceResponder {
2815 fn drop(&mut self) {
2816 self.control_handle.shutdown();
2817 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2819 }
2820}
2821
2822impl fdomain_client::fidl::Responder for LifecycleControllerStartInstanceResponder {
2823 type ControlHandle = LifecycleControllerControlHandle;
2824
2825 fn control_handle(&self) -> &LifecycleControllerControlHandle {
2826 &self.control_handle
2827 }
2828
2829 fn drop_without_shutdown(mut self) {
2830 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2832 std::mem::forget(self);
2834 }
2835}
2836
2837impl LifecycleControllerStartInstanceResponder {
2838 pub fn send(self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
2842 let _result = self.send_raw(result);
2843 if _result.is_err() {
2844 self.control_handle.shutdown();
2845 }
2846 self.drop_without_shutdown();
2847 _result
2848 }
2849
2850 pub fn send_no_shutdown_on_err(
2852 self,
2853 mut result: Result<(), StartError>,
2854 ) -> Result<(), fidl::Error> {
2855 let _result = self.send_raw(result);
2856 self.drop_without_shutdown();
2857 _result
2858 }
2859
2860 fn send_raw(&self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
2861 self.control_handle
2862 .inner
2863 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>>(
2864 result,
2865 self.tx_id,
2866 0x13fcb422876384bf,
2867 fidl::encoding::DynamicFlags::empty(),
2868 )
2869 }
2870}
2871
2872#[must_use = "FIDL methods require a response to be sent"]
2873#[derive(Debug)]
2874pub struct LifecycleControllerStartInstanceWithArgsResponder {
2875 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
2876 tx_id: u32,
2877}
2878
2879impl std::ops::Drop for LifecycleControllerStartInstanceWithArgsResponder {
2883 fn drop(&mut self) {
2884 self.control_handle.shutdown();
2885 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2887 }
2888}
2889
2890impl fdomain_client::fidl::Responder for LifecycleControllerStartInstanceWithArgsResponder {
2891 type ControlHandle = LifecycleControllerControlHandle;
2892
2893 fn control_handle(&self) -> &LifecycleControllerControlHandle {
2894 &self.control_handle
2895 }
2896
2897 fn drop_without_shutdown(mut self) {
2898 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2900 std::mem::forget(self);
2902 }
2903}
2904
2905impl LifecycleControllerStartInstanceWithArgsResponder {
2906 pub fn send(self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
2910 let _result = self.send_raw(result);
2911 if _result.is_err() {
2912 self.control_handle.shutdown();
2913 }
2914 self.drop_without_shutdown();
2915 _result
2916 }
2917
2918 pub fn send_no_shutdown_on_err(
2920 self,
2921 mut result: Result<(), StartError>,
2922 ) -> Result<(), fidl::Error> {
2923 let _result = self.send_raw(result);
2924 self.drop_without_shutdown();
2925 _result
2926 }
2927
2928 fn send_raw(&self, mut result: Result<(), StartError>) -> Result<(), fidl::Error> {
2929 self.control_handle
2930 .inner
2931 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StartError>>(
2932 result,
2933 self.tx_id,
2934 0xd3b467436223e9,
2935 fidl::encoding::DynamicFlags::empty(),
2936 )
2937 }
2938}
2939
2940#[must_use = "FIDL methods require a response to be sent"]
2941#[derive(Debug)]
2942pub struct LifecycleControllerStopInstanceResponder {
2943 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
2944 tx_id: u32,
2945}
2946
2947impl std::ops::Drop for LifecycleControllerStopInstanceResponder {
2951 fn drop(&mut self) {
2952 self.control_handle.shutdown();
2953 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2955 }
2956}
2957
2958impl fdomain_client::fidl::Responder for LifecycleControllerStopInstanceResponder {
2959 type ControlHandle = LifecycleControllerControlHandle;
2960
2961 fn control_handle(&self) -> &LifecycleControllerControlHandle {
2962 &self.control_handle
2963 }
2964
2965 fn drop_without_shutdown(mut self) {
2966 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2968 std::mem::forget(self);
2970 }
2971}
2972
2973impl LifecycleControllerStopInstanceResponder {
2974 pub fn send(self, mut result: Result<(), StopError>) -> Result<(), fidl::Error> {
2978 let _result = self.send_raw(result);
2979 if _result.is_err() {
2980 self.control_handle.shutdown();
2981 }
2982 self.drop_without_shutdown();
2983 _result
2984 }
2985
2986 pub fn send_no_shutdown_on_err(
2988 self,
2989 mut result: Result<(), StopError>,
2990 ) -> Result<(), fidl::Error> {
2991 let _result = self.send_raw(result);
2992 self.drop_without_shutdown();
2993 _result
2994 }
2995
2996 fn send_raw(&self, mut result: Result<(), StopError>) -> Result<(), fidl::Error> {
2997 self.control_handle
2998 .inner
2999 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, StopError>>(
3000 result,
3001 self.tx_id,
3002 0x1362ba9d0e3caf36,
3003 fidl::encoding::DynamicFlags::empty(),
3004 )
3005 }
3006}
3007
3008#[must_use = "FIDL methods require a response to be sent"]
3009#[derive(Debug)]
3010pub struct LifecycleControllerResolveInstanceResponder {
3011 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3012 tx_id: u32,
3013}
3014
3015impl std::ops::Drop for LifecycleControllerResolveInstanceResponder {
3019 fn drop(&mut self) {
3020 self.control_handle.shutdown();
3021 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3023 }
3024}
3025
3026impl fdomain_client::fidl::Responder for LifecycleControllerResolveInstanceResponder {
3027 type ControlHandle = LifecycleControllerControlHandle;
3028
3029 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3030 &self.control_handle
3031 }
3032
3033 fn drop_without_shutdown(mut self) {
3034 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3036 std::mem::forget(self);
3038 }
3039}
3040
3041impl LifecycleControllerResolveInstanceResponder {
3042 pub fn send(self, mut result: Result<(), ResolveError>) -> Result<(), fidl::Error> {
3046 let _result = self.send_raw(result);
3047 if _result.is_err() {
3048 self.control_handle.shutdown();
3049 }
3050 self.drop_without_shutdown();
3051 _result
3052 }
3053
3054 pub fn send_no_shutdown_on_err(
3056 self,
3057 mut result: Result<(), ResolveError>,
3058 ) -> Result<(), fidl::Error> {
3059 let _result = self.send_raw(result);
3060 self.drop_without_shutdown();
3061 _result
3062 }
3063
3064 fn send_raw(&self, mut result: Result<(), ResolveError>) -> Result<(), fidl::Error> {
3065 self.control_handle.inner.send::<fidl::encoding::ResultType<
3066 fidl::encoding::EmptyStruct,
3067 ResolveError,
3068 >>(
3069 result,
3070 self.tx_id,
3071 0x426ab8dd53d8e737,
3072 fidl::encoding::DynamicFlags::empty(),
3073 )
3074 }
3075}
3076
3077#[must_use = "FIDL methods require a response to be sent"]
3078#[derive(Debug)]
3079pub struct LifecycleControllerUnresolveInstanceResponder {
3080 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3081 tx_id: u32,
3082}
3083
3084impl std::ops::Drop for LifecycleControllerUnresolveInstanceResponder {
3088 fn drop(&mut self) {
3089 self.control_handle.shutdown();
3090 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3092 }
3093}
3094
3095impl fdomain_client::fidl::Responder for LifecycleControllerUnresolveInstanceResponder {
3096 type ControlHandle = LifecycleControllerControlHandle;
3097
3098 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3099 &self.control_handle
3100 }
3101
3102 fn drop_without_shutdown(mut self) {
3103 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3105 std::mem::forget(self);
3107 }
3108}
3109
3110impl LifecycleControllerUnresolveInstanceResponder {
3111 pub fn send(self, mut result: Result<(), UnresolveError>) -> Result<(), fidl::Error> {
3115 let _result = self.send_raw(result);
3116 if _result.is_err() {
3117 self.control_handle.shutdown();
3118 }
3119 self.drop_without_shutdown();
3120 _result
3121 }
3122
3123 pub fn send_no_shutdown_on_err(
3125 self,
3126 mut result: Result<(), UnresolveError>,
3127 ) -> Result<(), fidl::Error> {
3128 let _result = self.send_raw(result);
3129 self.drop_without_shutdown();
3130 _result
3131 }
3132
3133 fn send_raw(&self, mut result: Result<(), UnresolveError>) -> Result<(), fidl::Error> {
3134 self.control_handle.inner.send::<fidl::encoding::ResultType<
3135 fidl::encoding::EmptyStruct,
3136 UnresolveError,
3137 >>(
3138 result,
3139 self.tx_id,
3140 0x18166a2aa798cb99,
3141 fidl::encoding::DynamicFlags::empty(),
3142 )
3143 }
3144}
3145
3146#[must_use = "FIDL methods require a response to be sent"]
3147#[derive(Debug)]
3148pub struct LifecycleControllerCreateInstanceResponder {
3149 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3150 tx_id: u32,
3151}
3152
3153impl std::ops::Drop for LifecycleControllerCreateInstanceResponder {
3157 fn drop(&mut self) {
3158 self.control_handle.shutdown();
3159 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3161 }
3162}
3163
3164impl fdomain_client::fidl::Responder for LifecycleControllerCreateInstanceResponder {
3165 type ControlHandle = LifecycleControllerControlHandle;
3166
3167 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3168 &self.control_handle
3169 }
3170
3171 fn drop_without_shutdown(mut self) {
3172 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3174 std::mem::forget(self);
3176 }
3177}
3178
3179impl LifecycleControllerCreateInstanceResponder {
3180 pub fn send(self, mut result: Result<(), CreateError>) -> Result<(), fidl::Error> {
3184 let _result = self.send_raw(result);
3185 if _result.is_err() {
3186 self.control_handle.shutdown();
3187 }
3188 self.drop_without_shutdown();
3189 _result
3190 }
3191
3192 pub fn send_no_shutdown_on_err(
3194 self,
3195 mut result: Result<(), CreateError>,
3196 ) -> Result<(), fidl::Error> {
3197 let _result = self.send_raw(result);
3198 self.drop_without_shutdown();
3199 _result
3200 }
3201
3202 fn send_raw(&self, mut result: Result<(), CreateError>) -> Result<(), fidl::Error> {
3203 self.control_handle.inner.send::<fidl::encoding::ResultType<
3204 fidl::encoding::EmptyStruct,
3205 CreateError,
3206 >>(
3207 result,
3208 self.tx_id,
3209 0x48d17ae777e4f9,
3210 fidl::encoding::DynamicFlags::empty(),
3211 )
3212 }
3213}
3214
3215#[must_use = "FIDL methods require a response to be sent"]
3216#[derive(Debug)]
3217pub struct LifecycleControllerDestroyInstanceResponder {
3218 control_handle: std::mem::ManuallyDrop<LifecycleControllerControlHandle>,
3219 tx_id: u32,
3220}
3221
3222impl std::ops::Drop for LifecycleControllerDestroyInstanceResponder {
3226 fn drop(&mut self) {
3227 self.control_handle.shutdown();
3228 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3230 }
3231}
3232
3233impl fdomain_client::fidl::Responder for LifecycleControllerDestroyInstanceResponder {
3234 type ControlHandle = LifecycleControllerControlHandle;
3235
3236 fn control_handle(&self) -> &LifecycleControllerControlHandle {
3237 &self.control_handle
3238 }
3239
3240 fn drop_without_shutdown(mut self) {
3241 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3243 std::mem::forget(self);
3245 }
3246}
3247
3248impl LifecycleControllerDestroyInstanceResponder {
3249 pub fn send(self, mut result: Result<(), DestroyError>) -> Result<(), fidl::Error> {
3253 let _result = self.send_raw(result);
3254 if _result.is_err() {
3255 self.control_handle.shutdown();
3256 }
3257 self.drop_without_shutdown();
3258 _result
3259 }
3260
3261 pub fn send_no_shutdown_on_err(
3263 self,
3264 mut result: Result<(), DestroyError>,
3265 ) -> Result<(), fidl::Error> {
3266 let _result = self.send_raw(result);
3267 self.drop_without_shutdown();
3268 _result
3269 }
3270
3271 fn send_raw(&self, mut result: Result<(), DestroyError>) -> Result<(), fidl::Error> {
3272 self.control_handle.inner.send::<fidl::encoding::ResultType<
3273 fidl::encoding::EmptyStruct,
3274 DestroyError,
3275 >>(
3276 result,
3277 self.tx_id,
3278 0x27640ae5889d7443,
3279 fidl::encoding::DynamicFlags::empty(),
3280 )
3281 }
3282}
3283
3284#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3285pub struct ManifestBytesIteratorMarker;
3286
3287impl fdomain_client::fidl::ProtocolMarker for ManifestBytesIteratorMarker {
3288 type Proxy = ManifestBytesIteratorProxy;
3289 type RequestStream = ManifestBytesIteratorRequestStream;
3290
3291 const DEBUG_NAME: &'static str = "(anonymous) ManifestBytesIterator";
3292}
3293
3294pub trait ManifestBytesIteratorProxyInterface: Send + Sync {
3295 type NextResponseFut: std::future::Future<Output = Result<Vec<u8>, fidl::Error>> + Send;
3296 fn r#next(&self) -> Self::NextResponseFut;
3297}
3298
3299#[derive(Debug, Clone)]
3300pub struct ManifestBytesIteratorProxy {
3301 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3302}
3303
3304impl fdomain_client::fidl::Proxy for ManifestBytesIteratorProxy {
3305 type Protocol = ManifestBytesIteratorMarker;
3306
3307 fn from_channel(inner: fdomain_client::Channel) -> Self {
3308 Self::new(inner)
3309 }
3310
3311 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3312 self.client.into_channel().map_err(|client| Self { client })
3313 }
3314
3315 fn as_channel(&self) -> &fdomain_client::Channel {
3316 self.client.as_channel()
3317 }
3318}
3319
3320impl ManifestBytesIteratorProxy {
3321 pub fn new(channel: fdomain_client::Channel) -> Self {
3323 let protocol_name =
3324 <ManifestBytesIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3325 Self { client: fidl::client::Client::new(channel, protocol_name) }
3326 }
3327
3328 pub fn take_event_stream(&self) -> ManifestBytesIteratorEventStream {
3334 ManifestBytesIteratorEventStream { event_receiver: self.client.take_event_receiver() }
3335 }
3336
3337 pub fn r#next(
3338 &self,
3339 ) -> fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect> {
3340 ManifestBytesIteratorProxyInterface::r#next(self)
3341 }
3342}
3343
3344impl ManifestBytesIteratorProxyInterface for ManifestBytesIteratorProxy {
3345 type NextResponseFut =
3346 fidl::client::QueryResponseFut<Vec<u8>, fdomain_client::fidl::FDomainResourceDialect>;
3347 fn r#next(&self) -> Self::NextResponseFut {
3348 fn _decode(
3349 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3350 ) -> Result<Vec<u8>, fidl::Error> {
3351 let _response = fidl::client::decode_transaction_body::<
3352 ManifestBytesIteratorNextResponse,
3353 fdomain_client::fidl::FDomainResourceDialect,
3354 0x4be4659549b15500,
3355 >(_buf?)?;
3356 Ok(_response.infos)
3357 }
3358 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u8>>(
3359 (),
3360 0x4be4659549b15500,
3361 fidl::encoding::DynamicFlags::empty(),
3362 _decode,
3363 )
3364 }
3365}
3366
3367pub struct ManifestBytesIteratorEventStream {
3368 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3369}
3370
3371impl std::marker::Unpin for ManifestBytesIteratorEventStream {}
3372
3373impl futures::stream::FusedStream for ManifestBytesIteratorEventStream {
3374 fn is_terminated(&self) -> bool {
3375 self.event_receiver.is_terminated()
3376 }
3377}
3378
3379impl futures::Stream for ManifestBytesIteratorEventStream {
3380 type Item = Result<ManifestBytesIteratorEvent, fidl::Error>;
3381
3382 fn poll_next(
3383 mut self: std::pin::Pin<&mut Self>,
3384 cx: &mut std::task::Context<'_>,
3385 ) -> std::task::Poll<Option<Self::Item>> {
3386 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3387 &mut self.event_receiver,
3388 cx
3389 )?) {
3390 Some(buf) => std::task::Poll::Ready(Some(ManifestBytesIteratorEvent::decode(buf))),
3391 None => std::task::Poll::Ready(None),
3392 }
3393 }
3394}
3395
3396#[derive(Debug)]
3397pub enum ManifestBytesIteratorEvent {}
3398
3399impl ManifestBytesIteratorEvent {
3400 fn decode(
3402 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3403 ) -> Result<ManifestBytesIteratorEvent, fidl::Error> {
3404 let (bytes, _handles) = buf.split_mut();
3405 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3406 debug_assert_eq!(tx_header.tx_id, 0);
3407 match tx_header.ordinal {
3408 _ => Err(fidl::Error::UnknownOrdinal {
3409 ordinal: tx_header.ordinal,
3410 protocol_name: <ManifestBytesIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3411 })
3412 }
3413 }
3414}
3415
3416pub struct ManifestBytesIteratorRequestStream {
3418 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3419 is_terminated: bool,
3420}
3421
3422impl std::marker::Unpin for ManifestBytesIteratorRequestStream {}
3423
3424impl futures::stream::FusedStream for ManifestBytesIteratorRequestStream {
3425 fn is_terminated(&self) -> bool {
3426 self.is_terminated
3427 }
3428}
3429
3430impl fdomain_client::fidl::RequestStream for ManifestBytesIteratorRequestStream {
3431 type Protocol = ManifestBytesIteratorMarker;
3432 type ControlHandle = ManifestBytesIteratorControlHandle;
3433
3434 fn from_channel(channel: fdomain_client::Channel) -> Self {
3435 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3436 }
3437
3438 fn control_handle(&self) -> Self::ControlHandle {
3439 ManifestBytesIteratorControlHandle { inner: self.inner.clone() }
3440 }
3441
3442 fn into_inner(
3443 self,
3444 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3445 {
3446 (self.inner, self.is_terminated)
3447 }
3448
3449 fn from_inner(
3450 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3451 is_terminated: bool,
3452 ) -> Self {
3453 Self { inner, is_terminated }
3454 }
3455}
3456
3457impl futures::Stream for ManifestBytesIteratorRequestStream {
3458 type Item = Result<ManifestBytesIteratorRequest, fidl::Error>;
3459
3460 fn poll_next(
3461 mut self: std::pin::Pin<&mut Self>,
3462 cx: &mut std::task::Context<'_>,
3463 ) -> std::task::Poll<Option<Self::Item>> {
3464 let this = &mut *self;
3465 if this.inner.check_shutdown(cx) {
3466 this.is_terminated = true;
3467 return std::task::Poll::Ready(None);
3468 }
3469 if this.is_terminated {
3470 panic!("polled ManifestBytesIteratorRequestStream after completion");
3471 }
3472 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
3473 |bytes, handles| {
3474 match this.inner.channel().read_etc(cx, bytes, handles) {
3475 std::task::Poll::Ready(Ok(())) => {}
3476 std::task::Poll::Pending => return std::task::Poll::Pending,
3477 std::task::Poll::Ready(Err(None)) => {
3478 this.is_terminated = true;
3479 return std::task::Poll::Ready(None);
3480 }
3481 std::task::Poll::Ready(Err(Some(e))) => {
3482 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3483 e.into(),
3484 ))));
3485 }
3486 }
3487
3488 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3490
3491 std::task::Poll::Ready(Some(match header.ordinal {
3492 0x4be4659549b15500 => {
3493 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3494 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
3495 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3496 let control_handle = ManifestBytesIteratorControlHandle {
3497 inner: this.inner.clone(),
3498 };
3499 Ok(ManifestBytesIteratorRequest::Next {
3500 responder: ManifestBytesIteratorNextResponder {
3501 control_handle: std::mem::ManuallyDrop::new(control_handle),
3502 tx_id: header.tx_id,
3503 },
3504 })
3505 }
3506 _ => Err(fidl::Error::UnknownOrdinal {
3507 ordinal: header.ordinal,
3508 protocol_name: <ManifestBytesIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3509 }),
3510 }))
3511 },
3512 )
3513 }
3514}
3515
3516#[derive(Debug)]
3518pub enum ManifestBytesIteratorRequest {
3519 Next { responder: ManifestBytesIteratorNextResponder },
3520}
3521
3522impl ManifestBytesIteratorRequest {
3523 #[allow(irrefutable_let_patterns)]
3524 pub fn into_next(self) -> Option<(ManifestBytesIteratorNextResponder)> {
3525 if let ManifestBytesIteratorRequest::Next { responder } = self {
3526 Some((responder))
3527 } else {
3528 None
3529 }
3530 }
3531
3532 pub fn method_name(&self) -> &'static str {
3534 match *self {
3535 ManifestBytesIteratorRequest::Next { .. } => "next",
3536 }
3537 }
3538}
3539
3540#[derive(Debug, Clone)]
3541pub struct ManifestBytesIteratorControlHandle {
3542 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3543}
3544
3545impl ManifestBytesIteratorControlHandle {
3546 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3547 self.inner.shutdown_with_epitaph(status.into())
3548 }
3549}
3550
3551impl fdomain_client::fidl::ControlHandle for ManifestBytesIteratorControlHandle {
3552 fn shutdown(&self) {
3553 self.inner.shutdown()
3554 }
3555
3556 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3557 self.inner.shutdown_with_epitaph(status)
3558 }
3559
3560 fn is_closed(&self) -> bool {
3561 self.inner.channel().is_closed()
3562 }
3563 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3564 self.inner.channel().on_closed()
3565 }
3566}
3567
3568impl ManifestBytesIteratorControlHandle {}
3569
3570#[must_use = "FIDL methods require a response to be sent"]
3571#[derive(Debug)]
3572pub struct ManifestBytesIteratorNextResponder {
3573 control_handle: std::mem::ManuallyDrop<ManifestBytesIteratorControlHandle>,
3574 tx_id: u32,
3575}
3576
3577impl std::ops::Drop for ManifestBytesIteratorNextResponder {
3581 fn drop(&mut self) {
3582 self.control_handle.shutdown();
3583 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3585 }
3586}
3587
3588impl fdomain_client::fidl::Responder for ManifestBytesIteratorNextResponder {
3589 type ControlHandle = ManifestBytesIteratorControlHandle;
3590
3591 fn control_handle(&self) -> &ManifestBytesIteratorControlHandle {
3592 &self.control_handle
3593 }
3594
3595 fn drop_without_shutdown(mut self) {
3596 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3598 std::mem::forget(self);
3600 }
3601}
3602
3603impl ManifestBytesIteratorNextResponder {
3604 pub fn send(self, mut infos: &[u8]) -> Result<(), fidl::Error> {
3608 let _result = self.send_raw(infos);
3609 if _result.is_err() {
3610 self.control_handle.shutdown();
3611 }
3612 self.drop_without_shutdown();
3613 _result
3614 }
3615
3616 pub fn send_no_shutdown_on_err(self, mut infos: &[u8]) -> Result<(), fidl::Error> {
3618 let _result = self.send_raw(infos);
3619 self.drop_without_shutdown();
3620 _result
3621 }
3622
3623 fn send_raw(&self, mut infos: &[u8]) -> Result<(), fidl::Error> {
3624 self.control_handle.inner.send::<ManifestBytesIteratorNextResponse>(
3625 (infos,),
3626 self.tx_id,
3627 0x4be4659549b15500,
3628 fidl::encoding::DynamicFlags::empty(),
3629 )
3630 }
3631}
3632
3633#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3634pub struct RealmExplorerMarker;
3635
3636impl fdomain_client::fidl::ProtocolMarker for RealmExplorerMarker {
3637 type Proxy = RealmExplorerProxy;
3638 type RequestStream = RealmExplorerRequestStream;
3639
3640 const DEBUG_NAME: &'static str = "fuchsia.sys2.RealmExplorer";
3641}
3642impl fdomain_client::fidl::DiscoverableProtocolMarker for RealmExplorerMarker {}
3643
3644pub trait RealmExplorerProxyInterface: Send + Sync {}
3645
3646#[derive(Debug, Clone)]
3647pub struct RealmExplorerProxy {
3648 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3649}
3650
3651impl fdomain_client::fidl::Proxy for RealmExplorerProxy {
3652 type Protocol = RealmExplorerMarker;
3653
3654 fn from_channel(inner: fdomain_client::Channel) -> Self {
3655 Self::new(inner)
3656 }
3657
3658 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3659 self.client.into_channel().map_err(|client| Self { client })
3660 }
3661
3662 fn as_channel(&self) -> &fdomain_client::Channel {
3663 self.client.as_channel()
3664 }
3665}
3666
3667impl RealmExplorerProxy {
3668 pub fn new(channel: fdomain_client::Channel) -> Self {
3670 let protocol_name =
3671 <RealmExplorerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3672 Self { client: fidl::client::Client::new(channel, protocol_name) }
3673 }
3674
3675 pub fn take_event_stream(&self) -> RealmExplorerEventStream {
3681 RealmExplorerEventStream { event_receiver: self.client.take_event_receiver() }
3682 }
3683}
3684
3685impl RealmExplorerProxyInterface for RealmExplorerProxy {}
3686
3687pub struct RealmExplorerEventStream {
3688 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3689}
3690
3691impl std::marker::Unpin for RealmExplorerEventStream {}
3692
3693impl futures::stream::FusedStream for RealmExplorerEventStream {
3694 fn is_terminated(&self) -> bool {
3695 self.event_receiver.is_terminated()
3696 }
3697}
3698
3699impl futures::Stream for RealmExplorerEventStream {
3700 type Item = Result<RealmExplorerEvent, fidl::Error>;
3701
3702 fn poll_next(
3703 mut self: std::pin::Pin<&mut Self>,
3704 cx: &mut std::task::Context<'_>,
3705 ) -> std::task::Poll<Option<Self::Item>> {
3706 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3707 &mut self.event_receiver,
3708 cx
3709 )?) {
3710 Some(buf) => std::task::Poll::Ready(Some(RealmExplorerEvent::decode(buf))),
3711 None => std::task::Poll::Ready(None),
3712 }
3713 }
3714}
3715
3716#[derive(Debug)]
3717pub enum RealmExplorerEvent {}
3718
3719impl RealmExplorerEvent {
3720 fn decode(
3722 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3723 ) -> Result<RealmExplorerEvent, fidl::Error> {
3724 let (bytes, _handles) = buf.split_mut();
3725 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3726 debug_assert_eq!(tx_header.tx_id, 0);
3727 match tx_header.ordinal {
3728 _ => Err(fidl::Error::UnknownOrdinal {
3729 ordinal: tx_header.ordinal,
3730 protocol_name:
3731 <RealmExplorerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3732 }),
3733 }
3734 }
3735}
3736
3737pub struct RealmExplorerRequestStream {
3739 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3740 is_terminated: bool,
3741}
3742
3743impl std::marker::Unpin for RealmExplorerRequestStream {}
3744
3745impl futures::stream::FusedStream for RealmExplorerRequestStream {
3746 fn is_terminated(&self) -> bool {
3747 self.is_terminated
3748 }
3749}
3750
3751impl fdomain_client::fidl::RequestStream for RealmExplorerRequestStream {
3752 type Protocol = RealmExplorerMarker;
3753 type ControlHandle = RealmExplorerControlHandle;
3754
3755 fn from_channel(channel: fdomain_client::Channel) -> Self {
3756 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3757 }
3758
3759 fn control_handle(&self) -> Self::ControlHandle {
3760 RealmExplorerControlHandle { inner: self.inner.clone() }
3761 }
3762
3763 fn into_inner(
3764 self,
3765 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3766 {
3767 (self.inner, self.is_terminated)
3768 }
3769
3770 fn from_inner(
3771 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3772 is_terminated: bool,
3773 ) -> Self {
3774 Self { inner, is_terminated }
3775 }
3776}
3777
3778impl futures::Stream for RealmExplorerRequestStream {
3779 type Item = Result<RealmExplorerRequest, fidl::Error>;
3780
3781 fn poll_next(
3782 mut self: std::pin::Pin<&mut Self>,
3783 cx: &mut std::task::Context<'_>,
3784 ) -> std::task::Poll<Option<Self::Item>> {
3785 let this = &mut *self;
3786 if this.inner.check_shutdown(cx) {
3787 this.is_terminated = true;
3788 return std::task::Poll::Ready(None);
3789 }
3790 if this.is_terminated {
3791 panic!("polled RealmExplorerRequestStream after completion");
3792 }
3793 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
3794 |bytes, handles| {
3795 match this.inner.channel().read_etc(cx, bytes, handles) {
3796 std::task::Poll::Ready(Ok(())) => {}
3797 std::task::Poll::Pending => return std::task::Poll::Pending,
3798 std::task::Poll::Ready(Err(None)) => {
3799 this.is_terminated = true;
3800 return std::task::Poll::Ready(None);
3801 }
3802 std::task::Poll::Ready(Err(Some(e))) => {
3803 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3804 e.into(),
3805 ))));
3806 }
3807 }
3808
3809 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3811
3812 std::task::Poll::Ready(Some(match header.ordinal {
3813 _ => Err(fidl::Error::UnknownOrdinal {
3814 ordinal: header.ordinal,
3815 protocol_name: <RealmExplorerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3816 }),
3817 }))
3818 },
3819 )
3820 }
3821}
3822
3823#[derive(Debug)]
3825pub enum RealmExplorerRequest {}
3826
3827impl RealmExplorerRequest {
3828 pub fn method_name(&self) -> &'static str {
3830 match *self {}
3831 }
3832}
3833
3834#[derive(Debug, Clone)]
3835pub struct RealmExplorerControlHandle {
3836 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3837}
3838
3839impl RealmExplorerControlHandle {
3840 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3841 self.inner.shutdown_with_epitaph(status.into())
3842 }
3843}
3844
3845impl fdomain_client::fidl::ControlHandle for RealmExplorerControlHandle {
3846 fn shutdown(&self) {
3847 self.inner.shutdown()
3848 }
3849
3850 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3851 self.inner.shutdown_with_epitaph(status)
3852 }
3853
3854 fn is_closed(&self) -> bool {
3855 self.inner.channel().is_closed()
3856 }
3857 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3858 self.inner.channel().on_closed()
3859 }
3860}
3861
3862impl RealmExplorerControlHandle {}
3863
3864#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3865pub struct RealmQueryMarker;
3866
3867impl fdomain_client::fidl::ProtocolMarker for RealmQueryMarker {
3868 type Proxy = RealmQueryProxy;
3869 type RequestStream = RealmQueryRequestStream;
3870
3871 const DEBUG_NAME: &'static str = "fuchsia.sys2.RealmQuery";
3872}
3873impl fdomain_client::fidl::DiscoverableProtocolMarker for RealmQueryMarker {}
3874pub type RealmQueryGetInstanceResult = Result<Instance, GetInstanceError>;
3875pub type RealmQueryGetResolvedDeclarationResult =
3876 Result<fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>, GetDeclarationError>;
3877pub type RealmQueryResolveDeclarationResult =
3878 Result<fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>, GetDeclarationError>;
3879pub type RealmQueryGetStructuredConfigResult =
3880 Result<fdomain_fuchsia_component_decl::ResolvedConfig, GetStructuredConfigError>;
3881pub type RealmQueryGetAllInstancesResult =
3882 Result<fdomain_client::fidl::ClientEnd<InstanceIteratorMarker>, GetAllInstancesError>;
3883pub type RealmQueryConstructNamespaceResult =
3884 Result<Vec<fdomain_fuchsia_component_runner::ComponentNamespaceEntry>, ConstructNamespaceError>;
3885pub type RealmQueryOpenDirectoryResult = Result<(), OpenError>;
3886pub type RealmQueryConnectToStorageAdminResult = Result<(), ConnectToStorageAdminError>;
3887pub type RealmQueryOpenStorageAdminResult = Result<(), ConnectToStorageAdminError>;
3888
3889pub trait RealmQueryProxyInterface: Send + Sync {
3890 type GetInstanceResponseFut: std::future::Future<Output = Result<RealmQueryGetInstanceResult, fidl::Error>>
3891 + Send;
3892 fn r#get_instance(&self, moniker: &str) -> Self::GetInstanceResponseFut;
3893 type GetResolvedDeclarationResponseFut: std::future::Future<Output = Result<RealmQueryGetResolvedDeclarationResult, fidl::Error>>
3894 + Send;
3895 fn r#get_resolved_declaration(&self, moniker: &str) -> Self::GetResolvedDeclarationResponseFut;
3896 type ResolveDeclarationResponseFut: std::future::Future<Output = Result<RealmQueryResolveDeclarationResult, fidl::Error>>
3897 + Send;
3898 fn r#resolve_declaration(
3899 &self,
3900 parent: &str,
3901 child_location: &ChildLocation,
3902 url: &str,
3903 ) -> Self::ResolveDeclarationResponseFut;
3904 type GetStructuredConfigResponseFut: std::future::Future<Output = Result<RealmQueryGetStructuredConfigResult, fidl::Error>>
3905 + Send;
3906 fn r#get_structured_config(&self, moniker: &str) -> Self::GetStructuredConfigResponseFut;
3907 type GetAllInstancesResponseFut: std::future::Future<Output = Result<RealmQueryGetAllInstancesResult, fidl::Error>>
3908 + Send;
3909 fn r#get_all_instances(&self) -> Self::GetAllInstancesResponseFut;
3910 type ConstructNamespaceResponseFut: std::future::Future<Output = Result<RealmQueryConstructNamespaceResult, fidl::Error>>
3911 + Send;
3912 fn r#construct_namespace(&self, moniker: &str) -> Self::ConstructNamespaceResponseFut;
3913 type OpenDirectoryResponseFut: std::future::Future<Output = Result<RealmQueryOpenDirectoryResult, fidl::Error>>
3914 + Send;
3915 fn r#open_directory(
3916 &self,
3917 moniker: &str,
3918 dir_type: OpenDirType,
3919 object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
3920 ) -> Self::OpenDirectoryResponseFut;
3921 type ConnectToStorageAdminResponseFut: std::future::Future<Output = Result<RealmQueryConnectToStorageAdminResult, fidl::Error>>
3922 + Send;
3923 fn r#connect_to_storage_admin(
3924 &self,
3925 moniker: &str,
3926 storage_name: &str,
3927 server_end: fdomain_client::fidl::ServerEnd<StorageAdminMarker>,
3928 ) -> Self::ConnectToStorageAdminResponseFut;
3929 type OpenStorageAdminResponseFut: std::future::Future<Output = Result<RealmQueryOpenStorageAdminResult, fidl::Error>>
3930 + Send;
3931 fn r#open_storage_admin(
3932 &self,
3933 moniker: &str,
3934 storage_name: &str,
3935 server_end: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::StorageAdminMarker>,
3936 ) -> Self::OpenStorageAdminResponseFut;
3937}
3938
3939#[derive(Debug, Clone)]
3940pub struct RealmQueryProxy {
3941 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3942}
3943
3944impl fdomain_client::fidl::Proxy for RealmQueryProxy {
3945 type Protocol = RealmQueryMarker;
3946
3947 fn from_channel(inner: fdomain_client::Channel) -> Self {
3948 Self::new(inner)
3949 }
3950
3951 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3952 self.client.into_channel().map_err(|client| Self { client })
3953 }
3954
3955 fn as_channel(&self) -> &fdomain_client::Channel {
3956 self.client.as_channel()
3957 }
3958}
3959
3960impl RealmQueryProxy {
3961 pub fn new(channel: fdomain_client::Channel) -> Self {
3963 let protocol_name = <RealmQueryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3964 Self { client: fidl::client::Client::new(channel, protocol_name) }
3965 }
3966
3967 pub fn take_event_stream(&self) -> RealmQueryEventStream {
3973 RealmQueryEventStream { event_receiver: self.client.take_event_receiver() }
3974 }
3975
3976 pub fn r#get_instance(
3978 &self,
3979 mut moniker: &str,
3980 ) -> fidl::client::QueryResponseFut<
3981 RealmQueryGetInstanceResult,
3982 fdomain_client::fidl::FDomainResourceDialect,
3983 > {
3984 RealmQueryProxyInterface::r#get_instance(self, moniker)
3985 }
3986
3987 pub fn r#get_resolved_declaration(
3994 &self,
3995 mut moniker: &str,
3996 ) -> fidl::client::QueryResponseFut<
3997 RealmQueryGetResolvedDeclarationResult,
3998 fdomain_client::fidl::FDomainResourceDialect,
3999 > {
4000 RealmQueryProxyInterface::r#get_resolved_declaration(self, moniker)
4001 }
4002
4003 pub fn r#resolve_declaration(
4011 &self,
4012 mut parent: &str,
4013 mut child_location: &ChildLocation,
4014 mut url: &str,
4015 ) -> fidl::client::QueryResponseFut<
4016 RealmQueryResolveDeclarationResult,
4017 fdomain_client::fidl::FDomainResourceDialect,
4018 > {
4019 RealmQueryProxyInterface::r#resolve_declaration(self, parent, child_location, url)
4020 }
4021
4022 pub fn r#get_structured_config(
4024 &self,
4025 mut moniker: &str,
4026 ) -> fidl::client::QueryResponseFut<
4027 RealmQueryGetStructuredConfigResult,
4028 fdomain_client::fidl::FDomainResourceDialect,
4029 > {
4030 RealmQueryProxyInterface::r#get_structured_config(self, moniker)
4031 }
4032
4033 pub fn r#get_all_instances(
4037 &self,
4038 ) -> fidl::client::QueryResponseFut<
4039 RealmQueryGetAllInstancesResult,
4040 fdomain_client::fidl::FDomainResourceDialect,
4041 > {
4042 RealmQueryProxyInterface::r#get_all_instances(self)
4043 }
4044
4045 pub fn r#construct_namespace(
4050 &self,
4051 mut moniker: &str,
4052 ) -> fidl::client::QueryResponseFut<
4053 RealmQueryConstructNamespaceResult,
4054 fdomain_client::fidl::FDomainResourceDialect,
4055 > {
4056 RealmQueryProxyInterface::r#construct_namespace(self, moniker)
4057 }
4058
4059 pub fn r#open_directory(
4061 &self,
4062 mut moniker: &str,
4063 mut dir_type: OpenDirType,
4064 mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4065 ) -> fidl::client::QueryResponseFut<
4066 RealmQueryOpenDirectoryResult,
4067 fdomain_client::fidl::FDomainResourceDialect,
4068 > {
4069 RealmQueryProxyInterface::r#open_directory(self, moniker, dir_type, object)
4070 }
4071
4072 pub fn r#connect_to_storage_admin(
4075 &self,
4076 mut moniker: &str,
4077 mut storage_name: &str,
4078 mut server_end: fdomain_client::fidl::ServerEnd<StorageAdminMarker>,
4079 ) -> fidl::client::QueryResponseFut<
4080 RealmQueryConnectToStorageAdminResult,
4081 fdomain_client::fidl::FDomainResourceDialect,
4082 > {
4083 RealmQueryProxyInterface::r#connect_to_storage_admin(
4084 self,
4085 moniker,
4086 storage_name,
4087 server_end,
4088 )
4089 }
4090
4091 pub fn r#open_storage_admin(
4093 &self,
4094 mut moniker: &str,
4095 mut storage_name: &str,
4096 mut server_end: fdomain_client::fidl::ServerEnd<
4097 fdomain_fuchsia_component::StorageAdminMarker,
4098 >,
4099 ) -> fidl::client::QueryResponseFut<
4100 RealmQueryOpenStorageAdminResult,
4101 fdomain_client::fidl::FDomainResourceDialect,
4102 > {
4103 RealmQueryProxyInterface::r#open_storage_admin(self, moniker, storage_name, server_end)
4104 }
4105}
4106
4107impl RealmQueryProxyInterface for RealmQueryProxy {
4108 type GetInstanceResponseFut = fidl::client::QueryResponseFut<
4109 RealmQueryGetInstanceResult,
4110 fdomain_client::fidl::FDomainResourceDialect,
4111 >;
4112 fn r#get_instance(&self, mut moniker: &str) -> Self::GetInstanceResponseFut {
4113 fn _decode(
4114 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4115 ) -> Result<RealmQueryGetInstanceResult, fidl::Error> {
4116 let _response = fidl::client::decode_transaction_body::<
4117 fidl::encoding::ResultType<RealmQueryGetInstanceResponse, GetInstanceError>,
4118 fdomain_client::fidl::FDomainResourceDialect,
4119 0x3496ca1e5a0c13a8,
4120 >(_buf?)?;
4121 Ok(_response.map(|x| x.instance))
4122 }
4123 self.client
4124 .send_query_and_decode::<RealmQueryGetInstanceRequest, RealmQueryGetInstanceResult>(
4125 (moniker,),
4126 0x3496ca1e5a0c13a8,
4127 fidl::encoding::DynamicFlags::empty(),
4128 _decode,
4129 )
4130 }
4131
4132 type GetResolvedDeclarationResponseFut = fidl::client::QueryResponseFut<
4133 RealmQueryGetResolvedDeclarationResult,
4134 fdomain_client::fidl::FDomainResourceDialect,
4135 >;
4136 fn r#get_resolved_declaration(
4137 &self,
4138 mut moniker: &str,
4139 ) -> Self::GetResolvedDeclarationResponseFut {
4140 fn _decode(
4141 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4142 ) -> Result<RealmQueryGetResolvedDeclarationResult, fidl::Error> {
4143 let _response = fidl::client::decode_transaction_body::<
4144 fidl::encoding::ResultType<
4145 RealmQueryGetResolvedDeclarationResponse,
4146 GetDeclarationError,
4147 >,
4148 fdomain_client::fidl::FDomainResourceDialect,
4149 0x31a493d284a0bc1f,
4150 >(_buf?)?;
4151 Ok(_response.map(|x| x.iterator))
4152 }
4153 self.client.send_query_and_decode::<
4154 RealmQueryGetResolvedDeclarationRequest,
4155 RealmQueryGetResolvedDeclarationResult,
4156 >(
4157 (moniker,),
4158 0x31a493d284a0bc1f,
4159 fidl::encoding::DynamicFlags::empty(),
4160 _decode,
4161 )
4162 }
4163
4164 type ResolveDeclarationResponseFut = fidl::client::QueryResponseFut<
4165 RealmQueryResolveDeclarationResult,
4166 fdomain_client::fidl::FDomainResourceDialect,
4167 >;
4168 fn r#resolve_declaration(
4169 &self,
4170 mut parent: &str,
4171 mut child_location: &ChildLocation,
4172 mut url: &str,
4173 ) -> Self::ResolveDeclarationResponseFut {
4174 fn _decode(
4175 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4176 ) -> Result<RealmQueryResolveDeclarationResult, fidl::Error> {
4177 let _response = fidl::client::decode_transaction_body::<
4178 fidl::encoding::ResultType<
4179 RealmQueryResolveDeclarationResponse,
4180 GetDeclarationError,
4181 >,
4182 fdomain_client::fidl::FDomainResourceDialect,
4183 0x1ab1adf2a87d962d,
4184 >(_buf?)?;
4185 Ok(_response.map(|x| x.iterator))
4186 }
4187 self.client.send_query_and_decode::<
4188 RealmQueryResolveDeclarationRequest,
4189 RealmQueryResolveDeclarationResult,
4190 >(
4191 (parent, child_location, url,),
4192 0x1ab1adf2a87d962d,
4193 fidl::encoding::DynamicFlags::empty(),
4194 _decode,
4195 )
4196 }
4197
4198 type GetStructuredConfigResponseFut = fidl::client::QueryResponseFut<
4199 RealmQueryGetStructuredConfigResult,
4200 fdomain_client::fidl::FDomainResourceDialect,
4201 >;
4202 fn r#get_structured_config(&self, mut moniker: &str) -> Self::GetStructuredConfigResponseFut {
4203 fn _decode(
4204 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4205 ) -> Result<RealmQueryGetStructuredConfigResult, fidl::Error> {
4206 let _response = fidl::client::decode_transaction_body::<
4207 fidl::encoding::ResultType<
4208 RealmQueryGetStructuredConfigResponse,
4209 GetStructuredConfigError,
4210 >,
4211 fdomain_client::fidl::FDomainResourceDialect,
4212 0x16f88f6735bd204,
4213 >(_buf?)?;
4214 Ok(_response.map(|x| x.config))
4215 }
4216 self.client.send_query_and_decode::<
4217 RealmQueryGetStructuredConfigRequest,
4218 RealmQueryGetStructuredConfigResult,
4219 >(
4220 (moniker,),
4221 0x16f88f6735bd204,
4222 fidl::encoding::DynamicFlags::empty(),
4223 _decode,
4224 )
4225 }
4226
4227 type GetAllInstancesResponseFut = fidl::client::QueryResponseFut<
4228 RealmQueryGetAllInstancesResult,
4229 fdomain_client::fidl::FDomainResourceDialect,
4230 >;
4231 fn r#get_all_instances(&self) -> Self::GetAllInstancesResponseFut {
4232 fn _decode(
4233 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4234 ) -> Result<RealmQueryGetAllInstancesResult, fidl::Error> {
4235 let _response = fidl::client::decode_transaction_body::<
4236 fidl::encoding::ResultType<RealmQueryGetAllInstancesResponse, GetAllInstancesError>,
4237 fdomain_client::fidl::FDomainResourceDialect,
4238 0x7b5a8775d30cad47,
4239 >(_buf?)?;
4240 Ok(_response.map(|x| x.iterator))
4241 }
4242 self.client
4243 .send_query_and_decode::<fidl::encoding::EmptyPayload, RealmQueryGetAllInstancesResult>(
4244 (),
4245 0x7b5a8775d30cad47,
4246 fidl::encoding::DynamicFlags::empty(),
4247 _decode,
4248 )
4249 }
4250
4251 type ConstructNamespaceResponseFut = fidl::client::QueryResponseFut<
4252 RealmQueryConstructNamespaceResult,
4253 fdomain_client::fidl::FDomainResourceDialect,
4254 >;
4255 fn r#construct_namespace(&self, mut moniker: &str) -> Self::ConstructNamespaceResponseFut {
4256 fn _decode(
4257 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4258 ) -> Result<RealmQueryConstructNamespaceResult, fidl::Error> {
4259 let _response = fidl::client::decode_transaction_body::<
4260 fidl::encoding::ResultType<
4261 RealmQueryConstructNamespaceResponse,
4262 ConstructNamespaceError,
4263 >,
4264 fdomain_client::fidl::FDomainResourceDialect,
4265 0x5ecb29c02c488eeb,
4266 >(_buf?)?;
4267 Ok(_response.map(|x| x.namespace))
4268 }
4269 self.client.send_query_and_decode::<
4270 RealmQueryConstructNamespaceRequest,
4271 RealmQueryConstructNamespaceResult,
4272 >(
4273 (moniker,),
4274 0x5ecb29c02c488eeb,
4275 fidl::encoding::DynamicFlags::empty(),
4276 _decode,
4277 )
4278 }
4279
4280 type OpenDirectoryResponseFut = fidl::client::QueryResponseFut<
4281 RealmQueryOpenDirectoryResult,
4282 fdomain_client::fidl::FDomainResourceDialect,
4283 >;
4284 fn r#open_directory(
4285 &self,
4286 mut moniker: &str,
4287 mut dir_type: OpenDirType,
4288 mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4289 ) -> Self::OpenDirectoryResponseFut {
4290 fn _decode(
4291 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4292 ) -> Result<RealmQueryOpenDirectoryResult, fidl::Error> {
4293 let _response = fidl::client::decode_transaction_body::<
4294 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>,
4295 fdomain_client::fidl::FDomainResourceDialect,
4296 0x333d68f1deecec85,
4297 >(_buf?)?;
4298 Ok(_response.map(|x| x))
4299 }
4300 self.client
4301 .send_query_and_decode::<RealmQueryOpenDirectoryRequest, RealmQueryOpenDirectoryResult>(
4302 (moniker, dir_type, object),
4303 0x333d68f1deecec85,
4304 fidl::encoding::DynamicFlags::empty(),
4305 _decode,
4306 )
4307 }
4308
4309 type ConnectToStorageAdminResponseFut = fidl::client::QueryResponseFut<
4310 RealmQueryConnectToStorageAdminResult,
4311 fdomain_client::fidl::FDomainResourceDialect,
4312 >;
4313 fn r#connect_to_storage_admin(
4314 &self,
4315 mut moniker: &str,
4316 mut storage_name: &str,
4317 mut server_end: fdomain_client::fidl::ServerEnd<StorageAdminMarker>,
4318 ) -> Self::ConnectToStorageAdminResponseFut {
4319 fn _decode(
4320 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4321 ) -> Result<RealmQueryConnectToStorageAdminResult, fidl::Error> {
4322 let _response = fidl::client::decode_transaction_body::<
4323 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ConnectToStorageAdminError>,
4324 fdomain_client::fidl::FDomainResourceDialect,
4325 0x7807e6b4f623ace,
4326 >(_buf?)?;
4327 Ok(_response.map(|x| x))
4328 }
4329 self.client.send_query_and_decode::<
4330 RealmQueryConnectToStorageAdminRequest,
4331 RealmQueryConnectToStorageAdminResult,
4332 >(
4333 (moniker, storage_name, server_end,),
4334 0x7807e6b4f623ace,
4335 fidl::encoding::DynamicFlags::empty(),
4336 _decode,
4337 )
4338 }
4339
4340 type OpenStorageAdminResponseFut = fidl::client::QueryResponseFut<
4341 RealmQueryOpenStorageAdminResult,
4342 fdomain_client::fidl::FDomainResourceDialect,
4343 >;
4344 fn r#open_storage_admin(
4345 &self,
4346 mut moniker: &str,
4347 mut storage_name: &str,
4348 mut server_end: fdomain_client::fidl::ServerEnd<
4349 fdomain_fuchsia_component::StorageAdminMarker,
4350 >,
4351 ) -> Self::OpenStorageAdminResponseFut {
4352 fn _decode(
4353 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4354 ) -> Result<RealmQueryOpenStorageAdminResult, fidl::Error> {
4355 let _response = fidl::client::decode_transaction_body::<
4356 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ConnectToStorageAdminError>,
4357 fdomain_client::fidl::FDomainResourceDialect,
4358 0x54d6af83942b4069,
4359 >(_buf?)?;
4360 Ok(_response.map(|x| x))
4361 }
4362 self.client.send_query_and_decode::<
4363 RealmQueryOpenStorageAdminRequest,
4364 RealmQueryOpenStorageAdminResult,
4365 >(
4366 (moniker, storage_name, server_end,),
4367 0x54d6af83942b4069,
4368 fidl::encoding::DynamicFlags::empty(),
4369 _decode,
4370 )
4371 }
4372}
4373
4374pub struct RealmQueryEventStream {
4375 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4376}
4377
4378impl std::marker::Unpin for RealmQueryEventStream {}
4379
4380impl futures::stream::FusedStream for RealmQueryEventStream {
4381 fn is_terminated(&self) -> bool {
4382 self.event_receiver.is_terminated()
4383 }
4384}
4385
4386impl futures::Stream for RealmQueryEventStream {
4387 type Item = Result<RealmQueryEvent, fidl::Error>;
4388
4389 fn poll_next(
4390 mut self: std::pin::Pin<&mut Self>,
4391 cx: &mut std::task::Context<'_>,
4392 ) -> std::task::Poll<Option<Self::Item>> {
4393 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4394 &mut self.event_receiver,
4395 cx
4396 )?) {
4397 Some(buf) => std::task::Poll::Ready(Some(RealmQueryEvent::decode(buf))),
4398 None => std::task::Poll::Ready(None),
4399 }
4400 }
4401}
4402
4403#[derive(Debug)]
4404pub enum RealmQueryEvent {}
4405
4406impl RealmQueryEvent {
4407 fn decode(
4409 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4410 ) -> Result<RealmQueryEvent, fidl::Error> {
4411 let (bytes, _handles) = buf.split_mut();
4412 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4413 debug_assert_eq!(tx_header.tx_id, 0);
4414 match tx_header.ordinal {
4415 _ => Err(fidl::Error::UnknownOrdinal {
4416 ordinal: tx_header.ordinal,
4417 protocol_name:
4418 <RealmQueryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4419 }),
4420 }
4421 }
4422}
4423
4424pub struct RealmQueryRequestStream {
4426 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4427 is_terminated: bool,
4428}
4429
4430impl std::marker::Unpin for RealmQueryRequestStream {}
4431
4432impl futures::stream::FusedStream for RealmQueryRequestStream {
4433 fn is_terminated(&self) -> bool {
4434 self.is_terminated
4435 }
4436}
4437
4438impl fdomain_client::fidl::RequestStream for RealmQueryRequestStream {
4439 type Protocol = RealmQueryMarker;
4440 type ControlHandle = RealmQueryControlHandle;
4441
4442 fn from_channel(channel: fdomain_client::Channel) -> Self {
4443 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4444 }
4445
4446 fn control_handle(&self) -> Self::ControlHandle {
4447 RealmQueryControlHandle { inner: self.inner.clone() }
4448 }
4449
4450 fn into_inner(
4451 self,
4452 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4453 {
4454 (self.inner, self.is_terminated)
4455 }
4456
4457 fn from_inner(
4458 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4459 is_terminated: bool,
4460 ) -> Self {
4461 Self { inner, is_terminated }
4462 }
4463}
4464
4465impl futures::Stream for RealmQueryRequestStream {
4466 type Item = Result<RealmQueryRequest, fidl::Error>;
4467
4468 fn poll_next(
4469 mut self: std::pin::Pin<&mut Self>,
4470 cx: &mut std::task::Context<'_>,
4471 ) -> std::task::Poll<Option<Self::Item>> {
4472 let this = &mut *self;
4473 if this.inner.check_shutdown(cx) {
4474 this.is_terminated = true;
4475 return std::task::Poll::Ready(None);
4476 }
4477 if this.is_terminated {
4478 panic!("polled RealmQueryRequestStream after completion");
4479 }
4480 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4481 |bytes, handles| {
4482 match this.inner.channel().read_etc(cx, bytes, handles) {
4483 std::task::Poll::Ready(Ok(())) => {}
4484 std::task::Poll::Pending => return std::task::Poll::Pending,
4485 std::task::Poll::Ready(Err(None)) => {
4486 this.is_terminated = true;
4487 return std::task::Poll::Ready(None);
4488 }
4489 std::task::Poll::Ready(Err(Some(e))) => {
4490 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4491 e.into(),
4492 ))));
4493 }
4494 }
4495
4496 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4498
4499 std::task::Poll::Ready(Some(match header.ordinal {
4500 0x3496ca1e5a0c13a8 => {
4501 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4502 let mut req = fidl::new_empty!(
4503 RealmQueryGetInstanceRequest,
4504 fdomain_client::fidl::FDomainResourceDialect
4505 );
4506 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmQueryGetInstanceRequest>(&header, _body_bytes, handles, &mut req)?;
4507 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
4508 Ok(RealmQueryRequest::GetInstance {
4509 moniker: req.moniker,
4510
4511 responder: RealmQueryGetInstanceResponder {
4512 control_handle: std::mem::ManuallyDrop::new(control_handle),
4513 tx_id: header.tx_id,
4514 },
4515 })
4516 }
4517 0x31a493d284a0bc1f => {
4518 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4519 let mut req = fidl::new_empty!(
4520 RealmQueryGetResolvedDeclarationRequest,
4521 fdomain_client::fidl::FDomainResourceDialect
4522 );
4523 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmQueryGetResolvedDeclarationRequest>(&header, _body_bytes, handles, &mut req)?;
4524 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
4525 Ok(RealmQueryRequest::GetResolvedDeclaration {
4526 moniker: req.moniker,
4527
4528 responder: RealmQueryGetResolvedDeclarationResponder {
4529 control_handle: std::mem::ManuallyDrop::new(control_handle),
4530 tx_id: header.tx_id,
4531 },
4532 })
4533 }
4534 0x1ab1adf2a87d962d => {
4535 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4536 let mut req = fidl::new_empty!(
4537 RealmQueryResolveDeclarationRequest,
4538 fdomain_client::fidl::FDomainResourceDialect
4539 );
4540 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmQueryResolveDeclarationRequest>(&header, _body_bytes, handles, &mut req)?;
4541 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
4542 Ok(RealmQueryRequest::ResolveDeclaration {
4543 parent: req.parent,
4544 child_location: req.child_location,
4545 url: req.url,
4546
4547 responder: RealmQueryResolveDeclarationResponder {
4548 control_handle: std::mem::ManuallyDrop::new(control_handle),
4549 tx_id: header.tx_id,
4550 },
4551 })
4552 }
4553 0x16f88f6735bd204 => {
4554 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4555 let mut req = fidl::new_empty!(
4556 RealmQueryGetStructuredConfigRequest,
4557 fdomain_client::fidl::FDomainResourceDialect
4558 );
4559 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmQueryGetStructuredConfigRequest>(&header, _body_bytes, handles, &mut req)?;
4560 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
4561 Ok(RealmQueryRequest::GetStructuredConfig {
4562 moniker: req.moniker,
4563
4564 responder: RealmQueryGetStructuredConfigResponder {
4565 control_handle: std::mem::ManuallyDrop::new(control_handle),
4566 tx_id: header.tx_id,
4567 },
4568 })
4569 }
4570 0x7b5a8775d30cad47 => {
4571 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4572 let mut req = fidl::new_empty!(
4573 fidl::encoding::EmptyPayload,
4574 fdomain_client::fidl::FDomainResourceDialect
4575 );
4576 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4577 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
4578 Ok(RealmQueryRequest::GetAllInstances {
4579 responder: RealmQueryGetAllInstancesResponder {
4580 control_handle: std::mem::ManuallyDrop::new(control_handle),
4581 tx_id: header.tx_id,
4582 },
4583 })
4584 }
4585 0x5ecb29c02c488eeb => {
4586 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4587 let mut req = fidl::new_empty!(
4588 RealmQueryConstructNamespaceRequest,
4589 fdomain_client::fidl::FDomainResourceDialect
4590 );
4591 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmQueryConstructNamespaceRequest>(&header, _body_bytes, handles, &mut req)?;
4592 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
4593 Ok(RealmQueryRequest::ConstructNamespace {
4594 moniker: req.moniker,
4595
4596 responder: RealmQueryConstructNamespaceResponder {
4597 control_handle: std::mem::ManuallyDrop::new(control_handle),
4598 tx_id: header.tx_id,
4599 },
4600 })
4601 }
4602 0x333d68f1deecec85 => {
4603 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4604 let mut req = fidl::new_empty!(
4605 RealmQueryOpenDirectoryRequest,
4606 fdomain_client::fidl::FDomainResourceDialect
4607 );
4608 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmQueryOpenDirectoryRequest>(&header, _body_bytes, handles, &mut req)?;
4609 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
4610 Ok(RealmQueryRequest::OpenDirectory {
4611 moniker: req.moniker,
4612 dir_type: req.dir_type,
4613 object: req.object,
4614
4615 responder: RealmQueryOpenDirectoryResponder {
4616 control_handle: std::mem::ManuallyDrop::new(control_handle),
4617 tx_id: header.tx_id,
4618 },
4619 })
4620 }
4621 0x7807e6b4f623ace => {
4622 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4623 let mut req = fidl::new_empty!(
4624 RealmQueryConnectToStorageAdminRequest,
4625 fdomain_client::fidl::FDomainResourceDialect
4626 );
4627 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmQueryConnectToStorageAdminRequest>(&header, _body_bytes, handles, &mut req)?;
4628 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
4629 Ok(RealmQueryRequest::ConnectToStorageAdmin {
4630 moniker: req.moniker,
4631 storage_name: req.storage_name,
4632 server_end: req.server_end,
4633
4634 responder: RealmQueryConnectToStorageAdminResponder {
4635 control_handle: std::mem::ManuallyDrop::new(control_handle),
4636 tx_id: header.tx_id,
4637 },
4638 })
4639 }
4640 0x54d6af83942b4069 => {
4641 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4642 let mut req = fidl::new_empty!(
4643 RealmQueryOpenStorageAdminRequest,
4644 fdomain_client::fidl::FDomainResourceDialect
4645 );
4646 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmQueryOpenStorageAdminRequest>(&header, _body_bytes, handles, &mut req)?;
4647 let control_handle = RealmQueryControlHandle { inner: this.inner.clone() };
4648 Ok(RealmQueryRequest::OpenStorageAdmin {
4649 moniker: req.moniker,
4650 storage_name: req.storage_name,
4651 server_end: req.server_end,
4652
4653 responder: RealmQueryOpenStorageAdminResponder {
4654 control_handle: std::mem::ManuallyDrop::new(control_handle),
4655 tx_id: header.tx_id,
4656 },
4657 })
4658 }
4659 _ => Err(fidl::Error::UnknownOrdinal {
4660 ordinal: header.ordinal,
4661 protocol_name:
4662 <RealmQueryMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4663 }),
4664 }))
4665 },
4666 )
4667 }
4668}
4669
4670#[derive(Debug)]
4672pub enum RealmQueryRequest {
4673 GetInstance { moniker: String, responder: RealmQueryGetInstanceResponder },
4675 GetResolvedDeclaration { moniker: String, responder: RealmQueryGetResolvedDeclarationResponder },
4682 ResolveDeclaration {
4690 parent: String,
4691 child_location: ChildLocation,
4692 url: String,
4693 responder: RealmQueryResolveDeclarationResponder,
4694 },
4695 GetStructuredConfig { moniker: String, responder: RealmQueryGetStructuredConfigResponder },
4697 GetAllInstances { responder: RealmQueryGetAllInstancesResponder },
4701 ConstructNamespace { moniker: String, responder: RealmQueryConstructNamespaceResponder },
4706 OpenDirectory {
4708 moniker: String,
4709 dir_type: OpenDirType,
4710 object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4711 responder: RealmQueryOpenDirectoryResponder,
4712 },
4713 ConnectToStorageAdmin {
4716 moniker: String,
4717 storage_name: String,
4718 server_end: fdomain_client::fidl::ServerEnd<StorageAdminMarker>,
4719 responder: RealmQueryConnectToStorageAdminResponder,
4720 },
4721 OpenStorageAdmin {
4723 moniker: String,
4724 storage_name: String,
4725 server_end: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::StorageAdminMarker>,
4726 responder: RealmQueryOpenStorageAdminResponder,
4727 },
4728}
4729
4730impl RealmQueryRequest {
4731 #[allow(irrefutable_let_patterns)]
4732 pub fn into_get_instance(self) -> Option<(String, RealmQueryGetInstanceResponder)> {
4733 if let RealmQueryRequest::GetInstance { moniker, responder } = self {
4734 Some((moniker, responder))
4735 } else {
4736 None
4737 }
4738 }
4739
4740 #[allow(irrefutable_let_patterns)]
4741 pub fn into_get_resolved_declaration(
4742 self,
4743 ) -> Option<(String, RealmQueryGetResolvedDeclarationResponder)> {
4744 if let RealmQueryRequest::GetResolvedDeclaration { moniker, responder } = self {
4745 Some((moniker, responder))
4746 } else {
4747 None
4748 }
4749 }
4750
4751 #[allow(irrefutable_let_patterns)]
4752 pub fn into_resolve_declaration(
4753 self,
4754 ) -> Option<(String, ChildLocation, String, RealmQueryResolveDeclarationResponder)> {
4755 if let RealmQueryRequest::ResolveDeclaration { parent, child_location, url, responder } =
4756 self
4757 {
4758 Some((parent, child_location, url, responder))
4759 } else {
4760 None
4761 }
4762 }
4763
4764 #[allow(irrefutable_let_patterns)]
4765 pub fn into_get_structured_config(
4766 self,
4767 ) -> Option<(String, RealmQueryGetStructuredConfigResponder)> {
4768 if let RealmQueryRequest::GetStructuredConfig { moniker, responder } = self {
4769 Some((moniker, responder))
4770 } else {
4771 None
4772 }
4773 }
4774
4775 #[allow(irrefutable_let_patterns)]
4776 pub fn into_get_all_instances(self) -> Option<(RealmQueryGetAllInstancesResponder)> {
4777 if let RealmQueryRequest::GetAllInstances { responder } = self {
4778 Some((responder))
4779 } else {
4780 None
4781 }
4782 }
4783
4784 #[allow(irrefutable_let_patterns)]
4785 pub fn into_construct_namespace(
4786 self,
4787 ) -> Option<(String, RealmQueryConstructNamespaceResponder)> {
4788 if let RealmQueryRequest::ConstructNamespace { moniker, responder } = self {
4789 Some((moniker, responder))
4790 } else {
4791 None
4792 }
4793 }
4794
4795 #[allow(irrefutable_let_patterns)]
4796 pub fn into_open_directory(
4797 self,
4798 ) -> Option<(
4799 String,
4800 OpenDirType,
4801 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4802 RealmQueryOpenDirectoryResponder,
4803 )> {
4804 if let RealmQueryRequest::OpenDirectory { moniker, dir_type, object, responder } = self {
4805 Some((moniker, dir_type, object, responder))
4806 } else {
4807 None
4808 }
4809 }
4810
4811 #[allow(irrefutable_let_patterns)]
4812 pub fn into_connect_to_storage_admin(
4813 self,
4814 ) -> Option<(
4815 String,
4816 String,
4817 fdomain_client::fidl::ServerEnd<StorageAdminMarker>,
4818 RealmQueryConnectToStorageAdminResponder,
4819 )> {
4820 if let RealmQueryRequest::ConnectToStorageAdmin {
4821 moniker,
4822 storage_name,
4823 server_end,
4824 responder,
4825 } = self
4826 {
4827 Some((moniker, storage_name, server_end, responder))
4828 } else {
4829 None
4830 }
4831 }
4832
4833 #[allow(irrefutable_let_patterns)]
4834 pub fn into_open_storage_admin(
4835 self,
4836 ) -> Option<(
4837 String,
4838 String,
4839 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::StorageAdminMarker>,
4840 RealmQueryOpenStorageAdminResponder,
4841 )> {
4842 if let RealmQueryRequest::OpenStorageAdmin {
4843 moniker,
4844 storage_name,
4845 server_end,
4846 responder,
4847 } = self
4848 {
4849 Some((moniker, storage_name, server_end, responder))
4850 } else {
4851 None
4852 }
4853 }
4854
4855 pub fn method_name(&self) -> &'static str {
4857 match *self {
4858 RealmQueryRequest::GetInstance { .. } => "get_instance",
4859 RealmQueryRequest::GetResolvedDeclaration { .. } => "get_resolved_declaration",
4860 RealmQueryRequest::ResolveDeclaration { .. } => "resolve_declaration",
4861 RealmQueryRequest::GetStructuredConfig { .. } => "get_structured_config",
4862 RealmQueryRequest::GetAllInstances { .. } => "get_all_instances",
4863 RealmQueryRequest::ConstructNamespace { .. } => "construct_namespace",
4864 RealmQueryRequest::OpenDirectory { .. } => "open_directory",
4865 RealmQueryRequest::ConnectToStorageAdmin { .. } => "connect_to_storage_admin",
4866 RealmQueryRequest::OpenStorageAdmin { .. } => "open_storage_admin",
4867 }
4868 }
4869}
4870
4871#[derive(Debug, Clone)]
4872pub struct RealmQueryControlHandle {
4873 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4874}
4875
4876impl RealmQueryControlHandle {
4877 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4878 self.inner.shutdown_with_epitaph(status.into())
4879 }
4880}
4881
4882impl fdomain_client::fidl::ControlHandle for RealmQueryControlHandle {
4883 fn shutdown(&self) {
4884 self.inner.shutdown()
4885 }
4886
4887 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4888 self.inner.shutdown_with_epitaph(status)
4889 }
4890
4891 fn is_closed(&self) -> bool {
4892 self.inner.channel().is_closed()
4893 }
4894 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4895 self.inner.channel().on_closed()
4896 }
4897}
4898
4899impl RealmQueryControlHandle {}
4900
4901#[must_use = "FIDL methods require a response to be sent"]
4902#[derive(Debug)]
4903pub struct RealmQueryGetInstanceResponder {
4904 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
4905 tx_id: u32,
4906}
4907
4908impl std::ops::Drop for RealmQueryGetInstanceResponder {
4912 fn drop(&mut self) {
4913 self.control_handle.shutdown();
4914 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4916 }
4917}
4918
4919impl fdomain_client::fidl::Responder for RealmQueryGetInstanceResponder {
4920 type ControlHandle = RealmQueryControlHandle;
4921
4922 fn control_handle(&self) -> &RealmQueryControlHandle {
4923 &self.control_handle
4924 }
4925
4926 fn drop_without_shutdown(mut self) {
4927 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4929 std::mem::forget(self);
4931 }
4932}
4933
4934impl RealmQueryGetInstanceResponder {
4935 pub fn send(self, mut result: Result<&Instance, GetInstanceError>) -> Result<(), fidl::Error> {
4939 let _result = self.send_raw(result);
4940 if _result.is_err() {
4941 self.control_handle.shutdown();
4942 }
4943 self.drop_without_shutdown();
4944 _result
4945 }
4946
4947 pub fn send_no_shutdown_on_err(
4949 self,
4950 mut result: Result<&Instance, GetInstanceError>,
4951 ) -> Result<(), fidl::Error> {
4952 let _result = self.send_raw(result);
4953 self.drop_without_shutdown();
4954 _result
4955 }
4956
4957 fn send_raw(&self, mut result: Result<&Instance, GetInstanceError>) -> Result<(), fidl::Error> {
4958 self.control_handle.inner.send::<fidl::encoding::ResultType<
4959 RealmQueryGetInstanceResponse,
4960 GetInstanceError,
4961 >>(
4962 result.map(|instance| (instance,)),
4963 self.tx_id,
4964 0x3496ca1e5a0c13a8,
4965 fidl::encoding::DynamicFlags::empty(),
4966 )
4967 }
4968}
4969
4970#[must_use = "FIDL methods require a response to be sent"]
4971#[derive(Debug)]
4972pub struct RealmQueryGetResolvedDeclarationResponder {
4973 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
4974 tx_id: u32,
4975}
4976
4977impl std::ops::Drop for RealmQueryGetResolvedDeclarationResponder {
4981 fn drop(&mut self) {
4982 self.control_handle.shutdown();
4983 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4985 }
4986}
4987
4988impl fdomain_client::fidl::Responder for RealmQueryGetResolvedDeclarationResponder {
4989 type ControlHandle = RealmQueryControlHandle;
4990
4991 fn control_handle(&self) -> &RealmQueryControlHandle {
4992 &self.control_handle
4993 }
4994
4995 fn drop_without_shutdown(mut self) {
4996 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4998 std::mem::forget(self);
5000 }
5001}
5002
5003impl RealmQueryGetResolvedDeclarationResponder {
5004 pub fn send(
5008 self,
5009 mut result: Result<
5010 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
5011 GetDeclarationError,
5012 >,
5013 ) -> Result<(), fidl::Error> {
5014 let _result = self.send_raw(result);
5015 if _result.is_err() {
5016 self.control_handle.shutdown();
5017 }
5018 self.drop_without_shutdown();
5019 _result
5020 }
5021
5022 pub fn send_no_shutdown_on_err(
5024 self,
5025 mut result: Result<
5026 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
5027 GetDeclarationError,
5028 >,
5029 ) -> Result<(), fidl::Error> {
5030 let _result = self.send_raw(result);
5031 self.drop_without_shutdown();
5032 _result
5033 }
5034
5035 fn send_raw(
5036 &self,
5037 mut result: Result<
5038 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
5039 GetDeclarationError,
5040 >,
5041 ) -> Result<(), fidl::Error> {
5042 self.control_handle.inner.send::<fidl::encoding::ResultType<
5043 RealmQueryGetResolvedDeclarationResponse,
5044 GetDeclarationError,
5045 >>(
5046 result.map(|iterator| (iterator,)),
5047 self.tx_id,
5048 0x31a493d284a0bc1f,
5049 fidl::encoding::DynamicFlags::empty(),
5050 )
5051 }
5052}
5053
5054#[must_use = "FIDL methods require a response to be sent"]
5055#[derive(Debug)]
5056pub struct RealmQueryResolveDeclarationResponder {
5057 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5058 tx_id: u32,
5059}
5060
5061impl std::ops::Drop for RealmQueryResolveDeclarationResponder {
5065 fn drop(&mut self) {
5066 self.control_handle.shutdown();
5067 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5069 }
5070}
5071
5072impl fdomain_client::fidl::Responder for RealmQueryResolveDeclarationResponder {
5073 type ControlHandle = RealmQueryControlHandle;
5074
5075 fn control_handle(&self) -> &RealmQueryControlHandle {
5076 &self.control_handle
5077 }
5078
5079 fn drop_without_shutdown(mut self) {
5080 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5082 std::mem::forget(self);
5084 }
5085}
5086
5087impl RealmQueryResolveDeclarationResponder {
5088 pub fn send(
5092 self,
5093 mut result: Result<
5094 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
5095 GetDeclarationError,
5096 >,
5097 ) -> Result<(), fidl::Error> {
5098 let _result = self.send_raw(result);
5099 if _result.is_err() {
5100 self.control_handle.shutdown();
5101 }
5102 self.drop_without_shutdown();
5103 _result
5104 }
5105
5106 pub fn send_no_shutdown_on_err(
5108 self,
5109 mut result: Result<
5110 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
5111 GetDeclarationError,
5112 >,
5113 ) -> Result<(), fidl::Error> {
5114 let _result = self.send_raw(result);
5115 self.drop_without_shutdown();
5116 _result
5117 }
5118
5119 fn send_raw(
5120 &self,
5121 mut result: Result<
5122 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
5123 GetDeclarationError,
5124 >,
5125 ) -> Result<(), fidl::Error> {
5126 self.control_handle.inner.send::<fidl::encoding::ResultType<
5127 RealmQueryResolveDeclarationResponse,
5128 GetDeclarationError,
5129 >>(
5130 result.map(|iterator| (iterator,)),
5131 self.tx_id,
5132 0x1ab1adf2a87d962d,
5133 fidl::encoding::DynamicFlags::empty(),
5134 )
5135 }
5136}
5137
5138#[must_use = "FIDL methods require a response to be sent"]
5139#[derive(Debug)]
5140pub struct RealmQueryGetStructuredConfigResponder {
5141 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5142 tx_id: u32,
5143}
5144
5145impl std::ops::Drop for RealmQueryGetStructuredConfigResponder {
5149 fn drop(&mut self) {
5150 self.control_handle.shutdown();
5151 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5153 }
5154}
5155
5156impl fdomain_client::fidl::Responder for RealmQueryGetStructuredConfigResponder {
5157 type ControlHandle = RealmQueryControlHandle;
5158
5159 fn control_handle(&self) -> &RealmQueryControlHandle {
5160 &self.control_handle
5161 }
5162
5163 fn drop_without_shutdown(mut self) {
5164 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5166 std::mem::forget(self);
5168 }
5169}
5170
5171impl RealmQueryGetStructuredConfigResponder {
5172 pub fn send(
5176 self,
5177 mut result: Result<
5178 &fdomain_fuchsia_component_decl::ResolvedConfig,
5179 GetStructuredConfigError,
5180 >,
5181 ) -> Result<(), fidl::Error> {
5182 let _result = self.send_raw(result);
5183 if _result.is_err() {
5184 self.control_handle.shutdown();
5185 }
5186 self.drop_without_shutdown();
5187 _result
5188 }
5189
5190 pub fn send_no_shutdown_on_err(
5192 self,
5193 mut result: Result<
5194 &fdomain_fuchsia_component_decl::ResolvedConfig,
5195 GetStructuredConfigError,
5196 >,
5197 ) -> Result<(), fidl::Error> {
5198 let _result = self.send_raw(result);
5199 self.drop_without_shutdown();
5200 _result
5201 }
5202
5203 fn send_raw(
5204 &self,
5205 mut result: Result<
5206 &fdomain_fuchsia_component_decl::ResolvedConfig,
5207 GetStructuredConfigError,
5208 >,
5209 ) -> Result<(), fidl::Error> {
5210 self.control_handle.inner.send::<fidl::encoding::ResultType<
5211 RealmQueryGetStructuredConfigResponse,
5212 GetStructuredConfigError,
5213 >>(
5214 result.map(|config| (config,)),
5215 self.tx_id,
5216 0x16f88f6735bd204,
5217 fidl::encoding::DynamicFlags::empty(),
5218 )
5219 }
5220}
5221
5222#[must_use = "FIDL methods require a response to be sent"]
5223#[derive(Debug)]
5224pub struct RealmQueryGetAllInstancesResponder {
5225 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5226 tx_id: u32,
5227}
5228
5229impl std::ops::Drop for RealmQueryGetAllInstancesResponder {
5233 fn drop(&mut self) {
5234 self.control_handle.shutdown();
5235 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5237 }
5238}
5239
5240impl fdomain_client::fidl::Responder for RealmQueryGetAllInstancesResponder {
5241 type ControlHandle = RealmQueryControlHandle;
5242
5243 fn control_handle(&self) -> &RealmQueryControlHandle {
5244 &self.control_handle
5245 }
5246
5247 fn drop_without_shutdown(mut self) {
5248 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5250 std::mem::forget(self);
5252 }
5253}
5254
5255impl RealmQueryGetAllInstancesResponder {
5256 pub fn send(
5260 self,
5261 mut result: Result<
5262 fdomain_client::fidl::ClientEnd<InstanceIteratorMarker>,
5263 GetAllInstancesError,
5264 >,
5265 ) -> Result<(), fidl::Error> {
5266 let _result = self.send_raw(result);
5267 if _result.is_err() {
5268 self.control_handle.shutdown();
5269 }
5270 self.drop_without_shutdown();
5271 _result
5272 }
5273
5274 pub fn send_no_shutdown_on_err(
5276 self,
5277 mut result: Result<
5278 fdomain_client::fidl::ClientEnd<InstanceIteratorMarker>,
5279 GetAllInstancesError,
5280 >,
5281 ) -> Result<(), fidl::Error> {
5282 let _result = self.send_raw(result);
5283 self.drop_without_shutdown();
5284 _result
5285 }
5286
5287 fn send_raw(
5288 &self,
5289 mut result: Result<
5290 fdomain_client::fidl::ClientEnd<InstanceIteratorMarker>,
5291 GetAllInstancesError,
5292 >,
5293 ) -> Result<(), fidl::Error> {
5294 self.control_handle.inner.send::<fidl::encoding::ResultType<
5295 RealmQueryGetAllInstancesResponse,
5296 GetAllInstancesError,
5297 >>(
5298 result.map(|iterator| (iterator,)),
5299 self.tx_id,
5300 0x7b5a8775d30cad47,
5301 fidl::encoding::DynamicFlags::empty(),
5302 )
5303 }
5304}
5305
5306#[must_use = "FIDL methods require a response to be sent"]
5307#[derive(Debug)]
5308pub struct RealmQueryConstructNamespaceResponder {
5309 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5310 tx_id: u32,
5311}
5312
5313impl std::ops::Drop for RealmQueryConstructNamespaceResponder {
5317 fn drop(&mut self) {
5318 self.control_handle.shutdown();
5319 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5321 }
5322}
5323
5324impl fdomain_client::fidl::Responder for RealmQueryConstructNamespaceResponder {
5325 type ControlHandle = RealmQueryControlHandle;
5326
5327 fn control_handle(&self) -> &RealmQueryControlHandle {
5328 &self.control_handle
5329 }
5330
5331 fn drop_without_shutdown(mut self) {
5332 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5334 std::mem::forget(self);
5336 }
5337}
5338
5339impl RealmQueryConstructNamespaceResponder {
5340 pub fn send(
5344 self,
5345 mut result: Result<
5346 Vec<fdomain_fuchsia_component_runner::ComponentNamespaceEntry>,
5347 ConstructNamespaceError,
5348 >,
5349 ) -> Result<(), fidl::Error> {
5350 let _result = self.send_raw(result);
5351 if _result.is_err() {
5352 self.control_handle.shutdown();
5353 }
5354 self.drop_without_shutdown();
5355 _result
5356 }
5357
5358 pub fn send_no_shutdown_on_err(
5360 self,
5361 mut result: Result<
5362 Vec<fdomain_fuchsia_component_runner::ComponentNamespaceEntry>,
5363 ConstructNamespaceError,
5364 >,
5365 ) -> Result<(), fidl::Error> {
5366 let _result = self.send_raw(result);
5367 self.drop_without_shutdown();
5368 _result
5369 }
5370
5371 fn send_raw(
5372 &self,
5373 mut result: Result<
5374 Vec<fdomain_fuchsia_component_runner::ComponentNamespaceEntry>,
5375 ConstructNamespaceError,
5376 >,
5377 ) -> Result<(), fidl::Error> {
5378 self.control_handle.inner.send::<fidl::encoding::ResultType<
5379 RealmQueryConstructNamespaceResponse,
5380 ConstructNamespaceError,
5381 >>(
5382 result.as_mut().map_err(|e| *e).map(|namespace| (namespace.as_mut_slice(),)),
5383 self.tx_id,
5384 0x5ecb29c02c488eeb,
5385 fidl::encoding::DynamicFlags::empty(),
5386 )
5387 }
5388}
5389
5390#[must_use = "FIDL methods require a response to be sent"]
5391#[derive(Debug)]
5392pub struct RealmQueryOpenDirectoryResponder {
5393 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5394 tx_id: u32,
5395}
5396
5397impl std::ops::Drop for RealmQueryOpenDirectoryResponder {
5401 fn drop(&mut self) {
5402 self.control_handle.shutdown();
5403 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5405 }
5406}
5407
5408impl fdomain_client::fidl::Responder for RealmQueryOpenDirectoryResponder {
5409 type ControlHandle = RealmQueryControlHandle;
5410
5411 fn control_handle(&self) -> &RealmQueryControlHandle {
5412 &self.control_handle
5413 }
5414
5415 fn drop_without_shutdown(mut self) {
5416 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5418 std::mem::forget(self);
5420 }
5421}
5422
5423impl RealmQueryOpenDirectoryResponder {
5424 pub fn send(self, mut result: Result<(), OpenError>) -> Result<(), fidl::Error> {
5428 let _result = self.send_raw(result);
5429 if _result.is_err() {
5430 self.control_handle.shutdown();
5431 }
5432 self.drop_without_shutdown();
5433 _result
5434 }
5435
5436 pub fn send_no_shutdown_on_err(
5438 self,
5439 mut result: Result<(), OpenError>,
5440 ) -> Result<(), fidl::Error> {
5441 let _result = self.send_raw(result);
5442 self.drop_without_shutdown();
5443 _result
5444 }
5445
5446 fn send_raw(&self, mut result: Result<(), OpenError>) -> Result<(), fidl::Error> {
5447 self.control_handle
5448 .inner
5449 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, OpenError>>(
5450 result,
5451 self.tx_id,
5452 0x333d68f1deecec85,
5453 fidl::encoding::DynamicFlags::empty(),
5454 )
5455 }
5456}
5457
5458#[must_use = "FIDL methods require a response to be sent"]
5459#[derive(Debug)]
5460pub struct RealmQueryConnectToStorageAdminResponder {
5461 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5462 tx_id: u32,
5463}
5464
5465impl std::ops::Drop for RealmQueryConnectToStorageAdminResponder {
5469 fn drop(&mut self) {
5470 self.control_handle.shutdown();
5471 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5473 }
5474}
5475
5476impl fdomain_client::fidl::Responder for RealmQueryConnectToStorageAdminResponder {
5477 type ControlHandle = RealmQueryControlHandle;
5478
5479 fn control_handle(&self) -> &RealmQueryControlHandle {
5480 &self.control_handle
5481 }
5482
5483 fn drop_without_shutdown(mut self) {
5484 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5486 std::mem::forget(self);
5488 }
5489}
5490
5491impl RealmQueryConnectToStorageAdminResponder {
5492 pub fn send(
5496 self,
5497 mut result: Result<(), ConnectToStorageAdminError>,
5498 ) -> Result<(), fidl::Error> {
5499 let _result = self.send_raw(result);
5500 if _result.is_err() {
5501 self.control_handle.shutdown();
5502 }
5503 self.drop_without_shutdown();
5504 _result
5505 }
5506
5507 pub fn send_no_shutdown_on_err(
5509 self,
5510 mut result: Result<(), ConnectToStorageAdminError>,
5511 ) -> Result<(), fidl::Error> {
5512 let _result = self.send_raw(result);
5513 self.drop_without_shutdown();
5514 _result
5515 }
5516
5517 fn send_raw(
5518 &self,
5519 mut result: Result<(), ConnectToStorageAdminError>,
5520 ) -> Result<(), fidl::Error> {
5521 self.control_handle.inner.send::<fidl::encoding::ResultType<
5522 fidl::encoding::EmptyStruct,
5523 ConnectToStorageAdminError,
5524 >>(
5525 result,
5526 self.tx_id,
5527 0x7807e6b4f623ace,
5528 fidl::encoding::DynamicFlags::empty(),
5529 )
5530 }
5531}
5532
5533#[must_use = "FIDL methods require a response to be sent"]
5534#[derive(Debug)]
5535pub struct RealmQueryOpenStorageAdminResponder {
5536 control_handle: std::mem::ManuallyDrop<RealmQueryControlHandle>,
5537 tx_id: u32,
5538}
5539
5540impl std::ops::Drop for RealmQueryOpenStorageAdminResponder {
5544 fn drop(&mut self) {
5545 self.control_handle.shutdown();
5546 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5548 }
5549}
5550
5551impl fdomain_client::fidl::Responder for RealmQueryOpenStorageAdminResponder {
5552 type ControlHandle = RealmQueryControlHandle;
5553
5554 fn control_handle(&self) -> &RealmQueryControlHandle {
5555 &self.control_handle
5556 }
5557
5558 fn drop_without_shutdown(mut self) {
5559 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5561 std::mem::forget(self);
5563 }
5564}
5565
5566impl RealmQueryOpenStorageAdminResponder {
5567 pub fn send(
5571 self,
5572 mut result: Result<(), ConnectToStorageAdminError>,
5573 ) -> Result<(), fidl::Error> {
5574 let _result = self.send_raw(result);
5575 if _result.is_err() {
5576 self.control_handle.shutdown();
5577 }
5578 self.drop_without_shutdown();
5579 _result
5580 }
5581
5582 pub fn send_no_shutdown_on_err(
5584 self,
5585 mut result: Result<(), ConnectToStorageAdminError>,
5586 ) -> Result<(), fidl::Error> {
5587 let _result = self.send_raw(result);
5588 self.drop_without_shutdown();
5589 _result
5590 }
5591
5592 fn send_raw(
5593 &self,
5594 mut result: Result<(), ConnectToStorageAdminError>,
5595 ) -> Result<(), fidl::Error> {
5596 self.control_handle.inner.send::<fidl::encoding::ResultType<
5597 fidl::encoding::EmptyStruct,
5598 ConnectToStorageAdminError,
5599 >>(
5600 result,
5601 self.tx_id,
5602 0x54d6af83942b4069,
5603 fidl::encoding::DynamicFlags::empty(),
5604 )
5605 }
5606}
5607
5608#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5609pub struct RouteValidatorMarker;
5610
5611impl fdomain_client::fidl::ProtocolMarker for RouteValidatorMarker {
5612 type Proxy = RouteValidatorProxy;
5613 type RequestStream = RouteValidatorRequestStream;
5614
5615 const DEBUG_NAME: &'static str = "fuchsia.sys2.RouteValidator";
5616}
5617impl fdomain_client::fidl::DiscoverableProtocolMarker for RouteValidatorMarker {}
5618pub type RouteValidatorValidateResult = Result<Vec<RouteReport>, fdomain_fuchsia_component::Error>;
5619pub type RouteValidatorRouteResult = Result<Vec<RouteReport>, RouteValidatorError>;
5620
5621pub trait RouteValidatorProxyInterface: Send + Sync {
5622 type ValidateResponseFut: std::future::Future<Output = Result<RouteValidatorValidateResult, fidl::Error>>
5623 + Send;
5624 fn r#validate(&self, moniker: &str) -> Self::ValidateResponseFut;
5625 type RouteResponseFut: std::future::Future<Output = Result<RouteValidatorRouteResult, fidl::Error>>
5626 + Send;
5627 fn r#route(&self, moniker: &str, targets: &[RouteTarget]) -> Self::RouteResponseFut;
5628}
5629
5630#[derive(Debug, Clone)]
5631pub struct RouteValidatorProxy {
5632 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5633}
5634
5635impl fdomain_client::fidl::Proxy for RouteValidatorProxy {
5636 type Protocol = RouteValidatorMarker;
5637
5638 fn from_channel(inner: fdomain_client::Channel) -> Self {
5639 Self::new(inner)
5640 }
5641
5642 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5643 self.client.into_channel().map_err(|client| Self { client })
5644 }
5645
5646 fn as_channel(&self) -> &fdomain_client::Channel {
5647 self.client.as_channel()
5648 }
5649}
5650
5651impl RouteValidatorProxy {
5652 pub fn new(channel: fdomain_client::Channel) -> Self {
5654 let protocol_name =
5655 <RouteValidatorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5656 Self { client: fidl::client::Client::new(channel, protocol_name) }
5657 }
5658
5659 pub fn take_event_stream(&self) -> RouteValidatorEventStream {
5665 RouteValidatorEventStream { event_receiver: self.client.take_event_receiver() }
5666 }
5667
5668 pub fn r#validate(
5676 &self,
5677 mut moniker: &str,
5678 ) -> fidl::client::QueryResponseFut<
5679 RouteValidatorValidateResult,
5680 fdomain_client::fidl::FDomainResourceDialect,
5681 > {
5682 RouteValidatorProxyInterface::r#validate(self, moniker)
5683 }
5684
5685 pub fn r#route(
5701 &self,
5702 mut moniker: &str,
5703 mut targets: &[RouteTarget],
5704 ) -> fidl::client::QueryResponseFut<
5705 RouteValidatorRouteResult,
5706 fdomain_client::fidl::FDomainResourceDialect,
5707 > {
5708 RouteValidatorProxyInterface::r#route(self, moniker, targets)
5709 }
5710}
5711
5712impl RouteValidatorProxyInterface for RouteValidatorProxy {
5713 type ValidateResponseFut = fidl::client::QueryResponseFut<
5714 RouteValidatorValidateResult,
5715 fdomain_client::fidl::FDomainResourceDialect,
5716 >;
5717 fn r#validate(&self, mut moniker: &str) -> Self::ValidateResponseFut {
5718 fn _decode(
5719 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5720 ) -> Result<RouteValidatorValidateResult, fidl::Error> {
5721 let _response = fidl::client::decode_transaction_body::<
5722 fidl::encoding::ResultType<
5723 RouteValidatorValidateResponse,
5724 fdomain_fuchsia_component::Error,
5725 >,
5726 fdomain_client::fidl::FDomainResourceDialect,
5727 0x3360b96d5f86cdf4,
5728 >(_buf?)?;
5729 Ok(_response.map(|x| x.reports))
5730 }
5731 self.client
5732 .send_query_and_decode::<RouteValidatorValidateRequest, RouteValidatorValidateResult>(
5733 (moniker,),
5734 0x3360b96d5f86cdf4,
5735 fidl::encoding::DynamicFlags::empty(),
5736 _decode,
5737 )
5738 }
5739
5740 type RouteResponseFut = fidl::client::QueryResponseFut<
5741 RouteValidatorRouteResult,
5742 fdomain_client::fidl::FDomainResourceDialect,
5743 >;
5744 fn r#route(&self, mut moniker: &str, mut targets: &[RouteTarget]) -> Self::RouteResponseFut {
5745 fn _decode(
5746 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5747 ) -> Result<RouteValidatorRouteResult, fidl::Error> {
5748 let _response = fidl::client::decode_transaction_body::<
5749 fidl::encoding::ResultType<RouteValidatorRouteResponse, RouteValidatorError>,
5750 fdomain_client::fidl::FDomainResourceDialect,
5751 0x51c9b268216d8239,
5752 >(_buf?)?;
5753 Ok(_response.map(|x| x.reports))
5754 }
5755 self.client.send_query_and_decode::<RouteValidatorRouteRequest, RouteValidatorRouteResult>(
5756 (moniker, targets),
5757 0x51c9b268216d8239,
5758 fidl::encoding::DynamicFlags::empty(),
5759 _decode,
5760 )
5761 }
5762}
5763
5764pub struct RouteValidatorEventStream {
5765 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5766}
5767
5768impl std::marker::Unpin for RouteValidatorEventStream {}
5769
5770impl futures::stream::FusedStream for RouteValidatorEventStream {
5771 fn is_terminated(&self) -> bool {
5772 self.event_receiver.is_terminated()
5773 }
5774}
5775
5776impl futures::Stream for RouteValidatorEventStream {
5777 type Item = Result<RouteValidatorEvent, fidl::Error>;
5778
5779 fn poll_next(
5780 mut self: std::pin::Pin<&mut Self>,
5781 cx: &mut std::task::Context<'_>,
5782 ) -> std::task::Poll<Option<Self::Item>> {
5783 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5784 &mut self.event_receiver,
5785 cx
5786 )?) {
5787 Some(buf) => std::task::Poll::Ready(Some(RouteValidatorEvent::decode(buf))),
5788 None => std::task::Poll::Ready(None),
5789 }
5790 }
5791}
5792
5793#[derive(Debug)]
5794pub enum RouteValidatorEvent {}
5795
5796impl RouteValidatorEvent {
5797 fn decode(
5799 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5800 ) -> Result<RouteValidatorEvent, fidl::Error> {
5801 let (bytes, _handles) = buf.split_mut();
5802 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5803 debug_assert_eq!(tx_header.tx_id, 0);
5804 match tx_header.ordinal {
5805 _ => Err(fidl::Error::UnknownOrdinal {
5806 ordinal: tx_header.ordinal,
5807 protocol_name:
5808 <RouteValidatorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5809 }),
5810 }
5811 }
5812}
5813
5814pub struct RouteValidatorRequestStream {
5816 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5817 is_terminated: bool,
5818}
5819
5820impl std::marker::Unpin for RouteValidatorRequestStream {}
5821
5822impl futures::stream::FusedStream for RouteValidatorRequestStream {
5823 fn is_terminated(&self) -> bool {
5824 self.is_terminated
5825 }
5826}
5827
5828impl fdomain_client::fidl::RequestStream for RouteValidatorRequestStream {
5829 type Protocol = RouteValidatorMarker;
5830 type ControlHandle = RouteValidatorControlHandle;
5831
5832 fn from_channel(channel: fdomain_client::Channel) -> Self {
5833 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5834 }
5835
5836 fn control_handle(&self) -> Self::ControlHandle {
5837 RouteValidatorControlHandle { inner: self.inner.clone() }
5838 }
5839
5840 fn into_inner(
5841 self,
5842 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5843 {
5844 (self.inner, self.is_terminated)
5845 }
5846
5847 fn from_inner(
5848 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5849 is_terminated: bool,
5850 ) -> Self {
5851 Self { inner, is_terminated }
5852 }
5853}
5854
5855impl futures::Stream for RouteValidatorRequestStream {
5856 type Item = Result<RouteValidatorRequest, fidl::Error>;
5857
5858 fn poll_next(
5859 mut self: std::pin::Pin<&mut Self>,
5860 cx: &mut std::task::Context<'_>,
5861 ) -> std::task::Poll<Option<Self::Item>> {
5862 let this = &mut *self;
5863 if this.inner.check_shutdown(cx) {
5864 this.is_terminated = true;
5865 return std::task::Poll::Ready(None);
5866 }
5867 if this.is_terminated {
5868 panic!("polled RouteValidatorRequestStream after completion");
5869 }
5870 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5871 |bytes, handles| {
5872 match this.inner.channel().read_etc(cx, bytes, handles) {
5873 std::task::Poll::Ready(Ok(())) => {}
5874 std::task::Poll::Pending => return std::task::Poll::Pending,
5875 std::task::Poll::Ready(Err(None)) => {
5876 this.is_terminated = true;
5877 return std::task::Poll::Ready(None);
5878 }
5879 std::task::Poll::Ready(Err(Some(e))) => {
5880 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5881 e.into(),
5882 ))));
5883 }
5884 }
5885
5886 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5888
5889 std::task::Poll::Ready(Some(match header.ordinal {
5890 0x3360b96d5f86cdf4 => {
5891 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5892 let mut req = fidl::new_empty!(RouteValidatorValidateRequest, fdomain_client::fidl::FDomainResourceDialect);
5893 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteValidatorValidateRequest>(&header, _body_bytes, handles, &mut req)?;
5894 let control_handle = RouteValidatorControlHandle {
5895 inner: this.inner.clone(),
5896 };
5897 Ok(RouteValidatorRequest::Validate {moniker: req.moniker,
5898
5899 responder: RouteValidatorValidateResponder {
5900 control_handle: std::mem::ManuallyDrop::new(control_handle),
5901 tx_id: header.tx_id,
5902 },
5903 })
5904 }
5905 0x51c9b268216d8239 => {
5906 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5907 let mut req = fidl::new_empty!(RouteValidatorRouteRequest, fdomain_client::fidl::FDomainResourceDialect);
5908 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RouteValidatorRouteRequest>(&header, _body_bytes, handles, &mut req)?;
5909 let control_handle = RouteValidatorControlHandle {
5910 inner: this.inner.clone(),
5911 };
5912 Ok(RouteValidatorRequest::Route {moniker: req.moniker,
5913targets: req.targets,
5914
5915 responder: RouteValidatorRouteResponder {
5916 control_handle: std::mem::ManuallyDrop::new(control_handle),
5917 tx_id: header.tx_id,
5918 },
5919 })
5920 }
5921 _ => Err(fidl::Error::UnknownOrdinal {
5922 ordinal: header.ordinal,
5923 protocol_name: <RouteValidatorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5924 }),
5925 }))
5926 },
5927 )
5928 }
5929}
5930
5931#[derive(Debug)]
5932pub enum RouteValidatorRequest {
5933 Validate { moniker: String, responder: RouteValidatorValidateResponder },
5941 Route { moniker: String, targets: Vec<RouteTarget>, responder: RouteValidatorRouteResponder },
5957}
5958
5959impl RouteValidatorRequest {
5960 #[allow(irrefutable_let_patterns)]
5961 pub fn into_validate(self) -> Option<(String, RouteValidatorValidateResponder)> {
5962 if let RouteValidatorRequest::Validate { moniker, responder } = self {
5963 Some((moniker, responder))
5964 } else {
5965 None
5966 }
5967 }
5968
5969 #[allow(irrefutable_let_patterns)]
5970 pub fn into_route(self) -> Option<(String, Vec<RouteTarget>, RouteValidatorRouteResponder)> {
5971 if let RouteValidatorRequest::Route { moniker, targets, responder } = self {
5972 Some((moniker, targets, responder))
5973 } else {
5974 None
5975 }
5976 }
5977
5978 pub fn method_name(&self) -> &'static str {
5980 match *self {
5981 RouteValidatorRequest::Validate { .. } => "validate",
5982 RouteValidatorRequest::Route { .. } => "route",
5983 }
5984 }
5985}
5986
5987#[derive(Debug, Clone)]
5988pub struct RouteValidatorControlHandle {
5989 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5990}
5991
5992impl RouteValidatorControlHandle {
5993 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5994 self.inner.shutdown_with_epitaph(status.into())
5995 }
5996}
5997
5998impl fdomain_client::fidl::ControlHandle for RouteValidatorControlHandle {
5999 fn shutdown(&self) {
6000 self.inner.shutdown()
6001 }
6002
6003 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6004 self.inner.shutdown_with_epitaph(status)
6005 }
6006
6007 fn is_closed(&self) -> bool {
6008 self.inner.channel().is_closed()
6009 }
6010 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6011 self.inner.channel().on_closed()
6012 }
6013}
6014
6015impl RouteValidatorControlHandle {}
6016
6017#[must_use = "FIDL methods require a response to be sent"]
6018#[derive(Debug)]
6019pub struct RouteValidatorValidateResponder {
6020 control_handle: std::mem::ManuallyDrop<RouteValidatorControlHandle>,
6021 tx_id: u32,
6022}
6023
6024impl std::ops::Drop for RouteValidatorValidateResponder {
6028 fn drop(&mut self) {
6029 self.control_handle.shutdown();
6030 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6032 }
6033}
6034
6035impl fdomain_client::fidl::Responder for RouteValidatorValidateResponder {
6036 type ControlHandle = RouteValidatorControlHandle;
6037
6038 fn control_handle(&self) -> &RouteValidatorControlHandle {
6039 &self.control_handle
6040 }
6041
6042 fn drop_without_shutdown(mut self) {
6043 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6045 std::mem::forget(self);
6047 }
6048}
6049
6050impl RouteValidatorValidateResponder {
6051 pub fn send(
6055 self,
6056 mut result: Result<&[RouteReport], fdomain_fuchsia_component::Error>,
6057 ) -> Result<(), fidl::Error> {
6058 let _result = self.send_raw(result);
6059 if _result.is_err() {
6060 self.control_handle.shutdown();
6061 }
6062 self.drop_without_shutdown();
6063 _result
6064 }
6065
6066 pub fn send_no_shutdown_on_err(
6068 self,
6069 mut result: Result<&[RouteReport], fdomain_fuchsia_component::Error>,
6070 ) -> Result<(), fidl::Error> {
6071 let _result = self.send_raw(result);
6072 self.drop_without_shutdown();
6073 _result
6074 }
6075
6076 fn send_raw(
6077 &self,
6078 mut result: Result<&[RouteReport], fdomain_fuchsia_component::Error>,
6079 ) -> Result<(), fidl::Error> {
6080 self.control_handle.inner.send::<fidl::encoding::ResultType<
6081 RouteValidatorValidateResponse,
6082 fdomain_fuchsia_component::Error,
6083 >>(
6084 result.map(|reports| (reports,)),
6085 self.tx_id,
6086 0x3360b96d5f86cdf4,
6087 fidl::encoding::DynamicFlags::empty(),
6088 )
6089 }
6090}
6091
6092#[must_use = "FIDL methods require a response to be sent"]
6093#[derive(Debug)]
6094pub struct RouteValidatorRouteResponder {
6095 control_handle: std::mem::ManuallyDrop<RouteValidatorControlHandle>,
6096 tx_id: u32,
6097}
6098
6099impl std::ops::Drop for RouteValidatorRouteResponder {
6103 fn drop(&mut self) {
6104 self.control_handle.shutdown();
6105 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6107 }
6108}
6109
6110impl fdomain_client::fidl::Responder for RouteValidatorRouteResponder {
6111 type ControlHandle = RouteValidatorControlHandle;
6112
6113 fn control_handle(&self) -> &RouteValidatorControlHandle {
6114 &self.control_handle
6115 }
6116
6117 fn drop_without_shutdown(mut self) {
6118 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6120 std::mem::forget(self);
6122 }
6123}
6124
6125impl RouteValidatorRouteResponder {
6126 pub fn send(
6130 self,
6131 mut result: Result<&[RouteReport], RouteValidatorError>,
6132 ) -> Result<(), fidl::Error> {
6133 let _result = self.send_raw(result);
6134 if _result.is_err() {
6135 self.control_handle.shutdown();
6136 }
6137 self.drop_without_shutdown();
6138 _result
6139 }
6140
6141 pub fn send_no_shutdown_on_err(
6143 self,
6144 mut result: Result<&[RouteReport], RouteValidatorError>,
6145 ) -> Result<(), fidl::Error> {
6146 let _result = self.send_raw(result);
6147 self.drop_without_shutdown();
6148 _result
6149 }
6150
6151 fn send_raw(
6152 &self,
6153 mut result: Result<&[RouteReport], RouteValidatorError>,
6154 ) -> Result<(), fidl::Error> {
6155 self.control_handle.inner.send::<fidl::encoding::ResultType<
6156 RouteValidatorRouteResponse,
6157 RouteValidatorError,
6158 >>(
6159 result.map(|reports| (reports,)),
6160 self.tx_id,
6161 0x51c9b268216d8239,
6162 fidl::encoding::DynamicFlags::empty(),
6163 )
6164 }
6165}
6166
6167#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6168pub struct StorageAdminMarker;
6169
6170impl fdomain_client::fidl::ProtocolMarker for StorageAdminMarker {
6171 type Proxy = StorageAdminProxy;
6172 type RequestStream = StorageAdminRequestStream;
6173
6174 const DEBUG_NAME: &'static str = "fuchsia.sys2.StorageAdmin";
6175}
6176impl fdomain_client::fidl::DiscoverableProtocolMarker for StorageAdminMarker {}
6177pub type StorageAdminOpenStorageResult = Result<(), fdomain_fuchsia_component::Error>;
6178pub type StorageAdminListStorageInRealmResult = Result<(), fdomain_fuchsia_component::Error>;
6179pub type StorageAdminOpenComponentStorageByIdResult = Result<(), fdomain_fuchsia_component::Error>;
6180pub type StorageAdminDeleteComponentStorageResult = Result<(), fdomain_fuchsia_component::Error>;
6181pub type StorageAdminGetStatusResult = Result<StorageStatus, StatusError>;
6182pub type StorageAdminDeleteAllStorageContentsResult = Result<(), DeletionError>;
6183
6184pub trait StorageAdminProxyInterface: Send + Sync {
6185 type OpenStorageResponseFut: std::future::Future<Output = Result<StorageAdminOpenStorageResult, fidl::Error>>
6186 + Send;
6187 fn r#open_storage(
6188 &self,
6189 relative_moniker: &str,
6190 object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6191 ) -> Self::OpenStorageResponseFut;
6192 type ListStorageInRealmResponseFut: std::future::Future<Output = Result<StorageAdminListStorageInRealmResult, fidl::Error>>
6193 + Send;
6194 fn r#list_storage_in_realm(
6195 &self,
6196 relative_moniker: &str,
6197 iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
6198 ) -> Self::ListStorageInRealmResponseFut;
6199 type OpenComponentStorageByIdResponseFut: std::future::Future<
6200 Output = Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error>,
6201 > + Send;
6202 fn r#open_component_storage_by_id(
6203 &self,
6204 id: &str,
6205 object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6206 ) -> Self::OpenComponentStorageByIdResponseFut;
6207 type DeleteComponentStorageResponseFut: std::future::Future<Output = Result<StorageAdminDeleteComponentStorageResult, fidl::Error>>
6208 + Send;
6209 fn r#delete_component_storage(
6210 &self,
6211 relative_moniker: &str,
6212 ) -> Self::DeleteComponentStorageResponseFut;
6213 type GetStatusResponseFut: std::future::Future<Output = Result<StorageAdminGetStatusResult, fidl::Error>>
6214 + Send;
6215 fn r#get_status(&self) -> Self::GetStatusResponseFut;
6216 type DeleteAllStorageContentsResponseFut: std::future::Future<
6217 Output = Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error>,
6218 > + Send;
6219 fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut;
6220}
6221
6222#[derive(Debug, Clone)]
6223pub struct StorageAdminProxy {
6224 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6225}
6226
6227impl fdomain_client::fidl::Proxy for StorageAdminProxy {
6228 type Protocol = StorageAdminMarker;
6229
6230 fn from_channel(inner: fdomain_client::Channel) -> Self {
6231 Self::new(inner)
6232 }
6233
6234 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6235 self.client.into_channel().map_err(|client| Self { client })
6236 }
6237
6238 fn as_channel(&self) -> &fdomain_client::Channel {
6239 self.client.as_channel()
6240 }
6241}
6242
6243impl StorageAdminProxy {
6244 pub fn new(channel: fdomain_client::Channel) -> Self {
6246 let protocol_name =
6247 <StorageAdminMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6248 Self { client: fidl::client::Client::new(channel, protocol_name) }
6249 }
6250
6251 pub fn take_event_stream(&self) -> StorageAdminEventStream {
6257 StorageAdminEventStream { event_receiver: self.client.take_event_receiver() }
6258 }
6259
6260 pub fn r#open_storage(
6263 &self,
6264 mut relative_moniker: &str,
6265 mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6266 ) -> fidl::client::QueryResponseFut<
6267 StorageAdminOpenStorageResult,
6268 fdomain_client::fidl::FDomainResourceDialect,
6269 > {
6270 StorageAdminProxyInterface::r#open_storage(self, relative_moniker, object)
6271 }
6272
6273 pub fn r#list_storage_in_realm(
6278 &self,
6279 mut relative_moniker: &str,
6280 mut iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
6281 ) -> fidl::client::QueryResponseFut<
6282 StorageAdminListStorageInRealmResult,
6283 fdomain_client::fidl::FDomainResourceDialect,
6284 > {
6285 StorageAdminProxyInterface::r#list_storage_in_realm(self, relative_moniker, iterator)
6286 }
6287
6288 pub fn r#open_component_storage_by_id(
6291 &self,
6292 mut id: &str,
6293 mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6294 ) -> fidl::client::QueryResponseFut<
6295 StorageAdminOpenComponentStorageByIdResult,
6296 fdomain_client::fidl::FDomainResourceDialect,
6297 > {
6298 StorageAdminProxyInterface::r#open_component_storage_by_id(self, id, object)
6299 }
6300
6301 pub fn r#delete_component_storage(
6305 &self,
6306 mut relative_moniker: &str,
6307 ) -> fidl::client::QueryResponseFut<
6308 StorageAdminDeleteComponentStorageResult,
6309 fdomain_client::fidl::FDomainResourceDialect,
6310 > {
6311 StorageAdminProxyInterface::r#delete_component_storage(self, relative_moniker)
6312 }
6313
6314 pub fn r#get_status(
6316 &self,
6317 ) -> fidl::client::QueryResponseFut<
6318 StorageAdminGetStatusResult,
6319 fdomain_client::fidl::FDomainResourceDialect,
6320 > {
6321 StorageAdminProxyInterface::r#get_status(self)
6322 }
6323
6324 pub fn r#delete_all_storage_contents(
6329 &self,
6330 ) -> fidl::client::QueryResponseFut<
6331 StorageAdminDeleteAllStorageContentsResult,
6332 fdomain_client::fidl::FDomainResourceDialect,
6333 > {
6334 StorageAdminProxyInterface::r#delete_all_storage_contents(self)
6335 }
6336}
6337
6338impl StorageAdminProxyInterface for StorageAdminProxy {
6339 type OpenStorageResponseFut = fidl::client::QueryResponseFut<
6340 StorageAdminOpenStorageResult,
6341 fdomain_client::fidl::FDomainResourceDialect,
6342 >;
6343 fn r#open_storage(
6344 &self,
6345 mut relative_moniker: &str,
6346 mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6347 ) -> Self::OpenStorageResponseFut {
6348 fn _decode(
6349 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6350 ) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
6351 let _response = fidl::client::decode_transaction_body::<
6352 fidl::encoding::ResultType<
6353 fidl::encoding::EmptyStruct,
6354 fdomain_fuchsia_component::Error,
6355 >,
6356 fdomain_client::fidl::FDomainResourceDialect,
6357 0x6ceaa5904cfe4377,
6358 >(_buf?)?;
6359 Ok(_response.map(|x| x))
6360 }
6361 self.client
6362 .send_query_and_decode::<StorageAdminOpenStorageRequest, StorageAdminOpenStorageResult>(
6363 (relative_moniker, object),
6364 0x6ceaa5904cfe4377,
6365 fidl::encoding::DynamicFlags::empty(),
6366 _decode,
6367 )
6368 }
6369
6370 type ListStorageInRealmResponseFut = fidl::client::QueryResponseFut<
6371 StorageAdminListStorageInRealmResult,
6372 fdomain_client::fidl::FDomainResourceDialect,
6373 >;
6374 fn r#list_storage_in_realm(
6375 &self,
6376 mut relative_moniker: &str,
6377 mut iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
6378 ) -> Self::ListStorageInRealmResponseFut {
6379 fn _decode(
6380 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6381 ) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
6382 let _response = fidl::client::decode_transaction_body::<
6383 fidl::encoding::ResultType<
6384 fidl::encoding::EmptyStruct,
6385 fdomain_fuchsia_component::Error,
6386 >,
6387 fdomain_client::fidl::FDomainResourceDialect,
6388 0x764f6d1f083e8bfb,
6389 >(_buf?)?;
6390 Ok(_response.map(|x| x))
6391 }
6392 self.client.send_query_and_decode::<
6393 StorageAdminListStorageInRealmRequest,
6394 StorageAdminListStorageInRealmResult,
6395 >(
6396 (relative_moniker, iterator,),
6397 0x764f6d1f083e8bfb,
6398 fidl::encoding::DynamicFlags::empty(),
6399 _decode,
6400 )
6401 }
6402
6403 type OpenComponentStorageByIdResponseFut = fidl::client::QueryResponseFut<
6404 StorageAdminOpenComponentStorageByIdResult,
6405 fdomain_client::fidl::FDomainResourceDialect,
6406 >;
6407 fn r#open_component_storage_by_id(
6408 &self,
6409 mut id: &str,
6410 mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6411 ) -> Self::OpenComponentStorageByIdResponseFut {
6412 fn _decode(
6413 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6414 ) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
6415 let _response = fidl::client::decode_transaction_body::<
6416 fidl::encoding::ResultType<
6417 fidl::encoding::EmptyStruct,
6418 fdomain_fuchsia_component::Error,
6419 >,
6420 fdomain_client::fidl::FDomainResourceDialect,
6421 0x4802102cc55d5df1,
6422 >(_buf?)?;
6423 Ok(_response.map(|x| x))
6424 }
6425 self.client.send_query_and_decode::<
6426 StorageAdminOpenComponentStorageByIdRequest,
6427 StorageAdminOpenComponentStorageByIdResult,
6428 >(
6429 (id, object,),
6430 0x4802102cc55d5df1,
6431 fidl::encoding::DynamicFlags::empty(),
6432 _decode,
6433 )
6434 }
6435
6436 type DeleteComponentStorageResponseFut = fidl::client::QueryResponseFut<
6437 StorageAdminDeleteComponentStorageResult,
6438 fdomain_client::fidl::FDomainResourceDialect,
6439 >;
6440 fn r#delete_component_storage(
6441 &self,
6442 mut relative_moniker: &str,
6443 ) -> Self::DeleteComponentStorageResponseFut {
6444 fn _decode(
6445 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6446 ) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
6447 let _response = fidl::client::decode_transaction_body::<
6448 fidl::encoding::ResultType<
6449 fidl::encoding::EmptyStruct,
6450 fdomain_fuchsia_component::Error,
6451 >,
6452 fdomain_client::fidl::FDomainResourceDialect,
6453 0x1677c1cdfcdbf45a,
6454 >(_buf?)?;
6455 Ok(_response.map(|x| x))
6456 }
6457 self.client.send_query_and_decode::<
6458 StorageAdminDeleteComponentStorageRequest,
6459 StorageAdminDeleteComponentStorageResult,
6460 >(
6461 (relative_moniker,),
6462 0x1677c1cdfcdbf45a,
6463 fidl::encoding::DynamicFlags::empty(),
6464 _decode,
6465 )
6466 }
6467
6468 type GetStatusResponseFut = fidl::client::QueryResponseFut<
6469 StorageAdminGetStatusResult,
6470 fdomain_client::fidl::FDomainResourceDialect,
6471 >;
6472 fn r#get_status(&self) -> Self::GetStatusResponseFut {
6473 fn _decode(
6474 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6475 ) -> Result<StorageAdminGetStatusResult, fidl::Error> {
6476 let _response = fidl::client::decode_transaction_body::<
6477 fidl::encoding::ResultType<StorageStatus, StatusError>,
6478 fdomain_client::fidl::FDomainResourceDialect,
6479 0x7729e325a6c526c8,
6480 >(_buf?)?;
6481 Ok(_response.map(|x| x))
6482 }
6483 self.client
6484 .send_query_and_decode::<fidl::encoding::EmptyPayload, StorageAdminGetStatusResult>(
6485 (),
6486 0x7729e325a6c526c8,
6487 fidl::encoding::DynamicFlags::empty(),
6488 _decode,
6489 )
6490 }
6491
6492 type DeleteAllStorageContentsResponseFut = fidl::client::QueryResponseFut<
6493 StorageAdminDeleteAllStorageContentsResult,
6494 fdomain_client::fidl::FDomainResourceDialect,
6495 >;
6496 fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut {
6497 fn _decode(
6498 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6499 ) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
6500 let _response = fidl::client::decode_transaction_body::<
6501 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
6502 fdomain_client::fidl::FDomainResourceDialect,
6503 0x2ee980b4b2d24adb,
6504 >(_buf?)?;
6505 Ok(_response.map(|x| x))
6506 }
6507 self.client.send_query_and_decode::<
6508 fidl::encoding::EmptyPayload,
6509 StorageAdminDeleteAllStorageContentsResult,
6510 >(
6511 (),
6512 0x2ee980b4b2d24adb,
6513 fidl::encoding::DynamicFlags::empty(),
6514 _decode,
6515 )
6516 }
6517}
6518
6519pub struct StorageAdminEventStream {
6520 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6521}
6522
6523impl std::marker::Unpin for StorageAdminEventStream {}
6524
6525impl futures::stream::FusedStream for StorageAdminEventStream {
6526 fn is_terminated(&self) -> bool {
6527 self.event_receiver.is_terminated()
6528 }
6529}
6530
6531impl futures::Stream for StorageAdminEventStream {
6532 type Item = Result<StorageAdminEvent, fidl::Error>;
6533
6534 fn poll_next(
6535 mut self: std::pin::Pin<&mut Self>,
6536 cx: &mut std::task::Context<'_>,
6537 ) -> std::task::Poll<Option<Self::Item>> {
6538 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6539 &mut self.event_receiver,
6540 cx
6541 )?) {
6542 Some(buf) => std::task::Poll::Ready(Some(StorageAdminEvent::decode(buf))),
6543 None => std::task::Poll::Ready(None),
6544 }
6545 }
6546}
6547
6548#[derive(Debug)]
6549pub enum StorageAdminEvent {}
6550
6551impl StorageAdminEvent {
6552 fn decode(
6554 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6555 ) -> Result<StorageAdminEvent, fidl::Error> {
6556 let (bytes, _handles) = buf.split_mut();
6557 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6558 debug_assert_eq!(tx_header.tx_id, 0);
6559 match tx_header.ordinal {
6560 _ => Err(fidl::Error::UnknownOrdinal {
6561 ordinal: tx_header.ordinal,
6562 protocol_name:
6563 <StorageAdminMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6564 }),
6565 }
6566 }
6567}
6568
6569pub struct StorageAdminRequestStream {
6571 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6572 is_terminated: bool,
6573}
6574
6575impl std::marker::Unpin for StorageAdminRequestStream {}
6576
6577impl futures::stream::FusedStream for StorageAdminRequestStream {
6578 fn is_terminated(&self) -> bool {
6579 self.is_terminated
6580 }
6581}
6582
6583impl fdomain_client::fidl::RequestStream for StorageAdminRequestStream {
6584 type Protocol = StorageAdminMarker;
6585 type ControlHandle = StorageAdminControlHandle;
6586
6587 fn from_channel(channel: fdomain_client::Channel) -> Self {
6588 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6589 }
6590
6591 fn control_handle(&self) -> Self::ControlHandle {
6592 StorageAdminControlHandle { inner: self.inner.clone() }
6593 }
6594
6595 fn into_inner(
6596 self,
6597 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6598 {
6599 (self.inner, self.is_terminated)
6600 }
6601
6602 fn from_inner(
6603 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6604 is_terminated: bool,
6605 ) -> Self {
6606 Self { inner, is_terminated }
6607 }
6608}
6609
6610impl futures::Stream for StorageAdminRequestStream {
6611 type Item = Result<StorageAdminRequest, fidl::Error>;
6612
6613 fn poll_next(
6614 mut self: std::pin::Pin<&mut Self>,
6615 cx: &mut std::task::Context<'_>,
6616 ) -> std::task::Poll<Option<Self::Item>> {
6617 let this = &mut *self;
6618 if this.inner.check_shutdown(cx) {
6619 this.is_terminated = true;
6620 return std::task::Poll::Ready(None);
6621 }
6622 if this.is_terminated {
6623 panic!("polled StorageAdminRequestStream after completion");
6624 }
6625 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6626 |bytes, handles| {
6627 match this.inner.channel().read_etc(cx, bytes, handles) {
6628 std::task::Poll::Ready(Ok(())) => {}
6629 std::task::Poll::Pending => return std::task::Poll::Pending,
6630 std::task::Poll::Ready(Err(None)) => {
6631 this.is_terminated = true;
6632 return std::task::Poll::Ready(None);
6633 }
6634 std::task::Poll::Ready(Err(Some(e))) => {
6635 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6636 e.into(),
6637 ))));
6638 }
6639 }
6640
6641 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6643
6644 std::task::Poll::Ready(Some(match header.ordinal {
6645 0x6ceaa5904cfe4377 => {
6646 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6647 let mut req = fidl::new_empty!(
6648 StorageAdminOpenStorageRequest,
6649 fdomain_client::fidl::FDomainResourceDialect
6650 );
6651 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminOpenStorageRequest>(&header, _body_bytes, handles, &mut req)?;
6652 let control_handle =
6653 StorageAdminControlHandle { inner: this.inner.clone() };
6654 Ok(StorageAdminRequest::OpenStorage {
6655 relative_moniker: req.relative_moniker,
6656 object: req.object,
6657
6658 responder: StorageAdminOpenStorageResponder {
6659 control_handle: std::mem::ManuallyDrop::new(control_handle),
6660 tx_id: header.tx_id,
6661 },
6662 })
6663 }
6664 0x764f6d1f083e8bfb => {
6665 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6666 let mut req = fidl::new_empty!(
6667 StorageAdminListStorageInRealmRequest,
6668 fdomain_client::fidl::FDomainResourceDialect
6669 );
6670 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminListStorageInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
6671 let control_handle =
6672 StorageAdminControlHandle { inner: this.inner.clone() };
6673 Ok(StorageAdminRequest::ListStorageInRealm {
6674 relative_moniker: req.relative_moniker,
6675 iterator: req.iterator,
6676
6677 responder: StorageAdminListStorageInRealmResponder {
6678 control_handle: std::mem::ManuallyDrop::new(control_handle),
6679 tx_id: header.tx_id,
6680 },
6681 })
6682 }
6683 0x4802102cc55d5df1 => {
6684 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6685 let mut req = fidl::new_empty!(
6686 StorageAdminOpenComponentStorageByIdRequest,
6687 fdomain_client::fidl::FDomainResourceDialect
6688 );
6689 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminOpenComponentStorageByIdRequest>(&header, _body_bytes, handles, &mut req)?;
6690 let control_handle =
6691 StorageAdminControlHandle { inner: this.inner.clone() };
6692 Ok(StorageAdminRequest::OpenComponentStorageById {
6693 id: req.id,
6694 object: req.object,
6695
6696 responder: StorageAdminOpenComponentStorageByIdResponder {
6697 control_handle: std::mem::ManuallyDrop::new(control_handle),
6698 tx_id: header.tx_id,
6699 },
6700 })
6701 }
6702 0x1677c1cdfcdbf45a => {
6703 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6704 let mut req = fidl::new_empty!(
6705 StorageAdminDeleteComponentStorageRequest,
6706 fdomain_client::fidl::FDomainResourceDialect
6707 );
6708 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminDeleteComponentStorageRequest>(&header, _body_bytes, handles, &mut req)?;
6709 let control_handle =
6710 StorageAdminControlHandle { inner: this.inner.clone() };
6711 Ok(StorageAdminRequest::DeleteComponentStorage {
6712 relative_moniker: req.relative_moniker,
6713
6714 responder: StorageAdminDeleteComponentStorageResponder {
6715 control_handle: std::mem::ManuallyDrop::new(control_handle),
6716 tx_id: header.tx_id,
6717 },
6718 })
6719 }
6720 0x7729e325a6c526c8 => {
6721 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6722 let mut req = fidl::new_empty!(
6723 fidl::encoding::EmptyPayload,
6724 fdomain_client::fidl::FDomainResourceDialect
6725 );
6726 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6727 let control_handle =
6728 StorageAdminControlHandle { inner: this.inner.clone() };
6729 Ok(StorageAdminRequest::GetStatus {
6730 responder: StorageAdminGetStatusResponder {
6731 control_handle: std::mem::ManuallyDrop::new(control_handle),
6732 tx_id: header.tx_id,
6733 },
6734 })
6735 }
6736 0x2ee980b4b2d24adb => {
6737 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6738 let mut req = fidl::new_empty!(
6739 fidl::encoding::EmptyPayload,
6740 fdomain_client::fidl::FDomainResourceDialect
6741 );
6742 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6743 let control_handle =
6744 StorageAdminControlHandle { inner: this.inner.clone() };
6745 Ok(StorageAdminRequest::DeleteAllStorageContents {
6746 responder: StorageAdminDeleteAllStorageContentsResponder {
6747 control_handle: std::mem::ManuallyDrop::new(control_handle),
6748 tx_id: header.tx_id,
6749 },
6750 })
6751 }
6752 _ => Err(fidl::Error::UnknownOrdinal {
6753 ordinal: header.ordinal,
6754 protocol_name:
6755 <StorageAdminMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6756 }),
6757 }))
6758 },
6759 )
6760 }
6761}
6762
6763#[derive(Debug)]
6764pub enum StorageAdminRequest {
6765 OpenStorage {
6768 relative_moniker: String,
6769 object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6770 responder: StorageAdminOpenStorageResponder,
6771 },
6772 ListStorageInRealm {
6777 relative_moniker: String,
6778 iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
6779 responder: StorageAdminListStorageInRealmResponder,
6780 },
6781 OpenComponentStorageById {
6784 id: String,
6785 object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6786 responder: StorageAdminOpenComponentStorageByIdResponder,
6787 },
6788 DeleteComponentStorage {
6792 relative_moniker: String,
6793 responder: StorageAdminDeleteComponentStorageResponder,
6794 },
6795 GetStatus { responder: StorageAdminGetStatusResponder },
6797 DeleteAllStorageContents { responder: StorageAdminDeleteAllStorageContentsResponder },
6802}
6803
6804impl StorageAdminRequest {
6805 #[allow(irrefutable_let_patterns)]
6806 pub fn into_open_storage(
6807 self,
6808 ) -> Option<(
6809 String,
6810 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6811 StorageAdminOpenStorageResponder,
6812 )> {
6813 if let StorageAdminRequest::OpenStorage { relative_moniker, object, responder } = self {
6814 Some((relative_moniker, object, responder))
6815 } else {
6816 None
6817 }
6818 }
6819
6820 #[allow(irrefutable_let_patterns)]
6821 pub fn into_list_storage_in_realm(
6822 self,
6823 ) -> Option<(
6824 String,
6825 fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
6826 StorageAdminListStorageInRealmResponder,
6827 )> {
6828 if let StorageAdminRequest::ListStorageInRealm { relative_moniker, iterator, responder } =
6829 self
6830 {
6831 Some((relative_moniker, iterator, responder))
6832 } else {
6833 None
6834 }
6835 }
6836
6837 #[allow(irrefutable_let_patterns)]
6838 pub fn into_open_component_storage_by_id(
6839 self,
6840 ) -> Option<(
6841 String,
6842 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6843 StorageAdminOpenComponentStorageByIdResponder,
6844 )> {
6845 if let StorageAdminRequest::OpenComponentStorageById { id, object, responder } = self {
6846 Some((id, object, responder))
6847 } else {
6848 None
6849 }
6850 }
6851
6852 #[allow(irrefutable_let_patterns)]
6853 pub fn into_delete_component_storage(
6854 self,
6855 ) -> Option<(String, StorageAdminDeleteComponentStorageResponder)> {
6856 if let StorageAdminRequest::DeleteComponentStorage { relative_moniker, responder } = self {
6857 Some((relative_moniker, responder))
6858 } else {
6859 None
6860 }
6861 }
6862
6863 #[allow(irrefutable_let_patterns)]
6864 pub fn into_get_status(self) -> Option<(StorageAdminGetStatusResponder)> {
6865 if let StorageAdminRequest::GetStatus { responder } = self {
6866 Some((responder))
6867 } else {
6868 None
6869 }
6870 }
6871
6872 #[allow(irrefutable_let_patterns)]
6873 pub fn into_delete_all_storage_contents(
6874 self,
6875 ) -> Option<(StorageAdminDeleteAllStorageContentsResponder)> {
6876 if let StorageAdminRequest::DeleteAllStorageContents { responder } = self {
6877 Some((responder))
6878 } else {
6879 None
6880 }
6881 }
6882
6883 pub fn method_name(&self) -> &'static str {
6885 match *self {
6886 StorageAdminRequest::OpenStorage { .. } => "open_storage",
6887 StorageAdminRequest::ListStorageInRealm { .. } => "list_storage_in_realm",
6888 StorageAdminRequest::OpenComponentStorageById { .. } => "open_component_storage_by_id",
6889 StorageAdminRequest::DeleteComponentStorage { .. } => "delete_component_storage",
6890 StorageAdminRequest::GetStatus { .. } => "get_status",
6891 StorageAdminRequest::DeleteAllStorageContents { .. } => "delete_all_storage_contents",
6892 }
6893 }
6894}
6895
6896#[derive(Debug, Clone)]
6897pub struct StorageAdminControlHandle {
6898 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6899}
6900
6901impl StorageAdminControlHandle {
6902 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6903 self.inner.shutdown_with_epitaph(status.into())
6904 }
6905}
6906
6907impl fdomain_client::fidl::ControlHandle for StorageAdminControlHandle {
6908 fn shutdown(&self) {
6909 self.inner.shutdown()
6910 }
6911
6912 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6913 self.inner.shutdown_with_epitaph(status)
6914 }
6915
6916 fn is_closed(&self) -> bool {
6917 self.inner.channel().is_closed()
6918 }
6919 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6920 self.inner.channel().on_closed()
6921 }
6922}
6923
6924impl StorageAdminControlHandle {}
6925
6926#[must_use = "FIDL methods require a response to be sent"]
6927#[derive(Debug)]
6928pub struct StorageAdminOpenStorageResponder {
6929 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
6930 tx_id: u32,
6931}
6932
6933impl std::ops::Drop for StorageAdminOpenStorageResponder {
6937 fn drop(&mut self) {
6938 self.control_handle.shutdown();
6939 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6941 }
6942}
6943
6944impl fdomain_client::fidl::Responder for StorageAdminOpenStorageResponder {
6945 type ControlHandle = StorageAdminControlHandle;
6946
6947 fn control_handle(&self) -> &StorageAdminControlHandle {
6948 &self.control_handle
6949 }
6950
6951 fn drop_without_shutdown(mut self) {
6952 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6954 std::mem::forget(self);
6956 }
6957}
6958
6959impl StorageAdminOpenStorageResponder {
6960 pub fn send(
6964 self,
6965 mut result: Result<(), fdomain_fuchsia_component::Error>,
6966 ) -> Result<(), fidl::Error> {
6967 let _result = self.send_raw(result);
6968 if _result.is_err() {
6969 self.control_handle.shutdown();
6970 }
6971 self.drop_without_shutdown();
6972 _result
6973 }
6974
6975 pub fn send_no_shutdown_on_err(
6977 self,
6978 mut result: Result<(), fdomain_fuchsia_component::Error>,
6979 ) -> Result<(), fidl::Error> {
6980 let _result = self.send_raw(result);
6981 self.drop_without_shutdown();
6982 _result
6983 }
6984
6985 fn send_raw(
6986 &self,
6987 mut result: Result<(), fdomain_fuchsia_component::Error>,
6988 ) -> Result<(), fidl::Error> {
6989 self.control_handle.inner.send::<fidl::encoding::ResultType<
6990 fidl::encoding::EmptyStruct,
6991 fdomain_fuchsia_component::Error,
6992 >>(
6993 result,
6994 self.tx_id,
6995 0x6ceaa5904cfe4377,
6996 fidl::encoding::DynamicFlags::empty(),
6997 )
6998 }
6999}
7000
7001#[must_use = "FIDL methods require a response to be sent"]
7002#[derive(Debug)]
7003pub struct StorageAdminListStorageInRealmResponder {
7004 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7005 tx_id: u32,
7006}
7007
7008impl std::ops::Drop for StorageAdminListStorageInRealmResponder {
7012 fn drop(&mut self) {
7013 self.control_handle.shutdown();
7014 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7016 }
7017}
7018
7019impl fdomain_client::fidl::Responder for StorageAdminListStorageInRealmResponder {
7020 type ControlHandle = StorageAdminControlHandle;
7021
7022 fn control_handle(&self) -> &StorageAdminControlHandle {
7023 &self.control_handle
7024 }
7025
7026 fn drop_without_shutdown(mut self) {
7027 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7029 std::mem::forget(self);
7031 }
7032}
7033
7034impl StorageAdminListStorageInRealmResponder {
7035 pub fn send(
7039 self,
7040 mut result: Result<(), fdomain_fuchsia_component::Error>,
7041 ) -> Result<(), fidl::Error> {
7042 let _result = self.send_raw(result);
7043 if _result.is_err() {
7044 self.control_handle.shutdown();
7045 }
7046 self.drop_without_shutdown();
7047 _result
7048 }
7049
7050 pub fn send_no_shutdown_on_err(
7052 self,
7053 mut result: Result<(), fdomain_fuchsia_component::Error>,
7054 ) -> Result<(), fidl::Error> {
7055 let _result = self.send_raw(result);
7056 self.drop_without_shutdown();
7057 _result
7058 }
7059
7060 fn send_raw(
7061 &self,
7062 mut result: Result<(), fdomain_fuchsia_component::Error>,
7063 ) -> Result<(), fidl::Error> {
7064 self.control_handle.inner.send::<fidl::encoding::ResultType<
7065 fidl::encoding::EmptyStruct,
7066 fdomain_fuchsia_component::Error,
7067 >>(
7068 result,
7069 self.tx_id,
7070 0x764f6d1f083e8bfb,
7071 fidl::encoding::DynamicFlags::empty(),
7072 )
7073 }
7074}
7075
7076#[must_use = "FIDL methods require a response to be sent"]
7077#[derive(Debug)]
7078pub struct StorageAdminOpenComponentStorageByIdResponder {
7079 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7080 tx_id: u32,
7081}
7082
7083impl std::ops::Drop for StorageAdminOpenComponentStorageByIdResponder {
7087 fn drop(&mut self) {
7088 self.control_handle.shutdown();
7089 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7091 }
7092}
7093
7094impl fdomain_client::fidl::Responder for StorageAdminOpenComponentStorageByIdResponder {
7095 type ControlHandle = StorageAdminControlHandle;
7096
7097 fn control_handle(&self) -> &StorageAdminControlHandle {
7098 &self.control_handle
7099 }
7100
7101 fn drop_without_shutdown(mut self) {
7102 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7104 std::mem::forget(self);
7106 }
7107}
7108
7109impl StorageAdminOpenComponentStorageByIdResponder {
7110 pub fn send(
7114 self,
7115 mut result: Result<(), fdomain_fuchsia_component::Error>,
7116 ) -> Result<(), fidl::Error> {
7117 let _result = self.send_raw(result);
7118 if _result.is_err() {
7119 self.control_handle.shutdown();
7120 }
7121 self.drop_without_shutdown();
7122 _result
7123 }
7124
7125 pub fn send_no_shutdown_on_err(
7127 self,
7128 mut result: Result<(), fdomain_fuchsia_component::Error>,
7129 ) -> Result<(), fidl::Error> {
7130 let _result = self.send_raw(result);
7131 self.drop_without_shutdown();
7132 _result
7133 }
7134
7135 fn send_raw(
7136 &self,
7137 mut result: Result<(), fdomain_fuchsia_component::Error>,
7138 ) -> Result<(), fidl::Error> {
7139 self.control_handle.inner.send::<fidl::encoding::ResultType<
7140 fidl::encoding::EmptyStruct,
7141 fdomain_fuchsia_component::Error,
7142 >>(
7143 result,
7144 self.tx_id,
7145 0x4802102cc55d5df1,
7146 fidl::encoding::DynamicFlags::empty(),
7147 )
7148 }
7149}
7150
7151#[must_use = "FIDL methods require a response to be sent"]
7152#[derive(Debug)]
7153pub struct StorageAdminDeleteComponentStorageResponder {
7154 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7155 tx_id: u32,
7156}
7157
7158impl std::ops::Drop for StorageAdminDeleteComponentStorageResponder {
7162 fn drop(&mut self) {
7163 self.control_handle.shutdown();
7164 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7166 }
7167}
7168
7169impl fdomain_client::fidl::Responder for StorageAdminDeleteComponentStorageResponder {
7170 type ControlHandle = StorageAdminControlHandle;
7171
7172 fn control_handle(&self) -> &StorageAdminControlHandle {
7173 &self.control_handle
7174 }
7175
7176 fn drop_without_shutdown(mut self) {
7177 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7179 std::mem::forget(self);
7181 }
7182}
7183
7184impl StorageAdminDeleteComponentStorageResponder {
7185 pub fn send(
7189 self,
7190 mut result: Result<(), fdomain_fuchsia_component::Error>,
7191 ) -> Result<(), fidl::Error> {
7192 let _result = self.send_raw(result);
7193 if _result.is_err() {
7194 self.control_handle.shutdown();
7195 }
7196 self.drop_without_shutdown();
7197 _result
7198 }
7199
7200 pub fn send_no_shutdown_on_err(
7202 self,
7203 mut result: Result<(), fdomain_fuchsia_component::Error>,
7204 ) -> Result<(), fidl::Error> {
7205 let _result = self.send_raw(result);
7206 self.drop_without_shutdown();
7207 _result
7208 }
7209
7210 fn send_raw(
7211 &self,
7212 mut result: Result<(), fdomain_fuchsia_component::Error>,
7213 ) -> Result<(), fidl::Error> {
7214 self.control_handle.inner.send::<fidl::encoding::ResultType<
7215 fidl::encoding::EmptyStruct,
7216 fdomain_fuchsia_component::Error,
7217 >>(
7218 result,
7219 self.tx_id,
7220 0x1677c1cdfcdbf45a,
7221 fidl::encoding::DynamicFlags::empty(),
7222 )
7223 }
7224}
7225
7226#[must_use = "FIDL methods require a response to be sent"]
7227#[derive(Debug)]
7228pub struct StorageAdminGetStatusResponder {
7229 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7230 tx_id: u32,
7231}
7232
7233impl std::ops::Drop for StorageAdminGetStatusResponder {
7237 fn drop(&mut self) {
7238 self.control_handle.shutdown();
7239 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7241 }
7242}
7243
7244impl fdomain_client::fidl::Responder for StorageAdminGetStatusResponder {
7245 type ControlHandle = StorageAdminControlHandle;
7246
7247 fn control_handle(&self) -> &StorageAdminControlHandle {
7248 &self.control_handle
7249 }
7250
7251 fn drop_without_shutdown(mut self) {
7252 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7254 std::mem::forget(self);
7256 }
7257}
7258
7259impl StorageAdminGetStatusResponder {
7260 pub fn send(self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
7264 let _result = self.send_raw(result);
7265 if _result.is_err() {
7266 self.control_handle.shutdown();
7267 }
7268 self.drop_without_shutdown();
7269 _result
7270 }
7271
7272 pub fn send_no_shutdown_on_err(
7274 self,
7275 mut result: Result<&StorageStatus, StatusError>,
7276 ) -> Result<(), fidl::Error> {
7277 let _result = self.send_raw(result);
7278 self.drop_without_shutdown();
7279 _result
7280 }
7281
7282 fn send_raw(&self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
7283 self.control_handle.inner.send::<fidl::encoding::ResultType<StorageStatus, StatusError>>(
7284 result,
7285 self.tx_id,
7286 0x7729e325a6c526c8,
7287 fidl::encoding::DynamicFlags::empty(),
7288 )
7289 }
7290}
7291
7292#[must_use = "FIDL methods require a response to be sent"]
7293#[derive(Debug)]
7294pub struct StorageAdminDeleteAllStorageContentsResponder {
7295 control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7296 tx_id: u32,
7297}
7298
7299impl std::ops::Drop for StorageAdminDeleteAllStorageContentsResponder {
7303 fn drop(&mut self) {
7304 self.control_handle.shutdown();
7305 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7307 }
7308}
7309
7310impl fdomain_client::fidl::Responder for StorageAdminDeleteAllStorageContentsResponder {
7311 type ControlHandle = StorageAdminControlHandle;
7312
7313 fn control_handle(&self) -> &StorageAdminControlHandle {
7314 &self.control_handle
7315 }
7316
7317 fn drop_without_shutdown(mut self) {
7318 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7320 std::mem::forget(self);
7322 }
7323}
7324
7325impl StorageAdminDeleteAllStorageContentsResponder {
7326 pub fn send(self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
7330 let _result = self.send_raw(result);
7331 if _result.is_err() {
7332 self.control_handle.shutdown();
7333 }
7334 self.drop_without_shutdown();
7335 _result
7336 }
7337
7338 pub fn send_no_shutdown_on_err(
7340 self,
7341 mut result: Result<(), DeletionError>,
7342 ) -> Result<(), fidl::Error> {
7343 let _result = self.send_raw(result);
7344 self.drop_without_shutdown();
7345 _result
7346 }
7347
7348 fn send_raw(&self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
7349 self.control_handle.inner.send::<fidl::encoding::ResultType<
7350 fidl::encoding::EmptyStruct,
7351 DeletionError,
7352 >>(
7353 result,
7354 self.tx_id,
7355 0x2ee980b4b2d24adb,
7356 fidl::encoding::DynamicFlags::empty(),
7357 )
7358 }
7359}
7360
7361#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7362pub struct StorageIteratorMarker;
7363
7364impl fdomain_client::fidl::ProtocolMarker for StorageIteratorMarker {
7365 type Proxy = StorageIteratorProxy;
7366 type RequestStream = StorageIteratorRequestStream;
7367
7368 const DEBUG_NAME: &'static str = "(anonymous) StorageIterator";
7369}
7370
7371pub trait StorageIteratorProxyInterface: Send + Sync {
7372 type NextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
7373 fn r#next(&self) -> Self::NextResponseFut;
7374}
7375
7376#[derive(Debug, Clone)]
7377pub struct StorageIteratorProxy {
7378 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7379}
7380
7381impl fdomain_client::fidl::Proxy for StorageIteratorProxy {
7382 type Protocol = StorageIteratorMarker;
7383
7384 fn from_channel(inner: fdomain_client::Channel) -> Self {
7385 Self::new(inner)
7386 }
7387
7388 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7389 self.client.into_channel().map_err(|client| Self { client })
7390 }
7391
7392 fn as_channel(&self) -> &fdomain_client::Channel {
7393 self.client.as_channel()
7394 }
7395}
7396
7397impl StorageIteratorProxy {
7398 pub fn new(channel: fdomain_client::Channel) -> Self {
7400 let protocol_name =
7401 <StorageIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7402 Self { client: fidl::client::Client::new(channel, protocol_name) }
7403 }
7404
7405 pub fn take_event_stream(&self) -> StorageIteratorEventStream {
7411 StorageIteratorEventStream { event_receiver: self.client.take_event_receiver() }
7412 }
7413
7414 pub fn r#next(
7418 &self,
7419 ) -> fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>
7420 {
7421 StorageIteratorProxyInterface::r#next(self)
7422 }
7423}
7424
7425impl StorageIteratorProxyInterface for StorageIteratorProxy {
7426 type NextResponseFut =
7427 fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>;
7428 fn r#next(&self) -> Self::NextResponseFut {
7429 fn _decode(
7430 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7431 ) -> Result<Vec<String>, fidl::Error> {
7432 let _response = fidl::client::decode_transaction_body::<
7433 StorageIteratorNextResponse,
7434 fdomain_client::fidl::FDomainResourceDialect,
7435 0x7a6b21f15fd01b72,
7436 >(_buf?)?;
7437 Ok(_response.relative_monikers)
7438 }
7439 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
7440 (),
7441 0x7a6b21f15fd01b72,
7442 fidl::encoding::DynamicFlags::empty(),
7443 _decode,
7444 )
7445 }
7446}
7447
7448pub struct StorageIteratorEventStream {
7449 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7450}
7451
7452impl std::marker::Unpin for StorageIteratorEventStream {}
7453
7454impl futures::stream::FusedStream for StorageIteratorEventStream {
7455 fn is_terminated(&self) -> bool {
7456 self.event_receiver.is_terminated()
7457 }
7458}
7459
7460impl futures::Stream for StorageIteratorEventStream {
7461 type Item = Result<StorageIteratorEvent, fidl::Error>;
7462
7463 fn poll_next(
7464 mut self: std::pin::Pin<&mut Self>,
7465 cx: &mut std::task::Context<'_>,
7466 ) -> std::task::Poll<Option<Self::Item>> {
7467 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7468 &mut self.event_receiver,
7469 cx
7470 )?) {
7471 Some(buf) => std::task::Poll::Ready(Some(StorageIteratorEvent::decode(buf))),
7472 None => std::task::Poll::Ready(None),
7473 }
7474 }
7475}
7476
7477#[derive(Debug)]
7478pub enum StorageIteratorEvent {}
7479
7480impl StorageIteratorEvent {
7481 fn decode(
7483 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7484 ) -> Result<StorageIteratorEvent, fidl::Error> {
7485 let (bytes, _handles) = buf.split_mut();
7486 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7487 debug_assert_eq!(tx_header.tx_id, 0);
7488 match tx_header.ordinal {
7489 _ => Err(fidl::Error::UnknownOrdinal {
7490 ordinal: tx_header.ordinal,
7491 protocol_name:
7492 <StorageIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7493 }),
7494 }
7495 }
7496}
7497
7498pub struct StorageIteratorRequestStream {
7500 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7501 is_terminated: bool,
7502}
7503
7504impl std::marker::Unpin for StorageIteratorRequestStream {}
7505
7506impl futures::stream::FusedStream for StorageIteratorRequestStream {
7507 fn is_terminated(&self) -> bool {
7508 self.is_terminated
7509 }
7510}
7511
7512impl fdomain_client::fidl::RequestStream for StorageIteratorRequestStream {
7513 type Protocol = StorageIteratorMarker;
7514 type ControlHandle = StorageIteratorControlHandle;
7515
7516 fn from_channel(channel: fdomain_client::Channel) -> Self {
7517 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7518 }
7519
7520 fn control_handle(&self) -> Self::ControlHandle {
7521 StorageIteratorControlHandle { inner: self.inner.clone() }
7522 }
7523
7524 fn into_inner(
7525 self,
7526 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7527 {
7528 (self.inner, self.is_terminated)
7529 }
7530
7531 fn from_inner(
7532 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7533 is_terminated: bool,
7534 ) -> Self {
7535 Self { inner, is_terminated }
7536 }
7537}
7538
7539impl futures::Stream for StorageIteratorRequestStream {
7540 type Item = Result<StorageIteratorRequest, fidl::Error>;
7541
7542 fn poll_next(
7543 mut self: std::pin::Pin<&mut Self>,
7544 cx: &mut std::task::Context<'_>,
7545 ) -> std::task::Poll<Option<Self::Item>> {
7546 let this = &mut *self;
7547 if this.inner.check_shutdown(cx) {
7548 this.is_terminated = true;
7549 return std::task::Poll::Ready(None);
7550 }
7551 if this.is_terminated {
7552 panic!("polled StorageIteratorRequestStream after completion");
7553 }
7554 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7555 |bytes, handles| {
7556 match this.inner.channel().read_etc(cx, bytes, handles) {
7557 std::task::Poll::Ready(Ok(())) => {}
7558 std::task::Poll::Pending => return std::task::Poll::Pending,
7559 std::task::Poll::Ready(Err(None)) => {
7560 this.is_terminated = true;
7561 return std::task::Poll::Ready(None);
7562 }
7563 std::task::Poll::Ready(Err(Some(e))) => {
7564 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7565 e.into(),
7566 ))));
7567 }
7568 }
7569
7570 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7572
7573 std::task::Poll::Ready(Some(match header.ordinal {
7574 0x7a6b21f15fd01b72 => {
7575 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7576 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
7577 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7578 let control_handle = StorageIteratorControlHandle {
7579 inner: this.inner.clone(),
7580 };
7581 Ok(StorageIteratorRequest::Next {
7582 responder: StorageIteratorNextResponder {
7583 control_handle: std::mem::ManuallyDrop::new(control_handle),
7584 tx_id: header.tx_id,
7585 },
7586 })
7587 }
7588 _ => Err(fidl::Error::UnknownOrdinal {
7589 ordinal: header.ordinal,
7590 protocol_name: <StorageIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7591 }),
7592 }))
7593 },
7594 )
7595 }
7596}
7597
7598#[derive(Debug)]
7601pub enum StorageIteratorRequest {
7602 Next { responder: StorageIteratorNextResponder },
7606}
7607
7608impl StorageIteratorRequest {
7609 #[allow(irrefutable_let_patterns)]
7610 pub fn into_next(self) -> Option<(StorageIteratorNextResponder)> {
7611 if let StorageIteratorRequest::Next { responder } = self { Some((responder)) } else { None }
7612 }
7613
7614 pub fn method_name(&self) -> &'static str {
7616 match *self {
7617 StorageIteratorRequest::Next { .. } => "next",
7618 }
7619 }
7620}
7621
7622#[derive(Debug, Clone)]
7623pub struct StorageIteratorControlHandle {
7624 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7625}
7626
7627impl StorageIteratorControlHandle {
7628 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7629 self.inner.shutdown_with_epitaph(status.into())
7630 }
7631}
7632
7633impl fdomain_client::fidl::ControlHandle for StorageIteratorControlHandle {
7634 fn shutdown(&self) {
7635 self.inner.shutdown()
7636 }
7637
7638 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7639 self.inner.shutdown_with_epitaph(status)
7640 }
7641
7642 fn is_closed(&self) -> bool {
7643 self.inner.channel().is_closed()
7644 }
7645 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
7646 self.inner.channel().on_closed()
7647 }
7648}
7649
7650impl StorageIteratorControlHandle {}
7651
7652#[must_use = "FIDL methods require a response to be sent"]
7653#[derive(Debug)]
7654pub struct StorageIteratorNextResponder {
7655 control_handle: std::mem::ManuallyDrop<StorageIteratorControlHandle>,
7656 tx_id: u32,
7657}
7658
7659impl std::ops::Drop for StorageIteratorNextResponder {
7663 fn drop(&mut self) {
7664 self.control_handle.shutdown();
7665 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7667 }
7668}
7669
7670impl fdomain_client::fidl::Responder for StorageIteratorNextResponder {
7671 type ControlHandle = StorageIteratorControlHandle;
7672
7673 fn control_handle(&self) -> &StorageIteratorControlHandle {
7674 &self.control_handle
7675 }
7676
7677 fn drop_without_shutdown(mut self) {
7678 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7680 std::mem::forget(self);
7682 }
7683}
7684
7685impl StorageIteratorNextResponder {
7686 pub fn send(self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
7690 let _result = self.send_raw(relative_monikers);
7691 if _result.is_err() {
7692 self.control_handle.shutdown();
7693 }
7694 self.drop_without_shutdown();
7695 _result
7696 }
7697
7698 pub fn send_no_shutdown_on_err(
7700 self,
7701 mut relative_monikers: &[String],
7702 ) -> Result<(), fidl::Error> {
7703 let _result = self.send_raw(relative_monikers);
7704 self.drop_without_shutdown();
7705 _result
7706 }
7707
7708 fn send_raw(&self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
7709 self.control_handle.inner.send::<StorageIteratorNextResponse>(
7710 (relative_monikers,),
7711 self.tx_id,
7712 0x7a6b21f15fd01b72,
7713 fidl::encoding::DynamicFlags::empty(),
7714 )
7715 }
7716}
7717
7718#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7719pub struct SystemControllerMarker;
7720
7721impl fdomain_client::fidl::ProtocolMarker for SystemControllerMarker {
7722 type Proxy = SystemControllerProxy;
7723 type RequestStream = SystemControllerRequestStream;
7724
7725 const DEBUG_NAME: &'static str = "fuchsia.sys2.SystemController";
7726}
7727impl fdomain_client::fidl::DiscoverableProtocolMarker for SystemControllerMarker {}
7728
7729pub trait SystemControllerProxyInterface: Send + Sync {
7730 type ShutdownResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
7731 fn r#shutdown(&self) -> Self::ShutdownResponseFut;
7732}
7733
7734#[derive(Debug, Clone)]
7735pub struct SystemControllerProxy {
7736 client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
7737}
7738
7739impl fdomain_client::fidl::Proxy for SystemControllerProxy {
7740 type Protocol = SystemControllerMarker;
7741
7742 fn from_channel(inner: fdomain_client::Channel) -> Self {
7743 Self::new(inner)
7744 }
7745
7746 fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
7747 self.client.into_channel().map_err(|client| Self { client })
7748 }
7749
7750 fn as_channel(&self) -> &fdomain_client::Channel {
7751 self.client.as_channel()
7752 }
7753}
7754
7755impl SystemControllerProxy {
7756 pub fn new(channel: fdomain_client::Channel) -> Self {
7758 let protocol_name =
7759 <SystemControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
7760 Self { client: fidl::client::Client::new(channel, protocol_name) }
7761 }
7762
7763 pub fn take_event_stream(&self) -> SystemControllerEventStream {
7769 SystemControllerEventStream { event_receiver: self.client.take_event_receiver() }
7770 }
7771
7772 pub fn r#shutdown(
7776 &self,
7777 ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
7778 SystemControllerProxyInterface::r#shutdown(self)
7779 }
7780}
7781
7782impl SystemControllerProxyInterface for SystemControllerProxy {
7783 type ShutdownResponseFut =
7784 fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
7785 fn r#shutdown(&self) -> Self::ShutdownResponseFut {
7786 fn _decode(
7787 mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7788 ) -> Result<(), fidl::Error> {
7789 let _response = fidl::client::decode_transaction_body::<
7790 fidl::encoding::EmptyPayload,
7791 fdomain_client::fidl::FDomainResourceDialect,
7792 0x25f56c938344e549,
7793 >(_buf?)?;
7794 Ok(_response)
7795 }
7796 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
7797 (),
7798 0x25f56c938344e549,
7799 fidl::encoding::DynamicFlags::empty(),
7800 _decode,
7801 )
7802 }
7803}
7804
7805pub struct SystemControllerEventStream {
7806 event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
7807}
7808
7809impl std::marker::Unpin for SystemControllerEventStream {}
7810
7811impl futures::stream::FusedStream for SystemControllerEventStream {
7812 fn is_terminated(&self) -> bool {
7813 self.event_receiver.is_terminated()
7814 }
7815}
7816
7817impl futures::Stream for SystemControllerEventStream {
7818 type Item = Result<SystemControllerEvent, fidl::Error>;
7819
7820 fn poll_next(
7821 mut self: std::pin::Pin<&mut Self>,
7822 cx: &mut std::task::Context<'_>,
7823 ) -> std::task::Poll<Option<Self::Item>> {
7824 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7825 &mut self.event_receiver,
7826 cx
7827 )?) {
7828 Some(buf) => std::task::Poll::Ready(Some(SystemControllerEvent::decode(buf))),
7829 None => std::task::Poll::Ready(None),
7830 }
7831 }
7832}
7833
7834#[derive(Debug)]
7835pub enum SystemControllerEvent {}
7836
7837impl SystemControllerEvent {
7838 fn decode(
7840 mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7841 ) -> Result<SystemControllerEvent, fidl::Error> {
7842 let (bytes, _handles) = buf.split_mut();
7843 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7844 debug_assert_eq!(tx_header.tx_id, 0);
7845 match tx_header.ordinal {
7846 _ => Err(fidl::Error::UnknownOrdinal {
7847 ordinal: tx_header.ordinal,
7848 protocol_name:
7849 <SystemControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7850 }),
7851 }
7852 }
7853}
7854
7855pub struct SystemControllerRequestStream {
7857 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7858 is_terminated: bool,
7859}
7860
7861impl std::marker::Unpin for SystemControllerRequestStream {}
7862
7863impl futures::stream::FusedStream for SystemControllerRequestStream {
7864 fn is_terminated(&self) -> bool {
7865 self.is_terminated
7866 }
7867}
7868
7869impl fdomain_client::fidl::RequestStream for SystemControllerRequestStream {
7870 type Protocol = SystemControllerMarker;
7871 type ControlHandle = SystemControllerControlHandle;
7872
7873 fn from_channel(channel: fdomain_client::Channel) -> Self {
7874 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7875 }
7876
7877 fn control_handle(&self) -> Self::ControlHandle {
7878 SystemControllerControlHandle { inner: self.inner.clone() }
7879 }
7880
7881 fn into_inner(
7882 self,
7883 ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
7884 {
7885 (self.inner, self.is_terminated)
7886 }
7887
7888 fn from_inner(
7889 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7890 is_terminated: bool,
7891 ) -> Self {
7892 Self { inner, is_terminated }
7893 }
7894}
7895
7896impl futures::Stream for SystemControllerRequestStream {
7897 type Item = Result<SystemControllerRequest, fidl::Error>;
7898
7899 fn poll_next(
7900 mut self: std::pin::Pin<&mut Self>,
7901 cx: &mut std::task::Context<'_>,
7902 ) -> std::task::Poll<Option<Self::Item>> {
7903 let this = &mut *self;
7904 if this.inner.check_shutdown(cx) {
7905 this.is_terminated = true;
7906 return std::task::Poll::Ready(None);
7907 }
7908 if this.is_terminated {
7909 panic!("polled SystemControllerRequestStream after completion");
7910 }
7911 fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7912 |bytes, handles| {
7913 match this.inner.channel().read_etc(cx, bytes, handles) {
7914 std::task::Poll::Ready(Ok(())) => {}
7915 std::task::Poll::Pending => return std::task::Poll::Pending,
7916 std::task::Poll::Ready(Err(None)) => {
7917 this.is_terminated = true;
7918 return std::task::Poll::Ready(None);
7919 }
7920 std::task::Poll::Ready(Err(Some(e))) => {
7921 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7922 e.into(),
7923 ))));
7924 }
7925 }
7926
7927 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7929
7930 std::task::Poll::Ready(Some(match header.ordinal {
7931 0x25f56c938344e549 => {
7932 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7933 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
7934 fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7935 let control_handle = SystemControllerControlHandle {
7936 inner: this.inner.clone(),
7937 };
7938 Ok(SystemControllerRequest::Shutdown {
7939 responder: SystemControllerShutdownResponder {
7940 control_handle: std::mem::ManuallyDrop::new(control_handle),
7941 tx_id: header.tx_id,
7942 },
7943 })
7944 }
7945 _ => Err(fidl::Error::UnknownOrdinal {
7946 ordinal: header.ordinal,
7947 protocol_name: <SystemControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7948 }),
7949 }))
7950 },
7951 )
7952 }
7953}
7954
7955#[derive(Debug)]
7958pub enum SystemControllerRequest {
7959 Shutdown { responder: SystemControllerShutdownResponder },
7963}
7964
7965impl SystemControllerRequest {
7966 #[allow(irrefutable_let_patterns)]
7967 pub fn into_shutdown(self) -> Option<(SystemControllerShutdownResponder)> {
7968 if let SystemControllerRequest::Shutdown { responder } = self {
7969 Some((responder))
7970 } else {
7971 None
7972 }
7973 }
7974
7975 pub fn method_name(&self) -> &'static str {
7977 match *self {
7978 SystemControllerRequest::Shutdown { .. } => "shutdown",
7979 }
7980 }
7981}
7982
7983#[derive(Debug, Clone)]
7984pub struct SystemControllerControlHandle {
7985 inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7986}
7987
7988impl SystemControllerControlHandle {
7989 pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7990 self.inner.shutdown_with_epitaph(status.into())
7991 }
7992}
7993
7994impl fdomain_client::fidl::ControlHandle for SystemControllerControlHandle {
7995 fn shutdown(&self) {
7996 self.inner.shutdown()
7997 }
7998
7999 fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8000 self.inner.shutdown_with_epitaph(status)
8001 }
8002
8003 fn is_closed(&self) -> bool {
8004 self.inner.channel().is_closed()
8005 }
8006 fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
8007 self.inner.channel().on_closed()
8008 }
8009}
8010
8011impl SystemControllerControlHandle {}
8012
8013#[must_use = "FIDL methods require a response to be sent"]
8014#[derive(Debug)]
8015pub struct SystemControllerShutdownResponder {
8016 control_handle: std::mem::ManuallyDrop<SystemControllerControlHandle>,
8017 tx_id: u32,
8018}
8019
8020impl std::ops::Drop for SystemControllerShutdownResponder {
8024 fn drop(&mut self) {
8025 self.control_handle.shutdown();
8026 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8028 }
8029}
8030
8031impl fdomain_client::fidl::Responder for SystemControllerShutdownResponder {
8032 type ControlHandle = SystemControllerControlHandle;
8033
8034 fn control_handle(&self) -> &SystemControllerControlHandle {
8035 &self.control_handle
8036 }
8037
8038 fn drop_without_shutdown(mut self) {
8039 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8041 std::mem::forget(self);
8043 }
8044}
8045
8046impl SystemControllerShutdownResponder {
8047 pub fn send(self) -> Result<(), fidl::Error> {
8051 let _result = self.send_raw();
8052 if _result.is_err() {
8053 self.control_handle.shutdown();
8054 }
8055 self.drop_without_shutdown();
8056 _result
8057 }
8058
8059 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8061 let _result = self.send_raw();
8062 self.drop_without_shutdown();
8063 _result
8064 }
8065
8066 fn send_raw(&self) -> Result<(), fidl::Error> {
8067 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
8068 (),
8069 self.tx_id,
8070 0x25f56c938344e549,
8071 fidl::encoding::DynamicFlags::empty(),
8072 )
8073 }
8074}
8075
8076mod internal {
8077 use super::*;
8078
8079 impl fidl::encoding::ResourceTypeMarker for CrashIntrospectFindComponentByThreadKoidRequest {
8080 type Borrowed<'a> = &'a mut Self;
8081 fn take_or_borrow<'a>(
8082 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8083 ) -> Self::Borrowed<'a> {
8084 value
8085 }
8086 }
8087
8088 unsafe impl fidl::encoding::TypeMarker for CrashIntrospectFindComponentByThreadKoidRequest {
8089 type Owned = Self;
8090
8091 #[inline(always)]
8092 fn inline_align(_context: fidl::encoding::Context) -> usize {
8093 8
8094 }
8095
8096 #[inline(always)]
8097 fn inline_size(_context: fidl::encoding::Context) -> usize {
8098 8
8099 }
8100 #[inline(always)]
8101 fn encode_is_copy() -> bool {
8102 true
8103 }
8104
8105 #[inline(always)]
8106 fn decode_is_copy() -> bool {
8107 true
8108 }
8109 }
8110
8111 unsafe impl
8112 fidl::encoding::Encode<
8113 CrashIntrospectFindComponentByThreadKoidRequest,
8114 fdomain_client::fidl::FDomainResourceDialect,
8115 > for &mut CrashIntrospectFindComponentByThreadKoidRequest
8116 {
8117 #[inline]
8118 unsafe fn encode(
8119 self,
8120 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8121 offset: usize,
8122 _depth: fidl::encoding::Depth,
8123 ) -> fidl::Result<()> {
8124 encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidRequest>(offset);
8125 unsafe {
8126 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8128 (buf_ptr as *mut CrashIntrospectFindComponentByThreadKoidRequest).write_unaligned(
8129 (self as *const CrashIntrospectFindComponentByThreadKoidRequest).read(),
8130 );
8131 }
8134 Ok(())
8135 }
8136 }
8137 unsafe impl<T0: fidl::encoding::Encode<u64, fdomain_client::fidl::FDomainResourceDialect>>
8138 fidl::encoding::Encode<
8139 CrashIntrospectFindComponentByThreadKoidRequest,
8140 fdomain_client::fidl::FDomainResourceDialect,
8141 > for (T0,)
8142 {
8143 #[inline]
8144 unsafe fn encode(
8145 self,
8146 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8147 offset: usize,
8148 depth: fidl::encoding::Depth,
8149 ) -> fidl::Result<()> {
8150 encoder.debug_check_bounds::<CrashIntrospectFindComponentByThreadKoidRequest>(offset);
8151 self.0.encode(encoder, offset + 0, depth)?;
8155 Ok(())
8156 }
8157 }
8158
8159 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8160 for CrashIntrospectFindComponentByThreadKoidRequest
8161 {
8162 #[inline(always)]
8163 fn new_empty() -> Self {
8164 Self {
8165 thread_koid: fidl::new_empty!(u64, fdomain_client::fidl::FDomainResourceDialect),
8166 }
8167 }
8168
8169 #[inline]
8170 unsafe fn decode(
8171 &mut self,
8172 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8173 offset: usize,
8174 _depth: fidl::encoding::Depth,
8175 ) -> fidl::Result<()> {
8176 decoder.debug_check_bounds::<Self>(offset);
8177 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8178 unsafe {
8181 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8182 }
8183 Ok(())
8184 }
8185 }
8186
8187 impl fidl::encoding::ResourceTypeMarker for LifecycleControllerCreateInstanceRequest {
8188 type Borrowed<'a> = &'a mut Self;
8189 fn take_or_borrow<'a>(
8190 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8191 ) -> Self::Borrowed<'a> {
8192 value
8193 }
8194 }
8195
8196 unsafe impl fidl::encoding::TypeMarker for LifecycleControllerCreateInstanceRequest {
8197 type Owned = Self;
8198
8199 #[inline(always)]
8200 fn inline_align(_context: fidl::encoding::Context) -> usize {
8201 8
8202 }
8203
8204 #[inline(always)]
8205 fn inline_size(_context: fidl::encoding::Context) -> usize {
8206 64
8207 }
8208 }
8209
8210 unsafe impl
8211 fidl::encoding::Encode<
8212 LifecycleControllerCreateInstanceRequest,
8213 fdomain_client::fidl::FDomainResourceDialect,
8214 > for &mut LifecycleControllerCreateInstanceRequest
8215 {
8216 #[inline]
8217 unsafe fn encode(
8218 self,
8219 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8220 offset: usize,
8221 _depth: fidl::encoding::Depth,
8222 ) -> fidl::Result<()> {
8223 encoder.debug_check_bounds::<LifecycleControllerCreateInstanceRequest>(offset);
8224 fidl::encoding::Encode::<LifecycleControllerCreateInstanceRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8226 (
8227 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.parent_moniker),
8228 <fdomain_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
8229 <fdomain_fuchsia_component_decl::Child as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
8230 <fdomain_fuchsia_component::CreateChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
8231 ),
8232 encoder, offset, _depth
8233 )
8234 }
8235 }
8236 unsafe impl<
8237 T0: fidl::encoding::Encode<
8238 fidl::encoding::BoundedString<4096>,
8239 fdomain_client::fidl::FDomainResourceDialect,
8240 >,
8241 T1: fidl::encoding::Encode<
8242 fdomain_fuchsia_component_decl::CollectionRef,
8243 fdomain_client::fidl::FDomainResourceDialect,
8244 >,
8245 T2: fidl::encoding::Encode<
8246 fdomain_fuchsia_component_decl::Child,
8247 fdomain_client::fidl::FDomainResourceDialect,
8248 >,
8249 T3: fidl::encoding::Encode<
8250 fdomain_fuchsia_component::CreateChildArgs,
8251 fdomain_client::fidl::FDomainResourceDialect,
8252 >,
8253 >
8254 fidl::encoding::Encode<
8255 LifecycleControllerCreateInstanceRequest,
8256 fdomain_client::fidl::FDomainResourceDialect,
8257 > for (T0, T1, T2, T3)
8258 {
8259 #[inline]
8260 unsafe fn encode(
8261 self,
8262 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8263 offset: usize,
8264 depth: fidl::encoding::Depth,
8265 ) -> fidl::Result<()> {
8266 encoder.debug_check_bounds::<LifecycleControllerCreateInstanceRequest>(offset);
8267 self.0.encode(encoder, offset + 0, depth)?;
8271 self.1.encode(encoder, offset + 16, depth)?;
8272 self.2.encode(encoder, offset + 32, depth)?;
8273 self.3.encode(encoder, offset + 48, depth)?;
8274 Ok(())
8275 }
8276 }
8277
8278 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8279 for LifecycleControllerCreateInstanceRequest
8280 {
8281 #[inline(always)]
8282 fn new_empty() -> Self {
8283 Self {
8284 parent_moniker: fidl::new_empty!(
8285 fidl::encoding::BoundedString<4096>,
8286 fdomain_client::fidl::FDomainResourceDialect
8287 ),
8288 collection: fidl::new_empty!(
8289 fdomain_fuchsia_component_decl::CollectionRef,
8290 fdomain_client::fidl::FDomainResourceDialect
8291 ),
8292 decl: fidl::new_empty!(
8293 fdomain_fuchsia_component_decl::Child,
8294 fdomain_client::fidl::FDomainResourceDialect
8295 ),
8296 args: fidl::new_empty!(
8297 fdomain_fuchsia_component::CreateChildArgs,
8298 fdomain_client::fidl::FDomainResourceDialect
8299 ),
8300 }
8301 }
8302
8303 #[inline]
8304 unsafe fn decode(
8305 &mut self,
8306 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8307 offset: usize,
8308 _depth: fidl::encoding::Depth,
8309 ) -> fidl::Result<()> {
8310 decoder.debug_check_bounds::<Self>(offset);
8311 fidl::decode!(
8313 fidl::encoding::BoundedString<4096>,
8314 fdomain_client::fidl::FDomainResourceDialect,
8315 &mut self.parent_moniker,
8316 decoder,
8317 offset + 0,
8318 _depth
8319 )?;
8320 fidl::decode!(
8321 fdomain_fuchsia_component_decl::CollectionRef,
8322 fdomain_client::fidl::FDomainResourceDialect,
8323 &mut self.collection,
8324 decoder,
8325 offset + 16,
8326 _depth
8327 )?;
8328 fidl::decode!(
8329 fdomain_fuchsia_component_decl::Child,
8330 fdomain_client::fidl::FDomainResourceDialect,
8331 &mut self.decl,
8332 decoder,
8333 offset + 32,
8334 _depth
8335 )?;
8336 fidl::decode!(
8337 fdomain_fuchsia_component::CreateChildArgs,
8338 fdomain_client::fidl::FDomainResourceDialect,
8339 &mut self.args,
8340 decoder,
8341 offset + 48,
8342 _depth
8343 )?;
8344 Ok(())
8345 }
8346 }
8347
8348 impl fidl::encoding::ResourceTypeMarker for LifecycleControllerStartInstanceRequest {
8349 type Borrowed<'a> = &'a mut Self;
8350 fn take_or_borrow<'a>(
8351 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8352 ) -> Self::Borrowed<'a> {
8353 value
8354 }
8355 }
8356
8357 unsafe impl fidl::encoding::TypeMarker for LifecycleControllerStartInstanceRequest {
8358 type Owned = Self;
8359
8360 #[inline(always)]
8361 fn inline_align(_context: fidl::encoding::Context) -> usize {
8362 8
8363 }
8364
8365 #[inline(always)]
8366 fn inline_size(_context: fidl::encoding::Context) -> usize {
8367 24
8368 }
8369 }
8370
8371 unsafe impl
8372 fidl::encoding::Encode<
8373 LifecycleControllerStartInstanceRequest,
8374 fdomain_client::fidl::FDomainResourceDialect,
8375 > for &mut LifecycleControllerStartInstanceRequest
8376 {
8377 #[inline]
8378 unsafe fn encode(
8379 self,
8380 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8381 offset: usize,
8382 _depth: fidl::encoding::Depth,
8383 ) -> fidl::Result<()> {
8384 encoder.debug_check_bounds::<LifecycleControllerStartInstanceRequest>(offset);
8385 fidl::encoding::Encode::<LifecycleControllerStartInstanceRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8387 (
8388 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
8389 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.binder),
8390 ),
8391 encoder, offset, _depth
8392 )
8393 }
8394 }
8395 unsafe impl<
8396 T0: fidl::encoding::Encode<
8397 fidl::encoding::BoundedString<4096>,
8398 fdomain_client::fidl::FDomainResourceDialect,
8399 >,
8400 T1: fidl::encoding::Encode<
8401 fidl::encoding::Endpoint<
8402 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
8403 >,
8404 fdomain_client::fidl::FDomainResourceDialect,
8405 >,
8406 >
8407 fidl::encoding::Encode<
8408 LifecycleControllerStartInstanceRequest,
8409 fdomain_client::fidl::FDomainResourceDialect,
8410 > for (T0, T1)
8411 {
8412 #[inline]
8413 unsafe fn encode(
8414 self,
8415 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8416 offset: usize,
8417 depth: fidl::encoding::Depth,
8418 ) -> fidl::Result<()> {
8419 encoder.debug_check_bounds::<LifecycleControllerStartInstanceRequest>(offset);
8420 unsafe {
8423 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8424 (ptr as *mut u64).write_unaligned(0);
8425 }
8426 self.0.encode(encoder, offset + 0, depth)?;
8428 self.1.encode(encoder, offset + 16, depth)?;
8429 Ok(())
8430 }
8431 }
8432
8433 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8434 for LifecycleControllerStartInstanceRequest
8435 {
8436 #[inline(always)]
8437 fn new_empty() -> Self {
8438 Self {
8439 moniker: fidl::new_empty!(
8440 fidl::encoding::BoundedString<4096>,
8441 fdomain_client::fidl::FDomainResourceDialect
8442 ),
8443 binder: fidl::new_empty!(
8444 fidl::encoding::Endpoint<
8445 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
8446 >,
8447 fdomain_client::fidl::FDomainResourceDialect
8448 ),
8449 }
8450 }
8451
8452 #[inline]
8453 unsafe fn decode(
8454 &mut self,
8455 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8456 offset: usize,
8457 _depth: fidl::encoding::Depth,
8458 ) -> fidl::Result<()> {
8459 decoder.debug_check_bounds::<Self>(offset);
8460 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8462 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8463 let mask = 0xffffffff00000000u64;
8464 let maskedval = padval & mask;
8465 if maskedval != 0 {
8466 return Err(fidl::Error::NonZeroPadding {
8467 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8468 });
8469 }
8470 fidl::decode!(
8471 fidl::encoding::BoundedString<4096>,
8472 fdomain_client::fidl::FDomainResourceDialect,
8473 &mut self.moniker,
8474 decoder,
8475 offset + 0,
8476 _depth
8477 )?;
8478 fidl::decode!(
8479 fidl::encoding::Endpoint<
8480 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
8481 >,
8482 fdomain_client::fidl::FDomainResourceDialect,
8483 &mut self.binder,
8484 decoder,
8485 offset + 16,
8486 _depth
8487 )?;
8488 Ok(())
8489 }
8490 }
8491
8492 impl fidl::encoding::ResourceTypeMarker for LifecycleControllerStartInstanceWithArgsRequest {
8493 type Borrowed<'a> = &'a mut Self;
8494 fn take_or_borrow<'a>(
8495 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8496 ) -> Self::Borrowed<'a> {
8497 value
8498 }
8499 }
8500
8501 unsafe impl fidl::encoding::TypeMarker for LifecycleControllerStartInstanceWithArgsRequest {
8502 type Owned = Self;
8503
8504 #[inline(always)]
8505 fn inline_align(_context: fidl::encoding::Context) -> usize {
8506 8
8507 }
8508
8509 #[inline(always)]
8510 fn inline_size(_context: fidl::encoding::Context) -> usize {
8511 40
8512 }
8513 }
8514
8515 unsafe impl
8516 fidl::encoding::Encode<
8517 LifecycleControllerStartInstanceWithArgsRequest,
8518 fdomain_client::fidl::FDomainResourceDialect,
8519 > for &mut LifecycleControllerStartInstanceWithArgsRequest
8520 {
8521 #[inline]
8522 unsafe fn encode(
8523 self,
8524 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8525 offset: usize,
8526 _depth: fidl::encoding::Depth,
8527 ) -> fidl::Result<()> {
8528 encoder.debug_check_bounds::<LifecycleControllerStartInstanceWithArgsRequest>(offset);
8529 fidl::encoding::Encode::<LifecycleControllerStartInstanceWithArgsRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8531 (
8532 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
8533 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.binder),
8534 <fdomain_fuchsia_component::StartChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
8535 ),
8536 encoder, offset, _depth
8537 )
8538 }
8539 }
8540 unsafe impl<
8541 T0: fidl::encoding::Encode<
8542 fidl::encoding::BoundedString<4096>,
8543 fdomain_client::fidl::FDomainResourceDialect,
8544 >,
8545 T1: fidl::encoding::Encode<
8546 fidl::encoding::Endpoint<
8547 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
8548 >,
8549 fdomain_client::fidl::FDomainResourceDialect,
8550 >,
8551 T2: fidl::encoding::Encode<
8552 fdomain_fuchsia_component::StartChildArgs,
8553 fdomain_client::fidl::FDomainResourceDialect,
8554 >,
8555 >
8556 fidl::encoding::Encode<
8557 LifecycleControllerStartInstanceWithArgsRequest,
8558 fdomain_client::fidl::FDomainResourceDialect,
8559 > for (T0, T1, T2)
8560 {
8561 #[inline]
8562 unsafe fn encode(
8563 self,
8564 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8565 offset: usize,
8566 depth: fidl::encoding::Depth,
8567 ) -> fidl::Result<()> {
8568 encoder.debug_check_bounds::<LifecycleControllerStartInstanceWithArgsRequest>(offset);
8569 unsafe {
8572 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8573 (ptr as *mut u64).write_unaligned(0);
8574 }
8575 self.0.encode(encoder, offset + 0, depth)?;
8577 self.1.encode(encoder, offset + 16, depth)?;
8578 self.2.encode(encoder, offset + 24, depth)?;
8579 Ok(())
8580 }
8581 }
8582
8583 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8584 for LifecycleControllerStartInstanceWithArgsRequest
8585 {
8586 #[inline(always)]
8587 fn new_empty() -> Self {
8588 Self {
8589 moniker: fidl::new_empty!(
8590 fidl::encoding::BoundedString<4096>,
8591 fdomain_client::fidl::FDomainResourceDialect
8592 ),
8593 binder: fidl::new_empty!(
8594 fidl::encoding::Endpoint<
8595 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
8596 >,
8597 fdomain_client::fidl::FDomainResourceDialect
8598 ),
8599 args: fidl::new_empty!(
8600 fdomain_fuchsia_component::StartChildArgs,
8601 fdomain_client::fidl::FDomainResourceDialect
8602 ),
8603 }
8604 }
8605
8606 #[inline]
8607 unsafe fn decode(
8608 &mut self,
8609 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8610 offset: usize,
8611 _depth: fidl::encoding::Depth,
8612 ) -> fidl::Result<()> {
8613 decoder.debug_check_bounds::<Self>(offset);
8614 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8616 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8617 let mask = 0xffffffff00000000u64;
8618 let maskedval = padval & mask;
8619 if maskedval != 0 {
8620 return Err(fidl::Error::NonZeroPadding {
8621 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8622 });
8623 }
8624 fidl::decode!(
8625 fidl::encoding::BoundedString<4096>,
8626 fdomain_client::fidl::FDomainResourceDialect,
8627 &mut self.moniker,
8628 decoder,
8629 offset + 0,
8630 _depth
8631 )?;
8632 fidl::decode!(
8633 fidl::encoding::Endpoint<
8634 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::BinderMarker>,
8635 >,
8636 fdomain_client::fidl::FDomainResourceDialect,
8637 &mut self.binder,
8638 decoder,
8639 offset + 16,
8640 _depth
8641 )?;
8642 fidl::decode!(
8643 fdomain_fuchsia_component::StartChildArgs,
8644 fdomain_client::fidl::FDomainResourceDialect,
8645 &mut self.args,
8646 decoder,
8647 offset + 24,
8648 _depth
8649 )?;
8650 Ok(())
8651 }
8652 }
8653
8654 impl fidl::encoding::ResourceTypeMarker for RealmQueryConnectToStorageAdminRequest {
8655 type Borrowed<'a> = &'a mut Self;
8656 fn take_or_borrow<'a>(
8657 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8658 ) -> Self::Borrowed<'a> {
8659 value
8660 }
8661 }
8662
8663 unsafe impl fidl::encoding::TypeMarker for RealmQueryConnectToStorageAdminRequest {
8664 type Owned = Self;
8665
8666 #[inline(always)]
8667 fn inline_align(_context: fidl::encoding::Context) -> usize {
8668 8
8669 }
8670
8671 #[inline(always)]
8672 fn inline_size(_context: fidl::encoding::Context) -> usize {
8673 40
8674 }
8675 }
8676
8677 unsafe impl
8678 fidl::encoding::Encode<
8679 RealmQueryConnectToStorageAdminRequest,
8680 fdomain_client::fidl::FDomainResourceDialect,
8681 > for &mut RealmQueryConnectToStorageAdminRequest
8682 {
8683 #[inline]
8684 unsafe fn encode(
8685 self,
8686 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8687 offset: usize,
8688 _depth: fidl::encoding::Depth,
8689 ) -> fidl::Result<()> {
8690 encoder.debug_check_bounds::<RealmQueryConnectToStorageAdminRequest>(offset);
8691 fidl::encoding::Encode::<RealmQueryConnectToStorageAdminRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8693 (
8694 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
8695 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(&self.storage_name),
8696 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageAdminMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8697 ),
8698 encoder, offset, _depth
8699 )
8700 }
8701 }
8702 unsafe impl<
8703 T0: fidl::encoding::Encode<
8704 fidl::encoding::BoundedString<4096>,
8705 fdomain_client::fidl::FDomainResourceDialect,
8706 >,
8707 T1: fidl::encoding::Encode<
8708 fidl::encoding::BoundedString<100>,
8709 fdomain_client::fidl::FDomainResourceDialect,
8710 >,
8711 T2: fidl::encoding::Encode<
8712 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageAdminMarker>>,
8713 fdomain_client::fidl::FDomainResourceDialect,
8714 >,
8715 >
8716 fidl::encoding::Encode<
8717 RealmQueryConnectToStorageAdminRequest,
8718 fdomain_client::fidl::FDomainResourceDialect,
8719 > for (T0, T1, T2)
8720 {
8721 #[inline]
8722 unsafe fn encode(
8723 self,
8724 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8725 offset: usize,
8726 depth: fidl::encoding::Depth,
8727 ) -> fidl::Result<()> {
8728 encoder.debug_check_bounds::<RealmQueryConnectToStorageAdminRequest>(offset);
8729 unsafe {
8732 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8733 (ptr as *mut u64).write_unaligned(0);
8734 }
8735 self.0.encode(encoder, offset + 0, depth)?;
8737 self.1.encode(encoder, offset + 16, depth)?;
8738 self.2.encode(encoder, offset + 32, depth)?;
8739 Ok(())
8740 }
8741 }
8742
8743 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8744 for RealmQueryConnectToStorageAdminRequest
8745 {
8746 #[inline(always)]
8747 fn new_empty() -> Self {
8748 Self {
8749 moniker: fidl::new_empty!(
8750 fidl::encoding::BoundedString<4096>,
8751 fdomain_client::fidl::FDomainResourceDialect
8752 ),
8753 storage_name: fidl::new_empty!(
8754 fidl::encoding::BoundedString<100>,
8755 fdomain_client::fidl::FDomainResourceDialect
8756 ),
8757 server_end: fidl::new_empty!(
8758 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageAdminMarker>>,
8759 fdomain_client::fidl::FDomainResourceDialect
8760 ),
8761 }
8762 }
8763
8764 #[inline]
8765 unsafe fn decode(
8766 &mut self,
8767 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8768 offset: usize,
8769 _depth: fidl::encoding::Depth,
8770 ) -> fidl::Result<()> {
8771 decoder.debug_check_bounds::<Self>(offset);
8772 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8774 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8775 let mask = 0xffffffff00000000u64;
8776 let maskedval = padval & mask;
8777 if maskedval != 0 {
8778 return Err(fidl::Error::NonZeroPadding {
8779 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8780 });
8781 }
8782 fidl::decode!(
8783 fidl::encoding::BoundedString<4096>,
8784 fdomain_client::fidl::FDomainResourceDialect,
8785 &mut self.moniker,
8786 decoder,
8787 offset + 0,
8788 _depth
8789 )?;
8790 fidl::decode!(
8791 fidl::encoding::BoundedString<100>,
8792 fdomain_client::fidl::FDomainResourceDialect,
8793 &mut self.storage_name,
8794 decoder,
8795 offset + 16,
8796 _depth
8797 )?;
8798 fidl::decode!(
8799 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageAdminMarker>>,
8800 fdomain_client::fidl::FDomainResourceDialect,
8801 &mut self.server_end,
8802 decoder,
8803 offset + 32,
8804 _depth
8805 )?;
8806 Ok(())
8807 }
8808 }
8809
8810 impl fidl::encoding::ResourceTypeMarker for RealmQueryOpenDirectoryRequest {
8811 type Borrowed<'a> = &'a mut Self;
8812 fn take_or_borrow<'a>(
8813 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8814 ) -> Self::Borrowed<'a> {
8815 value
8816 }
8817 }
8818
8819 unsafe impl fidl::encoding::TypeMarker for RealmQueryOpenDirectoryRequest {
8820 type Owned = Self;
8821
8822 #[inline(always)]
8823 fn inline_align(_context: fidl::encoding::Context) -> usize {
8824 8
8825 }
8826
8827 #[inline(always)]
8828 fn inline_size(_context: fidl::encoding::Context) -> usize {
8829 24
8830 }
8831 }
8832
8833 unsafe impl
8834 fidl::encoding::Encode<
8835 RealmQueryOpenDirectoryRequest,
8836 fdomain_client::fidl::FDomainResourceDialect,
8837 > for &mut RealmQueryOpenDirectoryRequest
8838 {
8839 #[inline]
8840 unsafe fn encode(
8841 self,
8842 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8843 offset: usize,
8844 _depth: fidl::encoding::Depth,
8845 ) -> fidl::Result<()> {
8846 encoder.debug_check_bounds::<RealmQueryOpenDirectoryRequest>(offset);
8847 fidl::encoding::Encode::<RealmQueryOpenDirectoryRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8849 (
8850 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
8851 <OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.dir_type),
8852 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
8853 ),
8854 encoder, offset, _depth
8855 )
8856 }
8857 }
8858 unsafe impl<
8859 T0: fidl::encoding::Encode<
8860 fidl::encoding::BoundedString<4096>,
8861 fdomain_client::fidl::FDomainResourceDialect,
8862 >,
8863 T1: fidl::encoding::Encode<OpenDirType, fdomain_client::fidl::FDomainResourceDialect>,
8864 T2: fidl::encoding::Encode<
8865 fidl::encoding::Endpoint<
8866 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
8867 >,
8868 fdomain_client::fidl::FDomainResourceDialect,
8869 >,
8870 >
8871 fidl::encoding::Encode<
8872 RealmQueryOpenDirectoryRequest,
8873 fdomain_client::fidl::FDomainResourceDialect,
8874 > for (T0, T1, T2)
8875 {
8876 #[inline]
8877 unsafe fn encode(
8878 self,
8879 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8880 offset: usize,
8881 depth: fidl::encoding::Depth,
8882 ) -> fidl::Result<()> {
8883 encoder.debug_check_bounds::<RealmQueryOpenDirectoryRequest>(offset);
8884 self.0.encode(encoder, offset + 0, depth)?;
8888 self.1.encode(encoder, offset + 16, depth)?;
8889 self.2.encode(encoder, offset + 20, depth)?;
8890 Ok(())
8891 }
8892 }
8893
8894 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8895 for RealmQueryOpenDirectoryRequest
8896 {
8897 #[inline(always)]
8898 fn new_empty() -> Self {
8899 Self {
8900 moniker: fidl::new_empty!(
8901 fidl::encoding::BoundedString<4096>,
8902 fdomain_client::fidl::FDomainResourceDialect
8903 ),
8904 dir_type: fidl::new_empty!(
8905 OpenDirType,
8906 fdomain_client::fidl::FDomainResourceDialect
8907 ),
8908 object: fidl::new_empty!(
8909 fidl::encoding::Endpoint<
8910 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
8911 >,
8912 fdomain_client::fidl::FDomainResourceDialect
8913 ),
8914 }
8915 }
8916
8917 #[inline]
8918 unsafe fn decode(
8919 &mut self,
8920 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8921 offset: usize,
8922 _depth: fidl::encoding::Depth,
8923 ) -> fidl::Result<()> {
8924 decoder.debug_check_bounds::<Self>(offset);
8925 fidl::decode!(
8927 fidl::encoding::BoundedString<4096>,
8928 fdomain_client::fidl::FDomainResourceDialect,
8929 &mut self.moniker,
8930 decoder,
8931 offset + 0,
8932 _depth
8933 )?;
8934 fidl::decode!(
8935 OpenDirType,
8936 fdomain_client::fidl::FDomainResourceDialect,
8937 &mut self.dir_type,
8938 decoder,
8939 offset + 16,
8940 _depth
8941 )?;
8942 fidl::decode!(
8943 fidl::encoding::Endpoint<
8944 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
8945 >,
8946 fdomain_client::fidl::FDomainResourceDialect,
8947 &mut self.object,
8948 decoder,
8949 offset + 20,
8950 _depth
8951 )?;
8952 Ok(())
8953 }
8954 }
8955
8956 impl fidl::encoding::ResourceTypeMarker for RealmQueryOpenStorageAdminRequest {
8957 type Borrowed<'a> = &'a mut Self;
8958 fn take_or_borrow<'a>(
8959 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8960 ) -> Self::Borrowed<'a> {
8961 value
8962 }
8963 }
8964
8965 unsafe impl fidl::encoding::TypeMarker for RealmQueryOpenStorageAdminRequest {
8966 type Owned = Self;
8967
8968 #[inline(always)]
8969 fn inline_align(_context: fidl::encoding::Context) -> usize {
8970 8
8971 }
8972
8973 #[inline(always)]
8974 fn inline_size(_context: fidl::encoding::Context) -> usize {
8975 40
8976 }
8977 }
8978
8979 unsafe impl
8980 fidl::encoding::Encode<
8981 RealmQueryOpenStorageAdminRequest,
8982 fdomain_client::fidl::FDomainResourceDialect,
8983 > for &mut RealmQueryOpenStorageAdminRequest
8984 {
8985 #[inline]
8986 unsafe fn encode(
8987 self,
8988 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8989 offset: usize,
8990 _depth: fidl::encoding::Depth,
8991 ) -> fidl::Result<()> {
8992 encoder.debug_check_bounds::<RealmQueryOpenStorageAdminRequest>(offset);
8993 fidl::encoding::Encode::<RealmQueryOpenStorageAdminRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8995 (
8996 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
8997 <fidl::encoding::BoundedString<100> as fidl::encoding::ValueTypeMarker>::borrow(&self.storage_name),
8998 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::StorageAdminMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_end),
8999 ),
9000 encoder, offset, _depth
9001 )
9002 }
9003 }
9004 unsafe impl<
9005 T0: fidl::encoding::Encode<
9006 fidl::encoding::BoundedString<4096>,
9007 fdomain_client::fidl::FDomainResourceDialect,
9008 >,
9009 T1: fidl::encoding::Encode<
9010 fidl::encoding::BoundedString<100>,
9011 fdomain_client::fidl::FDomainResourceDialect,
9012 >,
9013 T2: fidl::encoding::Encode<
9014 fidl::encoding::Endpoint<
9015 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::StorageAdminMarker>,
9016 >,
9017 fdomain_client::fidl::FDomainResourceDialect,
9018 >,
9019 >
9020 fidl::encoding::Encode<
9021 RealmQueryOpenStorageAdminRequest,
9022 fdomain_client::fidl::FDomainResourceDialect,
9023 > for (T0, T1, T2)
9024 {
9025 #[inline]
9026 unsafe fn encode(
9027 self,
9028 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9029 offset: usize,
9030 depth: fidl::encoding::Depth,
9031 ) -> fidl::Result<()> {
9032 encoder.debug_check_bounds::<RealmQueryOpenStorageAdminRequest>(offset);
9033 unsafe {
9036 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
9037 (ptr as *mut u64).write_unaligned(0);
9038 }
9039 self.0.encode(encoder, offset + 0, depth)?;
9041 self.1.encode(encoder, offset + 16, depth)?;
9042 self.2.encode(encoder, offset + 32, depth)?;
9043 Ok(())
9044 }
9045 }
9046
9047 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9048 for RealmQueryOpenStorageAdminRequest
9049 {
9050 #[inline(always)]
9051 fn new_empty() -> Self {
9052 Self {
9053 moniker: fidl::new_empty!(
9054 fidl::encoding::BoundedString<4096>,
9055 fdomain_client::fidl::FDomainResourceDialect
9056 ),
9057 storage_name: fidl::new_empty!(
9058 fidl::encoding::BoundedString<100>,
9059 fdomain_client::fidl::FDomainResourceDialect
9060 ),
9061 server_end: fidl::new_empty!(
9062 fidl::encoding::Endpoint<
9063 fdomain_client::fidl::ServerEnd<
9064 fdomain_fuchsia_component::StorageAdminMarker,
9065 >,
9066 >,
9067 fdomain_client::fidl::FDomainResourceDialect
9068 ),
9069 }
9070 }
9071
9072 #[inline]
9073 unsafe fn decode(
9074 &mut self,
9075 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9076 offset: usize,
9077 _depth: fidl::encoding::Depth,
9078 ) -> fidl::Result<()> {
9079 decoder.debug_check_bounds::<Self>(offset);
9080 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
9082 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9083 let mask = 0xffffffff00000000u64;
9084 let maskedval = padval & mask;
9085 if maskedval != 0 {
9086 return Err(fidl::Error::NonZeroPadding {
9087 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
9088 });
9089 }
9090 fidl::decode!(
9091 fidl::encoding::BoundedString<4096>,
9092 fdomain_client::fidl::FDomainResourceDialect,
9093 &mut self.moniker,
9094 decoder,
9095 offset + 0,
9096 _depth
9097 )?;
9098 fidl::decode!(
9099 fidl::encoding::BoundedString<100>,
9100 fdomain_client::fidl::FDomainResourceDialect,
9101 &mut self.storage_name,
9102 decoder,
9103 offset + 16,
9104 _depth
9105 )?;
9106 fidl::decode!(
9107 fidl::encoding::Endpoint<
9108 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_component::StorageAdminMarker>,
9109 >,
9110 fdomain_client::fidl::FDomainResourceDialect,
9111 &mut self.server_end,
9112 decoder,
9113 offset + 32,
9114 _depth
9115 )?;
9116 Ok(())
9117 }
9118 }
9119
9120 impl fidl::encoding::ResourceTypeMarker for RealmQueryConstructNamespaceResponse {
9121 type Borrowed<'a> = &'a mut Self;
9122 fn take_or_borrow<'a>(
9123 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9124 ) -> Self::Borrowed<'a> {
9125 value
9126 }
9127 }
9128
9129 unsafe impl fidl::encoding::TypeMarker for RealmQueryConstructNamespaceResponse {
9130 type Owned = Self;
9131
9132 #[inline(always)]
9133 fn inline_align(_context: fidl::encoding::Context) -> usize {
9134 8
9135 }
9136
9137 #[inline(always)]
9138 fn inline_size(_context: fidl::encoding::Context) -> usize {
9139 16
9140 }
9141 }
9142
9143 unsafe impl
9144 fidl::encoding::Encode<
9145 RealmQueryConstructNamespaceResponse,
9146 fdomain_client::fidl::FDomainResourceDialect,
9147 > for &mut RealmQueryConstructNamespaceResponse
9148 {
9149 #[inline]
9150 unsafe fn encode(
9151 self,
9152 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9153 offset: usize,
9154 _depth: fidl::encoding::Depth,
9155 ) -> fidl::Result<()> {
9156 encoder.debug_check_bounds::<RealmQueryConstructNamespaceResponse>(offset);
9157 fidl::encoding::Encode::<
9159 RealmQueryConstructNamespaceResponse,
9160 fdomain_client::fidl::FDomainResourceDialect,
9161 >::encode(
9162 (<fidl::encoding::UnboundedVector<
9163 fdomain_fuchsia_component_runner::ComponentNamespaceEntry,
9164 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9165 &mut self.namespace
9166 ),),
9167 encoder,
9168 offset,
9169 _depth,
9170 )
9171 }
9172 }
9173 unsafe impl<
9174 T0: fidl::encoding::Encode<
9175 fidl::encoding::UnboundedVector<
9176 fdomain_fuchsia_component_runner::ComponentNamespaceEntry,
9177 >,
9178 fdomain_client::fidl::FDomainResourceDialect,
9179 >,
9180 >
9181 fidl::encoding::Encode<
9182 RealmQueryConstructNamespaceResponse,
9183 fdomain_client::fidl::FDomainResourceDialect,
9184 > for (T0,)
9185 {
9186 #[inline]
9187 unsafe fn encode(
9188 self,
9189 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9190 offset: usize,
9191 depth: fidl::encoding::Depth,
9192 ) -> fidl::Result<()> {
9193 encoder.debug_check_bounds::<RealmQueryConstructNamespaceResponse>(offset);
9194 self.0.encode(encoder, offset + 0, depth)?;
9198 Ok(())
9199 }
9200 }
9201
9202 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9203 for RealmQueryConstructNamespaceResponse
9204 {
9205 #[inline(always)]
9206 fn new_empty() -> Self {
9207 Self {
9208 namespace: fidl::new_empty!(
9209 fidl::encoding::UnboundedVector<
9210 fdomain_fuchsia_component_runner::ComponentNamespaceEntry,
9211 >,
9212 fdomain_client::fidl::FDomainResourceDialect
9213 ),
9214 }
9215 }
9216
9217 #[inline]
9218 unsafe fn decode(
9219 &mut self,
9220 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9221 offset: usize,
9222 _depth: fidl::encoding::Depth,
9223 ) -> fidl::Result<()> {
9224 decoder.debug_check_bounds::<Self>(offset);
9225 fidl::decode!(
9227 fidl::encoding::UnboundedVector<
9228 fdomain_fuchsia_component_runner::ComponentNamespaceEntry,
9229 >,
9230 fdomain_client::fidl::FDomainResourceDialect,
9231 &mut self.namespace,
9232 decoder,
9233 offset + 0,
9234 _depth
9235 )?;
9236 Ok(())
9237 }
9238 }
9239
9240 impl fidl::encoding::ResourceTypeMarker for RealmQueryGetAllInstancesResponse {
9241 type Borrowed<'a> = &'a mut Self;
9242 fn take_or_borrow<'a>(
9243 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9244 ) -> Self::Borrowed<'a> {
9245 value
9246 }
9247 }
9248
9249 unsafe impl fidl::encoding::TypeMarker for RealmQueryGetAllInstancesResponse {
9250 type Owned = Self;
9251
9252 #[inline(always)]
9253 fn inline_align(_context: fidl::encoding::Context) -> usize {
9254 4
9255 }
9256
9257 #[inline(always)]
9258 fn inline_size(_context: fidl::encoding::Context) -> usize {
9259 4
9260 }
9261 }
9262
9263 unsafe impl
9264 fidl::encoding::Encode<
9265 RealmQueryGetAllInstancesResponse,
9266 fdomain_client::fidl::FDomainResourceDialect,
9267 > for &mut RealmQueryGetAllInstancesResponse
9268 {
9269 #[inline]
9270 unsafe fn encode(
9271 self,
9272 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9273 offset: usize,
9274 _depth: fidl::encoding::Depth,
9275 ) -> fidl::Result<()> {
9276 encoder.debug_check_bounds::<RealmQueryGetAllInstancesResponse>(offset);
9277 fidl::encoding::Encode::<
9279 RealmQueryGetAllInstancesResponse,
9280 fdomain_client::fidl::FDomainResourceDialect,
9281 >::encode(
9282 (
9283 <fidl::encoding::Endpoint<
9284 fdomain_client::fidl::ClientEnd<InstanceIteratorMarker>,
9285 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9286 &mut self.iterator
9287 ),
9288 ),
9289 encoder,
9290 offset,
9291 _depth,
9292 )
9293 }
9294 }
9295 unsafe impl<
9296 T0: fidl::encoding::Encode<
9297 fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<InstanceIteratorMarker>>,
9298 fdomain_client::fidl::FDomainResourceDialect,
9299 >,
9300 >
9301 fidl::encoding::Encode<
9302 RealmQueryGetAllInstancesResponse,
9303 fdomain_client::fidl::FDomainResourceDialect,
9304 > for (T0,)
9305 {
9306 #[inline]
9307 unsafe fn encode(
9308 self,
9309 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9310 offset: usize,
9311 depth: fidl::encoding::Depth,
9312 ) -> fidl::Result<()> {
9313 encoder.debug_check_bounds::<RealmQueryGetAllInstancesResponse>(offset);
9314 self.0.encode(encoder, offset + 0, depth)?;
9318 Ok(())
9319 }
9320 }
9321
9322 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9323 for RealmQueryGetAllInstancesResponse
9324 {
9325 #[inline(always)]
9326 fn new_empty() -> Self {
9327 Self {
9328 iterator: fidl::new_empty!(
9329 fidl::encoding::Endpoint<
9330 fdomain_client::fidl::ClientEnd<InstanceIteratorMarker>,
9331 >,
9332 fdomain_client::fidl::FDomainResourceDialect
9333 ),
9334 }
9335 }
9336
9337 #[inline]
9338 unsafe fn decode(
9339 &mut self,
9340 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9341 offset: usize,
9342 _depth: fidl::encoding::Depth,
9343 ) -> fidl::Result<()> {
9344 decoder.debug_check_bounds::<Self>(offset);
9345 fidl::decode!(
9347 fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<InstanceIteratorMarker>>,
9348 fdomain_client::fidl::FDomainResourceDialect,
9349 &mut self.iterator,
9350 decoder,
9351 offset + 0,
9352 _depth
9353 )?;
9354 Ok(())
9355 }
9356 }
9357
9358 impl fidl::encoding::ResourceTypeMarker for RealmQueryGetResolvedDeclarationResponse {
9359 type Borrowed<'a> = &'a mut Self;
9360 fn take_or_borrow<'a>(
9361 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9362 ) -> Self::Borrowed<'a> {
9363 value
9364 }
9365 }
9366
9367 unsafe impl fidl::encoding::TypeMarker for RealmQueryGetResolvedDeclarationResponse {
9368 type Owned = Self;
9369
9370 #[inline(always)]
9371 fn inline_align(_context: fidl::encoding::Context) -> usize {
9372 4
9373 }
9374
9375 #[inline(always)]
9376 fn inline_size(_context: fidl::encoding::Context) -> usize {
9377 4
9378 }
9379 }
9380
9381 unsafe impl
9382 fidl::encoding::Encode<
9383 RealmQueryGetResolvedDeclarationResponse,
9384 fdomain_client::fidl::FDomainResourceDialect,
9385 > for &mut RealmQueryGetResolvedDeclarationResponse
9386 {
9387 #[inline]
9388 unsafe fn encode(
9389 self,
9390 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9391 offset: usize,
9392 _depth: fidl::encoding::Depth,
9393 ) -> fidl::Result<()> {
9394 encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationResponse>(offset);
9395 fidl::encoding::Encode::<
9397 RealmQueryGetResolvedDeclarationResponse,
9398 fdomain_client::fidl::FDomainResourceDialect,
9399 >::encode(
9400 (<fidl::encoding::Endpoint<
9401 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
9402 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9403 &mut self.iterator
9404 ),),
9405 encoder,
9406 offset,
9407 _depth,
9408 )
9409 }
9410 }
9411 unsafe impl<
9412 T0: fidl::encoding::Encode<
9413 fidl::encoding::Endpoint<
9414 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
9415 >,
9416 fdomain_client::fidl::FDomainResourceDialect,
9417 >,
9418 >
9419 fidl::encoding::Encode<
9420 RealmQueryGetResolvedDeclarationResponse,
9421 fdomain_client::fidl::FDomainResourceDialect,
9422 > for (T0,)
9423 {
9424 #[inline]
9425 unsafe fn encode(
9426 self,
9427 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9428 offset: usize,
9429 depth: fidl::encoding::Depth,
9430 ) -> fidl::Result<()> {
9431 encoder.debug_check_bounds::<RealmQueryGetResolvedDeclarationResponse>(offset);
9432 self.0.encode(encoder, offset + 0, depth)?;
9436 Ok(())
9437 }
9438 }
9439
9440 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9441 for RealmQueryGetResolvedDeclarationResponse
9442 {
9443 #[inline(always)]
9444 fn new_empty() -> Self {
9445 Self {
9446 iterator: fidl::new_empty!(
9447 fidl::encoding::Endpoint<
9448 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
9449 >,
9450 fdomain_client::fidl::FDomainResourceDialect
9451 ),
9452 }
9453 }
9454
9455 #[inline]
9456 unsafe fn decode(
9457 &mut self,
9458 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9459 offset: usize,
9460 _depth: fidl::encoding::Depth,
9461 ) -> fidl::Result<()> {
9462 decoder.debug_check_bounds::<Self>(offset);
9463 fidl::decode!(
9465 fidl::encoding::Endpoint<
9466 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
9467 >,
9468 fdomain_client::fidl::FDomainResourceDialect,
9469 &mut self.iterator,
9470 decoder,
9471 offset + 0,
9472 _depth
9473 )?;
9474 Ok(())
9475 }
9476 }
9477
9478 impl fidl::encoding::ResourceTypeMarker for RealmQueryResolveDeclarationResponse {
9479 type Borrowed<'a> = &'a mut Self;
9480 fn take_or_borrow<'a>(
9481 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9482 ) -> Self::Borrowed<'a> {
9483 value
9484 }
9485 }
9486
9487 unsafe impl fidl::encoding::TypeMarker for RealmQueryResolveDeclarationResponse {
9488 type Owned = Self;
9489
9490 #[inline(always)]
9491 fn inline_align(_context: fidl::encoding::Context) -> usize {
9492 4
9493 }
9494
9495 #[inline(always)]
9496 fn inline_size(_context: fidl::encoding::Context) -> usize {
9497 4
9498 }
9499 }
9500
9501 unsafe impl
9502 fidl::encoding::Encode<
9503 RealmQueryResolveDeclarationResponse,
9504 fdomain_client::fidl::FDomainResourceDialect,
9505 > for &mut RealmQueryResolveDeclarationResponse
9506 {
9507 #[inline]
9508 unsafe fn encode(
9509 self,
9510 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9511 offset: usize,
9512 _depth: fidl::encoding::Depth,
9513 ) -> fidl::Result<()> {
9514 encoder.debug_check_bounds::<RealmQueryResolveDeclarationResponse>(offset);
9515 fidl::encoding::Encode::<
9517 RealmQueryResolveDeclarationResponse,
9518 fdomain_client::fidl::FDomainResourceDialect,
9519 >::encode(
9520 (<fidl::encoding::Endpoint<
9521 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
9522 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9523 &mut self.iterator
9524 ),),
9525 encoder,
9526 offset,
9527 _depth,
9528 )
9529 }
9530 }
9531 unsafe impl<
9532 T0: fidl::encoding::Encode<
9533 fidl::encoding::Endpoint<
9534 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
9535 >,
9536 fdomain_client::fidl::FDomainResourceDialect,
9537 >,
9538 >
9539 fidl::encoding::Encode<
9540 RealmQueryResolveDeclarationResponse,
9541 fdomain_client::fidl::FDomainResourceDialect,
9542 > for (T0,)
9543 {
9544 #[inline]
9545 unsafe fn encode(
9546 self,
9547 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9548 offset: usize,
9549 depth: fidl::encoding::Depth,
9550 ) -> fidl::Result<()> {
9551 encoder.debug_check_bounds::<RealmQueryResolveDeclarationResponse>(offset);
9552 self.0.encode(encoder, offset + 0, depth)?;
9556 Ok(())
9557 }
9558 }
9559
9560 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9561 for RealmQueryResolveDeclarationResponse
9562 {
9563 #[inline(always)]
9564 fn new_empty() -> Self {
9565 Self {
9566 iterator: fidl::new_empty!(
9567 fidl::encoding::Endpoint<
9568 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
9569 >,
9570 fdomain_client::fidl::FDomainResourceDialect
9571 ),
9572 }
9573 }
9574
9575 #[inline]
9576 unsafe fn decode(
9577 &mut self,
9578 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9579 offset: usize,
9580 _depth: fidl::encoding::Depth,
9581 ) -> fidl::Result<()> {
9582 decoder.debug_check_bounds::<Self>(offset);
9583 fidl::decode!(
9585 fidl::encoding::Endpoint<
9586 fdomain_client::fidl::ClientEnd<ManifestBytesIteratorMarker>,
9587 >,
9588 fdomain_client::fidl::FDomainResourceDialect,
9589 &mut self.iterator,
9590 decoder,
9591 offset + 0,
9592 _depth
9593 )?;
9594 Ok(())
9595 }
9596 }
9597
9598 impl fidl::encoding::ResourceTypeMarker for StorageAdminListStorageInRealmRequest {
9599 type Borrowed<'a> = &'a mut Self;
9600 fn take_or_borrow<'a>(
9601 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9602 ) -> Self::Borrowed<'a> {
9603 value
9604 }
9605 }
9606
9607 unsafe impl fidl::encoding::TypeMarker for StorageAdminListStorageInRealmRequest {
9608 type Owned = Self;
9609
9610 #[inline(always)]
9611 fn inline_align(_context: fidl::encoding::Context) -> usize {
9612 8
9613 }
9614
9615 #[inline(always)]
9616 fn inline_size(_context: fidl::encoding::Context) -> usize {
9617 24
9618 }
9619 }
9620
9621 unsafe impl
9622 fidl::encoding::Encode<
9623 StorageAdminListStorageInRealmRequest,
9624 fdomain_client::fidl::FDomainResourceDialect,
9625 > for &mut StorageAdminListStorageInRealmRequest
9626 {
9627 #[inline]
9628 unsafe fn encode(
9629 self,
9630 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9631 offset: usize,
9632 _depth: fidl::encoding::Depth,
9633 ) -> fidl::Result<()> {
9634 encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
9635 fidl::encoding::Encode::<StorageAdminListStorageInRealmRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9637 (
9638 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
9639 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
9640 ),
9641 encoder, offset, _depth
9642 )
9643 }
9644 }
9645 unsafe impl<
9646 T0: fidl::encoding::Encode<
9647 fidl::encoding::BoundedString<4096>,
9648 fdomain_client::fidl::FDomainResourceDialect,
9649 >,
9650 T1: fidl::encoding::Encode<
9651 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageIteratorMarker>>,
9652 fdomain_client::fidl::FDomainResourceDialect,
9653 >,
9654 >
9655 fidl::encoding::Encode<
9656 StorageAdminListStorageInRealmRequest,
9657 fdomain_client::fidl::FDomainResourceDialect,
9658 > for (T0, T1)
9659 {
9660 #[inline]
9661 unsafe fn encode(
9662 self,
9663 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9664 offset: usize,
9665 depth: fidl::encoding::Depth,
9666 ) -> fidl::Result<()> {
9667 encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
9668 unsafe {
9671 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9672 (ptr as *mut u64).write_unaligned(0);
9673 }
9674 self.0.encode(encoder, offset + 0, depth)?;
9676 self.1.encode(encoder, offset + 16, depth)?;
9677 Ok(())
9678 }
9679 }
9680
9681 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9682 for StorageAdminListStorageInRealmRequest
9683 {
9684 #[inline(always)]
9685 fn new_empty() -> Self {
9686 Self {
9687 relative_moniker: fidl::new_empty!(
9688 fidl::encoding::BoundedString<4096>,
9689 fdomain_client::fidl::FDomainResourceDialect
9690 ),
9691 iterator: fidl::new_empty!(
9692 fidl::encoding::Endpoint<
9693 fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
9694 >,
9695 fdomain_client::fidl::FDomainResourceDialect
9696 ),
9697 }
9698 }
9699
9700 #[inline]
9701 unsafe fn decode(
9702 &mut self,
9703 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9704 offset: usize,
9705 _depth: fidl::encoding::Depth,
9706 ) -> fidl::Result<()> {
9707 decoder.debug_check_bounds::<Self>(offset);
9708 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9710 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9711 let mask = 0xffffffff00000000u64;
9712 let maskedval = padval & mask;
9713 if maskedval != 0 {
9714 return Err(fidl::Error::NonZeroPadding {
9715 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9716 });
9717 }
9718 fidl::decode!(
9719 fidl::encoding::BoundedString<4096>,
9720 fdomain_client::fidl::FDomainResourceDialect,
9721 &mut self.relative_moniker,
9722 decoder,
9723 offset + 0,
9724 _depth
9725 )?;
9726 fidl::decode!(
9727 fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageIteratorMarker>>,
9728 fdomain_client::fidl::FDomainResourceDialect,
9729 &mut self.iterator,
9730 decoder,
9731 offset + 16,
9732 _depth
9733 )?;
9734 Ok(())
9735 }
9736 }
9737
9738 impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenComponentStorageByIdRequest {
9739 type Borrowed<'a> = &'a mut Self;
9740 fn take_or_borrow<'a>(
9741 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9742 ) -> Self::Borrowed<'a> {
9743 value
9744 }
9745 }
9746
9747 unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenComponentStorageByIdRequest {
9748 type Owned = Self;
9749
9750 #[inline(always)]
9751 fn inline_align(_context: fidl::encoding::Context) -> usize {
9752 8
9753 }
9754
9755 #[inline(always)]
9756 fn inline_size(_context: fidl::encoding::Context) -> usize {
9757 24
9758 }
9759 }
9760
9761 unsafe impl
9762 fidl::encoding::Encode<
9763 StorageAdminOpenComponentStorageByIdRequest,
9764 fdomain_client::fidl::FDomainResourceDialect,
9765 > for &mut StorageAdminOpenComponentStorageByIdRequest
9766 {
9767 #[inline]
9768 unsafe fn encode(
9769 self,
9770 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9771 offset: usize,
9772 _depth: fidl::encoding::Depth,
9773 ) -> fidl::Result<()> {
9774 encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
9775 fidl::encoding::Encode::<
9777 StorageAdminOpenComponentStorageByIdRequest,
9778 fdomain_client::fidl::FDomainResourceDialect,
9779 >::encode(
9780 (
9781 <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
9782 &self.id,
9783 ),
9784 <fidl::encoding::Endpoint<
9785 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
9786 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9787 &mut self.object
9788 ),
9789 ),
9790 encoder,
9791 offset,
9792 _depth,
9793 )
9794 }
9795 }
9796 unsafe impl<
9797 T0: fidl::encoding::Encode<
9798 fidl::encoding::BoundedString<64>,
9799 fdomain_client::fidl::FDomainResourceDialect,
9800 >,
9801 T1: fidl::encoding::Encode<
9802 fidl::encoding::Endpoint<
9803 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
9804 >,
9805 fdomain_client::fidl::FDomainResourceDialect,
9806 >,
9807 >
9808 fidl::encoding::Encode<
9809 StorageAdminOpenComponentStorageByIdRequest,
9810 fdomain_client::fidl::FDomainResourceDialect,
9811 > for (T0, T1)
9812 {
9813 #[inline]
9814 unsafe fn encode(
9815 self,
9816 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9817 offset: usize,
9818 depth: fidl::encoding::Depth,
9819 ) -> fidl::Result<()> {
9820 encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
9821 unsafe {
9824 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9825 (ptr as *mut u64).write_unaligned(0);
9826 }
9827 self.0.encode(encoder, offset + 0, depth)?;
9829 self.1.encode(encoder, offset + 16, depth)?;
9830 Ok(())
9831 }
9832 }
9833
9834 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9835 for StorageAdminOpenComponentStorageByIdRequest
9836 {
9837 #[inline(always)]
9838 fn new_empty() -> Self {
9839 Self {
9840 id: fidl::new_empty!(
9841 fidl::encoding::BoundedString<64>,
9842 fdomain_client::fidl::FDomainResourceDialect
9843 ),
9844 object: fidl::new_empty!(
9845 fidl::encoding::Endpoint<
9846 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
9847 >,
9848 fdomain_client::fidl::FDomainResourceDialect
9849 ),
9850 }
9851 }
9852
9853 #[inline]
9854 unsafe fn decode(
9855 &mut self,
9856 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9857 offset: usize,
9858 _depth: fidl::encoding::Depth,
9859 ) -> fidl::Result<()> {
9860 decoder.debug_check_bounds::<Self>(offset);
9861 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9863 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9864 let mask = 0xffffffff00000000u64;
9865 let maskedval = padval & mask;
9866 if maskedval != 0 {
9867 return Err(fidl::Error::NonZeroPadding {
9868 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9869 });
9870 }
9871 fidl::decode!(
9872 fidl::encoding::BoundedString<64>,
9873 fdomain_client::fidl::FDomainResourceDialect,
9874 &mut self.id,
9875 decoder,
9876 offset + 0,
9877 _depth
9878 )?;
9879 fidl::decode!(
9880 fidl::encoding::Endpoint<
9881 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
9882 >,
9883 fdomain_client::fidl::FDomainResourceDialect,
9884 &mut self.object,
9885 decoder,
9886 offset + 16,
9887 _depth
9888 )?;
9889 Ok(())
9890 }
9891 }
9892
9893 impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenStorageRequest {
9894 type Borrowed<'a> = &'a mut Self;
9895 fn take_or_borrow<'a>(
9896 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9897 ) -> Self::Borrowed<'a> {
9898 value
9899 }
9900 }
9901
9902 unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenStorageRequest {
9903 type Owned = Self;
9904
9905 #[inline(always)]
9906 fn inline_align(_context: fidl::encoding::Context) -> usize {
9907 8
9908 }
9909
9910 #[inline(always)]
9911 fn inline_size(_context: fidl::encoding::Context) -> usize {
9912 24
9913 }
9914 }
9915
9916 unsafe impl
9917 fidl::encoding::Encode<
9918 StorageAdminOpenStorageRequest,
9919 fdomain_client::fidl::FDomainResourceDialect,
9920 > for &mut StorageAdminOpenStorageRequest
9921 {
9922 #[inline]
9923 unsafe fn encode(
9924 self,
9925 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9926 offset: usize,
9927 _depth: fidl::encoding::Depth,
9928 ) -> fidl::Result<()> {
9929 encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
9930 fidl::encoding::Encode::<StorageAdminOpenStorageRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9932 (
9933 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
9934 <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
9935 ),
9936 encoder, offset, _depth
9937 )
9938 }
9939 }
9940 unsafe impl<
9941 T0: fidl::encoding::Encode<
9942 fidl::encoding::BoundedString<4096>,
9943 fdomain_client::fidl::FDomainResourceDialect,
9944 >,
9945 T1: fidl::encoding::Encode<
9946 fidl::encoding::Endpoint<
9947 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
9948 >,
9949 fdomain_client::fidl::FDomainResourceDialect,
9950 >,
9951 >
9952 fidl::encoding::Encode<
9953 StorageAdminOpenStorageRequest,
9954 fdomain_client::fidl::FDomainResourceDialect,
9955 > for (T0, T1)
9956 {
9957 #[inline]
9958 unsafe fn encode(
9959 self,
9960 encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9961 offset: usize,
9962 depth: fidl::encoding::Depth,
9963 ) -> fidl::Result<()> {
9964 encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
9965 unsafe {
9968 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9969 (ptr as *mut u64).write_unaligned(0);
9970 }
9971 self.0.encode(encoder, offset + 0, depth)?;
9973 self.1.encode(encoder, offset + 16, depth)?;
9974 Ok(())
9975 }
9976 }
9977
9978 impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9979 for StorageAdminOpenStorageRequest
9980 {
9981 #[inline(always)]
9982 fn new_empty() -> Self {
9983 Self {
9984 relative_moniker: fidl::new_empty!(
9985 fidl::encoding::BoundedString<4096>,
9986 fdomain_client::fidl::FDomainResourceDialect
9987 ),
9988 object: fidl::new_empty!(
9989 fidl::encoding::Endpoint<
9990 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
9991 >,
9992 fdomain_client::fidl::FDomainResourceDialect
9993 ),
9994 }
9995 }
9996
9997 #[inline]
9998 unsafe fn decode(
9999 &mut self,
10000 decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10001 offset: usize,
10002 _depth: fidl::encoding::Depth,
10003 ) -> fidl::Result<()> {
10004 decoder.debug_check_bounds::<Self>(offset);
10005 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10007 let padval = unsafe { (ptr as *const u64).read_unaligned() };
10008 let mask = 0xffffffff00000000u64;
10009 let maskedval = padval & mask;
10010 if maskedval != 0 {
10011 return Err(fidl::Error::NonZeroPadding {
10012 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10013 });
10014 }
10015 fidl::decode!(
10016 fidl::encoding::BoundedString<4096>,
10017 fdomain_client::fidl::FDomainResourceDialect,
10018 &mut self.relative_moniker,
10019 decoder,
10020 offset + 0,
10021 _depth
10022 )?;
10023 fidl::decode!(
10024 fidl::encoding::Endpoint<
10025 fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
10026 >,
10027 fdomain_client::fidl::FDomainResourceDialect,
10028 &mut self.object,
10029 decoder,
10030 offset + 16,
10031 _depth
10032 )?;
10033 Ok(())
10034 }
10035 }
10036}