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