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_pkg_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct FontResolverResolveRequest {
16 pub package_url: String,
17 pub directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for FontResolverResolveRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct NeededBlobsGetMissingBlobsRequest {
27 pub iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
31 for NeededBlobsGetMissingBlobsRequest
32{
33}
34
35#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36pub struct NeededBlobsOpenBlobResponse {
37 pub writer: Option<Box<BlobWriter>>,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
41 for NeededBlobsOpenBlobResponse
42{
43}
44
45#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46pub struct NeededBlobsOpenMetaBlobResponse {
47 pub writer: Option<Box<BlobWriter>>,
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
51 for NeededBlobsOpenMetaBlobResponse
52{
53}
54
55#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
56pub struct PackageCacheBasePackageIndexRequest {
57 pub iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
58}
59
60impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
61 for PackageCacheBasePackageIndexRequest
62{
63}
64
65#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
66pub struct PackageCacheCachePackageIndexRequest {
67 pub iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
68}
69
70impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
71 for PackageCacheCachePackageIndexRequest
72{
73}
74
75#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
76pub struct PackageCacheGetRequest {
77 pub meta_far_blob: BlobInfo,
78 pub gc_protection: GcProtection,
79 pub needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
80 pub dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
81}
82
83impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PackageCacheGetRequest {}
84
85#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
86pub struct PackageCacheGetSubpackageRequest {
87 pub superpackage: BlobId,
88 pub subpackage: PackageUrl,
89 pub dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
90}
91
92impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
93 for PackageCacheGetSubpackageRequest
94{
95}
96
97#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
98pub struct PackageResolverResolveRequest {
99 pub package_url: String,
100 pub dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
101}
102
103impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
104 for PackageResolverResolveRequest
105{
106}
107
108#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
109pub struct PackageResolverResolveWithContextRequest {
110 pub package_url: String,
111 pub context: ResolutionContext,
112 pub dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
113}
114
115impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
116 for PackageResolverResolveWithContextRequest
117{
118}
119
120#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
121pub struct RepositoryManagerListRequest {
122 pub iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
123}
124
125impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
126 for RepositoryManagerListRequest
127{
128}
129
130#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
131pub struct RetainedPackagesReplaceRequest {
132 pub iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
133}
134
135impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
136 for RetainedPackagesReplaceRequest
137{
138}
139
140#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
142pub enum BlobWriter {
143 File(fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>),
151 Writer(fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>),
154}
155
156impl BlobWriter {
157 #[inline]
158 pub fn ordinal(&self) -> u64 {
159 match *self {
160 Self::File(_) => 1,
161 Self::Writer(_) => 2,
162 }
163 }
164
165 #[deprecated = "Strict unions should not use `is_unknown`"]
166 #[inline]
167 pub fn is_unknown(&self) -> bool {
168 false
169 }
170}
171
172impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobWriter {}
173
174#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
175pub struct BlobIdIteratorMarker;
176
177impl fidl::endpoints::ProtocolMarker for BlobIdIteratorMarker {
178 type Proxy = BlobIdIteratorProxy;
179 type RequestStream = BlobIdIteratorRequestStream;
180 #[cfg(target_os = "fuchsia")]
181 type SynchronousProxy = BlobIdIteratorSynchronousProxy;
182
183 const DEBUG_NAME: &'static str = "(anonymous) BlobIdIterator";
184}
185
186pub trait BlobIdIteratorProxyInterface: Send + Sync {
187 type NextResponseFut: std::future::Future<Output = Result<Vec<BlobId>, fidl::Error>> + Send;
188 fn r#next(&self) -> Self::NextResponseFut;
189}
190#[derive(Debug)]
191#[cfg(target_os = "fuchsia")]
192pub struct BlobIdIteratorSynchronousProxy {
193 client: fidl::client::sync::Client,
194}
195
196#[cfg(target_os = "fuchsia")]
197impl fidl::endpoints::SynchronousProxy for BlobIdIteratorSynchronousProxy {
198 type Proxy = BlobIdIteratorProxy;
199 type Protocol = BlobIdIteratorMarker;
200
201 fn from_channel(inner: fidl::Channel) -> Self {
202 Self::new(inner)
203 }
204
205 fn into_channel(self) -> fidl::Channel {
206 self.client.into_channel()
207 }
208
209 fn as_channel(&self) -> &fidl::Channel {
210 self.client.as_channel()
211 }
212}
213
214#[cfg(target_os = "fuchsia")]
215impl BlobIdIteratorSynchronousProxy {
216 pub fn new(channel: fidl::Channel) -> Self {
217 let protocol_name = <BlobIdIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
218 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
219 }
220
221 pub fn into_channel(self) -> fidl::Channel {
222 self.client.into_channel()
223 }
224
225 pub fn wait_for_event(
228 &self,
229 deadline: zx::MonotonicInstant,
230 ) -> Result<BlobIdIteratorEvent, fidl::Error> {
231 BlobIdIteratorEvent::decode(self.client.wait_for_event(deadline)?)
232 }
233
234 pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<BlobId>, fidl::Error> {
239 let _response =
240 self.client.send_query::<fidl::encoding::EmptyPayload, BlobIdIteratorNextResponse>(
241 (),
242 0x5eb0af0daeb8f537,
243 fidl::encoding::DynamicFlags::empty(),
244 ___deadline,
245 )?;
246 Ok(_response.blobs)
247 }
248}
249
250#[cfg(target_os = "fuchsia")]
251impl From<BlobIdIteratorSynchronousProxy> for zx::Handle {
252 fn from(value: BlobIdIteratorSynchronousProxy) -> Self {
253 value.into_channel().into()
254 }
255}
256
257#[cfg(target_os = "fuchsia")]
258impl From<fidl::Channel> for BlobIdIteratorSynchronousProxy {
259 fn from(value: fidl::Channel) -> Self {
260 Self::new(value)
261 }
262}
263
264#[derive(Debug, Clone)]
265pub struct BlobIdIteratorProxy {
266 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
267}
268
269impl fidl::endpoints::Proxy for BlobIdIteratorProxy {
270 type Protocol = BlobIdIteratorMarker;
271
272 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
273 Self::new(inner)
274 }
275
276 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
277 self.client.into_channel().map_err(|client| Self { client })
278 }
279
280 fn as_channel(&self) -> &::fidl::AsyncChannel {
281 self.client.as_channel()
282 }
283}
284
285impl BlobIdIteratorProxy {
286 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
288 let protocol_name = <BlobIdIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
289 Self { client: fidl::client::Client::new(channel, protocol_name) }
290 }
291
292 pub fn take_event_stream(&self) -> BlobIdIteratorEventStream {
298 BlobIdIteratorEventStream { event_receiver: self.client.take_event_receiver() }
299 }
300
301 pub fn r#next(
306 &self,
307 ) -> fidl::client::QueryResponseFut<Vec<BlobId>, fidl::encoding::DefaultFuchsiaResourceDialect>
308 {
309 BlobIdIteratorProxyInterface::r#next(self)
310 }
311}
312
313impl BlobIdIteratorProxyInterface for BlobIdIteratorProxy {
314 type NextResponseFut =
315 fidl::client::QueryResponseFut<Vec<BlobId>, fidl::encoding::DefaultFuchsiaResourceDialect>;
316 fn r#next(&self) -> Self::NextResponseFut {
317 fn _decode(
318 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
319 ) -> Result<Vec<BlobId>, fidl::Error> {
320 let _response = fidl::client::decode_transaction_body::<
321 BlobIdIteratorNextResponse,
322 fidl::encoding::DefaultFuchsiaResourceDialect,
323 0x5eb0af0daeb8f537,
324 >(_buf?)?;
325 Ok(_response.blobs)
326 }
327 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<BlobId>>(
328 (),
329 0x5eb0af0daeb8f537,
330 fidl::encoding::DynamicFlags::empty(),
331 _decode,
332 )
333 }
334}
335
336pub struct BlobIdIteratorEventStream {
337 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
338}
339
340impl std::marker::Unpin for BlobIdIteratorEventStream {}
341
342impl futures::stream::FusedStream for BlobIdIteratorEventStream {
343 fn is_terminated(&self) -> bool {
344 self.event_receiver.is_terminated()
345 }
346}
347
348impl futures::Stream for BlobIdIteratorEventStream {
349 type Item = Result<BlobIdIteratorEvent, fidl::Error>;
350
351 fn poll_next(
352 mut self: std::pin::Pin<&mut Self>,
353 cx: &mut std::task::Context<'_>,
354 ) -> std::task::Poll<Option<Self::Item>> {
355 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
356 &mut self.event_receiver,
357 cx
358 )?) {
359 Some(buf) => std::task::Poll::Ready(Some(BlobIdIteratorEvent::decode(buf))),
360 None => std::task::Poll::Ready(None),
361 }
362 }
363}
364
365#[derive(Debug)]
366pub enum BlobIdIteratorEvent {}
367
368impl BlobIdIteratorEvent {
369 fn decode(
371 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
372 ) -> Result<BlobIdIteratorEvent, fidl::Error> {
373 let (bytes, _handles) = buf.split_mut();
374 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
375 debug_assert_eq!(tx_header.tx_id, 0);
376 match tx_header.ordinal {
377 _ => Err(fidl::Error::UnknownOrdinal {
378 ordinal: tx_header.ordinal,
379 protocol_name:
380 <BlobIdIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
381 }),
382 }
383 }
384}
385
386pub struct BlobIdIteratorRequestStream {
388 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
389 is_terminated: bool,
390}
391
392impl std::marker::Unpin for BlobIdIteratorRequestStream {}
393
394impl futures::stream::FusedStream for BlobIdIteratorRequestStream {
395 fn is_terminated(&self) -> bool {
396 self.is_terminated
397 }
398}
399
400impl fidl::endpoints::RequestStream for BlobIdIteratorRequestStream {
401 type Protocol = BlobIdIteratorMarker;
402 type ControlHandle = BlobIdIteratorControlHandle;
403
404 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
405 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
406 }
407
408 fn control_handle(&self) -> Self::ControlHandle {
409 BlobIdIteratorControlHandle { inner: self.inner.clone() }
410 }
411
412 fn into_inner(
413 self,
414 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
415 {
416 (self.inner, self.is_terminated)
417 }
418
419 fn from_inner(
420 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
421 is_terminated: bool,
422 ) -> Self {
423 Self { inner, is_terminated }
424 }
425}
426
427impl futures::Stream for BlobIdIteratorRequestStream {
428 type Item = Result<BlobIdIteratorRequest, fidl::Error>;
429
430 fn poll_next(
431 mut self: std::pin::Pin<&mut Self>,
432 cx: &mut std::task::Context<'_>,
433 ) -> std::task::Poll<Option<Self::Item>> {
434 let this = &mut *self;
435 if this.inner.check_shutdown(cx) {
436 this.is_terminated = true;
437 return std::task::Poll::Ready(None);
438 }
439 if this.is_terminated {
440 panic!("polled BlobIdIteratorRequestStream after completion");
441 }
442 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
443 |bytes, handles| {
444 match this.inner.channel().read_etc(cx, bytes, handles) {
445 std::task::Poll::Ready(Ok(())) => {}
446 std::task::Poll::Pending => return std::task::Poll::Pending,
447 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
448 this.is_terminated = true;
449 return std::task::Poll::Ready(None);
450 }
451 std::task::Poll::Ready(Err(e)) => {
452 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
453 e.into(),
454 ))))
455 }
456 }
457
458 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
460
461 std::task::Poll::Ready(Some(match header.ordinal {
462 0x5eb0af0daeb8f537 => {
463 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
464 let mut req = fidl::new_empty!(
465 fidl::encoding::EmptyPayload,
466 fidl::encoding::DefaultFuchsiaResourceDialect
467 );
468 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
469 let control_handle =
470 BlobIdIteratorControlHandle { inner: this.inner.clone() };
471 Ok(BlobIdIteratorRequest::Next {
472 responder: BlobIdIteratorNextResponder {
473 control_handle: std::mem::ManuallyDrop::new(control_handle),
474 tx_id: header.tx_id,
475 },
476 })
477 }
478 _ => Err(fidl::Error::UnknownOrdinal {
479 ordinal: header.ordinal,
480 protocol_name:
481 <BlobIdIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
482 }),
483 }))
484 },
485 )
486 }
487}
488
489#[derive(Debug)]
492pub enum BlobIdIteratorRequest {
493 Next { responder: BlobIdIteratorNextResponder },
498}
499
500impl BlobIdIteratorRequest {
501 #[allow(irrefutable_let_patterns)]
502 pub fn into_next(self) -> Option<(BlobIdIteratorNextResponder)> {
503 if let BlobIdIteratorRequest::Next { responder } = self {
504 Some((responder))
505 } else {
506 None
507 }
508 }
509
510 pub fn method_name(&self) -> &'static str {
512 match *self {
513 BlobIdIteratorRequest::Next { .. } => "next",
514 }
515 }
516}
517
518#[derive(Debug, Clone)]
519pub struct BlobIdIteratorControlHandle {
520 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
521}
522
523impl fidl::endpoints::ControlHandle for BlobIdIteratorControlHandle {
524 fn shutdown(&self) {
525 self.inner.shutdown()
526 }
527 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
528 self.inner.shutdown_with_epitaph(status)
529 }
530
531 fn is_closed(&self) -> bool {
532 self.inner.channel().is_closed()
533 }
534 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
535 self.inner.channel().on_closed()
536 }
537
538 #[cfg(target_os = "fuchsia")]
539 fn signal_peer(
540 &self,
541 clear_mask: zx::Signals,
542 set_mask: zx::Signals,
543 ) -> Result<(), zx_status::Status> {
544 use fidl::Peered;
545 self.inner.channel().signal_peer(clear_mask, set_mask)
546 }
547}
548
549impl BlobIdIteratorControlHandle {}
550
551#[must_use = "FIDL methods require a response to be sent"]
552#[derive(Debug)]
553pub struct BlobIdIteratorNextResponder {
554 control_handle: std::mem::ManuallyDrop<BlobIdIteratorControlHandle>,
555 tx_id: u32,
556}
557
558impl std::ops::Drop for BlobIdIteratorNextResponder {
562 fn drop(&mut self) {
563 self.control_handle.shutdown();
564 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
566 }
567}
568
569impl fidl::endpoints::Responder for BlobIdIteratorNextResponder {
570 type ControlHandle = BlobIdIteratorControlHandle;
571
572 fn control_handle(&self) -> &BlobIdIteratorControlHandle {
573 &self.control_handle
574 }
575
576 fn drop_without_shutdown(mut self) {
577 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
579 std::mem::forget(self);
581 }
582}
583
584impl BlobIdIteratorNextResponder {
585 pub fn send(self, mut blobs: &[BlobId]) -> Result<(), fidl::Error> {
589 let _result = self.send_raw(blobs);
590 if _result.is_err() {
591 self.control_handle.shutdown();
592 }
593 self.drop_without_shutdown();
594 _result
595 }
596
597 pub fn send_no_shutdown_on_err(self, mut blobs: &[BlobId]) -> Result<(), fidl::Error> {
599 let _result = self.send_raw(blobs);
600 self.drop_without_shutdown();
601 _result
602 }
603
604 fn send_raw(&self, mut blobs: &[BlobId]) -> Result<(), fidl::Error> {
605 self.control_handle.inner.send::<BlobIdIteratorNextResponse>(
606 (blobs,),
607 self.tx_id,
608 0x5eb0af0daeb8f537,
609 fidl::encoding::DynamicFlags::empty(),
610 )
611 }
612}
613
614#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
615pub struct BlobInfoIteratorMarker;
616
617impl fidl::endpoints::ProtocolMarker for BlobInfoIteratorMarker {
618 type Proxy = BlobInfoIteratorProxy;
619 type RequestStream = BlobInfoIteratorRequestStream;
620 #[cfg(target_os = "fuchsia")]
621 type SynchronousProxy = BlobInfoIteratorSynchronousProxy;
622
623 const DEBUG_NAME: &'static str = "(anonymous) BlobInfoIterator";
624}
625
626pub trait BlobInfoIteratorProxyInterface: Send + Sync {
627 type NextResponseFut: std::future::Future<Output = Result<Vec<BlobInfo>, fidl::Error>> + Send;
628 fn r#next(&self) -> Self::NextResponseFut;
629}
630#[derive(Debug)]
631#[cfg(target_os = "fuchsia")]
632pub struct BlobInfoIteratorSynchronousProxy {
633 client: fidl::client::sync::Client,
634}
635
636#[cfg(target_os = "fuchsia")]
637impl fidl::endpoints::SynchronousProxy for BlobInfoIteratorSynchronousProxy {
638 type Proxy = BlobInfoIteratorProxy;
639 type Protocol = BlobInfoIteratorMarker;
640
641 fn from_channel(inner: fidl::Channel) -> Self {
642 Self::new(inner)
643 }
644
645 fn into_channel(self) -> fidl::Channel {
646 self.client.into_channel()
647 }
648
649 fn as_channel(&self) -> &fidl::Channel {
650 self.client.as_channel()
651 }
652}
653
654#[cfg(target_os = "fuchsia")]
655impl BlobInfoIteratorSynchronousProxy {
656 pub fn new(channel: fidl::Channel) -> Self {
657 let protocol_name = <BlobInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
658 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
659 }
660
661 pub fn into_channel(self) -> fidl::Channel {
662 self.client.into_channel()
663 }
664
665 pub fn wait_for_event(
668 &self,
669 deadline: zx::MonotonicInstant,
670 ) -> Result<BlobInfoIteratorEvent, fidl::Error> {
671 BlobInfoIteratorEvent::decode(self.client.wait_for_event(deadline)?)
672 }
673
674 pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<BlobInfo>, fidl::Error> {
679 let _response =
680 self.client.send_query::<fidl::encoding::EmptyPayload, BlobInfoIteratorNextResponse>(
681 (),
682 0x2b889489a59b6970,
683 fidl::encoding::DynamicFlags::empty(),
684 ___deadline,
685 )?;
686 Ok(_response.blobs)
687 }
688}
689
690#[cfg(target_os = "fuchsia")]
691impl From<BlobInfoIteratorSynchronousProxy> for zx::Handle {
692 fn from(value: BlobInfoIteratorSynchronousProxy) -> Self {
693 value.into_channel().into()
694 }
695}
696
697#[cfg(target_os = "fuchsia")]
698impl From<fidl::Channel> for BlobInfoIteratorSynchronousProxy {
699 fn from(value: fidl::Channel) -> Self {
700 Self::new(value)
701 }
702}
703
704#[derive(Debug, Clone)]
705pub struct BlobInfoIteratorProxy {
706 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
707}
708
709impl fidl::endpoints::Proxy for BlobInfoIteratorProxy {
710 type Protocol = BlobInfoIteratorMarker;
711
712 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
713 Self::new(inner)
714 }
715
716 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
717 self.client.into_channel().map_err(|client| Self { client })
718 }
719
720 fn as_channel(&self) -> &::fidl::AsyncChannel {
721 self.client.as_channel()
722 }
723}
724
725impl BlobInfoIteratorProxy {
726 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
728 let protocol_name = <BlobInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
729 Self { client: fidl::client::Client::new(channel, protocol_name) }
730 }
731
732 pub fn take_event_stream(&self) -> BlobInfoIteratorEventStream {
738 BlobInfoIteratorEventStream { event_receiver: self.client.take_event_receiver() }
739 }
740
741 pub fn r#next(
746 &self,
747 ) -> fidl::client::QueryResponseFut<Vec<BlobInfo>, fidl::encoding::DefaultFuchsiaResourceDialect>
748 {
749 BlobInfoIteratorProxyInterface::r#next(self)
750 }
751}
752
753impl BlobInfoIteratorProxyInterface for BlobInfoIteratorProxy {
754 type NextResponseFut = fidl::client::QueryResponseFut<
755 Vec<BlobInfo>,
756 fidl::encoding::DefaultFuchsiaResourceDialect,
757 >;
758 fn r#next(&self) -> Self::NextResponseFut {
759 fn _decode(
760 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
761 ) -> Result<Vec<BlobInfo>, fidl::Error> {
762 let _response = fidl::client::decode_transaction_body::<
763 BlobInfoIteratorNextResponse,
764 fidl::encoding::DefaultFuchsiaResourceDialect,
765 0x2b889489a59b6970,
766 >(_buf?)?;
767 Ok(_response.blobs)
768 }
769 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<BlobInfo>>(
770 (),
771 0x2b889489a59b6970,
772 fidl::encoding::DynamicFlags::empty(),
773 _decode,
774 )
775 }
776}
777
778pub struct BlobInfoIteratorEventStream {
779 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
780}
781
782impl std::marker::Unpin for BlobInfoIteratorEventStream {}
783
784impl futures::stream::FusedStream for BlobInfoIteratorEventStream {
785 fn is_terminated(&self) -> bool {
786 self.event_receiver.is_terminated()
787 }
788}
789
790impl futures::Stream for BlobInfoIteratorEventStream {
791 type Item = Result<BlobInfoIteratorEvent, fidl::Error>;
792
793 fn poll_next(
794 mut self: std::pin::Pin<&mut Self>,
795 cx: &mut std::task::Context<'_>,
796 ) -> std::task::Poll<Option<Self::Item>> {
797 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
798 &mut self.event_receiver,
799 cx
800 )?) {
801 Some(buf) => std::task::Poll::Ready(Some(BlobInfoIteratorEvent::decode(buf))),
802 None => std::task::Poll::Ready(None),
803 }
804 }
805}
806
807#[derive(Debug)]
808pub enum BlobInfoIteratorEvent {}
809
810impl BlobInfoIteratorEvent {
811 fn decode(
813 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
814 ) -> Result<BlobInfoIteratorEvent, fidl::Error> {
815 let (bytes, _handles) = buf.split_mut();
816 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
817 debug_assert_eq!(tx_header.tx_id, 0);
818 match tx_header.ordinal {
819 _ => Err(fidl::Error::UnknownOrdinal {
820 ordinal: tx_header.ordinal,
821 protocol_name:
822 <BlobInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
823 }),
824 }
825 }
826}
827
828pub struct BlobInfoIteratorRequestStream {
830 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
831 is_terminated: bool,
832}
833
834impl std::marker::Unpin for BlobInfoIteratorRequestStream {}
835
836impl futures::stream::FusedStream for BlobInfoIteratorRequestStream {
837 fn is_terminated(&self) -> bool {
838 self.is_terminated
839 }
840}
841
842impl fidl::endpoints::RequestStream for BlobInfoIteratorRequestStream {
843 type Protocol = BlobInfoIteratorMarker;
844 type ControlHandle = BlobInfoIteratorControlHandle;
845
846 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
847 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
848 }
849
850 fn control_handle(&self) -> Self::ControlHandle {
851 BlobInfoIteratorControlHandle { inner: self.inner.clone() }
852 }
853
854 fn into_inner(
855 self,
856 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
857 {
858 (self.inner, self.is_terminated)
859 }
860
861 fn from_inner(
862 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
863 is_terminated: bool,
864 ) -> Self {
865 Self { inner, is_terminated }
866 }
867}
868
869impl futures::Stream for BlobInfoIteratorRequestStream {
870 type Item = Result<BlobInfoIteratorRequest, fidl::Error>;
871
872 fn poll_next(
873 mut self: std::pin::Pin<&mut Self>,
874 cx: &mut std::task::Context<'_>,
875 ) -> std::task::Poll<Option<Self::Item>> {
876 let this = &mut *self;
877 if this.inner.check_shutdown(cx) {
878 this.is_terminated = true;
879 return std::task::Poll::Ready(None);
880 }
881 if this.is_terminated {
882 panic!("polled BlobInfoIteratorRequestStream after completion");
883 }
884 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
885 |bytes, handles| {
886 match this.inner.channel().read_etc(cx, bytes, handles) {
887 std::task::Poll::Ready(Ok(())) => {}
888 std::task::Poll::Pending => return std::task::Poll::Pending,
889 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
890 this.is_terminated = true;
891 return std::task::Poll::Ready(None);
892 }
893 std::task::Poll::Ready(Err(e)) => {
894 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
895 e.into(),
896 ))))
897 }
898 }
899
900 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
902
903 std::task::Poll::Ready(Some(match header.ordinal {
904 0x2b889489a59b6970 => {
905 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
906 let mut req = fidl::new_empty!(
907 fidl::encoding::EmptyPayload,
908 fidl::encoding::DefaultFuchsiaResourceDialect
909 );
910 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
911 let control_handle =
912 BlobInfoIteratorControlHandle { inner: this.inner.clone() };
913 Ok(BlobInfoIteratorRequest::Next {
914 responder: BlobInfoIteratorNextResponder {
915 control_handle: std::mem::ManuallyDrop::new(control_handle),
916 tx_id: header.tx_id,
917 },
918 })
919 }
920 _ => Err(fidl::Error::UnknownOrdinal {
921 ordinal: header.ordinal,
922 protocol_name:
923 <BlobInfoIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
924 }),
925 }))
926 },
927 )
928 }
929}
930
931#[derive(Debug)]
934pub enum BlobInfoIteratorRequest {
935 Next { responder: BlobInfoIteratorNextResponder },
940}
941
942impl BlobInfoIteratorRequest {
943 #[allow(irrefutable_let_patterns)]
944 pub fn into_next(self) -> Option<(BlobInfoIteratorNextResponder)> {
945 if let BlobInfoIteratorRequest::Next { responder } = self {
946 Some((responder))
947 } else {
948 None
949 }
950 }
951
952 pub fn method_name(&self) -> &'static str {
954 match *self {
955 BlobInfoIteratorRequest::Next { .. } => "next",
956 }
957 }
958}
959
960#[derive(Debug, Clone)]
961pub struct BlobInfoIteratorControlHandle {
962 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
963}
964
965impl fidl::endpoints::ControlHandle for BlobInfoIteratorControlHandle {
966 fn shutdown(&self) {
967 self.inner.shutdown()
968 }
969 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
970 self.inner.shutdown_with_epitaph(status)
971 }
972
973 fn is_closed(&self) -> bool {
974 self.inner.channel().is_closed()
975 }
976 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
977 self.inner.channel().on_closed()
978 }
979
980 #[cfg(target_os = "fuchsia")]
981 fn signal_peer(
982 &self,
983 clear_mask: zx::Signals,
984 set_mask: zx::Signals,
985 ) -> Result<(), zx_status::Status> {
986 use fidl::Peered;
987 self.inner.channel().signal_peer(clear_mask, set_mask)
988 }
989}
990
991impl BlobInfoIteratorControlHandle {}
992
993#[must_use = "FIDL methods require a response to be sent"]
994#[derive(Debug)]
995pub struct BlobInfoIteratorNextResponder {
996 control_handle: std::mem::ManuallyDrop<BlobInfoIteratorControlHandle>,
997 tx_id: u32,
998}
999
1000impl std::ops::Drop for BlobInfoIteratorNextResponder {
1004 fn drop(&mut self) {
1005 self.control_handle.shutdown();
1006 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1008 }
1009}
1010
1011impl fidl::endpoints::Responder for BlobInfoIteratorNextResponder {
1012 type ControlHandle = BlobInfoIteratorControlHandle;
1013
1014 fn control_handle(&self) -> &BlobInfoIteratorControlHandle {
1015 &self.control_handle
1016 }
1017
1018 fn drop_without_shutdown(mut self) {
1019 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1021 std::mem::forget(self);
1023 }
1024}
1025
1026impl BlobInfoIteratorNextResponder {
1027 pub fn send(self, mut blobs: &[BlobInfo]) -> Result<(), fidl::Error> {
1031 let _result = self.send_raw(blobs);
1032 if _result.is_err() {
1033 self.control_handle.shutdown();
1034 }
1035 self.drop_without_shutdown();
1036 _result
1037 }
1038
1039 pub fn send_no_shutdown_on_err(self, mut blobs: &[BlobInfo]) -> Result<(), fidl::Error> {
1041 let _result = self.send_raw(blobs);
1042 self.drop_without_shutdown();
1043 _result
1044 }
1045
1046 fn send_raw(&self, mut blobs: &[BlobInfo]) -> Result<(), fidl::Error> {
1047 self.control_handle.inner.send::<BlobInfoIteratorNextResponse>(
1048 (blobs,),
1049 self.tx_id,
1050 0x2b889489a59b6970,
1051 fidl::encoding::DynamicFlags::empty(),
1052 )
1053 }
1054}
1055
1056#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1057pub struct CupMarker;
1058
1059impl fidl::endpoints::ProtocolMarker for CupMarker {
1060 type Proxy = CupProxy;
1061 type RequestStream = CupRequestStream;
1062 #[cfg(target_os = "fuchsia")]
1063 type SynchronousProxy = CupSynchronousProxy;
1064
1065 const DEBUG_NAME: &'static str = "fuchsia.pkg.Cup";
1066}
1067impl fidl::endpoints::DiscoverableProtocolMarker for CupMarker {}
1068pub type CupWriteResult = Result<(), WriteError>;
1069pub type CupGetInfoResult = Result<(String, String), GetInfoError>;
1070
1071pub trait CupProxyInterface: Send + Sync {
1072 type WriteResponseFut: std::future::Future<Output = Result<CupWriteResult, fidl::Error>> + Send;
1073 fn r#write(&self, url: &PackageUrl, cup: &CupData) -> Self::WriteResponseFut;
1074 type GetInfoResponseFut: std::future::Future<Output = Result<CupGetInfoResult, fidl::Error>>
1075 + Send;
1076 fn r#get_info(&self, url: &PackageUrl) -> Self::GetInfoResponseFut;
1077}
1078#[derive(Debug)]
1079#[cfg(target_os = "fuchsia")]
1080pub struct CupSynchronousProxy {
1081 client: fidl::client::sync::Client,
1082}
1083
1084#[cfg(target_os = "fuchsia")]
1085impl fidl::endpoints::SynchronousProxy for CupSynchronousProxy {
1086 type Proxy = CupProxy;
1087 type Protocol = CupMarker;
1088
1089 fn from_channel(inner: fidl::Channel) -> Self {
1090 Self::new(inner)
1091 }
1092
1093 fn into_channel(self) -> fidl::Channel {
1094 self.client.into_channel()
1095 }
1096
1097 fn as_channel(&self) -> &fidl::Channel {
1098 self.client.as_channel()
1099 }
1100}
1101
1102#[cfg(target_os = "fuchsia")]
1103impl CupSynchronousProxy {
1104 pub fn new(channel: fidl::Channel) -> Self {
1105 let protocol_name = <CupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1106 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1107 }
1108
1109 pub fn into_channel(self) -> fidl::Channel {
1110 self.client.into_channel()
1111 }
1112
1113 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<CupEvent, fidl::Error> {
1116 CupEvent::decode(self.client.wait_for_event(deadline)?)
1117 }
1118
1119 pub fn r#write(
1122 &self,
1123 mut url: &PackageUrl,
1124 mut cup: &CupData,
1125 ___deadline: zx::MonotonicInstant,
1126 ) -> Result<CupWriteResult, fidl::Error> {
1127 let _response = self.client.send_query::<CupWriteRequest, fidl::encoding::ResultType<
1128 fidl::encoding::EmptyStruct,
1129 WriteError,
1130 >>(
1131 (url, cup),
1132 0x29f30e83bda39c37,
1133 fidl::encoding::DynamicFlags::empty(),
1134 ___deadline,
1135 )?;
1136 Ok(_response.map(|x| x))
1137 }
1138
1139 pub fn r#get_info(
1141 &self,
1142 mut url: &PackageUrl,
1143 ___deadline: zx::MonotonicInstant,
1144 ) -> Result<CupGetInfoResult, fidl::Error> {
1145 let _response = self.client.send_query::<
1146 CupGetInfoRequest,
1147 fidl::encoding::ResultType<CupGetInfoResponse, GetInfoError>,
1148 >(
1149 (url,),
1150 0x5b2cedd887209b9c,
1151 fidl::encoding::DynamicFlags::empty(),
1152 ___deadline,
1153 )?;
1154 Ok(_response.map(|x| (x.version, x.channel)))
1155 }
1156}
1157
1158#[cfg(target_os = "fuchsia")]
1159impl From<CupSynchronousProxy> for zx::Handle {
1160 fn from(value: CupSynchronousProxy) -> Self {
1161 value.into_channel().into()
1162 }
1163}
1164
1165#[cfg(target_os = "fuchsia")]
1166impl From<fidl::Channel> for CupSynchronousProxy {
1167 fn from(value: fidl::Channel) -> Self {
1168 Self::new(value)
1169 }
1170}
1171
1172#[derive(Debug, Clone)]
1173pub struct CupProxy {
1174 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1175}
1176
1177impl fidl::endpoints::Proxy for CupProxy {
1178 type Protocol = CupMarker;
1179
1180 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1181 Self::new(inner)
1182 }
1183
1184 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1185 self.client.into_channel().map_err(|client| Self { client })
1186 }
1187
1188 fn as_channel(&self) -> &::fidl::AsyncChannel {
1189 self.client.as_channel()
1190 }
1191}
1192
1193impl CupProxy {
1194 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1196 let protocol_name = <CupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1197 Self { client: fidl::client::Client::new(channel, protocol_name) }
1198 }
1199
1200 pub fn take_event_stream(&self) -> CupEventStream {
1206 CupEventStream { event_receiver: self.client.take_event_receiver() }
1207 }
1208
1209 pub fn r#write(
1212 &self,
1213 mut url: &PackageUrl,
1214 mut cup: &CupData,
1215 ) -> fidl::client::QueryResponseFut<CupWriteResult, fidl::encoding::DefaultFuchsiaResourceDialect>
1216 {
1217 CupProxyInterface::r#write(self, url, cup)
1218 }
1219
1220 pub fn r#get_info(
1222 &self,
1223 mut url: &PackageUrl,
1224 ) -> fidl::client::QueryResponseFut<
1225 CupGetInfoResult,
1226 fidl::encoding::DefaultFuchsiaResourceDialect,
1227 > {
1228 CupProxyInterface::r#get_info(self, url)
1229 }
1230}
1231
1232impl CupProxyInterface for CupProxy {
1233 type WriteResponseFut = fidl::client::QueryResponseFut<
1234 CupWriteResult,
1235 fidl::encoding::DefaultFuchsiaResourceDialect,
1236 >;
1237 fn r#write(&self, mut url: &PackageUrl, mut cup: &CupData) -> Self::WriteResponseFut {
1238 fn _decode(
1239 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1240 ) -> Result<CupWriteResult, fidl::Error> {
1241 let _response = fidl::client::decode_transaction_body::<
1242 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, WriteError>,
1243 fidl::encoding::DefaultFuchsiaResourceDialect,
1244 0x29f30e83bda39c37,
1245 >(_buf?)?;
1246 Ok(_response.map(|x| x))
1247 }
1248 self.client.send_query_and_decode::<CupWriteRequest, CupWriteResult>(
1249 (url, cup),
1250 0x29f30e83bda39c37,
1251 fidl::encoding::DynamicFlags::empty(),
1252 _decode,
1253 )
1254 }
1255
1256 type GetInfoResponseFut = fidl::client::QueryResponseFut<
1257 CupGetInfoResult,
1258 fidl::encoding::DefaultFuchsiaResourceDialect,
1259 >;
1260 fn r#get_info(&self, mut url: &PackageUrl) -> Self::GetInfoResponseFut {
1261 fn _decode(
1262 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1263 ) -> Result<CupGetInfoResult, fidl::Error> {
1264 let _response = fidl::client::decode_transaction_body::<
1265 fidl::encoding::ResultType<CupGetInfoResponse, GetInfoError>,
1266 fidl::encoding::DefaultFuchsiaResourceDialect,
1267 0x5b2cedd887209b9c,
1268 >(_buf?)?;
1269 Ok(_response.map(|x| (x.version, x.channel)))
1270 }
1271 self.client.send_query_and_decode::<CupGetInfoRequest, CupGetInfoResult>(
1272 (url,),
1273 0x5b2cedd887209b9c,
1274 fidl::encoding::DynamicFlags::empty(),
1275 _decode,
1276 )
1277 }
1278}
1279
1280pub struct CupEventStream {
1281 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1282}
1283
1284impl std::marker::Unpin for CupEventStream {}
1285
1286impl futures::stream::FusedStream for CupEventStream {
1287 fn is_terminated(&self) -> bool {
1288 self.event_receiver.is_terminated()
1289 }
1290}
1291
1292impl futures::Stream for CupEventStream {
1293 type Item = Result<CupEvent, fidl::Error>;
1294
1295 fn poll_next(
1296 mut self: std::pin::Pin<&mut Self>,
1297 cx: &mut std::task::Context<'_>,
1298 ) -> std::task::Poll<Option<Self::Item>> {
1299 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1300 &mut self.event_receiver,
1301 cx
1302 )?) {
1303 Some(buf) => std::task::Poll::Ready(Some(CupEvent::decode(buf))),
1304 None => std::task::Poll::Ready(None),
1305 }
1306 }
1307}
1308
1309#[derive(Debug)]
1310pub enum CupEvent {}
1311
1312impl CupEvent {
1313 fn decode(
1315 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1316 ) -> Result<CupEvent, fidl::Error> {
1317 let (bytes, _handles) = buf.split_mut();
1318 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1319 debug_assert_eq!(tx_header.tx_id, 0);
1320 match tx_header.ordinal {
1321 _ => Err(fidl::Error::UnknownOrdinal {
1322 ordinal: tx_header.ordinal,
1323 protocol_name: <CupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1324 }),
1325 }
1326 }
1327}
1328
1329pub struct CupRequestStream {
1331 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1332 is_terminated: bool,
1333}
1334
1335impl std::marker::Unpin for CupRequestStream {}
1336
1337impl futures::stream::FusedStream for CupRequestStream {
1338 fn is_terminated(&self) -> bool {
1339 self.is_terminated
1340 }
1341}
1342
1343impl fidl::endpoints::RequestStream for CupRequestStream {
1344 type Protocol = CupMarker;
1345 type ControlHandle = CupControlHandle;
1346
1347 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1348 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1349 }
1350
1351 fn control_handle(&self) -> Self::ControlHandle {
1352 CupControlHandle { inner: self.inner.clone() }
1353 }
1354
1355 fn into_inner(
1356 self,
1357 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1358 {
1359 (self.inner, self.is_terminated)
1360 }
1361
1362 fn from_inner(
1363 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1364 is_terminated: bool,
1365 ) -> Self {
1366 Self { inner, is_terminated }
1367 }
1368}
1369
1370impl futures::Stream for CupRequestStream {
1371 type Item = Result<CupRequest, fidl::Error>;
1372
1373 fn poll_next(
1374 mut self: std::pin::Pin<&mut Self>,
1375 cx: &mut std::task::Context<'_>,
1376 ) -> std::task::Poll<Option<Self::Item>> {
1377 let this = &mut *self;
1378 if this.inner.check_shutdown(cx) {
1379 this.is_terminated = true;
1380 return std::task::Poll::Ready(None);
1381 }
1382 if this.is_terminated {
1383 panic!("polled CupRequestStream after completion");
1384 }
1385 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1386 |bytes, handles| {
1387 match this.inner.channel().read_etc(cx, bytes, handles) {
1388 std::task::Poll::Ready(Ok(())) => {}
1389 std::task::Poll::Pending => return std::task::Poll::Pending,
1390 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1391 this.is_terminated = true;
1392 return std::task::Poll::Ready(None);
1393 }
1394 std::task::Poll::Ready(Err(e)) => {
1395 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1396 e.into(),
1397 ))))
1398 }
1399 }
1400
1401 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1403
1404 std::task::Poll::Ready(Some(match header.ordinal {
1405 0x29f30e83bda39c37 => {
1406 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1407 let mut req = fidl::new_empty!(
1408 CupWriteRequest,
1409 fidl::encoding::DefaultFuchsiaResourceDialect
1410 );
1411 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CupWriteRequest>(&header, _body_bytes, handles, &mut req)?;
1412 let control_handle = CupControlHandle { inner: this.inner.clone() };
1413 Ok(CupRequest::Write {
1414 url: req.url,
1415 cup: req.cup,
1416
1417 responder: CupWriteResponder {
1418 control_handle: std::mem::ManuallyDrop::new(control_handle),
1419 tx_id: header.tx_id,
1420 },
1421 })
1422 }
1423 0x5b2cedd887209b9c => {
1424 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1425 let mut req = fidl::new_empty!(
1426 CupGetInfoRequest,
1427 fidl::encoding::DefaultFuchsiaResourceDialect
1428 );
1429 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CupGetInfoRequest>(&header, _body_bytes, handles, &mut req)?;
1430 let control_handle = CupControlHandle { inner: this.inner.clone() };
1431 Ok(CupRequest::GetInfo {
1432 url: req.url,
1433
1434 responder: CupGetInfoResponder {
1435 control_handle: std::mem::ManuallyDrop::new(control_handle),
1436 tx_id: header.tx_id,
1437 },
1438 })
1439 }
1440 _ => Err(fidl::Error::UnknownOrdinal {
1441 ordinal: header.ordinal,
1442 protocol_name: <CupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1443 }),
1444 }))
1445 },
1446 )
1447 }
1448}
1449
1450#[derive(Debug)]
1453pub enum CupRequest {
1454 Write { url: PackageUrl, cup: CupData, responder: CupWriteResponder },
1457 GetInfo { url: PackageUrl, responder: CupGetInfoResponder },
1459}
1460
1461impl CupRequest {
1462 #[allow(irrefutable_let_patterns)]
1463 pub fn into_write(self) -> Option<(PackageUrl, CupData, CupWriteResponder)> {
1464 if let CupRequest::Write { url, cup, responder } = self {
1465 Some((url, cup, responder))
1466 } else {
1467 None
1468 }
1469 }
1470
1471 #[allow(irrefutable_let_patterns)]
1472 pub fn into_get_info(self) -> Option<(PackageUrl, CupGetInfoResponder)> {
1473 if let CupRequest::GetInfo { url, responder } = self {
1474 Some((url, responder))
1475 } else {
1476 None
1477 }
1478 }
1479
1480 pub fn method_name(&self) -> &'static str {
1482 match *self {
1483 CupRequest::Write { .. } => "write",
1484 CupRequest::GetInfo { .. } => "get_info",
1485 }
1486 }
1487}
1488
1489#[derive(Debug, Clone)]
1490pub struct CupControlHandle {
1491 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1492}
1493
1494impl fidl::endpoints::ControlHandle for CupControlHandle {
1495 fn shutdown(&self) {
1496 self.inner.shutdown()
1497 }
1498 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1499 self.inner.shutdown_with_epitaph(status)
1500 }
1501
1502 fn is_closed(&self) -> bool {
1503 self.inner.channel().is_closed()
1504 }
1505 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1506 self.inner.channel().on_closed()
1507 }
1508
1509 #[cfg(target_os = "fuchsia")]
1510 fn signal_peer(
1511 &self,
1512 clear_mask: zx::Signals,
1513 set_mask: zx::Signals,
1514 ) -> Result<(), zx_status::Status> {
1515 use fidl::Peered;
1516 self.inner.channel().signal_peer(clear_mask, set_mask)
1517 }
1518}
1519
1520impl CupControlHandle {}
1521
1522#[must_use = "FIDL methods require a response to be sent"]
1523#[derive(Debug)]
1524pub struct CupWriteResponder {
1525 control_handle: std::mem::ManuallyDrop<CupControlHandle>,
1526 tx_id: u32,
1527}
1528
1529impl std::ops::Drop for CupWriteResponder {
1533 fn drop(&mut self) {
1534 self.control_handle.shutdown();
1535 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1537 }
1538}
1539
1540impl fidl::endpoints::Responder for CupWriteResponder {
1541 type ControlHandle = CupControlHandle;
1542
1543 fn control_handle(&self) -> &CupControlHandle {
1544 &self.control_handle
1545 }
1546
1547 fn drop_without_shutdown(mut self) {
1548 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1550 std::mem::forget(self);
1552 }
1553}
1554
1555impl CupWriteResponder {
1556 pub fn send(self, mut result: Result<(), WriteError>) -> Result<(), fidl::Error> {
1560 let _result = self.send_raw(result);
1561 if _result.is_err() {
1562 self.control_handle.shutdown();
1563 }
1564 self.drop_without_shutdown();
1565 _result
1566 }
1567
1568 pub fn send_no_shutdown_on_err(
1570 self,
1571 mut result: Result<(), WriteError>,
1572 ) -> Result<(), fidl::Error> {
1573 let _result = self.send_raw(result);
1574 self.drop_without_shutdown();
1575 _result
1576 }
1577
1578 fn send_raw(&self, mut result: Result<(), WriteError>) -> Result<(), fidl::Error> {
1579 self.control_handle
1580 .inner
1581 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, WriteError>>(
1582 result,
1583 self.tx_id,
1584 0x29f30e83bda39c37,
1585 fidl::encoding::DynamicFlags::empty(),
1586 )
1587 }
1588}
1589
1590#[must_use = "FIDL methods require a response to be sent"]
1591#[derive(Debug)]
1592pub struct CupGetInfoResponder {
1593 control_handle: std::mem::ManuallyDrop<CupControlHandle>,
1594 tx_id: u32,
1595}
1596
1597impl std::ops::Drop for CupGetInfoResponder {
1601 fn drop(&mut self) {
1602 self.control_handle.shutdown();
1603 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1605 }
1606}
1607
1608impl fidl::endpoints::Responder for CupGetInfoResponder {
1609 type ControlHandle = CupControlHandle;
1610
1611 fn control_handle(&self) -> &CupControlHandle {
1612 &self.control_handle
1613 }
1614
1615 fn drop_without_shutdown(mut self) {
1616 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1618 std::mem::forget(self);
1620 }
1621}
1622
1623impl CupGetInfoResponder {
1624 pub fn send(self, mut result: Result<(&str, &str), GetInfoError>) -> Result<(), fidl::Error> {
1628 let _result = self.send_raw(result);
1629 if _result.is_err() {
1630 self.control_handle.shutdown();
1631 }
1632 self.drop_without_shutdown();
1633 _result
1634 }
1635
1636 pub fn send_no_shutdown_on_err(
1638 self,
1639 mut result: Result<(&str, &str), GetInfoError>,
1640 ) -> Result<(), fidl::Error> {
1641 let _result = self.send_raw(result);
1642 self.drop_without_shutdown();
1643 _result
1644 }
1645
1646 fn send_raw(&self, mut result: Result<(&str, &str), GetInfoError>) -> Result<(), fidl::Error> {
1647 self.control_handle
1648 .inner
1649 .send::<fidl::encoding::ResultType<CupGetInfoResponse, GetInfoError>>(
1650 result,
1651 self.tx_id,
1652 0x5b2cedd887209b9c,
1653 fidl::encoding::DynamicFlags::empty(),
1654 )
1655 }
1656}
1657
1658#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1659pub struct FontResolverMarker;
1660
1661impl fidl::endpoints::ProtocolMarker for FontResolverMarker {
1662 type Proxy = FontResolverProxy;
1663 type RequestStream = FontResolverRequestStream;
1664 #[cfg(target_os = "fuchsia")]
1665 type SynchronousProxy = FontResolverSynchronousProxy;
1666
1667 const DEBUG_NAME: &'static str = "fuchsia.pkg.FontResolver";
1668}
1669impl fidl::endpoints::DiscoverableProtocolMarker for FontResolverMarker {}
1670pub type FontResolverResolveResult = Result<(), i32>;
1671
1672pub trait FontResolverProxyInterface: Send + Sync {
1673 type ResolveResponseFut: std::future::Future<Output = Result<FontResolverResolveResult, fidl::Error>>
1674 + Send;
1675 fn r#resolve(
1676 &self,
1677 package_url: &str,
1678 directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1679 ) -> Self::ResolveResponseFut;
1680}
1681#[derive(Debug)]
1682#[cfg(target_os = "fuchsia")]
1683pub struct FontResolverSynchronousProxy {
1684 client: fidl::client::sync::Client,
1685}
1686
1687#[cfg(target_os = "fuchsia")]
1688impl fidl::endpoints::SynchronousProxy for FontResolverSynchronousProxy {
1689 type Proxy = FontResolverProxy;
1690 type Protocol = FontResolverMarker;
1691
1692 fn from_channel(inner: fidl::Channel) -> Self {
1693 Self::new(inner)
1694 }
1695
1696 fn into_channel(self) -> fidl::Channel {
1697 self.client.into_channel()
1698 }
1699
1700 fn as_channel(&self) -> &fidl::Channel {
1701 self.client.as_channel()
1702 }
1703}
1704
1705#[cfg(target_os = "fuchsia")]
1706impl FontResolverSynchronousProxy {
1707 pub fn new(channel: fidl::Channel) -> Self {
1708 let protocol_name = <FontResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1709 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1710 }
1711
1712 pub fn into_channel(self) -> fidl::Channel {
1713 self.client.into_channel()
1714 }
1715
1716 pub fn wait_for_event(
1719 &self,
1720 deadline: zx::MonotonicInstant,
1721 ) -> Result<FontResolverEvent, fidl::Error> {
1722 FontResolverEvent::decode(self.client.wait_for_event(deadline)?)
1723 }
1724
1725 pub fn r#resolve(
1742 &self,
1743 mut package_url: &str,
1744 mut directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1745 ___deadline: zx::MonotonicInstant,
1746 ) -> Result<FontResolverResolveResult, fidl::Error> {
1747 let _response = self.client.send_query::<
1748 FontResolverResolveRequest,
1749 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1750 >(
1751 (package_url, directory_request,),
1752 0x159f60cc5ba432da,
1753 fidl::encoding::DynamicFlags::empty(),
1754 ___deadline,
1755 )?;
1756 Ok(_response.map(|x| x))
1757 }
1758}
1759
1760#[cfg(target_os = "fuchsia")]
1761impl From<FontResolverSynchronousProxy> for zx::Handle {
1762 fn from(value: FontResolverSynchronousProxy) -> Self {
1763 value.into_channel().into()
1764 }
1765}
1766
1767#[cfg(target_os = "fuchsia")]
1768impl From<fidl::Channel> for FontResolverSynchronousProxy {
1769 fn from(value: fidl::Channel) -> Self {
1770 Self::new(value)
1771 }
1772}
1773
1774#[derive(Debug, Clone)]
1775pub struct FontResolverProxy {
1776 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1777}
1778
1779impl fidl::endpoints::Proxy for FontResolverProxy {
1780 type Protocol = FontResolverMarker;
1781
1782 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1783 Self::new(inner)
1784 }
1785
1786 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1787 self.client.into_channel().map_err(|client| Self { client })
1788 }
1789
1790 fn as_channel(&self) -> &::fidl::AsyncChannel {
1791 self.client.as_channel()
1792 }
1793}
1794
1795impl FontResolverProxy {
1796 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1798 let protocol_name = <FontResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1799 Self { client: fidl::client::Client::new(channel, protocol_name) }
1800 }
1801
1802 pub fn take_event_stream(&self) -> FontResolverEventStream {
1808 FontResolverEventStream { event_receiver: self.client.take_event_receiver() }
1809 }
1810
1811 pub fn r#resolve(
1828 &self,
1829 mut package_url: &str,
1830 mut directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1831 ) -> fidl::client::QueryResponseFut<
1832 FontResolverResolveResult,
1833 fidl::encoding::DefaultFuchsiaResourceDialect,
1834 > {
1835 FontResolverProxyInterface::r#resolve(self, package_url, directory_request)
1836 }
1837}
1838
1839impl FontResolverProxyInterface for FontResolverProxy {
1840 type ResolveResponseFut = fidl::client::QueryResponseFut<
1841 FontResolverResolveResult,
1842 fidl::encoding::DefaultFuchsiaResourceDialect,
1843 >;
1844 fn r#resolve(
1845 &self,
1846 mut package_url: &str,
1847 mut directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1848 ) -> Self::ResolveResponseFut {
1849 fn _decode(
1850 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1851 ) -> Result<FontResolverResolveResult, fidl::Error> {
1852 let _response = fidl::client::decode_transaction_body::<
1853 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1854 fidl::encoding::DefaultFuchsiaResourceDialect,
1855 0x159f60cc5ba432da,
1856 >(_buf?)?;
1857 Ok(_response.map(|x| x))
1858 }
1859 self.client.send_query_and_decode::<FontResolverResolveRequest, FontResolverResolveResult>(
1860 (package_url, directory_request),
1861 0x159f60cc5ba432da,
1862 fidl::encoding::DynamicFlags::empty(),
1863 _decode,
1864 )
1865 }
1866}
1867
1868pub struct FontResolverEventStream {
1869 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1870}
1871
1872impl std::marker::Unpin for FontResolverEventStream {}
1873
1874impl futures::stream::FusedStream for FontResolverEventStream {
1875 fn is_terminated(&self) -> bool {
1876 self.event_receiver.is_terminated()
1877 }
1878}
1879
1880impl futures::Stream for FontResolverEventStream {
1881 type Item = Result<FontResolverEvent, fidl::Error>;
1882
1883 fn poll_next(
1884 mut self: std::pin::Pin<&mut Self>,
1885 cx: &mut std::task::Context<'_>,
1886 ) -> std::task::Poll<Option<Self::Item>> {
1887 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1888 &mut self.event_receiver,
1889 cx
1890 )?) {
1891 Some(buf) => std::task::Poll::Ready(Some(FontResolverEvent::decode(buf))),
1892 None => std::task::Poll::Ready(None),
1893 }
1894 }
1895}
1896
1897#[derive(Debug)]
1898pub enum FontResolverEvent {}
1899
1900impl FontResolverEvent {
1901 fn decode(
1903 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1904 ) -> Result<FontResolverEvent, fidl::Error> {
1905 let (bytes, _handles) = buf.split_mut();
1906 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1907 debug_assert_eq!(tx_header.tx_id, 0);
1908 match tx_header.ordinal {
1909 _ => Err(fidl::Error::UnknownOrdinal {
1910 ordinal: tx_header.ordinal,
1911 protocol_name: <FontResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1912 }),
1913 }
1914 }
1915}
1916
1917pub struct FontResolverRequestStream {
1919 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1920 is_terminated: bool,
1921}
1922
1923impl std::marker::Unpin for FontResolverRequestStream {}
1924
1925impl futures::stream::FusedStream for FontResolverRequestStream {
1926 fn is_terminated(&self) -> bool {
1927 self.is_terminated
1928 }
1929}
1930
1931impl fidl::endpoints::RequestStream for FontResolverRequestStream {
1932 type Protocol = FontResolverMarker;
1933 type ControlHandle = FontResolverControlHandle;
1934
1935 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1936 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1937 }
1938
1939 fn control_handle(&self) -> Self::ControlHandle {
1940 FontResolverControlHandle { inner: self.inner.clone() }
1941 }
1942
1943 fn into_inner(
1944 self,
1945 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1946 {
1947 (self.inner, self.is_terminated)
1948 }
1949
1950 fn from_inner(
1951 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1952 is_terminated: bool,
1953 ) -> Self {
1954 Self { inner, is_terminated }
1955 }
1956}
1957
1958impl futures::Stream for FontResolverRequestStream {
1959 type Item = Result<FontResolverRequest, fidl::Error>;
1960
1961 fn poll_next(
1962 mut self: std::pin::Pin<&mut Self>,
1963 cx: &mut std::task::Context<'_>,
1964 ) -> std::task::Poll<Option<Self::Item>> {
1965 let this = &mut *self;
1966 if this.inner.check_shutdown(cx) {
1967 this.is_terminated = true;
1968 return std::task::Poll::Ready(None);
1969 }
1970 if this.is_terminated {
1971 panic!("polled FontResolverRequestStream after completion");
1972 }
1973 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1974 |bytes, handles| {
1975 match this.inner.channel().read_etc(cx, bytes, handles) {
1976 std::task::Poll::Ready(Ok(())) => {}
1977 std::task::Poll::Pending => return std::task::Poll::Pending,
1978 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1979 this.is_terminated = true;
1980 return std::task::Poll::Ready(None);
1981 }
1982 std::task::Poll::Ready(Err(e)) => {
1983 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1984 e.into(),
1985 ))))
1986 }
1987 }
1988
1989 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1991
1992 std::task::Poll::Ready(Some(match header.ordinal {
1993 0x159f60cc5ba432da => {
1994 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1995 let mut req = fidl::new_empty!(
1996 FontResolverResolveRequest,
1997 fidl::encoding::DefaultFuchsiaResourceDialect
1998 );
1999 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FontResolverResolveRequest>(&header, _body_bytes, handles, &mut req)?;
2000 let control_handle =
2001 FontResolverControlHandle { inner: this.inner.clone() };
2002 Ok(FontResolverRequest::Resolve {
2003 package_url: req.package_url,
2004 directory_request: req.directory_request,
2005
2006 responder: FontResolverResolveResponder {
2007 control_handle: std::mem::ManuallyDrop::new(control_handle),
2008 tx_id: header.tx_id,
2009 },
2010 })
2011 }
2012 _ => Err(fidl::Error::UnknownOrdinal {
2013 ordinal: header.ordinal,
2014 protocol_name:
2015 <FontResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2016 }),
2017 }))
2018 },
2019 )
2020 }
2021}
2022
2023#[derive(Debug)]
2031pub enum FontResolverRequest {
2032 Resolve {
2049 package_url: String,
2050 directory_request: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2051 responder: FontResolverResolveResponder,
2052 },
2053}
2054
2055impl FontResolverRequest {
2056 #[allow(irrefutable_let_patterns)]
2057 pub fn into_resolve(
2058 self,
2059 ) -> Option<(
2060 String,
2061 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2062 FontResolverResolveResponder,
2063 )> {
2064 if let FontResolverRequest::Resolve { package_url, directory_request, responder } = self {
2065 Some((package_url, directory_request, responder))
2066 } else {
2067 None
2068 }
2069 }
2070
2071 pub fn method_name(&self) -> &'static str {
2073 match *self {
2074 FontResolverRequest::Resolve { .. } => "resolve",
2075 }
2076 }
2077}
2078
2079#[derive(Debug, Clone)]
2080pub struct FontResolverControlHandle {
2081 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2082}
2083
2084impl fidl::endpoints::ControlHandle for FontResolverControlHandle {
2085 fn shutdown(&self) {
2086 self.inner.shutdown()
2087 }
2088 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2089 self.inner.shutdown_with_epitaph(status)
2090 }
2091
2092 fn is_closed(&self) -> bool {
2093 self.inner.channel().is_closed()
2094 }
2095 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2096 self.inner.channel().on_closed()
2097 }
2098
2099 #[cfg(target_os = "fuchsia")]
2100 fn signal_peer(
2101 &self,
2102 clear_mask: zx::Signals,
2103 set_mask: zx::Signals,
2104 ) -> Result<(), zx_status::Status> {
2105 use fidl::Peered;
2106 self.inner.channel().signal_peer(clear_mask, set_mask)
2107 }
2108}
2109
2110impl FontResolverControlHandle {}
2111
2112#[must_use = "FIDL methods require a response to be sent"]
2113#[derive(Debug)]
2114pub struct FontResolverResolveResponder {
2115 control_handle: std::mem::ManuallyDrop<FontResolverControlHandle>,
2116 tx_id: u32,
2117}
2118
2119impl std::ops::Drop for FontResolverResolveResponder {
2123 fn drop(&mut self) {
2124 self.control_handle.shutdown();
2125 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2127 }
2128}
2129
2130impl fidl::endpoints::Responder for FontResolverResolveResponder {
2131 type ControlHandle = FontResolverControlHandle;
2132
2133 fn control_handle(&self) -> &FontResolverControlHandle {
2134 &self.control_handle
2135 }
2136
2137 fn drop_without_shutdown(mut self) {
2138 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2140 std::mem::forget(self);
2142 }
2143}
2144
2145impl FontResolverResolveResponder {
2146 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2150 let _result = self.send_raw(result);
2151 if _result.is_err() {
2152 self.control_handle.shutdown();
2153 }
2154 self.drop_without_shutdown();
2155 _result
2156 }
2157
2158 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2160 let _result = self.send_raw(result);
2161 self.drop_without_shutdown();
2162 _result
2163 }
2164
2165 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2166 self.control_handle
2167 .inner
2168 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2169 result,
2170 self.tx_id,
2171 0x159f60cc5ba432da,
2172 fidl::encoding::DynamicFlags::empty(),
2173 )
2174 }
2175}
2176
2177#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2178pub struct NeededBlobsMarker;
2179
2180impl fidl::endpoints::ProtocolMarker for NeededBlobsMarker {
2181 type Proxy = NeededBlobsProxy;
2182 type RequestStream = NeededBlobsRequestStream;
2183 #[cfg(target_os = "fuchsia")]
2184 type SynchronousProxy = NeededBlobsSynchronousProxy;
2185
2186 const DEBUG_NAME: &'static str = "(anonymous) NeededBlobs";
2187}
2188pub type NeededBlobsOpenMetaBlobResult = Result<Option<Box<BlobWriter>>, OpenBlobError>;
2189pub type NeededBlobsOpenBlobResult = Result<Option<Box<BlobWriter>>, OpenBlobError>;
2190pub type NeededBlobsBlobWrittenResult = Result<(), BlobWrittenError>;
2191
2192pub trait NeededBlobsProxyInterface: Send + Sync {
2193 type OpenMetaBlobResponseFut: std::future::Future<Output = Result<NeededBlobsOpenMetaBlobResult, fidl::Error>>
2194 + Send;
2195 fn r#open_meta_blob(&self) -> Self::OpenMetaBlobResponseFut;
2196 fn r#get_missing_blobs(
2197 &self,
2198 iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
2199 ) -> Result<(), fidl::Error>;
2200 type OpenBlobResponseFut: std::future::Future<Output = Result<NeededBlobsOpenBlobResult, fidl::Error>>
2201 + Send;
2202 fn r#open_blob(&self, blob_id: &BlobId) -> Self::OpenBlobResponseFut;
2203 type BlobWrittenResponseFut: std::future::Future<Output = Result<NeededBlobsBlobWrittenResult, fidl::Error>>
2204 + Send;
2205 fn r#blob_written(&self, blob_id: &BlobId) -> Self::BlobWrittenResponseFut;
2206 type AbortResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2207 fn r#abort(&self) -> Self::AbortResponseFut;
2208}
2209#[derive(Debug)]
2210#[cfg(target_os = "fuchsia")]
2211pub struct NeededBlobsSynchronousProxy {
2212 client: fidl::client::sync::Client,
2213}
2214
2215#[cfg(target_os = "fuchsia")]
2216impl fidl::endpoints::SynchronousProxy for NeededBlobsSynchronousProxy {
2217 type Proxy = NeededBlobsProxy;
2218 type Protocol = NeededBlobsMarker;
2219
2220 fn from_channel(inner: fidl::Channel) -> Self {
2221 Self::new(inner)
2222 }
2223
2224 fn into_channel(self) -> fidl::Channel {
2225 self.client.into_channel()
2226 }
2227
2228 fn as_channel(&self) -> &fidl::Channel {
2229 self.client.as_channel()
2230 }
2231}
2232
2233#[cfg(target_os = "fuchsia")]
2234impl NeededBlobsSynchronousProxy {
2235 pub fn new(channel: fidl::Channel) -> Self {
2236 let protocol_name = <NeededBlobsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2237 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2238 }
2239
2240 pub fn into_channel(self) -> fidl::Channel {
2241 self.client.into_channel()
2242 }
2243
2244 pub fn wait_for_event(
2247 &self,
2248 deadline: zx::MonotonicInstant,
2249 ) -> Result<NeededBlobsEvent, fidl::Error> {
2250 NeededBlobsEvent::decode(self.client.wait_for_event(deadline)?)
2251 }
2252
2253 pub fn r#open_meta_blob(
2266 &self,
2267 ___deadline: zx::MonotonicInstant,
2268 ) -> Result<NeededBlobsOpenMetaBlobResult, fidl::Error> {
2269 let _response =
2270 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
2271 NeededBlobsOpenMetaBlobResponse,
2272 OpenBlobError,
2273 >>(
2274 (),
2275 0x42f385a58180f5fb,
2276 fidl::encoding::DynamicFlags::empty(),
2277 ___deadline,
2278 )?;
2279 Ok(_response.map(|x| x.writer))
2280 }
2281
2282 pub fn r#get_missing_blobs(
2300 &self,
2301 mut iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
2302 ) -> Result<(), fidl::Error> {
2303 self.client.send::<NeededBlobsGetMissingBlobsRequest>(
2304 (iterator,),
2305 0x44eaf14fd56e7ae1,
2306 fidl::encoding::DynamicFlags::empty(),
2307 )
2308 }
2309
2310 pub fn r#open_blob(
2319 &self,
2320 mut blob_id: &BlobId,
2321 ___deadline: zx::MonotonicInstant,
2322 ) -> Result<NeededBlobsOpenBlobResult, fidl::Error> {
2323 let _response = self.client.send_query::<
2324 NeededBlobsOpenBlobRequest,
2325 fidl::encoding::ResultType<NeededBlobsOpenBlobResponse, OpenBlobError>,
2326 >(
2327 (blob_id,),
2328 0x67cd4c4cd10ea9e0,
2329 fidl::encoding::DynamicFlags::empty(),
2330 ___deadline,
2331 )?;
2332 Ok(_response.map(|x| x.writer))
2333 }
2334
2335 pub fn r#blob_written(
2346 &self,
2347 mut blob_id: &BlobId,
2348 ___deadline: zx::MonotonicInstant,
2349 ) -> Result<NeededBlobsBlobWrittenResult, fidl::Error> {
2350 let _response = self.client.send_query::<
2351 NeededBlobsBlobWrittenRequest,
2352 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BlobWrittenError>,
2353 >(
2354 (blob_id,),
2355 0x222f80ec77433f44,
2356 fidl::encoding::DynamicFlags::empty(),
2357 ___deadline,
2358 )?;
2359 Ok(_response.map(|x| x))
2360 }
2361
2362 pub fn r#abort(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2372 let _response =
2373 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
2374 (),
2375 0x6fda8d5ebea74cbb,
2376 fidl::encoding::DynamicFlags::empty(),
2377 ___deadline,
2378 )?;
2379 Ok(_response)
2380 }
2381}
2382
2383#[cfg(target_os = "fuchsia")]
2384impl From<NeededBlobsSynchronousProxy> for zx::Handle {
2385 fn from(value: NeededBlobsSynchronousProxy) -> Self {
2386 value.into_channel().into()
2387 }
2388}
2389
2390#[cfg(target_os = "fuchsia")]
2391impl From<fidl::Channel> for NeededBlobsSynchronousProxy {
2392 fn from(value: fidl::Channel) -> Self {
2393 Self::new(value)
2394 }
2395}
2396
2397#[derive(Debug, Clone)]
2398pub struct NeededBlobsProxy {
2399 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2400}
2401
2402impl fidl::endpoints::Proxy for NeededBlobsProxy {
2403 type Protocol = NeededBlobsMarker;
2404
2405 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2406 Self::new(inner)
2407 }
2408
2409 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2410 self.client.into_channel().map_err(|client| Self { client })
2411 }
2412
2413 fn as_channel(&self) -> &::fidl::AsyncChannel {
2414 self.client.as_channel()
2415 }
2416}
2417
2418impl NeededBlobsProxy {
2419 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2421 let protocol_name = <NeededBlobsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2422 Self { client: fidl::client::Client::new(channel, protocol_name) }
2423 }
2424
2425 pub fn take_event_stream(&self) -> NeededBlobsEventStream {
2431 NeededBlobsEventStream { event_receiver: self.client.take_event_receiver() }
2432 }
2433
2434 pub fn r#open_meta_blob(
2447 &self,
2448 ) -> fidl::client::QueryResponseFut<
2449 NeededBlobsOpenMetaBlobResult,
2450 fidl::encoding::DefaultFuchsiaResourceDialect,
2451 > {
2452 NeededBlobsProxyInterface::r#open_meta_blob(self)
2453 }
2454
2455 pub fn r#get_missing_blobs(
2473 &self,
2474 mut iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
2475 ) -> Result<(), fidl::Error> {
2476 NeededBlobsProxyInterface::r#get_missing_blobs(self, iterator)
2477 }
2478
2479 pub fn r#open_blob(
2488 &self,
2489 mut blob_id: &BlobId,
2490 ) -> fidl::client::QueryResponseFut<
2491 NeededBlobsOpenBlobResult,
2492 fidl::encoding::DefaultFuchsiaResourceDialect,
2493 > {
2494 NeededBlobsProxyInterface::r#open_blob(self, blob_id)
2495 }
2496
2497 pub fn r#blob_written(
2508 &self,
2509 mut blob_id: &BlobId,
2510 ) -> fidl::client::QueryResponseFut<
2511 NeededBlobsBlobWrittenResult,
2512 fidl::encoding::DefaultFuchsiaResourceDialect,
2513 > {
2514 NeededBlobsProxyInterface::r#blob_written(self, blob_id)
2515 }
2516
2517 pub fn r#abort(
2527 &self,
2528 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2529 NeededBlobsProxyInterface::r#abort(self)
2530 }
2531}
2532
2533impl NeededBlobsProxyInterface for NeededBlobsProxy {
2534 type OpenMetaBlobResponseFut = fidl::client::QueryResponseFut<
2535 NeededBlobsOpenMetaBlobResult,
2536 fidl::encoding::DefaultFuchsiaResourceDialect,
2537 >;
2538 fn r#open_meta_blob(&self) -> Self::OpenMetaBlobResponseFut {
2539 fn _decode(
2540 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2541 ) -> Result<NeededBlobsOpenMetaBlobResult, fidl::Error> {
2542 let _response = fidl::client::decode_transaction_body::<
2543 fidl::encoding::ResultType<NeededBlobsOpenMetaBlobResponse, OpenBlobError>,
2544 fidl::encoding::DefaultFuchsiaResourceDialect,
2545 0x42f385a58180f5fb,
2546 >(_buf?)?;
2547 Ok(_response.map(|x| x.writer))
2548 }
2549 self.client
2550 .send_query_and_decode::<fidl::encoding::EmptyPayload, NeededBlobsOpenMetaBlobResult>(
2551 (),
2552 0x42f385a58180f5fb,
2553 fidl::encoding::DynamicFlags::empty(),
2554 _decode,
2555 )
2556 }
2557
2558 fn r#get_missing_blobs(
2559 &self,
2560 mut iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
2561 ) -> Result<(), fidl::Error> {
2562 self.client.send::<NeededBlobsGetMissingBlobsRequest>(
2563 (iterator,),
2564 0x44eaf14fd56e7ae1,
2565 fidl::encoding::DynamicFlags::empty(),
2566 )
2567 }
2568
2569 type OpenBlobResponseFut = fidl::client::QueryResponseFut<
2570 NeededBlobsOpenBlobResult,
2571 fidl::encoding::DefaultFuchsiaResourceDialect,
2572 >;
2573 fn r#open_blob(&self, mut blob_id: &BlobId) -> Self::OpenBlobResponseFut {
2574 fn _decode(
2575 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2576 ) -> Result<NeededBlobsOpenBlobResult, fidl::Error> {
2577 let _response = fidl::client::decode_transaction_body::<
2578 fidl::encoding::ResultType<NeededBlobsOpenBlobResponse, OpenBlobError>,
2579 fidl::encoding::DefaultFuchsiaResourceDialect,
2580 0x67cd4c4cd10ea9e0,
2581 >(_buf?)?;
2582 Ok(_response.map(|x| x.writer))
2583 }
2584 self.client.send_query_and_decode::<NeededBlobsOpenBlobRequest, NeededBlobsOpenBlobResult>(
2585 (blob_id,),
2586 0x67cd4c4cd10ea9e0,
2587 fidl::encoding::DynamicFlags::empty(),
2588 _decode,
2589 )
2590 }
2591
2592 type BlobWrittenResponseFut = fidl::client::QueryResponseFut<
2593 NeededBlobsBlobWrittenResult,
2594 fidl::encoding::DefaultFuchsiaResourceDialect,
2595 >;
2596 fn r#blob_written(&self, mut blob_id: &BlobId) -> Self::BlobWrittenResponseFut {
2597 fn _decode(
2598 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2599 ) -> Result<NeededBlobsBlobWrittenResult, fidl::Error> {
2600 let _response = fidl::client::decode_transaction_body::<
2601 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BlobWrittenError>,
2602 fidl::encoding::DefaultFuchsiaResourceDialect,
2603 0x222f80ec77433f44,
2604 >(_buf?)?;
2605 Ok(_response.map(|x| x))
2606 }
2607 self.client
2608 .send_query_and_decode::<NeededBlobsBlobWrittenRequest, NeededBlobsBlobWrittenResult>(
2609 (blob_id,),
2610 0x222f80ec77433f44,
2611 fidl::encoding::DynamicFlags::empty(),
2612 _decode,
2613 )
2614 }
2615
2616 type AbortResponseFut =
2617 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2618 fn r#abort(&self) -> Self::AbortResponseFut {
2619 fn _decode(
2620 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2621 ) -> Result<(), fidl::Error> {
2622 let _response = fidl::client::decode_transaction_body::<
2623 fidl::encoding::EmptyPayload,
2624 fidl::encoding::DefaultFuchsiaResourceDialect,
2625 0x6fda8d5ebea74cbb,
2626 >(_buf?)?;
2627 Ok(_response)
2628 }
2629 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2630 (),
2631 0x6fda8d5ebea74cbb,
2632 fidl::encoding::DynamicFlags::empty(),
2633 _decode,
2634 )
2635 }
2636}
2637
2638pub struct NeededBlobsEventStream {
2639 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2640}
2641
2642impl std::marker::Unpin for NeededBlobsEventStream {}
2643
2644impl futures::stream::FusedStream for NeededBlobsEventStream {
2645 fn is_terminated(&self) -> bool {
2646 self.event_receiver.is_terminated()
2647 }
2648}
2649
2650impl futures::Stream for NeededBlobsEventStream {
2651 type Item = Result<NeededBlobsEvent, fidl::Error>;
2652
2653 fn poll_next(
2654 mut self: std::pin::Pin<&mut Self>,
2655 cx: &mut std::task::Context<'_>,
2656 ) -> std::task::Poll<Option<Self::Item>> {
2657 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2658 &mut self.event_receiver,
2659 cx
2660 )?) {
2661 Some(buf) => std::task::Poll::Ready(Some(NeededBlobsEvent::decode(buf))),
2662 None => std::task::Poll::Ready(None),
2663 }
2664 }
2665}
2666
2667#[derive(Debug)]
2668pub enum NeededBlobsEvent {}
2669
2670impl NeededBlobsEvent {
2671 fn decode(
2673 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2674 ) -> Result<NeededBlobsEvent, fidl::Error> {
2675 let (bytes, _handles) = buf.split_mut();
2676 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2677 debug_assert_eq!(tx_header.tx_id, 0);
2678 match tx_header.ordinal {
2679 _ => Err(fidl::Error::UnknownOrdinal {
2680 ordinal: tx_header.ordinal,
2681 protocol_name: <NeededBlobsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2682 }),
2683 }
2684 }
2685}
2686
2687pub struct NeededBlobsRequestStream {
2689 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2690 is_terminated: bool,
2691}
2692
2693impl std::marker::Unpin for NeededBlobsRequestStream {}
2694
2695impl futures::stream::FusedStream for NeededBlobsRequestStream {
2696 fn is_terminated(&self) -> bool {
2697 self.is_terminated
2698 }
2699}
2700
2701impl fidl::endpoints::RequestStream for NeededBlobsRequestStream {
2702 type Protocol = NeededBlobsMarker;
2703 type ControlHandle = NeededBlobsControlHandle;
2704
2705 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2706 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2707 }
2708
2709 fn control_handle(&self) -> Self::ControlHandle {
2710 NeededBlobsControlHandle { inner: self.inner.clone() }
2711 }
2712
2713 fn into_inner(
2714 self,
2715 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2716 {
2717 (self.inner, self.is_terminated)
2718 }
2719
2720 fn from_inner(
2721 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2722 is_terminated: bool,
2723 ) -> Self {
2724 Self { inner, is_terminated }
2725 }
2726}
2727
2728impl futures::Stream for NeededBlobsRequestStream {
2729 type Item = Result<NeededBlobsRequest, fidl::Error>;
2730
2731 fn poll_next(
2732 mut self: std::pin::Pin<&mut Self>,
2733 cx: &mut std::task::Context<'_>,
2734 ) -> std::task::Poll<Option<Self::Item>> {
2735 let this = &mut *self;
2736 if this.inner.check_shutdown(cx) {
2737 this.is_terminated = true;
2738 return std::task::Poll::Ready(None);
2739 }
2740 if this.is_terminated {
2741 panic!("polled NeededBlobsRequestStream after completion");
2742 }
2743 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2744 |bytes, handles| {
2745 match this.inner.channel().read_etc(cx, bytes, handles) {
2746 std::task::Poll::Ready(Ok(())) => {}
2747 std::task::Poll::Pending => return std::task::Poll::Pending,
2748 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2749 this.is_terminated = true;
2750 return std::task::Poll::Ready(None);
2751 }
2752 std::task::Poll::Ready(Err(e)) => {
2753 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2754 e.into(),
2755 ))))
2756 }
2757 }
2758
2759 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2761
2762 std::task::Poll::Ready(Some(match header.ordinal {
2763 0x42f385a58180f5fb => {
2764 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2765 let mut req = fidl::new_empty!(
2766 fidl::encoding::EmptyPayload,
2767 fidl::encoding::DefaultFuchsiaResourceDialect
2768 );
2769 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2770 let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
2771 Ok(NeededBlobsRequest::OpenMetaBlob {
2772 responder: NeededBlobsOpenMetaBlobResponder {
2773 control_handle: std::mem::ManuallyDrop::new(control_handle),
2774 tx_id: header.tx_id,
2775 },
2776 })
2777 }
2778 0x44eaf14fd56e7ae1 => {
2779 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2780 let mut req = fidl::new_empty!(
2781 NeededBlobsGetMissingBlobsRequest,
2782 fidl::encoding::DefaultFuchsiaResourceDialect
2783 );
2784 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NeededBlobsGetMissingBlobsRequest>(&header, _body_bytes, handles, &mut req)?;
2785 let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
2786 Ok(NeededBlobsRequest::GetMissingBlobs {
2787 iterator: req.iterator,
2788
2789 control_handle,
2790 })
2791 }
2792 0x67cd4c4cd10ea9e0 => {
2793 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2794 let mut req = fidl::new_empty!(
2795 NeededBlobsOpenBlobRequest,
2796 fidl::encoding::DefaultFuchsiaResourceDialect
2797 );
2798 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NeededBlobsOpenBlobRequest>(&header, _body_bytes, handles, &mut req)?;
2799 let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
2800 Ok(NeededBlobsRequest::OpenBlob {
2801 blob_id: req.blob_id,
2802
2803 responder: NeededBlobsOpenBlobResponder {
2804 control_handle: std::mem::ManuallyDrop::new(control_handle),
2805 tx_id: header.tx_id,
2806 },
2807 })
2808 }
2809 0x222f80ec77433f44 => {
2810 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2811 let mut req = fidl::new_empty!(
2812 NeededBlobsBlobWrittenRequest,
2813 fidl::encoding::DefaultFuchsiaResourceDialect
2814 );
2815 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NeededBlobsBlobWrittenRequest>(&header, _body_bytes, handles, &mut req)?;
2816 let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
2817 Ok(NeededBlobsRequest::BlobWritten {
2818 blob_id: req.blob_id,
2819
2820 responder: NeededBlobsBlobWrittenResponder {
2821 control_handle: std::mem::ManuallyDrop::new(control_handle),
2822 tx_id: header.tx_id,
2823 },
2824 })
2825 }
2826 0x6fda8d5ebea74cbb => {
2827 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2828 let mut req = fidl::new_empty!(
2829 fidl::encoding::EmptyPayload,
2830 fidl::encoding::DefaultFuchsiaResourceDialect
2831 );
2832 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2833 let control_handle = NeededBlobsControlHandle { inner: this.inner.clone() };
2834 Ok(NeededBlobsRequest::Abort {
2835 responder: NeededBlobsAbortResponder {
2836 control_handle: std::mem::ManuallyDrop::new(control_handle),
2837 tx_id: header.tx_id,
2838 },
2839 })
2840 }
2841 _ => Err(fidl::Error::UnknownOrdinal {
2842 ordinal: header.ordinal,
2843 protocol_name:
2844 <NeededBlobsMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2845 }),
2846 }))
2847 },
2848 )
2849 }
2850}
2851
2852#[derive(Debug)]
2888pub enum NeededBlobsRequest {
2889 OpenMetaBlob { responder: NeededBlobsOpenMetaBlobResponder },
2902 GetMissingBlobs {
2920 iterator: fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>,
2921 control_handle: NeededBlobsControlHandle,
2922 },
2923 OpenBlob { blob_id: BlobId, responder: NeededBlobsOpenBlobResponder },
2932 BlobWritten { blob_id: BlobId, responder: NeededBlobsBlobWrittenResponder },
2943 Abort { responder: NeededBlobsAbortResponder },
2953}
2954
2955impl NeededBlobsRequest {
2956 #[allow(irrefutable_let_patterns)]
2957 pub fn into_open_meta_blob(self) -> Option<(NeededBlobsOpenMetaBlobResponder)> {
2958 if let NeededBlobsRequest::OpenMetaBlob { responder } = self {
2959 Some((responder))
2960 } else {
2961 None
2962 }
2963 }
2964
2965 #[allow(irrefutable_let_patterns)]
2966 pub fn into_get_missing_blobs(
2967 self,
2968 ) -> Option<(fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>, NeededBlobsControlHandle)>
2969 {
2970 if let NeededBlobsRequest::GetMissingBlobs { iterator, control_handle } = self {
2971 Some((iterator, control_handle))
2972 } else {
2973 None
2974 }
2975 }
2976
2977 #[allow(irrefutable_let_patterns)]
2978 pub fn into_open_blob(self) -> Option<(BlobId, NeededBlobsOpenBlobResponder)> {
2979 if let NeededBlobsRequest::OpenBlob { blob_id, responder } = self {
2980 Some((blob_id, responder))
2981 } else {
2982 None
2983 }
2984 }
2985
2986 #[allow(irrefutable_let_patterns)]
2987 pub fn into_blob_written(self) -> Option<(BlobId, NeededBlobsBlobWrittenResponder)> {
2988 if let NeededBlobsRequest::BlobWritten { blob_id, responder } = self {
2989 Some((blob_id, responder))
2990 } else {
2991 None
2992 }
2993 }
2994
2995 #[allow(irrefutable_let_patterns)]
2996 pub fn into_abort(self) -> Option<(NeededBlobsAbortResponder)> {
2997 if let NeededBlobsRequest::Abort { responder } = self {
2998 Some((responder))
2999 } else {
3000 None
3001 }
3002 }
3003
3004 pub fn method_name(&self) -> &'static str {
3006 match *self {
3007 NeededBlobsRequest::OpenMetaBlob { .. } => "open_meta_blob",
3008 NeededBlobsRequest::GetMissingBlobs { .. } => "get_missing_blobs",
3009 NeededBlobsRequest::OpenBlob { .. } => "open_blob",
3010 NeededBlobsRequest::BlobWritten { .. } => "blob_written",
3011 NeededBlobsRequest::Abort { .. } => "abort",
3012 }
3013 }
3014}
3015
3016#[derive(Debug, Clone)]
3017pub struct NeededBlobsControlHandle {
3018 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3019}
3020
3021impl fidl::endpoints::ControlHandle for NeededBlobsControlHandle {
3022 fn shutdown(&self) {
3023 self.inner.shutdown()
3024 }
3025 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3026 self.inner.shutdown_with_epitaph(status)
3027 }
3028
3029 fn is_closed(&self) -> bool {
3030 self.inner.channel().is_closed()
3031 }
3032 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3033 self.inner.channel().on_closed()
3034 }
3035
3036 #[cfg(target_os = "fuchsia")]
3037 fn signal_peer(
3038 &self,
3039 clear_mask: zx::Signals,
3040 set_mask: zx::Signals,
3041 ) -> Result<(), zx_status::Status> {
3042 use fidl::Peered;
3043 self.inner.channel().signal_peer(clear_mask, set_mask)
3044 }
3045}
3046
3047impl NeededBlobsControlHandle {}
3048
3049#[must_use = "FIDL methods require a response to be sent"]
3050#[derive(Debug)]
3051pub struct NeededBlobsOpenMetaBlobResponder {
3052 control_handle: std::mem::ManuallyDrop<NeededBlobsControlHandle>,
3053 tx_id: u32,
3054}
3055
3056impl std::ops::Drop for NeededBlobsOpenMetaBlobResponder {
3060 fn drop(&mut self) {
3061 self.control_handle.shutdown();
3062 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3064 }
3065}
3066
3067impl fidl::endpoints::Responder for NeededBlobsOpenMetaBlobResponder {
3068 type ControlHandle = NeededBlobsControlHandle;
3069
3070 fn control_handle(&self) -> &NeededBlobsControlHandle {
3071 &self.control_handle
3072 }
3073
3074 fn drop_without_shutdown(mut self) {
3075 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3077 std::mem::forget(self);
3079 }
3080}
3081
3082impl NeededBlobsOpenMetaBlobResponder {
3083 pub fn send(
3087 self,
3088 mut result: Result<Option<BlobWriter>, OpenBlobError>,
3089 ) -> Result<(), fidl::Error> {
3090 let _result = self.send_raw(result);
3091 if _result.is_err() {
3092 self.control_handle.shutdown();
3093 }
3094 self.drop_without_shutdown();
3095 _result
3096 }
3097
3098 pub fn send_no_shutdown_on_err(
3100 self,
3101 mut result: Result<Option<BlobWriter>, OpenBlobError>,
3102 ) -> Result<(), fidl::Error> {
3103 let _result = self.send_raw(result);
3104 self.drop_without_shutdown();
3105 _result
3106 }
3107
3108 fn send_raw(
3109 &self,
3110 mut result: Result<Option<BlobWriter>, OpenBlobError>,
3111 ) -> Result<(), fidl::Error> {
3112 self.control_handle.inner.send::<fidl::encoding::ResultType<
3113 NeededBlobsOpenMetaBlobResponse,
3114 OpenBlobError,
3115 >>(
3116 result.as_mut().map_err(|e| *e).map(|writer| (writer.as_mut(),)),
3117 self.tx_id,
3118 0x42f385a58180f5fb,
3119 fidl::encoding::DynamicFlags::empty(),
3120 )
3121 }
3122}
3123
3124#[must_use = "FIDL methods require a response to be sent"]
3125#[derive(Debug)]
3126pub struct NeededBlobsOpenBlobResponder {
3127 control_handle: std::mem::ManuallyDrop<NeededBlobsControlHandle>,
3128 tx_id: u32,
3129}
3130
3131impl std::ops::Drop for NeededBlobsOpenBlobResponder {
3135 fn drop(&mut self) {
3136 self.control_handle.shutdown();
3137 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3139 }
3140}
3141
3142impl fidl::endpoints::Responder for NeededBlobsOpenBlobResponder {
3143 type ControlHandle = NeededBlobsControlHandle;
3144
3145 fn control_handle(&self) -> &NeededBlobsControlHandle {
3146 &self.control_handle
3147 }
3148
3149 fn drop_without_shutdown(mut self) {
3150 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3152 std::mem::forget(self);
3154 }
3155}
3156
3157impl NeededBlobsOpenBlobResponder {
3158 pub fn send(
3162 self,
3163 mut result: Result<Option<BlobWriter>, OpenBlobError>,
3164 ) -> Result<(), fidl::Error> {
3165 let _result = self.send_raw(result);
3166 if _result.is_err() {
3167 self.control_handle.shutdown();
3168 }
3169 self.drop_without_shutdown();
3170 _result
3171 }
3172
3173 pub fn send_no_shutdown_on_err(
3175 self,
3176 mut result: Result<Option<BlobWriter>, OpenBlobError>,
3177 ) -> Result<(), fidl::Error> {
3178 let _result = self.send_raw(result);
3179 self.drop_without_shutdown();
3180 _result
3181 }
3182
3183 fn send_raw(
3184 &self,
3185 mut result: Result<Option<BlobWriter>, OpenBlobError>,
3186 ) -> Result<(), fidl::Error> {
3187 self.control_handle.inner.send::<fidl::encoding::ResultType<
3188 NeededBlobsOpenBlobResponse,
3189 OpenBlobError,
3190 >>(
3191 result.as_mut().map_err(|e| *e).map(|writer| (writer.as_mut(),)),
3192 self.tx_id,
3193 0x67cd4c4cd10ea9e0,
3194 fidl::encoding::DynamicFlags::empty(),
3195 )
3196 }
3197}
3198
3199#[must_use = "FIDL methods require a response to be sent"]
3200#[derive(Debug)]
3201pub struct NeededBlobsBlobWrittenResponder {
3202 control_handle: std::mem::ManuallyDrop<NeededBlobsControlHandle>,
3203 tx_id: u32,
3204}
3205
3206impl std::ops::Drop for NeededBlobsBlobWrittenResponder {
3210 fn drop(&mut self) {
3211 self.control_handle.shutdown();
3212 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3214 }
3215}
3216
3217impl fidl::endpoints::Responder for NeededBlobsBlobWrittenResponder {
3218 type ControlHandle = NeededBlobsControlHandle;
3219
3220 fn control_handle(&self) -> &NeededBlobsControlHandle {
3221 &self.control_handle
3222 }
3223
3224 fn drop_without_shutdown(mut self) {
3225 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3227 std::mem::forget(self);
3229 }
3230}
3231
3232impl NeededBlobsBlobWrittenResponder {
3233 pub fn send(self, mut result: Result<(), BlobWrittenError>) -> Result<(), fidl::Error> {
3237 let _result = self.send_raw(result);
3238 if _result.is_err() {
3239 self.control_handle.shutdown();
3240 }
3241 self.drop_without_shutdown();
3242 _result
3243 }
3244
3245 pub fn send_no_shutdown_on_err(
3247 self,
3248 mut result: Result<(), BlobWrittenError>,
3249 ) -> Result<(), fidl::Error> {
3250 let _result = self.send_raw(result);
3251 self.drop_without_shutdown();
3252 _result
3253 }
3254
3255 fn send_raw(&self, mut result: Result<(), BlobWrittenError>) -> Result<(), fidl::Error> {
3256 self.control_handle.inner.send::<fidl::encoding::ResultType<
3257 fidl::encoding::EmptyStruct,
3258 BlobWrittenError,
3259 >>(
3260 result,
3261 self.tx_id,
3262 0x222f80ec77433f44,
3263 fidl::encoding::DynamicFlags::empty(),
3264 )
3265 }
3266}
3267
3268#[must_use = "FIDL methods require a response to be sent"]
3269#[derive(Debug)]
3270pub struct NeededBlobsAbortResponder {
3271 control_handle: std::mem::ManuallyDrop<NeededBlobsControlHandle>,
3272 tx_id: u32,
3273}
3274
3275impl std::ops::Drop for NeededBlobsAbortResponder {
3279 fn drop(&mut self) {
3280 self.control_handle.shutdown();
3281 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3283 }
3284}
3285
3286impl fidl::endpoints::Responder for NeededBlobsAbortResponder {
3287 type ControlHandle = NeededBlobsControlHandle;
3288
3289 fn control_handle(&self) -> &NeededBlobsControlHandle {
3290 &self.control_handle
3291 }
3292
3293 fn drop_without_shutdown(mut self) {
3294 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3296 std::mem::forget(self);
3298 }
3299}
3300
3301impl NeededBlobsAbortResponder {
3302 pub fn send(self) -> Result<(), fidl::Error> {
3306 let _result = self.send_raw();
3307 if _result.is_err() {
3308 self.control_handle.shutdown();
3309 }
3310 self.drop_without_shutdown();
3311 _result
3312 }
3313
3314 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3316 let _result = self.send_raw();
3317 self.drop_without_shutdown();
3318 _result
3319 }
3320
3321 fn send_raw(&self) -> Result<(), fidl::Error> {
3322 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3323 (),
3324 self.tx_id,
3325 0x6fda8d5ebea74cbb,
3326 fidl::encoding::DynamicFlags::empty(),
3327 )
3328 }
3329}
3330
3331#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3332pub struct PackageCacheMarker;
3333
3334impl fidl::endpoints::ProtocolMarker for PackageCacheMarker {
3335 type Proxy = PackageCacheProxy;
3336 type RequestStream = PackageCacheRequestStream;
3337 #[cfg(target_os = "fuchsia")]
3338 type SynchronousProxy = PackageCacheSynchronousProxy;
3339
3340 const DEBUG_NAME: &'static str = "fuchsia.pkg.PackageCache";
3341}
3342impl fidl::endpoints::DiscoverableProtocolMarker for PackageCacheMarker {}
3343pub type PackageCacheGetResult = Result<(), i32>;
3344pub type PackageCacheGetSubpackageResult = Result<(), GetSubpackageError>;
3345pub type PackageCacheSyncResult = Result<(), i32>;
3346pub type PackageCacheSetUpgradableUrlsResult = Result<(), SetUpgradableUrlsError>;
3347
3348pub trait PackageCacheProxyInterface: Send + Sync {
3349 type GetResponseFut: std::future::Future<Output = Result<PackageCacheGetResult, fidl::Error>>
3350 + Send;
3351 fn r#get(
3352 &self,
3353 meta_far_blob: &BlobInfo,
3354 gc_protection: GcProtection,
3355 needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
3356 dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3357 ) -> Self::GetResponseFut;
3358 type GetSubpackageResponseFut: std::future::Future<Output = Result<PackageCacheGetSubpackageResult, fidl::Error>>
3359 + Send;
3360 fn r#get_subpackage(
3361 &self,
3362 superpackage: &BlobId,
3363 subpackage: &PackageUrl,
3364 dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3365 ) -> Self::GetSubpackageResponseFut;
3366 fn r#base_package_index(
3367 &self,
3368 iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
3369 ) -> Result<(), fidl::Error>;
3370 fn r#cache_package_index(
3371 &self,
3372 iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
3373 ) -> Result<(), fidl::Error>;
3374 type SyncResponseFut: std::future::Future<Output = Result<PackageCacheSyncResult, fidl::Error>>
3375 + Send;
3376 fn r#sync(&self) -> Self::SyncResponseFut;
3377 type SetUpgradableUrlsResponseFut: std::future::Future<Output = Result<PackageCacheSetUpgradableUrlsResult, fidl::Error>>
3378 + Send;
3379 fn r#set_upgradable_urls(
3380 &self,
3381 pinned_urls: &[PackageUrl],
3382 ) -> Self::SetUpgradableUrlsResponseFut;
3383}
3384#[derive(Debug)]
3385#[cfg(target_os = "fuchsia")]
3386pub struct PackageCacheSynchronousProxy {
3387 client: fidl::client::sync::Client,
3388}
3389
3390#[cfg(target_os = "fuchsia")]
3391impl fidl::endpoints::SynchronousProxy for PackageCacheSynchronousProxy {
3392 type Proxy = PackageCacheProxy;
3393 type Protocol = PackageCacheMarker;
3394
3395 fn from_channel(inner: fidl::Channel) -> Self {
3396 Self::new(inner)
3397 }
3398
3399 fn into_channel(self) -> fidl::Channel {
3400 self.client.into_channel()
3401 }
3402
3403 fn as_channel(&self) -> &fidl::Channel {
3404 self.client.as_channel()
3405 }
3406}
3407
3408#[cfg(target_os = "fuchsia")]
3409impl PackageCacheSynchronousProxy {
3410 pub fn new(channel: fidl::Channel) -> Self {
3411 let protocol_name = <PackageCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3412 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3413 }
3414
3415 pub fn into_channel(self) -> fidl::Channel {
3416 self.client.into_channel()
3417 }
3418
3419 pub fn wait_for_event(
3422 &self,
3423 deadline: zx::MonotonicInstant,
3424 ) -> Result<PackageCacheEvent, fidl::Error> {
3425 PackageCacheEvent::decode(self.client.wait_for_event(deadline)?)
3426 }
3427
3428 pub fn r#get(
3450 &self,
3451 mut meta_far_blob: &BlobInfo,
3452 mut gc_protection: GcProtection,
3453 mut needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
3454 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3455 ___deadline: zx::MonotonicInstant,
3456 ) -> Result<PackageCacheGetResult, fidl::Error> {
3457 let _response = self.client.send_query::<
3458 PackageCacheGetRequest,
3459 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3460 >(
3461 (meta_far_blob, gc_protection, needed_blobs, dir,),
3462 0x15e1963f4bf123b5,
3463 fidl::encoding::DynamicFlags::empty(),
3464 ___deadline,
3465 )?;
3466 Ok(_response.map(|x| x))
3467 }
3468
3469 pub fn r#get_subpackage(
3479 &self,
3480 mut superpackage: &BlobId,
3481 mut subpackage: &PackageUrl,
3482 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3483 ___deadline: zx::MonotonicInstant,
3484 ) -> Result<PackageCacheGetSubpackageResult, fidl::Error> {
3485 let _response =
3486 self.client.send_query::<PackageCacheGetSubpackageRequest, fidl::encoding::ResultType<
3487 fidl::encoding::EmptyStruct,
3488 GetSubpackageError,
3489 >>(
3490 (superpackage, subpackage, dir),
3491 0x29478df87c29ffa3,
3492 fidl::encoding::DynamicFlags::empty(),
3493 ___deadline,
3494 )?;
3495 Ok(_response.map(|x| x))
3496 }
3497
3498 pub fn r#base_package_index(
3503 &self,
3504 mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
3505 ) -> Result<(), fidl::Error> {
3506 self.client.send::<PackageCacheBasePackageIndexRequest>(
3507 (iterator,),
3508 0x46af9e595f8eced4,
3509 fidl::encoding::DynamicFlags::empty(),
3510 )
3511 }
3512
3513 pub fn r#cache_package_index(
3518 &self,
3519 mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
3520 ) -> Result<(), fidl::Error> {
3521 self.client.send::<PackageCacheCachePackageIndexRequest>(
3522 (iterator,),
3523 0x14a48fdb8f26ed26,
3524 fidl::encoding::DynamicFlags::empty(),
3525 )
3526 }
3527
3528 pub fn r#sync(
3533 &self,
3534 ___deadline: zx::MonotonicInstant,
3535 ) -> Result<PackageCacheSyncResult, fidl::Error> {
3536 let _response = self.client.send_query::<
3537 fidl::encoding::EmptyPayload,
3538 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3539 >(
3540 (),
3541 0x5c10a84094535a74,
3542 fidl::encoding::DynamicFlags::empty(),
3543 ___deadline,
3544 )?;
3545 Ok(_response.map(|x| x))
3546 }
3547
3548 pub fn r#set_upgradable_urls(
3564 &self,
3565 mut pinned_urls: &[PackageUrl],
3566 ___deadline: zx::MonotonicInstant,
3567 ) -> Result<PackageCacheSetUpgradableUrlsResult, fidl::Error> {
3568 let _response = self.client.send_query::<
3569 PackageCacheSetUpgradableUrlsRequest,
3570 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, SetUpgradableUrlsError>,
3571 >(
3572 (pinned_urls,),
3573 0x2c235f7efdb5e2d1,
3574 fidl::encoding::DynamicFlags::FLEXIBLE,
3575 ___deadline,
3576 )?
3577 .into_result::<PackageCacheMarker>("set_upgradable_urls")?;
3578 Ok(_response.map(|x| x))
3579 }
3580}
3581
3582#[cfg(target_os = "fuchsia")]
3583impl From<PackageCacheSynchronousProxy> for zx::Handle {
3584 fn from(value: PackageCacheSynchronousProxy) -> Self {
3585 value.into_channel().into()
3586 }
3587}
3588
3589#[cfg(target_os = "fuchsia")]
3590impl From<fidl::Channel> for PackageCacheSynchronousProxy {
3591 fn from(value: fidl::Channel) -> Self {
3592 Self::new(value)
3593 }
3594}
3595
3596#[derive(Debug, Clone)]
3597pub struct PackageCacheProxy {
3598 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3599}
3600
3601impl fidl::endpoints::Proxy for PackageCacheProxy {
3602 type Protocol = PackageCacheMarker;
3603
3604 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3605 Self::new(inner)
3606 }
3607
3608 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3609 self.client.into_channel().map_err(|client| Self { client })
3610 }
3611
3612 fn as_channel(&self) -> &::fidl::AsyncChannel {
3613 self.client.as_channel()
3614 }
3615}
3616
3617impl PackageCacheProxy {
3618 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3620 let protocol_name = <PackageCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3621 Self { client: fidl::client::Client::new(channel, protocol_name) }
3622 }
3623
3624 pub fn take_event_stream(&self) -> PackageCacheEventStream {
3630 PackageCacheEventStream { event_receiver: self.client.take_event_receiver() }
3631 }
3632
3633 pub fn r#get(
3655 &self,
3656 mut meta_far_blob: &BlobInfo,
3657 mut gc_protection: GcProtection,
3658 mut needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
3659 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3660 ) -> fidl::client::QueryResponseFut<
3661 PackageCacheGetResult,
3662 fidl::encoding::DefaultFuchsiaResourceDialect,
3663 > {
3664 PackageCacheProxyInterface::r#get(self, meta_far_blob, gc_protection, needed_blobs, dir)
3665 }
3666
3667 pub fn r#get_subpackage(
3677 &self,
3678 mut superpackage: &BlobId,
3679 mut subpackage: &PackageUrl,
3680 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3681 ) -> fidl::client::QueryResponseFut<
3682 PackageCacheGetSubpackageResult,
3683 fidl::encoding::DefaultFuchsiaResourceDialect,
3684 > {
3685 PackageCacheProxyInterface::r#get_subpackage(self, superpackage, subpackage, dir)
3686 }
3687
3688 pub fn r#base_package_index(
3693 &self,
3694 mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
3695 ) -> Result<(), fidl::Error> {
3696 PackageCacheProxyInterface::r#base_package_index(self, iterator)
3697 }
3698
3699 pub fn r#cache_package_index(
3704 &self,
3705 mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
3706 ) -> Result<(), fidl::Error> {
3707 PackageCacheProxyInterface::r#cache_package_index(self, iterator)
3708 }
3709
3710 pub fn r#sync(
3715 &self,
3716 ) -> fidl::client::QueryResponseFut<
3717 PackageCacheSyncResult,
3718 fidl::encoding::DefaultFuchsiaResourceDialect,
3719 > {
3720 PackageCacheProxyInterface::r#sync(self)
3721 }
3722
3723 pub fn r#set_upgradable_urls(
3739 &self,
3740 mut pinned_urls: &[PackageUrl],
3741 ) -> fidl::client::QueryResponseFut<
3742 PackageCacheSetUpgradableUrlsResult,
3743 fidl::encoding::DefaultFuchsiaResourceDialect,
3744 > {
3745 PackageCacheProxyInterface::r#set_upgradable_urls(self, pinned_urls)
3746 }
3747}
3748
3749impl PackageCacheProxyInterface for PackageCacheProxy {
3750 type GetResponseFut = fidl::client::QueryResponseFut<
3751 PackageCacheGetResult,
3752 fidl::encoding::DefaultFuchsiaResourceDialect,
3753 >;
3754 fn r#get(
3755 &self,
3756 mut meta_far_blob: &BlobInfo,
3757 mut gc_protection: GcProtection,
3758 mut needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
3759 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3760 ) -> Self::GetResponseFut {
3761 fn _decode(
3762 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3763 ) -> Result<PackageCacheGetResult, fidl::Error> {
3764 let _response = fidl::client::decode_transaction_body::<
3765 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3766 fidl::encoding::DefaultFuchsiaResourceDialect,
3767 0x15e1963f4bf123b5,
3768 >(_buf?)?;
3769 Ok(_response.map(|x| x))
3770 }
3771 self.client.send_query_and_decode::<PackageCacheGetRequest, PackageCacheGetResult>(
3772 (meta_far_blob, gc_protection, needed_blobs, dir),
3773 0x15e1963f4bf123b5,
3774 fidl::encoding::DynamicFlags::empty(),
3775 _decode,
3776 )
3777 }
3778
3779 type GetSubpackageResponseFut = fidl::client::QueryResponseFut<
3780 PackageCacheGetSubpackageResult,
3781 fidl::encoding::DefaultFuchsiaResourceDialect,
3782 >;
3783 fn r#get_subpackage(
3784 &self,
3785 mut superpackage: &BlobId,
3786 mut subpackage: &PackageUrl,
3787 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3788 ) -> Self::GetSubpackageResponseFut {
3789 fn _decode(
3790 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3791 ) -> Result<PackageCacheGetSubpackageResult, fidl::Error> {
3792 let _response = fidl::client::decode_transaction_body::<
3793 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, GetSubpackageError>,
3794 fidl::encoding::DefaultFuchsiaResourceDialect,
3795 0x29478df87c29ffa3,
3796 >(_buf?)?;
3797 Ok(_response.map(|x| x))
3798 }
3799 self.client.send_query_and_decode::<
3800 PackageCacheGetSubpackageRequest,
3801 PackageCacheGetSubpackageResult,
3802 >(
3803 (superpackage, subpackage, dir,),
3804 0x29478df87c29ffa3,
3805 fidl::encoding::DynamicFlags::empty(),
3806 _decode,
3807 )
3808 }
3809
3810 fn r#base_package_index(
3811 &self,
3812 mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
3813 ) -> Result<(), fidl::Error> {
3814 self.client.send::<PackageCacheBasePackageIndexRequest>(
3815 (iterator,),
3816 0x46af9e595f8eced4,
3817 fidl::encoding::DynamicFlags::empty(),
3818 )
3819 }
3820
3821 fn r#cache_package_index(
3822 &self,
3823 mut iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
3824 ) -> Result<(), fidl::Error> {
3825 self.client.send::<PackageCacheCachePackageIndexRequest>(
3826 (iterator,),
3827 0x14a48fdb8f26ed26,
3828 fidl::encoding::DynamicFlags::empty(),
3829 )
3830 }
3831
3832 type SyncResponseFut = fidl::client::QueryResponseFut<
3833 PackageCacheSyncResult,
3834 fidl::encoding::DefaultFuchsiaResourceDialect,
3835 >;
3836 fn r#sync(&self) -> Self::SyncResponseFut {
3837 fn _decode(
3838 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3839 ) -> Result<PackageCacheSyncResult, fidl::Error> {
3840 let _response = fidl::client::decode_transaction_body::<
3841 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3842 fidl::encoding::DefaultFuchsiaResourceDialect,
3843 0x5c10a84094535a74,
3844 >(_buf?)?;
3845 Ok(_response.map(|x| x))
3846 }
3847 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PackageCacheSyncResult>(
3848 (),
3849 0x5c10a84094535a74,
3850 fidl::encoding::DynamicFlags::empty(),
3851 _decode,
3852 )
3853 }
3854
3855 type SetUpgradableUrlsResponseFut = fidl::client::QueryResponseFut<
3856 PackageCacheSetUpgradableUrlsResult,
3857 fidl::encoding::DefaultFuchsiaResourceDialect,
3858 >;
3859 fn r#set_upgradable_urls(
3860 &self,
3861 mut pinned_urls: &[PackageUrl],
3862 ) -> Self::SetUpgradableUrlsResponseFut {
3863 fn _decode(
3864 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3865 ) -> Result<PackageCacheSetUpgradableUrlsResult, fidl::Error> {
3866 let _response = fidl::client::decode_transaction_body::<
3867 fidl::encoding::FlexibleResultType<
3868 fidl::encoding::EmptyStruct,
3869 SetUpgradableUrlsError,
3870 >,
3871 fidl::encoding::DefaultFuchsiaResourceDialect,
3872 0x2c235f7efdb5e2d1,
3873 >(_buf?)?
3874 .into_result::<PackageCacheMarker>("set_upgradable_urls")?;
3875 Ok(_response.map(|x| x))
3876 }
3877 self.client.send_query_and_decode::<
3878 PackageCacheSetUpgradableUrlsRequest,
3879 PackageCacheSetUpgradableUrlsResult,
3880 >(
3881 (pinned_urls,),
3882 0x2c235f7efdb5e2d1,
3883 fidl::encoding::DynamicFlags::FLEXIBLE,
3884 _decode,
3885 )
3886 }
3887}
3888
3889pub struct PackageCacheEventStream {
3890 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3891}
3892
3893impl std::marker::Unpin for PackageCacheEventStream {}
3894
3895impl futures::stream::FusedStream for PackageCacheEventStream {
3896 fn is_terminated(&self) -> bool {
3897 self.event_receiver.is_terminated()
3898 }
3899}
3900
3901impl futures::Stream for PackageCacheEventStream {
3902 type Item = Result<PackageCacheEvent, fidl::Error>;
3903
3904 fn poll_next(
3905 mut self: std::pin::Pin<&mut Self>,
3906 cx: &mut std::task::Context<'_>,
3907 ) -> std::task::Poll<Option<Self::Item>> {
3908 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3909 &mut self.event_receiver,
3910 cx
3911 )?) {
3912 Some(buf) => std::task::Poll::Ready(Some(PackageCacheEvent::decode(buf))),
3913 None => std::task::Poll::Ready(None),
3914 }
3915 }
3916}
3917
3918#[derive(Debug)]
3919pub enum PackageCacheEvent {
3920 #[non_exhaustive]
3921 _UnknownEvent {
3922 ordinal: u64,
3924 },
3925}
3926
3927impl PackageCacheEvent {
3928 fn decode(
3930 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3931 ) -> Result<PackageCacheEvent, fidl::Error> {
3932 let (bytes, _handles) = buf.split_mut();
3933 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3934 debug_assert_eq!(tx_header.tx_id, 0);
3935 match tx_header.ordinal {
3936 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3937 Ok(PackageCacheEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3938 }
3939 _ => Err(fidl::Error::UnknownOrdinal {
3940 ordinal: tx_header.ordinal,
3941 protocol_name: <PackageCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3942 }),
3943 }
3944 }
3945}
3946
3947pub struct PackageCacheRequestStream {
3949 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3950 is_terminated: bool,
3951}
3952
3953impl std::marker::Unpin for PackageCacheRequestStream {}
3954
3955impl futures::stream::FusedStream for PackageCacheRequestStream {
3956 fn is_terminated(&self) -> bool {
3957 self.is_terminated
3958 }
3959}
3960
3961impl fidl::endpoints::RequestStream for PackageCacheRequestStream {
3962 type Protocol = PackageCacheMarker;
3963 type ControlHandle = PackageCacheControlHandle;
3964
3965 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3966 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3967 }
3968
3969 fn control_handle(&self) -> Self::ControlHandle {
3970 PackageCacheControlHandle { inner: self.inner.clone() }
3971 }
3972
3973 fn into_inner(
3974 self,
3975 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3976 {
3977 (self.inner, self.is_terminated)
3978 }
3979
3980 fn from_inner(
3981 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3982 is_terminated: bool,
3983 ) -> Self {
3984 Self { inner, is_terminated }
3985 }
3986}
3987
3988impl futures::Stream for PackageCacheRequestStream {
3989 type Item = Result<PackageCacheRequest, fidl::Error>;
3990
3991 fn poll_next(
3992 mut self: std::pin::Pin<&mut Self>,
3993 cx: &mut std::task::Context<'_>,
3994 ) -> std::task::Poll<Option<Self::Item>> {
3995 let this = &mut *self;
3996 if this.inner.check_shutdown(cx) {
3997 this.is_terminated = true;
3998 return std::task::Poll::Ready(None);
3999 }
4000 if this.is_terminated {
4001 panic!("polled PackageCacheRequestStream after completion");
4002 }
4003 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4004 |bytes, handles| {
4005 match this.inner.channel().read_etc(cx, bytes, handles) {
4006 std::task::Poll::Ready(Ok(())) => {}
4007 std::task::Poll::Pending => return std::task::Poll::Pending,
4008 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4009 this.is_terminated = true;
4010 return std::task::Poll::Ready(None);
4011 }
4012 std::task::Poll::Ready(Err(e)) => {
4013 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4014 e.into(),
4015 ))))
4016 }
4017 }
4018
4019 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4021
4022 std::task::Poll::Ready(Some(match header.ordinal {
4023 0x15e1963f4bf123b5 => {
4024 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4025 let mut req = fidl::new_empty!(
4026 PackageCacheGetRequest,
4027 fidl::encoding::DefaultFuchsiaResourceDialect
4028 );
4029 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheGetRequest>(&header, _body_bytes, handles, &mut req)?;
4030 let control_handle =
4031 PackageCacheControlHandle { inner: this.inner.clone() };
4032 Ok(PackageCacheRequest::Get {
4033 meta_far_blob: req.meta_far_blob,
4034 gc_protection: req.gc_protection,
4035 needed_blobs: req.needed_blobs,
4036 dir: req.dir,
4037
4038 responder: PackageCacheGetResponder {
4039 control_handle: std::mem::ManuallyDrop::new(control_handle),
4040 tx_id: header.tx_id,
4041 },
4042 })
4043 }
4044 0x29478df87c29ffa3 => {
4045 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4046 let mut req = fidl::new_empty!(
4047 PackageCacheGetSubpackageRequest,
4048 fidl::encoding::DefaultFuchsiaResourceDialect
4049 );
4050 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheGetSubpackageRequest>(&header, _body_bytes, handles, &mut req)?;
4051 let control_handle =
4052 PackageCacheControlHandle { inner: this.inner.clone() };
4053 Ok(PackageCacheRequest::GetSubpackage {
4054 superpackage: req.superpackage,
4055 subpackage: req.subpackage,
4056 dir: req.dir,
4057
4058 responder: PackageCacheGetSubpackageResponder {
4059 control_handle: std::mem::ManuallyDrop::new(control_handle),
4060 tx_id: header.tx_id,
4061 },
4062 })
4063 }
4064 0x46af9e595f8eced4 => {
4065 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4066 let mut req = fidl::new_empty!(
4067 PackageCacheBasePackageIndexRequest,
4068 fidl::encoding::DefaultFuchsiaResourceDialect
4069 );
4070 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheBasePackageIndexRequest>(&header, _body_bytes, handles, &mut req)?;
4071 let control_handle =
4072 PackageCacheControlHandle { inner: this.inner.clone() };
4073 Ok(PackageCacheRequest::BasePackageIndex {
4074 iterator: req.iterator,
4075
4076 control_handle,
4077 })
4078 }
4079 0x14a48fdb8f26ed26 => {
4080 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4081 let mut req = fidl::new_empty!(
4082 PackageCacheCachePackageIndexRequest,
4083 fidl::encoding::DefaultFuchsiaResourceDialect
4084 );
4085 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheCachePackageIndexRequest>(&header, _body_bytes, handles, &mut req)?;
4086 let control_handle =
4087 PackageCacheControlHandle { inner: this.inner.clone() };
4088 Ok(PackageCacheRequest::CachePackageIndex {
4089 iterator: req.iterator,
4090
4091 control_handle,
4092 })
4093 }
4094 0x5c10a84094535a74 => {
4095 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4096 let mut req = fidl::new_empty!(
4097 fidl::encoding::EmptyPayload,
4098 fidl::encoding::DefaultFuchsiaResourceDialect
4099 );
4100 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4101 let control_handle =
4102 PackageCacheControlHandle { inner: this.inner.clone() };
4103 Ok(PackageCacheRequest::Sync {
4104 responder: PackageCacheSyncResponder {
4105 control_handle: std::mem::ManuallyDrop::new(control_handle),
4106 tx_id: header.tx_id,
4107 },
4108 })
4109 }
4110 0x2c235f7efdb5e2d1 => {
4111 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4112 let mut req = fidl::new_empty!(
4113 PackageCacheSetUpgradableUrlsRequest,
4114 fidl::encoding::DefaultFuchsiaResourceDialect
4115 );
4116 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageCacheSetUpgradableUrlsRequest>(&header, _body_bytes, handles, &mut req)?;
4117 let control_handle =
4118 PackageCacheControlHandle { inner: this.inner.clone() };
4119 Ok(PackageCacheRequest::SetUpgradableUrls {
4120 pinned_urls: req.pinned_urls,
4121
4122 responder: PackageCacheSetUpgradableUrlsResponder {
4123 control_handle: std::mem::ManuallyDrop::new(control_handle),
4124 tx_id: header.tx_id,
4125 },
4126 })
4127 }
4128 _ if header.tx_id == 0
4129 && header
4130 .dynamic_flags()
4131 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4132 {
4133 Ok(PackageCacheRequest::_UnknownMethod {
4134 ordinal: header.ordinal,
4135 control_handle: PackageCacheControlHandle { inner: this.inner.clone() },
4136 method_type: fidl::MethodType::OneWay,
4137 })
4138 }
4139 _ if header
4140 .dynamic_flags()
4141 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4142 {
4143 this.inner.send_framework_err(
4144 fidl::encoding::FrameworkErr::UnknownMethod,
4145 header.tx_id,
4146 header.ordinal,
4147 header.dynamic_flags(),
4148 (bytes, handles),
4149 )?;
4150 Ok(PackageCacheRequest::_UnknownMethod {
4151 ordinal: header.ordinal,
4152 control_handle: PackageCacheControlHandle { inner: this.inner.clone() },
4153 method_type: fidl::MethodType::TwoWay,
4154 })
4155 }
4156 _ => Err(fidl::Error::UnknownOrdinal {
4157 ordinal: header.ordinal,
4158 protocol_name:
4159 <PackageCacheMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4160 }),
4161 }))
4162 },
4163 )
4164 }
4165}
4166
4167#[derive(Debug)]
4172pub enum PackageCacheRequest {
4173 Get {
4195 meta_far_blob: BlobInfo,
4196 gc_protection: GcProtection,
4197 needed_blobs: fidl::endpoints::ServerEnd<NeededBlobsMarker>,
4198 dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4199 responder: PackageCacheGetResponder,
4200 },
4201 GetSubpackage {
4211 superpackage: BlobId,
4212 subpackage: PackageUrl,
4213 dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4214 responder: PackageCacheGetSubpackageResponder,
4215 },
4216 BasePackageIndex {
4221 iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
4222 control_handle: PackageCacheControlHandle,
4223 },
4224 CachePackageIndex {
4229 iterator: fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
4230 control_handle: PackageCacheControlHandle,
4231 },
4232 Sync { responder: PackageCacheSyncResponder },
4237 SetUpgradableUrls {
4253 pinned_urls: Vec<PackageUrl>,
4254 responder: PackageCacheSetUpgradableUrlsResponder,
4255 },
4256 #[non_exhaustive]
4258 _UnknownMethod {
4259 ordinal: u64,
4261 control_handle: PackageCacheControlHandle,
4262 method_type: fidl::MethodType,
4263 },
4264}
4265
4266impl PackageCacheRequest {
4267 #[allow(irrefutable_let_patterns)]
4268 pub fn into_get(
4269 self,
4270 ) -> Option<(
4271 BlobInfo,
4272 GcProtection,
4273 fidl::endpoints::ServerEnd<NeededBlobsMarker>,
4274 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4275 PackageCacheGetResponder,
4276 )> {
4277 if let PackageCacheRequest::Get {
4278 meta_far_blob,
4279 gc_protection,
4280 needed_blobs,
4281 dir,
4282 responder,
4283 } = self
4284 {
4285 Some((meta_far_blob, gc_protection, needed_blobs, dir, responder))
4286 } else {
4287 None
4288 }
4289 }
4290
4291 #[allow(irrefutable_let_patterns)]
4292 pub fn into_get_subpackage(
4293 self,
4294 ) -> Option<(
4295 BlobId,
4296 PackageUrl,
4297 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4298 PackageCacheGetSubpackageResponder,
4299 )> {
4300 if let PackageCacheRequest::GetSubpackage { superpackage, subpackage, dir, responder } =
4301 self
4302 {
4303 Some((superpackage, subpackage, dir, responder))
4304 } else {
4305 None
4306 }
4307 }
4308
4309 #[allow(irrefutable_let_patterns)]
4310 pub fn into_base_package_index(
4311 self,
4312 ) -> Option<(fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>, PackageCacheControlHandle)>
4313 {
4314 if let PackageCacheRequest::BasePackageIndex { iterator, control_handle } = self {
4315 Some((iterator, control_handle))
4316 } else {
4317 None
4318 }
4319 }
4320
4321 #[allow(irrefutable_let_patterns)]
4322 pub fn into_cache_package_index(
4323 self,
4324 ) -> Option<(fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>, PackageCacheControlHandle)>
4325 {
4326 if let PackageCacheRequest::CachePackageIndex { iterator, control_handle } = self {
4327 Some((iterator, control_handle))
4328 } else {
4329 None
4330 }
4331 }
4332
4333 #[allow(irrefutable_let_patterns)]
4334 pub fn into_sync(self) -> Option<(PackageCacheSyncResponder)> {
4335 if let PackageCacheRequest::Sync { responder } = self {
4336 Some((responder))
4337 } else {
4338 None
4339 }
4340 }
4341
4342 #[allow(irrefutable_let_patterns)]
4343 pub fn into_set_upgradable_urls(
4344 self,
4345 ) -> Option<(Vec<PackageUrl>, PackageCacheSetUpgradableUrlsResponder)> {
4346 if let PackageCacheRequest::SetUpgradableUrls { pinned_urls, responder } = self {
4347 Some((pinned_urls, responder))
4348 } else {
4349 None
4350 }
4351 }
4352
4353 pub fn method_name(&self) -> &'static str {
4355 match *self {
4356 PackageCacheRequest::Get { .. } => "get",
4357 PackageCacheRequest::GetSubpackage { .. } => "get_subpackage",
4358 PackageCacheRequest::BasePackageIndex { .. } => "base_package_index",
4359 PackageCacheRequest::CachePackageIndex { .. } => "cache_package_index",
4360 PackageCacheRequest::Sync { .. } => "sync",
4361 PackageCacheRequest::SetUpgradableUrls { .. } => "set_upgradable_urls",
4362 PackageCacheRequest::_UnknownMethod {
4363 method_type: fidl::MethodType::OneWay, ..
4364 } => "unknown one-way method",
4365 PackageCacheRequest::_UnknownMethod {
4366 method_type: fidl::MethodType::TwoWay, ..
4367 } => "unknown two-way method",
4368 }
4369 }
4370}
4371
4372#[derive(Debug, Clone)]
4373pub struct PackageCacheControlHandle {
4374 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4375}
4376
4377impl fidl::endpoints::ControlHandle for PackageCacheControlHandle {
4378 fn shutdown(&self) {
4379 self.inner.shutdown()
4380 }
4381 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4382 self.inner.shutdown_with_epitaph(status)
4383 }
4384
4385 fn is_closed(&self) -> bool {
4386 self.inner.channel().is_closed()
4387 }
4388 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4389 self.inner.channel().on_closed()
4390 }
4391
4392 #[cfg(target_os = "fuchsia")]
4393 fn signal_peer(
4394 &self,
4395 clear_mask: zx::Signals,
4396 set_mask: zx::Signals,
4397 ) -> Result<(), zx_status::Status> {
4398 use fidl::Peered;
4399 self.inner.channel().signal_peer(clear_mask, set_mask)
4400 }
4401}
4402
4403impl PackageCacheControlHandle {}
4404
4405#[must_use = "FIDL methods require a response to be sent"]
4406#[derive(Debug)]
4407pub struct PackageCacheGetResponder {
4408 control_handle: std::mem::ManuallyDrop<PackageCacheControlHandle>,
4409 tx_id: u32,
4410}
4411
4412impl std::ops::Drop for PackageCacheGetResponder {
4416 fn drop(&mut self) {
4417 self.control_handle.shutdown();
4418 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4420 }
4421}
4422
4423impl fidl::endpoints::Responder for PackageCacheGetResponder {
4424 type ControlHandle = PackageCacheControlHandle;
4425
4426 fn control_handle(&self) -> &PackageCacheControlHandle {
4427 &self.control_handle
4428 }
4429
4430 fn drop_without_shutdown(mut self) {
4431 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4433 std::mem::forget(self);
4435 }
4436}
4437
4438impl PackageCacheGetResponder {
4439 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4443 let _result = self.send_raw(result);
4444 if _result.is_err() {
4445 self.control_handle.shutdown();
4446 }
4447 self.drop_without_shutdown();
4448 _result
4449 }
4450
4451 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4453 let _result = self.send_raw(result);
4454 self.drop_without_shutdown();
4455 _result
4456 }
4457
4458 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4459 self.control_handle
4460 .inner
4461 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4462 result,
4463 self.tx_id,
4464 0x15e1963f4bf123b5,
4465 fidl::encoding::DynamicFlags::empty(),
4466 )
4467 }
4468}
4469
4470#[must_use = "FIDL methods require a response to be sent"]
4471#[derive(Debug)]
4472pub struct PackageCacheGetSubpackageResponder {
4473 control_handle: std::mem::ManuallyDrop<PackageCacheControlHandle>,
4474 tx_id: u32,
4475}
4476
4477impl std::ops::Drop for PackageCacheGetSubpackageResponder {
4481 fn drop(&mut self) {
4482 self.control_handle.shutdown();
4483 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4485 }
4486}
4487
4488impl fidl::endpoints::Responder for PackageCacheGetSubpackageResponder {
4489 type ControlHandle = PackageCacheControlHandle;
4490
4491 fn control_handle(&self) -> &PackageCacheControlHandle {
4492 &self.control_handle
4493 }
4494
4495 fn drop_without_shutdown(mut self) {
4496 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4498 std::mem::forget(self);
4500 }
4501}
4502
4503impl PackageCacheGetSubpackageResponder {
4504 pub fn send(self, mut result: Result<(), GetSubpackageError>) -> Result<(), fidl::Error> {
4508 let _result = self.send_raw(result);
4509 if _result.is_err() {
4510 self.control_handle.shutdown();
4511 }
4512 self.drop_without_shutdown();
4513 _result
4514 }
4515
4516 pub fn send_no_shutdown_on_err(
4518 self,
4519 mut result: Result<(), GetSubpackageError>,
4520 ) -> Result<(), fidl::Error> {
4521 let _result = self.send_raw(result);
4522 self.drop_without_shutdown();
4523 _result
4524 }
4525
4526 fn send_raw(&self, mut result: Result<(), GetSubpackageError>) -> Result<(), fidl::Error> {
4527 self.control_handle.inner.send::<fidl::encoding::ResultType<
4528 fidl::encoding::EmptyStruct,
4529 GetSubpackageError,
4530 >>(
4531 result,
4532 self.tx_id,
4533 0x29478df87c29ffa3,
4534 fidl::encoding::DynamicFlags::empty(),
4535 )
4536 }
4537}
4538
4539#[must_use = "FIDL methods require a response to be sent"]
4540#[derive(Debug)]
4541pub struct PackageCacheSyncResponder {
4542 control_handle: std::mem::ManuallyDrop<PackageCacheControlHandle>,
4543 tx_id: u32,
4544}
4545
4546impl std::ops::Drop for PackageCacheSyncResponder {
4550 fn drop(&mut self) {
4551 self.control_handle.shutdown();
4552 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4554 }
4555}
4556
4557impl fidl::endpoints::Responder for PackageCacheSyncResponder {
4558 type ControlHandle = PackageCacheControlHandle;
4559
4560 fn control_handle(&self) -> &PackageCacheControlHandle {
4561 &self.control_handle
4562 }
4563
4564 fn drop_without_shutdown(mut self) {
4565 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4567 std::mem::forget(self);
4569 }
4570}
4571
4572impl PackageCacheSyncResponder {
4573 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4577 let _result = self.send_raw(result);
4578 if _result.is_err() {
4579 self.control_handle.shutdown();
4580 }
4581 self.drop_without_shutdown();
4582 _result
4583 }
4584
4585 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4587 let _result = self.send_raw(result);
4588 self.drop_without_shutdown();
4589 _result
4590 }
4591
4592 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4593 self.control_handle
4594 .inner
4595 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4596 result,
4597 self.tx_id,
4598 0x5c10a84094535a74,
4599 fidl::encoding::DynamicFlags::empty(),
4600 )
4601 }
4602}
4603
4604#[must_use = "FIDL methods require a response to be sent"]
4605#[derive(Debug)]
4606pub struct PackageCacheSetUpgradableUrlsResponder {
4607 control_handle: std::mem::ManuallyDrop<PackageCacheControlHandle>,
4608 tx_id: u32,
4609}
4610
4611impl std::ops::Drop for PackageCacheSetUpgradableUrlsResponder {
4615 fn drop(&mut self) {
4616 self.control_handle.shutdown();
4617 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4619 }
4620}
4621
4622impl fidl::endpoints::Responder for PackageCacheSetUpgradableUrlsResponder {
4623 type ControlHandle = PackageCacheControlHandle;
4624
4625 fn control_handle(&self) -> &PackageCacheControlHandle {
4626 &self.control_handle
4627 }
4628
4629 fn drop_without_shutdown(mut self) {
4630 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4632 std::mem::forget(self);
4634 }
4635}
4636
4637impl PackageCacheSetUpgradableUrlsResponder {
4638 pub fn send(self, mut result: Result<(), SetUpgradableUrlsError>) -> Result<(), fidl::Error> {
4642 let _result = self.send_raw(result);
4643 if _result.is_err() {
4644 self.control_handle.shutdown();
4645 }
4646 self.drop_without_shutdown();
4647 _result
4648 }
4649
4650 pub fn send_no_shutdown_on_err(
4652 self,
4653 mut result: Result<(), SetUpgradableUrlsError>,
4654 ) -> Result<(), fidl::Error> {
4655 let _result = self.send_raw(result);
4656 self.drop_without_shutdown();
4657 _result
4658 }
4659
4660 fn send_raw(&self, mut result: Result<(), SetUpgradableUrlsError>) -> Result<(), fidl::Error> {
4661 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4662 fidl::encoding::EmptyStruct,
4663 SetUpgradableUrlsError,
4664 >>(
4665 fidl::encoding::FlexibleResult::new(result),
4666 self.tx_id,
4667 0x2c235f7efdb5e2d1,
4668 fidl::encoding::DynamicFlags::FLEXIBLE,
4669 )
4670 }
4671}
4672
4673#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4674pub struct PackageIndexIteratorMarker;
4675
4676impl fidl::endpoints::ProtocolMarker for PackageIndexIteratorMarker {
4677 type Proxy = PackageIndexIteratorProxy;
4678 type RequestStream = PackageIndexIteratorRequestStream;
4679 #[cfg(target_os = "fuchsia")]
4680 type SynchronousProxy = PackageIndexIteratorSynchronousProxy;
4681
4682 const DEBUG_NAME: &'static str = "(anonymous) PackageIndexIterator";
4683}
4684
4685pub trait PackageIndexIteratorProxyInterface: Send + Sync {
4686 type NextResponseFut: std::future::Future<Output = Result<Vec<PackageIndexEntry>, fidl::Error>>
4687 + Send;
4688 fn r#next(&self) -> Self::NextResponseFut;
4689}
4690#[derive(Debug)]
4691#[cfg(target_os = "fuchsia")]
4692pub struct PackageIndexIteratorSynchronousProxy {
4693 client: fidl::client::sync::Client,
4694}
4695
4696#[cfg(target_os = "fuchsia")]
4697impl fidl::endpoints::SynchronousProxy for PackageIndexIteratorSynchronousProxy {
4698 type Proxy = PackageIndexIteratorProxy;
4699 type Protocol = PackageIndexIteratorMarker;
4700
4701 fn from_channel(inner: fidl::Channel) -> Self {
4702 Self::new(inner)
4703 }
4704
4705 fn into_channel(self) -> fidl::Channel {
4706 self.client.into_channel()
4707 }
4708
4709 fn as_channel(&self) -> &fidl::Channel {
4710 self.client.as_channel()
4711 }
4712}
4713
4714#[cfg(target_os = "fuchsia")]
4715impl PackageIndexIteratorSynchronousProxy {
4716 pub fn new(channel: fidl::Channel) -> Self {
4717 let protocol_name =
4718 <PackageIndexIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4719 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4720 }
4721
4722 pub fn into_channel(self) -> fidl::Channel {
4723 self.client.into_channel()
4724 }
4725
4726 pub fn wait_for_event(
4729 &self,
4730 deadline: zx::MonotonicInstant,
4731 ) -> Result<PackageIndexIteratorEvent, fidl::Error> {
4732 PackageIndexIteratorEvent::decode(self.client.wait_for_event(deadline)?)
4733 }
4734
4735 pub fn r#next(
4740 &self,
4741 ___deadline: zx::MonotonicInstant,
4742 ) -> Result<Vec<PackageIndexEntry>, fidl::Error> {
4743 let _response = self
4744 .client
4745 .send_query::<fidl::encoding::EmptyPayload, PackageIndexIteratorNextResponse>(
4746 (),
4747 0x9de6bbc87c314d9,
4748 fidl::encoding::DynamicFlags::empty(),
4749 ___deadline,
4750 )?;
4751 Ok(_response.entries)
4752 }
4753}
4754
4755#[cfg(target_os = "fuchsia")]
4756impl From<PackageIndexIteratorSynchronousProxy> for zx::Handle {
4757 fn from(value: PackageIndexIteratorSynchronousProxy) -> Self {
4758 value.into_channel().into()
4759 }
4760}
4761
4762#[cfg(target_os = "fuchsia")]
4763impl From<fidl::Channel> for PackageIndexIteratorSynchronousProxy {
4764 fn from(value: fidl::Channel) -> Self {
4765 Self::new(value)
4766 }
4767}
4768
4769#[derive(Debug, Clone)]
4770pub struct PackageIndexIteratorProxy {
4771 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4772}
4773
4774impl fidl::endpoints::Proxy for PackageIndexIteratorProxy {
4775 type Protocol = PackageIndexIteratorMarker;
4776
4777 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4778 Self::new(inner)
4779 }
4780
4781 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4782 self.client.into_channel().map_err(|client| Self { client })
4783 }
4784
4785 fn as_channel(&self) -> &::fidl::AsyncChannel {
4786 self.client.as_channel()
4787 }
4788}
4789
4790impl PackageIndexIteratorProxy {
4791 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4793 let protocol_name =
4794 <PackageIndexIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4795 Self { client: fidl::client::Client::new(channel, protocol_name) }
4796 }
4797
4798 pub fn take_event_stream(&self) -> PackageIndexIteratorEventStream {
4804 PackageIndexIteratorEventStream { event_receiver: self.client.take_event_receiver() }
4805 }
4806
4807 pub fn r#next(
4812 &self,
4813 ) -> fidl::client::QueryResponseFut<
4814 Vec<PackageIndexEntry>,
4815 fidl::encoding::DefaultFuchsiaResourceDialect,
4816 > {
4817 PackageIndexIteratorProxyInterface::r#next(self)
4818 }
4819}
4820
4821impl PackageIndexIteratorProxyInterface for PackageIndexIteratorProxy {
4822 type NextResponseFut = fidl::client::QueryResponseFut<
4823 Vec<PackageIndexEntry>,
4824 fidl::encoding::DefaultFuchsiaResourceDialect,
4825 >;
4826 fn r#next(&self) -> Self::NextResponseFut {
4827 fn _decode(
4828 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4829 ) -> Result<Vec<PackageIndexEntry>, fidl::Error> {
4830 let _response = fidl::client::decode_transaction_body::<
4831 PackageIndexIteratorNextResponse,
4832 fidl::encoding::DefaultFuchsiaResourceDialect,
4833 0x9de6bbc87c314d9,
4834 >(_buf?)?;
4835 Ok(_response.entries)
4836 }
4837 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<PackageIndexEntry>>(
4838 (),
4839 0x9de6bbc87c314d9,
4840 fidl::encoding::DynamicFlags::empty(),
4841 _decode,
4842 )
4843 }
4844}
4845
4846pub struct PackageIndexIteratorEventStream {
4847 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4848}
4849
4850impl std::marker::Unpin for PackageIndexIteratorEventStream {}
4851
4852impl futures::stream::FusedStream for PackageIndexIteratorEventStream {
4853 fn is_terminated(&self) -> bool {
4854 self.event_receiver.is_terminated()
4855 }
4856}
4857
4858impl futures::Stream for PackageIndexIteratorEventStream {
4859 type Item = Result<PackageIndexIteratorEvent, fidl::Error>;
4860
4861 fn poll_next(
4862 mut self: std::pin::Pin<&mut Self>,
4863 cx: &mut std::task::Context<'_>,
4864 ) -> std::task::Poll<Option<Self::Item>> {
4865 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4866 &mut self.event_receiver,
4867 cx
4868 )?) {
4869 Some(buf) => std::task::Poll::Ready(Some(PackageIndexIteratorEvent::decode(buf))),
4870 None => std::task::Poll::Ready(None),
4871 }
4872 }
4873}
4874
4875#[derive(Debug)]
4876pub enum PackageIndexIteratorEvent {}
4877
4878impl PackageIndexIteratorEvent {
4879 fn decode(
4881 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4882 ) -> Result<PackageIndexIteratorEvent, fidl::Error> {
4883 let (bytes, _handles) = buf.split_mut();
4884 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4885 debug_assert_eq!(tx_header.tx_id, 0);
4886 match tx_header.ordinal {
4887 _ => Err(fidl::Error::UnknownOrdinal {
4888 ordinal: tx_header.ordinal,
4889 protocol_name:
4890 <PackageIndexIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4891 }),
4892 }
4893 }
4894}
4895
4896pub struct PackageIndexIteratorRequestStream {
4898 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4899 is_terminated: bool,
4900}
4901
4902impl std::marker::Unpin for PackageIndexIteratorRequestStream {}
4903
4904impl futures::stream::FusedStream for PackageIndexIteratorRequestStream {
4905 fn is_terminated(&self) -> bool {
4906 self.is_terminated
4907 }
4908}
4909
4910impl fidl::endpoints::RequestStream for PackageIndexIteratorRequestStream {
4911 type Protocol = PackageIndexIteratorMarker;
4912 type ControlHandle = PackageIndexIteratorControlHandle;
4913
4914 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4915 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4916 }
4917
4918 fn control_handle(&self) -> Self::ControlHandle {
4919 PackageIndexIteratorControlHandle { inner: self.inner.clone() }
4920 }
4921
4922 fn into_inner(
4923 self,
4924 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4925 {
4926 (self.inner, self.is_terminated)
4927 }
4928
4929 fn from_inner(
4930 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4931 is_terminated: bool,
4932 ) -> Self {
4933 Self { inner, is_terminated }
4934 }
4935}
4936
4937impl futures::Stream for PackageIndexIteratorRequestStream {
4938 type Item = Result<PackageIndexIteratorRequest, fidl::Error>;
4939
4940 fn poll_next(
4941 mut self: std::pin::Pin<&mut Self>,
4942 cx: &mut std::task::Context<'_>,
4943 ) -> std::task::Poll<Option<Self::Item>> {
4944 let this = &mut *self;
4945 if this.inner.check_shutdown(cx) {
4946 this.is_terminated = true;
4947 return std::task::Poll::Ready(None);
4948 }
4949 if this.is_terminated {
4950 panic!("polled PackageIndexIteratorRequestStream after completion");
4951 }
4952 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4953 |bytes, handles| {
4954 match this.inner.channel().read_etc(cx, bytes, handles) {
4955 std::task::Poll::Ready(Ok(())) => {}
4956 std::task::Poll::Pending => return std::task::Poll::Pending,
4957 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4958 this.is_terminated = true;
4959 return std::task::Poll::Ready(None);
4960 }
4961 std::task::Poll::Ready(Err(e)) => {
4962 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4963 e.into(),
4964 ))))
4965 }
4966 }
4967
4968 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4970
4971 std::task::Poll::Ready(Some(match header.ordinal {
4972 0x9de6bbc87c314d9 => {
4973 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4974 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
4975 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4976 let control_handle = PackageIndexIteratorControlHandle {
4977 inner: this.inner.clone(),
4978 };
4979 Ok(PackageIndexIteratorRequest::Next {
4980 responder: PackageIndexIteratorNextResponder {
4981 control_handle: std::mem::ManuallyDrop::new(control_handle),
4982 tx_id: header.tx_id,
4983 },
4984 })
4985 }
4986 _ => Err(fidl::Error::UnknownOrdinal {
4987 ordinal: header.ordinal,
4988 protocol_name: <PackageIndexIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4989 }),
4990 }))
4991 },
4992 )
4993 }
4994}
4995
4996#[derive(Debug)]
4999pub enum PackageIndexIteratorRequest {
5000 Next { responder: PackageIndexIteratorNextResponder },
5005}
5006
5007impl PackageIndexIteratorRequest {
5008 #[allow(irrefutable_let_patterns)]
5009 pub fn into_next(self) -> Option<(PackageIndexIteratorNextResponder)> {
5010 if let PackageIndexIteratorRequest::Next { responder } = self {
5011 Some((responder))
5012 } else {
5013 None
5014 }
5015 }
5016
5017 pub fn method_name(&self) -> &'static str {
5019 match *self {
5020 PackageIndexIteratorRequest::Next { .. } => "next",
5021 }
5022 }
5023}
5024
5025#[derive(Debug, Clone)]
5026pub struct PackageIndexIteratorControlHandle {
5027 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5028}
5029
5030impl fidl::endpoints::ControlHandle for PackageIndexIteratorControlHandle {
5031 fn shutdown(&self) {
5032 self.inner.shutdown()
5033 }
5034 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5035 self.inner.shutdown_with_epitaph(status)
5036 }
5037
5038 fn is_closed(&self) -> bool {
5039 self.inner.channel().is_closed()
5040 }
5041 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5042 self.inner.channel().on_closed()
5043 }
5044
5045 #[cfg(target_os = "fuchsia")]
5046 fn signal_peer(
5047 &self,
5048 clear_mask: zx::Signals,
5049 set_mask: zx::Signals,
5050 ) -> Result<(), zx_status::Status> {
5051 use fidl::Peered;
5052 self.inner.channel().signal_peer(clear_mask, set_mask)
5053 }
5054}
5055
5056impl PackageIndexIteratorControlHandle {}
5057
5058#[must_use = "FIDL methods require a response to be sent"]
5059#[derive(Debug)]
5060pub struct PackageIndexIteratorNextResponder {
5061 control_handle: std::mem::ManuallyDrop<PackageIndexIteratorControlHandle>,
5062 tx_id: u32,
5063}
5064
5065impl std::ops::Drop for PackageIndexIteratorNextResponder {
5069 fn drop(&mut self) {
5070 self.control_handle.shutdown();
5071 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5073 }
5074}
5075
5076impl fidl::endpoints::Responder for PackageIndexIteratorNextResponder {
5077 type ControlHandle = PackageIndexIteratorControlHandle;
5078
5079 fn control_handle(&self) -> &PackageIndexIteratorControlHandle {
5080 &self.control_handle
5081 }
5082
5083 fn drop_without_shutdown(mut self) {
5084 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5086 std::mem::forget(self);
5088 }
5089}
5090
5091impl PackageIndexIteratorNextResponder {
5092 pub fn send(self, mut entries: &[PackageIndexEntry]) -> Result<(), fidl::Error> {
5096 let _result = self.send_raw(entries);
5097 if _result.is_err() {
5098 self.control_handle.shutdown();
5099 }
5100 self.drop_without_shutdown();
5101 _result
5102 }
5103
5104 pub fn send_no_shutdown_on_err(
5106 self,
5107 mut entries: &[PackageIndexEntry],
5108 ) -> Result<(), fidl::Error> {
5109 let _result = self.send_raw(entries);
5110 self.drop_without_shutdown();
5111 _result
5112 }
5113
5114 fn send_raw(&self, mut entries: &[PackageIndexEntry]) -> Result<(), fidl::Error> {
5115 self.control_handle.inner.send::<PackageIndexIteratorNextResponse>(
5116 (entries,),
5117 self.tx_id,
5118 0x9de6bbc87c314d9,
5119 fidl::encoding::DynamicFlags::empty(),
5120 )
5121 }
5122}
5123
5124#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5125pub struct PackageResolverMarker;
5126
5127impl fidl::endpoints::ProtocolMarker for PackageResolverMarker {
5128 type Proxy = PackageResolverProxy;
5129 type RequestStream = PackageResolverRequestStream;
5130 #[cfg(target_os = "fuchsia")]
5131 type SynchronousProxy = PackageResolverSynchronousProxy;
5132
5133 const DEBUG_NAME: &'static str = "fuchsia.pkg.PackageResolver";
5134}
5135impl fidl::endpoints::DiscoverableProtocolMarker for PackageResolverMarker {}
5136pub type PackageResolverResolveResult = Result<ResolutionContext, ResolveError>;
5137pub type PackageResolverResolveWithContextResult = Result<ResolutionContext, ResolveError>;
5138pub type PackageResolverGetHashResult = Result<BlobId, i32>;
5139
5140pub trait PackageResolverProxyInterface: Send + Sync {
5141 type ResolveResponseFut: std::future::Future<Output = Result<PackageResolverResolveResult, fidl::Error>>
5142 + Send;
5143 fn r#resolve(
5144 &self,
5145 package_url: &str,
5146 dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5147 ) -> Self::ResolveResponseFut;
5148 type ResolveWithContextResponseFut: std::future::Future<Output = Result<PackageResolverResolveWithContextResult, fidl::Error>>
5149 + Send;
5150 fn r#resolve_with_context(
5151 &self,
5152 package_url: &str,
5153 context: &ResolutionContext,
5154 dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5155 ) -> Self::ResolveWithContextResponseFut;
5156 type GetHashResponseFut: std::future::Future<Output = Result<PackageResolverGetHashResult, fidl::Error>>
5157 + Send;
5158 fn r#get_hash(&self, package_url: &PackageUrl) -> Self::GetHashResponseFut;
5159}
5160#[derive(Debug)]
5161#[cfg(target_os = "fuchsia")]
5162pub struct PackageResolverSynchronousProxy {
5163 client: fidl::client::sync::Client,
5164}
5165
5166#[cfg(target_os = "fuchsia")]
5167impl fidl::endpoints::SynchronousProxy for PackageResolverSynchronousProxy {
5168 type Proxy = PackageResolverProxy;
5169 type Protocol = PackageResolverMarker;
5170
5171 fn from_channel(inner: fidl::Channel) -> Self {
5172 Self::new(inner)
5173 }
5174
5175 fn into_channel(self) -> fidl::Channel {
5176 self.client.into_channel()
5177 }
5178
5179 fn as_channel(&self) -> &fidl::Channel {
5180 self.client.as_channel()
5181 }
5182}
5183
5184#[cfg(target_os = "fuchsia")]
5185impl PackageResolverSynchronousProxy {
5186 pub fn new(channel: fidl::Channel) -> Self {
5187 let protocol_name = <PackageResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5188 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5189 }
5190
5191 pub fn into_channel(self) -> fidl::Channel {
5192 self.client.into_channel()
5193 }
5194
5195 pub fn wait_for_event(
5198 &self,
5199 deadline: zx::MonotonicInstant,
5200 ) -> Result<PackageResolverEvent, fidl::Error> {
5201 PackageResolverEvent::decode(self.client.wait_for_event(deadline)?)
5202 }
5203
5204 pub fn r#resolve(
5222 &self,
5223 mut package_url: &str,
5224 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5225 ___deadline: zx::MonotonicInstant,
5226 ) -> Result<PackageResolverResolveResult, fidl::Error> {
5227 let _response = self.client.send_query::<
5228 PackageResolverResolveRequest,
5229 fidl::encoding::ResultType<PackageResolverResolveResponse, ResolveError>,
5230 >(
5231 (package_url, dir,),
5232 0x6611263be4052d4f,
5233 fidl::encoding::DynamicFlags::empty(),
5234 ___deadline,
5235 )?;
5236 Ok(_response.map(|x| x.resolved_context))
5237 }
5238
5239 pub fn r#resolve_with_context(
5259 &self,
5260 mut package_url: &str,
5261 mut context: &ResolutionContext,
5262 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5263 ___deadline: zx::MonotonicInstant,
5264 ) -> Result<PackageResolverResolveWithContextResult, fidl::Error> {
5265 let _response =
5266 self.client
5267 .send_query::<PackageResolverResolveWithContextRequest, fidl::encoding::ResultType<
5268 PackageResolverResolveWithContextResponse,
5269 ResolveError,
5270 >>(
5271 (package_url, context, dir),
5272 0x4c255ae7260298d4,
5273 fidl::encoding::DynamicFlags::empty(),
5274 ___deadline,
5275 )?;
5276 Ok(_response.map(|x| x.resolved_context))
5277 }
5278
5279 pub fn r#get_hash(
5291 &self,
5292 mut package_url: &PackageUrl,
5293 ___deadline: zx::MonotonicInstant,
5294 ) -> Result<PackageResolverGetHashResult, fidl::Error> {
5295 let _response = self.client.send_query::<
5296 PackageResolverGetHashRequest,
5297 fidl::encoding::ResultType<PackageResolverGetHashResponse, i32>,
5298 >(
5299 (package_url,),
5300 0x594e8b4db51efd87,
5301 fidl::encoding::DynamicFlags::empty(),
5302 ___deadline,
5303 )?;
5304 Ok(_response.map(|x| x.meta_far_blob_id))
5305 }
5306}
5307
5308#[cfg(target_os = "fuchsia")]
5309impl From<PackageResolverSynchronousProxy> for zx::Handle {
5310 fn from(value: PackageResolverSynchronousProxy) -> Self {
5311 value.into_channel().into()
5312 }
5313}
5314
5315#[cfg(target_os = "fuchsia")]
5316impl From<fidl::Channel> for PackageResolverSynchronousProxy {
5317 fn from(value: fidl::Channel) -> Self {
5318 Self::new(value)
5319 }
5320}
5321
5322#[derive(Debug, Clone)]
5323pub struct PackageResolverProxy {
5324 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5325}
5326
5327impl fidl::endpoints::Proxy for PackageResolverProxy {
5328 type Protocol = PackageResolverMarker;
5329
5330 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5331 Self::new(inner)
5332 }
5333
5334 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5335 self.client.into_channel().map_err(|client| Self { client })
5336 }
5337
5338 fn as_channel(&self) -> &::fidl::AsyncChannel {
5339 self.client.as_channel()
5340 }
5341}
5342
5343impl PackageResolverProxy {
5344 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5346 let protocol_name = <PackageResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5347 Self { client: fidl::client::Client::new(channel, protocol_name) }
5348 }
5349
5350 pub fn take_event_stream(&self) -> PackageResolverEventStream {
5356 PackageResolverEventStream { event_receiver: self.client.take_event_receiver() }
5357 }
5358
5359 pub fn r#resolve(
5377 &self,
5378 mut package_url: &str,
5379 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5380 ) -> fidl::client::QueryResponseFut<
5381 PackageResolverResolveResult,
5382 fidl::encoding::DefaultFuchsiaResourceDialect,
5383 > {
5384 PackageResolverProxyInterface::r#resolve(self, package_url, dir)
5385 }
5386
5387 pub fn r#resolve_with_context(
5407 &self,
5408 mut package_url: &str,
5409 mut context: &ResolutionContext,
5410 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5411 ) -> fidl::client::QueryResponseFut<
5412 PackageResolverResolveWithContextResult,
5413 fidl::encoding::DefaultFuchsiaResourceDialect,
5414 > {
5415 PackageResolverProxyInterface::r#resolve_with_context(self, package_url, context, dir)
5416 }
5417
5418 pub fn r#get_hash(
5430 &self,
5431 mut package_url: &PackageUrl,
5432 ) -> fidl::client::QueryResponseFut<
5433 PackageResolverGetHashResult,
5434 fidl::encoding::DefaultFuchsiaResourceDialect,
5435 > {
5436 PackageResolverProxyInterface::r#get_hash(self, package_url)
5437 }
5438}
5439
5440impl PackageResolverProxyInterface for PackageResolverProxy {
5441 type ResolveResponseFut = fidl::client::QueryResponseFut<
5442 PackageResolverResolveResult,
5443 fidl::encoding::DefaultFuchsiaResourceDialect,
5444 >;
5445 fn r#resolve(
5446 &self,
5447 mut package_url: &str,
5448 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5449 ) -> Self::ResolveResponseFut {
5450 fn _decode(
5451 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5452 ) -> Result<PackageResolverResolveResult, fidl::Error> {
5453 let _response = fidl::client::decode_transaction_body::<
5454 fidl::encoding::ResultType<PackageResolverResolveResponse, ResolveError>,
5455 fidl::encoding::DefaultFuchsiaResourceDialect,
5456 0x6611263be4052d4f,
5457 >(_buf?)?;
5458 Ok(_response.map(|x| x.resolved_context))
5459 }
5460 self.client
5461 .send_query_and_decode::<PackageResolverResolveRequest, PackageResolverResolveResult>(
5462 (package_url, dir),
5463 0x6611263be4052d4f,
5464 fidl::encoding::DynamicFlags::empty(),
5465 _decode,
5466 )
5467 }
5468
5469 type ResolveWithContextResponseFut = fidl::client::QueryResponseFut<
5470 PackageResolverResolveWithContextResult,
5471 fidl::encoding::DefaultFuchsiaResourceDialect,
5472 >;
5473 fn r#resolve_with_context(
5474 &self,
5475 mut package_url: &str,
5476 mut context: &ResolutionContext,
5477 mut dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5478 ) -> Self::ResolveWithContextResponseFut {
5479 fn _decode(
5480 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5481 ) -> Result<PackageResolverResolveWithContextResult, fidl::Error> {
5482 let _response = fidl::client::decode_transaction_body::<
5483 fidl::encoding::ResultType<PackageResolverResolveWithContextResponse, ResolveError>,
5484 fidl::encoding::DefaultFuchsiaResourceDialect,
5485 0x4c255ae7260298d4,
5486 >(_buf?)?;
5487 Ok(_response.map(|x| x.resolved_context))
5488 }
5489 self.client.send_query_and_decode::<
5490 PackageResolverResolveWithContextRequest,
5491 PackageResolverResolveWithContextResult,
5492 >(
5493 (package_url, context, dir,),
5494 0x4c255ae7260298d4,
5495 fidl::encoding::DynamicFlags::empty(),
5496 _decode,
5497 )
5498 }
5499
5500 type GetHashResponseFut = fidl::client::QueryResponseFut<
5501 PackageResolverGetHashResult,
5502 fidl::encoding::DefaultFuchsiaResourceDialect,
5503 >;
5504 fn r#get_hash(&self, mut package_url: &PackageUrl) -> Self::GetHashResponseFut {
5505 fn _decode(
5506 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5507 ) -> Result<PackageResolverGetHashResult, fidl::Error> {
5508 let _response = fidl::client::decode_transaction_body::<
5509 fidl::encoding::ResultType<PackageResolverGetHashResponse, i32>,
5510 fidl::encoding::DefaultFuchsiaResourceDialect,
5511 0x594e8b4db51efd87,
5512 >(_buf?)?;
5513 Ok(_response.map(|x| x.meta_far_blob_id))
5514 }
5515 self.client
5516 .send_query_and_decode::<PackageResolverGetHashRequest, PackageResolverGetHashResult>(
5517 (package_url,),
5518 0x594e8b4db51efd87,
5519 fidl::encoding::DynamicFlags::empty(),
5520 _decode,
5521 )
5522 }
5523}
5524
5525pub struct PackageResolverEventStream {
5526 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5527}
5528
5529impl std::marker::Unpin for PackageResolverEventStream {}
5530
5531impl futures::stream::FusedStream for PackageResolverEventStream {
5532 fn is_terminated(&self) -> bool {
5533 self.event_receiver.is_terminated()
5534 }
5535}
5536
5537impl futures::Stream for PackageResolverEventStream {
5538 type Item = Result<PackageResolverEvent, fidl::Error>;
5539
5540 fn poll_next(
5541 mut self: std::pin::Pin<&mut Self>,
5542 cx: &mut std::task::Context<'_>,
5543 ) -> std::task::Poll<Option<Self::Item>> {
5544 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5545 &mut self.event_receiver,
5546 cx
5547 )?) {
5548 Some(buf) => std::task::Poll::Ready(Some(PackageResolverEvent::decode(buf))),
5549 None => std::task::Poll::Ready(None),
5550 }
5551 }
5552}
5553
5554#[derive(Debug)]
5555pub enum PackageResolverEvent {}
5556
5557impl PackageResolverEvent {
5558 fn decode(
5560 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5561 ) -> Result<PackageResolverEvent, fidl::Error> {
5562 let (bytes, _handles) = buf.split_mut();
5563 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5564 debug_assert_eq!(tx_header.tx_id, 0);
5565 match tx_header.ordinal {
5566 _ => Err(fidl::Error::UnknownOrdinal {
5567 ordinal: tx_header.ordinal,
5568 protocol_name:
5569 <PackageResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5570 }),
5571 }
5572 }
5573}
5574
5575pub struct PackageResolverRequestStream {
5577 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5578 is_terminated: bool,
5579}
5580
5581impl std::marker::Unpin for PackageResolverRequestStream {}
5582
5583impl futures::stream::FusedStream for PackageResolverRequestStream {
5584 fn is_terminated(&self) -> bool {
5585 self.is_terminated
5586 }
5587}
5588
5589impl fidl::endpoints::RequestStream for PackageResolverRequestStream {
5590 type Protocol = PackageResolverMarker;
5591 type ControlHandle = PackageResolverControlHandle;
5592
5593 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5594 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5595 }
5596
5597 fn control_handle(&self) -> Self::ControlHandle {
5598 PackageResolverControlHandle { inner: self.inner.clone() }
5599 }
5600
5601 fn into_inner(
5602 self,
5603 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5604 {
5605 (self.inner, self.is_terminated)
5606 }
5607
5608 fn from_inner(
5609 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5610 is_terminated: bool,
5611 ) -> Self {
5612 Self { inner, is_terminated }
5613 }
5614}
5615
5616impl futures::Stream for PackageResolverRequestStream {
5617 type Item = Result<PackageResolverRequest, fidl::Error>;
5618
5619 fn poll_next(
5620 mut self: std::pin::Pin<&mut Self>,
5621 cx: &mut std::task::Context<'_>,
5622 ) -> std::task::Poll<Option<Self::Item>> {
5623 let this = &mut *self;
5624 if this.inner.check_shutdown(cx) {
5625 this.is_terminated = true;
5626 return std::task::Poll::Ready(None);
5627 }
5628 if this.is_terminated {
5629 panic!("polled PackageResolverRequestStream after completion");
5630 }
5631 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5632 |bytes, handles| {
5633 match this.inner.channel().read_etc(cx, bytes, handles) {
5634 std::task::Poll::Ready(Ok(())) => {}
5635 std::task::Poll::Pending => return std::task::Poll::Pending,
5636 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5637 this.is_terminated = true;
5638 return std::task::Poll::Ready(None);
5639 }
5640 std::task::Poll::Ready(Err(e)) => {
5641 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5642 e.into(),
5643 ))))
5644 }
5645 }
5646
5647 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5649
5650 std::task::Poll::Ready(Some(match header.ordinal {
5651 0x6611263be4052d4f => {
5652 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5653 let mut req = fidl::new_empty!(
5654 PackageResolverResolveRequest,
5655 fidl::encoding::DefaultFuchsiaResourceDialect
5656 );
5657 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageResolverResolveRequest>(&header, _body_bytes, handles, &mut req)?;
5658 let control_handle =
5659 PackageResolverControlHandle { inner: this.inner.clone() };
5660 Ok(PackageResolverRequest::Resolve {
5661 package_url: req.package_url,
5662 dir: req.dir,
5663
5664 responder: PackageResolverResolveResponder {
5665 control_handle: std::mem::ManuallyDrop::new(control_handle),
5666 tx_id: header.tx_id,
5667 },
5668 })
5669 }
5670 0x4c255ae7260298d4 => {
5671 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5672 let mut req = fidl::new_empty!(
5673 PackageResolverResolveWithContextRequest,
5674 fidl::encoding::DefaultFuchsiaResourceDialect
5675 );
5676 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageResolverResolveWithContextRequest>(&header, _body_bytes, handles, &mut req)?;
5677 let control_handle =
5678 PackageResolverControlHandle { inner: this.inner.clone() };
5679 Ok(PackageResolverRequest::ResolveWithContext {
5680 package_url: req.package_url,
5681 context: req.context,
5682 dir: req.dir,
5683
5684 responder: PackageResolverResolveWithContextResponder {
5685 control_handle: std::mem::ManuallyDrop::new(control_handle),
5686 tx_id: header.tx_id,
5687 },
5688 })
5689 }
5690 0x594e8b4db51efd87 => {
5691 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5692 let mut req = fidl::new_empty!(
5693 PackageResolverGetHashRequest,
5694 fidl::encoding::DefaultFuchsiaResourceDialect
5695 );
5696 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PackageResolverGetHashRequest>(&header, _body_bytes, handles, &mut req)?;
5697 let control_handle =
5698 PackageResolverControlHandle { inner: this.inner.clone() };
5699 Ok(PackageResolverRequest::GetHash {
5700 package_url: req.package_url,
5701
5702 responder: PackageResolverGetHashResponder {
5703 control_handle: std::mem::ManuallyDrop::new(control_handle),
5704 tx_id: header.tx_id,
5705 },
5706 })
5707 }
5708 _ => Err(fidl::Error::UnknownOrdinal {
5709 ordinal: header.ordinal,
5710 protocol_name:
5711 <PackageResolverMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5712 }),
5713 }))
5714 },
5715 )
5716 }
5717}
5718
5719#[derive(Debug)]
5724pub enum PackageResolverRequest {
5725 Resolve {
5743 package_url: String,
5744 dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5745 responder: PackageResolverResolveResponder,
5746 },
5747 ResolveWithContext {
5767 package_url: String,
5768 context: ResolutionContext,
5769 dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5770 responder: PackageResolverResolveWithContextResponder,
5771 },
5772 GetHash { package_url: PackageUrl, responder: PackageResolverGetHashResponder },
5784}
5785
5786impl PackageResolverRequest {
5787 #[allow(irrefutable_let_patterns)]
5788 pub fn into_resolve(
5789 self,
5790 ) -> Option<(
5791 String,
5792 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5793 PackageResolverResolveResponder,
5794 )> {
5795 if let PackageResolverRequest::Resolve { package_url, dir, responder } = self {
5796 Some((package_url, dir, responder))
5797 } else {
5798 None
5799 }
5800 }
5801
5802 #[allow(irrefutable_let_patterns)]
5803 pub fn into_resolve_with_context(
5804 self,
5805 ) -> Option<(
5806 String,
5807 ResolutionContext,
5808 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5809 PackageResolverResolveWithContextResponder,
5810 )> {
5811 if let PackageResolverRequest::ResolveWithContext { package_url, context, dir, responder } =
5812 self
5813 {
5814 Some((package_url, context, dir, responder))
5815 } else {
5816 None
5817 }
5818 }
5819
5820 #[allow(irrefutable_let_patterns)]
5821 pub fn into_get_hash(self) -> Option<(PackageUrl, PackageResolverGetHashResponder)> {
5822 if let PackageResolverRequest::GetHash { package_url, responder } = self {
5823 Some((package_url, responder))
5824 } else {
5825 None
5826 }
5827 }
5828
5829 pub fn method_name(&self) -> &'static str {
5831 match *self {
5832 PackageResolverRequest::Resolve { .. } => "resolve",
5833 PackageResolverRequest::ResolveWithContext { .. } => "resolve_with_context",
5834 PackageResolverRequest::GetHash { .. } => "get_hash",
5835 }
5836 }
5837}
5838
5839#[derive(Debug, Clone)]
5840pub struct PackageResolverControlHandle {
5841 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5842}
5843
5844impl fidl::endpoints::ControlHandle for PackageResolverControlHandle {
5845 fn shutdown(&self) {
5846 self.inner.shutdown()
5847 }
5848 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5849 self.inner.shutdown_with_epitaph(status)
5850 }
5851
5852 fn is_closed(&self) -> bool {
5853 self.inner.channel().is_closed()
5854 }
5855 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5856 self.inner.channel().on_closed()
5857 }
5858
5859 #[cfg(target_os = "fuchsia")]
5860 fn signal_peer(
5861 &self,
5862 clear_mask: zx::Signals,
5863 set_mask: zx::Signals,
5864 ) -> Result<(), zx_status::Status> {
5865 use fidl::Peered;
5866 self.inner.channel().signal_peer(clear_mask, set_mask)
5867 }
5868}
5869
5870impl PackageResolverControlHandle {}
5871
5872#[must_use = "FIDL methods require a response to be sent"]
5873#[derive(Debug)]
5874pub struct PackageResolverResolveResponder {
5875 control_handle: std::mem::ManuallyDrop<PackageResolverControlHandle>,
5876 tx_id: u32,
5877}
5878
5879impl std::ops::Drop for PackageResolverResolveResponder {
5883 fn drop(&mut self) {
5884 self.control_handle.shutdown();
5885 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5887 }
5888}
5889
5890impl fidl::endpoints::Responder for PackageResolverResolveResponder {
5891 type ControlHandle = PackageResolverControlHandle;
5892
5893 fn control_handle(&self) -> &PackageResolverControlHandle {
5894 &self.control_handle
5895 }
5896
5897 fn drop_without_shutdown(mut self) {
5898 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5900 std::mem::forget(self);
5902 }
5903}
5904
5905impl PackageResolverResolveResponder {
5906 pub fn send(
5910 self,
5911 mut result: Result<&ResolutionContext, ResolveError>,
5912 ) -> Result<(), fidl::Error> {
5913 let _result = self.send_raw(result);
5914 if _result.is_err() {
5915 self.control_handle.shutdown();
5916 }
5917 self.drop_without_shutdown();
5918 _result
5919 }
5920
5921 pub fn send_no_shutdown_on_err(
5923 self,
5924 mut result: Result<&ResolutionContext, ResolveError>,
5925 ) -> Result<(), fidl::Error> {
5926 let _result = self.send_raw(result);
5927 self.drop_without_shutdown();
5928 _result
5929 }
5930
5931 fn send_raw(
5932 &self,
5933 mut result: Result<&ResolutionContext, ResolveError>,
5934 ) -> Result<(), fidl::Error> {
5935 self.control_handle.inner.send::<fidl::encoding::ResultType<
5936 PackageResolverResolveResponse,
5937 ResolveError,
5938 >>(
5939 result.map(|resolved_context| (resolved_context,)),
5940 self.tx_id,
5941 0x6611263be4052d4f,
5942 fidl::encoding::DynamicFlags::empty(),
5943 )
5944 }
5945}
5946
5947#[must_use = "FIDL methods require a response to be sent"]
5948#[derive(Debug)]
5949pub struct PackageResolverResolveWithContextResponder {
5950 control_handle: std::mem::ManuallyDrop<PackageResolverControlHandle>,
5951 tx_id: u32,
5952}
5953
5954impl std::ops::Drop for PackageResolverResolveWithContextResponder {
5958 fn drop(&mut self) {
5959 self.control_handle.shutdown();
5960 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5962 }
5963}
5964
5965impl fidl::endpoints::Responder for PackageResolverResolveWithContextResponder {
5966 type ControlHandle = PackageResolverControlHandle;
5967
5968 fn control_handle(&self) -> &PackageResolverControlHandle {
5969 &self.control_handle
5970 }
5971
5972 fn drop_without_shutdown(mut self) {
5973 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5975 std::mem::forget(self);
5977 }
5978}
5979
5980impl PackageResolverResolveWithContextResponder {
5981 pub fn send(
5985 self,
5986 mut result: Result<&ResolutionContext, ResolveError>,
5987 ) -> Result<(), fidl::Error> {
5988 let _result = self.send_raw(result);
5989 if _result.is_err() {
5990 self.control_handle.shutdown();
5991 }
5992 self.drop_without_shutdown();
5993 _result
5994 }
5995
5996 pub fn send_no_shutdown_on_err(
5998 self,
5999 mut result: Result<&ResolutionContext, ResolveError>,
6000 ) -> Result<(), fidl::Error> {
6001 let _result = self.send_raw(result);
6002 self.drop_without_shutdown();
6003 _result
6004 }
6005
6006 fn send_raw(
6007 &self,
6008 mut result: Result<&ResolutionContext, ResolveError>,
6009 ) -> Result<(), fidl::Error> {
6010 self.control_handle.inner.send::<fidl::encoding::ResultType<
6011 PackageResolverResolveWithContextResponse,
6012 ResolveError,
6013 >>(
6014 result.map(|resolved_context| (resolved_context,)),
6015 self.tx_id,
6016 0x4c255ae7260298d4,
6017 fidl::encoding::DynamicFlags::empty(),
6018 )
6019 }
6020}
6021
6022#[must_use = "FIDL methods require a response to be sent"]
6023#[derive(Debug)]
6024pub struct PackageResolverGetHashResponder {
6025 control_handle: std::mem::ManuallyDrop<PackageResolverControlHandle>,
6026 tx_id: u32,
6027}
6028
6029impl std::ops::Drop for PackageResolverGetHashResponder {
6033 fn drop(&mut self) {
6034 self.control_handle.shutdown();
6035 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6037 }
6038}
6039
6040impl fidl::endpoints::Responder for PackageResolverGetHashResponder {
6041 type ControlHandle = PackageResolverControlHandle;
6042
6043 fn control_handle(&self) -> &PackageResolverControlHandle {
6044 &self.control_handle
6045 }
6046
6047 fn drop_without_shutdown(mut self) {
6048 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6050 std::mem::forget(self);
6052 }
6053}
6054
6055impl PackageResolverGetHashResponder {
6056 pub fn send(self, mut result: Result<&BlobId, i32>) -> Result<(), fidl::Error> {
6060 let _result = self.send_raw(result);
6061 if _result.is_err() {
6062 self.control_handle.shutdown();
6063 }
6064 self.drop_without_shutdown();
6065 _result
6066 }
6067
6068 pub fn send_no_shutdown_on_err(
6070 self,
6071 mut result: Result<&BlobId, i32>,
6072 ) -> Result<(), fidl::Error> {
6073 let _result = self.send_raw(result);
6074 self.drop_without_shutdown();
6075 _result
6076 }
6077
6078 fn send_raw(&self, mut result: Result<&BlobId, i32>) -> Result<(), fidl::Error> {
6079 self.control_handle
6080 .inner
6081 .send::<fidl::encoding::ResultType<PackageResolverGetHashResponse, i32>>(
6082 result.map(|meta_far_blob_id| (meta_far_blob_id,)),
6083 self.tx_id,
6084 0x594e8b4db51efd87,
6085 fidl::encoding::DynamicFlags::empty(),
6086 )
6087 }
6088}
6089
6090#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6091pub struct RepositoryIteratorMarker;
6092
6093impl fidl::endpoints::ProtocolMarker for RepositoryIteratorMarker {
6094 type Proxy = RepositoryIteratorProxy;
6095 type RequestStream = RepositoryIteratorRequestStream;
6096 #[cfg(target_os = "fuchsia")]
6097 type SynchronousProxy = RepositoryIteratorSynchronousProxy;
6098
6099 const DEBUG_NAME: &'static str = "(anonymous) RepositoryIterator";
6100}
6101
6102pub trait RepositoryIteratorProxyInterface: Send + Sync {
6103 type NextResponseFut: std::future::Future<Output = Result<Vec<RepositoryConfig>, fidl::Error>>
6104 + Send;
6105 fn r#next(&self) -> Self::NextResponseFut;
6106}
6107#[derive(Debug)]
6108#[cfg(target_os = "fuchsia")]
6109pub struct RepositoryIteratorSynchronousProxy {
6110 client: fidl::client::sync::Client,
6111}
6112
6113#[cfg(target_os = "fuchsia")]
6114impl fidl::endpoints::SynchronousProxy for RepositoryIteratorSynchronousProxy {
6115 type Proxy = RepositoryIteratorProxy;
6116 type Protocol = RepositoryIteratorMarker;
6117
6118 fn from_channel(inner: fidl::Channel) -> Self {
6119 Self::new(inner)
6120 }
6121
6122 fn into_channel(self) -> fidl::Channel {
6123 self.client.into_channel()
6124 }
6125
6126 fn as_channel(&self) -> &fidl::Channel {
6127 self.client.as_channel()
6128 }
6129}
6130
6131#[cfg(target_os = "fuchsia")]
6132impl RepositoryIteratorSynchronousProxy {
6133 pub fn new(channel: fidl::Channel) -> Self {
6134 let protocol_name =
6135 <RepositoryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6136 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6137 }
6138
6139 pub fn into_channel(self) -> fidl::Channel {
6140 self.client.into_channel()
6141 }
6142
6143 pub fn wait_for_event(
6146 &self,
6147 deadline: zx::MonotonicInstant,
6148 ) -> Result<RepositoryIteratorEvent, fidl::Error> {
6149 RepositoryIteratorEvent::decode(self.client.wait_for_event(deadline)?)
6150 }
6151
6152 pub fn r#next(
6157 &self,
6158 ___deadline: zx::MonotonicInstant,
6159 ) -> Result<Vec<RepositoryConfig>, fidl::Error> {
6160 let _response = self
6161 .client
6162 .send_query::<fidl::encoding::EmptyPayload, RepositoryIteratorNextResponse>(
6163 (),
6164 0x5502086bc0cdd25e,
6165 fidl::encoding::DynamicFlags::empty(),
6166 ___deadline,
6167 )?;
6168 Ok(_response.repos)
6169 }
6170}
6171
6172#[cfg(target_os = "fuchsia")]
6173impl From<RepositoryIteratorSynchronousProxy> for zx::Handle {
6174 fn from(value: RepositoryIteratorSynchronousProxy) -> Self {
6175 value.into_channel().into()
6176 }
6177}
6178
6179#[cfg(target_os = "fuchsia")]
6180impl From<fidl::Channel> for RepositoryIteratorSynchronousProxy {
6181 fn from(value: fidl::Channel) -> Self {
6182 Self::new(value)
6183 }
6184}
6185
6186#[derive(Debug, Clone)]
6187pub struct RepositoryIteratorProxy {
6188 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6189}
6190
6191impl fidl::endpoints::Proxy for RepositoryIteratorProxy {
6192 type Protocol = RepositoryIteratorMarker;
6193
6194 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6195 Self::new(inner)
6196 }
6197
6198 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6199 self.client.into_channel().map_err(|client| Self { client })
6200 }
6201
6202 fn as_channel(&self) -> &::fidl::AsyncChannel {
6203 self.client.as_channel()
6204 }
6205}
6206
6207impl RepositoryIteratorProxy {
6208 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6210 let protocol_name =
6211 <RepositoryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6212 Self { client: fidl::client::Client::new(channel, protocol_name) }
6213 }
6214
6215 pub fn take_event_stream(&self) -> RepositoryIteratorEventStream {
6221 RepositoryIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6222 }
6223
6224 pub fn r#next(
6229 &self,
6230 ) -> fidl::client::QueryResponseFut<
6231 Vec<RepositoryConfig>,
6232 fidl::encoding::DefaultFuchsiaResourceDialect,
6233 > {
6234 RepositoryIteratorProxyInterface::r#next(self)
6235 }
6236}
6237
6238impl RepositoryIteratorProxyInterface for RepositoryIteratorProxy {
6239 type NextResponseFut = fidl::client::QueryResponseFut<
6240 Vec<RepositoryConfig>,
6241 fidl::encoding::DefaultFuchsiaResourceDialect,
6242 >;
6243 fn r#next(&self) -> Self::NextResponseFut {
6244 fn _decode(
6245 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6246 ) -> Result<Vec<RepositoryConfig>, fidl::Error> {
6247 let _response = fidl::client::decode_transaction_body::<
6248 RepositoryIteratorNextResponse,
6249 fidl::encoding::DefaultFuchsiaResourceDialect,
6250 0x5502086bc0cdd25e,
6251 >(_buf?)?;
6252 Ok(_response.repos)
6253 }
6254 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<RepositoryConfig>>(
6255 (),
6256 0x5502086bc0cdd25e,
6257 fidl::encoding::DynamicFlags::empty(),
6258 _decode,
6259 )
6260 }
6261}
6262
6263pub struct RepositoryIteratorEventStream {
6264 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6265}
6266
6267impl std::marker::Unpin for RepositoryIteratorEventStream {}
6268
6269impl futures::stream::FusedStream for RepositoryIteratorEventStream {
6270 fn is_terminated(&self) -> bool {
6271 self.event_receiver.is_terminated()
6272 }
6273}
6274
6275impl futures::Stream for RepositoryIteratorEventStream {
6276 type Item = Result<RepositoryIteratorEvent, fidl::Error>;
6277
6278 fn poll_next(
6279 mut self: std::pin::Pin<&mut Self>,
6280 cx: &mut std::task::Context<'_>,
6281 ) -> std::task::Poll<Option<Self::Item>> {
6282 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6283 &mut self.event_receiver,
6284 cx
6285 )?) {
6286 Some(buf) => std::task::Poll::Ready(Some(RepositoryIteratorEvent::decode(buf))),
6287 None => std::task::Poll::Ready(None),
6288 }
6289 }
6290}
6291
6292#[derive(Debug)]
6293pub enum RepositoryIteratorEvent {}
6294
6295impl RepositoryIteratorEvent {
6296 fn decode(
6298 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6299 ) -> Result<RepositoryIteratorEvent, fidl::Error> {
6300 let (bytes, _handles) = buf.split_mut();
6301 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6302 debug_assert_eq!(tx_header.tx_id, 0);
6303 match tx_header.ordinal {
6304 _ => Err(fidl::Error::UnknownOrdinal {
6305 ordinal: tx_header.ordinal,
6306 protocol_name:
6307 <RepositoryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6308 }),
6309 }
6310 }
6311}
6312
6313pub struct RepositoryIteratorRequestStream {
6315 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6316 is_terminated: bool,
6317}
6318
6319impl std::marker::Unpin for RepositoryIteratorRequestStream {}
6320
6321impl futures::stream::FusedStream for RepositoryIteratorRequestStream {
6322 fn is_terminated(&self) -> bool {
6323 self.is_terminated
6324 }
6325}
6326
6327impl fidl::endpoints::RequestStream for RepositoryIteratorRequestStream {
6328 type Protocol = RepositoryIteratorMarker;
6329 type ControlHandle = RepositoryIteratorControlHandle;
6330
6331 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6332 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6333 }
6334
6335 fn control_handle(&self) -> Self::ControlHandle {
6336 RepositoryIteratorControlHandle { inner: self.inner.clone() }
6337 }
6338
6339 fn into_inner(
6340 self,
6341 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6342 {
6343 (self.inner, self.is_terminated)
6344 }
6345
6346 fn from_inner(
6347 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6348 is_terminated: bool,
6349 ) -> Self {
6350 Self { inner, is_terminated }
6351 }
6352}
6353
6354impl futures::Stream for RepositoryIteratorRequestStream {
6355 type Item = Result<RepositoryIteratorRequest, fidl::Error>;
6356
6357 fn poll_next(
6358 mut self: std::pin::Pin<&mut Self>,
6359 cx: &mut std::task::Context<'_>,
6360 ) -> std::task::Poll<Option<Self::Item>> {
6361 let this = &mut *self;
6362 if this.inner.check_shutdown(cx) {
6363 this.is_terminated = true;
6364 return std::task::Poll::Ready(None);
6365 }
6366 if this.is_terminated {
6367 panic!("polled RepositoryIteratorRequestStream after completion");
6368 }
6369 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6370 |bytes, handles| {
6371 match this.inner.channel().read_etc(cx, bytes, handles) {
6372 std::task::Poll::Ready(Ok(())) => {}
6373 std::task::Poll::Pending => return std::task::Poll::Pending,
6374 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6375 this.is_terminated = true;
6376 return std::task::Poll::Ready(None);
6377 }
6378 std::task::Poll::Ready(Err(e)) => {
6379 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6380 e.into(),
6381 ))))
6382 }
6383 }
6384
6385 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6387
6388 std::task::Poll::Ready(Some(match header.ordinal {
6389 0x5502086bc0cdd25e => {
6390 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6391 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
6392 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6393 let control_handle = RepositoryIteratorControlHandle {
6394 inner: this.inner.clone(),
6395 };
6396 Ok(RepositoryIteratorRequest::Next {
6397 responder: RepositoryIteratorNextResponder {
6398 control_handle: std::mem::ManuallyDrop::new(control_handle),
6399 tx_id: header.tx_id,
6400 },
6401 })
6402 }
6403 _ => Err(fidl::Error::UnknownOrdinal {
6404 ordinal: header.ordinal,
6405 protocol_name: <RepositoryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6406 }),
6407 }))
6408 },
6409 )
6410 }
6411}
6412
6413#[derive(Debug)]
6415pub enum RepositoryIteratorRequest {
6416 Next { responder: RepositoryIteratorNextResponder },
6421}
6422
6423impl RepositoryIteratorRequest {
6424 #[allow(irrefutable_let_patterns)]
6425 pub fn into_next(self) -> Option<(RepositoryIteratorNextResponder)> {
6426 if let RepositoryIteratorRequest::Next { responder } = self {
6427 Some((responder))
6428 } else {
6429 None
6430 }
6431 }
6432
6433 pub fn method_name(&self) -> &'static str {
6435 match *self {
6436 RepositoryIteratorRequest::Next { .. } => "next",
6437 }
6438 }
6439}
6440
6441#[derive(Debug, Clone)]
6442pub struct RepositoryIteratorControlHandle {
6443 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6444}
6445
6446impl fidl::endpoints::ControlHandle for RepositoryIteratorControlHandle {
6447 fn shutdown(&self) {
6448 self.inner.shutdown()
6449 }
6450 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6451 self.inner.shutdown_with_epitaph(status)
6452 }
6453
6454 fn is_closed(&self) -> bool {
6455 self.inner.channel().is_closed()
6456 }
6457 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6458 self.inner.channel().on_closed()
6459 }
6460
6461 #[cfg(target_os = "fuchsia")]
6462 fn signal_peer(
6463 &self,
6464 clear_mask: zx::Signals,
6465 set_mask: zx::Signals,
6466 ) -> Result<(), zx_status::Status> {
6467 use fidl::Peered;
6468 self.inner.channel().signal_peer(clear_mask, set_mask)
6469 }
6470}
6471
6472impl RepositoryIteratorControlHandle {}
6473
6474#[must_use = "FIDL methods require a response to be sent"]
6475#[derive(Debug)]
6476pub struct RepositoryIteratorNextResponder {
6477 control_handle: std::mem::ManuallyDrop<RepositoryIteratorControlHandle>,
6478 tx_id: u32,
6479}
6480
6481impl std::ops::Drop for RepositoryIteratorNextResponder {
6485 fn drop(&mut self) {
6486 self.control_handle.shutdown();
6487 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6489 }
6490}
6491
6492impl fidl::endpoints::Responder for RepositoryIteratorNextResponder {
6493 type ControlHandle = RepositoryIteratorControlHandle;
6494
6495 fn control_handle(&self) -> &RepositoryIteratorControlHandle {
6496 &self.control_handle
6497 }
6498
6499 fn drop_without_shutdown(mut self) {
6500 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6502 std::mem::forget(self);
6504 }
6505}
6506
6507impl RepositoryIteratorNextResponder {
6508 pub fn send(self, mut repos: &[RepositoryConfig]) -> Result<(), fidl::Error> {
6512 let _result = self.send_raw(repos);
6513 if _result.is_err() {
6514 self.control_handle.shutdown();
6515 }
6516 self.drop_without_shutdown();
6517 _result
6518 }
6519
6520 pub fn send_no_shutdown_on_err(
6522 self,
6523 mut repos: &[RepositoryConfig],
6524 ) -> Result<(), fidl::Error> {
6525 let _result = self.send_raw(repos);
6526 self.drop_without_shutdown();
6527 _result
6528 }
6529
6530 fn send_raw(&self, mut repos: &[RepositoryConfig]) -> Result<(), fidl::Error> {
6531 self.control_handle.inner.send::<RepositoryIteratorNextResponse>(
6532 (repos,),
6533 self.tx_id,
6534 0x5502086bc0cdd25e,
6535 fidl::encoding::DynamicFlags::empty(),
6536 )
6537 }
6538}
6539
6540#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6541pub struct RepositoryManagerMarker;
6542
6543impl fidl::endpoints::ProtocolMarker for RepositoryManagerMarker {
6544 type Proxy = RepositoryManagerProxy;
6545 type RequestStream = RepositoryManagerRequestStream;
6546 #[cfg(target_os = "fuchsia")]
6547 type SynchronousProxy = RepositoryManagerSynchronousProxy;
6548
6549 const DEBUG_NAME: &'static str = "fuchsia.pkg.RepositoryManager";
6550}
6551impl fidl::endpoints::DiscoverableProtocolMarker for RepositoryManagerMarker {}
6552pub type RepositoryManagerAddResult = Result<(), i32>;
6553pub type RepositoryManagerRemoveResult = Result<(), i32>;
6554pub type RepositoryManagerAddMirrorResult = Result<(), i32>;
6555pub type RepositoryManagerRemoveMirrorResult = Result<(), i32>;
6556
6557pub trait RepositoryManagerProxyInterface: Send + Sync {
6558 type AddResponseFut: std::future::Future<Output = Result<RepositoryManagerAddResult, fidl::Error>>
6559 + Send;
6560 fn r#add(&self, repo: &RepositoryConfig) -> Self::AddResponseFut;
6561 type RemoveResponseFut: std::future::Future<Output = Result<RepositoryManagerRemoveResult, fidl::Error>>
6562 + Send;
6563 fn r#remove(&self, repo_url: &str) -> Self::RemoveResponseFut;
6564 type AddMirrorResponseFut: std::future::Future<Output = Result<RepositoryManagerAddMirrorResult, fidl::Error>>
6565 + Send;
6566 fn r#add_mirror(&self, repo_url: &str, mirror: &MirrorConfig) -> Self::AddMirrorResponseFut;
6567 type RemoveMirrorResponseFut: std::future::Future<Output = Result<RepositoryManagerRemoveMirrorResult, fidl::Error>>
6568 + Send;
6569 fn r#remove_mirror(&self, repo_url: &str, mirror_url: &str) -> Self::RemoveMirrorResponseFut;
6570 fn r#list(
6571 &self,
6572 iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
6573 ) -> Result<(), fidl::Error>;
6574}
6575#[derive(Debug)]
6576#[cfg(target_os = "fuchsia")]
6577pub struct RepositoryManagerSynchronousProxy {
6578 client: fidl::client::sync::Client,
6579}
6580
6581#[cfg(target_os = "fuchsia")]
6582impl fidl::endpoints::SynchronousProxy for RepositoryManagerSynchronousProxy {
6583 type Proxy = RepositoryManagerProxy;
6584 type Protocol = RepositoryManagerMarker;
6585
6586 fn from_channel(inner: fidl::Channel) -> Self {
6587 Self::new(inner)
6588 }
6589
6590 fn into_channel(self) -> fidl::Channel {
6591 self.client.into_channel()
6592 }
6593
6594 fn as_channel(&self) -> &fidl::Channel {
6595 self.client.as_channel()
6596 }
6597}
6598
6599#[cfg(target_os = "fuchsia")]
6600impl RepositoryManagerSynchronousProxy {
6601 pub fn new(channel: fidl::Channel) -> Self {
6602 let protocol_name =
6603 <RepositoryManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6604 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6605 }
6606
6607 pub fn into_channel(self) -> fidl::Channel {
6608 self.client.into_channel()
6609 }
6610
6611 pub fn wait_for_event(
6614 &self,
6615 deadline: zx::MonotonicInstant,
6616 ) -> Result<RepositoryManagerEvent, fidl::Error> {
6617 RepositoryManagerEvent::decode(self.client.wait_for_event(deadline)?)
6618 }
6619
6620 pub fn r#add(
6628 &self,
6629 mut repo: &RepositoryConfig,
6630 ___deadline: zx::MonotonicInstant,
6631 ) -> Result<RepositoryManagerAddResult, fidl::Error> {
6632 let _response = self.client.send_query::<
6633 RepositoryManagerAddRequest,
6634 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6635 >(
6636 (repo,),
6637 0x7fff4b8c733c7151,
6638 fidl::encoding::DynamicFlags::empty(),
6639 ___deadline,
6640 )?;
6641 Ok(_response.map(|x| x))
6642 }
6643
6644 pub fn r#remove(
6656 &self,
6657 mut repo_url: &str,
6658 ___deadline: zx::MonotonicInstant,
6659 ) -> Result<RepositoryManagerRemoveResult, fidl::Error> {
6660 let _response = self.client.send_query::<
6661 RepositoryManagerRemoveRequest,
6662 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6663 >(
6664 (repo_url,),
6665 0x5de23dc0e0dea4ba,
6666 fidl::encoding::DynamicFlags::empty(),
6667 ___deadline,
6668 )?;
6669 Ok(_response.map(|x| x))
6670 }
6671
6672 pub fn r#add_mirror(
6681 &self,
6682 mut repo_url: &str,
6683 mut mirror: &MirrorConfig,
6684 ___deadline: zx::MonotonicInstant,
6685 ) -> Result<RepositoryManagerAddMirrorResult, fidl::Error> {
6686 let _response = self.client.send_query::<
6687 RepositoryManagerAddMirrorRequest,
6688 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6689 >(
6690 (repo_url, mirror,),
6691 0x3b7ef213730dd24c,
6692 fidl::encoding::DynamicFlags::empty(),
6693 ___deadline,
6694 )?;
6695 Ok(_response.map(|x| x))
6696 }
6697
6698 pub fn r#remove_mirror(
6709 &self,
6710 mut repo_url: &str,
6711 mut mirror_url: &str,
6712 ___deadline: zx::MonotonicInstant,
6713 ) -> Result<RepositoryManagerRemoveMirrorResult, fidl::Error> {
6714 let _response = self.client.send_query::<
6715 RepositoryManagerRemoveMirrorRequest,
6716 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6717 >(
6718 (repo_url, mirror_url,),
6719 0x4682584cc47c23a2,
6720 fidl::encoding::DynamicFlags::empty(),
6721 ___deadline,
6722 )?;
6723 Ok(_response.map(|x| x))
6724 }
6725
6726 pub fn r#list(
6730 &self,
6731 mut iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
6732 ) -> Result<(), fidl::Error> {
6733 self.client.send::<RepositoryManagerListRequest>(
6734 (iterator,),
6735 0x61837314ba6f4afb,
6736 fidl::encoding::DynamicFlags::empty(),
6737 )
6738 }
6739}
6740
6741#[cfg(target_os = "fuchsia")]
6742impl From<RepositoryManagerSynchronousProxy> for zx::Handle {
6743 fn from(value: RepositoryManagerSynchronousProxy) -> Self {
6744 value.into_channel().into()
6745 }
6746}
6747
6748#[cfg(target_os = "fuchsia")]
6749impl From<fidl::Channel> for RepositoryManagerSynchronousProxy {
6750 fn from(value: fidl::Channel) -> Self {
6751 Self::new(value)
6752 }
6753}
6754
6755#[derive(Debug, Clone)]
6756pub struct RepositoryManagerProxy {
6757 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6758}
6759
6760impl fidl::endpoints::Proxy for RepositoryManagerProxy {
6761 type Protocol = RepositoryManagerMarker;
6762
6763 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6764 Self::new(inner)
6765 }
6766
6767 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6768 self.client.into_channel().map_err(|client| Self { client })
6769 }
6770
6771 fn as_channel(&self) -> &::fidl::AsyncChannel {
6772 self.client.as_channel()
6773 }
6774}
6775
6776impl RepositoryManagerProxy {
6777 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6779 let protocol_name =
6780 <RepositoryManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6781 Self { client: fidl::client::Client::new(channel, protocol_name) }
6782 }
6783
6784 pub fn take_event_stream(&self) -> RepositoryManagerEventStream {
6790 RepositoryManagerEventStream { event_receiver: self.client.take_event_receiver() }
6791 }
6792
6793 pub fn r#add(
6801 &self,
6802 mut repo: &RepositoryConfig,
6803 ) -> fidl::client::QueryResponseFut<
6804 RepositoryManagerAddResult,
6805 fidl::encoding::DefaultFuchsiaResourceDialect,
6806 > {
6807 RepositoryManagerProxyInterface::r#add(self, repo)
6808 }
6809
6810 pub fn r#remove(
6822 &self,
6823 mut repo_url: &str,
6824 ) -> fidl::client::QueryResponseFut<
6825 RepositoryManagerRemoveResult,
6826 fidl::encoding::DefaultFuchsiaResourceDialect,
6827 > {
6828 RepositoryManagerProxyInterface::r#remove(self, repo_url)
6829 }
6830
6831 pub fn r#add_mirror(
6840 &self,
6841 mut repo_url: &str,
6842 mut mirror: &MirrorConfig,
6843 ) -> fidl::client::QueryResponseFut<
6844 RepositoryManagerAddMirrorResult,
6845 fidl::encoding::DefaultFuchsiaResourceDialect,
6846 > {
6847 RepositoryManagerProxyInterface::r#add_mirror(self, repo_url, mirror)
6848 }
6849
6850 pub fn r#remove_mirror(
6861 &self,
6862 mut repo_url: &str,
6863 mut mirror_url: &str,
6864 ) -> fidl::client::QueryResponseFut<
6865 RepositoryManagerRemoveMirrorResult,
6866 fidl::encoding::DefaultFuchsiaResourceDialect,
6867 > {
6868 RepositoryManagerProxyInterface::r#remove_mirror(self, repo_url, mirror_url)
6869 }
6870
6871 pub fn r#list(
6875 &self,
6876 mut iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
6877 ) -> Result<(), fidl::Error> {
6878 RepositoryManagerProxyInterface::r#list(self, iterator)
6879 }
6880}
6881
6882impl RepositoryManagerProxyInterface for RepositoryManagerProxy {
6883 type AddResponseFut = fidl::client::QueryResponseFut<
6884 RepositoryManagerAddResult,
6885 fidl::encoding::DefaultFuchsiaResourceDialect,
6886 >;
6887 fn r#add(&self, mut repo: &RepositoryConfig) -> Self::AddResponseFut {
6888 fn _decode(
6889 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6890 ) -> Result<RepositoryManagerAddResult, fidl::Error> {
6891 let _response = fidl::client::decode_transaction_body::<
6892 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6893 fidl::encoding::DefaultFuchsiaResourceDialect,
6894 0x7fff4b8c733c7151,
6895 >(_buf?)?;
6896 Ok(_response.map(|x| x))
6897 }
6898 self.client
6899 .send_query_and_decode::<RepositoryManagerAddRequest, RepositoryManagerAddResult>(
6900 (repo,),
6901 0x7fff4b8c733c7151,
6902 fidl::encoding::DynamicFlags::empty(),
6903 _decode,
6904 )
6905 }
6906
6907 type RemoveResponseFut = fidl::client::QueryResponseFut<
6908 RepositoryManagerRemoveResult,
6909 fidl::encoding::DefaultFuchsiaResourceDialect,
6910 >;
6911 fn r#remove(&self, mut repo_url: &str) -> Self::RemoveResponseFut {
6912 fn _decode(
6913 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6914 ) -> Result<RepositoryManagerRemoveResult, fidl::Error> {
6915 let _response = fidl::client::decode_transaction_body::<
6916 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6917 fidl::encoding::DefaultFuchsiaResourceDialect,
6918 0x5de23dc0e0dea4ba,
6919 >(_buf?)?;
6920 Ok(_response.map(|x| x))
6921 }
6922 self.client
6923 .send_query_and_decode::<RepositoryManagerRemoveRequest, RepositoryManagerRemoveResult>(
6924 (repo_url,),
6925 0x5de23dc0e0dea4ba,
6926 fidl::encoding::DynamicFlags::empty(),
6927 _decode,
6928 )
6929 }
6930
6931 type AddMirrorResponseFut = fidl::client::QueryResponseFut<
6932 RepositoryManagerAddMirrorResult,
6933 fidl::encoding::DefaultFuchsiaResourceDialect,
6934 >;
6935 fn r#add_mirror(
6936 &self,
6937 mut repo_url: &str,
6938 mut mirror: &MirrorConfig,
6939 ) -> Self::AddMirrorResponseFut {
6940 fn _decode(
6941 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6942 ) -> Result<RepositoryManagerAddMirrorResult, fidl::Error> {
6943 let _response = fidl::client::decode_transaction_body::<
6944 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6945 fidl::encoding::DefaultFuchsiaResourceDialect,
6946 0x3b7ef213730dd24c,
6947 >(_buf?)?;
6948 Ok(_response.map(|x| x))
6949 }
6950 self.client.send_query_and_decode::<
6951 RepositoryManagerAddMirrorRequest,
6952 RepositoryManagerAddMirrorResult,
6953 >(
6954 (repo_url, mirror,),
6955 0x3b7ef213730dd24c,
6956 fidl::encoding::DynamicFlags::empty(),
6957 _decode,
6958 )
6959 }
6960
6961 type RemoveMirrorResponseFut = fidl::client::QueryResponseFut<
6962 RepositoryManagerRemoveMirrorResult,
6963 fidl::encoding::DefaultFuchsiaResourceDialect,
6964 >;
6965 fn r#remove_mirror(
6966 &self,
6967 mut repo_url: &str,
6968 mut mirror_url: &str,
6969 ) -> Self::RemoveMirrorResponseFut {
6970 fn _decode(
6971 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6972 ) -> Result<RepositoryManagerRemoveMirrorResult, fidl::Error> {
6973 let _response = fidl::client::decode_transaction_body::<
6974 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6975 fidl::encoding::DefaultFuchsiaResourceDialect,
6976 0x4682584cc47c23a2,
6977 >(_buf?)?;
6978 Ok(_response.map(|x| x))
6979 }
6980 self.client.send_query_and_decode::<
6981 RepositoryManagerRemoveMirrorRequest,
6982 RepositoryManagerRemoveMirrorResult,
6983 >(
6984 (repo_url, mirror_url,),
6985 0x4682584cc47c23a2,
6986 fidl::encoding::DynamicFlags::empty(),
6987 _decode,
6988 )
6989 }
6990
6991 fn r#list(
6992 &self,
6993 mut iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
6994 ) -> Result<(), fidl::Error> {
6995 self.client.send::<RepositoryManagerListRequest>(
6996 (iterator,),
6997 0x61837314ba6f4afb,
6998 fidl::encoding::DynamicFlags::empty(),
6999 )
7000 }
7001}
7002
7003pub struct RepositoryManagerEventStream {
7004 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7005}
7006
7007impl std::marker::Unpin for RepositoryManagerEventStream {}
7008
7009impl futures::stream::FusedStream for RepositoryManagerEventStream {
7010 fn is_terminated(&self) -> bool {
7011 self.event_receiver.is_terminated()
7012 }
7013}
7014
7015impl futures::Stream for RepositoryManagerEventStream {
7016 type Item = Result<RepositoryManagerEvent, fidl::Error>;
7017
7018 fn poll_next(
7019 mut self: std::pin::Pin<&mut Self>,
7020 cx: &mut std::task::Context<'_>,
7021 ) -> std::task::Poll<Option<Self::Item>> {
7022 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7023 &mut self.event_receiver,
7024 cx
7025 )?) {
7026 Some(buf) => std::task::Poll::Ready(Some(RepositoryManagerEvent::decode(buf))),
7027 None => std::task::Poll::Ready(None),
7028 }
7029 }
7030}
7031
7032#[derive(Debug)]
7033pub enum RepositoryManagerEvent {}
7034
7035impl RepositoryManagerEvent {
7036 fn decode(
7038 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7039 ) -> Result<RepositoryManagerEvent, fidl::Error> {
7040 let (bytes, _handles) = buf.split_mut();
7041 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7042 debug_assert_eq!(tx_header.tx_id, 0);
7043 match tx_header.ordinal {
7044 _ => Err(fidl::Error::UnknownOrdinal {
7045 ordinal: tx_header.ordinal,
7046 protocol_name:
7047 <RepositoryManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7048 }),
7049 }
7050 }
7051}
7052
7053pub struct RepositoryManagerRequestStream {
7055 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7056 is_terminated: bool,
7057}
7058
7059impl std::marker::Unpin for RepositoryManagerRequestStream {}
7060
7061impl futures::stream::FusedStream for RepositoryManagerRequestStream {
7062 fn is_terminated(&self) -> bool {
7063 self.is_terminated
7064 }
7065}
7066
7067impl fidl::endpoints::RequestStream for RepositoryManagerRequestStream {
7068 type Protocol = RepositoryManagerMarker;
7069 type ControlHandle = RepositoryManagerControlHandle;
7070
7071 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7072 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7073 }
7074
7075 fn control_handle(&self) -> Self::ControlHandle {
7076 RepositoryManagerControlHandle { inner: self.inner.clone() }
7077 }
7078
7079 fn into_inner(
7080 self,
7081 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7082 {
7083 (self.inner, self.is_terminated)
7084 }
7085
7086 fn from_inner(
7087 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7088 is_terminated: bool,
7089 ) -> Self {
7090 Self { inner, is_terminated }
7091 }
7092}
7093
7094impl futures::Stream for RepositoryManagerRequestStream {
7095 type Item = Result<RepositoryManagerRequest, fidl::Error>;
7096
7097 fn poll_next(
7098 mut self: std::pin::Pin<&mut Self>,
7099 cx: &mut std::task::Context<'_>,
7100 ) -> std::task::Poll<Option<Self::Item>> {
7101 let this = &mut *self;
7102 if this.inner.check_shutdown(cx) {
7103 this.is_terminated = true;
7104 return std::task::Poll::Ready(None);
7105 }
7106 if this.is_terminated {
7107 panic!("polled RepositoryManagerRequestStream after completion");
7108 }
7109 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7110 |bytes, handles| {
7111 match this.inner.channel().read_etc(cx, bytes, handles) {
7112 std::task::Poll::Ready(Ok(())) => {}
7113 std::task::Poll::Pending => return std::task::Poll::Pending,
7114 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7115 this.is_terminated = true;
7116 return std::task::Poll::Ready(None);
7117 }
7118 std::task::Poll::Ready(Err(e)) => {
7119 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7120 e.into(),
7121 ))))
7122 }
7123 }
7124
7125 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7127
7128 std::task::Poll::Ready(Some(match header.ordinal {
7129 0x7fff4b8c733c7151 => {
7130 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7131 let mut req = fidl::new_empty!(
7132 RepositoryManagerAddRequest,
7133 fidl::encoding::DefaultFuchsiaResourceDialect
7134 );
7135 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerAddRequest>(&header, _body_bytes, handles, &mut req)?;
7136 let control_handle =
7137 RepositoryManagerControlHandle { inner: this.inner.clone() };
7138 Ok(RepositoryManagerRequest::Add {
7139 repo: req.repo,
7140
7141 responder: RepositoryManagerAddResponder {
7142 control_handle: std::mem::ManuallyDrop::new(control_handle),
7143 tx_id: header.tx_id,
7144 },
7145 })
7146 }
7147 0x5de23dc0e0dea4ba => {
7148 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7149 let mut req = fidl::new_empty!(
7150 RepositoryManagerRemoveRequest,
7151 fidl::encoding::DefaultFuchsiaResourceDialect
7152 );
7153 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
7154 let control_handle =
7155 RepositoryManagerControlHandle { inner: this.inner.clone() };
7156 Ok(RepositoryManagerRequest::Remove {
7157 repo_url: req.repo_url,
7158
7159 responder: RepositoryManagerRemoveResponder {
7160 control_handle: std::mem::ManuallyDrop::new(control_handle),
7161 tx_id: header.tx_id,
7162 },
7163 })
7164 }
7165 0x3b7ef213730dd24c => {
7166 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7167 let mut req = fidl::new_empty!(
7168 RepositoryManagerAddMirrorRequest,
7169 fidl::encoding::DefaultFuchsiaResourceDialect
7170 );
7171 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerAddMirrorRequest>(&header, _body_bytes, handles, &mut req)?;
7172 let control_handle =
7173 RepositoryManagerControlHandle { inner: this.inner.clone() };
7174 Ok(RepositoryManagerRequest::AddMirror {
7175 repo_url: req.repo_url,
7176 mirror: req.mirror,
7177
7178 responder: RepositoryManagerAddMirrorResponder {
7179 control_handle: std::mem::ManuallyDrop::new(control_handle),
7180 tx_id: header.tx_id,
7181 },
7182 })
7183 }
7184 0x4682584cc47c23a2 => {
7185 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7186 let mut req = fidl::new_empty!(
7187 RepositoryManagerRemoveMirrorRequest,
7188 fidl::encoding::DefaultFuchsiaResourceDialect
7189 );
7190 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerRemoveMirrorRequest>(&header, _body_bytes, handles, &mut req)?;
7191 let control_handle =
7192 RepositoryManagerControlHandle { inner: this.inner.clone() };
7193 Ok(RepositoryManagerRequest::RemoveMirror {
7194 repo_url: req.repo_url,
7195 mirror_url: req.mirror_url,
7196
7197 responder: RepositoryManagerRemoveMirrorResponder {
7198 control_handle: std::mem::ManuallyDrop::new(control_handle),
7199 tx_id: header.tx_id,
7200 },
7201 })
7202 }
7203 0x61837314ba6f4afb => {
7204 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
7205 let mut req = fidl::new_empty!(
7206 RepositoryManagerListRequest,
7207 fidl::encoding::DefaultFuchsiaResourceDialect
7208 );
7209 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RepositoryManagerListRequest>(&header, _body_bytes, handles, &mut req)?;
7210 let control_handle =
7211 RepositoryManagerControlHandle { inner: this.inner.clone() };
7212 Ok(RepositoryManagerRequest::List {
7213 iterator: req.iterator,
7214
7215 control_handle,
7216 })
7217 }
7218 _ => Err(fidl::Error::UnknownOrdinal {
7219 ordinal: header.ordinal,
7220 protocol_name:
7221 <RepositoryManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7222 }),
7223 }))
7224 },
7225 )
7226 }
7227}
7228
7229#[derive(Debug)]
7234pub enum RepositoryManagerRequest {
7235 Add { repo: RepositoryConfig, responder: RepositoryManagerAddResponder },
7243 Remove { repo_url: String, responder: RepositoryManagerRemoveResponder },
7255 AddMirror {
7264 repo_url: String,
7265 mirror: MirrorConfig,
7266 responder: RepositoryManagerAddMirrorResponder,
7267 },
7268 RemoveMirror {
7279 repo_url: String,
7280 mirror_url: String,
7281 responder: RepositoryManagerRemoveMirrorResponder,
7282 },
7283 List {
7287 iterator: fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
7288 control_handle: RepositoryManagerControlHandle,
7289 },
7290}
7291
7292impl RepositoryManagerRequest {
7293 #[allow(irrefutable_let_patterns)]
7294 pub fn into_add(self) -> Option<(RepositoryConfig, RepositoryManagerAddResponder)> {
7295 if let RepositoryManagerRequest::Add { repo, responder } = self {
7296 Some((repo, responder))
7297 } else {
7298 None
7299 }
7300 }
7301
7302 #[allow(irrefutable_let_patterns)]
7303 pub fn into_remove(self) -> Option<(String, RepositoryManagerRemoveResponder)> {
7304 if let RepositoryManagerRequest::Remove { repo_url, responder } = self {
7305 Some((repo_url, responder))
7306 } else {
7307 None
7308 }
7309 }
7310
7311 #[allow(irrefutable_let_patterns)]
7312 pub fn into_add_mirror(
7313 self,
7314 ) -> Option<(String, MirrorConfig, RepositoryManagerAddMirrorResponder)> {
7315 if let RepositoryManagerRequest::AddMirror { repo_url, mirror, responder } = self {
7316 Some((repo_url, mirror, responder))
7317 } else {
7318 None
7319 }
7320 }
7321
7322 #[allow(irrefutable_let_patterns)]
7323 pub fn into_remove_mirror(
7324 self,
7325 ) -> Option<(String, String, RepositoryManagerRemoveMirrorResponder)> {
7326 if let RepositoryManagerRequest::RemoveMirror { repo_url, mirror_url, responder } = self {
7327 Some((repo_url, mirror_url, responder))
7328 } else {
7329 None
7330 }
7331 }
7332
7333 #[allow(irrefutable_let_patterns)]
7334 pub fn into_list(
7335 self,
7336 ) -> Option<(
7337 fidl::endpoints::ServerEnd<RepositoryIteratorMarker>,
7338 RepositoryManagerControlHandle,
7339 )> {
7340 if let RepositoryManagerRequest::List { iterator, control_handle } = self {
7341 Some((iterator, control_handle))
7342 } else {
7343 None
7344 }
7345 }
7346
7347 pub fn method_name(&self) -> &'static str {
7349 match *self {
7350 RepositoryManagerRequest::Add { .. } => "add",
7351 RepositoryManagerRequest::Remove { .. } => "remove",
7352 RepositoryManagerRequest::AddMirror { .. } => "add_mirror",
7353 RepositoryManagerRequest::RemoveMirror { .. } => "remove_mirror",
7354 RepositoryManagerRequest::List { .. } => "list",
7355 }
7356 }
7357}
7358
7359#[derive(Debug, Clone)]
7360pub struct RepositoryManagerControlHandle {
7361 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7362}
7363
7364impl fidl::endpoints::ControlHandle for RepositoryManagerControlHandle {
7365 fn shutdown(&self) {
7366 self.inner.shutdown()
7367 }
7368 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7369 self.inner.shutdown_with_epitaph(status)
7370 }
7371
7372 fn is_closed(&self) -> bool {
7373 self.inner.channel().is_closed()
7374 }
7375 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7376 self.inner.channel().on_closed()
7377 }
7378
7379 #[cfg(target_os = "fuchsia")]
7380 fn signal_peer(
7381 &self,
7382 clear_mask: zx::Signals,
7383 set_mask: zx::Signals,
7384 ) -> Result<(), zx_status::Status> {
7385 use fidl::Peered;
7386 self.inner.channel().signal_peer(clear_mask, set_mask)
7387 }
7388}
7389
7390impl RepositoryManagerControlHandle {}
7391
7392#[must_use = "FIDL methods require a response to be sent"]
7393#[derive(Debug)]
7394pub struct RepositoryManagerAddResponder {
7395 control_handle: std::mem::ManuallyDrop<RepositoryManagerControlHandle>,
7396 tx_id: u32,
7397}
7398
7399impl std::ops::Drop for RepositoryManagerAddResponder {
7403 fn drop(&mut self) {
7404 self.control_handle.shutdown();
7405 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7407 }
7408}
7409
7410impl fidl::endpoints::Responder for RepositoryManagerAddResponder {
7411 type ControlHandle = RepositoryManagerControlHandle;
7412
7413 fn control_handle(&self) -> &RepositoryManagerControlHandle {
7414 &self.control_handle
7415 }
7416
7417 fn drop_without_shutdown(mut self) {
7418 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7420 std::mem::forget(self);
7422 }
7423}
7424
7425impl RepositoryManagerAddResponder {
7426 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7430 let _result = self.send_raw(result);
7431 if _result.is_err() {
7432 self.control_handle.shutdown();
7433 }
7434 self.drop_without_shutdown();
7435 _result
7436 }
7437
7438 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7440 let _result = self.send_raw(result);
7441 self.drop_without_shutdown();
7442 _result
7443 }
7444
7445 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7446 self.control_handle
7447 .inner
7448 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7449 result,
7450 self.tx_id,
7451 0x7fff4b8c733c7151,
7452 fidl::encoding::DynamicFlags::empty(),
7453 )
7454 }
7455}
7456
7457#[must_use = "FIDL methods require a response to be sent"]
7458#[derive(Debug)]
7459pub struct RepositoryManagerRemoveResponder {
7460 control_handle: std::mem::ManuallyDrop<RepositoryManagerControlHandle>,
7461 tx_id: u32,
7462}
7463
7464impl std::ops::Drop for RepositoryManagerRemoveResponder {
7468 fn drop(&mut self) {
7469 self.control_handle.shutdown();
7470 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7472 }
7473}
7474
7475impl fidl::endpoints::Responder for RepositoryManagerRemoveResponder {
7476 type ControlHandle = RepositoryManagerControlHandle;
7477
7478 fn control_handle(&self) -> &RepositoryManagerControlHandle {
7479 &self.control_handle
7480 }
7481
7482 fn drop_without_shutdown(mut self) {
7483 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7485 std::mem::forget(self);
7487 }
7488}
7489
7490impl RepositoryManagerRemoveResponder {
7491 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7495 let _result = self.send_raw(result);
7496 if _result.is_err() {
7497 self.control_handle.shutdown();
7498 }
7499 self.drop_without_shutdown();
7500 _result
7501 }
7502
7503 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7505 let _result = self.send_raw(result);
7506 self.drop_without_shutdown();
7507 _result
7508 }
7509
7510 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7511 self.control_handle
7512 .inner
7513 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7514 result,
7515 self.tx_id,
7516 0x5de23dc0e0dea4ba,
7517 fidl::encoding::DynamicFlags::empty(),
7518 )
7519 }
7520}
7521
7522#[must_use = "FIDL methods require a response to be sent"]
7523#[derive(Debug)]
7524pub struct RepositoryManagerAddMirrorResponder {
7525 control_handle: std::mem::ManuallyDrop<RepositoryManagerControlHandle>,
7526 tx_id: u32,
7527}
7528
7529impl std::ops::Drop for RepositoryManagerAddMirrorResponder {
7533 fn drop(&mut self) {
7534 self.control_handle.shutdown();
7535 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7537 }
7538}
7539
7540impl fidl::endpoints::Responder for RepositoryManagerAddMirrorResponder {
7541 type ControlHandle = RepositoryManagerControlHandle;
7542
7543 fn control_handle(&self) -> &RepositoryManagerControlHandle {
7544 &self.control_handle
7545 }
7546
7547 fn drop_without_shutdown(mut self) {
7548 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7550 std::mem::forget(self);
7552 }
7553}
7554
7555impl RepositoryManagerAddMirrorResponder {
7556 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7560 let _result = self.send_raw(result);
7561 if _result.is_err() {
7562 self.control_handle.shutdown();
7563 }
7564 self.drop_without_shutdown();
7565 _result
7566 }
7567
7568 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7570 let _result = self.send_raw(result);
7571 self.drop_without_shutdown();
7572 _result
7573 }
7574
7575 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7576 self.control_handle
7577 .inner
7578 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7579 result,
7580 self.tx_id,
7581 0x3b7ef213730dd24c,
7582 fidl::encoding::DynamicFlags::empty(),
7583 )
7584 }
7585}
7586
7587#[must_use = "FIDL methods require a response to be sent"]
7588#[derive(Debug)]
7589pub struct RepositoryManagerRemoveMirrorResponder {
7590 control_handle: std::mem::ManuallyDrop<RepositoryManagerControlHandle>,
7591 tx_id: u32,
7592}
7593
7594impl std::ops::Drop for RepositoryManagerRemoveMirrorResponder {
7598 fn drop(&mut self) {
7599 self.control_handle.shutdown();
7600 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7602 }
7603}
7604
7605impl fidl::endpoints::Responder for RepositoryManagerRemoveMirrorResponder {
7606 type ControlHandle = RepositoryManagerControlHandle;
7607
7608 fn control_handle(&self) -> &RepositoryManagerControlHandle {
7609 &self.control_handle
7610 }
7611
7612 fn drop_without_shutdown(mut self) {
7613 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7615 std::mem::forget(self);
7617 }
7618}
7619
7620impl RepositoryManagerRemoveMirrorResponder {
7621 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7625 let _result = self.send_raw(result);
7626 if _result.is_err() {
7627 self.control_handle.shutdown();
7628 }
7629 self.drop_without_shutdown();
7630 _result
7631 }
7632
7633 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7635 let _result = self.send_raw(result);
7636 self.drop_without_shutdown();
7637 _result
7638 }
7639
7640 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7641 self.control_handle
7642 .inner
7643 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7644 result,
7645 self.tx_id,
7646 0x4682584cc47c23a2,
7647 fidl::encoding::DynamicFlags::empty(),
7648 )
7649 }
7650}
7651
7652#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7653pub struct RetainedPackagesMarker;
7654
7655impl fidl::endpoints::ProtocolMarker for RetainedPackagesMarker {
7656 type Proxy = RetainedPackagesProxy;
7657 type RequestStream = RetainedPackagesRequestStream;
7658 #[cfg(target_os = "fuchsia")]
7659 type SynchronousProxy = RetainedPackagesSynchronousProxy;
7660
7661 const DEBUG_NAME: &'static str = "fuchsia.pkg.RetainedPackages";
7662}
7663impl fidl::endpoints::DiscoverableProtocolMarker for RetainedPackagesMarker {}
7664
7665pub trait RetainedPackagesProxyInterface: Send + Sync {
7666 type ClearResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
7667 fn r#clear(&self) -> Self::ClearResponseFut;
7668 type ReplaceResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
7669 fn r#replace(
7670 &self,
7671 iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
7672 ) -> Self::ReplaceResponseFut;
7673}
7674#[derive(Debug)]
7675#[cfg(target_os = "fuchsia")]
7676pub struct RetainedPackagesSynchronousProxy {
7677 client: fidl::client::sync::Client,
7678}
7679
7680#[cfg(target_os = "fuchsia")]
7681impl fidl::endpoints::SynchronousProxy for RetainedPackagesSynchronousProxy {
7682 type Proxy = RetainedPackagesProxy;
7683 type Protocol = RetainedPackagesMarker;
7684
7685 fn from_channel(inner: fidl::Channel) -> Self {
7686 Self::new(inner)
7687 }
7688
7689 fn into_channel(self) -> fidl::Channel {
7690 self.client.into_channel()
7691 }
7692
7693 fn as_channel(&self) -> &fidl::Channel {
7694 self.client.as_channel()
7695 }
7696}
7697
7698#[cfg(target_os = "fuchsia")]
7699impl RetainedPackagesSynchronousProxy {
7700 pub fn new(channel: fidl::Channel) -> Self {
7701 let protocol_name = <RetainedPackagesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7702 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7703 }
7704
7705 pub fn into_channel(self) -> fidl::Channel {
7706 self.client.into_channel()
7707 }
7708
7709 pub fn wait_for_event(
7712 &self,
7713 deadline: zx::MonotonicInstant,
7714 ) -> Result<RetainedPackagesEvent, fidl::Error> {
7715 RetainedPackagesEvent::decode(self.client.wait_for_event(deadline)?)
7716 }
7717
7718 pub fn r#clear(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
7721 let _response =
7722 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
7723 (),
7724 0x7f17476f097961ac,
7725 fidl::encoding::DynamicFlags::empty(),
7726 ___deadline,
7727 )?;
7728 Ok(_response)
7729 }
7730
7731 pub fn r#replace(
7739 &self,
7740 mut iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
7741 ___deadline: zx::MonotonicInstant,
7742 ) -> Result<(), fidl::Error> {
7743 let _response = self
7744 .client
7745 .send_query::<RetainedPackagesReplaceRequest, fidl::encoding::EmptyPayload>(
7746 (iterator,),
7747 0x5021e479570f3a9f,
7748 fidl::encoding::DynamicFlags::empty(),
7749 ___deadline,
7750 )?;
7751 Ok(_response)
7752 }
7753}
7754
7755#[cfg(target_os = "fuchsia")]
7756impl From<RetainedPackagesSynchronousProxy> for zx::Handle {
7757 fn from(value: RetainedPackagesSynchronousProxy) -> Self {
7758 value.into_channel().into()
7759 }
7760}
7761
7762#[cfg(target_os = "fuchsia")]
7763impl From<fidl::Channel> for RetainedPackagesSynchronousProxy {
7764 fn from(value: fidl::Channel) -> Self {
7765 Self::new(value)
7766 }
7767}
7768
7769#[derive(Debug, Clone)]
7770pub struct RetainedPackagesProxy {
7771 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7772}
7773
7774impl fidl::endpoints::Proxy for RetainedPackagesProxy {
7775 type Protocol = RetainedPackagesMarker;
7776
7777 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7778 Self::new(inner)
7779 }
7780
7781 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7782 self.client.into_channel().map_err(|client| Self { client })
7783 }
7784
7785 fn as_channel(&self) -> &::fidl::AsyncChannel {
7786 self.client.as_channel()
7787 }
7788}
7789
7790impl RetainedPackagesProxy {
7791 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7793 let protocol_name = <RetainedPackagesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7794 Self { client: fidl::client::Client::new(channel, protocol_name) }
7795 }
7796
7797 pub fn take_event_stream(&self) -> RetainedPackagesEventStream {
7803 RetainedPackagesEventStream { event_receiver: self.client.take_event_receiver() }
7804 }
7805
7806 pub fn r#clear(
7809 &self,
7810 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
7811 RetainedPackagesProxyInterface::r#clear(self)
7812 }
7813
7814 pub fn r#replace(
7822 &self,
7823 mut iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
7824 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
7825 RetainedPackagesProxyInterface::r#replace(self, iterator)
7826 }
7827}
7828
7829impl RetainedPackagesProxyInterface for RetainedPackagesProxy {
7830 type ClearResponseFut =
7831 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7832 fn r#clear(&self) -> Self::ClearResponseFut {
7833 fn _decode(
7834 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7835 ) -> Result<(), fidl::Error> {
7836 let _response = fidl::client::decode_transaction_body::<
7837 fidl::encoding::EmptyPayload,
7838 fidl::encoding::DefaultFuchsiaResourceDialect,
7839 0x7f17476f097961ac,
7840 >(_buf?)?;
7841 Ok(_response)
7842 }
7843 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
7844 (),
7845 0x7f17476f097961ac,
7846 fidl::encoding::DynamicFlags::empty(),
7847 _decode,
7848 )
7849 }
7850
7851 type ReplaceResponseFut =
7852 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
7853 fn r#replace(
7854 &self,
7855 mut iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
7856 ) -> Self::ReplaceResponseFut {
7857 fn _decode(
7858 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7859 ) -> Result<(), fidl::Error> {
7860 let _response = fidl::client::decode_transaction_body::<
7861 fidl::encoding::EmptyPayload,
7862 fidl::encoding::DefaultFuchsiaResourceDialect,
7863 0x5021e479570f3a9f,
7864 >(_buf?)?;
7865 Ok(_response)
7866 }
7867 self.client.send_query_and_decode::<RetainedPackagesReplaceRequest, ()>(
7868 (iterator,),
7869 0x5021e479570f3a9f,
7870 fidl::encoding::DynamicFlags::empty(),
7871 _decode,
7872 )
7873 }
7874}
7875
7876pub struct RetainedPackagesEventStream {
7877 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7878}
7879
7880impl std::marker::Unpin for RetainedPackagesEventStream {}
7881
7882impl futures::stream::FusedStream for RetainedPackagesEventStream {
7883 fn is_terminated(&self) -> bool {
7884 self.event_receiver.is_terminated()
7885 }
7886}
7887
7888impl futures::Stream for RetainedPackagesEventStream {
7889 type Item = Result<RetainedPackagesEvent, fidl::Error>;
7890
7891 fn poll_next(
7892 mut self: std::pin::Pin<&mut Self>,
7893 cx: &mut std::task::Context<'_>,
7894 ) -> std::task::Poll<Option<Self::Item>> {
7895 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7896 &mut self.event_receiver,
7897 cx
7898 )?) {
7899 Some(buf) => std::task::Poll::Ready(Some(RetainedPackagesEvent::decode(buf))),
7900 None => std::task::Poll::Ready(None),
7901 }
7902 }
7903}
7904
7905#[derive(Debug)]
7906pub enum RetainedPackagesEvent {}
7907
7908impl RetainedPackagesEvent {
7909 fn decode(
7911 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7912 ) -> Result<RetainedPackagesEvent, fidl::Error> {
7913 let (bytes, _handles) = buf.split_mut();
7914 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7915 debug_assert_eq!(tx_header.tx_id, 0);
7916 match tx_header.ordinal {
7917 _ => Err(fidl::Error::UnknownOrdinal {
7918 ordinal: tx_header.ordinal,
7919 protocol_name:
7920 <RetainedPackagesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7921 }),
7922 }
7923 }
7924}
7925
7926pub struct RetainedPackagesRequestStream {
7928 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7929 is_terminated: bool,
7930}
7931
7932impl std::marker::Unpin for RetainedPackagesRequestStream {}
7933
7934impl futures::stream::FusedStream for RetainedPackagesRequestStream {
7935 fn is_terminated(&self) -> bool {
7936 self.is_terminated
7937 }
7938}
7939
7940impl fidl::endpoints::RequestStream for RetainedPackagesRequestStream {
7941 type Protocol = RetainedPackagesMarker;
7942 type ControlHandle = RetainedPackagesControlHandle;
7943
7944 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7945 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7946 }
7947
7948 fn control_handle(&self) -> Self::ControlHandle {
7949 RetainedPackagesControlHandle { inner: self.inner.clone() }
7950 }
7951
7952 fn into_inner(
7953 self,
7954 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7955 {
7956 (self.inner, self.is_terminated)
7957 }
7958
7959 fn from_inner(
7960 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7961 is_terminated: bool,
7962 ) -> Self {
7963 Self { inner, is_terminated }
7964 }
7965}
7966
7967impl futures::Stream for RetainedPackagesRequestStream {
7968 type Item = Result<RetainedPackagesRequest, fidl::Error>;
7969
7970 fn poll_next(
7971 mut self: std::pin::Pin<&mut Self>,
7972 cx: &mut std::task::Context<'_>,
7973 ) -> std::task::Poll<Option<Self::Item>> {
7974 let this = &mut *self;
7975 if this.inner.check_shutdown(cx) {
7976 this.is_terminated = true;
7977 return std::task::Poll::Ready(None);
7978 }
7979 if this.is_terminated {
7980 panic!("polled RetainedPackagesRequestStream after completion");
7981 }
7982 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7983 |bytes, handles| {
7984 match this.inner.channel().read_etc(cx, bytes, handles) {
7985 std::task::Poll::Ready(Ok(())) => {}
7986 std::task::Poll::Pending => return std::task::Poll::Pending,
7987 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7988 this.is_terminated = true;
7989 return std::task::Poll::Ready(None);
7990 }
7991 std::task::Poll::Ready(Err(e)) => {
7992 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7993 e.into(),
7994 ))))
7995 }
7996 }
7997
7998 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8000
8001 std::task::Poll::Ready(Some(match header.ordinal {
8002 0x7f17476f097961ac => {
8003 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8004 let mut req = fidl::new_empty!(
8005 fidl::encoding::EmptyPayload,
8006 fidl::encoding::DefaultFuchsiaResourceDialect
8007 );
8008 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8009 let control_handle =
8010 RetainedPackagesControlHandle { inner: this.inner.clone() };
8011 Ok(RetainedPackagesRequest::Clear {
8012 responder: RetainedPackagesClearResponder {
8013 control_handle: std::mem::ManuallyDrop::new(control_handle),
8014 tx_id: header.tx_id,
8015 },
8016 })
8017 }
8018 0x5021e479570f3a9f => {
8019 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8020 let mut req = fidl::new_empty!(
8021 RetainedPackagesReplaceRequest,
8022 fidl::encoding::DefaultFuchsiaResourceDialect
8023 );
8024 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RetainedPackagesReplaceRequest>(&header, _body_bytes, handles, &mut req)?;
8025 let control_handle =
8026 RetainedPackagesControlHandle { inner: this.inner.clone() };
8027 Ok(RetainedPackagesRequest::Replace {
8028 iterator: req.iterator,
8029
8030 responder: RetainedPackagesReplaceResponder {
8031 control_handle: std::mem::ManuallyDrop::new(control_handle),
8032 tx_id: header.tx_id,
8033 },
8034 })
8035 }
8036 _ => Err(fidl::Error::UnknownOrdinal {
8037 ordinal: header.ordinal,
8038 protocol_name:
8039 <RetainedPackagesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8040 }),
8041 }))
8042 },
8043 )
8044 }
8045}
8046
8047#[derive(Debug)]
8058pub enum RetainedPackagesRequest {
8059 Clear { responder: RetainedPackagesClearResponder },
8062 Replace {
8070 iterator: fidl::endpoints::ClientEnd<BlobIdIteratorMarker>,
8071 responder: RetainedPackagesReplaceResponder,
8072 },
8073}
8074
8075impl RetainedPackagesRequest {
8076 #[allow(irrefutable_let_patterns)]
8077 pub fn into_clear(self) -> Option<(RetainedPackagesClearResponder)> {
8078 if let RetainedPackagesRequest::Clear { responder } = self {
8079 Some((responder))
8080 } else {
8081 None
8082 }
8083 }
8084
8085 #[allow(irrefutable_let_patterns)]
8086 pub fn into_replace(
8087 self,
8088 ) -> Option<(fidl::endpoints::ClientEnd<BlobIdIteratorMarker>, RetainedPackagesReplaceResponder)>
8089 {
8090 if let RetainedPackagesRequest::Replace { iterator, responder } = self {
8091 Some((iterator, responder))
8092 } else {
8093 None
8094 }
8095 }
8096
8097 pub fn method_name(&self) -> &'static str {
8099 match *self {
8100 RetainedPackagesRequest::Clear { .. } => "clear",
8101 RetainedPackagesRequest::Replace { .. } => "replace",
8102 }
8103 }
8104}
8105
8106#[derive(Debug, Clone)]
8107pub struct RetainedPackagesControlHandle {
8108 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8109}
8110
8111impl fidl::endpoints::ControlHandle for RetainedPackagesControlHandle {
8112 fn shutdown(&self) {
8113 self.inner.shutdown()
8114 }
8115 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8116 self.inner.shutdown_with_epitaph(status)
8117 }
8118
8119 fn is_closed(&self) -> bool {
8120 self.inner.channel().is_closed()
8121 }
8122 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8123 self.inner.channel().on_closed()
8124 }
8125
8126 #[cfg(target_os = "fuchsia")]
8127 fn signal_peer(
8128 &self,
8129 clear_mask: zx::Signals,
8130 set_mask: zx::Signals,
8131 ) -> Result<(), zx_status::Status> {
8132 use fidl::Peered;
8133 self.inner.channel().signal_peer(clear_mask, set_mask)
8134 }
8135}
8136
8137impl RetainedPackagesControlHandle {}
8138
8139#[must_use = "FIDL methods require a response to be sent"]
8140#[derive(Debug)]
8141pub struct RetainedPackagesClearResponder {
8142 control_handle: std::mem::ManuallyDrop<RetainedPackagesControlHandle>,
8143 tx_id: u32,
8144}
8145
8146impl std::ops::Drop for RetainedPackagesClearResponder {
8150 fn drop(&mut self) {
8151 self.control_handle.shutdown();
8152 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8154 }
8155}
8156
8157impl fidl::endpoints::Responder for RetainedPackagesClearResponder {
8158 type ControlHandle = RetainedPackagesControlHandle;
8159
8160 fn control_handle(&self) -> &RetainedPackagesControlHandle {
8161 &self.control_handle
8162 }
8163
8164 fn drop_without_shutdown(mut self) {
8165 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8167 std::mem::forget(self);
8169 }
8170}
8171
8172impl RetainedPackagesClearResponder {
8173 pub fn send(self) -> Result<(), fidl::Error> {
8177 let _result = self.send_raw();
8178 if _result.is_err() {
8179 self.control_handle.shutdown();
8180 }
8181 self.drop_without_shutdown();
8182 _result
8183 }
8184
8185 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8187 let _result = self.send_raw();
8188 self.drop_without_shutdown();
8189 _result
8190 }
8191
8192 fn send_raw(&self) -> Result<(), fidl::Error> {
8193 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
8194 (),
8195 self.tx_id,
8196 0x7f17476f097961ac,
8197 fidl::encoding::DynamicFlags::empty(),
8198 )
8199 }
8200}
8201
8202#[must_use = "FIDL methods require a response to be sent"]
8203#[derive(Debug)]
8204pub struct RetainedPackagesReplaceResponder {
8205 control_handle: std::mem::ManuallyDrop<RetainedPackagesControlHandle>,
8206 tx_id: u32,
8207}
8208
8209impl std::ops::Drop for RetainedPackagesReplaceResponder {
8213 fn drop(&mut self) {
8214 self.control_handle.shutdown();
8215 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8217 }
8218}
8219
8220impl fidl::endpoints::Responder for RetainedPackagesReplaceResponder {
8221 type ControlHandle = RetainedPackagesControlHandle;
8222
8223 fn control_handle(&self) -> &RetainedPackagesControlHandle {
8224 &self.control_handle
8225 }
8226
8227 fn drop_without_shutdown(mut self) {
8228 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8230 std::mem::forget(self);
8232 }
8233}
8234
8235impl RetainedPackagesReplaceResponder {
8236 pub fn send(self) -> Result<(), fidl::Error> {
8240 let _result = self.send_raw();
8241 if _result.is_err() {
8242 self.control_handle.shutdown();
8243 }
8244 self.drop_without_shutdown();
8245 _result
8246 }
8247
8248 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8250 let _result = self.send_raw();
8251 self.drop_without_shutdown();
8252 _result
8253 }
8254
8255 fn send_raw(&self) -> Result<(), fidl::Error> {
8256 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
8257 (),
8258 self.tx_id,
8259 0x5021e479570f3a9f,
8260 fidl::encoding::DynamicFlags::empty(),
8261 )
8262 }
8263}
8264
8265mod internal {
8266 use super::*;
8267
8268 impl fidl::encoding::ResourceTypeMarker for FontResolverResolveRequest {
8269 type Borrowed<'a> = &'a mut Self;
8270 fn take_or_borrow<'a>(
8271 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8272 ) -> Self::Borrowed<'a> {
8273 value
8274 }
8275 }
8276
8277 unsafe impl fidl::encoding::TypeMarker for FontResolverResolveRequest {
8278 type Owned = Self;
8279
8280 #[inline(always)]
8281 fn inline_align(_context: fidl::encoding::Context) -> usize {
8282 8
8283 }
8284
8285 #[inline(always)]
8286 fn inline_size(_context: fidl::encoding::Context) -> usize {
8287 24
8288 }
8289 }
8290
8291 unsafe impl
8292 fidl::encoding::Encode<
8293 FontResolverResolveRequest,
8294 fidl::encoding::DefaultFuchsiaResourceDialect,
8295 > for &mut FontResolverResolveRequest
8296 {
8297 #[inline]
8298 unsafe fn encode(
8299 self,
8300 encoder: &mut fidl::encoding::Encoder<
8301 '_,
8302 fidl::encoding::DefaultFuchsiaResourceDialect,
8303 >,
8304 offset: usize,
8305 _depth: fidl::encoding::Depth,
8306 ) -> fidl::Result<()> {
8307 encoder.debug_check_bounds::<FontResolverResolveRequest>(offset);
8308 fidl::encoding::Encode::<
8310 FontResolverResolveRequest,
8311 fidl::encoding::DefaultFuchsiaResourceDialect,
8312 >::encode(
8313 (
8314 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
8315 &self.package_url,
8316 ),
8317 <fidl::encoding::Endpoint<
8318 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8319 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8320 &mut self.directory_request,
8321 ),
8322 ),
8323 encoder,
8324 offset,
8325 _depth,
8326 )
8327 }
8328 }
8329 unsafe impl<
8330 T0: fidl::encoding::Encode<
8331 fidl::encoding::UnboundedString,
8332 fidl::encoding::DefaultFuchsiaResourceDialect,
8333 >,
8334 T1: fidl::encoding::Encode<
8335 fidl::encoding::Endpoint<
8336 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8337 >,
8338 fidl::encoding::DefaultFuchsiaResourceDialect,
8339 >,
8340 >
8341 fidl::encoding::Encode<
8342 FontResolverResolveRequest,
8343 fidl::encoding::DefaultFuchsiaResourceDialect,
8344 > for (T0, T1)
8345 {
8346 #[inline]
8347 unsafe fn encode(
8348 self,
8349 encoder: &mut fidl::encoding::Encoder<
8350 '_,
8351 fidl::encoding::DefaultFuchsiaResourceDialect,
8352 >,
8353 offset: usize,
8354 depth: fidl::encoding::Depth,
8355 ) -> fidl::Result<()> {
8356 encoder.debug_check_bounds::<FontResolverResolveRequest>(offset);
8357 unsafe {
8360 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8361 (ptr as *mut u64).write_unaligned(0);
8362 }
8363 self.0.encode(encoder, offset + 0, depth)?;
8365 self.1.encode(encoder, offset + 16, depth)?;
8366 Ok(())
8367 }
8368 }
8369
8370 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8371 for FontResolverResolveRequest
8372 {
8373 #[inline(always)]
8374 fn new_empty() -> Self {
8375 Self {
8376 package_url: fidl::new_empty!(
8377 fidl::encoding::UnboundedString,
8378 fidl::encoding::DefaultFuchsiaResourceDialect
8379 ),
8380 directory_request: fidl::new_empty!(
8381 fidl::encoding::Endpoint<
8382 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8383 >,
8384 fidl::encoding::DefaultFuchsiaResourceDialect
8385 ),
8386 }
8387 }
8388
8389 #[inline]
8390 unsafe fn decode(
8391 &mut self,
8392 decoder: &mut fidl::encoding::Decoder<
8393 '_,
8394 fidl::encoding::DefaultFuchsiaResourceDialect,
8395 >,
8396 offset: usize,
8397 _depth: fidl::encoding::Depth,
8398 ) -> fidl::Result<()> {
8399 decoder.debug_check_bounds::<Self>(offset);
8400 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8402 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8403 let mask = 0xffffffff00000000u64;
8404 let maskedval = padval & mask;
8405 if maskedval != 0 {
8406 return Err(fidl::Error::NonZeroPadding {
8407 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8408 });
8409 }
8410 fidl::decode!(
8411 fidl::encoding::UnboundedString,
8412 fidl::encoding::DefaultFuchsiaResourceDialect,
8413 &mut self.package_url,
8414 decoder,
8415 offset + 0,
8416 _depth
8417 )?;
8418 fidl::decode!(
8419 fidl::encoding::Endpoint<
8420 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8421 >,
8422 fidl::encoding::DefaultFuchsiaResourceDialect,
8423 &mut self.directory_request,
8424 decoder,
8425 offset + 16,
8426 _depth
8427 )?;
8428 Ok(())
8429 }
8430 }
8431
8432 impl fidl::encoding::ResourceTypeMarker for NeededBlobsGetMissingBlobsRequest {
8433 type Borrowed<'a> = &'a mut Self;
8434 fn take_or_borrow<'a>(
8435 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8436 ) -> Self::Borrowed<'a> {
8437 value
8438 }
8439 }
8440
8441 unsafe impl fidl::encoding::TypeMarker for NeededBlobsGetMissingBlobsRequest {
8442 type Owned = Self;
8443
8444 #[inline(always)]
8445 fn inline_align(_context: fidl::encoding::Context) -> usize {
8446 4
8447 }
8448
8449 #[inline(always)]
8450 fn inline_size(_context: fidl::encoding::Context) -> usize {
8451 4
8452 }
8453 }
8454
8455 unsafe impl
8456 fidl::encoding::Encode<
8457 NeededBlobsGetMissingBlobsRequest,
8458 fidl::encoding::DefaultFuchsiaResourceDialect,
8459 > for &mut NeededBlobsGetMissingBlobsRequest
8460 {
8461 #[inline]
8462 unsafe fn encode(
8463 self,
8464 encoder: &mut fidl::encoding::Encoder<
8465 '_,
8466 fidl::encoding::DefaultFuchsiaResourceDialect,
8467 >,
8468 offset: usize,
8469 _depth: fidl::encoding::Depth,
8470 ) -> fidl::Result<()> {
8471 encoder.debug_check_bounds::<NeededBlobsGetMissingBlobsRequest>(offset);
8472 fidl::encoding::Encode::<NeededBlobsGetMissingBlobsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8474 (
8475 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
8476 ),
8477 encoder, offset, _depth
8478 )
8479 }
8480 }
8481 unsafe impl<
8482 T0: fidl::encoding::Encode<
8483 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>>,
8484 fidl::encoding::DefaultFuchsiaResourceDialect,
8485 >,
8486 >
8487 fidl::encoding::Encode<
8488 NeededBlobsGetMissingBlobsRequest,
8489 fidl::encoding::DefaultFuchsiaResourceDialect,
8490 > for (T0,)
8491 {
8492 #[inline]
8493 unsafe fn encode(
8494 self,
8495 encoder: &mut fidl::encoding::Encoder<
8496 '_,
8497 fidl::encoding::DefaultFuchsiaResourceDialect,
8498 >,
8499 offset: usize,
8500 depth: fidl::encoding::Depth,
8501 ) -> fidl::Result<()> {
8502 encoder.debug_check_bounds::<NeededBlobsGetMissingBlobsRequest>(offset);
8503 self.0.encode(encoder, offset + 0, depth)?;
8507 Ok(())
8508 }
8509 }
8510
8511 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8512 for NeededBlobsGetMissingBlobsRequest
8513 {
8514 #[inline(always)]
8515 fn new_empty() -> Self {
8516 Self {
8517 iterator: fidl::new_empty!(
8518 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>>,
8519 fidl::encoding::DefaultFuchsiaResourceDialect
8520 ),
8521 }
8522 }
8523
8524 #[inline]
8525 unsafe fn decode(
8526 &mut self,
8527 decoder: &mut fidl::encoding::Decoder<
8528 '_,
8529 fidl::encoding::DefaultFuchsiaResourceDialect,
8530 >,
8531 offset: usize,
8532 _depth: fidl::encoding::Depth,
8533 ) -> fidl::Result<()> {
8534 decoder.debug_check_bounds::<Self>(offset);
8535 fidl::decode!(
8537 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BlobInfoIteratorMarker>>,
8538 fidl::encoding::DefaultFuchsiaResourceDialect,
8539 &mut self.iterator,
8540 decoder,
8541 offset + 0,
8542 _depth
8543 )?;
8544 Ok(())
8545 }
8546 }
8547
8548 impl fidl::encoding::ResourceTypeMarker for NeededBlobsOpenBlobResponse {
8549 type Borrowed<'a> = &'a mut Self;
8550 fn take_or_borrow<'a>(
8551 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8552 ) -> Self::Borrowed<'a> {
8553 value
8554 }
8555 }
8556
8557 unsafe impl fidl::encoding::TypeMarker for NeededBlobsOpenBlobResponse {
8558 type Owned = Self;
8559
8560 #[inline(always)]
8561 fn inline_align(_context: fidl::encoding::Context) -> usize {
8562 8
8563 }
8564
8565 #[inline(always)]
8566 fn inline_size(_context: fidl::encoding::Context) -> usize {
8567 16
8568 }
8569 }
8570
8571 unsafe impl
8572 fidl::encoding::Encode<
8573 NeededBlobsOpenBlobResponse,
8574 fidl::encoding::DefaultFuchsiaResourceDialect,
8575 > for &mut NeededBlobsOpenBlobResponse
8576 {
8577 #[inline]
8578 unsafe fn encode(
8579 self,
8580 encoder: &mut fidl::encoding::Encoder<
8581 '_,
8582 fidl::encoding::DefaultFuchsiaResourceDialect,
8583 >,
8584 offset: usize,
8585 _depth: fidl::encoding::Depth,
8586 ) -> fidl::Result<()> {
8587 encoder.debug_check_bounds::<NeededBlobsOpenBlobResponse>(offset);
8588 fidl::encoding::Encode::<NeededBlobsOpenBlobResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8590 (
8591 <fidl::encoding::OptionalUnion<BlobWriter> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
8592 ),
8593 encoder, offset, _depth
8594 )
8595 }
8596 }
8597 unsafe impl<
8598 T0: fidl::encoding::Encode<
8599 fidl::encoding::OptionalUnion<BlobWriter>,
8600 fidl::encoding::DefaultFuchsiaResourceDialect,
8601 >,
8602 >
8603 fidl::encoding::Encode<
8604 NeededBlobsOpenBlobResponse,
8605 fidl::encoding::DefaultFuchsiaResourceDialect,
8606 > for (T0,)
8607 {
8608 #[inline]
8609 unsafe fn encode(
8610 self,
8611 encoder: &mut fidl::encoding::Encoder<
8612 '_,
8613 fidl::encoding::DefaultFuchsiaResourceDialect,
8614 >,
8615 offset: usize,
8616 depth: fidl::encoding::Depth,
8617 ) -> fidl::Result<()> {
8618 encoder.debug_check_bounds::<NeededBlobsOpenBlobResponse>(offset);
8619 self.0.encode(encoder, offset + 0, depth)?;
8623 Ok(())
8624 }
8625 }
8626
8627 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8628 for NeededBlobsOpenBlobResponse
8629 {
8630 #[inline(always)]
8631 fn new_empty() -> Self {
8632 Self {
8633 writer: fidl::new_empty!(
8634 fidl::encoding::OptionalUnion<BlobWriter>,
8635 fidl::encoding::DefaultFuchsiaResourceDialect
8636 ),
8637 }
8638 }
8639
8640 #[inline]
8641 unsafe fn decode(
8642 &mut self,
8643 decoder: &mut fidl::encoding::Decoder<
8644 '_,
8645 fidl::encoding::DefaultFuchsiaResourceDialect,
8646 >,
8647 offset: usize,
8648 _depth: fidl::encoding::Depth,
8649 ) -> fidl::Result<()> {
8650 decoder.debug_check_bounds::<Self>(offset);
8651 fidl::decode!(
8653 fidl::encoding::OptionalUnion<BlobWriter>,
8654 fidl::encoding::DefaultFuchsiaResourceDialect,
8655 &mut self.writer,
8656 decoder,
8657 offset + 0,
8658 _depth
8659 )?;
8660 Ok(())
8661 }
8662 }
8663
8664 impl fidl::encoding::ResourceTypeMarker for NeededBlobsOpenMetaBlobResponse {
8665 type Borrowed<'a> = &'a mut Self;
8666 fn take_or_borrow<'a>(
8667 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8668 ) -> Self::Borrowed<'a> {
8669 value
8670 }
8671 }
8672
8673 unsafe impl fidl::encoding::TypeMarker for NeededBlobsOpenMetaBlobResponse {
8674 type Owned = Self;
8675
8676 #[inline(always)]
8677 fn inline_align(_context: fidl::encoding::Context) -> usize {
8678 8
8679 }
8680
8681 #[inline(always)]
8682 fn inline_size(_context: fidl::encoding::Context) -> usize {
8683 16
8684 }
8685 }
8686
8687 unsafe impl
8688 fidl::encoding::Encode<
8689 NeededBlobsOpenMetaBlobResponse,
8690 fidl::encoding::DefaultFuchsiaResourceDialect,
8691 > for &mut NeededBlobsOpenMetaBlobResponse
8692 {
8693 #[inline]
8694 unsafe fn encode(
8695 self,
8696 encoder: &mut fidl::encoding::Encoder<
8697 '_,
8698 fidl::encoding::DefaultFuchsiaResourceDialect,
8699 >,
8700 offset: usize,
8701 _depth: fidl::encoding::Depth,
8702 ) -> fidl::Result<()> {
8703 encoder.debug_check_bounds::<NeededBlobsOpenMetaBlobResponse>(offset);
8704 fidl::encoding::Encode::<NeededBlobsOpenMetaBlobResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8706 (
8707 <fidl::encoding::OptionalUnion<BlobWriter> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
8708 ),
8709 encoder, offset, _depth
8710 )
8711 }
8712 }
8713 unsafe impl<
8714 T0: fidl::encoding::Encode<
8715 fidl::encoding::OptionalUnion<BlobWriter>,
8716 fidl::encoding::DefaultFuchsiaResourceDialect,
8717 >,
8718 >
8719 fidl::encoding::Encode<
8720 NeededBlobsOpenMetaBlobResponse,
8721 fidl::encoding::DefaultFuchsiaResourceDialect,
8722 > for (T0,)
8723 {
8724 #[inline]
8725 unsafe fn encode(
8726 self,
8727 encoder: &mut fidl::encoding::Encoder<
8728 '_,
8729 fidl::encoding::DefaultFuchsiaResourceDialect,
8730 >,
8731 offset: usize,
8732 depth: fidl::encoding::Depth,
8733 ) -> fidl::Result<()> {
8734 encoder.debug_check_bounds::<NeededBlobsOpenMetaBlobResponse>(offset);
8735 self.0.encode(encoder, offset + 0, depth)?;
8739 Ok(())
8740 }
8741 }
8742
8743 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8744 for NeededBlobsOpenMetaBlobResponse
8745 {
8746 #[inline(always)]
8747 fn new_empty() -> Self {
8748 Self {
8749 writer: fidl::new_empty!(
8750 fidl::encoding::OptionalUnion<BlobWriter>,
8751 fidl::encoding::DefaultFuchsiaResourceDialect
8752 ),
8753 }
8754 }
8755
8756 #[inline]
8757 unsafe fn decode(
8758 &mut self,
8759 decoder: &mut fidl::encoding::Decoder<
8760 '_,
8761 fidl::encoding::DefaultFuchsiaResourceDialect,
8762 >,
8763 offset: usize,
8764 _depth: fidl::encoding::Depth,
8765 ) -> fidl::Result<()> {
8766 decoder.debug_check_bounds::<Self>(offset);
8767 fidl::decode!(
8769 fidl::encoding::OptionalUnion<BlobWriter>,
8770 fidl::encoding::DefaultFuchsiaResourceDialect,
8771 &mut self.writer,
8772 decoder,
8773 offset + 0,
8774 _depth
8775 )?;
8776 Ok(())
8777 }
8778 }
8779
8780 impl fidl::encoding::ResourceTypeMarker for PackageCacheBasePackageIndexRequest {
8781 type Borrowed<'a> = &'a mut Self;
8782 fn take_or_borrow<'a>(
8783 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8784 ) -> Self::Borrowed<'a> {
8785 value
8786 }
8787 }
8788
8789 unsafe impl fidl::encoding::TypeMarker for PackageCacheBasePackageIndexRequest {
8790 type Owned = Self;
8791
8792 #[inline(always)]
8793 fn inline_align(_context: fidl::encoding::Context) -> usize {
8794 4
8795 }
8796
8797 #[inline(always)]
8798 fn inline_size(_context: fidl::encoding::Context) -> usize {
8799 4
8800 }
8801 }
8802
8803 unsafe impl
8804 fidl::encoding::Encode<
8805 PackageCacheBasePackageIndexRequest,
8806 fidl::encoding::DefaultFuchsiaResourceDialect,
8807 > for &mut PackageCacheBasePackageIndexRequest
8808 {
8809 #[inline]
8810 unsafe fn encode(
8811 self,
8812 encoder: &mut fidl::encoding::Encoder<
8813 '_,
8814 fidl::encoding::DefaultFuchsiaResourceDialect,
8815 >,
8816 offset: usize,
8817 _depth: fidl::encoding::Depth,
8818 ) -> fidl::Result<()> {
8819 encoder.debug_check_bounds::<PackageCacheBasePackageIndexRequest>(offset);
8820 fidl::encoding::Encode::<
8822 PackageCacheBasePackageIndexRequest,
8823 fidl::encoding::DefaultFuchsiaResourceDialect,
8824 >::encode(
8825 (
8826 <fidl::encoding::Endpoint<
8827 fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
8828 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8829 &mut self.iterator
8830 ),
8831 ),
8832 encoder,
8833 offset,
8834 _depth,
8835 )
8836 }
8837 }
8838 unsafe impl<
8839 T0: fidl::encoding::Encode<
8840 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>>,
8841 fidl::encoding::DefaultFuchsiaResourceDialect,
8842 >,
8843 >
8844 fidl::encoding::Encode<
8845 PackageCacheBasePackageIndexRequest,
8846 fidl::encoding::DefaultFuchsiaResourceDialect,
8847 > for (T0,)
8848 {
8849 #[inline]
8850 unsafe fn encode(
8851 self,
8852 encoder: &mut fidl::encoding::Encoder<
8853 '_,
8854 fidl::encoding::DefaultFuchsiaResourceDialect,
8855 >,
8856 offset: usize,
8857 depth: fidl::encoding::Depth,
8858 ) -> fidl::Result<()> {
8859 encoder.debug_check_bounds::<PackageCacheBasePackageIndexRequest>(offset);
8860 self.0.encode(encoder, offset + 0, depth)?;
8864 Ok(())
8865 }
8866 }
8867
8868 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8869 for PackageCacheBasePackageIndexRequest
8870 {
8871 #[inline(always)]
8872 fn new_empty() -> Self {
8873 Self {
8874 iterator: fidl::new_empty!(
8875 fidl::encoding::Endpoint<
8876 fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
8877 >,
8878 fidl::encoding::DefaultFuchsiaResourceDialect
8879 ),
8880 }
8881 }
8882
8883 #[inline]
8884 unsafe fn decode(
8885 &mut self,
8886 decoder: &mut fidl::encoding::Decoder<
8887 '_,
8888 fidl::encoding::DefaultFuchsiaResourceDialect,
8889 >,
8890 offset: usize,
8891 _depth: fidl::encoding::Depth,
8892 ) -> fidl::Result<()> {
8893 decoder.debug_check_bounds::<Self>(offset);
8894 fidl::decode!(
8896 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>>,
8897 fidl::encoding::DefaultFuchsiaResourceDialect,
8898 &mut self.iterator,
8899 decoder,
8900 offset + 0,
8901 _depth
8902 )?;
8903 Ok(())
8904 }
8905 }
8906
8907 impl fidl::encoding::ResourceTypeMarker for PackageCacheCachePackageIndexRequest {
8908 type Borrowed<'a> = &'a mut Self;
8909 fn take_or_borrow<'a>(
8910 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8911 ) -> Self::Borrowed<'a> {
8912 value
8913 }
8914 }
8915
8916 unsafe impl fidl::encoding::TypeMarker for PackageCacheCachePackageIndexRequest {
8917 type Owned = Self;
8918
8919 #[inline(always)]
8920 fn inline_align(_context: fidl::encoding::Context) -> usize {
8921 4
8922 }
8923
8924 #[inline(always)]
8925 fn inline_size(_context: fidl::encoding::Context) -> usize {
8926 4
8927 }
8928 }
8929
8930 unsafe impl
8931 fidl::encoding::Encode<
8932 PackageCacheCachePackageIndexRequest,
8933 fidl::encoding::DefaultFuchsiaResourceDialect,
8934 > for &mut PackageCacheCachePackageIndexRequest
8935 {
8936 #[inline]
8937 unsafe fn encode(
8938 self,
8939 encoder: &mut fidl::encoding::Encoder<
8940 '_,
8941 fidl::encoding::DefaultFuchsiaResourceDialect,
8942 >,
8943 offset: usize,
8944 _depth: fidl::encoding::Depth,
8945 ) -> fidl::Result<()> {
8946 encoder.debug_check_bounds::<PackageCacheCachePackageIndexRequest>(offset);
8947 fidl::encoding::Encode::<
8949 PackageCacheCachePackageIndexRequest,
8950 fidl::encoding::DefaultFuchsiaResourceDialect,
8951 >::encode(
8952 (
8953 <fidl::encoding::Endpoint<
8954 fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
8955 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8956 &mut self.iterator
8957 ),
8958 ),
8959 encoder,
8960 offset,
8961 _depth,
8962 )
8963 }
8964 }
8965 unsafe impl<
8966 T0: fidl::encoding::Encode<
8967 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>>,
8968 fidl::encoding::DefaultFuchsiaResourceDialect,
8969 >,
8970 >
8971 fidl::encoding::Encode<
8972 PackageCacheCachePackageIndexRequest,
8973 fidl::encoding::DefaultFuchsiaResourceDialect,
8974 > for (T0,)
8975 {
8976 #[inline]
8977 unsafe fn encode(
8978 self,
8979 encoder: &mut fidl::encoding::Encoder<
8980 '_,
8981 fidl::encoding::DefaultFuchsiaResourceDialect,
8982 >,
8983 offset: usize,
8984 depth: fidl::encoding::Depth,
8985 ) -> fidl::Result<()> {
8986 encoder.debug_check_bounds::<PackageCacheCachePackageIndexRequest>(offset);
8987 self.0.encode(encoder, offset + 0, depth)?;
8991 Ok(())
8992 }
8993 }
8994
8995 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8996 for PackageCacheCachePackageIndexRequest
8997 {
8998 #[inline(always)]
8999 fn new_empty() -> Self {
9000 Self {
9001 iterator: fidl::new_empty!(
9002 fidl::encoding::Endpoint<
9003 fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>,
9004 >,
9005 fidl::encoding::DefaultFuchsiaResourceDialect
9006 ),
9007 }
9008 }
9009
9010 #[inline]
9011 unsafe fn decode(
9012 &mut self,
9013 decoder: &mut fidl::encoding::Decoder<
9014 '_,
9015 fidl::encoding::DefaultFuchsiaResourceDialect,
9016 >,
9017 offset: usize,
9018 _depth: fidl::encoding::Depth,
9019 ) -> fidl::Result<()> {
9020 decoder.debug_check_bounds::<Self>(offset);
9021 fidl::decode!(
9023 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PackageIndexIteratorMarker>>,
9024 fidl::encoding::DefaultFuchsiaResourceDialect,
9025 &mut self.iterator,
9026 decoder,
9027 offset + 0,
9028 _depth
9029 )?;
9030 Ok(())
9031 }
9032 }
9033
9034 impl fidl::encoding::ResourceTypeMarker for PackageCacheGetRequest {
9035 type Borrowed<'a> = &'a mut Self;
9036 fn take_or_borrow<'a>(
9037 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9038 ) -> Self::Borrowed<'a> {
9039 value
9040 }
9041 }
9042
9043 unsafe impl fidl::encoding::TypeMarker for PackageCacheGetRequest {
9044 type Owned = Self;
9045
9046 #[inline(always)]
9047 fn inline_align(_context: fidl::encoding::Context) -> usize {
9048 8
9049 }
9050
9051 #[inline(always)]
9052 fn inline_size(_context: fidl::encoding::Context) -> usize {
9053 56
9054 }
9055 }
9056
9057 unsafe impl
9058 fidl::encoding::Encode<
9059 PackageCacheGetRequest,
9060 fidl::encoding::DefaultFuchsiaResourceDialect,
9061 > for &mut PackageCacheGetRequest
9062 {
9063 #[inline]
9064 unsafe fn encode(
9065 self,
9066 encoder: &mut fidl::encoding::Encoder<
9067 '_,
9068 fidl::encoding::DefaultFuchsiaResourceDialect,
9069 >,
9070 offset: usize,
9071 _depth: fidl::encoding::Depth,
9072 ) -> fidl::Result<()> {
9073 encoder.debug_check_bounds::<PackageCacheGetRequest>(offset);
9074 fidl::encoding::Encode::<PackageCacheGetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9076 (
9077 <BlobInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.meta_far_blob),
9078 <GcProtection as fidl::encoding::ValueTypeMarker>::borrow(&self.gc_protection),
9079 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NeededBlobsMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.needed_blobs),
9080 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dir),
9081 ),
9082 encoder, offset, _depth
9083 )
9084 }
9085 }
9086 unsafe impl<
9087 T0: fidl::encoding::Encode<BlobInfo, fidl::encoding::DefaultFuchsiaResourceDialect>,
9088 T1: fidl::encoding::Encode<GcProtection, fidl::encoding::DefaultFuchsiaResourceDialect>,
9089 T2: fidl::encoding::Encode<
9090 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NeededBlobsMarker>>,
9091 fidl::encoding::DefaultFuchsiaResourceDialect,
9092 >,
9093 T3: fidl::encoding::Encode<
9094 fidl::encoding::Endpoint<
9095 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9096 >,
9097 fidl::encoding::DefaultFuchsiaResourceDialect,
9098 >,
9099 >
9100 fidl::encoding::Encode<
9101 PackageCacheGetRequest,
9102 fidl::encoding::DefaultFuchsiaResourceDialect,
9103 > for (T0, T1, T2, T3)
9104 {
9105 #[inline]
9106 unsafe fn encode(
9107 self,
9108 encoder: &mut fidl::encoding::Encoder<
9109 '_,
9110 fidl::encoding::DefaultFuchsiaResourceDialect,
9111 >,
9112 offset: usize,
9113 depth: fidl::encoding::Depth,
9114 ) -> fidl::Result<()> {
9115 encoder.debug_check_bounds::<PackageCacheGetRequest>(offset);
9116 unsafe {
9119 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
9120 (ptr as *mut u64).write_unaligned(0);
9121 }
9122 self.0.encode(encoder, offset + 0, depth)?;
9124 self.1.encode(encoder, offset + 40, depth)?;
9125 self.2.encode(encoder, offset + 44, depth)?;
9126 self.3.encode(encoder, offset + 48, depth)?;
9127 Ok(())
9128 }
9129 }
9130
9131 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9132 for PackageCacheGetRequest
9133 {
9134 #[inline(always)]
9135 fn new_empty() -> Self {
9136 Self {
9137 meta_far_blob: fidl::new_empty!(
9138 BlobInfo,
9139 fidl::encoding::DefaultFuchsiaResourceDialect
9140 ),
9141 gc_protection: fidl::new_empty!(
9142 GcProtection,
9143 fidl::encoding::DefaultFuchsiaResourceDialect
9144 ),
9145 needed_blobs: fidl::new_empty!(
9146 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NeededBlobsMarker>>,
9147 fidl::encoding::DefaultFuchsiaResourceDialect
9148 ),
9149 dir: fidl::new_empty!(
9150 fidl::encoding::Endpoint<
9151 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9152 >,
9153 fidl::encoding::DefaultFuchsiaResourceDialect
9154 ),
9155 }
9156 }
9157
9158 #[inline]
9159 unsafe fn decode(
9160 &mut self,
9161 decoder: &mut fidl::encoding::Decoder<
9162 '_,
9163 fidl::encoding::DefaultFuchsiaResourceDialect,
9164 >,
9165 offset: usize,
9166 _depth: fidl::encoding::Depth,
9167 ) -> fidl::Result<()> {
9168 decoder.debug_check_bounds::<Self>(offset);
9169 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
9171 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9172 let mask = 0xffffffff00000000u64;
9173 let maskedval = padval & mask;
9174 if maskedval != 0 {
9175 return Err(fidl::Error::NonZeroPadding {
9176 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
9177 });
9178 }
9179 fidl::decode!(
9180 BlobInfo,
9181 fidl::encoding::DefaultFuchsiaResourceDialect,
9182 &mut self.meta_far_blob,
9183 decoder,
9184 offset + 0,
9185 _depth
9186 )?;
9187 fidl::decode!(
9188 GcProtection,
9189 fidl::encoding::DefaultFuchsiaResourceDialect,
9190 &mut self.gc_protection,
9191 decoder,
9192 offset + 40,
9193 _depth
9194 )?;
9195 fidl::decode!(
9196 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<NeededBlobsMarker>>,
9197 fidl::encoding::DefaultFuchsiaResourceDialect,
9198 &mut self.needed_blobs,
9199 decoder,
9200 offset + 44,
9201 _depth
9202 )?;
9203 fidl::decode!(
9204 fidl::encoding::Endpoint<
9205 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9206 >,
9207 fidl::encoding::DefaultFuchsiaResourceDialect,
9208 &mut self.dir,
9209 decoder,
9210 offset + 48,
9211 _depth
9212 )?;
9213 Ok(())
9214 }
9215 }
9216
9217 impl fidl::encoding::ResourceTypeMarker for PackageCacheGetSubpackageRequest {
9218 type Borrowed<'a> = &'a mut Self;
9219 fn take_or_borrow<'a>(
9220 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9221 ) -> Self::Borrowed<'a> {
9222 value
9223 }
9224 }
9225
9226 unsafe impl fidl::encoding::TypeMarker for PackageCacheGetSubpackageRequest {
9227 type Owned = Self;
9228
9229 #[inline(always)]
9230 fn inline_align(_context: fidl::encoding::Context) -> usize {
9231 8
9232 }
9233
9234 #[inline(always)]
9235 fn inline_size(_context: fidl::encoding::Context) -> usize {
9236 56
9237 }
9238 }
9239
9240 unsafe impl
9241 fidl::encoding::Encode<
9242 PackageCacheGetSubpackageRequest,
9243 fidl::encoding::DefaultFuchsiaResourceDialect,
9244 > for &mut PackageCacheGetSubpackageRequest
9245 {
9246 #[inline]
9247 unsafe fn encode(
9248 self,
9249 encoder: &mut fidl::encoding::Encoder<
9250 '_,
9251 fidl::encoding::DefaultFuchsiaResourceDialect,
9252 >,
9253 offset: usize,
9254 _depth: fidl::encoding::Depth,
9255 ) -> fidl::Result<()> {
9256 encoder.debug_check_bounds::<PackageCacheGetSubpackageRequest>(offset);
9257 fidl::encoding::Encode::<
9259 PackageCacheGetSubpackageRequest,
9260 fidl::encoding::DefaultFuchsiaResourceDialect,
9261 >::encode(
9262 (
9263 <BlobId as fidl::encoding::ValueTypeMarker>::borrow(&self.superpackage),
9264 <PackageUrl as fidl::encoding::ValueTypeMarker>::borrow(&self.subpackage),
9265 <fidl::encoding::Endpoint<
9266 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9267 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9268 &mut self.dir
9269 ),
9270 ),
9271 encoder,
9272 offset,
9273 _depth,
9274 )
9275 }
9276 }
9277 unsafe impl<
9278 T0: fidl::encoding::Encode<BlobId, fidl::encoding::DefaultFuchsiaResourceDialect>,
9279 T1: fidl::encoding::Encode<PackageUrl, fidl::encoding::DefaultFuchsiaResourceDialect>,
9280 T2: fidl::encoding::Encode<
9281 fidl::encoding::Endpoint<
9282 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9283 >,
9284 fidl::encoding::DefaultFuchsiaResourceDialect,
9285 >,
9286 >
9287 fidl::encoding::Encode<
9288 PackageCacheGetSubpackageRequest,
9289 fidl::encoding::DefaultFuchsiaResourceDialect,
9290 > for (T0, T1, T2)
9291 {
9292 #[inline]
9293 unsafe fn encode(
9294 self,
9295 encoder: &mut fidl::encoding::Encoder<
9296 '_,
9297 fidl::encoding::DefaultFuchsiaResourceDialect,
9298 >,
9299 offset: usize,
9300 depth: fidl::encoding::Depth,
9301 ) -> fidl::Result<()> {
9302 encoder.debug_check_bounds::<PackageCacheGetSubpackageRequest>(offset);
9303 unsafe {
9306 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
9307 (ptr as *mut u64).write_unaligned(0);
9308 }
9309 self.0.encode(encoder, offset + 0, depth)?;
9311 self.1.encode(encoder, offset + 32, depth)?;
9312 self.2.encode(encoder, offset + 48, depth)?;
9313 Ok(())
9314 }
9315 }
9316
9317 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9318 for PackageCacheGetSubpackageRequest
9319 {
9320 #[inline(always)]
9321 fn new_empty() -> Self {
9322 Self {
9323 superpackage: fidl::new_empty!(
9324 BlobId,
9325 fidl::encoding::DefaultFuchsiaResourceDialect
9326 ),
9327 subpackage: fidl::new_empty!(
9328 PackageUrl,
9329 fidl::encoding::DefaultFuchsiaResourceDialect
9330 ),
9331 dir: fidl::new_empty!(
9332 fidl::encoding::Endpoint<
9333 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9334 >,
9335 fidl::encoding::DefaultFuchsiaResourceDialect
9336 ),
9337 }
9338 }
9339
9340 #[inline]
9341 unsafe fn decode(
9342 &mut self,
9343 decoder: &mut fidl::encoding::Decoder<
9344 '_,
9345 fidl::encoding::DefaultFuchsiaResourceDialect,
9346 >,
9347 offset: usize,
9348 _depth: fidl::encoding::Depth,
9349 ) -> fidl::Result<()> {
9350 decoder.debug_check_bounds::<Self>(offset);
9351 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
9353 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9354 let mask = 0xffffffff00000000u64;
9355 let maskedval = padval & mask;
9356 if maskedval != 0 {
9357 return Err(fidl::Error::NonZeroPadding {
9358 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
9359 });
9360 }
9361 fidl::decode!(
9362 BlobId,
9363 fidl::encoding::DefaultFuchsiaResourceDialect,
9364 &mut self.superpackage,
9365 decoder,
9366 offset + 0,
9367 _depth
9368 )?;
9369 fidl::decode!(
9370 PackageUrl,
9371 fidl::encoding::DefaultFuchsiaResourceDialect,
9372 &mut self.subpackage,
9373 decoder,
9374 offset + 32,
9375 _depth
9376 )?;
9377 fidl::decode!(
9378 fidl::encoding::Endpoint<
9379 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9380 >,
9381 fidl::encoding::DefaultFuchsiaResourceDialect,
9382 &mut self.dir,
9383 decoder,
9384 offset + 48,
9385 _depth
9386 )?;
9387 Ok(())
9388 }
9389 }
9390
9391 impl fidl::encoding::ResourceTypeMarker for PackageResolverResolveRequest {
9392 type Borrowed<'a> = &'a mut Self;
9393 fn take_or_borrow<'a>(
9394 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9395 ) -> Self::Borrowed<'a> {
9396 value
9397 }
9398 }
9399
9400 unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveRequest {
9401 type Owned = Self;
9402
9403 #[inline(always)]
9404 fn inline_align(_context: fidl::encoding::Context) -> usize {
9405 8
9406 }
9407
9408 #[inline(always)]
9409 fn inline_size(_context: fidl::encoding::Context) -> usize {
9410 24
9411 }
9412 }
9413
9414 unsafe impl
9415 fidl::encoding::Encode<
9416 PackageResolverResolveRequest,
9417 fidl::encoding::DefaultFuchsiaResourceDialect,
9418 > for &mut PackageResolverResolveRequest
9419 {
9420 #[inline]
9421 unsafe fn encode(
9422 self,
9423 encoder: &mut fidl::encoding::Encoder<
9424 '_,
9425 fidl::encoding::DefaultFuchsiaResourceDialect,
9426 >,
9427 offset: usize,
9428 _depth: fidl::encoding::Depth,
9429 ) -> fidl::Result<()> {
9430 encoder.debug_check_bounds::<PackageResolverResolveRequest>(offset);
9431 fidl::encoding::Encode::<
9433 PackageResolverResolveRequest,
9434 fidl::encoding::DefaultFuchsiaResourceDialect,
9435 >::encode(
9436 (
9437 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9438 &self.package_url,
9439 ),
9440 <fidl::encoding::Endpoint<
9441 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9442 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9443 &mut self.dir
9444 ),
9445 ),
9446 encoder,
9447 offset,
9448 _depth,
9449 )
9450 }
9451 }
9452 unsafe impl<
9453 T0: fidl::encoding::Encode<
9454 fidl::encoding::UnboundedString,
9455 fidl::encoding::DefaultFuchsiaResourceDialect,
9456 >,
9457 T1: fidl::encoding::Encode<
9458 fidl::encoding::Endpoint<
9459 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9460 >,
9461 fidl::encoding::DefaultFuchsiaResourceDialect,
9462 >,
9463 >
9464 fidl::encoding::Encode<
9465 PackageResolverResolveRequest,
9466 fidl::encoding::DefaultFuchsiaResourceDialect,
9467 > for (T0, T1)
9468 {
9469 #[inline]
9470 unsafe fn encode(
9471 self,
9472 encoder: &mut fidl::encoding::Encoder<
9473 '_,
9474 fidl::encoding::DefaultFuchsiaResourceDialect,
9475 >,
9476 offset: usize,
9477 depth: fidl::encoding::Depth,
9478 ) -> fidl::Result<()> {
9479 encoder.debug_check_bounds::<PackageResolverResolveRequest>(offset);
9480 unsafe {
9483 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9484 (ptr as *mut u64).write_unaligned(0);
9485 }
9486 self.0.encode(encoder, offset + 0, depth)?;
9488 self.1.encode(encoder, offset + 16, depth)?;
9489 Ok(())
9490 }
9491 }
9492
9493 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9494 for PackageResolverResolveRequest
9495 {
9496 #[inline(always)]
9497 fn new_empty() -> Self {
9498 Self {
9499 package_url: fidl::new_empty!(
9500 fidl::encoding::UnboundedString,
9501 fidl::encoding::DefaultFuchsiaResourceDialect
9502 ),
9503 dir: fidl::new_empty!(
9504 fidl::encoding::Endpoint<
9505 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9506 >,
9507 fidl::encoding::DefaultFuchsiaResourceDialect
9508 ),
9509 }
9510 }
9511
9512 #[inline]
9513 unsafe fn decode(
9514 &mut self,
9515 decoder: &mut fidl::encoding::Decoder<
9516 '_,
9517 fidl::encoding::DefaultFuchsiaResourceDialect,
9518 >,
9519 offset: usize,
9520 _depth: fidl::encoding::Depth,
9521 ) -> fidl::Result<()> {
9522 decoder.debug_check_bounds::<Self>(offset);
9523 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9525 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9526 let mask = 0xffffffff00000000u64;
9527 let maskedval = padval & mask;
9528 if maskedval != 0 {
9529 return Err(fidl::Error::NonZeroPadding {
9530 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9531 });
9532 }
9533 fidl::decode!(
9534 fidl::encoding::UnboundedString,
9535 fidl::encoding::DefaultFuchsiaResourceDialect,
9536 &mut self.package_url,
9537 decoder,
9538 offset + 0,
9539 _depth
9540 )?;
9541 fidl::decode!(
9542 fidl::encoding::Endpoint<
9543 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9544 >,
9545 fidl::encoding::DefaultFuchsiaResourceDialect,
9546 &mut self.dir,
9547 decoder,
9548 offset + 16,
9549 _depth
9550 )?;
9551 Ok(())
9552 }
9553 }
9554
9555 impl fidl::encoding::ResourceTypeMarker for PackageResolverResolveWithContextRequest {
9556 type Borrowed<'a> = &'a mut Self;
9557 fn take_or_borrow<'a>(
9558 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9559 ) -> Self::Borrowed<'a> {
9560 value
9561 }
9562 }
9563
9564 unsafe impl fidl::encoding::TypeMarker for PackageResolverResolveWithContextRequest {
9565 type Owned = Self;
9566
9567 #[inline(always)]
9568 fn inline_align(_context: fidl::encoding::Context) -> usize {
9569 8
9570 }
9571
9572 #[inline(always)]
9573 fn inline_size(_context: fidl::encoding::Context) -> usize {
9574 40
9575 }
9576 }
9577
9578 unsafe impl
9579 fidl::encoding::Encode<
9580 PackageResolverResolveWithContextRequest,
9581 fidl::encoding::DefaultFuchsiaResourceDialect,
9582 > for &mut PackageResolverResolveWithContextRequest
9583 {
9584 #[inline]
9585 unsafe fn encode(
9586 self,
9587 encoder: &mut fidl::encoding::Encoder<
9588 '_,
9589 fidl::encoding::DefaultFuchsiaResourceDialect,
9590 >,
9591 offset: usize,
9592 _depth: fidl::encoding::Depth,
9593 ) -> fidl::Result<()> {
9594 encoder.debug_check_bounds::<PackageResolverResolveWithContextRequest>(offset);
9595 fidl::encoding::Encode::<
9597 PackageResolverResolveWithContextRequest,
9598 fidl::encoding::DefaultFuchsiaResourceDialect,
9599 >::encode(
9600 (
9601 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9602 &self.package_url,
9603 ),
9604 <ResolutionContext as fidl::encoding::ValueTypeMarker>::borrow(&self.context),
9605 <fidl::encoding::Endpoint<
9606 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9607 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9608 &mut self.dir
9609 ),
9610 ),
9611 encoder,
9612 offset,
9613 _depth,
9614 )
9615 }
9616 }
9617 unsafe impl<
9618 T0: fidl::encoding::Encode<
9619 fidl::encoding::UnboundedString,
9620 fidl::encoding::DefaultFuchsiaResourceDialect,
9621 >,
9622 T1: fidl::encoding::Encode<
9623 ResolutionContext,
9624 fidl::encoding::DefaultFuchsiaResourceDialect,
9625 >,
9626 T2: fidl::encoding::Encode<
9627 fidl::encoding::Endpoint<
9628 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9629 >,
9630 fidl::encoding::DefaultFuchsiaResourceDialect,
9631 >,
9632 >
9633 fidl::encoding::Encode<
9634 PackageResolverResolveWithContextRequest,
9635 fidl::encoding::DefaultFuchsiaResourceDialect,
9636 > for (T0, T1, T2)
9637 {
9638 #[inline]
9639 unsafe fn encode(
9640 self,
9641 encoder: &mut fidl::encoding::Encoder<
9642 '_,
9643 fidl::encoding::DefaultFuchsiaResourceDialect,
9644 >,
9645 offset: usize,
9646 depth: fidl::encoding::Depth,
9647 ) -> fidl::Result<()> {
9648 encoder.debug_check_bounds::<PackageResolverResolveWithContextRequest>(offset);
9649 unsafe {
9652 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
9653 (ptr as *mut u64).write_unaligned(0);
9654 }
9655 self.0.encode(encoder, offset + 0, depth)?;
9657 self.1.encode(encoder, offset + 16, depth)?;
9658 self.2.encode(encoder, offset + 32, depth)?;
9659 Ok(())
9660 }
9661 }
9662
9663 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9664 for PackageResolverResolveWithContextRequest
9665 {
9666 #[inline(always)]
9667 fn new_empty() -> Self {
9668 Self {
9669 package_url: fidl::new_empty!(
9670 fidl::encoding::UnboundedString,
9671 fidl::encoding::DefaultFuchsiaResourceDialect
9672 ),
9673 context: fidl::new_empty!(
9674 ResolutionContext,
9675 fidl::encoding::DefaultFuchsiaResourceDialect
9676 ),
9677 dir: fidl::new_empty!(
9678 fidl::encoding::Endpoint<
9679 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9680 >,
9681 fidl::encoding::DefaultFuchsiaResourceDialect
9682 ),
9683 }
9684 }
9685
9686 #[inline]
9687 unsafe fn decode(
9688 &mut self,
9689 decoder: &mut fidl::encoding::Decoder<
9690 '_,
9691 fidl::encoding::DefaultFuchsiaResourceDialect,
9692 >,
9693 offset: usize,
9694 _depth: fidl::encoding::Depth,
9695 ) -> fidl::Result<()> {
9696 decoder.debug_check_bounds::<Self>(offset);
9697 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
9699 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9700 let mask = 0xffffffff00000000u64;
9701 let maskedval = padval & mask;
9702 if maskedval != 0 {
9703 return Err(fidl::Error::NonZeroPadding {
9704 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
9705 });
9706 }
9707 fidl::decode!(
9708 fidl::encoding::UnboundedString,
9709 fidl::encoding::DefaultFuchsiaResourceDialect,
9710 &mut self.package_url,
9711 decoder,
9712 offset + 0,
9713 _depth
9714 )?;
9715 fidl::decode!(
9716 ResolutionContext,
9717 fidl::encoding::DefaultFuchsiaResourceDialect,
9718 &mut self.context,
9719 decoder,
9720 offset + 16,
9721 _depth
9722 )?;
9723 fidl::decode!(
9724 fidl::encoding::Endpoint<
9725 fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
9726 >,
9727 fidl::encoding::DefaultFuchsiaResourceDialect,
9728 &mut self.dir,
9729 decoder,
9730 offset + 32,
9731 _depth
9732 )?;
9733 Ok(())
9734 }
9735 }
9736
9737 impl fidl::encoding::ResourceTypeMarker for RepositoryManagerListRequest {
9738 type Borrowed<'a> = &'a mut Self;
9739 fn take_or_borrow<'a>(
9740 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9741 ) -> Self::Borrowed<'a> {
9742 value
9743 }
9744 }
9745
9746 unsafe impl fidl::encoding::TypeMarker for RepositoryManagerListRequest {
9747 type Owned = Self;
9748
9749 #[inline(always)]
9750 fn inline_align(_context: fidl::encoding::Context) -> usize {
9751 4
9752 }
9753
9754 #[inline(always)]
9755 fn inline_size(_context: fidl::encoding::Context) -> usize {
9756 4
9757 }
9758 }
9759
9760 unsafe impl
9761 fidl::encoding::Encode<
9762 RepositoryManagerListRequest,
9763 fidl::encoding::DefaultFuchsiaResourceDialect,
9764 > for &mut RepositoryManagerListRequest
9765 {
9766 #[inline]
9767 unsafe fn encode(
9768 self,
9769 encoder: &mut fidl::encoding::Encoder<
9770 '_,
9771 fidl::encoding::DefaultFuchsiaResourceDialect,
9772 >,
9773 offset: usize,
9774 _depth: fidl::encoding::Depth,
9775 ) -> fidl::Result<()> {
9776 encoder.debug_check_bounds::<RepositoryManagerListRequest>(offset);
9777 fidl::encoding::Encode::<RepositoryManagerListRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9779 (
9780 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RepositoryIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
9781 ),
9782 encoder, offset, _depth
9783 )
9784 }
9785 }
9786 unsafe impl<
9787 T0: fidl::encoding::Encode<
9788 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RepositoryIteratorMarker>>,
9789 fidl::encoding::DefaultFuchsiaResourceDialect,
9790 >,
9791 >
9792 fidl::encoding::Encode<
9793 RepositoryManagerListRequest,
9794 fidl::encoding::DefaultFuchsiaResourceDialect,
9795 > for (T0,)
9796 {
9797 #[inline]
9798 unsafe fn encode(
9799 self,
9800 encoder: &mut fidl::encoding::Encoder<
9801 '_,
9802 fidl::encoding::DefaultFuchsiaResourceDialect,
9803 >,
9804 offset: usize,
9805 depth: fidl::encoding::Depth,
9806 ) -> fidl::Result<()> {
9807 encoder.debug_check_bounds::<RepositoryManagerListRequest>(offset);
9808 self.0.encode(encoder, offset + 0, depth)?;
9812 Ok(())
9813 }
9814 }
9815
9816 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9817 for RepositoryManagerListRequest
9818 {
9819 #[inline(always)]
9820 fn new_empty() -> Self {
9821 Self {
9822 iterator: fidl::new_empty!(
9823 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RepositoryIteratorMarker>>,
9824 fidl::encoding::DefaultFuchsiaResourceDialect
9825 ),
9826 }
9827 }
9828
9829 #[inline]
9830 unsafe fn decode(
9831 &mut self,
9832 decoder: &mut fidl::encoding::Decoder<
9833 '_,
9834 fidl::encoding::DefaultFuchsiaResourceDialect,
9835 >,
9836 offset: usize,
9837 _depth: fidl::encoding::Depth,
9838 ) -> fidl::Result<()> {
9839 decoder.debug_check_bounds::<Self>(offset);
9840 fidl::decode!(
9842 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RepositoryIteratorMarker>>,
9843 fidl::encoding::DefaultFuchsiaResourceDialect,
9844 &mut self.iterator,
9845 decoder,
9846 offset + 0,
9847 _depth
9848 )?;
9849 Ok(())
9850 }
9851 }
9852
9853 impl fidl::encoding::ResourceTypeMarker for RetainedPackagesReplaceRequest {
9854 type Borrowed<'a> = &'a mut Self;
9855 fn take_or_borrow<'a>(
9856 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9857 ) -> Self::Borrowed<'a> {
9858 value
9859 }
9860 }
9861
9862 unsafe impl fidl::encoding::TypeMarker for RetainedPackagesReplaceRequest {
9863 type Owned = Self;
9864
9865 #[inline(always)]
9866 fn inline_align(_context: fidl::encoding::Context) -> usize {
9867 4
9868 }
9869
9870 #[inline(always)]
9871 fn inline_size(_context: fidl::encoding::Context) -> usize {
9872 4
9873 }
9874 }
9875
9876 unsafe impl
9877 fidl::encoding::Encode<
9878 RetainedPackagesReplaceRequest,
9879 fidl::encoding::DefaultFuchsiaResourceDialect,
9880 > for &mut RetainedPackagesReplaceRequest
9881 {
9882 #[inline]
9883 unsafe fn encode(
9884 self,
9885 encoder: &mut fidl::encoding::Encoder<
9886 '_,
9887 fidl::encoding::DefaultFuchsiaResourceDialect,
9888 >,
9889 offset: usize,
9890 _depth: fidl::encoding::Depth,
9891 ) -> fidl::Result<()> {
9892 encoder.debug_check_bounds::<RetainedPackagesReplaceRequest>(offset);
9893 fidl::encoding::Encode::<RetainedPackagesReplaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9895 (
9896 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobIdIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
9897 ),
9898 encoder, offset, _depth
9899 )
9900 }
9901 }
9902 unsafe impl<
9903 T0: fidl::encoding::Encode<
9904 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobIdIteratorMarker>>,
9905 fidl::encoding::DefaultFuchsiaResourceDialect,
9906 >,
9907 >
9908 fidl::encoding::Encode<
9909 RetainedPackagesReplaceRequest,
9910 fidl::encoding::DefaultFuchsiaResourceDialect,
9911 > for (T0,)
9912 {
9913 #[inline]
9914 unsafe fn encode(
9915 self,
9916 encoder: &mut fidl::encoding::Encoder<
9917 '_,
9918 fidl::encoding::DefaultFuchsiaResourceDialect,
9919 >,
9920 offset: usize,
9921 depth: fidl::encoding::Depth,
9922 ) -> fidl::Result<()> {
9923 encoder.debug_check_bounds::<RetainedPackagesReplaceRequest>(offset);
9924 self.0.encode(encoder, offset + 0, depth)?;
9928 Ok(())
9929 }
9930 }
9931
9932 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9933 for RetainedPackagesReplaceRequest
9934 {
9935 #[inline(always)]
9936 fn new_empty() -> Self {
9937 Self {
9938 iterator: fidl::new_empty!(
9939 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobIdIteratorMarker>>,
9940 fidl::encoding::DefaultFuchsiaResourceDialect
9941 ),
9942 }
9943 }
9944
9945 #[inline]
9946 unsafe fn decode(
9947 &mut self,
9948 decoder: &mut fidl::encoding::Decoder<
9949 '_,
9950 fidl::encoding::DefaultFuchsiaResourceDialect,
9951 >,
9952 offset: usize,
9953 _depth: fidl::encoding::Depth,
9954 ) -> fidl::Result<()> {
9955 decoder.debug_check_bounds::<Self>(offset);
9956 fidl::decode!(
9958 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobIdIteratorMarker>>,
9959 fidl::encoding::DefaultFuchsiaResourceDialect,
9960 &mut self.iterator,
9961 decoder,
9962 offset + 0,
9963 _depth
9964 )?;
9965 Ok(())
9966 }
9967 }
9968
9969 impl fidl::encoding::ResourceTypeMarker for BlobWriter {
9970 type Borrowed<'a> = &'a mut Self;
9971 fn take_or_borrow<'a>(
9972 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9973 ) -> Self::Borrowed<'a> {
9974 value
9975 }
9976 }
9977
9978 unsafe impl fidl::encoding::TypeMarker for BlobWriter {
9979 type Owned = Self;
9980
9981 #[inline(always)]
9982 fn inline_align(_context: fidl::encoding::Context) -> usize {
9983 8
9984 }
9985
9986 #[inline(always)]
9987 fn inline_size(_context: fidl::encoding::Context) -> usize {
9988 16
9989 }
9990 }
9991
9992 unsafe impl fidl::encoding::Encode<BlobWriter, fidl::encoding::DefaultFuchsiaResourceDialect>
9993 for &mut BlobWriter
9994 {
9995 #[inline]
9996 unsafe fn encode(
9997 self,
9998 encoder: &mut fidl::encoding::Encoder<
9999 '_,
10000 fidl::encoding::DefaultFuchsiaResourceDialect,
10001 >,
10002 offset: usize,
10003 _depth: fidl::encoding::Depth,
10004 ) -> fidl::Result<()> {
10005 encoder.debug_check_bounds::<BlobWriter>(offset);
10006 encoder.write_num::<u64>(self.ordinal(), offset);
10007 match self {
10008 BlobWriter::File(ref mut val) => fidl::encoding::encode_in_envelope::<
10009 fidl::encoding::Endpoint<
10010 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
10011 >,
10012 fidl::encoding::DefaultFuchsiaResourceDialect,
10013 >(
10014 <fidl::encoding::Endpoint<
10015 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
10016 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10017 val
10018 ),
10019 encoder,
10020 offset + 8,
10021 _depth,
10022 ),
10023 BlobWriter::Writer(ref mut val) => fidl::encoding::encode_in_envelope::<
10024 fidl::encoding::Endpoint<
10025 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
10026 >,
10027 fidl::encoding::DefaultFuchsiaResourceDialect,
10028 >(
10029 <fidl::encoding::Endpoint<
10030 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
10031 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10032 val
10033 ),
10034 encoder,
10035 offset + 8,
10036 _depth,
10037 ),
10038 }
10039 }
10040 }
10041
10042 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for BlobWriter {
10043 #[inline(always)]
10044 fn new_empty() -> Self {
10045 Self::File(fidl::new_empty!(
10046 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>>,
10047 fidl::encoding::DefaultFuchsiaResourceDialect
10048 ))
10049 }
10050
10051 #[inline]
10052 unsafe fn decode(
10053 &mut self,
10054 decoder: &mut fidl::encoding::Decoder<
10055 '_,
10056 fidl::encoding::DefaultFuchsiaResourceDialect,
10057 >,
10058 offset: usize,
10059 mut depth: fidl::encoding::Depth,
10060 ) -> fidl::Result<()> {
10061 decoder.debug_check_bounds::<Self>(offset);
10062 #[allow(unused_variables)]
10063 let next_out_of_line = decoder.next_out_of_line();
10064 let handles_before = decoder.remaining_handles();
10065 let (ordinal, inlined, num_bytes, num_handles) =
10066 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10067
10068 let member_inline_size = match ordinal {
10069 1 => <fidl::encoding::Endpoint<
10070 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
10071 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10072 2 => <fidl::encoding::Endpoint<
10073 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
10074 > as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10075 _ => return Err(fidl::Error::UnknownUnionTag),
10076 };
10077
10078 if inlined != (member_inline_size <= 4) {
10079 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10080 }
10081 let _inner_offset;
10082 if inlined {
10083 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10084 _inner_offset = offset + 8;
10085 } else {
10086 depth.increment()?;
10087 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10088 }
10089 match ordinal {
10090 1 => {
10091 #[allow(irrefutable_let_patterns)]
10092 if let BlobWriter::File(_) = self {
10093 } else {
10095 *self = BlobWriter::File(fidl::new_empty!(
10097 fidl::encoding::Endpoint<
10098 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
10099 >,
10100 fidl::encoding::DefaultFuchsiaResourceDialect
10101 ));
10102 }
10103 #[allow(irrefutable_let_patterns)]
10104 if let BlobWriter::File(ref mut val) = self {
10105 fidl::decode!(
10106 fidl::encoding::Endpoint<
10107 fidl::endpoints::ClientEnd<fidl_fuchsia_io::FileMarker>,
10108 >,
10109 fidl::encoding::DefaultFuchsiaResourceDialect,
10110 val,
10111 decoder,
10112 _inner_offset,
10113 depth
10114 )?;
10115 } else {
10116 unreachable!()
10117 }
10118 }
10119 2 => {
10120 #[allow(irrefutable_let_patterns)]
10121 if let BlobWriter::Writer(_) = self {
10122 } else {
10124 *self = BlobWriter::Writer(fidl::new_empty!(
10126 fidl::encoding::Endpoint<
10127 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
10128 >,
10129 fidl::encoding::DefaultFuchsiaResourceDialect
10130 ));
10131 }
10132 #[allow(irrefutable_let_patterns)]
10133 if let BlobWriter::Writer(ref mut val) = self {
10134 fidl::decode!(
10135 fidl::encoding::Endpoint<
10136 fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::BlobWriterMarker>,
10137 >,
10138 fidl::encoding::DefaultFuchsiaResourceDialect,
10139 val,
10140 decoder,
10141 _inner_offset,
10142 depth
10143 )?;
10144 } else {
10145 unreachable!()
10146 }
10147 }
10148 ordinal => panic!("unexpected ordinal {:?}", ordinal),
10149 }
10150 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10151 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10152 }
10153 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10154 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10155 }
10156 Ok(())
10157 }
10158 }
10159}