1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_boot_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
16pub struct BootfsFileVmo {
17 pub offset: u32,
19 pub contents: fidl::Vmo,
21}
22
23impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BootfsFileVmo {}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct FactoryItemsGetResponse {
27 pub payload: Option<fidl::Vmo>,
28 pub length: u32,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for FactoryItemsGetResponse {}
32
33#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34pub struct ItemsGetBootloaderFileResponse {
35 pub payload: Option<fidl::Vmo>,
36}
37
38impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
39 for ItemsGetBootloaderFileResponse
40{
41}
42
43#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
44pub struct ItemsGetResponse {
45 pub payload: Option<fidl::Vmo>,
46 pub length: u32,
47}
48
49impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ItemsGetResponse {}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
52pub struct ItemsGet2Response {
53 pub retrieved_items: Vec<RetrievedItems>,
54}
55
56impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ItemsGet2Response {}
57
58#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
59pub struct ReadOnlyLogGetResponse {
60 pub log: fidl::DebugLog,
61}
62
63impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ReadOnlyLogGetResponse {}
64
65#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
66pub struct RetrievedItems {
67 pub payload: fidl::Vmo,
68 pub length: u32,
69 pub extra: u32,
70}
71
72impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RetrievedItems {}
73
74#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
75pub struct SvcStashProviderGetResponse {
76 pub resource: fidl::endpoints::ServerEnd<SvcStashMarker>,
77}
78
79impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
80 for SvcStashProviderGetResponse
81{
82}
83
84#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85pub struct SvcStashStoreRequest {
86 pub svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
87}
88
89impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SvcStashStoreRequest {}
90
91#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
92pub struct UserbootPostBootfsFilesRequest {
93 pub files: Vec<BootfsFileVmo>,
94}
95
96impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
97 for UserbootPostBootfsFilesRequest
98{
99}
100
101#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
102pub struct UserbootPostStashSvcRequest {
103 pub stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
104}
105
106impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
107 for UserbootPostStashSvcRequest
108{
109}
110
111#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
112pub struct WriteOnlyLogGetResponse {
113 pub log: fidl::DebugLog,
114}
115
116impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for WriteOnlyLogGetResponse {}
117
118#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
119pub struct ArgumentsMarker;
120
121impl fidl::endpoints::ProtocolMarker for ArgumentsMarker {
122 type Proxy = ArgumentsProxy;
123 type RequestStream = ArgumentsRequestStream;
124 #[cfg(target_os = "fuchsia")]
125 type SynchronousProxy = ArgumentsSynchronousProxy;
126
127 const DEBUG_NAME: &'static str = "fuchsia.boot.Arguments";
128}
129impl fidl::endpoints::DiscoverableProtocolMarker for ArgumentsMarker {}
130
131pub trait ArgumentsProxyInterface: Send + Sync {
132 type GetStringResponseFut: std::future::Future<Output = Result<Option<String>, fidl::Error>>
133 + Send;
134 fn r#get_string(&self, key: &str) -> Self::GetStringResponseFut;
135 type GetStringsResponseFut: std::future::Future<Output = Result<Vec<Option<String>>, fidl::Error>>
136 + Send;
137 fn r#get_strings(&self, keys: &[String]) -> Self::GetStringsResponseFut;
138 type GetBoolResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
139 fn r#get_bool(&self, key: &str, defaultval: bool) -> Self::GetBoolResponseFut;
140 type GetBoolsResponseFut: std::future::Future<Output = Result<Vec<bool>, fidl::Error>> + Send;
141 fn r#get_bools(&self, keys: &[BoolPair]) -> Self::GetBoolsResponseFut;
142 type CollectResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
143 fn r#collect(&self, prefix: &str) -> Self::CollectResponseFut;
144}
145#[derive(Debug)]
146#[cfg(target_os = "fuchsia")]
147pub struct ArgumentsSynchronousProxy {
148 client: fidl::client::sync::Client,
149}
150
151#[cfg(target_os = "fuchsia")]
152impl fidl::endpoints::SynchronousProxy for ArgumentsSynchronousProxy {
153 type Proxy = ArgumentsProxy;
154 type Protocol = ArgumentsMarker;
155
156 fn from_channel(inner: fidl::Channel) -> Self {
157 Self::new(inner)
158 }
159
160 fn into_channel(self) -> fidl::Channel {
161 self.client.into_channel()
162 }
163
164 fn as_channel(&self) -> &fidl::Channel {
165 self.client.as_channel()
166 }
167}
168
169#[cfg(target_os = "fuchsia")]
170impl ArgumentsSynchronousProxy {
171 pub fn new(channel: fidl::Channel) -> Self {
172 let protocol_name = <ArgumentsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
173 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
174 }
175
176 pub fn into_channel(self) -> fidl::Channel {
177 self.client.into_channel()
178 }
179
180 pub fn wait_for_event(
183 &self,
184 deadline: zx::MonotonicInstant,
185 ) -> Result<ArgumentsEvent, fidl::Error> {
186 ArgumentsEvent::decode(self.client.wait_for_event(deadline)?)
187 }
188
189 pub fn r#get_string(
191 &self,
192 mut key: &str,
193 ___deadline: zx::MonotonicInstant,
194 ) -> Result<Option<String>, fidl::Error> {
195 let _response =
196 self.client.send_query::<ArgumentsGetStringRequest, ArgumentsGetStringResponse>(
197 (key,),
198 0x426c026d966f8fe,
199 fidl::encoding::DynamicFlags::empty(),
200 ___deadline,
201 )?;
202 Ok(_response.value)
203 }
204
205 pub fn r#get_strings(
207 &self,
208 mut keys: &[String],
209 ___deadline: zx::MonotonicInstant,
210 ) -> Result<Vec<Option<String>>, fidl::Error> {
211 let _response =
212 self.client.send_query::<ArgumentsGetStringsRequest, ArgumentsGetStringsResponse>(
213 (keys,),
214 0x328fb6b545aa96f7,
215 fidl::encoding::DynamicFlags::empty(),
216 ___deadline,
217 )?;
218 Ok(_response.values)
219 }
220
221 pub fn r#get_bool(
227 &self,
228 mut key: &str,
229 mut defaultval: bool,
230 ___deadline: zx::MonotonicInstant,
231 ) -> Result<bool, fidl::Error> {
232 let _response =
233 self.client.send_query::<ArgumentsGetBoolRequest, ArgumentsGetBoolResponse>(
234 (key, defaultval),
235 0x4c5dd3149815cccd,
236 fidl::encoding::DynamicFlags::empty(),
237 ___deadline,
238 )?;
239 Ok(_response.value)
240 }
241
242 pub fn r#get_bools(
245 &self,
246 mut keys: &[BoolPair],
247 ___deadline: zx::MonotonicInstant,
248 ) -> Result<Vec<bool>, fidl::Error> {
249 let _response =
250 self.client.send_query::<ArgumentsGetBoolsRequest, ArgumentsGetBoolsResponse>(
251 (keys,),
252 0xfcc9fc9a0f22615,
253 fidl::encoding::DynamicFlags::empty(),
254 ___deadline,
255 )?;
256 Ok(_response.values)
257 }
258
259 pub fn r#collect(
263 &self,
264 mut prefix: &str,
265 ___deadline: zx::MonotonicInstant,
266 ) -> Result<Vec<String>, fidl::Error> {
267 let _response =
268 self.client.send_query::<ArgumentsCollectRequest, ArgumentsCollectResponse>(
269 (prefix,),
270 0x24e5acd864546e30,
271 fidl::encoding::DynamicFlags::empty(),
272 ___deadline,
273 )?;
274 Ok(_response.results)
275 }
276}
277
278#[cfg(target_os = "fuchsia")]
279impl From<ArgumentsSynchronousProxy> for zx::Handle {
280 fn from(value: ArgumentsSynchronousProxy) -> Self {
281 value.into_channel().into()
282 }
283}
284
285#[cfg(target_os = "fuchsia")]
286impl From<fidl::Channel> for ArgumentsSynchronousProxy {
287 fn from(value: fidl::Channel) -> Self {
288 Self::new(value)
289 }
290}
291
292#[derive(Debug, Clone)]
293pub struct ArgumentsProxy {
294 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
295}
296
297impl fidl::endpoints::Proxy for ArgumentsProxy {
298 type Protocol = ArgumentsMarker;
299
300 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
301 Self::new(inner)
302 }
303
304 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
305 self.client.into_channel().map_err(|client| Self { client })
306 }
307
308 fn as_channel(&self) -> &::fidl::AsyncChannel {
309 self.client.as_channel()
310 }
311}
312
313impl ArgumentsProxy {
314 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
316 let protocol_name = <ArgumentsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
317 Self { client: fidl::client::Client::new(channel, protocol_name) }
318 }
319
320 pub fn take_event_stream(&self) -> ArgumentsEventStream {
326 ArgumentsEventStream { event_receiver: self.client.take_event_receiver() }
327 }
328
329 pub fn r#get_string(
331 &self,
332 mut key: &str,
333 ) -> fidl::client::QueryResponseFut<Option<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
334 {
335 ArgumentsProxyInterface::r#get_string(self, key)
336 }
337
338 pub fn r#get_strings(
340 &self,
341 mut keys: &[String],
342 ) -> fidl::client::QueryResponseFut<
343 Vec<Option<String>>,
344 fidl::encoding::DefaultFuchsiaResourceDialect,
345 > {
346 ArgumentsProxyInterface::r#get_strings(self, keys)
347 }
348
349 pub fn r#get_bool(
355 &self,
356 mut key: &str,
357 mut defaultval: bool,
358 ) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
359 ArgumentsProxyInterface::r#get_bool(self, key, defaultval)
360 }
361
362 pub fn r#get_bools(
365 &self,
366 mut keys: &[BoolPair],
367 ) -> fidl::client::QueryResponseFut<Vec<bool>, fidl::encoding::DefaultFuchsiaResourceDialect>
368 {
369 ArgumentsProxyInterface::r#get_bools(self, keys)
370 }
371
372 pub fn r#collect(
376 &self,
377 mut prefix: &str,
378 ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
379 {
380 ArgumentsProxyInterface::r#collect(self, prefix)
381 }
382}
383
384impl ArgumentsProxyInterface for ArgumentsProxy {
385 type GetStringResponseFut = fidl::client::QueryResponseFut<
386 Option<String>,
387 fidl::encoding::DefaultFuchsiaResourceDialect,
388 >;
389 fn r#get_string(&self, mut key: &str) -> Self::GetStringResponseFut {
390 fn _decode(
391 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
392 ) -> Result<Option<String>, fidl::Error> {
393 let _response = fidl::client::decode_transaction_body::<
394 ArgumentsGetStringResponse,
395 fidl::encoding::DefaultFuchsiaResourceDialect,
396 0x426c026d966f8fe,
397 >(_buf?)?;
398 Ok(_response.value)
399 }
400 self.client.send_query_and_decode::<ArgumentsGetStringRequest, Option<String>>(
401 (key,),
402 0x426c026d966f8fe,
403 fidl::encoding::DynamicFlags::empty(),
404 _decode,
405 )
406 }
407
408 type GetStringsResponseFut = fidl::client::QueryResponseFut<
409 Vec<Option<String>>,
410 fidl::encoding::DefaultFuchsiaResourceDialect,
411 >;
412 fn r#get_strings(&self, mut keys: &[String]) -> Self::GetStringsResponseFut {
413 fn _decode(
414 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
415 ) -> Result<Vec<Option<String>>, fidl::Error> {
416 let _response = fidl::client::decode_transaction_body::<
417 ArgumentsGetStringsResponse,
418 fidl::encoding::DefaultFuchsiaResourceDialect,
419 0x328fb6b545aa96f7,
420 >(_buf?)?;
421 Ok(_response.values)
422 }
423 self.client.send_query_and_decode::<ArgumentsGetStringsRequest, Vec<Option<String>>>(
424 (keys,),
425 0x328fb6b545aa96f7,
426 fidl::encoding::DynamicFlags::empty(),
427 _decode,
428 )
429 }
430
431 type GetBoolResponseFut =
432 fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
433 fn r#get_bool(&self, mut key: &str, mut defaultval: bool) -> Self::GetBoolResponseFut {
434 fn _decode(
435 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
436 ) -> Result<bool, fidl::Error> {
437 let _response = fidl::client::decode_transaction_body::<
438 ArgumentsGetBoolResponse,
439 fidl::encoding::DefaultFuchsiaResourceDialect,
440 0x4c5dd3149815cccd,
441 >(_buf?)?;
442 Ok(_response.value)
443 }
444 self.client.send_query_and_decode::<ArgumentsGetBoolRequest, bool>(
445 (key, defaultval),
446 0x4c5dd3149815cccd,
447 fidl::encoding::DynamicFlags::empty(),
448 _decode,
449 )
450 }
451
452 type GetBoolsResponseFut =
453 fidl::client::QueryResponseFut<Vec<bool>, fidl::encoding::DefaultFuchsiaResourceDialect>;
454 fn r#get_bools(&self, mut keys: &[BoolPair]) -> Self::GetBoolsResponseFut {
455 fn _decode(
456 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
457 ) -> Result<Vec<bool>, fidl::Error> {
458 let _response = fidl::client::decode_transaction_body::<
459 ArgumentsGetBoolsResponse,
460 fidl::encoding::DefaultFuchsiaResourceDialect,
461 0xfcc9fc9a0f22615,
462 >(_buf?)?;
463 Ok(_response.values)
464 }
465 self.client.send_query_and_decode::<ArgumentsGetBoolsRequest, Vec<bool>>(
466 (keys,),
467 0xfcc9fc9a0f22615,
468 fidl::encoding::DynamicFlags::empty(),
469 _decode,
470 )
471 }
472
473 type CollectResponseFut =
474 fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
475 fn r#collect(&self, mut prefix: &str) -> Self::CollectResponseFut {
476 fn _decode(
477 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
478 ) -> Result<Vec<String>, fidl::Error> {
479 let _response = fidl::client::decode_transaction_body::<
480 ArgumentsCollectResponse,
481 fidl::encoding::DefaultFuchsiaResourceDialect,
482 0x24e5acd864546e30,
483 >(_buf?)?;
484 Ok(_response.results)
485 }
486 self.client.send_query_and_decode::<ArgumentsCollectRequest, Vec<String>>(
487 (prefix,),
488 0x24e5acd864546e30,
489 fidl::encoding::DynamicFlags::empty(),
490 _decode,
491 )
492 }
493}
494
495pub struct ArgumentsEventStream {
496 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
497}
498
499impl std::marker::Unpin for ArgumentsEventStream {}
500
501impl futures::stream::FusedStream for ArgumentsEventStream {
502 fn is_terminated(&self) -> bool {
503 self.event_receiver.is_terminated()
504 }
505}
506
507impl futures::Stream for ArgumentsEventStream {
508 type Item = Result<ArgumentsEvent, fidl::Error>;
509
510 fn poll_next(
511 mut self: std::pin::Pin<&mut Self>,
512 cx: &mut std::task::Context<'_>,
513 ) -> std::task::Poll<Option<Self::Item>> {
514 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
515 &mut self.event_receiver,
516 cx
517 )?) {
518 Some(buf) => std::task::Poll::Ready(Some(ArgumentsEvent::decode(buf))),
519 None => std::task::Poll::Ready(None),
520 }
521 }
522}
523
524#[derive(Debug)]
525pub enum ArgumentsEvent {}
526
527impl ArgumentsEvent {
528 fn decode(
530 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
531 ) -> Result<ArgumentsEvent, fidl::Error> {
532 let (bytes, _handles) = buf.split_mut();
533 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
534 debug_assert_eq!(tx_header.tx_id, 0);
535 match tx_header.ordinal {
536 _ => Err(fidl::Error::UnknownOrdinal {
537 ordinal: tx_header.ordinal,
538 protocol_name: <ArgumentsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
539 }),
540 }
541 }
542}
543
544pub struct ArgumentsRequestStream {
546 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
547 is_terminated: bool,
548}
549
550impl std::marker::Unpin for ArgumentsRequestStream {}
551
552impl futures::stream::FusedStream for ArgumentsRequestStream {
553 fn is_terminated(&self) -> bool {
554 self.is_terminated
555 }
556}
557
558impl fidl::endpoints::RequestStream for ArgumentsRequestStream {
559 type Protocol = ArgumentsMarker;
560 type ControlHandle = ArgumentsControlHandle;
561
562 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
563 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
564 }
565
566 fn control_handle(&self) -> Self::ControlHandle {
567 ArgumentsControlHandle { inner: self.inner.clone() }
568 }
569
570 fn into_inner(
571 self,
572 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
573 {
574 (self.inner, self.is_terminated)
575 }
576
577 fn from_inner(
578 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
579 is_terminated: bool,
580 ) -> Self {
581 Self { inner, is_terminated }
582 }
583}
584
585impl futures::Stream for ArgumentsRequestStream {
586 type Item = Result<ArgumentsRequest, fidl::Error>;
587
588 fn poll_next(
589 mut self: std::pin::Pin<&mut Self>,
590 cx: &mut std::task::Context<'_>,
591 ) -> std::task::Poll<Option<Self::Item>> {
592 let this = &mut *self;
593 if this.inner.check_shutdown(cx) {
594 this.is_terminated = true;
595 return std::task::Poll::Ready(None);
596 }
597 if this.is_terminated {
598 panic!("polled ArgumentsRequestStream after completion");
599 }
600 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
601 |bytes, handles| {
602 match this.inner.channel().read_etc(cx, bytes, handles) {
603 std::task::Poll::Ready(Ok(())) => {}
604 std::task::Poll::Pending => return std::task::Poll::Pending,
605 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
606 this.is_terminated = true;
607 return std::task::Poll::Ready(None);
608 }
609 std::task::Poll::Ready(Err(e)) => {
610 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
611 e.into(),
612 ))))
613 }
614 }
615
616 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
618
619 std::task::Poll::Ready(Some(match header.ordinal {
620 0x426c026d966f8fe => {
621 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
622 let mut req = fidl::new_empty!(
623 ArgumentsGetStringRequest,
624 fidl::encoding::DefaultFuchsiaResourceDialect
625 );
626 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsGetStringRequest>(&header, _body_bytes, handles, &mut req)?;
627 let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
628 Ok(ArgumentsRequest::GetString {
629 key: req.key,
630
631 responder: ArgumentsGetStringResponder {
632 control_handle: std::mem::ManuallyDrop::new(control_handle),
633 tx_id: header.tx_id,
634 },
635 })
636 }
637 0x328fb6b545aa96f7 => {
638 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
639 let mut req = fidl::new_empty!(
640 ArgumentsGetStringsRequest,
641 fidl::encoding::DefaultFuchsiaResourceDialect
642 );
643 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsGetStringsRequest>(&header, _body_bytes, handles, &mut req)?;
644 let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
645 Ok(ArgumentsRequest::GetStrings {
646 keys: req.keys,
647
648 responder: ArgumentsGetStringsResponder {
649 control_handle: std::mem::ManuallyDrop::new(control_handle),
650 tx_id: header.tx_id,
651 },
652 })
653 }
654 0x4c5dd3149815cccd => {
655 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
656 let mut req = fidl::new_empty!(
657 ArgumentsGetBoolRequest,
658 fidl::encoding::DefaultFuchsiaResourceDialect
659 );
660 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsGetBoolRequest>(&header, _body_bytes, handles, &mut req)?;
661 let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
662 Ok(ArgumentsRequest::GetBool {
663 key: req.key,
664 defaultval: req.defaultval,
665
666 responder: ArgumentsGetBoolResponder {
667 control_handle: std::mem::ManuallyDrop::new(control_handle),
668 tx_id: header.tx_id,
669 },
670 })
671 }
672 0xfcc9fc9a0f22615 => {
673 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
674 let mut req = fidl::new_empty!(
675 ArgumentsGetBoolsRequest,
676 fidl::encoding::DefaultFuchsiaResourceDialect
677 );
678 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsGetBoolsRequest>(&header, _body_bytes, handles, &mut req)?;
679 let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
680 Ok(ArgumentsRequest::GetBools {
681 keys: req.keys,
682
683 responder: ArgumentsGetBoolsResponder {
684 control_handle: std::mem::ManuallyDrop::new(control_handle),
685 tx_id: header.tx_id,
686 },
687 })
688 }
689 0x24e5acd864546e30 => {
690 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
691 let mut req = fidl::new_empty!(
692 ArgumentsCollectRequest,
693 fidl::encoding::DefaultFuchsiaResourceDialect
694 );
695 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ArgumentsCollectRequest>(&header, _body_bytes, handles, &mut req)?;
696 let control_handle = ArgumentsControlHandle { inner: this.inner.clone() };
697 Ok(ArgumentsRequest::Collect {
698 prefix: req.prefix,
699
700 responder: ArgumentsCollectResponder {
701 control_handle: std::mem::ManuallyDrop::new(control_handle),
702 tx_id: header.tx_id,
703 },
704 })
705 }
706 _ => Err(fidl::Error::UnknownOrdinal {
707 ordinal: header.ordinal,
708 protocol_name:
709 <ArgumentsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
710 }),
711 }))
712 },
713 )
714 }
715}
716
717#[derive(Debug)]
719pub enum ArgumentsRequest {
720 GetString { key: String, responder: ArgumentsGetStringResponder },
722 GetStrings { keys: Vec<String>, responder: ArgumentsGetStringsResponder },
724 GetBool { key: String, defaultval: bool, responder: ArgumentsGetBoolResponder },
730 GetBools { keys: Vec<BoolPair>, responder: ArgumentsGetBoolsResponder },
733 Collect { prefix: String, responder: ArgumentsCollectResponder },
737}
738
739impl ArgumentsRequest {
740 #[allow(irrefutable_let_patterns)]
741 pub fn into_get_string(self) -> Option<(String, ArgumentsGetStringResponder)> {
742 if let ArgumentsRequest::GetString { key, responder } = self {
743 Some((key, responder))
744 } else {
745 None
746 }
747 }
748
749 #[allow(irrefutable_let_patterns)]
750 pub fn into_get_strings(self) -> Option<(Vec<String>, ArgumentsGetStringsResponder)> {
751 if let ArgumentsRequest::GetStrings { keys, responder } = self {
752 Some((keys, responder))
753 } else {
754 None
755 }
756 }
757
758 #[allow(irrefutable_let_patterns)]
759 pub fn into_get_bool(self) -> Option<(String, bool, ArgumentsGetBoolResponder)> {
760 if let ArgumentsRequest::GetBool { key, defaultval, responder } = self {
761 Some((key, defaultval, responder))
762 } else {
763 None
764 }
765 }
766
767 #[allow(irrefutable_let_patterns)]
768 pub fn into_get_bools(self) -> Option<(Vec<BoolPair>, ArgumentsGetBoolsResponder)> {
769 if let ArgumentsRequest::GetBools { keys, responder } = self {
770 Some((keys, responder))
771 } else {
772 None
773 }
774 }
775
776 #[allow(irrefutable_let_patterns)]
777 pub fn into_collect(self) -> Option<(String, ArgumentsCollectResponder)> {
778 if let ArgumentsRequest::Collect { prefix, responder } = self {
779 Some((prefix, responder))
780 } else {
781 None
782 }
783 }
784
785 pub fn method_name(&self) -> &'static str {
787 match *self {
788 ArgumentsRequest::GetString { .. } => "get_string",
789 ArgumentsRequest::GetStrings { .. } => "get_strings",
790 ArgumentsRequest::GetBool { .. } => "get_bool",
791 ArgumentsRequest::GetBools { .. } => "get_bools",
792 ArgumentsRequest::Collect { .. } => "collect",
793 }
794 }
795}
796
797#[derive(Debug, Clone)]
798pub struct ArgumentsControlHandle {
799 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
800}
801
802impl fidl::endpoints::ControlHandle for ArgumentsControlHandle {
803 fn shutdown(&self) {
804 self.inner.shutdown()
805 }
806 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
807 self.inner.shutdown_with_epitaph(status)
808 }
809
810 fn is_closed(&self) -> bool {
811 self.inner.channel().is_closed()
812 }
813 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
814 self.inner.channel().on_closed()
815 }
816
817 #[cfg(target_os = "fuchsia")]
818 fn signal_peer(
819 &self,
820 clear_mask: zx::Signals,
821 set_mask: zx::Signals,
822 ) -> Result<(), zx_status::Status> {
823 use fidl::Peered;
824 self.inner.channel().signal_peer(clear_mask, set_mask)
825 }
826}
827
828impl ArgumentsControlHandle {}
829
830#[must_use = "FIDL methods require a response to be sent"]
831#[derive(Debug)]
832pub struct ArgumentsGetStringResponder {
833 control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
834 tx_id: u32,
835}
836
837impl std::ops::Drop for ArgumentsGetStringResponder {
841 fn drop(&mut self) {
842 self.control_handle.shutdown();
843 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
845 }
846}
847
848impl fidl::endpoints::Responder for ArgumentsGetStringResponder {
849 type ControlHandle = ArgumentsControlHandle;
850
851 fn control_handle(&self) -> &ArgumentsControlHandle {
852 &self.control_handle
853 }
854
855 fn drop_without_shutdown(mut self) {
856 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
858 std::mem::forget(self);
860 }
861}
862
863impl ArgumentsGetStringResponder {
864 pub fn send(self, mut value: Option<&str>) -> Result<(), fidl::Error> {
868 let _result = self.send_raw(value);
869 if _result.is_err() {
870 self.control_handle.shutdown();
871 }
872 self.drop_without_shutdown();
873 _result
874 }
875
876 pub fn send_no_shutdown_on_err(self, mut value: Option<&str>) -> Result<(), fidl::Error> {
878 let _result = self.send_raw(value);
879 self.drop_without_shutdown();
880 _result
881 }
882
883 fn send_raw(&self, mut value: Option<&str>) -> Result<(), fidl::Error> {
884 self.control_handle.inner.send::<ArgumentsGetStringResponse>(
885 (value,),
886 self.tx_id,
887 0x426c026d966f8fe,
888 fidl::encoding::DynamicFlags::empty(),
889 )
890 }
891}
892
893#[must_use = "FIDL methods require a response to be sent"]
894#[derive(Debug)]
895pub struct ArgumentsGetStringsResponder {
896 control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
897 tx_id: u32,
898}
899
900impl std::ops::Drop for ArgumentsGetStringsResponder {
904 fn drop(&mut self) {
905 self.control_handle.shutdown();
906 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
908 }
909}
910
911impl fidl::endpoints::Responder for ArgumentsGetStringsResponder {
912 type ControlHandle = ArgumentsControlHandle;
913
914 fn control_handle(&self) -> &ArgumentsControlHandle {
915 &self.control_handle
916 }
917
918 fn drop_without_shutdown(mut self) {
919 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
921 std::mem::forget(self);
923 }
924}
925
926impl ArgumentsGetStringsResponder {
927 pub fn send(self, mut values: &[Option<String>]) -> Result<(), fidl::Error> {
931 let _result = self.send_raw(values);
932 if _result.is_err() {
933 self.control_handle.shutdown();
934 }
935 self.drop_without_shutdown();
936 _result
937 }
938
939 pub fn send_no_shutdown_on_err(self, mut values: &[Option<String>]) -> Result<(), fidl::Error> {
941 let _result = self.send_raw(values);
942 self.drop_without_shutdown();
943 _result
944 }
945
946 fn send_raw(&self, mut values: &[Option<String>]) -> Result<(), fidl::Error> {
947 self.control_handle.inner.send::<ArgumentsGetStringsResponse>(
948 (values,),
949 self.tx_id,
950 0x328fb6b545aa96f7,
951 fidl::encoding::DynamicFlags::empty(),
952 )
953 }
954}
955
956#[must_use = "FIDL methods require a response to be sent"]
957#[derive(Debug)]
958pub struct ArgumentsGetBoolResponder {
959 control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
960 tx_id: u32,
961}
962
963impl std::ops::Drop for ArgumentsGetBoolResponder {
967 fn drop(&mut self) {
968 self.control_handle.shutdown();
969 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
971 }
972}
973
974impl fidl::endpoints::Responder for ArgumentsGetBoolResponder {
975 type ControlHandle = ArgumentsControlHandle;
976
977 fn control_handle(&self) -> &ArgumentsControlHandle {
978 &self.control_handle
979 }
980
981 fn drop_without_shutdown(mut self) {
982 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
984 std::mem::forget(self);
986 }
987}
988
989impl ArgumentsGetBoolResponder {
990 pub fn send(self, mut value: bool) -> Result<(), fidl::Error> {
994 let _result = self.send_raw(value);
995 if _result.is_err() {
996 self.control_handle.shutdown();
997 }
998 self.drop_without_shutdown();
999 _result
1000 }
1001
1002 pub fn send_no_shutdown_on_err(self, mut value: bool) -> Result<(), fidl::Error> {
1004 let _result = self.send_raw(value);
1005 self.drop_without_shutdown();
1006 _result
1007 }
1008
1009 fn send_raw(&self, mut value: bool) -> Result<(), fidl::Error> {
1010 self.control_handle.inner.send::<ArgumentsGetBoolResponse>(
1011 (value,),
1012 self.tx_id,
1013 0x4c5dd3149815cccd,
1014 fidl::encoding::DynamicFlags::empty(),
1015 )
1016 }
1017}
1018
1019#[must_use = "FIDL methods require a response to be sent"]
1020#[derive(Debug)]
1021pub struct ArgumentsGetBoolsResponder {
1022 control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
1023 tx_id: u32,
1024}
1025
1026impl std::ops::Drop for ArgumentsGetBoolsResponder {
1030 fn drop(&mut self) {
1031 self.control_handle.shutdown();
1032 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1034 }
1035}
1036
1037impl fidl::endpoints::Responder for ArgumentsGetBoolsResponder {
1038 type ControlHandle = ArgumentsControlHandle;
1039
1040 fn control_handle(&self) -> &ArgumentsControlHandle {
1041 &self.control_handle
1042 }
1043
1044 fn drop_without_shutdown(mut self) {
1045 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1047 std::mem::forget(self);
1049 }
1050}
1051
1052impl ArgumentsGetBoolsResponder {
1053 pub fn send(self, mut values: &[bool]) -> Result<(), fidl::Error> {
1057 let _result = self.send_raw(values);
1058 if _result.is_err() {
1059 self.control_handle.shutdown();
1060 }
1061 self.drop_without_shutdown();
1062 _result
1063 }
1064
1065 pub fn send_no_shutdown_on_err(self, mut values: &[bool]) -> Result<(), fidl::Error> {
1067 let _result = self.send_raw(values);
1068 self.drop_without_shutdown();
1069 _result
1070 }
1071
1072 fn send_raw(&self, mut values: &[bool]) -> Result<(), fidl::Error> {
1073 self.control_handle.inner.send::<ArgumentsGetBoolsResponse>(
1074 (values,),
1075 self.tx_id,
1076 0xfcc9fc9a0f22615,
1077 fidl::encoding::DynamicFlags::empty(),
1078 )
1079 }
1080}
1081
1082#[must_use = "FIDL methods require a response to be sent"]
1083#[derive(Debug)]
1084pub struct ArgumentsCollectResponder {
1085 control_handle: std::mem::ManuallyDrop<ArgumentsControlHandle>,
1086 tx_id: u32,
1087}
1088
1089impl std::ops::Drop for ArgumentsCollectResponder {
1093 fn drop(&mut self) {
1094 self.control_handle.shutdown();
1095 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1097 }
1098}
1099
1100impl fidl::endpoints::Responder for ArgumentsCollectResponder {
1101 type ControlHandle = ArgumentsControlHandle;
1102
1103 fn control_handle(&self) -> &ArgumentsControlHandle {
1104 &self.control_handle
1105 }
1106
1107 fn drop_without_shutdown(mut self) {
1108 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1110 std::mem::forget(self);
1112 }
1113}
1114
1115impl ArgumentsCollectResponder {
1116 pub fn send(self, mut results: &[String]) -> Result<(), fidl::Error> {
1120 let _result = self.send_raw(results);
1121 if _result.is_err() {
1122 self.control_handle.shutdown();
1123 }
1124 self.drop_without_shutdown();
1125 _result
1126 }
1127
1128 pub fn send_no_shutdown_on_err(self, mut results: &[String]) -> Result<(), fidl::Error> {
1130 let _result = self.send_raw(results);
1131 self.drop_without_shutdown();
1132 _result
1133 }
1134
1135 fn send_raw(&self, mut results: &[String]) -> Result<(), fidl::Error> {
1136 self.control_handle.inner.send::<ArgumentsCollectResponse>(
1137 (results,),
1138 self.tx_id,
1139 0x24e5acd864546e30,
1140 fidl::encoding::DynamicFlags::empty(),
1141 )
1142 }
1143}
1144
1145#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1146pub struct FactoryItemsMarker;
1147
1148impl fidl::endpoints::ProtocolMarker for FactoryItemsMarker {
1149 type Proxy = FactoryItemsProxy;
1150 type RequestStream = FactoryItemsRequestStream;
1151 #[cfg(target_os = "fuchsia")]
1152 type SynchronousProxy = FactoryItemsSynchronousProxy;
1153
1154 const DEBUG_NAME: &'static str = "fuchsia.boot.FactoryItems";
1155}
1156impl fidl::endpoints::DiscoverableProtocolMarker for FactoryItemsMarker {}
1157
1158pub trait FactoryItemsProxyInterface: Send + Sync {
1159 type GetResponseFut: std::future::Future<Output = Result<(Option<fidl::Vmo>, u32), fidl::Error>>
1160 + Send;
1161 fn r#get(&self, extra: u32) -> Self::GetResponseFut;
1162}
1163#[derive(Debug)]
1164#[cfg(target_os = "fuchsia")]
1165pub struct FactoryItemsSynchronousProxy {
1166 client: fidl::client::sync::Client,
1167}
1168
1169#[cfg(target_os = "fuchsia")]
1170impl fidl::endpoints::SynchronousProxy for FactoryItemsSynchronousProxy {
1171 type Proxy = FactoryItemsProxy;
1172 type Protocol = FactoryItemsMarker;
1173
1174 fn from_channel(inner: fidl::Channel) -> Self {
1175 Self::new(inner)
1176 }
1177
1178 fn into_channel(self) -> fidl::Channel {
1179 self.client.into_channel()
1180 }
1181
1182 fn as_channel(&self) -> &fidl::Channel {
1183 self.client.as_channel()
1184 }
1185}
1186
1187#[cfg(target_os = "fuchsia")]
1188impl FactoryItemsSynchronousProxy {
1189 pub fn new(channel: fidl::Channel) -> Self {
1190 let protocol_name = <FactoryItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1191 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1192 }
1193
1194 pub fn into_channel(self) -> fidl::Channel {
1195 self.client.into_channel()
1196 }
1197
1198 pub fn wait_for_event(
1201 &self,
1202 deadline: zx::MonotonicInstant,
1203 ) -> Result<FactoryItemsEvent, fidl::Error> {
1204 FactoryItemsEvent::decode(self.client.wait_for_event(deadline)?)
1205 }
1206
1207 pub fn r#get(
1212 &self,
1213 mut extra: u32,
1214 ___deadline: zx::MonotonicInstant,
1215 ) -> Result<(Option<fidl::Vmo>, u32), fidl::Error> {
1216 let _response = self.client.send_query::<FactoryItemsGetRequest, FactoryItemsGetResponse>(
1217 (extra,),
1218 0x2f0dcb1aba41b6d9,
1219 fidl::encoding::DynamicFlags::empty(),
1220 ___deadline,
1221 )?;
1222 Ok((_response.payload, _response.length))
1223 }
1224}
1225
1226#[cfg(target_os = "fuchsia")]
1227impl From<FactoryItemsSynchronousProxy> for zx::Handle {
1228 fn from(value: FactoryItemsSynchronousProxy) -> Self {
1229 value.into_channel().into()
1230 }
1231}
1232
1233#[cfg(target_os = "fuchsia")]
1234impl From<fidl::Channel> for FactoryItemsSynchronousProxy {
1235 fn from(value: fidl::Channel) -> Self {
1236 Self::new(value)
1237 }
1238}
1239
1240#[derive(Debug, Clone)]
1241pub struct FactoryItemsProxy {
1242 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1243}
1244
1245impl fidl::endpoints::Proxy for FactoryItemsProxy {
1246 type Protocol = FactoryItemsMarker;
1247
1248 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1249 Self::new(inner)
1250 }
1251
1252 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1253 self.client.into_channel().map_err(|client| Self { client })
1254 }
1255
1256 fn as_channel(&self) -> &::fidl::AsyncChannel {
1257 self.client.as_channel()
1258 }
1259}
1260
1261impl FactoryItemsProxy {
1262 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1264 let protocol_name = <FactoryItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1265 Self { client: fidl::client::Client::new(channel, protocol_name) }
1266 }
1267
1268 pub fn take_event_stream(&self) -> FactoryItemsEventStream {
1274 FactoryItemsEventStream { event_receiver: self.client.take_event_receiver() }
1275 }
1276
1277 pub fn r#get(
1282 &self,
1283 mut extra: u32,
1284 ) -> fidl::client::QueryResponseFut<
1285 (Option<fidl::Vmo>, u32),
1286 fidl::encoding::DefaultFuchsiaResourceDialect,
1287 > {
1288 FactoryItemsProxyInterface::r#get(self, extra)
1289 }
1290}
1291
1292impl FactoryItemsProxyInterface for FactoryItemsProxy {
1293 type GetResponseFut = fidl::client::QueryResponseFut<
1294 (Option<fidl::Vmo>, u32),
1295 fidl::encoding::DefaultFuchsiaResourceDialect,
1296 >;
1297 fn r#get(&self, mut extra: u32) -> Self::GetResponseFut {
1298 fn _decode(
1299 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1300 ) -> Result<(Option<fidl::Vmo>, u32), fidl::Error> {
1301 let _response = fidl::client::decode_transaction_body::<
1302 FactoryItemsGetResponse,
1303 fidl::encoding::DefaultFuchsiaResourceDialect,
1304 0x2f0dcb1aba41b6d9,
1305 >(_buf?)?;
1306 Ok((_response.payload, _response.length))
1307 }
1308 self.client.send_query_and_decode::<FactoryItemsGetRequest, (Option<fidl::Vmo>, u32)>(
1309 (extra,),
1310 0x2f0dcb1aba41b6d9,
1311 fidl::encoding::DynamicFlags::empty(),
1312 _decode,
1313 )
1314 }
1315}
1316
1317pub struct FactoryItemsEventStream {
1318 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1319}
1320
1321impl std::marker::Unpin for FactoryItemsEventStream {}
1322
1323impl futures::stream::FusedStream for FactoryItemsEventStream {
1324 fn is_terminated(&self) -> bool {
1325 self.event_receiver.is_terminated()
1326 }
1327}
1328
1329impl futures::Stream for FactoryItemsEventStream {
1330 type Item = Result<FactoryItemsEvent, fidl::Error>;
1331
1332 fn poll_next(
1333 mut self: std::pin::Pin<&mut Self>,
1334 cx: &mut std::task::Context<'_>,
1335 ) -> std::task::Poll<Option<Self::Item>> {
1336 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1337 &mut self.event_receiver,
1338 cx
1339 )?) {
1340 Some(buf) => std::task::Poll::Ready(Some(FactoryItemsEvent::decode(buf))),
1341 None => std::task::Poll::Ready(None),
1342 }
1343 }
1344}
1345
1346#[derive(Debug)]
1347pub enum FactoryItemsEvent {}
1348
1349impl FactoryItemsEvent {
1350 fn decode(
1352 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1353 ) -> Result<FactoryItemsEvent, fidl::Error> {
1354 let (bytes, _handles) = buf.split_mut();
1355 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1356 debug_assert_eq!(tx_header.tx_id, 0);
1357 match tx_header.ordinal {
1358 _ => Err(fidl::Error::UnknownOrdinal {
1359 ordinal: tx_header.ordinal,
1360 protocol_name: <FactoryItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1361 }),
1362 }
1363 }
1364}
1365
1366pub struct FactoryItemsRequestStream {
1368 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1369 is_terminated: bool,
1370}
1371
1372impl std::marker::Unpin for FactoryItemsRequestStream {}
1373
1374impl futures::stream::FusedStream for FactoryItemsRequestStream {
1375 fn is_terminated(&self) -> bool {
1376 self.is_terminated
1377 }
1378}
1379
1380impl fidl::endpoints::RequestStream for FactoryItemsRequestStream {
1381 type Protocol = FactoryItemsMarker;
1382 type ControlHandle = FactoryItemsControlHandle;
1383
1384 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1385 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1386 }
1387
1388 fn control_handle(&self) -> Self::ControlHandle {
1389 FactoryItemsControlHandle { inner: self.inner.clone() }
1390 }
1391
1392 fn into_inner(
1393 self,
1394 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1395 {
1396 (self.inner, self.is_terminated)
1397 }
1398
1399 fn from_inner(
1400 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1401 is_terminated: bool,
1402 ) -> Self {
1403 Self { inner, is_terminated }
1404 }
1405}
1406
1407impl futures::Stream for FactoryItemsRequestStream {
1408 type Item = Result<FactoryItemsRequest, fidl::Error>;
1409
1410 fn poll_next(
1411 mut self: std::pin::Pin<&mut Self>,
1412 cx: &mut std::task::Context<'_>,
1413 ) -> std::task::Poll<Option<Self::Item>> {
1414 let this = &mut *self;
1415 if this.inner.check_shutdown(cx) {
1416 this.is_terminated = true;
1417 return std::task::Poll::Ready(None);
1418 }
1419 if this.is_terminated {
1420 panic!("polled FactoryItemsRequestStream after completion");
1421 }
1422 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1423 |bytes, handles| {
1424 match this.inner.channel().read_etc(cx, bytes, handles) {
1425 std::task::Poll::Ready(Ok(())) => {}
1426 std::task::Poll::Pending => return std::task::Poll::Pending,
1427 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1428 this.is_terminated = true;
1429 return std::task::Poll::Ready(None);
1430 }
1431 std::task::Poll::Ready(Err(e)) => {
1432 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1433 e.into(),
1434 ))))
1435 }
1436 }
1437
1438 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1440
1441 std::task::Poll::Ready(Some(match header.ordinal {
1442 0x2f0dcb1aba41b6d9 => {
1443 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1444 let mut req = fidl::new_empty!(
1445 FactoryItemsGetRequest,
1446 fidl::encoding::DefaultFuchsiaResourceDialect
1447 );
1448 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FactoryItemsGetRequest>(&header, _body_bytes, handles, &mut req)?;
1449 let control_handle =
1450 FactoryItemsControlHandle { inner: this.inner.clone() };
1451 Ok(FactoryItemsRequest::Get {
1452 extra: req.extra,
1453
1454 responder: FactoryItemsGetResponder {
1455 control_handle: std::mem::ManuallyDrop::new(control_handle),
1456 tx_id: header.tx_id,
1457 },
1458 })
1459 }
1460 _ => Err(fidl::Error::UnknownOrdinal {
1461 ordinal: header.ordinal,
1462 protocol_name:
1463 <FactoryItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1464 }),
1465 }))
1466 },
1467 )
1468 }
1469}
1470
1471#[derive(Debug)]
1473pub enum FactoryItemsRequest {
1474 Get { extra: u32, responder: FactoryItemsGetResponder },
1479}
1480
1481impl FactoryItemsRequest {
1482 #[allow(irrefutable_let_patterns)]
1483 pub fn into_get(self) -> Option<(u32, FactoryItemsGetResponder)> {
1484 if let FactoryItemsRequest::Get { extra, responder } = self {
1485 Some((extra, responder))
1486 } else {
1487 None
1488 }
1489 }
1490
1491 pub fn method_name(&self) -> &'static str {
1493 match *self {
1494 FactoryItemsRequest::Get { .. } => "get",
1495 }
1496 }
1497}
1498
1499#[derive(Debug, Clone)]
1500pub struct FactoryItemsControlHandle {
1501 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1502}
1503
1504impl fidl::endpoints::ControlHandle for FactoryItemsControlHandle {
1505 fn shutdown(&self) {
1506 self.inner.shutdown()
1507 }
1508 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1509 self.inner.shutdown_with_epitaph(status)
1510 }
1511
1512 fn is_closed(&self) -> bool {
1513 self.inner.channel().is_closed()
1514 }
1515 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1516 self.inner.channel().on_closed()
1517 }
1518
1519 #[cfg(target_os = "fuchsia")]
1520 fn signal_peer(
1521 &self,
1522 clear_mask: zx::Signals,
1523 set_mask: zx::Signals,
1524 ) -> Result<(), zx_status::Status> {
1525 use fidl::Peered;
1526 self.inner.channel().signal_peer(clear_mask, set_mask)
1527 }
1528}
1529
1530impl FactoryItemsControlHandle {}
1531
1532#[must_use = "FIDL methods require a response to be sent"]
1533#[derive(Debug)]
1534pub struct FactoryItemsGetResponder {
1535 control_handle: std::mem::ManuallyDrop<FactoryItemsControlHandle>,
1536 tx_id: u32,
1537}
1538
1539impl std::ops::Drop for FactoryItemsGetResponder {
1543 fn drop(&mut self) {
1544 self.control_handle.shutdown();
1545 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1547 }
1548}
1549
1550impl fidl::endpoints::Responder for FactoryItemsGetResponder {
1551 type ControlHandle = FactoryItemsControlHandle;
1552
1553 fn control_handle(&self) -> &FactoryItemsControlHandle {
1554 &self.control_handle
1555 }
1556
1557 fn drop_without_shutdown(mut self) {
1558 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1560 std::mem::forget(self);
1562 }
1563}
1564
1565impl FactoryItemsGetResponder {
1566 pub fn send(self, mut payload: Option<fidl::Vmo>, mut length: u32) -> Result<(), fidl::Error> {
1570 let _result = self.send_raw(payload, length);
1571 if _result.is_err() {
1572 self.control_handle.shutdown();
1573 }
1574 self.drop_without_shutdown();
1575 _result
1576 }
1577
1578 pub fn send_no_shutdown_on_err(
1580 self,
1581 mut payload: Option<fidl::Vmo>,
1582 mut length: u32,
1583 ) -> Result<(), fidl::Error> {
1584 let _result = self.send_raw(payload, length);
1585 self.drop_without_shutdown();
1586 _result
1587 }
1588
1589 fn send_raw(&self, mut payload: Option<fidl::Vmo>, mut length: u32) -> Result<(), fidl::Error> {
1590 self.control_handle.inner.send::<FactoryItemsGetResponse>(
1591 (payload, length),
1592 self.tx_id,
1593 0x2f0dcb1aba41b6d9,
1594 fidl::encoding::DynamicFlags::empty(),
1595 )
1596 }
1597}
1598
1599#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1600pub struct ItemsMarker;
1601
1602impl fidl::endpoints::ProtocolMarker for ItemsMarker {
1603 type Proxy = ItemsProxy;
1604 type RequestStream = ItemsRequestStream;
1605 #[cfg(target_os = "fuchsia")]
1606 type SynchronousProxy = ItemsSynchronousProxy;
1607
1608 const DEBUG_NAME: &'static str = "fuchsia.boot.Items";
1609}
1610impl fidl::endpoints::DiscoverableProtocolMarker for ItemsMarker {}
1611pub type ItemsGet2Result = Result<Vec<RetrievedItems>, i32>;
1612
1613pub trait ItemsProxyInterface: Send + Sync {
1614 type GetResponseFut: std::future::Future<Output = Result<(Option<fidl::Vmo>, u32), fidl::Error>>
1615 + Send;
1616 fn r#get(&self, type_: u32, extra: u32) -> Self::GetResponseFut;
1617 type Get2ResponseFut: std::future::Future<Output = Result<ItemsGet2Result, fidl::Error>> + Send;
1618 fn r#get2(&self, type_: u32, extra: Option<&Extra>) -> Self::Get2ResponseFut;
1619 type GetBootloaderFileResponseFut: std::future::Future<Output = Result<Option<fidl::Vmo>, fidl::Error>>
1620 + Send;
1621 fn r#get_bootloader_file(&self, filename: &str) -> Self::GetBootloaderFileResponseFut;
1622}
1623#[derive(Debug)]
1624#[cfg(target_os = "fuchsia")]
1625pub struct ItemsSynchronousProxy {
1626 client: fidl::client::sync::Client,
1627}
1628
1629#[cfg(target_os = "fuchsia")]
1630impl fidl::endpoints::SynchronousProxy for ItemsSynchronousProxy {
1631 type Proxy = ItemsProxy;
1632 type Protocol = ItemsMarker;
1633
1634 fn from_channel(inner: fidl::Channel) -> Self {
1635 Self::new(inner)
1636 }
1637
1638 fn into_channel(self) -> fidl::Channel {
1639 self.client.into_channel()
1640 }
1641
1642 fn as_channel(&self) -> &fidl::Channel {
1643 self.client.as_channel()
1644 }
1645}
1646
1647#[cfg(target_os = "fuchsia")]
1648impl ItemsSynchronousProxy {
1649 pub fn new(channel: fidl::Channel) -> Self {
1650 let protocol_name = <ItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1651 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1652 }
1653
1654 pub fn into_channel(self) -> fidl::Channel {
1655 self.client.into_channel()
1656 }
1657
1658 pub fn wait_for_event(
1661 &self,
1662 deadline: zx::MonotonicInstant,
1663 ) -> Result<ItemsEvent, fidl::Error> {
1664 ItemsEvent::decode(self.client.wait_for_event(deadline)?)
1665 }
1666
1667 pub fn r#get(
1675 &self,
1676 mut type_: u32,
1677 mut extra: u32,
1678 ___deadline: zx::MonotonicInstant,
1679 ) -> Result<(Option<fidl::Vmo>, u32), fidl::Error> {
1680 let _response = self.client.send_query::<ItemsGetRequest, ItemsGetResponse>(
1681 (type_, extra),
1682 0x542db3f176641edc,
1683 fidl::encoding::DynamicFlags::empty(),
1684 ___deadline,
1685 )?;
1686 Ok((_response.payload, _response.length))
1687 }
1688
1689 pub fn r#get2(
1694 &self,
1695 mut type_: u32,
1696 mut extra: Option<&Extra>,
1697 ___deadline: zx::MonotonicInstant,
1698 ) -> Result<ItemsGet2Result, fidl::Error> {
1699 let _response = self
1700 .client
1701 .send_query::<ItemsGet2Request, fidl::encoding::ResultType<ItemsGet2Response, i32>>(
1702 (type_, extra),
1703 0x2a64bd32f9ba3f2e,
1704 fidl::encoding::DynamicFlags::empty(),
1705 ___deadline,
1706 )?;
1707 Ok(_response.map(|x| x.retrieved_items))
1708 }
1709
1710 pub fn r#get_bootloader_file(
1713 &self,
1714 mut filename: &str,
1715 ___deadline: zx::MonotonicInstant,
1716 ) -> Result<Option<fidl::Vmo>, fidl::Error> {
1717 let _response = self
1718 .client
1719 .send_query::<ItemsGetBootloaderFileRequest, ItemsGetBootloaderFileResponse>(
1720 (filename,),
1721 0x5a004db3c9378e8c,
1722 fidl::encoding::DynamicFlags::empty(),
1723 ___deadline,
1724 )?;
1725 Ok(_response.payload)
1726 }
1727}
1728
1729#[cfg(target_os = "fuchsia")]
1730impl From<ItemsSynchronousProxy> for zx::Handle {
1731 fn from(value: ItemsSynchronousProxy) -> Self {
1732 value.into_channel().into()
1733 }
1734}
1735
1736#[cfg(target_os = "fuchsia")]
1737impl From<fidl::Channel> for ItemsSynchronousProxy {
1738 fn from(value: fidl::Channel) -> Self {
1739 Self::new(value)
1740 }
1741}
1742
1743#[derive(Debug, Clone)]
1744pub struct ItemsProxy {
1745 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1746}
1747
1748impl fidl::endpoints::Proxy for ItemsProxy {
1749 type Protocol = ItemsMarker;
1750
1751 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1752 Self::new(inner)
1753 }
1754
1755 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1756 self.client.into_channel().map_err(|client| Self { client })
1757 }
1758
1759 fn as_channel(&self) -> &::fidl::AsyncChannel {
1760 self.client.as_channel()
1761 }
1762}
1763
1764impl ItemsProxy {
1765 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1767 let protocol_name = <ItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1768 Self { client: fidl::client::Client::new(channel, protocol_name) }
1769 }
1770
1771 pub fn take_event_stream(&self) -> ItemsEventStream {
1777 ItemsEventStream { event_receiver: self.client.take_event_receiver() }
1778 }
1779
1780 pub fn r#get(
1788 &self,
1789 mut type_: u32,
1790 mut extra: u32,
1791 ) -> fidl::client::QueryResponseFut<
1792 (Option<fidl::Vmo>, u32),
1793 fidl::encoding::DefaultFuchsiaResourceDialect,
1794 > {
1795 ItemsProxyInterface::r#get(self, type_, extra)
1796 }
1797
1798 pub fn r#get2(
1803 &self,
1804 mut type_: u32,
1805 mut extra: Option<&Extra>,
1806 ) -> fidl::client::QueryResponseFut<
1807 ItemsGet2Result,
1808 fidl::encoding::DefaultFuchsiaResourceDialect,
1809 > {
1810 ItemsProxyInterface::r#get2(self, type_, extra)
1811 }
1812
1813 pub fn r#get_bootloader_file(
1816 &self,
1817 mut filename: &str,
1818 ) -> fidl::client::QueryResponseFut<
1819 Option<fidl::Vmo>,
1820 fidl::encoding::DefaultFuchsiaResourceDialect,
1821 > {
1822 ItemsProxyInterface::r#get_bootloader_file(self, filename)
1823 }
1824}
1825
1826impl ItemsProxyInterface for ItemsProxy {
1827 type GetResponseFut = fidl::client::QueryResponseFut<
1828 (Option<fidl::Vmo>, u32),
1829 fidl::encoding::DefaultFuchsiaResourceDialect,
1830 >;
1831 fn r#get(&self, mut type_: u32, mut extra: u32) -> Self::GetResponseFut {
1832 fn _decode(
1833 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1834 ) -> Result<(Option<fidl::Vmo>, u32), fidl::Error> {
1835 let _response = fidl::client::decode_transaction_body::<
1836 ItemsGetResponse,
1837 fidl::encoding::DefaultFuchsiaResourceDialect,
1838 0x542db3f176641edc,
1839 >(_buf?)?;
1840 Ok((_response.payload, _response.length))
1841 }
1842 self.client.send_query_and_decode::<ItemsGetRequest, (Option<fidl::Vmo>, u32)>(
1843 (type_, extra),
1844 0x542db3f176641edc,
1845 fidl::encoding::DynamicFlags::empty(),
1846 _decode,
1847 )
1848 }
1849
1850 type Get2ResponseFut = fidl::client::QueryResponseFut<
1851 ItemsGet2Result,
1852 fidl::encoding::DefaultFuchsiaResourceDialect,
1853 >;
1854 fn r#get2(&self, mut type_: u32, mut extra: Option<&Extra>) -> Self::Get2ResponseFut {
1855 fn _decode(
1856 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1857 ) -> Result<ItemsGet2Result, fidl::Error> {
1858 let _response = fidl::client::decode_transaction_body::<
1859 fidl::encoding::ResultType<ItemsGet2Response, i32>,
1860 fidl::encoding::DefaultFuchsiaResourceDialect,
1861 0x2a64bd32f9ba3f2e,
1862 >(_buf?)?;
1863 Ok(_response.map(|x| x.retrieved_items))
1864 }
1865 self.client.send_query_and_decode::<ItemsGet2Request, ItemsGet2Result>(
1866 (type_, extra),
1867 0x2a64bd32f9ba3f2e,
1868 fidl::encoding::DynamicFlags::empty(),
1869 _decode,
1870 )
1871 }
1872
1873 type GetBootloaderFileResponseFut = fidl::client::QueryResponseFut<
1874 Option<fidl::Vmo>,
1875 fidl::encoding::DefaultFuchsiaResourceDialect,
1876 >;
1877 fn r#get_bootloader_file(&self, mut filename: &str) -> Self::GetBootloaderFileResponseFut {
1878 fn _decode(
1879 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1880 ) -> Result<Option<fidl::Vmo>, fidl::Error> {
1881 let _response = fidl::client::decode_transaction_body::<
1882 ItemsGetBootloaderFileResponse,
1883 fidl::encoding::DefaultFuchsiaResourceDialect,
1884 0x5a004db3c9378e8c,
1885 >(_buf?)?;
1886 Ok(_response.payload)
1887 }
1888 self.client.send_query_and_decode::<ItemsGetBootloaderFileRequest, Option<fidl::Vmo>>(
1889 (filename,),
1890 0x5a004db3c9378e8c,
1891 fidl::encoding::DynamicFlags::empty(),
1892 _decode,
1893 )
1894 }
1895}
1896
1897pub struct ItemsEventStream {
1898 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1899}
1900
1901impl std::marker::Unpin for ItemsEventStream {}
1902
1903impl futures::stream::FusedStream for ItemsEventStream {
1904 fn is_terminated(&self) -> bool {
1905 self.event_receiver.is_terminated()
1906 }
1907}
1908
1909impl futures::Stream for ItemsEventStream {
1910 type Item = Result<ItemsEvent, fidl::Error>;
1911
1912 fn poll_next(
1913 mut self: std::pin::Pin<&mut Self>,
1914 cx: &mut std::task::Context<'_>,
1915 ) -> std::task::Poll<Option<Self::Item>> {
1916 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1917 &mut self.event_receiver,
1918 cx
1919 )?) {
1920 Some(buf) => std::task::Poll::Ready(Some(ItemsEvent::decode(buf))),
1921 None => std::task::Poll::Ready(None),
1922 }
1923 }
1924}
1925
1926#[derive(Debug)]
1927pub enum ItemsEvent {}
1928
1929impl ItemsEvent {
1930 fn decode(
1932 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1933 ) -> Result<ItemsEvent, fidl::Error> {
1934 let (bytes, _handles) = buf.split_mut();
1935 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1936 debug_assert_eq!(tx_header.tx_id, 0);
1937 match tx_header.ordinal {
1938 _ => Err(fidl::Error::UnknownOrdinal {
1939 ordinal: tx_header.ordinal,
1940 protocol_name: <ItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1941 }),
1942 }
1943 }
1944}
1945
1946pub struct ItemsRequestStream {
1948 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1949 is_terminated: bool,
1950}
1951
1952impl std::marker::Unpin for ItemsRequestStream {}
1953
1954impl futures::stream::FusedStream for ItemsRequestStream {
1955 fn is_terminated(&self) -> bool {
1956 self.is_terminated
1957 }
1958}
1959
1960impl fidl::endpoints::RequestStream for ItemsRequestStream {
1961 type Protocol = ItemsMarker;
1962 type ControlHandle = ItemsControlHandle;
1963
1964 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1965 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1966 }
1967
1968 fn control_handle(&self) -> Self::ControlHandle {
1969 ItemsControlHandle { inner: self.inner.clone() }
1970 }
1971
1972 fn into_inner(
1973 self,
1974 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1975 {
1976 (self.inner, self.is_terminated)
1977 }
1978
1979 fn from_inner(
1980 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1981 is_terminated: bool,
1982 ) -> Self {
1983 Self { inner, is_terminated }
1984 }
1985}
1986
1987impl futures::Stream for ItemsRequestStream {
1988 type Item = Result<ItemsRequest, fidl::Error>;
1989
1990 fn poll_next(
1991 mut self: std::pin::Pin<&mut Self>,
1992 cx: &mut std::task::Context<'_>,
1993 ) -> std::task::Poll<Option<Self::Item>> {
1994 let this = &mut *self;
1995 if this.inner.check_shutdown(cx) {
1996 this.is_terminated = true;
1997 return std::task::Poll::Ready(None);
1998 }
1999 if this.is_terminated {
2000 panic!("polled ItemsRequestStream after completion");
2001 }
2002 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2003 |bytes, handles| {
2004 match this.inner.channel().read_etc(cx, bytes, handles) {
2005 std::task::Poll::Ready(Ok(())) => {}
2006 std::task::Poll::Pending => return std::task::Poll::Pending,
2007 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2008 this.is_terminated = true;
2009 return std::task::Poll::Ready(None);
2010 }
2011 std::task::Poll::Ready(Err(e)) => {
2012 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2013 e.into(),
2014 ))))
2015 }
2016 }
2017
2018 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2020
2021 std::task::Poll::Ready(Some(match header.ordinal {
2022 0x542db3f176641edc => {
2023 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2024 let mut req = fidl::new_empty!(
2025 ItemsGetRequest,
2026 fidl::encoding::DefaultFuchsiaResourceDialect
2027 );
2028 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ItemsGetRequest>(&header, _body_bytes, handles, &mut req)?;
2029 let control_handle = ItemsControlHandle { inner: this.inner.clone() };
2030 Ok(ItemsRequest::Get {
2031 type_: req.type_,
2032 extra: req.extra,
2033
2034 responder: ItemsGetResponder {
2035 control_handle: std::mem::ManuallyDrop::new(control_handle),
2036 tx_id: header.tx_id,
2037 },
2038 })
2039 }
2040 0x2a64bd32f9ba3f2e => {
2041 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2042 let mut req = fidl::new_empty!(
2043 ItemsGet2Request,
2044 fidl::encoding::DefaultFuchsiaResourceDialect
2045 );
2046 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ItemsGet2Request>(&header, _body_bytes, handles, &mut req)?;
2047 let control_handle = ItemsControlHandle { inner: this.inner.clone() };
2048 Ok(ItemsRequest::Get2 {
2049 type_: req.type_,
2050 extra: req.extra,
2051
2052 responder: ItemsGet2Responder {
2053 control_handle: std::mem::ManuallyDrop::new(control_handle),
2054 tx_id: header.tx_id,
2055 },
2056 })
2057 }
2058 0x5a004db3c9378e8c => {
2059 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2060 let mut req = fidl::new_empty!(
2061 ItemsGetBootloaderFileRequest,
2062 fidl::encoding::DefaultFuchsiaResourceDialect
2063 );
2064 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ItemsGetBootloaderFileRequest>(&header, _body_bytes, handles, &mut req)?;
2065 let control_handle = ItemsControlHandle { inner: this.inner.clone() };
2066 Ok(ItemsRequest::GetBootloaderFile {
2067 filename: req.filename,
2068
2069 responder: ItemsGetBootloaderFileResponder {
2070 control_handle: std::mem::ManuallyDrop::new(control_handle),
2071 tx_id: header.tx_id,
2072 },
2073 })
2074 }
2075 _ => Err(fidl::Error::UnknownOrdinal {
2076 ordinal: header.ordinal,
2077 protocol_name: <ItemsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2078 }),
2079 }))
2080 },
2081 )
2082 }
2083}
2084
2085#[derive(Debug)]
2087pub enum ItemsRequest {
2088 Get { type_: u32, extra: u32, responder: ItemsGetResponder },
2096 Get2 { type_: u32, extra: Option<Box<Extra>>, responder: ItemsGet2Responder },
2101 GetBootloaderFile { filename: String, responder: ItemsGetBootloaderFileResponder },
2104}
2105
2106impl ItemsRequest {
2107 #[allow(irrefutable_let_patterns)]
2108 pub fn into_get(self) -> Option<(u32, u32, ItemsGetResponder)> {
2109 if let ItemsRequest::Get { type_, extra, responder } = self {
2110 Some((type_, extra, responder))
2111 } else {
2112 None
2113 }
2114 }
2115
2116 #[allow(irrefutable_let_patterns)]
2117 pub fn into_get2(self) -> Option<(u32, Option<Box<Extra>>, ItemsGet2Responder)> {
2118 if let ItemsRequest::Get2 { type_, extra, responder } = self {
2119 Some((type_, extra, responder))
2120 } else {
2121 None
2122 }
2123 }
2124
2125 #[allow(irrefutable_let_patterns)]
2126 pub fn into_get_bootloader_file(self) -> Option<(String, ItemsGetBootloaderFileResponder)> {
2127 if let ItemsRequest::GetBootloaderFile { filename, responder } = self {
2128 Some((filename, responder))
2129 } else {
2130 None
2131 }
2132 }
2133
2134 pub fn method_name(&self) -> &'static str {
2136 match *self {
2137 ItemsRequest::Get { .. } => "get",
2138 ItemsRequest::Get2 { .. } => "get2",
2139 ItemsRequest::GetBootloaderFile { .. } => "get_bootloader_file",
2140 }
2141 }
2142}
2143
2144#[derive(Debug, Clone)]
2145pub struct ItemsControlHandle {
2146 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2147}
2148
2149impl fidl::endpoints::ControlHandle for ItemsControlHandle {
2150 fn shutdown(&self) {
2151 self.inner.shutdown()
2152 }
2153 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2154 self.inner.shutdown_with_epitaph(status)
2155 }
2156
2157 fn is_closed(&self) -> bool {
2158 self.inner.channel().is_closed()
2159 }
2160 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2161 self.inner.channel().on_closed()
2162 }
2163
2164 #[cfg(target_os = "fuchsia")]
2165 fn signal_peer(
2166 &self,
2167 clear_mask: zx::Signals,
2168 set_mask: zx::Signals,
2169 ) -> Result<(), zx_status::Status> {
2170 use fidl::Peered;
2171 self.inner.channel().signal_peer(clear_mask, set_mask)
2172 }
2173}
2174
2175impl ItemsControlHandle {}
2176
2177#[must_use = "FIDL methods require a response to be sent"]
2178#[derive(Debug)]
2179pub struct ItemsGetResponder {
2180 control_handle: std::mem::ManuallyDrop<ItemsControlHandle>,
2181 tx_id: u32,
2182}
2183
2184impl std::ops::Drop for ItemsGetResponder {
2188 fn drop(&mut self) {
2189 self.control_handle.shutdown();
2190 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2192 }
2193}
2194
2195impl fidl::endpoints::Responder for ItemsGetResponder {
2196 type ControlHandle = ItemsControlHandle;
2197
2198 fn control_handle(&self) -> &ItemsControlHandle {
2199 &self.control_handle
2200 }
2201
2202 fn drop_without_shutdown(mut self) {
2203 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2205 std::mem::forget(self);
2207 }
2208}
2209
2210impl ItemsGetResponder {
2211 pub fn send(self, mut payload: Option<fidl::Vmo>, mut length: u32) -> Result<(), fidl::Error> {
2215 let _result = self.send_raw(payload, length);
2216 if _result.is_err() {
2217 self.control_handle.shutdown();
2218 }
2219 self.drop_without_shutdown();
2220 _result
2221 }
2222
2223 pub fn send_no_shutdown_on_err(
2225 self,
2226 mut payload: Option<fidl::Vmo>,
2227 mut length: u32,
2228 ) -> Result<(), fidl::Error> {
2229 let _result = self.send_raw(payload, length);
2230 self.drop_without_shutdown();
2231 _result
2232 }
2233
2234 fn send_raw(&self, mut payload: Option<fidl::Vmo>, mut length: u32) -> Result<(), fidl::Error> {
2235 self.control_handle.inner.send::<ItemsGetResponse>(
2236 (payload, length),
2237 self.tx_id,
2238 0x542db3f176641edc,
2239 fidl::encoding::DynamicFlags::empty(),
2240 )
2241 }
2242}
2243
2244#[must_use = "FIDL methods require a response to be sent"]
2245#[derive(Debug)]
2246pub struct ItemsGet2Responder {
2247 control_handle: std::mem::ManuallyDrop<ItemsControlHandle>,
2248 tx_id: u32,
2249}
2250
2251impl std::ops::Drop for ItemsGet2Responder {
2255 fn drop(&mut self) {
2256 self.control_handle.shutdown();
2257 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2259 }
2260}
2261
2262impl fidl::endpoints::Responder for ItemsGet2Responder {
2263 type ControlHandle = ItemsControlHandle;
2264
2265 fn control_handle(&self) -> &ItemsControlHandle {
2266 &self.control_handle
2267 }
2268
2269 fn drop_without_shutdown(mut self) {
2270 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2272 std::mem::forget(self);
2274 }
2275}
2276
2277impl ItemsGet2Responder {
2278 pub fn send(self, mut result: Result<Vec<RetrievedItems>, i32>) -> Result<(), fidl::Error> {
2282 let _result = self.send_raw(result);
2283 if _result.is_err() {
2284 self.control_handle.shutdown();
2285 }
2286 self.drop_without_shutdown();
2287 _result
2288 }
2289
2290 pub fn send_no_shutdown_on_err(
2292 self,
2293 mut result: Result<Vec<RetrievedItems>, i32>,
2294 ) -> Result<(), fidl::Error> {
2295 let _result = self.send_raw(result);
2296 self.drop_without_shutdown();
2297 _result
2298 }
2299
2300 fn send_raw(&self, mut result: Result<Vec<RetrievedItems>, i32>) -> Result<(), fidl::Error> {
2301 self.control_handle.inner.send::<fidl::encoding::ResultType<ItemsGet2Response, i32>>(
2302 result
2303 .as_mut()
2304 .map_err(|e| *e)
2305 .map(|retrieved_items| (retrieved_items.as_mut_slice(),)),
2306 self.tx_id,
2307 0x2a64bd32f9ba3f2e,
2308 fidl::encoding::DynamicFlags::empty(),
2309 )
2310 }
2311}
2312
2313#[must_use = "FIDL methods require a response to be sent"]
2314#[derive(Debug)]
2315pub struct ItemsGetBootloaderFileResponder {
2316 control_handle: std::mem::ManuallyDrop<ItemsControlHandle>,
2317 tx_id: u32,
2318}
2319
2320impl std::ops::Drop for ItemsGetBootloaderFileResponder {
2324 fn drop(&mut self) {
2325 self.control_handle.shutdown();
2326 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2328 }
2329}
2330
2331impl fidl::endpoints::Responder for ItemsGetBootloaderFileResponder {
2332 type ControlHandle = ItemsControlHandle;
2333
2334 fn control_handle(&self) -> &ItemsControlHandle {
2335 &self.control_handle
2336 }
2337
2338 fn drop_without_shutdown(mut self) {
2339 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2341 std::mem::forget(self);
2343 }
2344}
2345
2346impl ItemsGetBootloaderFileResponder {
2347 pub fn send(self, mut payload: Option<fidl::Vmo>) -> Result<(), fidl::Error> {
2351 let _result = self.send_raw(payload);
2352 if _result.is_err() {
2353 self.control_handle.shutdown();
2354 }
2355 self.drop_without_shutdown();
2356 _result
2357 }
2358
2359 pub fn send_no_shutdown_on_err(
2361 self,
2362 mut payload: Option<fidl::Vmo>,
2363 ) -> Result<(), fidl::Error> {
2364 let _result = self.send_raw(payload);
2365 self.drop_without_shutdown();
2366 _result
2367 }
2368
2369 fn send_raw(&self, mut payload: Option<fidl::Vmo>) -> Result<(), fidl::Error> {
2370 self.control_handle.inner.send::<ItemsGetBootloaderFileResponse>(
2371 (payload,),
2372 self.tx_id,
2373 0x5a004db3c9378e8c,
2374 fidl::encoding::DynamicFlags::empty(),
2375 )
2376 }
2377}
2378
2379#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2380pub struct ReadOnlyLogMarker;
2381
2382impl fidl::endpoints::ProtocolMarker for ReadOnlyLogMarker {
2383 type Proxy = ReadOnlyLogProxy;
2384 type RequestStream = ReadOnlyLogRequestStream;
2385 #[cfg(target_os = "fuchsia")]
2386 type SynchronousProxy = ReadOnlyLogSynchronousProxy;
2387
2388 const DEBUG_NAME: &'static str = "fuchsia.boot.ReadOnlyLog";
2389}
2390impl fidl::endpoints::DiscoverableProtocolMarker for ReadOnlyLogMarker {}
2391
2392pub trait ReadOnlyLogProxyInterface: Send + Sync {
2393 type GetResponseFut: std::future::Future<Output = Result<fidl::DebugLog, fidl::Error>> + Send;
2394 fn r#get(&self) -> Self::GetResponseFut;
2395}
2396#[derive(Debug)]
2397#[cfg(target_os = "fuchsia")]
2398pub struct ReadOnlyLogSynchronousProxy {
2399 client: fidl::client::sync::Client,
2400}
2401
2402#[cfg(target_os = "fuchsia")]
2403impl fidl::endpoints::SynchronousProxy for ReadOnlyLogSynchronousProxy {
2404 type Proxy = ReadOnlyLogProxy;
2405 type Protocol = ReadOnlyLogMarker;
2406
2407 fn from_channel(inner: fidl::Channel) -> Self {
2408 Self::new(inner)
2409 }
2410
2411 fn into_channel(self) -> fidl::Channel {
2412 self.client.into_channel()
2413 }
2414
2415 fn as_channel(&self) -> &fidl::Channel {
2416 self.client.as_channel()
2417 }
2418}
2419
2420#[cfg(target_os = "fuchsia")]
2421impl ReadOnlyLogSynchronousProxy {
2422 pub fn new(channel: fidl::Channel) -> Self {
2423 let protocol_name = <ReadOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2424 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2425 }
2426
2427 pub fn into_channel(self) -> fidl::Channel {
2428 self.client.into_channel()
2429 }
2430
2431 pub fn wait_for_event(
2434 &self,
2435 deadline: zx::MonotonicInstant,
2436 ) -> Result<ReadOnlyLogEvent, fidl::Error> {
2437 ReadOnlyLogEvent::decode(self.client.wait_for_event(deadline)?)
2438 }
2439
2440 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::DebugLog, fidl::Error> {
2442 let _response =
2443 self.client.send_query::<fidl::encoding::EmptyPayload, ReadOnlyLogGetResponse>(
2444 (),
2445 0x6f3ceba5eca871ff,
2446 fidl::encoding::DynamicFlags::empty(),
2447 ___deadline,
2448 )?;
2449 Ok(_response.log)
2450 }
2451}
2452
2453#[cfg(target_os = "fuchsia")]
2454impl From<ReadOnlyLogSynchronousProxy> for zx::Handle {
2455 fn from(value: ReadOnlyLogSynchronousProxy) -> Self {
2456 value.into_channel().into()
2457 }
2458}
2459
2460#[cfg(target_os = "fuchsia")]
2461impl From<fidl::Channel> for ReadOnlyLogSynchronousProxy {
2462 fn from(value: fidl::Channel) -> Self {
2463 Self::new(value)
2464 }
2465}
2466
2467#[derive(Debug, Clone)]
2468pub struct ReadOnlyLogProxy {
2469 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2470}
2471
2472impl fidl::endpoints::Proxy for ReadOnlyLogProxy {
2473 type Protocol = ReadOnlyLogMarker;
2474
2475 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2476 Self::new(inner)
2477 }
2478
2479 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2480 self.client.into_channel().map_err(|client| Self { client })
2481 }
2482
2483 fn as_channel(&self) -> &::fidl::AsyncChannel {
2484 self.client.as_channel()
2485 }
2486}
2487
2488impl ReadOnlyLogProxy {
2489 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2491 let protocol_name = <ReadOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2492 Self { client: fidl::client::Client::new(channel, protocol_name) }
2493 }
2494
2495 pub fn take_event_stream(&self) -> ReadOnlyLogEventStream {
2501 ReadOnlyLogEventStream { event_receiver: self.client.take_event_receiver() }
2502 }
2503
2504 pub fn r#get(
2506 &self,
2507 ) -> fidl::client::QueryResponseFut<fidl::DebugLog, fidl::encoding::DefaultFuchsiaResourceDialect>
2508 {
2509 ReadOnlyLogProxyInterface::r#get(self)
2510 }
2511}
2512
2513impl ReadOnlyLogProxyInterface for ReadOnlyLogProxy {
2514 type GetResponseFut = fidl::client::QueryResponseFut<
2515 fidl::DebugLog,
2516 fidl::encoding::DefaultFuchsiaResourceDialect,
2517 >;
2518 fn r#get(&self) -> Self::GetResponseFut {
2519 fn _decode(
2520 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2521 ) -> Result<fidl::DebugLog, fidl::Error> {
2522 let _response = fidl::client::decode_transaction_body::<
2523 ReadOnlyLogGetResponse,
2524 fidl::encoding::DefaultFuchsiaResourceDialect,
2525 0x6f3ceba5eca871ff,
2526 >(_buf?)?;
2527 Ok(_response.log)
2528 }
2529 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::DebugLog>(
2530 (),
2531 0x6f3ceba5eca871ff,
2532 fidl::encoding::DynamicFlags::empty(),
2533 _decode,
2534 )
2535 }
2536}
2537
2538pub struct ReadOnlyLogEventStream {
2539 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2540}
2541
2542impl std::marker::Unpin for ReadOnlyLogEventStream {}
2543
2544impl futures::stream::FusedStream for ReadOnlyLogEventStream {
2545 fn is_terminated(&self) -> bool {
2546 self.event_receiver.is_terminated()
2547 }
2548}
2549
2550impl futures::Stream for ReadOnlyLogEventStream {
2551 type Item = Result<ReadOnlyLogEvent, fidl::Error>;
2552
2553 fn poll_next(
2554 mut self: std::pin::Pin<&mut Self>,
2555 cx: &mut std::task::Context<'_>,
2556 ) -> std::task::Poll<Option<Self::Item>> {
2557 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2558 &mut self.event_receiver,
2559 cx
2560 )?) {
2561 Some(buf) => std::task::Poll::Ready(Some(ReadOnlyLogEvent::decode(buf))),
2562 None => std::task::Poll::Ready(None),
2563 }
2564 }
2565}
2566
2567#[derive(Debug)]
2568pub enum ReadOnlyLogEvent {}
2569
2570impl ReadOnlyLogEvent {
2571 fn decode(
2573 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2574 ) -> Result<ReadOnlyLogEvent, fidl::Error> {
2575 let (bytes, _handles) = buf.split_mut();
2576 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2577 debug_assert_eq!(tx_header.tx_id, 0);
2578 match tx_header.ordinal {
2579 _ => Err(fidl::Error::UnknownOrdinal {
2580 ordinal: tx_header.ordinal,
2581 protocol_name: <ReadOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2582 }),
2583 }
2584 }
2585}
2586
2587pub struct ReadOnlyLogRequestStream {
2589 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2590 is_terminated: bool,
2591}
2592
2593impl std::marker::Unpin for ReadOnlyLogRequestStream {}
2594
2595impl futures::stream::FusedStream for ReadOnlyLogRequestStream {
2596 fn is_terminated(&self) -> bool {
2597 self.is_terminated
2598 }
2599}
2600
2601impl fidl::endpoints::RequestStream for ReadOnlyLogRequestStream {
2602 type Protocol = ReadOnlyLogMarker;
2603 type ControlHandle = ReadOnlyLogControlHandle;
2604
2605 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2606 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2607 }
2608
2609 fn control_handle(&self) -> Self::ControlHandle {
2610 ReadOnlyLogControlHandle { inner: self.inner.clone() }
2611 }
2612
2613 fn into_inner(
2614 self,
2615 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2616 {
2617 (self.inner, self.is_terminated)
2618 }
2619
2620 fn from_inner(
2621 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2622 is_terminated: bool,
2623 ) -> Self {
2624 Self { inner, is_terminated }
2625 }
2626}
2627
2628impl futures::Stream for ReadOnlyLogRequestStream {
2629 type Item = Result<ReadOnlyLogRequest, fidl::Error>;
2630
2631 fn poll_next(
2632 mut self: std::pin::Pin<&mut Self>,
2633 cx: &mut std::task::Context<'_>,
2634 ) -> std::task::Poll<Option<Self::Item>> {
2635 let this = &mut *self;
2636 if this.inner.check_shutdown(cx) {
2637 this.is_terminated = true;
2638 return std::task::Poll::Ready(None);
2639 }
2640 if this.is_terminated {
2641 panic!("polled ReadOnlyLogRequestStream after completion");
2642 }
2643 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2644 |bytes, handles| {
2645 match this.inner.channel().read_etc(cx, bytes, handles) {
2646 std::task::Poll::Ready(Ok(())) => {}
2647 std::task::Poll::Pending => return std::task::Poll::Pending,
2648 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2649 this.is_terminated = true;
2650 return std::task::Poll::Ready(None);
2651 }
2652 std::task::Poll::Ready(Err(e)) => {
2653 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2654 e.into(),
2655 ))))
2656 }
2657 }
2658
2659 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2661
2662 std::task::Poll::Ready(Some(match header.ordinal {
2663 0x6f3ceba5eca871ff => {
2664 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2665 let mut req = fidl::new_empty!(
2666 fidl::encoding::EmptyPayload,
2667 fidl::encoding::DefaultFuchsiaResourceDialect
2668 );
2669 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2670 let control_handle = ReadOnlyLogControlHandle { inner: this.inner.clone() };
2671 Ok(ReadOnlyLogRequest::Get {
2672 responder: ReadOnlyLogGetResponder {
2673 control_handle: std::mem::ManuallyDrop::new(control_handle),
2674 tx_id: header.tx_id,
2675 },
2676 })
2677 }
2678 _ => Err(fidl::Error::UnknownOrdinal {
2679 ordinal: header.ordinal,
2680 protocol_name:
2681 <ReadOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2682 }),
2683 }))
2684 },
2685 )
2686 }
2687}
2688
2689#[derive(Debug)]
2691pub enum ReadOnlyLogRequest {
2692 Get { responder: ReadOnlyLogGetResponder },
2694}
2695
2696impl ReadOnlyLogRequest {
2697 #[allow(irrefutable_let_patterns)]
2698 pub fn into_get(self) -> Option<(ReadOnlyLogGetResponder)> {
2699 if let ReadOnlyLogRequest::Get { responder } = self {
2700 Some((responder))
2701 } else {
2702 None
2703 }
2704 }
2705
2706 pub fn method_name(&self) -> &'static str {
2708 match *self {
2709 ReadOnlyLogRequest::Get { .. } => "get",
2710 }
2711 }
2712}
2713
2714#[derive(Debug, Clone)]
2715pub struct ReadOnlyLogControlHandle {
2716 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2717}
2718
2719impl fidl::endpoints::ControlHandle for ReadOnlyLogControlHandle {
2720 fn shutdown(&self) {
2721 self.inner.shutdown()
2722 }
2723 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2724 self.inner.shutdown_with_epitaph(status)
2725 }
2726
2727 fn is_closed(&self) -> bool {
2728 self.inner.channel().is_closed()
2729 }
2730 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2731 self.inner.channel().on_closed()
2732 }
2733
2734 #[cfg(target_os = "fuchsia")]
2735 fn signal_peer(
2736 &self,
2737 clear_mask: zx::Signals,
2738 set_mask: zx::Signals,
2739 ) -> Result<(), zx_status::Status> {
2740 use fidl::Peered;
2741 self.inner.channel().signal_peer(clear_mask, set_mask)
2742 }
2743}
2744
2745impl ReadOnlyLogControlHandle {}
2746
2747#[must_use = "FIDL methods require a response to be sent"]
2748#[derive(Debug)]
2749pub struct ReadOnlyLogGetResponder {
2750 control_handle: std::mem::ManuallyDrop<ReadOnlyLogControlHandle>,
2751 tx_id: u32,
2752}
2753
2754impl std::ops::Drop for ReadOnlyLogGetResponder {
2758 fn drop(&mut self) {
2759 self.control_handle.shutdown();
2760 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2762 }
2763}
2764
2765impl fidl::endpoints::Responder for ReadOnlyLogGetResponder {
2766 type ControlHandle = ReadOnlyLogControlHandle;
2767
2768 fn control_handle(&self) -> &ReadOnlyLogControlHandle {
2769 &self.control_handle
2770 }
2771
2772 fn drop_without_shutdown(mut self) {
2773 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2775 std::mem::forget(self);
2777 }
2778}
2779
2780impl ReadOnlyLogGetResponder {
2781 pub fn send(self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
2785 let _result = self.send_raw(log);
2786 if _result.is_err() {
2787 self.control_handle.shutdown();
2788 }
2789 self.drop_without_shutdown();
2790 _result
2791 }
2792
2793 pub fn send_no_shutdown_on_err(self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
2795 let _result = self.send_raw(log);
2796 self.drop_without_shutdown();
2797 _result
2798 }
2799
2800 fn send_raw(&self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
2801 self.control_handle.inner.send::<ReadOnlyLogGetResponse>(
2802 (log,),
2803 self.tx_id,
2804 0x6f3ceba5eca871ff,
2805 fidl::encoding::DynamicFlags::empty(),
2806 )
2807 }
2808}
2809
2810#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2811pub struct SvcStashMarker;
2812
2813impl fidl::endpoints::ProtocolMarker for SvcStashMarker {
2814 type Proxy = SvcStashProxy;
2815 type RequestStream = SvcStashRequestStream;
2816 #[cfg(target_os = "fuchsia")]
2817 type SynchronousProxy = SvcStashSynchronousProxy;
2818
2819 const DEBUG_NAME: &'static str = "(anonymous) SvcStash";
2820}
2821
2822pub trait SvcStashProxyInterface: Send + Sync {
2823 fn r#store(
2824 &self,
2825 svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2826 ) -> Result<(), fidl::Error>;
2827}
2828#[derive(Debug)]
2829#[cfg(target_os = "fuchsia")]
2830pub struct SvcStashSynchronousProxy {
2831 client: fidl::client::sync::Client,
2832}
2833
2834#[cfg(target_os = "fuchsia")]
2835impl fidl::endpoints::SynchronousProxy for SvcStashSynchronousProxy {
2836 type Proxy = SvcStashProxy;
2837 type Protocol = SvcStashMarker;
2838
2839 fn from_channel(inner: fidl::Channel) -> Self {
2840 Self::new(inner)
2841 }
2842
2843 fn into_channel(self) -> fidl::Channel {
2844 self.client.into_channel()
2845 }
2846
2847 fn as_channel(&self) -> &fidl::Channel {
2848 self.client.as_channel()
2849 }
2850}
2851
2852#[cfg(target_os = "fuchsia")]
2853impl SvcStashSynchronousProxy {
2854 pub fn new(channel: fidl::Channel) -> Self {
2855 let protocol_name = <SvcStashMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2856 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2857 }
2858
2859 pub fn into_channel(self) -> fidl::Channel {
2860 self.client.into_channel()
2861 }
2862
2863 pub fn wait_for_event(
2866 &self,
2867 deadline: zx::MonotonicInstant,
2868 ) -> Result<SvcStashEvent, fidl::Error> {
2869 SvcStashEvent::decode(self.client.wait_for_event(deadline)?)
2870 }
2871
2872 pub fn r#store(
2876 &self,
2877 mut svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2878 ) -> Result<(), fidl::Error> {
2879 self.client.send::<SvcStashStoreRequest>(
2880 (svc_endpoint,),
2881 0xc2648e356ca2870,
2882 fidl::encoding::DynamicFlags::empty(),
2883 )
2884 }
2885}
2886
2887#[cfg(target_os = "fuchsia")]
2888impl From<SvcStashSynchronousProxy> for zx::Handle {
2889 fn from(value: SvcStashSynchronousProxy) -> Self {
2890 value.into_channel().into()
2891 }
2892}
2893
2894#[cfg(target_os = "fuchsia")]
2895impl From<fidl::Channel> for SvcStashSynchronousProxy {
2896 fn from(value: fidl::Channel) -> Self {
2897 Self::new(value)
2898 }
2899}
2900
2901#[derive(Debug, Clone)]
2902pub struct SvcStashProxy {
2903 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2904}
2905
2906impl fidl::endpoints::Proxy for SvcStashProxy {
2907 type Protocol = SvcStashMarker;
2908
2909 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2910 Self::new(inner)
2911 }
2912
2913 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2914 self.client.into_channel().map_err(|client| Self { client })
2915 }
2916
2917 fn as_channel(&self) -> &::fidl::AsyncChannel {
2918 self.client.as_channel()
2919 }
2920}
2921
2922impl SvcStashProxy {
2923 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2925 let protocol_name = <SvcStashMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2926 Self { client: fidl::client::Client::new(channel, protocol_name) }
2927 }
2928
2929 pub fn take_event_stream(&self) -> SvcStashEventStream {
2935 SvcStashEventStream { event_receiver: self.client.take_event_receiver() }
2936 }
2937
2938 pub fn r#store(
2942 &self,
2943 mut svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2944 ) -> Result<(), fidl::Error> {
2945 SvcStashProxyInterface::r#store(self, svc_endpoint)
2946 }
2947}
2948
2949impl SvcStashProxyInterface for SvcStashProxy {
2950 fn r#store(
2951 &self,
2952 mut svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2953 ) -> Result<(), fidl::Error> {
2954 self.client.send::<SvcStashStoreRequest>(
2955 (svc_endpoint,),
2956 0xc2648e356ca2870,
2957 fidl::encoding::DynamicFlags::empty(),
2958 )
2959 }
2960}
2961
2962pub struct SvcStashEventStream {
2963 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2964}
2965
2966impl std::marker::Unpin for SvcStashEventStream {}
2967
2968impl futures::stream::FusedStream for SvcStashEventStream {
2969 fn is_terminated(&self) -> bool {
2970 self.event_receiver.is_terminated()
2971 }
2972}
2973
2974impl futures::Stream for SvcStashEventStream {
2975 type Item = Result<SvcStashEvent, fidl::Error>;
2976
2977 fn poll_next(
2978 mut self: std::pin::Pin<&mut Self>,
2979 cx: &mut std::task::Context<'_>,
2980 ) -> std::task::Poll<Option<Self::Item>> {
2981 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2982 &mut self.event_receiver,
2983 cx
2984 )?) {
2985 Some(buf) => std::task::Poll::Ready(Some(SvcStashEvent::decode(buf))),
2986 None => std::task::Poll::Ready(None),
2987 }
2988 }
2989}
2990
2991#[derive(Debug)]
2992pub enum SvcStashEvent {}
2993
2994impl SvcStashEvent {
2995 fn decode(
2997 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2998 ) -> Result<SvcStashEvent, fidl::Error> {
2999 let (bytes, _handles) = buf.split_mut();
3000 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3001 debug_assert_eq!(tx_header.tx_id, 0);
3002 match tx_header.ordinal {
3003 _ => Err(fidl::Error::UnknownOrdinal {
3004 ordinal: tx_header.ordinal,
3005 protocol_name: <SvcStashMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3006 }),
3007 }
3008 }
3009}
3010
3011pub struct SvcStashRequestStream {
3013 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3014 is_terminated: bool,
3015}
3016
3017impl std::marker::Unpin for SvcStashRequestStream {}
3018
3019impl futures::stream::FusedStream for SvcStashRequestStream {
3020 fn is_terminated(&self) -> bool {
3021 self.is_terminated
3022 }
3023}
3024
3025impl fidl::endpoints::RequestStream for SvcStashRequestStream {
3026 type Protocol = SvcStashMarker;
3027 type ControlHandle = SvcStashControlHandle;
3028
3029 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3030 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3031 }
3032
3033 fn control_handle(&self) -> Self::ControlHandle {
3034 SvcStashControlHandle { inner: self.inner.clone() }
3035 }
3036
3037 fn into_inner(
3038 self,
3039 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3040 {
3041 (self.inner, self.is_terminated)
3042 }
3043
3044 fn from_inner(
3045 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3046 is_terminated: bool,
3047 ) -> Self {
3048 Self { inner, is_terminated }
3049 }
3050}
3051
3052impl futures::Stream for SvcStashRequestStream {
3053 type Item = Result<SvcStashRequest, fidl::Error>;
3054
3055 fn poll_next(
3056 mut self: std::pin::Pin<&mut Self>,
3057 cx: &mut std::task::Context<'_>,
3058 ) -> std::task::Poll<Option<Self::Item>> {
3059 let this = &mut *self;
3060 if this.inner.check_shutdown(cx) {
3061 this.is_terminated = true;
3062 return std::task::Poll::Ready(None);
3063 }
3064 if this.is_terminated {
3065 panic!("polled SvcStashRequestStream after completion");
3066 }
3067 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3068 |bytes, handles| {
3069 match this.inner.channel().read_etc(cx, bytes, handles) {
3070 std::task::Poll::Ready(Ok(())) => {}
3071 std::task::Poll::Pending => return std::task::Poll::Pending,
3072 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3073 this.is_terminated = true;
3074 return std::task::Poll::Ready(None);
3075 }
3076 std::task::Poll::Ready(Err(e)) => {
3077 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3078 e.into(),
3079 ))))
3080 }
3081 }
3082
3083 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3085
3086 std::task::Poll::Ready(Some(match header.ordinal {
3087 0xc2648e356ca2870 => {
3088 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3089 let mut req = fidl::new_empty!(
3090 SvcStashStoreRequest,
3091 fidl::encoding::DefaultFuchsiaResourceDialect
3092 );
3093 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SvcStashStoreRequest>(&header, _body_bytes, handles, &mut req)?;
3094 let control_handle = SvcStashControlHandle { inner: this.inner.clone() };
3095 Ok(SvcStashRequest::Store {
3096 svc_endpoint: req.svc_endpoint,
3097
3098 control_handle,
3099 })
3100 }
3101 _ => Err(fidl::Error::UnknownOrdinal {
3102 ordinal: header.ordinal,
3103 protocol_name:
3104 <SvcStashMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3105 }),
3106 }))
3107 },
3108 )
3109 }
3110}
3111
3112#[derive(Debug)]
3114pub enum SvcStashRequest {
3115 Store {
3119 svc_endpoint: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3120 control_handle: SvcStashControlHandle,
3121 },
3122}
3123
3124impl SvcStashRequest {
3125 #[allow(irrefutable_let_patterns)]
3126 pub fn into_store(
3127 self,
3128 ) -> Option<(fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>, SvcStashControlHandle)>
3129 {
3130 if let SvcStashRequest::Store { svc_endpoint, control_handle } = self {
3131 Some((svc_endpoint, control_handle))
3132 } else {
3133 None
3134 }
3135 }
3136
3137 pub fn method_name(&self) -> &'static str {
3139 match *self {
3140 SvcStashRequest::Store { .. } => "store",
3141 }
3142 }
3143}
3144
3145#[derive(Debug, Clone)]
3146pub struct SvcStashControlHandle {
3147 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3148}
3149
3150impl fidl::endpoints::ControlHandle for SvcStashControlHandle {
3151 fn shutdown(&self) {
3152 self.inner.shutdown()
3153 }
3154 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3155 self.inner.shutdown_with_epitaph(status)
3156 }
3157
3158 fn is_closed(&self) -> bool {
3159 self.inner.channel().is_closed()
3160 }
3161 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3162 self.inner.channel().on_closed()
3163 }
3164
3165 #[cfg(target_os = "fuchsia")]
3166 fn signal_peer(
3167 &self,
3168 clear_mask: zx::Signals,
3169 set_mask: zx::Signals,
3170 ) -> Result<(), zx_status::Status> {
3171 use fidl::Peered;
3172 self.inner.channel().signal_peer(clear_mask, set_mask)
3173 }
3174}
3175
3176impl SvcStashControlHandle {}
3177
3178#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3179pub struct SvcStashProviderMarker;
3180
3181impl fidl::endpoints::ProtocolMarker for SvcStashProviderMarker {
3182 type Proxy = SvcStashProviderProxy;
3183 type RequestStream = SvcStashProviderRequestStream;
3184 #[cfg(target_os = "fuchsia")]
3185 type SynchronousProxy = SvcStashProviderSynchronousProxy;
3186
3187 const DEBUG_NAME: &'static str = "fuchsia.boot.SvcStashProvider";
3188}
3189impl fidl::endpoints::DiscoverableProtocolMarker for SvcStashProviderMarker {}
3190pub type SvcStashProviderGetResult = Result<fidl::endpoints::ServerEnd<SvcStashMarker>, i32>;
3191
3192pub trait SvcStashProviderProxyInterface: Send + Sync {
3193 type GetResponseFut: std::future::Future<Output = Result<SvcStashProviderGetResult, fidl::Error>>
3194 + Send;
3195 fn r#get(&self) -> Self::GetResponseFut;
3196}
3197#[derive(Debug)]
3198#[cfg(target_os = "fuchsia")]
3199pub struct SvcStashProviderSynchronousProxy {
3200 client: fidl::client::sync::Client,
3201}
3202
3203#[cfg(target_os = "fuchsia")]
3204impl fidl::endpoints::SynchronousProxy for SvcStashProviderSynchronousProxy {
3205 type Proxy = SvcStashProviderProxy;
3206 type Protocol = SvcStashProviderMarker;
3207
3208 fn from_channel(inner: fidl::Channel) -> Self {
3209 Self::new(inner)
3210 }
3211
3212 fn into_channel(self) -> fidl::Channel {
3213 self.client.into_channel()
3214 }
3215
3216 fn as_channel(&self) -> &fidl::Channel {
3217 self.client.as_channel()
3218 }
3219}
3220
3221#[cfg(target_os = "fuchsia")]
3222impl SvcStashProviderSynchronousProxy {
3223 pub fn new(channel: fidl::Channel) -> Self {
3224 let protocol_name = <SvcStashProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3225 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3226 }
3227
3228 pub fn into_channel(self) -> fidl::Channel {
3229 self.client.into_channel()
3230 }
3231
3232 pub fn wait_for_event(
3235 &self,
3236 deadline: zx::MonotonicInstant,
3237 ) -> Result<SvcStashProviderEvent, fidl::Error> {
3238 SvcStashProviderEvent::decode(self.client.wait_for_event(deadline)?)
3239 }
3240
3241 pub fn r#get(
3246 &self,
3247 ___deadline: zx::MonotonicInstant,
3248 ) -> Result<SvcStashProviderGetResult, fidl::Error> {
3249 let _response = self.client.send_query::<
3250 fidl::encoding::EmptyPayload,
3251 fidl::encoding::ResultType<SvcStashProviderGetResponse, i32>,
3252 >(
3253 (),
3254 0x3885bad5b734f883,
3255 fidl::encoding::DynamicFlags::empty(),
3256 ___deadline,
3257 )?;
3258 Ok(_response.map(|x| x.resource))
3259 }
3260}
3261
3262#[cfg(target_os = "fuchsia")]
3263impl From<SvcStashProviderSynchronousProxy> for zx::Handle {
3264 fn from(value: SvcStashProviderSynchronousProxy) -> Self {
3265 value.into_channel().into()
3266 }
3267}
3268
3269#[cfg(target_os = "fuchsia")]
3270impl From<fidl::Channel> for SvcStashProviderSynchronousProxy {
3271 fn from(value: fidl::Channel) -> Self {
3272 Self::new(value)
3273 }
3274}
3275
3276#[derive(Debug, Clone)]
3277pub struct SvcStashProviderProxy {
3278 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3279}
3280
3281impl fidl::endpoints::Proxy for SvcStashProviderProxy {
3282 type Protocol = SvcStashProviderMarker;
3283
3284 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3285 Self::new(inner)
3286 }
3287
3288 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3289 self.client.into_channel().map_err(|client| Self { client })
3290 }
3291
3292 fn as_channel(&self) -> &::fidl::AsyncChannel {
3293 self.client.as_channel()
3294 }
3295}
3296
3297impl SvcStashProviderProxy {
3298 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3300 let protocol_name = <SvcStashProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3301 Self { client: fidl::client::Client::new(channel, protocol_name) }
3302 }
3303
3304 pub fn take_event_stream(&self) -> SvcStashProviderEventStream {
3310 SvcStashProviderEventStream { event_receiver: self.client.take_event_receiver() }
3311 }
3312
3313 pub fn r#get(
3318 &self,
3319 ) -> fidl::client::QueryResponseFut<
3320 SvcStashProviderGetResult,
3321 fidl::encoding::DefaultFuchsiaResourceDialect,
3322 > {
3323 SvcStashProviderProxyInterface::r#get(self)
3324 }
3325}
3326
3327impl SvcStashProviderProxyInterface for SvcStashProviderProxy {
3328 type GetResponseFut = fidl::client::QueryResponseFut<
3329 SvcStashProviderGetResult,
3330 fidl::encoding::DefaultFuchsiaResourceDialect,
3331 >;
3332 fn r#get(&self) -> Self::GetResponseFut {
3333 fn _decode(
3334 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3335 ) -> Result<SvcStashProviderGetResult, fidl::Error> {
3336 let _response = fidl::client::decode_transaction_body::<
3337 fidl::encoding::ResultType<SvcStashProviderGetResponse, i32>,
3338 fidl::encoding::DefaultFuchsiaResourceDialect,
3339 0x3885bad5b734f883,
3340 >(_buf?)?;
3341 Ok(_response.map(|x| x.resource))
3342 }
3343 self.client
3344 .send_query_and_decode::<fidl::encoding::EmptyPayload, SvcStashProviderGetResult>(
3345 (),
3346 0x3885bad5b734f883,
3347 fidl::encoding::DynamicFlags::empty(),
3348 _decode,
3349 )
3350 }
3351}
3352
3353pub struct SvcStashProviderEventStream {
3354 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3355}
3356
3357impl std::marker::Unpin for SvcStashProviderEventStream {}
3358
3359impl futures::stream::FusedStream for SvcStashProviderEventStream {
3360 fn is_terminated(&self) -> bool {
3361 self.event_receiver.is_terminated()
3362 }
3363}
3364
3365impl futures::Stream for SvcStashProviderEventStream {
3366 type Item = Result<SvcStashProviderEvent, fidl::Error>;
3367
3368 fn poll_next(
3369 mut self: std::pin::Pin<&mut Self>,
3370 cx: &mut std::task::Context<'_>,
3371 ) -> std::task::Poll<Option<Self::Item>> {
3372 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3373 &mut self.event_receiver,
3374 cx
3375 )?) {
3376 Some(buf) => std::task::Poll::Ready(Some(SvcStashProviderEvent::decode(buf))),
3377 None => std::task::Poll::Ready(None),
3378 }
3379 }
3380}
3381
3382#[derive(Debug)]
3383pub enum SvcStashProviderEvent {}
3384
3385impl SvcStashProviderEvent {
3386 fn decode(
3388 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3389 ) -> Result<SvcStashProviderEvent, fidl::Error> {
3390 let (bytes, _handles) = buf.split_mut();
3391 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3392 debug_assert_eq!(tx_header.tx_id, 0);
3393 match tx_header.ordinal {
3394 _ => Err(fidl::Error::UnknownOrdinal {
3395 ordinal: tx_header.ordinal,
3396 protocol_name:
3397 <SvcStashProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3398 }),
3399 }
3400 }
3401}
3402
3403pub struct SvcStashProviderRequestStream {
3405 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3406 is_terminated: bool,
3407}
3408
3409impl std::marker::Unpin for SvcStashProviderRequestStream {}
3410
3411impl futures::stream::FusedStream for SvcStashProviderRequestStream {
3412 fn is_terminated(&self) -> bool {
3413 self.is_terminated
3414 }
3415}
3416
3417impl fidl::endpoints::RequestStream for SvcStashProviderRequestStream {
3418 type Protocol = SvcStashProviderMarker;
3419 type ControlHandle = SvcStashProviderControlHandle;
3420
3421 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3422 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3423 }
3424
3425 fn control_handle(&self) -> Self::ControlHandle {
3426 SvcStashProviderControlHandle { inner: self.inner.clone() }
3427 }
3428
3429 fn into_inner(
3430 self,
3431 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3432 {
3433 (self.inner, self.is_terminated)
3434 }
3435
3436 fn from_inner(
3437 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3438 is_terminated: bool,
3439 ) -> Self {
3440 Self { inner, is_terminated }
3441 }
3442}
3443
3444impl futures::Stream for SvcStashProviderRequestStream {
3445 type Item = Result<SvcStashProviderRequest, fidl::Error>;
3446
3447 fn poll_next(
3448 mut self: std::pin::Pin<&mut Self>,
3449 cx: &mut std::task::Context<'_>,
3450 ) -> std::task::Poll<Option<Self::Item>> {
3451 let this = &mut *self;
3452 if this.inner.check_shutdown(cx) {
3453 this.is_terminated = true;
3454 return std::task::Poll::Ready(None);
3455 }
3456 if this.is_terminated {
3457 panic!("polled SvcStashProviderRequestStream after completion");
3458 }
3459 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3460 |bytes, handles| {
3461 match this.inner.channel().read_etc(cx, bytes, handles) {
3462 std::task::Poll::Ready(Ok(())) => {}
3463 std::task::Poll::Pending => return std::task::Poll::Pending,
3464 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3465 this.is_terminated = true;
3466 return std::task::Poll::Ready(None);
3467 }
3468 std::task::Poll::Ready(Err(e)) => {
3469 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3470 e.into(),
3471 ))))
3472 }
3473 }
3474
3475 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3477
3478 std::task::Poll::Ready(Some(match header.ordinal {
3479 0x3885bad5b734f883 => {
3480 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3481 let mut req = fidl::new_empty!(
3482 fidl::encoding::EmptyPayload,
3483 fidl::encoding::DefaultFuchsiaResourceDialect
3484 );
3485 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3486 let control_handle =
3487 SvcStashProviderControlHandle { inner: this.inner.clone() };
3488 Ok(SvcStashProviderRequest::Get {
3489 responder: SvcStashProviderGetResponder {
3490 control_handle: std::mem::ManuallyDrop::new(control_handle),
3491 tx_id: header.tx_id,
3492 },
3493 })
3494 }
3495 _ => Err(fidl::Error::UnknownOrdinal {
3496 ordinal: header.ordinal,
3497 protocol_name:
3498 <SvcStashProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3499 }),
3500 }))
3501 },
3502 )
3503 }
3504}
3505
3506#[derive(Debug)]
3508pub enum SvcStashProviderRequest {
3509 Get { responder: SvcStashProviderGetResponder },
3514}
3515
3516impl SvcStashProviderRequest {
3517 #[allow(irrefutable_let_patterns)]
3518 pub fn into_get(self) -> Option<(SvcStashProviderGetResponder)> {
3519 if let SvcStashProviderRequest::Get { responder } = self {
3520 Some((responder))
3521 } else {
3522 None
3523 }
3524 }
3525
3526 pub fn method_name(&self) -> &'static str {
3528 match *self {
3529 SvcStashProviderRequest::Get { .. } => "get",
3530 }
3531 }
3532}
3533
3534#[derive(Debug, Clone)]
3535pub struct SvcStashProviderControlHandle {
3536 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3537}
3538
3539impl fidl::endpoints::ControlHandle for SvcStashProviderControlHandle {
3540 fn shutdown(&self) {
3541 self.inner.shutdown()
3542 }
3543 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3544 self.inner.shutdown_with_epitaph(status)
3545 }
3546
3547 fn is_closed(&self) -> bool {
3548 self.inner.channel().is_closed()
3549 }
3550 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3551 self.inner.channel().on_closed()
3552 }
3553
3554 #[cfg(target_os = "fuchsia")]
3555 fn signal_peer(
3556 &self,
3557 clear_mask: zx::Signals,
3558 set_mask: zx::Signals,
3559 ) -> Result<(), zx_status::Status> {
3560 use fidl::Peered;
3561 self.inner.channel().signal_peer(clear_mask, set_mask)
3562 }
3563}
3564
3565impl SvcStashProviderControlHandle {}
3566
3567#[must_use = "FIDL methods require a response to be sent"]
3568#[derive(Debug)]
3569pub struct SvcStashProviderGetResponder {
3570 control_handle: std::mem::ManuallyDrop<SvcStashProviderControlHandle>,
3571 tx_id: u32,
3572}
3573
3574impl std::ops::Drop for SvcStashProviderGetResponder {
3578 fn drop(&mut self) {
3579 self.control_handle.shutdown();
3580 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3582 }
3583}
3584
3585impl fidl::endpoints::Responder for SvcStashProviderGetResponder {
3586 type ControlHandle = SvcStashProviderControlHandle;
3587
3588 fn control_handle(&self) -> &SvcStashProviderControlHandle {
3589 &self.control_handle
3590 }
3591
3592 fn drop_without_shutdown(mut self) {
3593 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3595 std::mem::forget(self);
3597 }
3598}
3599
3600impl SvcStashProviderGetResponder {
3601 pub fn send(
3605 self,
3606 mut result: Result<fidl::endpoints::ServerEnd<SvcStashMarker>, i32>,
3607 ) -> Result<(), fidl::Error> {
3608 let _result = self.send_raw(result);
3609 if _result.is_err() {
3610 self.control_handle.shutdown();
3611 }
3612 self.drop_without_shutdown();
3613 _result
3614 }
3615
3616 pub fn send_no_shutdown_on_err(
3618 self,
3619 mut result: Result<fidl::endpoints::ServerEnd<SvcStashMarker>, i32>,
3620 ) -> Result<(), fidl::Error> {
3621 let _result = self.send_raw(result);
3622 self.drop_without_shutdown();
3623 _result
3624 }
3625
3626 fn send_raw(
3627 &self,
3628 mut result: Result<fidl::endpoints::ServerEnd<SvcStashMarker>, i32>,
3629 ) -> Result<(), fidl::Error> {
3630 self.control_handle
3631 .inner
3632 .send::<fidl::encoding::ResultType<SvcStashProviderGetResponse, i32>>(
3633 result.map(|resource| (resource,)),
3634 self.tx_id,
3635 0x3885bad5b734f883,
3636 fidl::encoding::DynamicFlags::empty(),
3637 )
3638 }
3639}
3640
3641#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3642pub struct UserbootMarker;
3643
3644impl fidl::endpoints::ProtocolMarker for UserbootMarker {
3645 type Proxy = UserbootProxy;
3646 type RequestStream = UserbootRequestStream;
3647 #[cfg(target_os = "fuchsia")]
3648 type SynchronousProxy = UserbootSynchronousProxy;
3649
3650 const DEBUG_NAME: &'static str = "(anonymous) Userboot";
3651}
3652
3653pub trait UserbootProxyInterface: Send + Sync {
3654 fn r#post_bootfs_files(&self, files: Vec<BootfsFileVmo>) -> Result<(), fidl::Error>;
3655 fn r#post_stash_svc(
3656 &self,
3657 stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
3658 ) -> Result<(), fidl::Error>;
3659}
3660#[derive(Debug)]
3661#[cfg(target_os = "fuchsia")]
3662pub struct UserbootSynchronousProxy {
3663 client: fidl::client::sync::Client,
3664}
3665
3666#[cfg(target_os = "fuchsia")]
3667impl fidl::endpoints::SynchronousProxy for UserbootSynchronousProxy {
3668 type Proxy = UserbootProxy;
3669 type Protocol = UserbootMarker;
3670
3671 fn from_channel(inner: fidl::Channel) -> Self {
3672 Self::new(inner)
3673 }
3674
3675 fn into_channel(self) -> fidl::Channel {
3676 self.client.into_channel()
3677 }
3678
3679 fn as_channel(&self) -> &fidl::Channel {
3680 self.client.as_channel()
3681 }
3682}
3683
3684#[cfg(target_os = "fuchsia")]
3685impl UserbootSynchronousProxy {
3686 pub fn new(channel: fidl::Channel) -> Self {
3687 let protocol_name = <UserbootMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3688 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3689 }
3690
3691 pub fn into_channel(self) -> fidl::Channel {
3692 self.client.into_channel()
3693 }
3694
3695 pub fn wait_for_event(
3698 &self,
3699 deadline: zx::MonotonicInstant,
3700 ) -> Result<UserbootEvent, fidl::Error> {
3701 UserbootEvent::decode(self.client.wait_for_event(deadline)?)
3702 }
3703
3704 pub fn r#post_bootfs_files(&self, mut files: Vec<BootfsFileVmo>) -> Result<(), fidl::Error> {
3710 self.client.send::<UserbootPostBootfsFilesRequest>(
3711 (files.as_mut(),),
3712 0x296d4420db7cc694,
3713 fidl::encoding::DynamicFlags::empty(),
3714 )
3715 }
3716
3717 pub fn r#post_stash_svc(
3719 &self,
3720 mut stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
3721 ) -> Result<(), fidl::Error> {
3722 self.client.send::<UserbootPostStashSvcRequest>(
3723 (stash_svc_endpoint,),
3724 0x506ecf7db01adeac,
3725 fidl::encoding::DynamicFlags::empty(),
3726 )
3727 }
3728}
3729
3730#[cfg(target_os = "fuchsia")]
3731impl From<UserbootSynchronousProxy> for zx::Handle {
3732 fn from(value: UserbootSynchronousProxy) -> Self {
3733 value.into_channel().into()
3734 }
3735}
3736
3737#[cfg(target_os = "fuchsia")]
3738impl From<fidl::Channel> for UserbootSynchronousProxy {
3739 fn from(value: fidl::Channel) -> Self {
3740 Self::new(value)
3741 }
3742}
3743
3744#[derive(Debug, Clone)]
3745pub struct UserbootProxy {
3746 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3747}
3748
3749impl fidl::endpoints::Proxy for UserbootProxy {
3750 type Protocol = UserbootMarker;
3751
3752 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3753 Self::new(inner)
3754 }
3755
3756 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3757 self.client.into_channel().map_err(|client| Self { client })
3758 }
3759
3760 fn as_channel(&self) -> &::fidl::AsyncChannel {
3761 self.client.as_channel()
3762 }
3763}
3764
3765impl UserbootProxy {
3766 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3768 let protocol_name = <UserbootMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3769 Self { client: fidl::client::Client::new(channel, protocol_name) }
3770 }
3771
3772 pub fn take_event_stream(&self) -> UserbootEventStream {
3778 UserbootEventStream { event_receiver: self.client.take_event_receiver() }
3779 }
3780
3781 pub fn r#post_bootfs_files(&self, mut files: Vec<BootfsFileVmo>) -> Result<(), fidl::Error> {
3787 UserbootProxyInterface::r#post_bootfs_files(self, files)
3788 }
3789
3790 pub fn r#post_stash_svc(
3792 &self,
3793 mut stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
3794 ) -> Result<(), fidl::Error> {
3795 UserbootProxyInterface::r#post_stash_svc(self, stash_svc_endpoint)
3796 }
3797}
3798
3799impl UserbootProxyInterface for UserbootProxy {
3800 fn r#post_bootfs_files(&self, mut files: Vec<BootfsFileVmo>) -> Result<(), fidl::Error> {
3801 self.client.send::<UserbootPostBootfsFilesRequest>(
3802 (files.as_mut(),),
3803 0x296d4420db7cc694,
3804 fidl::encoding::DynamicFlags::empty(),
3805 )
3806 }
3807
3808 fn r#post_stash_svc(
3809 &self,
3810 mut stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
3811 ) -> Result<(), fidl::Error> {
3812 self.client.send::<UserbootPostStashSvcRequest>(
3813 (stash_svc_endpoint,),
3814 0x506ecf7db01adeac,
3815 fidl::encoding::DynamicFlags::empty(),
3816 )
3817 }
3818}
3819
3820pub struct UserbootEventStream {
3821 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3822}
3823
3824impl std::marker::Unpin for UserbootEventStream {}
3825
3826impl futures::stream::FusedStream for UserbootEventStream {
3827 fn is_terminated(&self) -> bool {
3828 self.event_receiver.is_terminated()
3829 }
3830}
3831
3832impl futures::Stream for UserbootEventStream {
3833 type Item = Result<UserbootEvent, fidl::Error>;
3834
3835 fn poll_next(
3836 mut self: std::pin::Pin<&mut Self>,
3837 cx: &mut std::task::Context<'_>,
3838 ) -> std::task::Poll<Option<Self::Item>> {
3839 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3840 &mut self.event_receiver,
3841 cx
3842 )?) {
3843 Some(buf) => std::task::Poll::Ready(Some(UserbootEvent::decode(buf))),
3844 None => std::task::Poll::Ready(None),
3845 }
3846 }
3847}
3848
3849#[derive(Debug)]
3850pub enum UserbootEvent {}
3851
3852impl UserbootEvent {
3853 fn decode(
3855 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3856 ) -> Result<UserbootEvent, fidl::Error> {
3857 let (bytes, _handles) = buf.split_mut();
3858 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3859 debug_assert_eq!(tx_header.tx_id, 0);
3860 match tx_header.ordinal {
3861 _ => Err(fidl::Error::UnknownOrdinal {
3862 ordinal: tx_header.ordinal,
3863 protocol_name: <UserbootMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3864 }),
3865 }
3866 }
3867}
3868
3869pub struct UserbootRequestStream {
3871 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3872 is_terminated: bool,
3873}
3874
3875impl std::marker::Unpin for UserbootRequestStream {}
3876
3877impl futures::stream::FusedStream for UserbootRequestStream {
3878 fn is_terminated(&self) -> bool {
3879 self.is_terminated
3880 }
3881}
3882
3883impl fidl::endpoints::RequestStream for UserbootRequestStream {
3884 type Protocol = UserbootMarker;
3885 type ControlHandle = UserbootControlHandle;
3886
3887 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3888 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3889 }
3890
3891 fn control_handle(&self) -> Self::ControlHandle {
3892 UserbootControlHandle { inner: self.inner.clone() }
3893 }
3894
3895 fn into_inner(
3896 self,
3897 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3898 {
3899 (self.inner, self.is_terminated)
3900 }
3901
3902 fn from_inner(
3903 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3904 is_terminated: bool,
3905 ) -> Self {
3906 Self { inner, is_terminated }
3907 }
3908}
3909
3910impl futures::Stream for UserbootRequestStream {
3911 type Item = Result<UserbootRequest, fidl::Error>;
3912
3913 fn poll_next(
3914 mut self: std::pin::Pin<&mut Self>,
3915 cx: &mut std::task::Context<'_>,
3916 ) -> std::task::Poll<Option<Self::Item>> {
3917 let this = &mut *self;
3918 if this.inner.check_shutdown(cx) {
3919 this.is_terminated = true;
3920 return std::task::Poll::Ready(None);
3921 }
3922 if this.is_terminated {
3923 panic!("polled UserbootRequestStream after completion");
3924 }
3925 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3926 |bytes, handles| {
3927 match this.inner.channel().read_etc(cx, bytes, handles) {
3928 std::task::Poll::Ready(Ok(())) => {}
3929 std::task::Poll::Pending => return std::task::Poll::Pending,
3930 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3931 this.is_terminated = true;
3932 return std::task::Poll::Ready(None);
3933 }
3934 std::task::Poll::Ready(Err(e)) => {
3935 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3936 e.into(),
3937 ))))
3938 }
3939 }
3940
3941 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3943
3944 std::task::Poll::Ready(Some(match header.ordinal {
3945 0x296d4420db7cc694 => {
3946 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3947 let mut req = fidl::new_empty!(
3948 UserbootPostBootfsFilesRequest,
3949 fidl::encoding::DefaultFuchsiaResourceDialect
3950 );
3951 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UserbootPostBootfsFilesRequest>(&header, _body_bytes, handles, &mut req)?;
3952 let control_handle = UserbootControlHandle { inner: this.inner.clone() };
3953 Ok(UserbootRequest::PostBootfsFiles { files: req.files, control_handle })
3954 }
3955 0x506ecf7db01adeac => {
3956 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3957 let mut req = fidl::new_empty!(
3958 UserbootPostStashSvcRequest,
3959 fidl::encoding::DefaultFuchsiaResourceDialect
3960 );
3961 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UserbootPostStashSvcRequest>(&header, _body_bytes, handles, &mut req)?;
3962 let control_handle = UserbootControlHandle { inner: this.inner.clone() };
3963 Ok(UserbootRequest::PostStashSvc {
3964 stash_svc_endpoint: req.stash_svc_endpoint,
3965
3966 control_handle,
3967 })
3968 }
3969 _ => Err(fidl::Error::UnknownOrdinal {
3970 ordinal: header.ordinal,
3971 protocol_name:
3972 <UserbootMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3973 }),
3974 }))
3975 },
3976 )
3977 }
3978}
3979
3980#[derive(Debug)]
3988pub enum UserbootRequest {
3989 PostBootfsFiles { files: Vec<BootfsFileVmo>, control_handle: UserbootControlHandle },
3995 PostStashSvc {
3997 stash_svc_endpoint: fidl::endpoints::ServerEnd<SvcStashMarker>,
3998 control_handle: UserbootControlHandle,
3999 },
4000}
4001
4002impl UserbootRequest {
4003 #[allow(irrefutable_let_patterns)]
4004 pub fn into_post_bootfs_files(self) -> Option<(Vec<BootfsFileVmo>, UserbootControlHandle)> {
4005 if let UserbootRequest::PostBootfsFiles { files, control_handle } = self {
4006 Some((files, control_handle))
4007 } else {
4008 None
4009 }
4010 }
4011
4012 #[allow(irrefutable_let_patterns)]
4013 pub fn into_post_stash_svc(
4014 self,
4015 ) -> Option<(fidl::endpoints::ServerEnd<SvcStashMarker>, UserbootControlHandle)> {
4016 if let UserbootRequest::PostStashSvc { stash_svc_endpoint, control_handle } = self {
4017 Some((stash_svc_endpoint, control_handle))
4018 } else {
4019 None
4020 }
4021 }
4022
4023 pub fn method_name(&self) -> &'static str {
4025 match *self {
4026 UserbootRequest::PostBootfsFiles { .. } => "post_bootfs_files",
4027 UserbootRequest::PostStashSvc { .. } => "post_stash_svc",
4028 }
4029 }
4030}
4031
4032#[derive(Debug, Clone)]
4033pub struct UserbootControlHandle {
4034 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4035}
4036
4037impl fidl::endpoints::ControlHandle for UserbootControlHandle {
4038 fn shutdown(&self) {
4039 self.inner.shutdown()
4040 }
4041 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4042 self.inner.shutdown_with_epitaph(status)
4043 }
4044
4045 fn is_closed(&self) -> bool {
4046 self.inner.channel().is_closed()
4047 }
4048 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4049 self.inner.channel().on_closed()
4050 }
4051
4052 #[cfg(target_os = "fuchsia")]
4053 fn signal_peer(
4054 &self,
4055 clear_mask: zx::Signals,
4056 set_mask: zx::Signals,
4057 ) -> Result<(), zx_status::Status> {
4058 use fidl::Peered;
4059 self.inner.channel().signal_peer(clear_mask, set_mask)
4060 }
4061}
4062
4063impl UserbootControlHandle {}
4064
4065#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4066pub struct WriteOnlyLogMarker;
4067
4068impl fidl::endpoints::ProtocolMarker for WriteOnlyLogMarker {
4069 type Proxy = WriteOnlyLogProxy;
4070 type RequestStream = WriteOnlyLogRequestStream;
4071 #[cfg(target_os = "fuchsia")]
4072 type SynchronousProxy = WriteOnlyLogSynchronousProxy;
4073
4074 const DEBUG_NAME: &'static str = "fuchsia.boot.WriteOnlyLog";
4075}
4076impl fidl::endpoints::DiscoverableProtocolMarker for WriteOnlyLogMarker {}
4077
4078pub trait WriteOnlyLogProxyInterface: Send + Sync {
4079 type GetResponseFut: std::future::Future<Output = Result<fidl::DebugLog, fidl::Error>> + Send;
4080 fn r#get(&self) -> Self::GetResponseFut;
4081}
4082#[derive(Debug)]
4083#[cfg(target_os = "fuchsia")]
4084pub struct WriteOnlyLogSynchronousProxy {
4085 client: fidl::client::sync::Client,
4086}
4087
4088#[cfg(target_os = "fuchsia")]
4089impl fidl::endpoints::SynchronousProxy for WriteOnlyLogSynchronousProxy {
4090 type Proxy = WriteOnlyLogProxy;
4091 type Protocol = WriteOnlyLogMarker;
4092
4093 fn from_channel(inner: fidl::Channel) -> Self {
4094 Self::new(inner)
4095 }
4096
4097 fn into_channel(self) -> fidl::Channel {
4098 self.client.into_channel()
4099 }
4100
4101 fn as_channel(&self) -> &fidl::Channel {
4102 self.client.as_channel()
4103 }
4104}
4105
4106#[cfg(target_os = "fuchsia")]
4107impl WriteOnlyLogSynchronousProxy {
4108 pub fn new(channel: fidl::Channel) -> Self {
4109 let protocol_name = <WriteOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4110 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4111 }
4112
4113 pub fn into_channel(self) -> fidl::Channel {
4114 self.client.into_channel()
4115 }
4116
4117 pub fn wait_for_event(
4120 &self,
4121 deadline: zx::MonotonicInstant,
4122 ) -> Result<WriteOnlyLogEvent, fidl::Error> {
4123 WriteOnlyLogEvent::decode(self.client.wait_for_event(deadline)?)
4124 }
4125
4126 pub fn r#get(&self, ___deadline: zx::MonotonicInstant) -> Result<fidl::DebugLog, fidl::Error> {
4128 let _response =
4129 self.client.send_query::<fidl::encoding::EmptyPayload, WriteOnlyLogGetResponse>(
4130 (),
4131 0x4579dac289d3007,
4132 fidl::encoding::DynamicFlags::empty(),
4133 ___deadline,
4134 )?;
4135 Ok(_response.log)
4136 }
4137}
4138
4139#[cfg(target_os = "fuchsia")]
4140impl From<WriteOnlyLogSynchronousProxy> for zx::Handle {
4141 fn from(value: WriteOnlyLogSynchronousProxy) -> Self {
4142 value.into_channel().into()
4143 }
4144}
4145
4146#[cfg(target_os = "fuchsia")]
4147impl From<fidl::Channel> for WriteOnlyLogSynchronousProxy {
4148 fn from(value: fidl::Channel) -> Self {
4149 Self::new(value)
4150 }
4151}
4152
4153#[derive(Debug, Clone)]
4154pub struct WriteOnlyLogProxy {
4155 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4156}
4157
4158impl fidl::endpoints::Proxy for WriteOnlyLogProxy {
4159 type Protocol = WriteOnlyLogMarker;
4160
4161 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4162 Self::new(inner)
4163 }
4164
4165 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4166 self.client.into_channel().map_err(|client| Self { client })
4167 }
4168
4169 fn as_channel(&self) -> &::fidl::AsyncChannel {
4170 self.client.as_channel()
4171 }
4172}
4173
4174impl WriteOnlyLogProxy {
4175 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4177 let protocol_name = <WriteOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4178 Self { client: fidl::client::Client::new(channel, protocol_name) }
4179 }
4180
4181 pub fn take_event_stream(&self) -> WriteOnlyLogEventStream {
4187 WriteOnlyLogEventStream { event_receiver: self.client.take_event_receiver() }
4188 }
4189
4190 pub fn r#get(
4192 &self,
4193 ) -> fidl::client::QueryResponseFut<fidl::DebugLog, fidl::encoding::DefaultFuchsiaResourceDialect>
4194 {
4195 WriteOnlyLogProxyInterface::r#get(self)
4196 }
4197}
4198
4199impl WriteOnlyLogProxyInterface for WriteOnlyLogProxy {
4200 type GetResponseFut = fidl::client::QueryResponseFut<
4201 fidl::DebugLog,
4202 fidl::encoding::DefaultFuchsiaResourceDialect,
4203 >;
4204 fn r#get(&self) -> Self::GetResponseFut {
4205 fn _decode(
4206 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4207 ) -> Result<fidl::DebugLog, fidl::Error> {
4208 let _response = fidl::client::decode_transaction_body::<
4209 WriteOnlyLogGetResponse,
4210 fidl::encoding::DefaultFuchsiaResourceDialect,
4211 0x4579dac289d3007,
4212 >(_buf?)?;
4213 Ok(_response.log)
4214 }
4215 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::DebugLog>(
4216 (),
4217 0x4579dac289d3007,
4218 fidl::encoding::DynamicFlags::empty(),
4219 _decode,
4220 )
4221 }
4222}
4223
4224pub struct WriteOnlyLogEventStream {
4225 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4226}
4227
4228impl std::marker::Unpin for WriteOnlyLogEventStream {}
4229
4230impl futures::stream::FusedStream for WriteOnlyLogEventStream {
4231 fn is_terminated(&self) -> bool {
4232 self.event_receiver.is_terminated()
4233 }
4234}
4235
4236impl futures::Stream for WriteOnlyLogEventStream {
4237 type Item = Result<WriteOnlyLogEvent, fidl::Error>;
4238
4239 fn poll_next(
4240 mut self: std::pin::Pin<&mut Self>,
4241 cx: &mut std::task::Context<'_>,
4242 ) -> std::task::Poll<Option<Self::Item>> {
4243 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4244 &mut self.event_receiver,
4245 cx
4246 )?) {
4247 Some(buf) => std::task::Poll::Ready(Some(WriteOnlyLogEvent::decode(buf))),
4248 None => std::task::Poll::Ready(None),
4249 }
4250 }
4251}
4252
4253#[derive(Debug)]
4254pub enum WriteOnlyLogEvent {}
4255
4256impl WriteOnlyLogEvent {
4257 fn decode(
4259 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4260 ) -> Result<WriteOnlyLogEvent, fidl::Error> {
4261 let (bytes, _handles) = buf.split_mut();
4262 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4263 debug_assert_eq!(tx_header.tx_id, 0);
4264 match tx_header.ordinal {
4265 _ => Err(fidl::Error::UnknownOrdinal {
4266 ordinal: tx_header.ordinal,
4267 protocol_name: <WriteOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4268 }),
4269 }
4270 }
4271}
4272
4273pub struct WriteOnlyLogRequestStream {
4275 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4276 is_terminated: bool,
4277}
4278
4279impl std::marker::Unpin for WriteOnlyLogRequestStream {}
4280
4281impl futures::stream::FusedStream for WriteOnlyLogRequestStream {
4282 fn is_terminated(&self) -> bool {
4283 self.is_terminated
4284 }
4285}
4286
4287impl fidl::endpoints::RequestStream for WriteOnlyLogRequestStream {
4288 type Protocol = WriteOnlyLogMarker;
4289 type ControlHandle = WriteOnlyLogControlHandle;
4290
4291 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4292 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4293 }
4294
4295 fn control_handle(&self) -> Self::ControlHandle {
4296 WriteOnlyLogControlHandle { inner: self.inner.clone() }
4297 }
4298
4299 fn into_inner(
4300 self,
4301 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4302 {
4303 (self.inner, self.is_terminated)
4304 }
4305
4306 fn from_inner(
4307 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4308 is_terminated: bool,
4309 ) -> Self {
4310 Self { inner, is_terminated }
4311 }
4312}
4313
4314impl futures::Stream for WriteOnlyLogRequestStream {
4315 type Item = Result<WriteOnlyLogRequest, fidl::Error>;
4316
4317 fn poll_next(
4318 mut self: std::pin::Pin<&mut Self>,
4319 cx: &mut std::task::Context<'_>,
4320 ) -> std::task::Poll<Option<Self::Item>> {
4321 let this = &mut *self;
4322 if this.inner.check_shutdown(cx) {
4323 this.is_terminated = true;
4324 return std::task::Poll::Ready(None);
4325 }
4326 if this.is_terminated {
4327 panic!("polled WriteOnlyLogRequestStream after completion");
4328 }
4329 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4330 |bytes, handles| {
4331 match this.inner.channel().read_etc(cx, bytes, handles) {
4332 std::task::Poll::Ready(Ok(())) => {}
4333 std::task::Poll::Pending => return std::task::Poll::Pending,
4334 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4335 this.is_terminated = true;
4336 return std::task::Poll::Ready(None);
4337 }
4338 std::task::Poll::Ready(Err(e)) => {
4339 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4340 e.into(),
4341 ))))
4342 }
4343 }
4344
4345 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4347
4348 std::task::Poll::Ready(Some(match header.ordinal {
4349 0x4579dac289d3007 => {
4350 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4351 let mut req = fidl::new_empty!(
4352 fidl::encoding::EmptyPayload,
4353 fidl::encoding::DefaultFuchsiaResourceDialect
4354 );
4355 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4356 let control_handle =
4357 WriteOnlyLogControlHandle { inner: this.inner.clone() };
4358 Ok(WriteOnlyLogRequest::Get {
4359 responder: WriteOnlyLogGetResponder {
4360 control_handle: std::mem::ManuallyDrop::new(control_handle),
4361 tx_id: header.tx_id,
4362 },
4363 })
4364 }
4365 _ => Err(fidl::Error::UnknownOrdinal {
4366 ordinal: header.ordinal,
4367 protocol_name:
4368 <WriteOnlyLogMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4369 }),
4370 }))
4371 },
4372 )
4373 }
4374}
4375
4376#[derive(Debug)]
4378pub enum WriteOnlyLogRequest {
4379 Get { responder: WriteOnlyLogGetResponder },
4381}
4382
4383impl WriteOnlyLogRequest {
4384 #[allow(irrefutable_let_patterns)]
4385 pub fn into_get(self) -> Option<(WriteOnlyLogGetResponder)> {
4386 if let WriteOnlyLogRequest::Get { responder } = self {
4387 Some((responder))
4388 } else {
4389 None
4390 }
4391 }
4392
4393 pub fn method_name(&self) -> &'static str {
4395 match *self {
4396 WriteOnlyLogRequest::Get { .. } => "get",
4397 }
4398 }
4399}
4400
4401#[derive(Debug, Clone)]
4402pub struct WriteOnlyLogControlHandle {
4403 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4404}
4405
4406impl fidl::endpoints::ControlHandle for WriteOnlyLogControlHandle {
4407 fn shutdown(&self) {
4408 self.inner.shutdown()
4409 }
4410 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4411 self.inner.shutdown_with_epitaph(status)
4412 }
4413
4414 fn is_closed(&self) -> bool {
4415 self.inner.channel().is_closed()
4416 }
4417 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4418 self.inner.channel().on_closed()
4419 }
4420
4421 #[cfg(target_os = "fuchsia")]
4422 fn signal_peer(
4423 &self,
4424 clear_mask: zx::Signals,
4425 set_mask: zx::Signals,
4426 ) -> Result<(), zx_status::Status> {
4427 use fidl::Peered;
4428 self.inner.channel().signal_peer(clear_mask, set_mask)
4429 }
4430}
4431
4432impl WriteOnlyLogControlHandle {}
4433
4434#[must_use = "FIDL methods require a response to be sent"]
4435#[derive(Debug)]
4436pub struct WriteOnlyLogGetResponder {
4437 control_handle: std::mem::ManuallyDrop<WriteOnlyLogControlHandle>,
4438 tx_id: u32,
4439}
4440
4441impl std::ops::Drop for WriteOnlyLogGetResponder {
4445 fn drop(&mut self) {
4446 self.control_handle.shutdown();
4447 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4449 }
4450}
4451
4452impl fidl::endpoints::Responder for WriteOnlyLogGetResponder {
4453 type ControlHandle = WriteOnlyLogControlHandle;
4454
4455 fn control_handle(&self) -> &WriteOnlyLogControlHandle {
4456 &self.control_handle
4457 }
4458
4459 fn drop_without_shutdown(mut self) {
4460 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4462 std::mem::forget(self);
4464 }
4465}
4466
4467impl WriteOnlyLogGetResponder {
4468 pub fn send(self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
4472 let _result = self.send_raw(log);
4473 if _result.is_err() {
4474 self.control_handle.shutdown();
4475 }
4476 self.drop_without_shutdown();
4477 _result
4478 }
4479
4480 pub fn send_no_shutdown_on_err(self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
4482 let _result = self.send_raw(log);
4483 self.drop_without_shutdown();
4484 _result
4485 }
4486
4487 fn send_raw(&self, mut log: fidl::DebugLog) -> Result<(), fidl::Error> {
4488 self.control_handle.inner.send::<WriteOnlyLogGetResponse>(
4489 (log,),
4490 self.tx_id,
4491 0x4579dac289d3007,
4492 fidl::encoding::DynamicFlags::empty(),
4493 )
4494 }
4495}
4496
4497mod internal {
4498 use super::*;
4499
4500 impl fidl::encoding::ResourceTypeMarker for BootfsFileVmo {
4501 type Borrowed<'a> = &'a mut Self;
4502 fn take_or_borrow<'a>(
4503 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4504 ) -> Self::Borrowed<'a> {
4505 value
4506 }
4507 }
4508
4509 unsafe impl fidl::encoding::TypeMarker for BootfsFileVmo {
4510 type Owned = Self;
4511
4512 #[inline(always)]
4513 fn inline_align(_context: fidl::encoding::Context) -> usize {
4514 4
4515 }
4516
4517 #[inline(always)]
4518 fn inline_size(_context: fidl::encoding::Context) -> usize {
4519 8
4520 }
4521 }
4522
4523 unsafe impl fidl::encoding::Encode<BootfsFileVmo, fidl::encoding::DefaultFuchsiaResourceDialect>
4524 for &mut BootfsFileVmo
4525 {
4526 #[inline]
4527 unsafe fn encode(
4528 self,
4529 encoder: &mut fidl::encoding::Encoder<
4530 '_,
4531 fidl::encoding::DefaultFuchsiaResourceDialect,
4532 >,
4533 offset: usize,
4534 _depth: fidl::encoding::Depth,
4535 ) -> fidl::Result<()> {
4536 encoder.debug_check_bounds::<BootfsFileVmo>(offset);
4537 fidl::encoding::Encode::<BootfsFileVmo, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4539 (
4540 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.offset),
4541 <fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.contents),
4542 ),
4543 encoder, offset, _depth
4544 )
4545 }
4546 }
4547 unsafe impl<
4548 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
4549 T1: fidl::encoding::Encode<
4550 fidl::encoding::HandleType<
4551 fidl::Vmo,
4552 { fidl::ObjectType::VMO.into_raw() },
4553 2147483648,
4554 >,
4555 fidl::encoding::DefaultFuchsiaResourceDialect,
4556 >,
4557 > fidl::encoding::Encode<BootfsFileVmo, fidl::encoding::DefaultFuchsiaResourceDialect>
4558 for (T0, T1)
4559 {
4560 #[inline]
4561 unsafe fn encode(
4562 self,
4563 encoder: &mut fidl::encoding::Encoder<
4564 '_,
4565 fidl::encoding::DefaultFuchsiaResourceDialect,
4566 >,
4567 offset: usize,
4568 depth: fidl::encoding::Depth,
4569 ) -> fidl::Result<()> {
4570 encoder.debug_check_bounds::<BootfsFileVmo>(offset);
4571 self.0.encode(encoder, offset + 0, depth)?;
4575 self.1.encode(encoder, offset + 4, depth)?;
4576 Ok(())
4577 }
4578 }
4579
4580 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for BootfsFileVmo {
4581 #[inline(always)]
4582 fn new_empty() -> Self {
4583 Self {
4584 offset: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
4585 contents: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4586 }
4587 }
4588
4589 #[inline]
4590 unsafe fn decode(
4591 &mut self,
4592 decoder: &mut fidl::encoding::Decoder<
4593 '_,
4594 fidl::encoding::DefaultFuchsiaResourceDialect,
4595 >,
4596 offset: usize,
4597 _depth: fidl::encoding::Depth,
4598 ) -> fidl::Result<()> {
4599 decoder.debug_check_bounds::<Self>(offset);
4600 fidl::decode!(
4602 u32,
4603 fidl::encoding::DefaultFuchsiaResourceDialect,
4604 &mut self.offset,
4605 decoder,
4606 offset + 0,
4607 _depth
4608 )?;
4609 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.contents, decoder, offset + 4, _depth)?;
4610 Ok(())
4611 }
4612 }
4613
4614 impl fidl::encoding::ResourceTypeMarker for FactoryItemsGetResponse {
4615 type Borrowed<'a> = &'a mut Self;
4616 fn take_or_borrow<'a>(
4617 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4618 ) -> Self::Borrowed<'a> {
4619 value
4620 }
4621 }
4622
4623 unsafe impl fidl::encoding::TypeMarker for FactoryItemsGetResponse {
4624 type Owned = Self;
4625
4626 #[inline(always)]
4627 fn inline_align(_context: fidl::encoding::Context) -> usize {
4628 4
4629 }
4630
4631 #[inline(always)]
4632 fn inline_size(_context: fidl::encoding::Context) -> usize {
4633 8
4634 }
4635 }
4636
4637 unsafe impl
4638 fidl::encoding::Encode<
4639 FactoryItemsGetResponse,
4640 fidl::encoding::DefaultFuchsiaResourceDialect,
4641 > for &mut FactoryItemsGetResponse
4642 {
4643 #[inline]
4644 unsafe fn encode(
4645 self,
4646 encoder: &mut fidl::encoding::Encoder<
4647 '_,
4648 fidl::encoding::DefaultFuchsiaResourceDialect,
4649 >,
4650 offset: usize,
4651 _depth: fidl::encoding::Depth,
4652 ) -> fidl::Result<()> {
4653 encoder.debug_check_bounds::<FactoryItemsGetResponse>(offset);
4654 fidl::encoding::Encode::<
4656 FactoryItemsGetResponse,
4657 fidl::encoding::DefaultFuchsiaResourceDialect,
4658 >::encode(
4659 (
4660 <fidl::encoding::Optional<
4661 fidl::encoding::HandleType<
4662 fidl::Vmo,
4663 { fidl::ObjectType::VMO.into_raw() },
4664 2147483648,
4665 >,
4666 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4667 &mut self.payload
4668 ),
4669 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
4670 ),
4671 encoder,
4672 offset,
4673 _depth,
4674 )
4675 }
4676 }
4677 unsafe impl<
4678 T0: fidl::encoding::Encode<
4679 fidl::encoding::Optional<
4680 fidl::encoding::HandleType<
4681 fidl::Vmo,
4682 { fidl::ObjectType::VMO.into_raw() },
4683 2147483648,
4684 >,
4685 >,
4686 fidl::encoding::DefaultFuchsiaResourceDialect,
4687 >,
4688 T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
4689 >
4690 fidl::encoding::Encode<
4691 FactoryItemsGetResponse,
4692 fidl::encoding::DefaultFuchsiaResourceDialect,
4693 > for (T0, T1)
4694 {
4695 #[inline]
4696 unsafe fn encode(
4697 self,
4698 encoder: &mut fidl::encoding::Encoder<
4699 '_,
4700 fidl::encoding::DefaultFuchsiaResourceDialect,
4701 >,
4702 offset: usize,
4703 depth: fidl::encoding::Depth,
4704 ) -> fidl::Result<()> {
4705 encoder.debug_check_bounds::<FactoryItemsGetResponse>(offset);
4706 self.0.encode(encoder, offset + 0, depth)?;
4710 self.1.encode(encoder, offset + 4, depth)?;
4711 Ok(())
4712 }
4713 }
4714
4715 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4716 for FactoryItemsGetResponse
4717 {
4718 #[inline(always)]
4719 fn new_empty() -> Self {
4720 Self {
4721 payload: fidl::new_empty!(
4722 fidl::encoding::Optional<
4723 fidl::encoding::HandleType<
4724 fidl::Vmo,
4725 { fidl::ObjectType::VMO.into_raw() },
4726 2147483648,
4727 >,
4728 >,
4729 fidl::encoding::DefaultFuchsiaResourceDialect
4730 ),
4731 length: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
4732 }
4733 }
4734
4735 #[inline]
4736 unsafe fn decode(
4737 &mut self,
4738 decoder: &mut fidl::encoding::Decoder<
4739 '_,
4740 fidl::encoding::DefaultFuchsiaResourceDialect,
4741 >,
4742 offset: usize,
4743 _depth: fidl::encoding::Depth,
4744 ) -> fidl::Result<()> {
4745 decoder.debug_check_bounds::<Self>(offset);
4746 fidl::decode!(
4748 fidl::encoding::Optional<
4749 fidl::encoding::HandleType<
4750 fidl::Vmo,
4751 { fidl::ObjectType::VMO.into_raw() },
4752 2147483648,
4753 >,
4754 >,
4755 fidl::encoding::DefaultFuchsiaResourceDialect,
4756 &mut self.payload,
4757 decoder,
4758 offset + 0,
4759 _depth
4760 )?;
4761 fidl::decode!(
4762 u32,
4763 fidl::encoding::DefaultFuchsiaResourceDialect,
4764 &mut self.length,
4765 decoder,
4766 offset + 4,
4767 _depth
4768 )?;
4769 Ok(())
4770 }
4771 }
4772
4773 impl fidl::encoding::ResourceTypeMarker for ItemsGetBootloaderFileResponse {
4774 type Borrowed<'a> = &'a mut Self;
4775 fn take_or_borrow<'a>(
4776 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4777 ) -> Self::Borrowed<'a> {
4778 value
4779 }
4780 }
4781
4782 unsafe impl fidl::encoding::TypeMarker for ItemsGetBootloaderFileResponse {
4783 type Owned = Self;
4784
4785 #[inline(always)]
4786 fn inline_align(_context: fidl::encoding::Context) -> usize {
4787 4
4788 }
4789
4790 #[inline(always)]
4791 fn inline_size(_context: fidl::encoding::Context) -> usize {
4792 4
4793 }
4794 }
4795
4796 unsafe impl
4797 fidl::encoding::Encode<
4798 ItemsGetBootloaderFileResponse,
4799 fidl::encoding::DefaultFuchsiaResourceDialect,
4800 > for &mut ItemsGetBootloaderFileResponse
4801 {
4802 #[inline]
4803 unsafe fn encode(
4804 self,
4805 encoder: &mut fidl::encoding::Encoder<
4806 '_,
4807 fidl::encoding::DefaultFuchsiaResourceDialect,
4808 >,
4809 offset: usize,
4810 _depth: fidl::encoding::Depth,
4811 ) -> fidl::Result<()> {
4812 encoder.debug_check_bounds::<ItemsGetBootloaderFileResponse>(offset);
4813 fidl::encoding::Encode::<
4815 ItemsGetBootloaderFileResponse,
4816 fidl::encoding::DefaultFuchsiaResourceDialect,
4817 >::encode(
4818 (<fidl::encoding::Optional<
4819 fidl::encoding::HandleType<
4820 fidl::Vmo,
4821 { fidl::ObjectType::VMO.into_raw() },
4822 2147483648,
4823 >,
4824 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4825 &mut self.payload
4826 ),),
4827 encoder,
4828 offset,
4829 _depth,
4830 )
4831 }
4832 }
4833 unsafe impl<
4834 T0: fidl::encoding::Encode<
4835 fidl::encoding::Optional<
4836 fidl::encoding::HandleType<
4837 fidl::Vmo,
4838 { fidl::ObjectType::VMO.into_raw() },
4839 2147483648,
4840 >,
4841 >,
4842 fidl::encoding::DefaultFuchsiaResourceDialect,
4843 >,
4844 >
4845 fidl::encoding::Encode<
4846 ItemsGetBootloaderFileResponse,
4847 fidl::encoding::DefaultFuchsiaResourceDialect,
4848 > for (T0,)
4849 {
4850 #[inline]
4851 unsafe fn encode(
4852 self,
4853 encoder: &mut fidl::encoding::Encoder<
4854 '_,
4855 fidl::encoding::DefaultFuchsiaResourceDialect,
4856 >,
4857 offset: usize,
4858 depth: fidl::encoding::Depth,
4859 ) -> fidl::Result<()> {
4860 encoder.debug_check_bounds::<ItemsGetBootloaderFileResponse>(offset);
4861 self.0.encode(encoder, offset + 0, depth)?;
4865 Ok(())
4866 }
4867 }
4868
4869 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4870 for ItemsGetBootloaderFileResponse
4871 {
4872 #[inline(always)]
4873 fn new_empty() -> Self {
4874 Self {
4875 payload: fidl::new_empty!(
4876 fidl::encoding::Optional<
4877 fidl::encoding::HandleType<
4878 fidl::Vmo,
4879 { fidl::ObjectType::VMO.into_raw() },
4880 2147483648,
4881 >,
4882 >,
4883 fidl::encoding::DefaultFuchsiaResourceDialect
4884 ),
4885 }
4886 }
4887
4888 #[inline]
4889 unsafe fn decode(
4890 &mut self,
4891 decoder: &mut fidl::encoding::Decoder<
4892 '_,
4893 fidl::encoding::DefaultFuchsiaResourceDialect,
4894 >,
4895 offset: usize,
4896 _depth: fidl::encoding::Depth,
4897 ) -> fidl::Result<()> {
4898 decoder.debug_check_bounds::<Self>(offset);
4899 fidl::decode!(
4901 fidl::encoding::Optional<
4902 fidl::encoding::HandleType<
4903 fidl::Vmo,
4904 { fidl::ObjectType::VMO.into_raw() },
4905 2147483648,
4906 >,
4907 >,
4908 fidl::encoding::DefaultFuchsiaResourceDialect,
4909 &mut self.payload,
4910 decoder,
4911 offset + 0,
4912 _depth
4913 )?;
4914 Ok(())
4915 }
4916 }
4917
4918 impl fidl::encoding::ResourceTypeMarker for ItemsGetResponse {
4919 type Borrowed<'a> = &'a mut Self;
4920 fn take_or_borrow<'a>(
4921 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4922 ) -> Self::Borrowed<'a> {
4923 value
4924 }
4925 }
4926
4927 unsafe impl fidl::encoding::TypeMarker for ItemsGetResponse {
4928 type Owned = Self;
4929
4930 #[inline(always)]
4931 fn inline_align(_context: fidl::encoding::Context) -> usize {
4932 4
4933 }
4934
4935 #[inline(always)]
4936 fn inline_size(_context: fidl::encoding::Context) -> usize {
4937 8
4938 }
4939 }
4940
4941 unsafe impl
4942 fidl::encoding::Encode<ItemsGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
4943 for &mut ItemsGetResponse
4944 {
4945 #[inline]
4946 unsafe fn encode(
4947 self,
4948 encoder: &mut fidl::encoding::Encoder<
4949 '_,
4950 fidl::encoding::DefaultFuchsiaResourceDialect,
4951 >,
4952 offset: usize,
4953 _depth: fidl::encoding::Depth,
4954 ) -> fidl::Result<()> {
4955 encoder.debug_check_bounds::<ItemsGetResponse>(offset);
4956 fidl::encoding::Encode::<ItemsGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4958 (
4959 <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.payload),
4960 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
4961 ),
4962 encoder, offset, _depth
4963 )
4964 }
4965 }
4966 unsafe impl<
4967 T0: fidl::encoding::Encode<
4968 fidl::encoding::Optional<
4969 fidl::encoding::HandleType<
4970 fidl::Vmo,
4971 { fidl::ObjectType::VMO.into_raw() },
4972 2147483648,
4973 >,
4974 >,
4975 fidl::encoding::DefaultFuchsiaResourceDialect,
4976 >,
4977 T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
4978 >
4979 fidl::encoding::Encode<ItemsGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
4980 for (T0, T1)
4981 {
4982 #[inline]
4983 unsafe fn encode(
4984 self,
4985 encoder: &mut fidl::encoding::Encoder<
4986 '_,
4987 fidl::encoding::DefaultFuchsiaResourceDialect,
4988 >,
4989 offset: usize,
4990 depth: fidl::encoding::Depth,
4991 ) -> fidl::Result<()> {
4992 encoder.debug_check_bounds::<ItemsGetResponse>(offset);
4993 self.0.encode(encoder, offset + 0, depth)?;
4997 self.1.encode(encoder, offset + 4, depth)?;
4998 Ok(())
4999 }
5000 }
5001
5002 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5003 for ItemsGetResponse
5004 {
5005 #[inline(always)]
5006 fn new_empty() -> Self {
5007 Self {
5008 payload: fidl::new_empty!(
5009 fidl::encoding::Optional<
5010 fidl::encoding::HandleType<
5011 fidl::Vmo,
5012 { fidl::ObjectType::VMO.into_raw() },
5013 2147483648,
5014 >,
5015 >,
5016 fidl::encoding::DefaultFuchsiaResourceDialect
5017 ),
5018 length: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
5019 }
5020 }
5021
5022 #[inline]
5023 unsafe fn decode(
5024 &mut self,
5025 decoder: &mut fidl::encoding::Decoder<
5026 '_,
5027 fidl::encoding::DefaultFuchsiaResourceDialect,
5028 >,
5029 offset: usize,
5030 _depth: fidl::encoding::Depth,
5031 ) -> fidl::Result<()> {
5032 decoder.debug_check_bounds::<Self>(offset);
5033 fidl::decode!(
5035 fidl::encoding::Optional<
5036 fidl::encoding::HandleType<
5037 fidl::Vmo,
5038 { fidl::ObjectType::VMO.into_raw() },
5039 2147483648,
5040 >,
5041 >,
5042 fidl::encoding::DefaultFuchsiaResourceDialect,
5043 &mut self.payload,
5044 decoder,
5045 offset + 0,
5046 _depth
5047 )?;
5048 fidl::decode!(
5049 u32,
5050 fidl::encoding::DefaultFuchsiaResourceDialect,
5051 &mut self.length,
5052 decoder,
5053 offset + 4,
5054 _depth
5055 )?;
5056 Ok(())
5057 }
5058 }
5059
5060 impl fidl::encoding::ResourceTypeMarker for ItemsGet2Response {
5061 type Borrowed<'a> = &'a mut Self;
5062 fn take_or_borrow<'a>(
5063 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5064 ) -> Self::Borrowed<'a> {
5065 value
5066 }
5067 }
5068
5069 unsafe impl fidl::encoding::TypeMarker for ItemsGet2Response {
5070 type Owned = Self;
5071
5072 #[inline(always)]
5073 fn inline_align(_context: fidl::encoding::Context) -> usize {
5074 8
5075 }
5076
5077 #[inline(always)]
5078 fn inline_size(_context: fidl::encoding::Context) -> usize {
5079 16
5080 }
5081 }
5082
5083 unsafe impl
5084 fidl::encoding::Encode<ItemsGet2Response, fidl::encoding::DefaultFuchsiaResourceDialect>
5085 for &mut ItemsGet2Response
5086 {
5087 #[inline]
5088 unsafe fn encode(
5089 self,
5090 encoder: &mut fidl::encoding::Encoder<
5091 '_,
5092 fidl::encoding::DefaultFuchsiaResourceDialect,
5093 >,
5094 offset: usize,
5095 _depth: fidl::encoding::Depth,
5096 ) -> fidl::Result<()> {
5097 encoder.debug_check_bounds::<ItemsGet2Response>(offset);
5098 fidl::encoding::Encode::<ItemsGet2Response, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5100 (
5101 <fidl::encoding::UnboundedVector<RetrievedItems> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.retrieved_items),
5102 ),
5103 encoder, offset, _depth
5104 )
5105 }
5106 }
5107 unsafe impl<
5108 T0: fidl::encoding::Encode<
5109 fidl::encoding::UnboundedVector<RetrievedItems>,
5110 fidl::encoding::DefaultFuchsiaResourceDialect,
5111 >,
5112 >
5113 fidl::encoding::Encode<ItemsGet2Response, fidl::encoding::DefaultFuchsiaResourceDialect>
5114 for (T0,)
5115 {
5116 #[inline]
5117 unsafe fn encode(
5118 self,
5119 encoder: &mut fidl::encoding::Encoder<
5120 '_,
5121 fidl::encoding::DefaultFuchsiaResourceDialect,
5122 >,
5123 offset: usize,
5124 depth: fidl::encoding::Depth,
5125 ) -> fidl::Result<()> {
5126 encoder.debug_check_bounds::<ItemsGet2Response>(offset);
5127 self.0.encode(encoder, offset + 0, depth)?;
5131 Ok(())
5132 }
5133 }
5134
5135 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5136 for ItemsGet2Response
5137 {
5138 #[inline(always)]
5139 fn new_empty() -> Self {
5140 Self {
5141 retrieved_items: fidl::new_empty!(
5142 fidl::encoding::UnboundedVector<RetrievedItems>,
5143 fidl::encoding::DefaultFuchsiaResourceDialect
5144 ),
5145 }
5146 }
5147
5148 #[inline]
5149 unsafe fn decode(
5150 &mut self,
5151 decoder: &mut fidl::encoding::Decoder<
5152 '_,
5153 fidl::encoding::DefaultFuchsiaResourceDialect,
5154 >,
5155 offset: usize,
5156 _depth: fidl::encoding::Depth,
5157 ) -> fidl::Result<()> {
5158 decoder.debug_check_bounds::<Self>(offset);
5159 fidl::decode!(
5161 fidl::encoding::UnboundedVector<RetrievedItems>,
5162 fidl::encoding::DefaultFuchsiaResourceDialect,
5163 &mut self.retrieved_items,
5164 decoder,
5165 offset + 0,
5166 _depth
5167 )?;
5168 Ok(())
5169 }
5170 }
5171
5172 impl fidl::encoding::ResourceTypeMarker for ReadOnlyLogGetResponse {
5173 type Borrowed<'a> = &'a mut Self;
5174 fn take_or_borrow<'a>(
5175 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5176 ) -> Self::Borrowed<'a> {
5177 value
5178 }
5179 }
5180
5181 unsafe impl fidl::encoding::TypeMarker for ReadOnlyLogGetResponse {
5182 type Owned = Self;
5183
5184 #[inline(always)]
5185 fn inline_align(_context: fidl::encoding::Context) -> usize {
5186 4
5187 }
5188
5189 #[inline(always)]
5190 fn inline_size(_context: fidl::encoding::Context) -> usize {
5191 4
5192 }
5193 }
5194
5195 unsafe impl
5196 fidl::encoding::Encode<
5197 ReadOnlyLogGetResponse,
5198 fidl::encoding::DefaultFuchsiaResourceDialect,
5199 > for &mut ReadOnlyLogGetResponse
5200 {
5201 #[inline]
5202 unsafe fn encode(
5203 self,
5204 encoder: &mut fidl::encoding::Encoder<
5205 '_,
5206 fidl::encoding::DefaultFuchsiaResourceDialect,
5207 >,
5208 offset: usize,
5209 _depth: fidl::encoding::Depth,
5210 ) -> fidl::Result<()> {
5211 encoder.debug_check_bounds::<ReadOnlyLogGetResponse>(offset);
5212 fidl::encoding::Encode::<
5214 ReadOnlyLogGetResponse,
5215 fidl::encoding::DefaultFuchsiaResourceDialect,
5216 >::encode(
5217 (<fidl::encoding::HandleType<
5218 fidl::DebugLog,
5219 { fidl::ObjectType::DEBUGLOG.into_raw() },
5220 2147483648,
5221 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5222 &mut self.log
5223 ),),
5224 encoder,
5225 offset,
5226 _depth,
5227 )
5228 }
5229 }
5230 unsafe impl<
5231 T0: fidl::encoding::Encode<
5232 fidl::encoding::HandleType<
5233 fidl::DebugLog,
5234 { fidl::ObjectType::DEBUGLOG.into_raw() },
5235 2147483648,
5236 >,
5237 fidl::encoding::DefaultFuchsiaResourceDialect,
5238 >,
5239 >
5240 fidl::encoding::Encode<
5241 ReadOnlyLogGetResponse,
5242 fidl::encoding::DefaultFuchsiaResourceDialect,
5243 > for (T0,)
5244 {
5245 #[inline]
5246 unsafe fn encode(
5247 self,
5248 encoder: &mut fidl::encoding::Encoder<
5249 '_,
5250 fidl::encoding::DefaultFuchsiaResourceDialect,
5251 >,
5252 offset: usize,
5253 depth: fidl::encoding::Depth,
5254 ) -> fidl::Result<()> {
5255 encoder.debug_check_bounds::<ReadOnlyLogGetResponse>(offset);
5256 self.0.encode(encoder, offset + 0, depth)?;
5260 Ok(())
5261 }
5262 }
5263
5264 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5265 for ReadOnlyLogGetResponse
5266 {
5267 #[inline(always)]
5268 fn new_empty() -> Self {
5269 Self {
5270 log: fidl::new_empty!(fidl::encoding::HandleType<fidl::DebugLog, { fidl::ObjectType::DEBUGLOG.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5271 }
5272 }
5273
5274 #[inline]
5275 unsafe fn decode(
5276 &mut self,
5277 decoder: &mut fidl::encoding::Decoder<
5278 '_,
5279 fidl::encoding::DefaultFuchsiaResourceDialect,
5280 >,
5281 offset: usize,
5282 _depth: fidl::encoding::Depth,
5283 ) -> fidl::Result<()> {
5284 decoder.debug_check_bounds::<Self>(offset);
5285 fidl::decode!(fidl::encoding::HandleType<fidl::DebugLog, { fidl::ObjectType::DEBUGLOG.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.log, decoder, offset + 0, _depth)?;
5287 Ok(())
5288 }
5289 }
5290
5291 impl fidl::encoding::ResourceTypeMarker for RetrievedItems {
5292 type Borrowed<'a> = &'a mut Self;
5293 fn take_or_borrow<'a>(
5294 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5295 ) -> Self::Borrowed<'a> {
5296 value
5297 }
5298 }
5299
5300 unsafe impl fidl::encoding::TypeMarker for RetrievedItems {
5301 type Owned = Self;
5302
5303 #[inline(always)]
5304 fn inline_align(_context: fidl::encoding::Context) -> usize {
5305 4
5306 }
5307
5308 #[inline(always)]
5309 fn inline_size(_context: fidl::encoding::Context) -> usize {
5310 12
5311 }
5312 }
5313
5314 unsafe impl
5315 fidl::encoding::Encode<RetrievedItems, fidl::encoding::DefaultFuchsiaResourceDialect>
5316 for &mut RetrievedItems
5317 {
5318 #[inline]
5319 unsafe fn encode(
5320 self,
5321 encoder: &mut fidl::encoding::Encoder<
5322 '_,
5323 fidl::encoding::DefaultFuchsiaResourceDialect,
5324 >,
5325 offset: usize,
5326 _depth: fidl::encoding::Depth,
5327 ) -> fidl::Result<()> {
5328 encoder.debug_check_bounds::<RetrievedItems>(offset);
5329 fidl::encoding::Encode::<RetrievedItems, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5331 (
5332 <fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.payload),
5333 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.length),
5334 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.extra),
5335 ),
5336 encoder, offset, _depth
5337 )
5338 }
5339 }
5340 unsafe impl<
5341 T0: fidl::encoding::Encode<
5342 fidl::encoding::HandleType<
5343 fidl::Vmo,
5344 { fidl::ObjectType::VMO.into_raw() },
5345 2147483648,
5346 >,
5347 fidl::encoding::DefaultFuchsiaResourceDialect,
5348 >,
5349 T1: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
5350 T2: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
5351 > fidl::encoding::Encode<RetrievedItems, fidl::encoding::DefaultFuchsiaResourceDialect>
5352 for (T0, T1, T2)
5353 {
5354 #[inline]
5355 unsafe fn encode(
5356 self,
5357 encoder: &mut fidl::encoding::Encoder<
5358 '_,
5359 fidl::encoding::DefaultFuchsiaResourceDialect,
5360 >,
5361 offset: usize,
5362 depth: fidl::encoding::Depth,
5363 ) -> fidl::Result<()> {
5364 encoder.debug_check_bounds::<RetrievedItems>(offset);
5365 self.0.encode(encoder, offset + 0, depth)?;
5369 self.1.encode(encoder, offset + 4, depth)?;
5370 self.2.encode(encoder, offset + 8, depth)?;
5371 Ok(())
5372 }
5373 }
5374
5375 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5376 for RetrievedItems
5377 {
5378 #[inline(always)]
5379 fn new_empty() -> Self {
5380 Self {
5381 payload: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5382 length: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
5383 extra: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
5384 }
5385 }
5386
5387 #[inline]
5388 unsafe fn decode(
5389 &mut self,
5390 decoder: &mut fidl::encoding::Decoder<
5391 '_,
5392 fidl::encoding::DefaultFuchsiaResourceDialect,
5393 >,
5394 offset: usize,
5395 _depth: fidl::encoding::Depth,
5396 ) -> fidl::Result<()> {
5397 decoder.debug_check_bounds::<Self>(offset);
5398 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.payload, decoder, offset + 0, _depth)?;
5400 fidl::decode!(
5401 u32,
5402 fidl::encoding::DefaultFuchsiaResourceDialect,
5403 &mut self.length,
5404 decoder,
5405 offset + 4,
5406 _depth
5407 )?;
5408 fidl::decode!(
5409 u32,
5410 fidl::encoding::DefaultFuchsiaResourceDialect,
5411 &mut self.extra,
5412 decoder,
5413 offset + 8,
5414 _depth
5415 )?;
5416 Ok(())
5417 }
5418 }
5419
5420 impl fidl::encoding::ResourceTypeMarker for SvcStashProviderGetResponse {
5421 type Borrowed<'a> = &'a mut Self;
5422 fn take_or_borrow<'a>(
5423 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5424 ) -> Self::Borrowed<'a> {
5425 value
5426 }
5427 }
5428
5429 unsafe impl fidl::encoding::TypeMarker for SvcStashProviderGetResponse {
5430 type Owned = Self;
5431
5432 #[inline(always)]
5433 fn inline_align(_context: fidl::encoding::Context) -> usize {
5434 4
5435 }
5436
5437 #[inline(always)]
5438 fn inline_size(_context: fidl::encoding::Context) -> usize {
5439 4
5440 }
5441 }
5442
5443 unsafe impl
5444 fidl::encoding::Encode<
5445 SvcStashProviderGetResponse,
5446 fidl::encoding::DefaultFuchsiaResourceDialect,
5447 > for &mut SvcStashProviderGetResponse
5448 {
5449 #[inline]
5450 unsafe fn encode(
5451 self,
5452 encoder: &mut fidl::encoding::Encoder<
5453 '_,
5454 fidl::encoding::DefaultFuchsiaResourceDialect,
5455 >,
5456 offset: usize,
5457 _depth: fidl::encoding::Depth,
5458 ) -> fidl::Result<()> {
5459 encoder.debug_check_bounds::<SvcStashProviderGetResponse>(offset);
5460 fidl::encoding::Encode::<SvcStashProviderGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5462 (
5463 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.resource),
5464 ),
5465 encoder, offset, _depth
5466 )
5467 }
5468 }
5469 unsafe impl<
5470 T0: fidl::encoding::Encode<
5471 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
5472 fidl::encoding::DefaultFuchsiaResourceDialect,
5473 >,
5474 >
5475 fidl::encoding::Encode<
5476 SvcStashProviderGetResponse,
5477 fidl::encoding::DefaultFuchsiaResourceDialect,
5478 > for (T0,)
5479 {
5480 #[inline]
5481 unsafe fn encode(
5482 self,
5483 encoder: &mut fidl::encoding::Encoder<
5484 '_,
5485 fidl::encoding::DefaultFuchsiaResourceDialect,
5486 >,
5487 offset: usize,
5488 depth: fidl::encoding::Depth,
5489 ) -> fidl::Result<()> {
5490 encoder.debug_check_bounds::<SvcStashProviderGetResponse>(offset);
5491 self.0.encode(encoder, offset + 0, depth)?;
5495 Ok(())
5496 }
5497 }
5498
5499 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5500 for SvcStashProviderGetResponse
5501 {
5502 #[inline(always)]
5503 fn new_empty() -> Self {
5504 Self {
5505 resource: fidl::new_empty!(
5506 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
5507 fidl::encoding::DefaultFuchsiaResourceDialect
5508 ),
5509 }
5510 }
5511
5512 #[inline]
5513 unsafe fn decode(
5514 &mut self,
5515 decoder: &mut fidl::encoding::Decoder<
5516 '_,
5517 fidl::encoding::DefaultFuchsiaResourceDialect,
5518 >,
5519 offset: usize,
5520 _depth: fidl::encoding::Depth,
5521 ) -> fidl::Result<()> {
5522 decoder.debug_check_bounds::<Self>(offset);
5523 fidl::decode!(
5525 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
5526 fidl::encoding::DefaultFuchsiaResourceDialect,
5527 &mut self.resource,
5528 decoder,
5529 offset + 0,
5530 _depth
5531 )?;
5532 Ok(())
5533 }
5534 }
5535
5536 impl fidl::encoding::ResourceTypeMarker for SvcStashStoreRequest {
5537 type Borrowed<'a> = &'a mut Self;
5538 fn take_or_borrow<'a>(
5539 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5540 ) -> Self::Borrowed<'a> {
5541 value
5542 }
5543 }
5544
5545 unsafe impl fidl::encoding::TypeMarker for SvcStashStoreRequest {
5546 type Owned = Self;
5547
5548 #[inline(always)]
5549 fn inline_align(_context: fidl::encoding::Context) -> usize {
5550 4
5551 }
5552
5553 #[inline(always)]
5554 fn inline_size(_context: fidl::encoding::Context) -> usize {
5555 4
5556 }
5557 }
5558
5559 unsafe impl
5560 fidl::encoding::Encode<SvcStashStoreRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
5561 for &mut SvcStashStoreRequest
5562 {
5563 #[inline]
5564 unsafe fn encode(
5565 self,
5566 encoder: &mut fidl::encoding::Encoder<
5567 '_,
5568 fidl::encoding::DefaultFuchsiaResourceDialect,
5569 >,
5570 offset: usize,
5571 _depth: fidl::encoding::Depth,
5572 ) -> fidl::Result<()> {
5573 encoder.debug_check_bounds::<SvcStashStoreRequest>(offset);
5574 fidl::encoding::Encode::<
5576 SvcStashStoreRequest,
5577 fidl::encoding::DefaultFuchsiaResourceDialect,
5578 >::encode(
5579 (<fidl::encoding::Endpoint<
5580 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5581 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5582 &mut self.svc_endpoint
5583 ),),
5584 encoder,
5585 offset,
5586 _depth,
5587 )
5588 }
5589 }
5590 unsafe impl<
5591 T0: fidl::encoding::Encode<
5592 fidl::encoding::Endpoint<
5593 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5594 >,
5595 fidl::encoding::DefaultFuchsiaResourceDialect,
5596 >,
5597 >
5598 fidl::encoding::Encode<SvcStashStoreRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
5599 for (T0,)
5600 {
5601 #[inline]
5602 unsafe fn encode(
5603 self,
5604 encoder: &mut fidl::encoding::Encoder<
5605 '_,
5606 fidl::encoding::DefaultFuchsiaResourceDialect,
5607 >,
5608 offset: usize,
5609 depth: fidl::encoding::Depth,
5610 ) -> fidl::Result<()> {
5611 encoder.debug_check_bounds::<SvcStashStoreRequest>(offset);
5612 self.0.encode(encoder, offset + 0, depth)?;
5616 Ok(())
5617 }
5618 }
5619
5620 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5621 for SvcStashStoreRequest
5622 {
5623 #[inline(always)]
5624 fn new_empty() -> Self {
5625 Self {
5626 svc_endpoint: fidl::new_empty!(
5627 fidl::encoding::Endpoint<
5628 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5629 >,
5630 fidl::encoding::DefaultFuchsiaResourceDialect
5631 ),
5632 }
5633 }
5634
5635 #[inline]
5636 unsafe fn decode(
5637 &mut self,
5638 decoder: &mut fidl::encoding::Decoder<
5639 '_,
5640 fidl::encoding::DefaultFuchsiaResourceDialect,
5641 >,
5642 offset: usize,
5643 _depth: fidl::encoding::Depth,
5644 ) -> fidl::Result<()> {
5645 decoder.debug_check_bounds::<Self>(offset);
5646 fidl::decode!(
5648 fidl::encoding::Endpoint<
5649 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5650 >,
5651 fidl::encoding::DefaultFuchsiaResourceDialect,
5652 &mut self.svc_endpoint,
5653 decoder,
5654 offset + 0,
5655 _depth
5656 )?;
5657 Ok(())
5658 }
5659 }
5660
5661 impl fidl::encoding::ResourceTypeMarker for UserbootPostBootfsFilesRequest {
5662 type Borrowed<'a> = &'a mut Self;
5663 fn take_or_borrow<'a>(
5664 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5665 ) -> Self::Borrowed<'a> {
5666 value
5667 }
5668 }
5669
5670 unsafe impl fidl::encoding::TypeMarker for UserbootPostBootfsFilesRequest {
5671 type Owned = Self;
5672
5673 #[inline(always)]
5674 fn inline_align(_context: fidl::encoding::Context) -> usize {
5675 8
5676 }
5677
5678 #[inline(always)]
5679 fn inline_size(_context: fidl::encoding::Context) -> usize {
5680 16
5681 }
5682 }
5683
5684 unsafe impl
5685 fidl::encoding::Encode<
5686 UserbootPostBootfsFilesRequest,
5687 fidl::encoding::DefaultFuchsiaResourceDialect,
5688 > for &mut UserbootPostBootfsFilesRequest
5689 {
5690 #[inline]
5691 unsafe fn encode(
5692 self,
5693 encoder: &mut fidl::encoding::Encoder<
5694 '_,
5695 fidl::encoding::DefaultFuchsiaResourceDialect,
5696 >,
5697 offset: usize,
5698 _depth: fidl::encoding::Depth,
5699 ) -> fidl::Result<()> {
5700 encoder.debug_check_bounds::<UserbootPostBootfsFilesRequest>(offset);
5701 fidl::encoding::Encode::<UserbootPostBootfsFilesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5703 (
5704 <fidl::encoding::Vector<BootfsFileVmo, 64> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.files),
5705 ),
5706 encoder, offset, _depth
5707 )
5708 }
5709 }
5710 unsafe impl<
5711 T0: fidl::encoding::Encode<
5712 fidl::encoding::Vector<BootfsFileVmo, 64>,
5713 fidl::encoding::DefaultFuchsiaResourceDialect,
5714 >,
5715 >
5716 fidl::encoding::Encode<
5717 UserbootPostBootfsFilesRequest,
5718 fidl::encoding::DefaultFuchsiaResourceDialect,
5719 > for (T0,)
5720 {
5721 #[inline]
5722 unsafe fn encode(
5723 self,
5724 encoder: &mut fidl::encoding::Encoder<
5725 '_,
5726 fidl::encoding::DefaultFuchsiaResourceDialect,
5727 >,
5728 offset: usize,
5729 depth: fidl::encoding::Depth,
5730 ) -> fidl::Result<()> {
5731 encoder.debug_check_bounds::<UserbootPostBootfsFilesRequest>(offset);
5732 self.0.encode(encoder, offset + 0, depth)?;
5736 Ok(())
5737 }
5738 }
5739
5740 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5741 for UserbootPostBootfsFilesRequest
5742 {
5743 #[inline(always)]
5744 fn new_empty() -> Self {
5745 Self {
5746 files: fidl::new_empty!(fidl::encoding::Vector<BootfsFileVmo, 64>, fidl::encoding::DefaultFuchsiaResourceDialect),
5747 }
5748 }
5749
5750 #[inline]
5751 unsafe fn decode(
5752 &mut self,
5753 decoder: &mut fidl::encoding::Decoder<
5754 '_,
5755 fidl::encoding::DefaultFuchsiaResourceDialect,
5756 >,
5757 offset: usize,
5758 _depth: fidl::encoding::Depth,
5759 ) -> fidl::Result<()> {
5760 decoder.debug_check_bounds::<Self>(offset);
5761 fidl::decode!(fidl::encoding::Vector<BootfsFileVmo, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.files, decoder, offset + 0, _depth)?;
5763 Ok(())
5764 }
5765 }
5766
5767 impl fidl::encoding::ResourceTypeMarker for UserbootPostStashSvcRequest {
5768 type Borrowed<'a> = &'a mut Self;
5769 fn take_or_borrow<'a>(
5770 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5771 ) -> Self::Borrowed<'a> {
5772 value
5773 }
5774 }
5775
5776 unsafe impl fidl::encoding::TypeMarker for UserbootPostStashSvcRequest {
5777 type Owned = Self;
5778
5779 #[inline(always)]
5780 fn inline_align(_context: fidl::encoding::Context) -> usize {
5781 4
5782 }
5783
5784 #[inline(always)]
5785 fn inline_size(_context: fidl::encoding::Context) -> usize {
5786 4
5787 }
5788 }
5789
5790 unsafe impl
5791 fidl::encoding::Encode<
5792 UserbootPostStashSvcRequest,
5793 fidl::encoding::DefaultFuchsiaResourceDialect,
5794 > for &mut UserbootPostStashSvcRequest
5795 {
5796 #[inline]
5797 unsafe fn encode(
5798 self,
5799 encoder: &mut fidl::encoding::Encoder<
5800 '_,
5801 fidl::encoding::DefaultFuchsiaResourceDialect,
5802 >,
5803 offset: usize,
5804 _depth: fidl::encoding::Depth,
5805 ) -> fidl::Result<()> {
5806 encoder.debug_check_bounds::<UserbootPostStashSvcRequest>(offset);
5807 fidl::encoding::Encode::<UserbootPostStashSvcRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5809 (
5810 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.stash_svc_endpoint),
5811 ),
5812 encoder, offset, _depth
5813 )
5814 }
5815 }
5816 unsafe impl<
5817 T0: fidl::encoding::Encode<
5818 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
5819 fidl::encoding::DefaultFuchsiaResourceDialect,
5820 >,
5821 >
5822 fidl::encoding::Encode<
5823 UserbootPostStashSvcRequest,
5824 fidl::encoding::DefaultFuchsiaResourceDialect,
5825 > for (T0,)
5826 {
5827 #[inline]
5828 unsafe fn encode(
5829 self,
5830 encoder: &mut fidl::encoding::Encoder<
5831 '_,
5832 fidl::encoding::DefaultFuchsiaResourceDialect,
5833 >,
5834 offset: usize,
5835 depth: fidl::encoding::Depth,
5836 ) -> fidl::Result<()> {
5837 encoder.debug_check_bounds::<UserbootPostStashSvcRequest>(offset);
5838 self.0.encode(encoder, offset + 0, depth)?;
5842 Ok(())
5843 }
5844 }
5845
5846 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5847 for UserbootPostStashSvcRequest
5848 {
5849 #[inline(always)]
5850 fn new_empty() -> Self {
5851 Self {
5852 stash_svc_endpoint: fidl::new_empty!(
5853 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
5854 fidl::encoding::DefaultFuchsiaResourceDialect
5855 ),
5856 }
5857 }
5858
5859 #[inline]
5860 unsafe fn decode(
5861 &mut self,
5862 decoder: &mut fidl::encoding::Decoder<
5863 '_,
5864 fidl::encoding::DefaultFuchsiaResourceDialect,
5865 >,
5866 offset: usize,
5867 _depth: fidl::encoding::Depth,
5868 ) -> fidl::Result<()> {
5869 decoder.debug_check_bounds::<Self>(offset);
5870 fidl::decode!(
5872 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SvcStashMarker>>,
5873 fidl::encoding::DefaultFuchsiaResourceDialect,
5874 &mut self.stash_svc_endpoint,
5875 decoder,
5876 offset + 0,
5877 _depth
5878 )?;
5879 Ok(())
5880 }
5881 }
5882
5883 impl fidl::encoding::ResourceTypeMarker for WriteOnlyLogGetResponse {
5884 type Borrowed<'a> = &'a mut Self;
5885 fn take_or_borrow<'a>(
5886 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5887 ) -> Self::Borrowed<'a> {
5888 value
5889 }
5890 }
5891
5892 unsafe impl fidl::encoding::TypeMarker for WriteOnlyLogGetResponse {
5893 type Owned = Self;
5894
5895 #[inline(always)]
5896 fn inline_align(_context: fidl::encoding::Context) -> usize {
5897 4
5898 }
5899
5900 #[inline(always)]
5901 fn inline_size(_context: fidl::encoding::Context) -> usize {
5902 4
5903 }
5904 }
5905
5906 unsafe impl
5907 fidl::encoding::Encode<
5908 WriteOnlyLogGetResponse,
5909 fidl::encoding::DefaultFuchsiaResourceDialect,
5910 > for &mut WriteOnlyLogGetResponse
5911 {
5912 #[inline]
5913 unsafe fn encode(
5914 self,
5915 encoder: &mut fidl::encoding::Encoder<
5916 '_,
5917 fidl::encoding::DefaultFuchsiaResourceDialect,
5918 >,
5919 offset: usize,
5920 _depth: fidl::encoding::Depth,
5921 ) -> fidl::Result<()> {
5922 encoder.debug_check_bounds::<WriteOnlyLogGetResponse>(offset);
5923 fidl::encoding::Encode::<
5925 WriteOnlyLogGetResponse,
5926 fidl::encoding::DefaultFuchsiaResourceDialect,
5927 >::encode(
5928 (<fidl::encoding::HandleType<
5929 fidl::DebugLog,
5930 { fidl::ObjectType::DEBUGLOG.into_raw() },
5931 2147483648,
5932 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5933 &mut self.log
5934 ),),
5935 encoder,
5936 offset,
5937 _depth,
5938 )
5939 }
5940 }
5941 unsafe impl<
5942 T0: fidl::encoding::Encode<
5943 fidl::encoding::HandleType<
5944 fidl::DebugLog,
5945 { fidl::ObjectType::DEBUGLOG.into_raw() },
5946 2147483648,
5947 >,
5948 fidl::encoding::DefaultFuchsiaResourceDialect,
5949 >,
5950 >
5951 fidl::encoding::Encode<
5952 WriteOnlyLogGetResponse,
5953 fidl::encoding::DefaultFuchsiaResourceDialect,
5954 > for (T0,)
5955 {
5956 #[inline]
5957 unsafe fn encode(
5958 self,
5959 encoder: &mut fidl::encoding::Encoder<
5960 '_,
5961 fidl::encoding::DefaultFuchsiaResourceDialect,
5962 >,
5963 offset: usize,
5964 depth: fidl::encoding::Depth,
5965 ) -> fidl::Result<()> {
5966 encoder.debug_check_bounds::<WriteOnlyLogGetResponse>(offset);
5967 self.0.encode(encoder, offset + 0, depth)?;
5971 Ok(())
5972 }
5973 }
5974
5975 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5976 for WriteOnlyLogGetResponse
5977 {
5978 #[inline(always)]
5979 fn new_empty() -> Self {
5980 Self {
5981 log: fidl::new_empty!(fidl::encoding::HandleType<fidl::DebugLog, { fidl::ObjectType::DEBUGLOG.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5982 }
5983 }
5984
5985 #[inline]
5986 unsafe fn decode(
5987 &mut self,
5988 decoder: &mut fidl::encoding::Decoder<
5989 '_,
5990 fidl::encoding::DefaultFuchsiaResourceDialect,
5991 >,
5992 offset: usize,
5993 _depth: fidl::encoding::Depth,
5994 ) -> fidl::Result<()> {
5995 decoder.debug_check_bounds::<Self>(offset);
5996 fidl::decode!(fidl::encoding::HandleType<fidl::DebugLog, { fidl::ObjectType::DEBUGLOG.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.log, decoder, offset + 0, _depth)?;
5998 Ok(())
5999 }
6000 }
6001}