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_fxfs__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct BlobCreatorCreateResponse {
16 pub writer: fidl::endpoints::ClientEnd<BlobWriterMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobCreatorCreateResponse {}
20
21#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct BlobReaderGetVmoResponse {
23 pub vmo: fidl::Vmo,
24}
25
26impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobReaderGetVmoResponse {}
27
28#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29pub struct BlobWriterGetVmoResponse {
30 pub vmo: fidl::Vmo,
31}
32
33impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobWriterGetVmoResponse {}
34
35#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36pub struct FileBackedVolumeProviderOpenRequest {
37 pub parent_directory_token: fidl::Handle,
38 pub name: String,
39 pub server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block_volume::VolumeMarker>,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for FileBackedVolumeProviderOpenRequest
44{
45}
46
47#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
48pub struct BlobCreatorMarker;
49
50impl fidl::endpoints::ProtocolMarker for BlobCreatorMarker {
51 type Proxy = BlobCreatorProxy;
52 type RequestStream = BlobCreatorRequestStream;
53 #[cfg(target_os = "fuchsia")]
54 type SynchronousProxy = BlobCreatorSynchronousProxy;
55
56 const DEBUG_NAME: &'static str = "fuchsia.fxfs.BlobCreator";
57}
58impl fidl::endpoints::DiscoverableProtocolMarker for BlobCreatorMarker {}
59pub type BlobCreatorCreateResult =
60 Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>;
61
62pub trait BlobCreatorProxyInterface: Send + Sync {
63 type CreateResponseFut: std::future::Future<Output = Result<BlobCreatorCreateResult, fidl::Error>>
64 + Send;
65 fn r#create(&self, hash: &[u8; 32], allow_existing: bool) -> Self::CreateResponseFut;
66}
67#[derive(Debug)]
68#[cfg(target_os = "fuchsia")]
69pub struct BlobCreatorSynchronousProxy {
70 client: fidl::client::sync::Client,
71}
72
73#[cfg(target_os = "fuchsia")]
74impl fidl::endpoints::SynchronousProxy for BlobCreatorSynchronousProxy {
75 type Proxy = BlobCreatorProxy;
76 type Protocol = BlobCreatorMarker;
77
78 fn from_channel(inner: fidl::Channel) -> Self {
79 Self::new(inner)
80 }
81
82 fn into_channel(self) -> fidl::Channel {
83 self.client.into_channel()
84 }
85
86 fn as_channel(&self) -> &fidl::Channel {
87 self.client.as_channel()
88 }
89}
90
91#[cfg(target_os = "fuchsia")]
92impl BlobCreatorSynchronousProxy {
93 pub fn new(channel: fidl::Channel) -> Self {
94 let protocol_name = <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
95 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
96 }
97
98 pub fn into_channel(self) -> fidl::Channel {
99 self.client.into_channel()
100 }
101
102 pub fn wait_for_event(
105 &self,
106 deadline: zx::MonotonicInstant,
107 ) -> Result<BlobCreatorEvent, fidl::Error> {
108 BlobCreatorEvent::decode(self.client.wait_for_event(deadline)?)
109 }
110
111 pub fn r#create(
119 &self,
120 mut hash: &[u8; 32],
121 mut allow_existing: bool,
122 ___deadline: zx::MonotonicInstant,
123 ) -> Result<BlobCreatorCreateResult, fidl::Error> {
124 let _response = self.client.send_query::<
125 BlobCreatorCreateRequest,
126 fidl::encoding::ResultType<BlobCreatorCreateResponse, CreateBlobError>,
127 >(
128 (hash, allow_existing,),
129 0x4288fe720cca70d7,
130 fidl::encoding::DynamicFlags::empty(),
131 ___deadline,
132 )?;
133 Ok(_response.map(|x| x.writer))
134 }
135}
136
137#[cfg(target_os = "fuchsia")]
138impl From<BlobCreatorSynchronousProxy> for zx::Handle {
139 fn from(value: BlobCreatorSynchronousProxy) -> Self {
140 value.into_channel().into()
141 }
142}
143
144#[cfg(target_os = "fuchsia")]
145impl From<fidl::Channel> for BlobCreatorSynchronousProxy {
146 fn from(value: fidl::Channel) -> Self {
147 Self::new(value)
148 }
149}
150
151#[cfg(target_os = "fuchsia")]
152impl fidl::endpoints::FromClient for BlobCreatorSynchronousProxy {
153 type Protocol = BlobCreatorMarker;
154
155 fn from_client(value: fidl::endpoints::ClientEnd<BlobCreatorMarker>) -> Self {
156 Self::new(value.into_channel())
157 }
158}
159
160#[derive(Debug, Clone)]
161pub struct BlobCreatorProxy {
162 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
163}
164
165impl fidl::endpoints::Proxy for BlobCreatorProxy {
166 type Protocol = BlobCreatorMarker;
167
168 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
169 Self::new(inner)
170 }
171
172 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
173 self.client.into_channel().map_err(|client| Self { client })
174 }
175
176 fn as_channel(&self) -> &::fidl::AsyncChannel {
177 self.client.as_channel()
178 }
179}
180
181impl BlobCreatorProxy {
182 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
184 let protocol_name = <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
185 Self { client: fidl::client::Client::new(channel, protocol_name) }
186 }
187
188 pub fn take_event_stream(&self) -> BlobCreatorEventStream {
194 BlobCreatorEventStream { event_receiver: self.client.take_event_receiver() }
195 }
196
197 pub fn r#create(
205 &self,
206 mut hash: &[u8; 32],
207 mut allow_existing: bool,
208 ) -> fidl::client::QueryResponseFut<
209 BlobCreatorCreateResult,
210 fidl::encoding::DefaultFuchsiaResourceDialect,
211 > {
212 BlobCreatorProxyInterface::r#create(self, hash, allow_existing)
213 }
214}
215
216impl BlobCreatorProxyInterface for BlobCreatorProxy {
217 type CreateResponseFut = fidl::client::QueryResponseFut<
218 BlobCreatorCreateResult,
219 fidl::encoding::DefaultFuchsiaResourceDialect,
220 >;
221 fn r#create(&self, mut hash: &[u8; 32], mut allow_existing: bool) -> Self::CreateResponseFut {
222 fn _decode(
223 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
224 ) -> Result<BlobCreatorCreateResult, fidl::Error> {
225 let _response = fidl::client::decode_transaction_body::<
226 fidl::encoding::ResultType<BlobCreatorCreateResponse, CreateBlobError>,
227 fidl::encoding::DefaultFuchsiaResourceDialect,
228 0x4288fe720cca70d7,
229 >(_buf?)?;
230 Ok(_response.map(|x| x.writer))
231 }
232 self.client.send_query_and_decode::<BlobCreatorCreateRequest, BlobCreatorCreateResult>(
233 (hash, allow_existing),
234 0x4288fe720cca70d7,
235 fidl::encoding::DynamicFlags::empty(),
236 _decode,
237 )
238 }
239}
240
241pub struct BlobCreatorEventStream {
242 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
243}
244
245impl std::marker::Unpin for BlobCreatorEventStream {}
246
247impl futures::stream::FusedStream for BlobCreatorEventStream {
248 fn is_terminated(&self) -> bool {
249 self.event_receiver.is_terminated()
250 }
251}
252
253impl futures::Stream for BlobCreatorEventStream {
254 type Item = Result<BlobCreatorEvent, fidl::Error>;
255
256 fn poll_next(
257 mut self: std::pin::Pin<&mut Self>,
258 cx: &mut std::task::Context<'_>,
259 ) -> std::task::Poll<Option<Self::Item>> {
260 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
261 &mut self.event_receiver,
262 cx
263 )?) {
264 Some(buf) => std::task::Poll::Ready(Some(BlobCreatorEvent::decode(buf))),
265 None => std::task::Poll::Ready(None),
266 }
267 }
268}
269
270#[derive(Debug)]
271pub enum BlobCreatorEvent {}
272
273impl BlobCreatorEvent {
274 fn decode(
276 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
277 ) -> Result<BlobCreatorEvent, fidl::Error> {
278 let (bytes, _handles) = buf.split_mut();
279 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
280 debug_assert_eq!(tx_header.tx_id, 0);
281 match tx_header.ordinal {
282 _ => Err(fidl::Error::UnknownOrdinal {
283 ordinal: tx_header.ordinal,
284 protocol_name: <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
285 }),
286 }
287 }
288}
289
290pub struct BlobCreatorRequestStream {
292 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
293 is_terminated: bool,
294}
295
296impl std::marker::Unpin for BlobCreatorRequestStream {}
297
298impl futures::stream::FusedStream for BlobCreatorRequestStream {
299 fn is_terminated(&self) -> bool {
300 self.is_terminated
301 }
302}
303
304impl fidl::endpoints::RequestStream for BlobCreatorRequestStream {
305 type Protocol = BlobCreatorMarker;
306 type ControlHandle = BlobCreatorControlHandle;
307
308 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
309 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
310 }
311
312 fn control_handle(&self) -> Self::ControlHandle {
313 BlobCreatorControlHandle { inner: self.inner.clone() }
314 }
315
316 fn into_inner(
317 self,
318 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
319 {
320 (self.inner, self.is_terminated)
321 }
322
323 fn from_inner(
324 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
325 is_terminated: bool,
326 ) -> Self {
327 Self { inner, is_terminated }
328 }
329}
330
331impl futures::Stream for BlobCreatorRequestStream {
332 type Item = Result<BlobCreatorRequest, fidl::Error>;
333
334 fn poll_next(
335 mut self: std::pin::Pin<&mut Self>,
336 cx: &mut std::task::Context<'_>,
337 ) -> std::task::Poll<Option<Self::Item>> {
338 let this = &mut *self;
339 if this.inner.check_shutdown(cx) {
340 this.is_terminated = true;
341 return std::task::Poll::Ready(None);
342 }
343 if this.is_terminated {
344 panic!("polled BlobCreatorRequestStream after completion");
345 }
346 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
347 |bytes, handles| {
348 match this.inner.channel().read_etc(cx, bytes, handles) {
349 std::task::Poll::Ready(Ok(())) => {}
350 std::task::Poll::Pending => return std::task::Poll::Pending,
351 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
352 this.is_terminated = true;
353 return std::task::Poll::Ready(None);
354 }
355 std::task::Poll::Ready(Err(e)) => {
356 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
357 e.into(),
358 ))));
359 }
360 }
361
362 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
364
365 std::task::Poll::Ready(Some(match header.ordinal {
366 0x4288fe720cca70d7 => {
367 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
368 let mut req = fidl::new_empty!(
369 BlobCreatorCreateRequest,
370 fidl::encoding::DefaultFuchsiaResourceDialect
371 );
372 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobCreatorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
373 let control_handle = BlobCreatorControlHandle { inner: this.inner.clone() };
374 Ok(BlobCreatorRequest::Create {
375 hash: req.hash,
376 allow_existing: req.allow_existing,
377
378 responder: BlobCreatorCreateResponder {
379 control_handle: std::mem::ManuallyDrop::new(control_handle),
380 tx_id: header.tx_id,
381 },
382 })
383 }
384 _ => Err(fidl::Error::UnknownOrdinal {
385 ordinal: header.ordinal,
386 protocol_name:
387 <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
388 }),
389 }))
390 },
391 )
392 }
393}
394
395#[derive(Debug)]
396pub enum BlobCreatorRequest {
397 Create { hash: [u8; 32], allow_existing: bool, responder: BlobCreatorCreateResponder },
405}
406
407impl BlobCreatorRequest {
408 #[allow(irrefutable_let_patterns)]
409 pub fn into_create(self) -> Option<([u8; 32], bool, BlobCreatorCreateResponder)> {
410 if let BlobCreatorRequest::Create { hash, allow_existing, responder } = self {
411 Some((hash, allow_existing, responder))
412 } else {
413 None
414 }
415 }
416
417 pub fn method_name(&self) -> &'static str {
419 match *self {
420 BlobCreatorRequest::Create { .. } => "create",
421 }
422 }
423}
424
425#[derive(Debug, Clone)]
426pub struct BlobCreatorControlHandle {
427 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
428}
429
430impl fidl::endpoints::ControlHandle for BlobCreatorControlHandle {
431 fn shutdown(&self) {
432 self.inner.shutdown()
433 }
434 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
435 self.inner.shutdown_with_epitaph(status)
436 }
437
438 fn is_closed(&self) -> bool {
439 self.inner.channel().is_closed()
440 }
441 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
442 self.inner.channel().on_closed()
443 }
444
445 #[cfg(target_os = "fuchsia")]
446 fn signal_peer(
447 &self,
448 clear_mask: zx::Signals,
449 set_mask: zx::Signals,
450 ) -> Result<(), zx_status::Status> {
451 use fidl::Peered;
452 self.inner.channel().signal_peer(clear_mask, set_mask)
453 }
454}
455
456impl BlobCreatorControlHandle {}
457
458#[must_use = "FIDL methods require a response to be sent"]
459#[derive(Debug)]
460pub struct BlobCreatorCreateResponder {
461 control_handle: std::mem::ManuallyDrop<BlobCreatorControlHandle>,
462 tx_id: u32,
463}
464
465impl std::ops::Drop for BlobCreatorCreateResponder {
469 fn drop(&mut self) {
470 self.control_handle.shutdown();
471 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
473 }
474}
475
476impl fidl::endpoints::Responder for BlobCreatorCreateResponder {
477 type ControlHandle = BlobCreatorControlHandle;
478
479 fn control_handle(&self) -> &BlobCreatorControlHandle {
480 &self.control_handle
481 }
482
483 fn drop_without_shutdown(mut self) {
484 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
486 std::mem::forget(self);
488 }
489}
490
491impl BlobCreatorCreateResponder {
492 pub fn send(
496 self,
497 mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
498 ) -> Result<(), fidl::Error> {
499 let _result = self.send_raw(result);
500 if _result.is_err() {
501 self.control_handle.shutdown();
502 }
503 self.drop_without_shutdown();
504 _result
505 }
506
507 pub fn send_no_shutdown_on_err(
509 self,
510 mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
511 ) -> Result<(), fidl::Error> {
512 let _result = self.send_raw(result);
513 self.drop_without_shutdown();
514 _result
515 }
516
517 fn send_raw(
518 &self,
519 mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
520 ) -> Result<(), fidl::Error> {
521 self.control_handle.inner.send::<fidl::encoding::ResultType<
522 BlobCreatorCreateResponse,
523 CreateBlobError,
524 >>(
525 result.map(|writer| (writer,)),
526 self.tx_id,
527 0x4288fe720cca70d7,
528 fidl::encoding::DynamicFlags::empty(),
529 )
530 }
531}
532
533#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
534pub struct BlobReaderMarker;
535
536impl fidl::endpoints::ProtocolMarker for BlobReaderMarker {
537 type Proxy = BlobReaderProxy;
538 type RequestStream = BlobReaderRequestStream;
539 #[cfg(target_os = "fuchsia")]
540 type SynchronousProxy = BlobReaderSynchronousProxy;
541
542 const DEBUG_NAME: &'static str = "fuchsia.fxfs.BlobReader";
543}
544impl fidl::endpoints::DiscoverableProtocolMarker for BlobReaderMarker {}
545pub type BlobReaderGetVmoResult = Result<fidl::Vmo, i32>;
546
547pub trait BlobReaderProxyInterface: Send + Sync {
548 type GetVmoResponseFut: std::future::Future<Output = Result<BlobReaderGetVmoResult, fidl::Error>>
549 + Send;
550 fn r#get_vmo(&self, blob_hash: &[u8; 32]) -> Self::GetVmoResponseFut;
551}
552#[derive(Debug)]
553#[cfg(target_os = "fuchsia")]
554pub struct BlobReaderSynchronousProxy {
555 client: fidl::client::sync::Client,
556}
557
558#[cfg(target_os = "fuchsia")]
559impl fidl::endpoints::SynchronousProxy for BlobReaderSynchronousProxy {
560 type Proxy = BlobReaderProxy;
561 type Protocol = BlobReaderMarker;
562
563 fn from_channel(inner: fidl::Channel) -> Self {
564 Self::new(inner)
565 }
566
567 fn into_channel(self) -> fidl::Channel {
568 self.client.into_channel()
569 }
570
571 fn as_channel(&self) -> &fidl::Channel {
572 self.client.as_channel()
573 }
574}
575
576#[cfg(target_os = "fuchsia")]
577impl BlobReaderSynchronousProxy {
578 pub fn new(channel: fidl::Channel) -> Self {
579 let protocol_name = <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
580 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
581 }
582
583 pub fn into_channel(self) -> fidl::Channel {
584 self.client.into_channel()
585 }
586
587 pub fn wait_for_event(
590 &self,
591 deadline: zx::MonotonicInstant,
592 ) -> Result<BlobReaderEvent, fidl::Error> {
593 BlobReaderEvent::decode(self.client.wait_for_event(deadline)?)
594 }
595
596 pub fn r#get_vmo(
598 &self,
599 mut blob_hash: &[u8; 32],
600 ___deadline: zx::MonotonicInstant,
601 ) -> Result<BlobReaderGetVmoResult, fidl::Error> {
602 let _response = self.client.send_query::<
603 BlobReaderGetVmoRequest,
604 fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>,
605 >(
606 (blob_hash,),
607 0x2fa72823ef7f11f4,
608 fidl::encoding::DynamicFlags::empty(),
609 ___deadline,
610 )?;
611 Ok(_response.map(|x| x.vmo))
612 }
613}
614
615#[cfg(target_os = "fuchsia")]
616impl From<BlobReaderSynchronousProxy> for zx::Handle {
617 fn from(value: BlobReaderSynchronousProxy) -> Self {
618 value.into_channel().into()
619 }
620}
621
622#[cfg(target_os = "fuchsia")]
623impl From<fidl::Channel> for BlobReaderSynchronousProxy {
624 fn from(value: fidl::Channel) -> Self {
625 Self::new(value)
626 }
627}
628
629#[cfg(target_os = "fuchsia")]
630impl fidl::endpoints::FromClient for BlobReaderSynchronousProxy {
631 type Protocol = BlobReaderMarker;
632
633 fn from_client(value: fidl::endpoints::ClientEnd<BlobReaderMarker>) -> Self {
634 Self::new(value.into_channel())
635 }
636}
637
638#[derive(Debug, Clone)]
639pub struct BlobReaderProxy {
640 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
641}
642
643impl fidl::endpoints::Proxy for BlobReaderProxy {
644 type Protocol = BlobReaderMarker;
645
646 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
647 Self::new(inner)
648 }
649
650 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
651 self.client.into_channel().map_err(|client| Self { client })
652 }
653
654 fn as_channel(&self) -> &::fidl::AsyncChannel {
655 self.client.as_channel()
656 }
657}
658
659impl BlobReaderProxy {
660 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
662 let protocol_name = <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
663 Self { client: fidl::client::Client::new(channel, protocol_name) }
664 }
665
666 pub fn take_event_stream(&self) -> BlobReaderEventStream {
672 BlobReaderEventStream { event_receiver: self.client.take_event_receiver() }
673 }
674
675 pub fn r#get_vmo(
677 &self,
678 mut blob_hash: &[u8; 32],
679 ) -> fidl::client::QueryResponseFut<
680 BlobReaderGetVmoResult,
681 fidl::encoding::DefaultFuchsiaResourceDialect,
682 > {
683 BlobReaderProxyInterface::r#get_vmo(self, blob_hash)
684 }
685}
686
687impl BlobReaderProxyInterface for BlobReaderProxy {
688 type GetVmoResponseFut = fidl::client::QueryResponseFut<
689 BlobReaderGetVmoResult,
690 fidl::encoding::DefaultFuchsiaResourceDialect,
691 >;
692 fn r#get_vmo(&self, mut blob_hash: &[u8; 32]) -> Self::GetVmoResponseFut {
693 fn _decode(
694 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
695 ) -> Result<BlobReaderGetVmoResult, fidl::Error> {
696 let _response = fidl::client::decode_transaction_body::<
697 fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>,
698 fidl::encoding::DefaultFuchsiaResourceDialect,
699 0x2fa72823ef7f11f4,
700 >(_buf?)?;
701 Ok(_response.map(|x| x.vmo))
702 }
703 self.client.send_query_and_decode::<BlobReaderGetVmoRequest, BlobReaderGetVmoResult>(
704 (blob_hash,),
705 0x2fa72823ef7f11f4,
706 fidl::encoding::DynamicFlags::empty(),
707 _decode,
708 )
709 }
710}
711
712pub struct BlobReaderEventStream {
713 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
714}
715
716impl std::marker::Unpin for BlobReaderEventStream {}
717
718impl futures::stream::FusedStream for BlobReaderEventStream {
719 fn is_terminated(&self) -> bool {
720 self.event_receiver.is_terminated()
721 }
722}
723
724impl futures::Stream for BlobReaderEventStream {
725 type Item = Result<BlobReaderEvent, fidl::Error>;
726
727 fn poll_next(
728 mut self: std::pin::Pin<&mut Self>,
729 cx: &mut std::task::Context<'_>,
730 ) -> std::task::Poll<Option<Self::Item>> {
731 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
732 &mut self.event_receiver,
733 cx
734 )?) {
735 Some(buf) => std::task::Poll::Ready(Some(BlobReaderEvent::decode(buf))),
736 None => std::task::Poll::Ready(None),
737 }
738 }
739}
740
741#[derive(Debug)]
742pub enum BlobReaderEvent {}
743
744impl BlobReaderEvent {
745 fn decode(
747 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
748 ) -> Result<BlobReaderEvent, fidl::Error> {
749 let (bytes, _handles) = buf.split_mut();
750 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
751 debug_assert_eq!(tx_header.tx_id, 0);
752 match tx_header.ordinal {
753 _ => Err(fidl::Error::UnknownOrdinal {
754 ordinal: tx_header.ordinal,
755 protocol_name: <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
756 }),
757 }
758 }
759}
760
761pub struct BlobReaderRequestStream {
763 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
764 is_terminated: bool,
765}
766
767impl std::marker::Unpin for BlobReaderRequestStream {}
768
769impl futures::stream::FusedStream for BlobReaderRequestStream {
770 fn is_terminated(&self) -> bool {
771 self.is_terminated
772 }
773}
774
775impl fidl::endpoints::RequestStream for BlobReaderRequestStream {
776 type Protocol = BlobReaderMarker;
777 type ControlHandle = BlobReaderControlHandle;
778
779 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
780 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
781 }
782
783 fn control_handle(&self) -> Self::ControlHandle {
784 BlobReaderControlHandle { inner: self.inner.clone() }
785 }
786
787 fn into_inner(
788 self,
789 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
790 {
791 (self.inner, self.is_terminated)
792 }
793
794 fn from_inner(
795 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
796 is_terminated: bool,
797 ) -> Self {
798 Self { inner, is_terminated }
799 }
800}
801
802impl futures::Stream for BlobReaderRequestStream {
803 type Item = Result<BlobReaderRequest, fidl::Error>;
804
805 fn poll_next(
806 mut self: std::pin::Pin<&mut Self>,
807 cx: &mut std::task::Context<'_>,
808 ) -> std::task::Poll<Option<Self::Item>> {
809 let this = &mut *self;
810 if this.inner.check_shutdown(cx) {
811 this.is_terminated = true;
812 return std::task::Poll::Ready(None);
813 }
814 if this.is_terminated {
815 panic!("polled BlobReaderRequestStream after completion");
816 }
817 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
818 |bytes, handles| {
819 match this.inner.channel().read_etc(cx, bytes, handles) {
820 std::task::Poll::Ready(Ok(())) => {}
821 std::task::Poll::Pending => return std::task::Poll::Pending,
822 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
823 this.is_terminated = true;
824 return std::task::Poll::Ready(None);
825 }
826 std::task::Poll::Ready(Err(e)) => {
827 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
828 e.into(),
829 ))));
830 }
831 }
832
833 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
835
836 std::task::Poll::Ready(Some(match header.ordinal {
837 0x2fa72823ef7f11f4 => {
838 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
839 let mut req = fidl::new_empty!(
840 BlobReaderGetVmoRequest,
841 fidl::encoding::DefaultFuchsiaResourceDialect
842 );
843 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobReaderGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
844 let control_handle = BlobReaderControlHandle { inner: this.inner.clone() };
845 Ok(BlobReaderRequest::GetVmo {
846 blob_hash: req.blob_hash,
847
848 responder: BlobReaderGetVmoResponder {
849 control_handle: std::mem::ManuallyDrop::new(control_handle),
850 tx_id: header.tx_id,
851 },
852 })
853 }
854 _ => Err(fidl::Error::UnknownOrdinal {
855 ordinal: header.ordinal,
856 protocol_name:
857 <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
858 }),
859 }))
860 },
861 )
862 }
863}
864
865#[derive(Debug)]
866pub enum BlobReaderRequest {
867 GetVmo { blob_hash: [u8; 32], responder: BlobReaderGetVmoResponder },
869}
870
871impl BlobReaderRequest {
872 #[allow(irrefutable_let_patterns)]
873 pub fn into_get_vmo(self) -> Option<([u8; 32], BlobReaderGetVmoResponder)> {
874 if let BlobReaderRequest::GetVmo { blob_hash, responder } = self {
875 Some((blob_hash, responder))
876 } else {
877 None
878 }
879 }
880
881 pub fn method_name(&self) -> &'static str {
883 match *self {
884 BlobReaderRequest::GetVmo { .. } => "get_vmo",
885 }
886 }
887}
888
889#[derive(Debug, Clone)]
890pub struct BlobReaderControlHandle {
891 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
892}
893
894impl fidl::endpoints::ControlHandle for BlobReaderControlHandle {
895 fn shutdown(&self) {
896 self.inner.shutdown()
897 }
898 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
899 self.inner.shutdown_with_epitaph(status)
900 }
901
902 fn is_closed(&self) -> bool {
903 self.inner.channel().is_closed()
904 }
905 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
906 self.inner.channel().on_closed()
907 }
908
909 #[cfg(target_os = "fuchsia")]
910 fn signal_peer(
911 &self,
912 clear_mask: zx::Signals,
913 set_mask: zx::Signals,
914 ) -> Result<(), zx_status::Status> {
915 use fidl::Peered;
916 self.inner.channel().signal_peer(clear_mask, set_mask)
917 }
918}
919
920impl BlobReaderControlHandle {}
921
922#[must_use = "FIDL methods require a response to be sent"]
923#[derive(Debug)]
924pub struct BlobReaderGetVmoResponder {
925 control_handle: std::mem::ManuallyDrop<BlobReaderControlHandle>,
926 tx_id: u32,
927}
928
929impl std::ops::Drop for BlobReaderGetVmoResponder {
933 fn drop(&mut self) {
934 self.control_handle.shutdown();
935 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
937 }
938}
939
940impl fidl::endpoints::Responder for BlobReaderGetVmoResponder {
941 type ControlHandle = BlobReaderControlHandle;
942
943 fn control_handle(&self) -> &BlobReaderControlHandle {
944 &self.control_handle
945 }
946
947 fn drop_without_shutdown(mut self) {
948 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
950 std::mem::forget(self);
952 }
953}
954
955impl BlobReaderGetVmoResponder {
956 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
960 let _result = self.send_raw(result);
961 if _result.is_err() {
962 self.control_handle.shutdown();
963 }
964 self.drop_without_shutdown();
965 _result
966 }
967
968 pub fn send_no_shutdown_on_err(
970 self,
971 mut result: Result<fidl::Vmo, i32>,
972 ) -> Result<(), fidl::Error> {
973 let _result = self.send_raw(result);
974 self.drop_without_shutdown();
975 _result
976 }
977
978 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
979 self.control_handle.inner.send::<fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>>(
980 result.map(|vmo| (vmo,)),
981 self.tx_id,
982 0x2fa72823ef7f11f4,
983 fidl::encoding::DynamicFlags::empty(),
984 )
985 }
986}
987
988#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
989pub struct BlobWriterMarker;
990
991impl fidl::endpoints::ProtocolMarker for BlobWriterMarker {
992 type Proxy = BlobWriterProxy;
993 type RequestStream = BlobWriterRequestStream;
994 #[cfg(target_os = "fuchsia")]
995 type SynchronousProxy = BlobWriterSynchronousProxy;
996
997 const DEBUG_NAME: &'static str = "(anonymous) BlobWriter";
998}
999pub type BlobWriterGetVmoResult = Result<fidl::Vmo, i32>;
1000pub type BlobWriterBytesReadyResult = Result<(), i32>;
1001
1002pub trait BlobWriterProxyInterface: Send + Sync {
1003 type GetVmoResponseFut: std::future::Future<Output = Result<BlobWriterGetVmoResult, fidl::Error>>
1004 + Send;
1005 fn r#get_vmo(&self, size: u64) -> Self::GetVmoResponseFut;
1006 type BytesReadyResponseFut: std::future::Future<Output = Result<BlobWriterBytesReadyResult, fidl::Error>>
1007 + Send;
1008 fn r#bytes_ready(&self, bytes_written: u64) -> Self::BytesReadyResponseFut;
1009}
1010#[derive(Debug)]
1011#[cfg(target_os = "fuchsia")]
1012pub struct BlobWriterSynchronousProxy {
1013 client: fidl::client::sync::Client,
1014}
1015
1016#[cfg(target_os = "fuchsia")]
1017impl fidl::endpoints::SynchronousProxy for BlobWriterSynchronousProxy {
1018 type Proxy = BlobWriterProxy;
1019 type Protocol = BlobWriterMarker;
1020
1021 fn from_channel(inner: fidl::Channel) -> Self {
1022 Self::new(inner)
1023 }
1024
1025 fn into_channel(self) -> fidl::Channel {
1026 self.client.into_channel()
1027 }
1028
1029 fn as_channel(&self) -> &fidl::Channel {
1030 self.client.as_channel()
1031 }
1032}
1033
1034#[cfg(target_os = "fuchsia")]
1035impl BlobWriterSynchronousProxy {
1036 pub fn new(channel: fidl::Channel) -> Self {
1037 let protocol_name = <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1038 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1039 }
1040
1041 pub fn into_channel(self) -> fidl::Channel {
1042 self.client.into_channel()
1043 }
1044
1045 pub fn wait_for_event(
1048 &self,
1049 deadline: zx::MonotonicInstant,
1050 ) -> Result<BlobWriterEvent, fidl::Error> {
1051 BlobWriterEvent::decode(self.client.wait_for_event(deadline)?)
1052 }
1053
1054 pub fn r#get_vmo(
1066 &self,
1067 mut size: u64,
1068 ___deadline: zx::MonotonicInstant,
1069 ) -> Result<BlobWriterGetVmoResult, fidl::Error> {
1070 let _response = self.client.send_query::<
1071 BlobWriterGetVmoRequest,
1072 fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>,
1073 >(
1074 (size,),
1075 0x50c8988b12b6f893,
1076 fidl::encoding::DynamicFlags::empty(),
1077 ___deadline,
1078 )?;
1079 Ok(_response.map(|x| x.vmo))
1080 }
1081
1082 pub fn r#bytes_ready(
1086 &self,
1087 mut bytes_written: u64,
1088 ___deadline: zx::MonotonicInstant,
1089 ) -> Result<BlobWriterBytesReadyResult, fidl::Error> {
1090 let _response = self.client.send_query::<
1091 BlobWriterBytesReadyRequest,
1092 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1093 >(
1094 (bytes_written,),
1095 0x7b308b473606c573,
1096 fidl::encoding::DynamicFlags::empty(),
1097 ___deadline,
1098 )?;
1099 Ok(_response.map(|x| x))
1100 }
1101}
1102
1103#[cfg(target_os = "fuchsia")]
1104impl From<BlobWriterSynchronousProxy> for zx::Handle {
1105 fn from(value: BlobWriterSynchronousProxy) -> Self {
1106 value.into_channel().into()
1107 }
1108}
1109
1110#[cfg(target_os = "fuchsia")]
1111impl From<fidl::Channel> for BlobWriterSynchronousProxy {
1112 fn from(value: fidl::Channel) -> Self {
1113 Self::new(value)
1114 }
1115}
1116
1117#[cfg(target_os = "fuchsia")]
1118impl fidl::endpoints::FromClient for BlobWriterSynchronousProxy {
1119 type Protocol = BlobWriterMarker;
1120
1121 fn from_client(value: fidl::endpoints::ClientEnd<BlobWriterMarker>) -> Self {
1122 Self::new(value.into_channel())
1123 }
1124}
1125
1126#[derive(Debug, Clone)]
1127pub struct BlobWriterProxy {
1128 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1129}
1130
1131impl fidl::endpoints::Proxy for BlobWriterProxy {
1132 type Protocol = BlobWriterMarker;
1133
1134 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1135 Self::new(inner)
1136 }
1137
1138 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1139 self.client.into_channel().map_err(|client| Self { client })
1140 }
1141
1142 fn as_channel(&self) -> &::fidl::AsyncChannel {
1143 self.client.as_channel()
1144 }
1145}
1146
1147impl BlobWriterProxy {
1148 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1150 let protocol_name = <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1151 Self { client: fidl::client::Client::new(channel, protocol_name) }
1152 }
1153
1154 pub fn take_event_stream(&self) -> BlobWriterEventStream {
1160 BlobWriterEventStream { event_receiver: self.client.take_event_receiver() }
1161 }
1162
1163 pub fn r#get_vmo(
1175 &self,
1176 mut size: u64,
1177 ) -> fidl::client::QueryResponseFut<
1178 BlobWriterGetVmoResult,
1179 fidl::encoding::DefaultFuchsiaResourceDialect,
1180 > {
1181 BlobWriterProxyInterface::r#get_vmo(self, size)
1182 }
1183
1184 pub fn r#bytes_ready(
1188 &self,
1189 mut bytes_written: u64,
1190 ) -> fidl::client::QueryResponseFut<
1191 BlobWriterBytesReadyResult,
1192 fidl::encoding::DefaultFuchsiaResourceDialect,
1193 > {
1194 BlobWriterProxyInterface::r#bytes_ready(self, bytes_written)
1195 }
1196}
1197
1198impl BlobWriterProxyInterface for BlobWriterProxy {
1199 type GetVmoResponseFut = fidl::client::QueryResponseFut<
1200 BlobWriterGetVmoResult,
1201 fidl::encoding::DefaultFuchsiaResourceDialect,
1202 >;
1203 fn r#get_vmo(&self, mut size: u64) -> Self::GetVmoResponseFut {
1204 fn _decode(
1205 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1206 ) -> Result<BlobWriterGetVmoResult, fidl::Error> {
1207 let _response = fidl::client::decode_transaction_body::<
1208 fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>,
1209 fidl::encoding::DefaultFuchsiaResourceDialect,
1210 0x50c8988b12b6f893,
1211 >(_buf?)?;
1212 Ok(_response.map(|x| x.vmo))
1213 }
1214 self.client.send_query_and_decode::<BlobWriterGetVmoRequest, BlobWriterGetVmoResult>(
1215 (size,),
1216 0x50c8988b12b6f893,
1217 fidl::encoding::DynamicFlags::empty(),
1218 _decode,
1219 )
1220 }
1221
1222 type BytesReadyResponseFut = fidl::client::QueryResponseFut<
1223 BlobWriterBytesReadyResult,
1224 fidl::encoding::DefaultFuchsiaResourceDialect,
1225 >;
1226 fn r#bytes_ready(&self, mut bytes_written: u64) -> Self::BytesReadyResponseFut {
1227 fn _decode(
1228 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1229 ) -> Result<BlobWriterBytesReadyResult, fidl::Error> {
1230 let _response = fidl::client::decode_transaction_body::<
1231 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1232 fidl::encoding::DefaultFuchsiaResourceDialect,
1233 0x7b308b473606c573,
1234 >(_buf?)?;
1235 Ok(_response.map(|x| x))
1236 }
1237 self.client
1238 .send_query_and_decode::<BlobWriterBytesReadyRequest, BlobWriterBytesReadyResult>(
1239 (bytes_written,),
1240 0x7b308b473606c573,
1241 fidl::encoding::DynamicFlags::empty(),
1242 _decode,
1243 )
1244 }
1245}
1246
1247pub struct BlobWriterEventStream {
1248 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1249}
1250
1251impl std::marker::Unpin for BlobWriterEventStream {}
1252
1253impl futures::stream::FusedStream for BlobWriterEventStream {
1254 fn is_terminated(&self) -> bool {
1255 self.event_receiver.is_terminated()
1256 }
1257}
1258
1259impl futures::Stream for BlobWriterEventStream {
1260 type Item = Result<BlobWriterEvent, fidl::Error>;
1261
1262 fn poll_next(
1263 mut self: std::pin::Pin<&mut Self>,
1264 cx: &mut std::task::Context<'_>,
1265 ) -> std::task::Poll<Option<Self::Item>> {
1266 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1267 &mut self.event_receiver,
1268 cx
1269 )?) {
1270 Some(buf) => std::task::Poll::Ready(Some(BlobWriterEvent::decode(buf))),
1271 None => std::task::Poll::Ready(None),
1272 }
1273 }
1274}
1275
1276#[derive(Debug)]
1277pub enum BlobWriterEvent {}
1278
1279impl BlobWriterEvent {
1280 fn decode(
1282 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1283 ) -> Result<BlobWriterEvent, fidl::Error> {
1284 let (bytes, _handles) = buf.split_mut();
1285 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1286 debug_assert_eq!(tx_header.tx_id, 0);
1287 match tx_header.ordinal {
1288 _ => Err(fidl::Error::UnknownOrdinal {
1289 ordinal: tx_header.ordinal,
1290 protocol_name: <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1291 }),
1292 }
1293 }
1294}
1295
1296pub struct BlobWriterRequestStream {
1298 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1299 is_terminated: bool,
1300}
1301
1302impl std::marker::Unpin for BlobWriterRequestStream {}
1303
1304impl futures::stream::FusedStream for BlobWriterRequestStream {
1305 fn is_terminated(&self) -> bool {
1306 self.is_terminated
1307 }
1308}
1309
1310impl fidl::endpoints::RequestStream for BlobWriterRequestStream {
1311 type Protocol = BlobWriterMarker;
1312 type ControlHandle = BlobWriterControlHandle;
1313
1314 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1315 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1316 }
1317
1318 fn control_handle(&self) -> Self::ControlHandle {
1319 BlobWriterControlHandle { inner: self.inner.clone() }
1320 }
1321
1322 fn into_inner(
1323 self,
1324 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1325 {
1326 (self.inner, self.is_terminated)
1327 }
1328
1329 fn from_inner(
1330 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1331 is_terminated: bool,
1332 ) -> Self {
1333 Self { inner, is_terminated }
1334 }
1335}
1336
1337impl futures::Stream for BlobWriterRequestStream {
1338 type Item = Result<BlobWriterRequest, fidl::Error>;
1339
1340 fn poll_next(
1341 mut self: std::pin::Pin<&mut Self>,
1342 cx: &mut std::task::Context<'_>,
1343 ) -> std::task::Poll<Option<Self::Item>> {
1344 let this = &mut *self;
1345 if this.inner.check_shutdown(cx) {
1346 this.is_terminated = true;
1347 return std::task::Poll::Ready(None);
1348 }
1349 if this.is_terminated {
1350 panic!("polled BlobWriterRequestStream after completion");
1351 }
1352 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1353 |bytes, handles| {
1354 match this.inner.channel().read_etc(cx, bytes, handles) {
1355 std::task::Poll::Ready(Ok(())) => {}
1356 std::task::Poll::Pending => return std::task::Poll::Pending,
1357 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1358 this.is_terminated = true;
1359 return std::task::Poll::Ready(None);
1360 }
1361 std::task::Poll::Ready(Err(e)) => {
1362 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1363 e.into(),
1364 ))));
1365 }
1366 }
1367
1368 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1370
1371 std::task::Poll::Ready(Some(match header.ordinal {
1372 0x50c8988b12b6f893 => {
1373 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1374 let mut req = fidl::new_empty!(
1375 BlobWriterGetVmoRequest,
1376 fidl::encoding::DefaultFuchsiaResourceDialect
1377 );
1378 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobWriterGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
1379 let control_handle = BlobWriterControlHandle { inner: this.inner.clone() };
1380 Ok(BlobWriterRequest::GetVmo {
1381 size: req.size,
1382
1383 responder: BlobWriterGetVmoResponder {
1384 control_handle: std::mem::ManuallyDrop::new(control_handle),
1385 tx_id: header.tx_id,
1386 },
1387 })
1388 }
1389 0x7b308b473606c573 => {
1390 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1391 let mut req = fidl::new_empty!(
1392 BlobWriterBytesReadyRequest,
1393 fidl::encoding::DefaultFuchsiaResourceDialect
1394 );
1395 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobWriterBytesReadyRequest>(&header, _body_bytes, handles, &mut req)?;
1396 let control_handle = BlobWriterControlHandle { inner: this.inner.clone() };
1397 Ok(BlobWriterRequest::BytesReady {
1398 bytes_written: req.bytes_written,
1399
1400 responder: BlobWriterBytesReadyResponder {
1401 control_handle: std::mem::ManuallyDrop::new(control_handle),
1402 tx_id: header.tx_id,
1403 },
1404 })
1405 }
1406 _ => Err(fidl::Error::UnknownOrdinal {
1407 ordinal: header.ordinal,
1408 protocol_name:
1409 <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1410 }),
1411 }))
1412 },
1413 )
1414 }
1415}
1416
1417#[derive(Debug)]
1418pub enum BlobWriterRequest {
1419 GetVmo { size: u64, responder: BlobWriterGetVmoResponder },
1431 BytesReady { bytes_written: u64, responder: BlobWriterBytesReadyResponder },
1435}
1436
1437impl BlobWriterRequest {
1438 #[allow(irrefutable_let_patterns)]
1439 pub fn into_get_vmo(self) -> Option<(u64, BlobWriterGetVmoResponder)> {
1440 if let BlobWriterRequest::GetVmo { size, responder } = self {
1441 Some((size, responder))
1442 } else {
1443 None
1444 }
1445 }
1446
1447 #[allow(irrefutable_let_patterns)]
1448 pub fn into_bytes_ready(self) -> Option<(u64, BlobWriterBytesReadyResponder)> {
1449 if let BlobWriterRequest::BytesReady { bytes_written, responder } = self {
1450 Some((bytes_written, responder))
1451 } else {
1452 None
1453 }
1454 }
1455
1456 pub fn method_name(&self) -> &'static str {
1458 match *self {
1459 BlobWriterRequest::GetVmo { .. } => "get_vmo",
1460 BlobWriterRequest::BytesReady { .. } => "bytes_ready",
1461 }
1462 }
1463}
1464
1465#[derive(Debug, Clone)]
1466pub struct BlobWriterControlHandle {
1467 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1468}
1469
1470impl fidl::endpoints::ControlHandle for BlobWriterControlHandle {
1471 fn shutdown(&self) {
1472 self.inner.shutdown()
1473 }
1474 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1475 self.inner.shutdown_with_epitaph(status)
1476 }
1477
1478 fn is_closed(&self) -> bool {
1479 self.inner.channel().is_closed()
1480 }
1481 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1482 self.inner.channel().on_closed()
1483 }
1484
1485 #[cfg(target_os = "fuchsia")]
1486 fn signal_peer(
1487 &self,
1488 clear_mask: zx::Signals,
1489 set_mask: zx::Signals,
1490 ) -> Result<(), zx_status::Status> {
1491 use fidl::Peered;
1492 self.inner.channel().signal_peer(clear_mask, set_mask)
1493 }
1494}
1495
1496impl BlobWriterControlHandle {}
1497
1498#[must_use = "FIDL methods require a response to be sent"]
1499#[derive(Debug)]
1500pub struct BlobWriterGetVmoResponder {
1501 control_handle: std::mem::ManuallyDrop<BlobWriterControlHandle>,
1502 tx_id: u32,
1503}
1504
1505impl std::ops::Drop for BlobWriterGetVmoResponder {
1509 fn drop(&mut self) {
1510 self.control_handle.shutdown();
1511 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1513 }
1514}
1515
1516impl fidl::endpoints::Responder for BlobWriterGetVmoResponder {
1517 type ControlHandle = BlobWriterControlHandle;
1518
1519 fn control_handle(&self) -> &BlobWriterControlHandle {
1520 &self.control_handle
1521 }
1522
1523 fn drop_without_shutdown(mut self) {
1524 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1526 std::mem::forget(self);
1528 }
1529}
1530
1531impl BlobWriterGetVmoResponder {
1532 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1536 let _result = self.send_raw(result);
1537 if _result.is_err() {
1538 self.control_handle.shutdown();
1539 }
1540 self.drop_without_shutdown();
1541 _result
1542 }
1543
1544 pub fn send_no_shutdown_on_err(
1546 self,
1547 mut result: Result<fidl::Vmo, i32>,
1548 ) -> Result<(), fidl::Error> {
1549 let _result = self.send_raw(result);
1550 self.drop_without_shutdown();
1551 _result
1552 }
1553
1554 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1555 self.control_handle.inner.send::<fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>>(
1556 result.map(|vmo| (vmo,)),
1557 self.tx_id,
1558 0x50c8988b12b6f893,
1559 fidl::encoding::DynamicFlags::empty(),
1560 )
1561 }
1562}
1563
1564#[must_use = "FIDL methods require a response to be sent"]
1565#[derive(Debug)]
1566pub struct BlobWriterBytesReadyResponder {
1567 control_handle: std::mem::ManuallyDrop<BlobWriterControlHandle>,
1568 tx_id: u32,
1569}
1570
1571impl std::ops::Drop for BlobWriterBytesReadyResponder {
1575 fn drop(&mut self) {
1576 self.control_handle.shutdown();
1577 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1579 }
1580}
1581
1582impl fidl::endpoints::Responder for BlobWriterBytesReadyResponder {
1583 type ControlHandle = BlobWriterControlHandle;
1584
1585 fn control_handle(&self) -> &BlobWriterControlHandle {
1586 &self.control_handle
1587 }
1588
1589 fn drop_without_shutdown(mut self) {
1590 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1592 std::mem::forget(self);
1594 }
1595}
1596
1597impl BlobWriterBytesReadyResponder {
1598 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1602 let _result = self.send_raw(result);
1603 if _result.is_err() {
1604 self.control_handle.shutdown();
1605 }
1606 self.drop_without_shutdown();
1607 _result
1608 }
1609
1610 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1612 let _result = self.send_raw(result);
1613 self.drop_without_shutdown();
1614 _result
1615 }
1616
1617 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1618 self.control_handle
1619 .inner
1620 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1621 result,
1622 self.tx_id,
1623 0x7b308b473606c573,
1624 fidl::encoding::DynamicFlags::empty(),
1625 )
1626 }
1627}
1628
1629#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1630pub struct CryptMarker;
1631
1632impl fidl::endpoints::ProtocolMarker for CryptMarker {
1633 type Proxy = CryptProxy;
1634 type RequestStream = CryptRequestStream;
1635 #[cfg(target_os = "fuchsia")]
1636 type SynchronousProxy = CryptSynchronousProxy;
1637
1638 const DEBUG_NAME: &'static str = "fuchsia.fxfs.Crypt";
1639}
1640impl fidl::endpoints::DiscoverableProtocolMarker for CryptMarker {}
1641pub type CryptCreateKeyResult = Result<([u8; 16], Vec<u8>, Vec<u8>), i32>;
1642pub type CryptCreateKeyWithIdResult = Result<(WrappedKey, Vec<u8>), i32>;
1643pub type CryptUnwrapKeyResult = Result<Vec<u8>, i32>;
1644
1645pub trait CryptProxyInterface: Send + Sync {
1646 type CreateKeyResponseFut: std::future::Future<Output = Result<CryptCreateKeyResult, fidl::Error>>
1647 + Send;
1648 fn r#create_key(&self, owner: u64, purpose: KeyPurpose) -> Self::CreateKeyResponseFut;
1649 type CreateKeyWithIdResponseFut: std::future::Future<Output = Result<CryptCreateKeyWithIdResult, fidl::Error>>
1650 + Send;
1651 fn r#create_key_with_id(
1652 &self,
1653 owner: u64,
1654 wrapping_key_id: &[u8; 16],
1655 object_type: ObjectType,
1656 ) -> Self::CreateKeyWithIdResponseFut;
1657 type UnwrapKeyResponseFut: std::future::Future<Output = Result<CryptUnwrapKeyResult, fidl::Error>>
1658 + Send;
1659 fn r#unwrap_key(&self, owner: u64, wrapped_key: &WrappedKey) -> Self::UnwrapKeyResponseFut;
1660}
1661#[derive(Debug)]
1662#[cfg(target_os = "fuchsia")]
1663pub struct CryptSynchronousProxy {
1664 client: fidl::client::sync::Client,
1665}
1666
1667#[cfg(target_os = "fuchsia")]
1668impl fidl::endpoints::SynchronousProxy for CryptSynchronousProxy {
1669 type Proxy = CryptProxy;
1670 type Protocol = CryptMarker;
1671
1672 fn from_channel(inner: fidl::Channel) -> Self {
1673 Self::new(inner)
1674 }
1675
1676 fn into_channel(self) -> fidl::Channel {
1677 self.client.into_channel()
1678 }
1679
1680 fn as_channel(&self) -> &fidl::Channel {
1681 self.client.as_channel()
1682 }
1683}
1684
1685#[cfg(target_os = "fuchsia")]
1686impl CryptSynchronousProxy {
1687 pub fn new(channel: fidl::Channel) -> Self {
1688 let protocol_name = <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1689 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1690 }
1691
1692 pub fn into_channel(self) -> fidl::Channel {
1693 self.client.into_channel()
1694 }
1695
1696 pub fn wait_for_event(
1699 &self,
1700 deadline: zx::MonotonicInstant,
1701 ) -> Result<CryptEvent, fidl::Error> {
1702 CryptEvent::decode(self.client.wait_for_event(deadline)?)
1703 }
1704
1705 pub fn r#create_key(
1711 &self,
1712 mut owner: u64,
1713 mut purpose: KeyPurpose,
1714 ___deadline: zx::MonotonicInstant,
1715 ) -> Result<CryptCreateKeyResult, fidl::Error> {
1716 let _response = self.client.send_query::<
1717 CryptCreateKeyRequest,
1718 fidl::encoding::ResultType<CryptCreateKeyResponse, i32>,
1719 >(
1720 (owner, purpose,),
1721 0x6ec69b3aee7fdbba,
1722 fidl::encoding::DynamicFlags::empty(),
1723 ___deadline,
1724 )?;
1725 Ok(_response.map(|x| (x.wrapping_key_id, x.wrapped_key, x.unwrapped_key)))
1726 }
1727
1728 pub fn r#create_key_with_id(
1732 &self,
1733 mut owner: u64,
1734 mut wrapping_key_id: &[u8; 16],
1735 mut object_type: ObjectType,
1736 ___deadline: zx::MonotonicInstant,
1737 ) -> Result<CryptCreateKeyWithIdResult, fidl::Error> {
1738 let _response = self.client.send_query::<
1739 CryptCreateKeyWithIdRequest,
1740 fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>,
1741 >(
1742 (owner, wrapping_key_id, object_type,),
1743 0x21e8076688700b50,
1744 fidl::encoding::DynamicFlags::empty(),
1745 ___deadline,
1746 )?;
1747 Ok(_response.map(|x| (x.wrapped_key, x.unwrapped_key)))
1748 }
1749
1750 pub fn r#unwrap_key(
1759 &self,
1760 mut owner: u64,
1761 mut wrapped_key: &WrappedKey,
1762 ___deadline: zx::MonotonicInstant,
1763 ) -> Result<CryptUnwrapKeyResult, fidl::Error> {
1764 let _response = self.client.send_query::<
1765 CryptUnwrapKeyRequest,
1766 fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>,
1767 >(
1768 (owner, wrapped_key,),
1769 0x6ec34e2b64d46be9,
1770 fidl::encoding::DynamicFlags::empty(),
1771 ___deadline,
1772 )?;
1773 Ok(_response.map(|x| x.unwrapped_key))
1774 }
1775}
1776
1777#[cfg(target_os = "fuchsia")]
1778impl From<CryptSynchronousProxy> for zx::Handle {
1779 fn from(value: CryptSynchronousProxy) -> Self {
1780 value.into_channel().into()
1781 }
1782}
1783
1784#[cfg(target_os = "fuchsia")]
1785impl From<fidl::Channel> for CryptSynchronousProxy {
1786 fn from(value: fidl::Channel) -> Self {
1787 Self::new(value)
1788 }
1789}
1790
1791#[cfg(target_os = "fuchsia")]
1792impl fidl::endpoints::FromClient for CryptSynchronousProxy {
1793 type Protocol = CryptMarker;
1794
1795 fn from_client(value: fidl::endpoints::ClientEnd<CryptMarker>) -> Self {
1796 Self::new(value.into_channel())
1797 }
1798}
1799
1800#[derive(Debug, Clone)]
1801pub struct CryptProxy {
1802 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1803}
1804
1805impl fidl::endpoints::Proxy for CryptProxy {
1806 type Protocol = CryptMarker;
1807
1808 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1809 Self::new(inner)
1810 }
1811
1812 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1813 self.client.into_channel().map_err(|client| Self { client })
1814 }
1815
1816 fn as_channel(&self) -> &::fidl::AsyncChannel {
1817 self.client.as_channel()
1818 }
1819}
1820
1821impl CryptProxy {
1822 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1824 let protocol_name = <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1825 Self { client: fidl::client::Client::new(channel, protocol_name) }
1826 }
1827
1828 pub fn take_event_stream(&self) -> CryptEventStream {
1834 CryptEventStream { event_receiver: self.client.take_event_receiver() }
1835 }
1836
1837 pub fn r#create_key(
1843 &self,
1844 mut owner: u64,
1845 mut purpose: KeyPurpose,
1846 ) -> fidl::client::QueryResponseFut<
1847 CryptCreateKeyResult,
1848 fidl::encoding::DefaultFuchsiaResourceDialect,
1849 > {
1850 CryptProxyInterface::r#create_key(self, owner, purpose)
1851 }
1852
1853 pub fn r#create_key_with_id(
1857 &self,
1858 mut owner: u64,
1859 mut wrapping_key_id: &[u8; 16],
1860 mut object_type: ObjectType,
1861 ) -> fidl::client::QueryResponseFut<
1862 CryptCreateKeyWithIdResult,
1863 fidl::encoding::DefaultFuchsiaResourceDialect,
1864 > {
1865 CryptProxyInterface::r#create_key_with_id(self, owner, wrapping_key_id, object_type)
1866 }
1867
1868 pub fn r#unwrap_key(
1877 &self,
1878 mut owner: u64,
1879 mut wrapped_key: &WrappedKey,
1880 ) -> fidl::client::QueryResponseFut<
1881 CryptUnwrapKeyResult,
1882 fidl::encoding::DefaultFuchsiaResourceDialect,
1883 > {
1884 CryptProxyInterface::r#unwrap_key(self, owner, wrapped_key)
1885 }
1886}
1887
1888impl CryptProxyInterface for CryptProxy {
1889 type CreateKeyResponseFut = fidl::client::QueryResponseFut<
1890 CryptCreateKeyResult,
1891 fidl::encoding::DefaultFuchsiaResourceDialect,
1892 >;
1893 fn r#create_key(&self, mut owner: u64, mut purpose: KeyPurpose) -> Self::CreateKeyResponseFut {
1894 fn _decode(
1895 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1896 ) -> Result<CryptCreateKeyResult, fidl::Error> {
1897 let _response = fidl::client::decode_transaction_body::<
1898 fidl::encoding::ResultType<CryptCreateKeyResponse, i32>,
1899 fidl::encoding::DefaultFuchsiaResourceDialect,
1900 0x6ec69b3aee7fdbba,
1901 >(_buf?)?;
1902 Ok(_response.map(|x| (x.wrapping_key_id, x.wrapped_key, x.unwrapped_key)))
1903 }
1904 self.client.send_query_and_decode::<CryptCreateKeyRequest, CryptCreateKeyResult>(
1905 (owner, purpose),
1906 0x6ec69b3aee7fdbba,
1907 fidl::encoding::DynamicFlags::empty(),
1908 _decode,
1909 )
1910 }
1911
1912 type CreateKeyWithIdResponseFut = fidl::client::QueryResponseFut<
1913 CryptCreateKeyWithIdResult,
1914 fidl::encoding::DefaultFuchsiaResourceDialect,
1915 >;
1916 fn r#create_key_with_id(
1917 &self,
1918 mut owner: u64,
1919 mut wrapping_key_id: &[u8; 16],
1920 mut object_type: ObjectType,
1921 ) -> Self::CreateKeyWithIdResponseFut {
1922 fn _decode(
1923 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1924 ) -> Result<CryptCreateKeyWithIdResult, fidl::Error> {
1925 let _response = fidl::client::decode_transaction_body::<
1926 fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>,
1927 fidl::encoding::DefaultFuchsiaResourceDialect,
1928 0x21e8076688700b50,
1929 >(_buf?)?;
1930 Ok(_response.map(|x| (x.wrapped_key, x.unwrapped_key)))
1931 }
1932 self.client
1933 .send_query_and_decode::<CryptCreateKeyWithIdRequest, CryptCreateKeyWithIdResult>(
1934 (owner, wrapping_key_id, object_type),
1935 0x21e8076688700b50,
1936 fidl::encoding::DynamicFlags::empty(),
1937 _decode,
1938 )
1939 }
1940
1941 type UnwrapKeyResponseFut = fidl::client::QueryResponseFut<
1942 CryptUnwrapKeyResult,
1943 fidl::encoding::DefaultFuchsiaResourceDialect,
1944 >;
1945 fn r#unwrap_key(
1946 &self,
1947 mut owner: u64,
1948 mut wrapped_key: &WrappedKey,
1949 ) -> Self::UnwrapKeyResponseFut {
1950 fn _decode(
1951 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1952 ) -> Result<CryptUnwrapKeyResult, fidl::Error> {
1953 let _response = fidl::client::decode_transaction_body::<
1954 fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>,
1955 fidl::encoding::DefaultFuchsiaResourceDialect,
1956 0x6ec34e2b64d46be9,
1957 >(_buf?)?;
1958 Ok(_response.map(|x| x.unwrapped_key))
1959 }
1960 self.client.send_query_and_decode::<CryptUnwrapKeyRequest, CryptUnwrapKeyResult>(
1961 (owner, wrapped_key),
1962 0x6ec34e2b64d46be9,
1963 fidl::encoding::DynamicFlags::empty(),
1964 _decode,
1965 )
1966 }
1967}
1968
1969pub struct CryptEventStream {
1970 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1971}
1972
1973impl std::marker::Unpin for CryptEventStream {}
1974
1975impl futures::stream::FusedStream for CryptEventStream {
1976 fn is_terminated(&self) -> bool {
1977 self.event_receiver.is_terminated()
1978 }
1979}
1980
1981impl futures::Stream for CryptEventStream {
1982 type Item = Result<CryptEvent, fidl::Error>;
1983
1984 fn poll_next(
1985 mut self: std::pin::Pin<&mut Self>,
1986 cx: &mut std::task::Context<'_>,
1987 ) -> std::task::Poll<Option<Self::Item>> {
1988 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1989 &mut self.event_receiver,
1990 cx
1991 )?) {
1992 Some(buf) => std::task::Poll::Ready(Some(CryptEvent::decode(buf))),
1993 None => std::task::Poll::Ready(None),
1994 }
1995 }
1996}
1997
1998#[derive(Debug)]
1999pub enum CryptEvent {}
2000
2001impl CryptEvent {
2002 fn decode(
2004 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2005 ) -> Result<CryptEvent, fidl::Error> {
2006 let (bytes, _handles) = buf.split_mut();
2007 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2008 debug_assert_eq!(tx_header.tx_id, 0);
2009 match tx_header.ordinal {
2010 _ => Err(fidl::Error::UnknownOrdinal {
2011 ordinal: tx_header.ordinal,
2012 protocol_name: <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2013 }),
2014 }
2015 }
2016}
2017
2018pub struct CryptRequestStream {
2020 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2021 is_terminated: bool,
2022}
2023
2024impl std::marker::Unpin for CryptRequestStream {}
2025
2026impl futures::stream::FusedStream for CryptRequestStream {
2027 fn is_terminated(&self) -> bool {
2028 self.is_terminated
2029 }
2030}
2031
2032impl fidl::endpoints::RequestStream for CryptRequestStream {
2033 type Protocol = CryptMarker;
2034 type ControlHandle = CryptControlHandle;
2035
2036 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2037 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2038 }
2039
2040 fn control_handle(&self) -> Self::ControlHandle {
2041 CryptControlHandle { inner: self.inner.clone() }
2042 }
2043
2044 fn into_inner(
2045 self,
2046 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2047 {
2048 (self.inner, self.is_terminated)
2049 }
2050
2051 fn from_inner(
2052 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2053 is_terminated: bool,
2054 ) -> Self {
2055 Self { inner, is_terminated }
2056 }
2057}
2058
2059impl futures::Stream for CryptRequestStream {
2060 type Item = Result<CryptRequest, fidl::Error>;
2061
2062 fn poll_next(
2063 mut self: std::pin::Pin<&mut Self>,
2064 cx: &mut std::task::Context<'_>,
2065 ) -> std::task::Poll<Option<Self::Item>> {
2066 let this = &mut *self;
2067 if this.inner.check_shutdown(cx) {
2068 this.is_terminated = true;
2069 return std::task::Poll::Ready(None);
2070 }
2071 if this.is_terminated {
2072 panic!("polled CryptRequestStream after completion");
2073 }
2074 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2075 |bytes, handles| {
2076 match this.inner.channel().read_etc(cx, bytes, handles) {
2077 std::task::Poll::Ready(Ok(())) => {}
2078 std::task::Poll::Pending => return std::task::Poll::Pending,
2079 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2080 this.is_terminated = true;
2081 return std::task::Poll::Ready(None);
2082 }
2083 std::task::Poll::Ready(Err(e)) => {
2084 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2085 e.into(),
2086 ))));
2087 }
2088 }
2089
2090 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2092
2093 std::task::Poll::Ready(Some(match header.ordinal {
2094 0x6ec69b3aee7fdbba => {
2095 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2096 let mut req = fidl::new_empty!(
2097 CryptCreateKeyRequest,
2098 fidl::encoding::DefaultFuchsiaResourceDialect
2099 );
2100 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptCreateKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2101 let control_handle = CryptControlHandle { inner: this.inner.clone() };
2102 Ok(CryptRequest::CreateKey {
2103 owner: req.owner,
2104 purpose: req.purpose,
2105
2106 responder: CryptCreateKeyResponder {
2107 control_handle: std::mem::ManuallyDrop::new(control_handle),
2108 tx_id: header.tx_id,
2109 },
2110 })
2111 }
2112 0x21e8076688700b50 => {
2113 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2114 let mut req = fidl::new_empty!(
2115 CryptCreateKeyWithIdRequest,
2116 fidl::encoding::DefaultFuchsiaResourceDialect
2117 );
2118 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptCreateKeyWithIdRequest>(&header, _body_bytes, handles, &mut req)?;
2119 let control_handle = CryptControlHandle { inner: this.inner.clone() };
2120 Ok(CryptRequest::CreateKeyWithId {
2121 owner: req.owner,
2122 wrapping_key_id: req.wrapping_key_id,
2123 object_type: req.object_type,
2124
2125 responder: CryptCreateKeyWithIdResponder {
2126 control_handle: std::mem::ManuallyDrop::new(control_handle),
2127 tx_id: header.tx_id,
2128 },
2129 })
2130 }
2131 0x6ec34e2b64d46be9 => {
2132 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2133 let mut req = fidl::new_empty!(
2134 CryptUnwrapKeyRequest,
2135 fidl::encoding::DefaultFuchsiaResourceDialect
2136 );
2137 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptUnwrapKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2138 let control_handle = CryptControlHandle { inner: this.inner.clone() };
2139 Ok(CryptRequest::UnwrapKey {
2140 owner: req.owner,
2141 wrapped_key: req.wrapped_key,
2142
2143 responder: CryptUnwrapKeyResponder {
2144 control_handle: std::mem::ManuallyDrop::new(control_handle),
2145 tx_id: header.tx_id,
2146 },
2147 })
2148 }
2149 _ => Err(fidl::Error::UnknownOrdinal {
2150 ordinal: header.ordinal,
2151 protocol_name: <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2152 }),
2153 }))
2154 },
2155 )
2156 }
2157}
2158
2159#[derive(Debug)]
2160pub enum CryptRequest {
2161 CreateKey { owner: u64, purpose: KeyPurpose, responder: CryptCreateKeyResponder },
2167 CreateKeyWithId {
2171 owner: u64,
2172 wrapping_key_id: [u8; 16],
2173 object_type: ObjectType,
2174 responder: CryptCreateKeyWithIdResponder,
2175 },
2176 UnwrapKey { owner: u64, wrapped_key: WrappedKey, responder: CryptUnwrapKeyResponder },
2185}
2186
2187impl CryptRequest {
2188 #[allow(irrefutable_let_patterns)]
2189 pub fn into_create_key(self) -> Option<(u64, KeyPurpose, CryptCreateKeyResponder)> {
2190 if let CryptRequest::CreateKey { owner, purpose, responder } = self {
2191 Some((owner, purpose, responder))
2192 } else {
2193 None
2194 }
2195 }
2196
2197 #[allow(irrefutable_let_patterns)]
2198 pub fn into_create_key_with_id(
2199 self,
2200 ) -> Option<(u64, [u8; 16], ObjectType, CryptCreateKeyWithIdResponder)> {
2201 if let CryptRequest::CreateKeyWithId { owner, wrapping_key_id, object_type, responder } =
2202 self
2203 {
2204 Some((owner, wrapping_key_id, object_type, responder))
2205 } else {
2206 None
2207 }
2208 }
2209
2210 #[allow(irrefutable_let_patterns)]
2211 pub fn into_unwrap_key(self) -> Option<(u64, WrappedKey, CryptUnwrapKeyResponder)> {
2212 if let CryptRequest::UnwrapKey { owner, wrapped_key, responder } = self {
2213 Some((owner, wrapped_key, responder))
2214 } else {
2215 None
2216 }
2217 }
2218
2219 pub fn method_name(&self) -> &'static str {
2221 match *self {
2222 CryptRequest::CreateKey { .. } => "create_key",
2223 CryptRequest::CreateKeyWithId { .. } => "create_key_with_id",
2224 CryptRequest::UnwrapKey { .. } => "unwrap_key",
2225 }
2226 }
2227}
2228
2229#[derive(Debug, Clone)]
2230pub struct CryptControlHandle {
2231 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2232}
2233
2234impl fidl::endpoints::ControlHandle for CryptControlHandle {
2235 fn shutdown(&self) {
2236 self.inner.shutdown()
2237 }
2238 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2239 self.inner.shutdown_with_epitaph(status)
2240 }
2241
2242 fn is_closed(&self) -> bool {
2243 self.inner.channel().is_closed()
2244 }
2245 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2246 self.inner.channel().on_closed()
2247 }
2248
2249 #[cfg(target_os = "fuchsia")]
2250 fn signal_peer(
2251 &self,
2252 clear_mask: zx::Signals,
2253 set_mask: zx::Signals,
2254 ) -> Result<(), zx_status::Status> {
2255 use fidl::Peered;
2256 self.inner.channel().signal_peer(clear_mask, set_mask)
2257 }
2258}
2259
2260impl CryptControlHandle {}
2261
2262#[must_use = "FIDL methods require a response to be sent"]
2263#[derive(Debug)]
2264pub struct CryptCreateKeyResponder {
2265 control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
2266 tx_id: u32,
2267}
2268
2269impl std::ops::Drop for CryptCreateKeyResponder {
2273 fn drop(&mut self) {
2274 self.control_handle.shutdown();
2275 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2277 }
2278}
2279
2280impl fidl::endpoints::Responder for CryptCreateKeyResponder {
2281 type ControlHandle = CryptControlHandle;
2282
2283 fn control_handle(&self) -> &CryptControlHandle {
2284 &self.control_handle
2285 }
2286
2287 fn drop_without_shutdown(mut self) {
2288 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2290 std::mem::forget(self);
2292 }
2293}
2294
2295impl CryptCreateKeyResponder {
2296 pub fn send(
2300 self,
2301 mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
2302 ) -> Result<(), fidl::Error> {
2303 let _result = self.send_raw(result);
2304 if _result.is_err() {
2305 self.control_handle.shutdown();
2306 }
2307 self.drop_without_shutdown();
2308 _result
2309 }
2310
2311 pub fn send_no_shutdown_on_err(
2313 self,
2314 mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
2315 ) -> Result<(), fidl::Error> {
2316 let _result = self.send_raw(result);
2317 self.drop_without_shutdown();
2318 _result
2319 }
2320
2321 fn send_raw(
2322 &self,
2323 mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
2324 ) -> Result<(), fidl::Error> {
2325 self.control_handle.inner.send::<fidl::encoding::ResultType<CryptCreateKeyResponse, i32>>(
2326 result,
2327 self.tx_id,
2328 0x6ec69b3aee7fdbba,
2329 fidl::encoding::DynamicFlags::empty(),
2330 )
2331 }
2332}
2333
2334#[must_use = "FIDL methods require a response to be sent"]
2335#[derive(Debug)]
2336pub struct CryptCreateKeyWithIdResponder {
2337 control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
2338 tx_id: u32,
2339}
2340
2341impl std::ops::Drop for CryptCreateKeyWithIdResponder {
2345 fn drop(&mut self) {
2346 self.control_handle.shutdown();
2347 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2349 }
2350}
2351
2352impl fidl::endpoints::Responder for CryptCreateKeyWithIdResponder {
2353 type ControlHandle = CryptControlHandle;
2354
2355 fn control_handle(&self) -> &CryptControlHandle {
2356 &self.control_handle
2357 }
2358
2359 fn drop_without_shutdown(mut self) {
2360 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2362 std::mem::forget(self);
2364 }
2365}
2366
2367impl CryptCreateKeyWithIdResponder {
2368 pub fn send(self, mut result: Result<(&WrappedKey, &[u8]), i32>) -> Result<(), fidl::Error> {
2372 let _result = self.send_raw(result);
2373 if _result.is_err() {
2374 self.control_handle.shutdown();
2375 }
2376 self.drop_without_shutdown();
2377 _result
2378 }
2379
2380 pub fn send_no_shutdown_on_err(
2382 self,
2383 mut result: Result<(&WrappedKey, &[u8]), i32>,
2384 ) -> Result<(), fidl::Error> {
2385 let _result = self.send_raw(result);
2386 self.drop_without_shutdown();
2387 _result
2388 }
2389
2390 fn send_raw(&self, mut result: Result<(&WrappedKey, &[u8]), i32>) -> Result<(), fidl::Error> {
2391 self.control_handle
2392 .inner
2393 .send::<fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>>(
2394 result,
2395 self.tx_id,
2396 0x21e8076688700b50,
2397 fidl::encoding::DynamicFlags::empty(),
2398 )
2399 }
2400}
2401
2402#[must_use = "FIDL methods require a response to be sent"]
2403#[derive(Debug)]
2404pub struct CryptUnwrapKeyResponder {
2405 control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
2406 tx_id: u32,
2407}
2408
2409impl std::ops::Drop for CryptUnwrapKeyResponder {
2413 fn drop(&mut self) {
2414 self.control_handle.shutdown();
2415 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2417 }
2418}
2419
2420impl fidl::endpoints::Responder for CryptUnwrapKeyResponder {
2421 type ControlHandle = CryptControlHandle;
2422
2423 fn control_handle(&self) -> &CryptControlHandle {
2424 &self.control_handle
2425 }
2426
2427 fn drop_without_shutdown(mut self) {
2428 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2430 std::mem::forget(self);
2432 }
2433}
2434
2435impl CryptUnwrapKeyResponder {
2436 pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2440 let _result = self.send_raw(result);
2441 if _result.is_err() {
2442 self.control_handle.shutdown();
2443 }
2444 self.drop_without_shutdown();
2445 _result
2446 }
2447
2448 pub fn send_no_shutdown_on_err(
2450 self,
2451 mut result: Result<&[u8], i32>,
2452 ) -> Result<(), fidl::Error> {
2453 let _result = self.send_raw(result);
2454 self.drop_without_shutdown();
2455 _result
2456 }
2457
2458 fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2459 self.control_handle.inner.send::<fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>>(
2460 result.map(|unwrapped_key| (unwrapped_key,)),
2461 self.tx_id,
2462 0x6ec34e2b64d46be9,
2463 fidl::encoding::DynamicFlags::empty(),
2464 )
2465 }
2466}
2467
2468#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2469pub struct CryptManagementMarker;
2470
2471impl fidl::endpoints::ProtocolMarker for CryptManagementMarker {
2472 type Proxy = CryptManagementProxy;
2473 type RequestStream = CryptManagementRequestStream;
2474 #[cfg(target_os = "fuchsia")]
2475 type SynchronousProxy = CryptManagementSynchronousProxy;
2476
2477 const DEBUG_NAME: &'static str = "fuchsia.fxfs.CryptManagement";
2478}
2479impl fidl::endpoints::DiscoverableProtocolMarker for CryptManagementMarker {}
2480pub type CryptManagementAddWrappingKeyResult = Result<(), i32>;
2481pub type CryptManagementSetActiveKeyResult = Result<(), i32>;
2482pub type CryptManagementForgetWrappingKeyResult = Result<(), i32>;
2483
2484pub trait CryptManagementProxyInterface: Send + Sync {
2485 type AddWrappingKeyResponseFut: std::future::Future<Output = Result<CryptManagementAddWrappingKeyResult, fidl::Error>>
2486 + Send;
2487 fn r#add_wrapping_key(
2488 &self,
2489 wrapping_key_id: &[u8; 16],
2490 key: &[u8],
2491 ) -> Self::AddWrappingKeyResponseFut;
2492 type SetActiveKeyResponseFut: std::future::Future<Output = Result<CryptManagementSetActiveKeyResult, fidl::Error>>
2493 + Send;
2494 fn r#set_active_key(
2495 &self,
2496 purpose: KeyPurpose,
2497 wrapping_key_id: &[u8; 16],
2498 ) -> Self::SetActiveKeyResponseFut;
2499 type ForgetWrappingKeyResponseFut: std::future::Future<Output = Result<CryptManagementForgetWrappingKeyResult, fidl::Error>>
2500 + Send;
2501 fn r#forget_wrapping_key(
2502 &self,
2503 wrapping_key_id: &[u8; 16],
2504 ) -> Self::ForgetWrappingKeyResponseFut;
2505}
2506#[derive(Debug)]
2507#[cfg(target_os = "fuchsia")]
2508pub struct CryptManagementSynchronousProxy {
2509 client: fidl::client::sync::Client,
2510}
2511
2512#[cfg(target_os = "fuchsia")]
2513impl fidl::endpoints::SynchronousProxy for CryptManagementSynchronousProxy {
2514 type Proxy = CryptManagementProxy;
2515 type Protocol = CryptManagementMarker;
2516
2517 fn from_channel(inner: fidl::Channel) -> Self {
2518 Self::new(inner)
2519 }
2520
2521 fn into_channel(self) -> fidl::Channel {
2522 self.client.into_channel()
2523 }
2524
2525 fn as_channel(&self) -> &fidl::Channel {
2526 self.client.as_channel()
2527 }
2528}
2529
2530#[cfg(target_os = "fuchsia")]
2531impl CryptManagementSynchronousProxy {
2532 pub fn new(channel: fidl::Channel) -> Self {
2533 let protocol_name = <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2534 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2535 }
2536
2537 pub fn into_channel(self) -> fidl::Channel {
2538 self.client.into_channel()
2539 }
2540
2541 pub fn wait_for_event(
2544 &self,
2545 deadline: zx::MonotonicInstant,
2546 ) -> Result<CryptManagementEvent, fidl::Error> {
2547 CryptManagementEvent::decode(self.client.wait_for_event(deadline)?)
2548 }
2549
2550 pub fn r#add_wrapping_key(
2554 &self,
2555 mut wrapping_key_id: &[u8; 16],
2556 mut key: &[u8],
2557 ___deadline: zx::MonotonicInstant,
2558 ) -> Result<CryptManagementAddWrappingKeyResult, fidl::Error> {
2559 let _response = self.client.send_query::<
2560 CryptManagementAddWrappingKeyRequest,
2561 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2562 >(
2563 (wrapping_key_id, key,),
2564 0x59a5076762318bf,
2565 fidl::encoding::DynamicFlags::empty(),
2566 ___deadline,
2567 )?;
2568 Ok(_response.map(|x| x))
2569 }
2570
2571 pub fn r#set_active_key(
2574 &self,
2575 mut purpose: KeyPurpose,
2576 mut wrapping_key_id: &[u8; 16],
2577 ___deadline: zx::MonotonicInstant,
2578 ) -> Result<CryptManagementSetActiveKeyResult, fidl::Error> {
2579 let _response = self.client.send_query::<
2580 CryptManagementSetActiveKeyRequest,
2581 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2582 >(
2583 (purpose, wrapping_key_id,),
2584 0x5e81d600442f2872,
2585 fidl::encoding::DynamicFlags::empty(),
2586 ___deadline,
2587 )?;
2588 Ok(_response.map(|x| x))
2589 }
2590
2591 pub fn r#forget_wrapping_key(
2595 &self,
2596 mut wrapping_key_id: &[u8; 16],
2597 ___deadline: zx::MonotonicInstant,
2598 ) -> Result<CryptManagementForgetWrappingKeyResult, fidl::Error> {
2599 let _response = self.client.send_query::<
2600 CryptManagementForgetWrappingKeyRequest,
2601 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2602 >(
2603 (wrapping_key_id,),
2604 0x436d6d27696dfcf4,
2605 fidl::encoding::DynamicFlags::empty(),
2606 ___deadline,
2607 )?;
2608 Ok(_response.map(|x| x))
2609 }
2610}
2611
2612#[cfg(target_os = "fuchsia")]
2613impl From<CryptManagementSynchronousProxy> for zx::Handle {
2614 fn from(value: CryptManagementSynchronousProxy) -> Self {
2615 value.into_channel().into()
2616 }
2617}
2618
2619#[cfg(target_os = "fuchsia")]
2620impl From<fidl::Channel> for CryptManagementSynchronousProxy {
2621 fn from(value: fidl::Channel) -> Self {
2622 Self::new(value)
2623 }
2624}
2625
2626#[cfg(target_os = "fuchsia")]
2627impl fidl::endpoints::FromClient for CryptManagementSynchronousProxy {
2628 type Protocol = CryptManagementMarker;
2629
2630 fn from_client(value: fidl::endpoints::ClientEnd<CryptManagementMarker>) -> Self {
2631 Self::new(value.into_channel())
2632 }
2633}
2634
2635#[derive(Debug, Clone)]
2636pub struct CryptManagementProxy {
2637 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2638}
2639
2640impl fidl::endpoints::Proxy for CryptManagementProxy {
2641 type Protocol = CryptManagementMarker;
2642
2643 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2644 Self::new(inner)
2645 }
2646
2647 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2648 self.client.into_channel().map_err(|client| Self { client })
2649 }
2650
2651 fn as_channel(&self) -> &::fidl::AsyncChannel {
2652 self.client.as_channel()
2653 }
2654}
2655
2656impl CryptManagementProxy {
2657 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2659 let protocol_name = <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2660 Self { client: fidl::client::Client::new(channel, protocol_name) }
2661 }
2662
2663 pub fn take_event_stream(&self) -> CryptManagementEventStream {
2669 CryptManagementEventStream { event_receiver: self.client.take_event_receiver() }
2670 }
2671
2672 pub fn r#add_wrapping_key(
2676 &self,
2677 mut wrapping_key_id: &[u8; 16],
2678 mut key: &[u8],
2679 ) -> fidl::client::QueryResponseFut<
2680 CryptManagementAddWrappingKeyResult,
2681 fidl::encoding::DefaultFuchsiaResourceDialect,
2682 > {
2683 CryptManagementProxyInterface::r#add_wrapping_key(self, wrapping_key_id, key)
2684 }
2685
2686 pub fn r#set_active_key(
2689 &self,
2690 mut purpose: KeyPurpose,
2691 mut wrapping_key_id: &[u8; 16],
2692 ) -> fidl::client::QueryResponseFut<
2693 CryptManagementSetActiveKeyResult,
2694 fidl::encoding::DefaultFuchsiaResourceDialect,
2695 > {
2696 CryptManagementProxyInterface::r#set_active_key(self, purpose, wrapping_key_id)
2697 }
2698
2699 pub fn r#forget_wrapping_key(
2703 &self,
2704 mut wrapping_key_id: &[u8; 16],
2705 ) -> fidl::client::QueryResponseFut<
2706 CryptManagementForgetWrappingKeyResult,
2707 fidl::encoding::DefaultFuchsiaResourceDialect,
2708 > {
2709 CryptManagementProxyInterface::r#forget_wrapping_key(self, wrapping_key_id)
2710 }
2711}
2712
2713impl CryptManagementProxyInterface for CryptManagementProxy {
2714 type AddWrappingKeyResponseFut = fidl::client::QueryResponseFut<
2715 CryptManagementAddWrappingKeyResult,
2716 fidl::encoding::DefaultFuchsiaResourceDialect,
2717 >;
2718 fn r#add_wrapping_key(
2719 &self,
2720 mut wrapping_key_id: &[u8; 16],
2721 mut key: &[u8],
2722 ) -> Self::AddWrappingKeyResponseFut {
2723 fn _decode(
2724 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2725 ) -> Result<CryptManagementAddWrappingKeyResult, fidl::Error> {
2726 let _response = fidl::client::decode_transaction_body::<
2727 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2728 fidl::encoding::DefaultFuchsiaResourceDialect,
2729 0x59a5076762318bf,
2730 >(_buf?)?;
2731 Ok(_response.map(|x| x))
2732 }
2733 self.client.send_query_and_decode::<
2734 CryptManagementAddWrappingKeyRequest,
2735 CryptManagementAddWrappingKeyResult,
2736 >(
2737 (wrapping_key_id, key,),
2738 0x59a5076762318bf,
2739 fidl::encoding::DynamicFlags::empty(),
2740 _decode,
2741 )
2742 }
2743
2744 type SetActiveKeyResponseFut = fidl::client::QueryResponseFut<
2745 CryptManagementSetActiveKeyResult,
2746 fidl::encoding::DefaultFuchsiaResourceDialect,
2747 >;
2748 fn r#set_active_key(
2749 &self,
2750 mut purpose: KeyPurpose,
2751 mut wrapping_key_id: &[u8; 16],
2752 ) -> Self::SetActiveKeyResponseFut {
2753 fn _decode(
2754 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2755 ) -> Result<CryptManagementSetActiveKeyResult, fidl::Error> {
2756 let _response = fidl::client::decode_transaction_body::<
2757 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2758 fidl::encoding::DefaultFuchsiaResourceDialect,
2759 0x5e81d600442f2872,
2760 >(_buf?)?;
2761 Ok(_response.map(|x| x))
2762 }
2763 self.client.send_query_and_decode::<
2764 CryptManagementSetActiveKeyRequest,
2765 CryptManagementSetActiveKeyResult,
2766 >(
2767 (purpose, wrapping_key_id,),
2768 0x5e81d600442f2872,
2769 fidl::encoding::DynamicFlags::empty(),
2770 _decode,
2771 )
2772 }
2773
2774 type ForgetWrappingKeyResponseFut = fidl::client::QueryResponseFut<
2775 CryptManagementForgetWrappingKeyResult,
2776 fidl::encoding::DefaultFuchsiaResourceDialect,
2777 >;
2778 fn r#forget_wrapping_key(
2779 &self,
2780 mut wrapping_key_id: &[u8; 16],
2781 ) -> Self::ForgetWrappingKeyResponseFut {
2782 fn _decode(
2783 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2784 ) -> Result<CryptManagementForgetWrappingKeyResult, fidl::Error> {
2785 let _response = fidl::client::decode_transaction_body::<
2786 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2787 fidl::encoding::DefaultFuchsiaResourceDialect,
2788 0x436d6d27696dfcf4,
2789 >(_buf?)?;
2790 Ok(_response.map(|x| x))
2791 }
2792 self.client.send_query_and_decode::<
2793 CryptManagementForgetWrappingKeyRequest,
2794 CryptManagementForgetWrappingKeyResult,
2795 >(
2796 (wrapping_key_id,),
2797 0x436d6d27696dfcf4,
2798 fidl::encoding::DynamicFlags::empty(),
2799 _decode,
2800 )
2801 }
2802}
2803
2804pub struct CryptManagementEventStream {
2805 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2806}
2807
2808impl std::marker::Unpin for CryptManagementEventStream {}
2809
2810impl futures::stream::FusedStream for CryptManagementEventStream {
2811 fn is_terminated(&self) -> bool {
2812 self.event_receiver.is_terminated()
2813 }
2814}
2815
2816impl futures::Stream for CryptManagementEventStream {
2817 type Item = Result<CryptManagementEvent, fidl::Error>;
2818
2819 fn poll_next(
2820 mut self: std::pin::Pin<&mut Self>,
2821 cx: &mut std::task::Context<'_>,
2822 ) -> std::task::Poll<Option<Self::Item>> {
2823 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2824 &mut self.event_receiver,
2825 cx
2826 )?) {
2827 Some(buf) => std::task::Poll::Ready(Some(CryptManagementEvent::decode(buf))),
2828 None => std::task::Poll::Ready(None),
2829 }
2830 }
2831}
2832
2833#[derive(Debug)]
2834pub enum CryptManagementEvent {}
2835
2836impl CryptManagementEvent {
2837 fn decode(
2839 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2840 ) -> Result<CryptManagementEvent, fidl::Error> {
2841 let (bytes, _handles) = buf.split_mut();
2842 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2843 debug_assert_eq!(tx_header.tx_id, 0);
2844 match tx_header.ordinal {
2845 _ => Err(fidl::Error::UnknownOrdinal {
2846 ordinal: tx_header.ordinal,
2847 protocol_name:
2848 <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2849 }),
2850 }
2851 }
2852}
2853
2854pub struct CryptManagementRequestStream {
2856 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2857 is_terminated: bool,
2858}
2859
2860impl std::marker::Unpin for CryptManagementRequestStream {}
2861
2862impl futures::stream::FusedStream for CryptManagementRequestStream {
2863 fn is_terminated(&self) -> bool {
2864 self.is_terminated
2865 }
2866}
2867
2868impl fidl::endpoints::RequestStream for CryptManagementRequestStream {
2869 type Protocol = CryptManagementMarker;
2870 type ControlHandle = CryptManagementControlHandle;
2871
2872 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2873 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2874 }
2875
2876 fn control_handle(&self) -> Self::ControlHandle {
2877 CryptManagementControlHandle { inner: self.inner.clone() }
2878 }
2879
2880 fn into_inner(
2881 self,
2882 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2883 {
2884 (self.inner, self.is_terminated)
2885 }
2886
2887 fn from_inner(
2888 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2889 is_terminated: bool,
2890 ) -> Self {
2891 Self { inner, is_terminated }
2892 }
2893}
2894
2895impl futures::Stream for CryptManagementRequestStream {
2896 type Item = Result<CryptManagementRequest, fidl::Error>;
2897
2898 fn poll_next(
2899 mut self: std::pin::Pin<&mut Self>,
2900 cx: &mut std::task::Context<'_>,
2901 ) -> std::task::Poll<Option<Self::Item>> {
2902 let this = &mut *self;
2903 if this.inner.check_shutdown(cx) {
2904 this.is_terminated = true;
2905 return std::task::Poll::Ready(None);
2906 }
2907 if this.is_terminated {
2908 panic!("polled CryptManagementRequestStream after completion");
2909 }
2910 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2911 |bytes, handles| {
2912 match this.inner.channel().read_etc(cx, bytes, handles) {
2913 std::task::Poll::Ready(Ok(())) => {}
2914 std::task::Poll::Pending => return std::task::Poll::Pending,
2915 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2916 this.is_terminated = true;
2917 return std::task::Poll::Ready(None);
2918 }
2919 std::task::Poll::Ready(Err(e)) => {
2920 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2921 e.into(),
2922 ))));
2923 }
2924 }
2925
2926 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2928
2929 std::task::Poll::Ready(Some(match header.ordinal {
2930 0x59a5076762318bf => {
2931 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2932 let mut req = fidl::new_empty!(
2933 CryptManagementAddWrappingKeyRequest,
2934 fidl::encoding::DefaultFuchsiaResourceDialect
2935 );
2936 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementAddWrappingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2937 let control_handle =
2938 CryptManagementControlHandle { inner: this.inner.clone() };
2939 Ok(CryptManagementRequest::AddWrappingKey {
2940 wrapping_key_id: req.wrapping_key_id,
2941 key: req.key,
2942
2943 responder: CryptManagementAddWrappingKeyResponder {
2944 control_handle: std::mem::ManuallyDrop::new(control_handle),
2945 tx_id: header.tx_id,
2946 },
2947 })
2948 }
2949 0x5e81d600442f2872 => {
2950 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2951 let mut req = fidl::new_empty!(
2952 CryptManagementSetActiveKeyRequest,
2953 fidl::encoding::DefaultFuchsiaResourceDialect
2954 );
2955 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementSetActiveKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2956 let control_handle =
2957 CryptManagementControlHandle { inner: this.inner.clone() };
2958 Ok(CryptManagementRequest::SetActiveKey {
2959 purpose: req.purpose,
2960 wrapping_key_id: req.wrapping_key_id,
2961
2962 responder: CryptManagementSetActiveKeyResponder {
2963 control_handle: std::mem::ManuallyDrop::new(control_handle),
2964 tx_id: header.tx_id,
2965 },
2966 })
2967 }
2968 0x436d6d27696dfcf4 => {
2969 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2970 let mut req = fidl::new_empty!(
2971 CryptManagementForgetWrappingKeyRequest,
2972 fidl::encoding::DefaultFuchsiaResourceDialect
2973 );
2974 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementForgetWrappingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2975 let control_handle =
2976 CryptManagementControlHandle { inner: this.inner.clone() };
2977 Ok(CryptManagementRequest::ForgetWrappingKey {
2978 wrapping_key_id: req.wrapping_key_id,
2979
2980 responder: CryptManagementForgetWrappingKeyResponder {
2981 control_handle: std::mem::ManuallyDrop::new(control_handle),
2982 tx_id: header.tx_id,
2983 },
2984 })
2985 }
2986 _ => Err(fidl::Error::UnknownOrdinal {
2987 ordinal: header.ordinal,
2988 protocol_name:
2989 <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2990 }),
2991 }))
2992 },
2993 )
2994 }
2995}
2996
2997#[derive(Debug)]
2998pub enum CryptManagementRequest {
2999 AddWrappingKey {
3003 wrapping_key_id: [u8; 16],
3004 key: Vec<u8>,
3005 responder: CryptManagementAddWrappingKeyResponder,
3006 },
3007 SetActiveKey {
3010 purpose: KeyPurpose,
3011 wrapping_key_id: [u8; 16],
3012 responder: CryptManagementSetActiveKeyResponder,
3013 },
3014 ForgetWrappingKey {
3018 wrapping_key_id: [u8; 16],
3019 responder: CryptManagementForgetWrappingKeyResponder,
3020 },
3021}
3022
3023impl CryptManagementRequest {
3024 #[allow(irrefutable_let_patterns)]
3025 pub fn into_add_wrapping_key(
3026 self,
3027 ) -> Option<([u8; 16], Vec<u8>, CryptManagementAddWrappingKeyResponder)> {
3028 if let CryptManagementRequest::AddWrappingKey { wrapping_key_id, key, responder } = self {
3029 Some((wrapping_key_id, key, responder))
3030 } else {
3031 None
3032 }
3033 }
3034
3035 #[allow(irrefutable_let_patterns)]
3036 pub fn into_set_active_key(
3037 self,
3038 ) -> Option<(KeyPurpose, [u8; 16], CryptManagementSetActiveKeyResponder)> {
3039 if let CryptManagementRequest::SetActiveKey { purpose, wrapping_key_id, responder } = self {
3040 Some((purpose, wrapping_key_id, responder))
3041 } else {
3042 None
3043 }
3044 }
3045
3046 #[allow(irrefutable_let_patterns)]
3047 pub fn into_forget_wrapping_key(
3048 self,
3049 ) -> Option<([u8; 16], CryptManagementForgetWrappingKeyResponder)> {
3050 if let CryptManagementRequest::ForgetWrappingKey { wrapping_key_id, responder } = self {
3051 Some((wrapping_key_id, responder))
3052 } else {
3053 None
3054 }
3055 }
3056
3057 pub fn method_name(&self) -> &'static str {
3059 match *self {
3060 CryptManagementRequest::AddWrappingKey { .. } => "add_wrapping_key",
3061 CryptManagementRequest::SetActiveKey { .. } => "set_active_key",
3062 CryptManagementRequest::ForgetWrappingKey { .. } => "forget_wrapping_key",
3063 }
3064 }
3065}
3066
3067#[derive(Debug, Clone)]
3068pub struct CryptManagementControlHandle {
3069 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3070}
3071
3072impl fidl::endpoints::ControlHandle for CryptManagementControlHandle {
3073 fn shutdown(&self) {
3074 self.inner.shutdown()
3075 }
3076 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3077 self.inner.shutdown_with_epitaph(status)
3078 }
3079
3080 fn is_closed(&self) -> bool {
3081 self.inner.channel().is_closed()
3082 }
3083 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3084 self.inner.channel().on_closed()
3085 }
3086
3087 #[cfg(target_os = "fuchsia")]
3088 fn signal_peer(
3089 &self,
3090 clear_mask: zx::Signals,
3091 set_mask: zx::Signals,
3092 ) -> Result<(), zx_status::Status> {
3093 use fidl::Peered;
3094 self.inner.channel().signal_peer(clear_mask, set_mask)
3095 }
3096}
3097
3098impl CryptManagementControlHandle {}
3099
3100#[must_use = "FIDL methods require a response to be sent"]
3101#[derive(Debug)]
3102pub struct CryptManagementAddWrappingKeyResponder {
3103 control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
3104 tx_id: u32,
3105}
3106
3107impl std::ops::Drop for CryptManagementAddWrappingKeyResponder {
3111 fn drop(&mut self) {
3112 self.control_handle.shutdown();
3113 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3115 }
3116}
3117
3118impl fidl::endpoints::Responder for CryptManagementAddWrappingKeyResponder {
3119 type ControlHandle = CryptManagementControlHandle;
3120
3121 fn control_handle(&self) -> &CryptManagementControlHandle {
3122 &self.control_handle
3123 }
3124
3125 fn drop_without_shutdown(mut self) {
3126 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3128 std::mem::forget(self);
3130 }
3131}
3132
3133impl CryptManagementAddWrappingKeyResponder {
3134 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3138 let _result = self.send_raw(result);
3139 if _result.is_err() {
3140 self.control_handle.shutdown();
3141 }
3142 self.drop_without_shutdown();
3143 _result
3144 }
3145
3146 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3148 let _result = self.send_raw(result);
3149 self.drop_without_shutdown();
3150 _result
3151 }
3152
3153 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3154 self.control_handle
3155 .inner
3156 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3157 result,
3158 self.tx_id,
3159 0x59a5076762318bf,
3160 fidl::encoding::DynamicFlags::empty(),
3161 )
3162 }
3163}
3164
3165#[must_use = "FIDL methods require a response to be sent"]
3166#[derive(Debug)]
3167pub struct CryptManagementSetActiveKeyResponder {
3168 control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
3169 tx_id: u32,
3170}
3171
3172impl std::ops::Drop for CryptManagementSetActiveKeyResponder {
3176 fn drop(&mut self) {
3177 self.control_handle.shutdown();
3178 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3180 }
3181}
3182
3183impl fidl::endpoints::Responder for CryptManagementSetActiveKeyResponder {
3184 type ControlHandle = CryptManagementControlHandle;
3185
3186 fn control_handle(&self) -> &CryptManagementControlHandle {
3187 &self.control_handle
3188 }
3189
3190 fn drop_without_shutdown(mut self) {
3191 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3193 std::mem::forget(self);
3195 }
3196}
3197
3198impl CryptManagementSetActiveKeyResponder {
3199 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3203 let _result = self.send_raw(result);
3204 if _result.is_err() {
3205 self.control_handle.shutdown();
3206 }
3207 self.drop_without_shutdown();
3208 _result
3209 }
3210
3211 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3213 let _result = self.send_raw(result);
3214 self.drop_without_shutdown();
3215 _result
3216 }
3217
3218 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3219 self.control_handle
3220 .inner
3221 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3222 result,
3223 self.tx_id,
3224 0x5e81d600442f2872,
3225 fidl::encoding::DynamicFlags::empty(),
3226 )
3227 }
3228}
3229
3230#[must_use = "FIDL methods require a response to be sent"]
3231#[derive(Debug)]
3232pub struct CryptManagementForgetWrappingKeyResponder {
3233 control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
3234 tx_id: u32,
3235}
3236
3237impl std::ops::Drop for CryptManagementForgetWrappingKeyResponder {
3241 fn drop(&mut self) {
3242 self.control_handle.shutdown();
3243 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3245 }
3246}
3247
3248impl fidl::endpoints::Responder for CryptManagementForgetWrappingKeyResponder {
3249 type ControlHandle = CryptManagementControlHandle;
3250
3251 fn control_handle(&self) -> &CryptManagementControlHandle {
3252 &self.control_handle
3253 }
3254
3255 fn drop_without_shutdown(mut self) {
3256 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3258 std::mem::forget(self);
3260 }
3261}
3262
3263impl CryptManagementForgetWrappingKeyResponder {
3264 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3268 let _result = self.send_raw(result);
3269 if _result.is_err() {
3270 self.control_handle.shutdown();
3271 }
3272 self.drop_without_shutdown();
3273 _result
3274 }
3275
3276 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3278 let _result = self.send_raw(result);
3279 self.drop_without_shutdown();
3280 _result
3281 }
3282
3283 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3284 self.control_handle
3285 .inner
3286 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3287 result,
3288 self.tx_id,
3289 0x436d6d27696dfcf4,
3290 fidl::encoding::DynamicFlags::empty(),
3291 )
3292 }
3293}
3294
3295#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3296pub struct DebugMarker;
3297
3298impl fidl::endpoints::ProtocolMarker for DebugMarker {
3299 type Proxy = DebugProxy;
3300 type RequestStream = DebugRequestStream;
3301 #[cfg(target_os = "fuchsia")]
3302 type SynchronousProxy = DebugSynchronousProxy;
3303
3304 const DEBUG_NAME: &'static str = "fuchsia.fxfs.Debug";
3305}
3306impl fidl::endpoints::DiscoverableProtocolMarker for DebugMarker {}
3307pub type DebugCompactResult = Result<(), i32>;
3308pub type DebugDeleteProfileResult = Result<(), i32>;
3309pub type DebugStopProfileTasksResult = Result<(), i32>;
3310
3311pub trait DebugProxyInterface: Send + Sync {
3312 type CompactResponseFut: std::future::Future<Output = Result<DebugCompactResult, fidl::Error>>
3313 + Send;
3314 fn r#compact(&self) -> Self::CompactResponseFut;
3315 type DeleteProfileResponseFut: std::future::Future<Output = Result<DebugDeleteProfileResult, fidl::Error>>
3316 + Send;
3317 fn r#delete_profile(&self, volume: &str, profile: &str) -> Self::DeleteProfileResponseFut;
3318 type StopProfileTasksResponseFut: std::future::Future<Output = Result<DebugStopProfileTasksResult, fidl::Error>>
3319 + Send;
3320 fn r#stop_profile_tasks(&self) -> Self::StopProfileTasksResponseFut;
3321}
3322#[derive(Debug)]
3323#[cfg(target_os = "fuchsia")]
3324pub struct DebugSynchronousProxy {
3325 client: fidl::client::sync::Client,
3326}
3327
3328#[cfg(target_os = "fuchsia")]
3329impl fidl::endpoints::SynchronousProxy for DebugSynchronousProxy {
3330 type Proxy = DebugProxy;
3331 type Protocol = DebugMarker;
3332
3333 fn from_channel(inner: fidl::Channel) -> Self {
3334 Self::new(inner)
3335 }
3336
3337 fn into_channel(self) -> fidl::Channel {
3338 self.client.into_channel()
3339 }
3340
3341 fn as_channel(&self) -> &fidl::Channel {
3342 self.client.as_channel()
3343 }
3344}
3345
3346#[cfg(target_os = "fuchsia")]
3347impl DebugSynchronousProxy {
3348 pub fn new(channel: fidl::Channel) -> Self {
3349 let protocol_name = <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3350 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3351 }
3352
3353 pub fn into_channel(self) -> fidl::Channel {
3354 self.client.into_channel()
3355 }
3356
3357 pub fn wait_for_event(
3360 &self,
3361 deadline: zx::MonotonicInstant,
3362 ) -> Result<DebugEvent, fidl::Error> {
3363 DebugEvent::decode(self.client.wait_for_event(deadline)?)
3364 }
3365
3366 pub fn r#compact(
3368 &self,
3369 ___deadline: zx::MonotonicInstant,
3370 ) -> Result<DebugCompactResult, fidl::Error> {
3371 let _response = self.client.send_query::<
3372 fidl::encoding::EmptyPayload,
3373 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3374 >(
3375 (),
3376 0x6553eb197306e489,
3377 fidl::encoding::DynamicFlags::empty(),
3378 ___deadline,
3379 )?;
3380 Ok(_response.map(|x| x))
3381 }
3382
3383 pub fn r#delete_profile(
3386 &self,
3387 mut volume: &str,
3388 mut profile: &str,
3389 ___deadline: zx::MonotonicInstant,
3390 ) -> Result<DebugDeleteProfileResult, fidl::Error> {
3391 let _response = self.client.send_query::<
3392 DebugDeleteProfileRequest,
3393 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3394 >(
3395 (volume, profile,),
3396 0x54d9d4c9cf300a1e,
3397 fidl::encoding::DynamicFlags::empty(),
3398 ___deadline,
3399 )?;
3400 Ok(_response.map(|x| x))
3401 }
3402
3403 pub fn r#stop_profile_tasks(
3406 &self,
3407 ___deadline: zx::MonotonicInstant,
3408 ) -> Result<DebugStopProfileTasksResult, fidl::Error> {
3409 let _response = self.client.send_query::<
3410 fidl::encoding::EmptyPayload,
3411 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3412 >(
3413 (),
3414 0x1657b945dd629177,
3415 fidl::encoding::DynamicFlags::empty(),
3416 ___deadline,
3417 )?;
3418 Ok(_response.map(|x| x))
3419 }
3420}
3421
3422#[cfg(target_os = "fuchsia")]
3423impl From<DebugSynchronousProxy> for zx::Handle {
3424 fn from(value: DebugSynchronousProxy) -> Self {
3425 value.into_channel().into()
3426 }
3427}
3428
3429#[cfg(target_os = "fuchsia")]
3430impl From<fidl::Channel> for DebugSynchronousProxy {
3431 fn from(value: fidl::Channel) -> Self {
3432 Self::new(value)
3433 }
3434}
3435
3436#[cfg(target_os = "fuchsia")]
3437impl fidl::endpoints::FromClient for DebugSynchronousProxy {
3438 type Protocol = DebugMarker;
3439
3440 fn from_client(value: fidl::endpoints::ClientEnd<DebugMarker>) -> Self {
3441 Self::new(value.into_channel())
3442 }
3443}
3444
3445#[derive(Debug, Clone)]
3446pub struct DebugProxy {
3447 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3448}
3449
3450impl fidl::endpoints::Proxy for DebugProxy {
3451 type Protocol = DebugMarker;
3452
3453 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3454 Self::new(inner)
3455 }
3456
3457 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3458 self.client.into_channel().map_err(|client| Self { client })
3459 }
3460
3461 fn as_channel(&self) -> &::fidl::AsyncChannel {
3462 self.client.as_channel()
3463 }
3464}
3465
3466impl DebugProxy {
3467 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3469 let protocol_name = <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3470 Self { client: fidl::client::Client::new(channel, protocol_name) }
3471 }
3472
3473 pub fn take_event_stream(&self) -> DebugEventStream {
3479 DebugEventStream { event_receiver: self.client.take_event_receiver() }
3480 }
3481
3482 pub fn r#compact(
3484 &self,
3485 ) -> fidl::client::QueryResponseFut<
3486 DebugCompactResult,
3487 fidl::encoding::DefaultFuchsiaResourceDialect,
3488 > {
3489 DebugProxyInterface::r#compact(self)
3490 }
3491
3492 pub fn r#delete_profile(
3495 &self,
3496 mut volume: &str,
3497 mut profile: &str,
3498 ) -> fidl::client::QueryResponseFut<
3499 DebugDeleteProfileResult,
3500 fidl::encoding::DefaultFuchsiaResourceDialect,
3501 > {
3502 DebugProxyInterface::r#delete_profile(self, volume, profile)
3503 }
3504
3505 pub fn r#stop_profile_tasks(
3508 &self,
3509 ) -> fidl::client::QueryResponseFut<
3510 DebugStopProfileTasksResult,
3511 fidl::encoding::DefaultFuchsiaResourceDialect,
3512 > {
3513 DebugProxyInterface::r#stop_profile_tasks(self)
3514 }
3515}
3516
3517impl DebugProxyInterface for DebugProxy {
3518 type CompactResponseFut = fidl::client::QueryResponseFut<
3519 DebugCompactResult,
3520 fidl::encoding::DefaultFuchsiaResourceDialect,
3521 >;
3522 fn r#compact(&self) -> Self::CompactResponseFut {
3523 fn _decode(
3524 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3525 ) -> Result<DebugCompactResult, fidl::Error> {
3526 let _response = fidl::client::decode_transaction_body::<
3527 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3528 fidl::encoding::DefaultFuchsiaResourceDialect,
3529 0x6553eb197306e489,
3530 >(_buf?)?;
3531 Ok(_response.map(|x| x))
3532 }
3533 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DebugCompactResult>(
3534 (),
3535 0x6553eb197306e489,
3536 fidl::encoding::DynamicFlags::empty(),
3537 _decode,
3538 )
3539 }
3540
3541 type DeleteProfileResponseFut = fidl::client::QueryResponseFut<
3542 DebugDeleteProfileResult,
3543 fidl::encoding::DefaultFuchsiaResourceDialect,
3544 >;
3545 fn r#delete_profile(
3546 &self,
3547 mut volume: &str,
3548 mut profile: &str,
3549 ) -> Self::DeleteProfileResponseFut {
3550 fn _decode(
3551 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3552 ) -> Result<DebugDeleteProfileResult, fidl::Error> {
3553 let _response = fidl::client::decode_transaction_body::<
3554 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3555 fidl::encoding::DefaultFuchsiaResourceDialect,
3556 0x54d9d4c9cf300a1e,
3557 >(_buf?)?;
3558 Ok(_response.map(|x| x))
3559 }
3560 self.client.send_query_and_decode::<DebugDeleteProfileRequest, DebugDeleteProfileResult>(
3561 (volume, profile),
3562 0x54d9d4c9cf300a1e,
3563 fidl::encoding::DynamicFlags::empty(),
3564 _decode,
3565 )
3566 }
3567
3568 type StopProfileTasksResponseFut = fidl::client::QueryResponseFut<
3569 DebugStopProfileTasksResult,
3570 fidl::encoding::DefaultFuchsiaResourceDialect,
3571 >;
3572 fn r#stop_profile_tasks(&self) -> Self::StopProfileTasksResponseFut {
3573 fn _decode(
3574 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3575 ) -> Result<DebugStopProfileTasksResult, fidl::Error> {
3576 let _response = fidl::client::decode_transaction_body::<
3577 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3578 fidl::encoding::DefaultFuchsiaResourceDialect,
3579 0x1657b945dd629177,
3580 >(_buf?)?;
3581 Ok(_response.map(|x| x))
3582 }
3583 self.client
3584 .send_query_and_decode::<fidl::encoding::EmptyPayload, DebugStopProfileTasksResult>(
3585 (),
3586 0x1657b945dd629177,
3587 fidl::encoding::DynamicFlags::empty(),
3588 _decode,
3589 )
3590 }
3591}
3592
3593pub struct DebugEventStream {
3594 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3595}
3596
3597impl std::marker::Unpin for DebugEventStream {}
3598
3599impl futures::stream::FusedStream for DebugEventStream {
3600 fn is_terminated(&self) -> bool {
3601 self.event_receiver.is_terminated()
3602 }
3603}
3604
3605impl futures::Stream for DebugEventStream {
3606 type Item = Result<DebugEvent, fidl::Error>;
3607
3608 fn poll_next(
3609 mut self: std::pin::Pin<&mut Self>,
3610 cx: &mut std::task::Context<'_>,
3611 ) -> std::task::Poll<Option<Self::Item>> {
3612 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3613 &mut self.event_receiver,
3614 cx
3615 )?) {
3616 Some(buf) => std::task::Poll::Ready(Some(DebugEvent::decode(buf))),
3617 None => std::task::Poll::Ready(None),
3618 }
3619 }
3620}
3621
3622#[derive(Debug)]
3623pub enum DebugEvent {}
3624
3625impl DebugEvent {
3626 fn decode(
3628 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3629 ) -> Result<DebugEvent, fidl::Error> {
3630 let (bytes, _handles) = buf.split_mut();
3631 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3632 debug_assert_eq!(tx_header.tx_id, 0);
3633 match tx_header.ordinal {
3634 _ => Err(fidl::Error::UnknownOrdinal {
3635 ordinal: tx_header.ordinal,
3636 protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3637 }),
3638 }
3639 }
3640}
3641
3642pub struct DebugRequestStream {
3644 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3645 is_terminated: bool,
3646}
3647
3648impl std::marker::Unpin for DebugRequestStream {}
3649
3650impl futures::stream::FusedStream for DebugRequestStream {
3651 fn is_terminated(&self) -> bool {
3652 self.is_terminated
3653 }
3654}
3655
3656impl fidl::endpoints::RequestStream for DebugRequestStream {
3657 type Protocol = DebugMarker;
3658 type ControlHandle = DebugControlHandle;
3659
3660 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3661 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3662 }
3663
3664 fn control_handle(&self) -> Self::ControlHandle {
3665 DebugControlHandle { inner: self.inner.clone() }
3666 }
3667
3668 fn into_inner(
3669 self,
3670 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3671 {
3672 (self.inner, self.is_terminated)
3673 }
3674
3675 fn from_inner(
3676 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3677 is_terminated: bool,
3678 ) -> Self {
3679 Self { inner, is_terminated }
3680 }
3681}
3682
3683impl futures::Stream for DebugRequestStream {
3684 type Item = Result<DebugRequest, fidl::Error>;
3685
3686 fn poll_next(
3687 mut self: std::pin::Pin<&mut Self>,
3688 cx: &mut std::task::Context<'_>,
3689 ) -> std::task::Poll<Option<Self::Item>> {
3690 let this = &mut *self;
3691 if this.inner.check_shutdown(cx) {
3692 this.is_terminated = true;
3693 return std::task::Poll::Ready(None);
3694 }
3695 if this.is_terminated {
3696 panic!("polled DebugRequestStream after completion");
3697 }
3698 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3699 |bytes, handles| {
3700 match this.inner.channel().read_etc(cx, bytes, handles) {
3701 std::task::Poll::Ready(Ok(())) => {}
3702 std::task::Poll::Pending => return std::task::Poll::Pending,
3703 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3704 this.is_terminated = true;
3705 return std::task::Poll::Ready(None);
3706 }
3707 std::task::Poll::Ready(Err(e)) => {
3708 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3709 e.into(),
3710 ))));
3711 }
3712 }
3713
3714 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3716
3717 std::task::Poll::Ready(Some(match header.ordinal {
3718 0x6553eb197306e489 => {
3719 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3720 let mut req = fidl::new_empty!(
3721 fidl::encoding::EmptyPayload,
3722 fidl::encoding::DefaultFuchsiaResourceDialect
3723 );
3724 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3725 let control_handle = DebugControlHandle { inner: this.inner.clone() };
3726 Ok(DebugRequest::Compact {
3727 responder: DebugCompactResponder {
3728 control_handle: std::mem::ManuallyDrop::new(control_handle),
3729 tx_id: header.tx_id,
3730 },
3731 })
3732 }
3733 0x54d9d4c9cf300a1e => {
3734 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3735 let mut req = fidl::new_empty!(
3736 DebugDeleteProfileRequest,
3737 fidl::encoding::DefaultFuchsiaResourceDialect
3738 );
3739 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugDeleteProfileRequest>(&header, _body_bytes, handles, &mut req)?;
3740 let control_handle = DebugControlHandle { inner: this.inner.clone() };
3741 Ok(DebugRequest::DeleteProfile {
3742 volume: req.volume,
3743 profile: req.profile,
3744
3745 responder: DebugDeleteProfileResponder {
3746 control_handle: std::mem::ManuallyDrop::new(control_handle),
3747 tx_id: header.tx_id,
3748 },
3749 })
3750 }
3751 0x1657b945dd629177 => {
3752 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3753 let mut req = fidl::new_empty!(
3754 fidl::encoding::EmptyPayload,
3755 fidl::encoding::DefaultFuchsiaResourceDialect
3756 );
3757 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3758 let control_handle = DebugControlHandle { inner: this.inner.clone() };
3759 Ok(DebugRequest::StopProfileTasks {
3760 responder: DebugStopProfileTasksResponder {
3761 control_handle: std::mem::ManuallyDrop::new(control_handle),
3762 tx_id: header.tx_id,
3763 },
3764 })
3765 }
3766 _ => Err(fidl::Error::UnknownOrdinal {
3767 ordinal: header.ordinal,
3768 protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3769 }),
3770 }))
3771 },
3772 )
3773 }
3774}
3775
3776#[derive(Debug)]
3779pub enum DebugRequest {
3780 Compact { responder: DebugCompactResponder },
3782 DeleteProfile { volume: String, profile: String, responder: DebugDeleteProfileResponder },
3785 StopProfileTasks { responder: DebugStopProfileTasksResponder },
3788}
3789
3790impl DebugRequest {
3791 #[allow(irrefutable_let_patterns)]
3792 pub fn into_compact(self) -> Option<(DebugCompactResponder)> {
3793 if let DebugRequest::Compact { responder } = self { Some((responder)) } else { None }
3794 }
3795
3796 #[allow(irrefutable_let_patterns)]
3797 pub fn into_delete_profile(self) -> Option<(String, String, DebugDeleteProfileResponder)> {
3798 if let DebugRequest::DeleteProfile { volume, profile, responder } = self {
3799 Some((volume, profile, responder))
3800 } else {
3801 None
3802 }
3803 }
3804
3805 #[allow(irrefutable_let_patterns)]
3806 pub fn into_stop_profile_tasks(self) -> Option<(DebugStopProfileTasksResponder)> {
3807 if let DebugRequest::StopProfileTasks { responder } = self {
3808 Some((responder))
3809 } else {
3810 None
3811 }
3812 }
3813
3814 pub fn method_name(&self) -> &'static str {
3816 match *self {
3817 DebugRequest::Compact { .. } => "compact",
3818 DebugRequest::DeleteProfile { .. } => "delete_profile",
3819 DebugRequest::StopProfileTasks { .. } => "stop_profile_tasks",
3820 }
3821 }
3822}
3823
3824#[derive(Debug, Clone)]
3825pub struct DebugControlHandle {
3826 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3827}
3828
3829impl fidl::endpoints::ControlHandle for DebugControlHandle {
3830 fn shutdown(&self) {
3831 self.inner.shutdown()
3832 }
3833 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3834 self.inner.shutdown_with_epitaph(status)
3835 }
3836
3837 fn is_closed(&self) -> bool {
3838 self.inner.channel().is_closed()
3839 }
3840 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3841 self.inner.channel().on_closed()
3842 }
3843
3844 #[cfg(target_os = "fuchsia")]
3845 fn signal_peer(
3846 &self,
3847 clear_mask: zx::Signals,
3848 set_mask: zx::Signals,
3849 ) -> Result<(), zx_status::Status> {
3850 use fidl::Peered;
3851 self.inner.channel().signal_peer(clear_mask, set_mask)
3852 }
3853}
3854
3855impl DebugControlHandle {}
3856
3857#[must_use = "FIDL methods require a response to be sent"]
3858#[derive(Debug)]
3859pub struct DebugCompactResponder {
3860 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
3861 tx_id: u32,
3862}
3863
3864impl std::ops::Drop for DebugCompactResponder {
3868 fn drop(&mut self) {
3869 self.control_handle.shutdown();
3870 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3872 }
3873}
3874
3875impl fidl::endpoints::Responder for DebugCompactResponder {
3876 type ControlHandle = DebugControlHandle;
3877
3878 fn control_handle(&self) -> &DebugControlHandle {
3879 &self.control_handle
3880 }
3881
3882 fn drop_without_shutdown(mut self) {
3883 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3885 std::mem::forget(self);
3887 }
3888}
3889
3890impl DebugCompactResponder {
3891 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3895 let _result = self.send_raw(result);
3896 if _result.is_err() {
3897 self.control_handle.shutdown();
3898 }
3899 self.drop_without_shutdown();
3900 _result
3901 }
3902
3903 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3905 let _result = self.send_raw(result);
3906 self.drop_without_shutdown();
3907 _result
3908 }
3909
3910 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3911 self.control_handle
3912 .inner
3913 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3914 result,
3915 self.tx_id,
3916 0x6553eb197306e489,
3917 fidl::encoding::DynamicFlags::empty(),
3918 )
3919 }
3920}
3921
3922#[must_use = "FIDL methods require a response to be sent"]
3923#[derive(Debug)]
3924pub struct DebugDeleteProfileResponder {
3925 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
3926 tx_id: u32,
3927}
3928
3929impl std::ops::Drop for DebugDeleteProfileResponder {
3933 fn drop(&mut self) {
3934 self.control_handle.shutdown();
3935 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3937 }
3938}
3939
3940impl fidl::endpoints::Responder for DebugDeleteProfileResponder {
3941 type ControlHandle = DebugControlHandle;
3942
3943 fn control_handle(&self) -> &DebugControlHandle {
3944 &self.control_handle
3945 }
3946
3947 fn drop_without_shutdown(mut self) {
3948 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3950 std::mem::forget(self);
3952 }
3953}
3954
3955impl DebugDeleteProfileResponder {
3956 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3960 let _result = self.send_raw(result);
3961 if _result.is_err() {
3962 self.control_handle.shutdown();
3963 }
3964 self.drop_without_shutdown();
3965 _result
3966 }
3967
3968 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3970 let _result = self.send_raw(result);
3971 self.drop_without_shutdown();
3972 _result
3973 }
3974
3975 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3976 self.control_handle
3977 .inner
3978 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3979 result,
3980 self.tx_id,
3981 0x54d9d4c9cf300a1e,
3982 fidl::encoding::DynamicFlags::empty(),
3983 )
3984 }
3985}
3986
3987#[must_use = "FIDL methods require a response to be sent"]
3988#[derive(Debug)]
3989pub struct DebugStopProfileTasksResponder {
3990 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
3991 tx_id: u32,
3992}
3993
3994impl std::ops::Drop for DebugStopProfileTasksResponder {
3998 fn drop(&mut self) {
3999 self.control_handle.shutdown();
4000 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4002 }
4003}
4004
4005impl fidl::endpoints::Responder for DebugStopProfileTasksResponder {
4006 type ControlHandle = DebugControlHandle;
4007
4008 fn control_handle(&self) -> &DebugControlHandle {
4009 &self.control_handle
4010 }
4011
4012 fn drop_without_shutdown(mut self) {
4013 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4015 std::mem::forget(self);
4017 }
4018}
4019
4020impl DebugStopProfileTasksResponder {
4021 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4025 let _result = self.send_raw(result);
4026 if _result.is_err() {
4027 self.control_handle.shutdown();
4028 }
4029 self.drop_without_shutdown();
4030 _result
4031 }
4032
4033 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4035 let _result = self.send_raw(result);
4036 self.drop_without_shutdown();
4037 _result
4038 }
4039
4040 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4041 self.control_handle
4042 .inner
4043 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4044 result,
4045 self.tx_id,
4046 0x1657b945dd629177,
4047 fidl::encoding::DynamicFlags::empty(),
4048 )
4049 }
4050}
4051
4052#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4053pub struct FileBackedVolumeProviderMarker;
4054
4055impl fidl::endpoints::ProtocolMarker for FileBackedVolumeProviderMarker {
4056 type Proxy = FileBackedVolumeProviderProxy;
4057 type RequestStream = FileBackedVolumeProviderRequestStream;
4058 #[cfg(target_os = "fuchsia")]
4059 type SynchronousProxy = FileBackedVolumeProviderSynchronousProxy;
4060
4061 const DEBUG_NAME: &'static str = "fuchsia.fxfs.FileBackedVolumeProvider";
4062}
4063impl fidl::endpoints::DiscoverableProtocolMarker for FileBackedVolumeProviderMarker {}
4064
4065pub trait FileBackedVolumeProviderProxyInterface: Send + Sync {
4066 fn r#open(
4067 &self,
4068 parent_directory_token: fidl::Handle,
4069 name: &str,
4070 server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block_volume::VolumeMarker>,
4071 ) -> Result<(), fidl::Error>;
4072}
4073#[derive(Debug)]
4074#[cfg(target_os = "fuchsia")]
4075pub struct FileBackedVolumeProviderSynchronousProxy {
4076 client: fidl::client::sync::Client,
4077}
4078
4079#[cfg(target_os = "fuchsia")]
4080impl fidl::endpoints::SynchronousProxy for FileBackedVolumeProviderSynchronousProxy {
4081 type Proxy = FileBackedVolumeProviderProxy;
4082 type Protocol = FileBackedVolumeProviderMarker;
4083
4084 fn from_channel(inner: fidl::Channel) -> Self {
4085 Self::new(inner)
4086 }
4087
4088 fn into_channel(self) -> fidl::Channel {
4089 self.client.into_channel()
4090 }
4091
4092 fn as_channel(&self) -> &fidl::Channel {
4093 self.client.as_channel()
4094 }
4095}
4096
4097#[cfg(target_os = "fuchsia")]
4098impl FileBackedVolumeProviderSynchronousProxy {
4099 pub fn new(channel: fidl::Channel) -> Self {
4100 let protocol_name =
4101 <FileBackedVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4102 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4103 }
4104
4105 pub fn into_channel(self) -> fidl::Channel {
4106 self.client.into_channel()
4107 }
4108
4109 pub fn wait_for_event(
4112 &self,
4113 deadline: zx::MonotonicInstant,
4114 ) -> Result<FileBackedVolumeProviderEvent, fidl::Error> {
4115 FileBackedVolumeProviderEvent::decode(self.client.wait_for_event(deadline)?)
4116 }
4117
4118 pub fn r#open(
4132 &self,
4133 mut parent_directory_token: fidl::Handle,
4134 mut name: &str,
4135 mut server_end: fidl::endpoints::ServerEnd<
4136 fidl_fuchsia_hardware_block_volume::VolumeMarker,
4137 >,
4138 ) -> Result<(), fidl::Error> {
4139 self.client.send::<FileBackedVolumeProviderOpenRequest>(
4140 (parent_directory_token, name, server_end),
4141 0x67120b9fc9f319ee,
4142 fidl::encoding::DynamicFlags::empty(),
4143 )
4144 }
4145}
4146
4147#[cfg(target_os = "fuchsia")]
4148impl From<FileBackedVolumeProviderSynchronousProxy> for zx::Handle {
4149 fn from(value: FileBackedVolumeProviderSynchronousProxy) -> Self {
4150 value.into_channel().into()
4151 }
4152}
4153
4154#[cfg(target_os = "fuchsia")]
4155impl From<fidl::Channel> for FileBackedVolumeProviderSynchronousProxy {
4156 fn from(value: fidl::Channel) -> Self {
4157 Self::new(value)
4158 }
4159}
4160
4161#[cfg(target_os = "fuchsia")]
4162impl fidl::endpoints::FromClient for FileBackedVolumeProviderSynchronousProxy {
4163 type Protocol = FileBackedVolumeProviderMarker;
4164
4165 fn from_client(value: fidl::endpoints::ClientEnd<FileBackedVolumeProviderMarker>) -> Self {
4166 Self::new(value.into_channel())
4167 }
4168}
4169
4170#[derive(Debug, Clone)]
4171pub struct FileBackedVolumeProviderProxy {
4172 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4173}
4174
4175impl fidl::endpoints::Proxy for FileBackedVolumeProviderProxy {
4176 type Protocol = FileBackedVolumeProviderMarker;
4177
4178 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4179 Self::new(inner)
4180 }
4181
4182 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4183 self.client.into_channel().map_err(|client| Self { client })
4184 }
4185
4186 fn as_channel(&self) -> &::fidl::AsyncChannel {
4187 self.client.as_channel()
4188 }
4189}
4190
4191impl FileBackedVolumeProviderProxy {
4192 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4194 let protocol_name =
4195 <FileBackedVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4196 Self { client: fidl::client::Client::new(channel, protocol_name) }
4197 }
4198
4199 pub fn take_event_stream(&self) -> FileBackedVolumeProviderEventStream {
4205 FileBackedVolumeProviderEventStream { event_receiver: self.client.take_event_receiver() }
4206 }
4207
4208 pub fn r#open(
4222 &self,
4223 mut parent_directory_token: fidl::Handle,
4224 mut name: &str,
4225 mut server_end: fidl::endpoints::ServerEnd<
4226 fidl_fuchsia_hardware_block_volume::VolumeMarker,
4227 >,
4228 ) -> Result<(), fidl::Error> {
4229 FileBackedVolumeProviderProxyInterface::r#open(
4230 self,
4231 parent_directory_token,
4232 name,
4233 server_end,
4234 )
4235 }
4236}
4237
4238impl FileBackedVolumeProviderProxyInterface for FileBackedVolumeProviderProxy {
4239 fn r#open(
4240 &self,
4241 mut parent_directory_token: fidl::Handle,
4242 mut name: &str,
4243 mut server_end: fidl::endpoints::ServerEnd<
4244 fidl_fuchsia_hardware_block_volume::VolumeMarker,
4245 >,
4246 ) -> Result<(), fidl::Error> {
4247 self.client.send::<FileBackedVolumeProviderOpenRequest>(
4248 (parent_directory_token, name, server_end),
4249 0x67120b9fc9f319ee,
4250 fidl::encoding::DynamicFlags::empty(),
4251 )
4252 }
4253}
4254
4255pub struct FileBackedVolumeProviderEventStream {
4256 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4257}
4258
4259impl std::marker::Unpin for FileBackedVolumeProviderEventStream {}
4260
4261impl futures::stream::FusedStream for FileBackedVolumeProviderEventStream {
4262 fn is_terminated(&self) -> bool {
4263 self.event_receiver.is_terminated()
4264 }
4265}
4266
4267impl futures::Stream for FileBackedVolumeProviderEventStream {
4268 type Item = Result<FileBackedVolumeProviderEvent, fidl::Error>;
4269
4270 fn poll_next(
4271 mut self: std::pin::Pin<&mut Self>,
4272 cx: &mut std::task::Context<'_>,
4273 ) -> std::task::Poll<Option<Self::Item>> {
4274 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4275 &mut self.event_receiver,
4276 cx
4277 )?) {
4278 Some(buf) => std::task::Poll::Ready(Some(FileBackedVolumeProviderEvent::decode(buf))),
4279 None => std::task::Poll::Ready(None),
4280 }
4281 }
4282}
4283
4284#[derive(Debug)]
4285pub enum FileBackedVolumeProviderEvent {}
4286
4287impl FileBackedVolumeProviderEvent {
4288 fn decode(
4290 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4291 ) -> Result<FileBackedVolumeProviderEvent, fidl::Error> {
4292 let (bytes, _handles) = buf.split_mut();
4293 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4294 debug_assert_eq!(tx_header.tx_id, 0);
4295 match tx_header.ordinal {
4296 _ => Err(fidl::Error::UnknownOrdinal {
4297 ordinal: tx_header.ordinal,
4298 protocol_name:
4299 <FileBackedVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4300 }),
4301 }
4302 }
4303}
4304
4305pub struct FileBackedVolumeProviderRequestStream {
4307 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4308 is_terminated: bool,
4309}
4310
4311impl std::marker::Unpin for FileBackedVolumeProviderRequestStream {}
4312
4313impl futures::stream::FusedStream for FileBackedVolumeProviderRequestStream {
4314 fn is_terminated(&self) -> bool {
4315 self.is_terminated
4316 }
4317}
4318
4319impl fidl::endpoints::RequestStream for FileBackedVolumeProviderRequestStream {
4320 type Protocol = FileBackedVolumeProviderMarker;
4321 type ControlHandle = FileBackedVolumeProviderControlHandle;
4322
4323 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4324 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4325 }
4326
4327 fn control_handle(&self) -> Self::ControlHandle {
4328 FileBackedVolumeProviderControlHandle { inner: self.inner.clone() }
4329 }
4330
4331 fn into_inner(
4332 self,
4333 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4334 {
4335 (self.inner, self.is_terminated)
4336 }
4337
4338 fn from_inner(
4339 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4340 is_terminated: bool,
4341 ) -> Self {
4342 Self { inner, is_terminated }
4343 }
4344}
4345
4346impl futures::Stream for FileBackedVolumeProviderRequestStream {
4347 type Item = Result<FileBackedVolumeProviderRequest, fidl::Error>;
4348
4349 fn poll_next(
4350 mut self: std::pin::Pin<&mut Self>,
4351 cx: &mut std::task::Context<'_>,
4352 ) -> std::task::Poll<Option<Self::Item>> {
4353 let this = &mut *self;
4354 if this.inner.check_shutdown(cx) {
4355 this.is_terminated = true;
4356 return std::task::Poll::Ready(None);
4357 }
4358 if this.is_terminated {
4359 panic!("polled FileBackedVolumeProviderRequestStream after completion");
4360 }
4361 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4362 |bytes, handles| {
4363 match this.inner.channel().read_etc(cx, bytes, handles) {
4364 std::task::Poll::Ready(Ok(())) => {}
4365 std::task::Poll::Pending => return std::task::Poll::Pending,
4366 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4367 this.is_terminated = true;
4368 return std::task::Poll::Ready(None);
4369 }
4370 std::task::Poll::Ready(Err(e)) => {
4371 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4372 e.into(),
4373 ))));
4374 }
4375 }
4376
4377 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4379
4380 std::task::Poll::Ready(Some(match header.ordinal {
4381 0x67120b9fc9f319ee => {
4382 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4383 let mut req = fidl::new_empty!(FileBackedVolumeProviderOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
4384 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileBackedVolumeProviderOpenRequest>(&header, _body_bytes, handles, &mut req)?;
4385 let control_handle = FileBackedVolumeProviderControlHandle {
4386 inner: this.inner.clone(),
4387 };
4388 Ok(FileBackedVolumeProviderRequest::Open {parent_directory_token: req.parent_directory_token,
4389name: req.name,
4390server_end: req.server_end,
4391
4392 control_handle,
4393 })
4394 }
4395 _ => Err(fidl::Error::UnknownOrdinal {
4396 ordinal: header.ordinal,
4397 protocol_name: <FileBackedVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4398 }),
4399 }))
4400 },
4401 )
4402 }
4403}
4404
4405#[derive(Debug)]
4407pub enum FileBackedVolumeProviderRequest {
4408 Open {
4422 parent_directory_token: fidl::Handle,
4423 name: String,
4424 server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block_volume::VolumeMarker>,
4425 control_handle: FileBackedVolumeProviderControlHandle,
4426 },
4427}
4428
4429impl FileBackedVolumeProviderRequest {
4430 #[allow(irrefutable_let_patterns)]
4431 pub fn into_open(
4432 self,
4433 ) -> Option<(
4434 fidl::Handle,
4435 String,
4436 fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block_volume::VolumeMarker>,
4437 FileBackedVolumeProviderControlHandle,
4438 )> {
4439 if let FileBackedVolumeProviderRequest::Open {
4440 parent_directory_token,
4441 name,
4442 server_end,
4443 control_handle,
4444 } = self
4445 {
4446 Some((parent_directory_token, name, server_end, control_handle))
4447 } else {
4448 None
4449 }
4450 }
4451
4452 pub fn method_name(&self) -> &'static str {
4454 match *self {
4455 FileBackedVolumeProviderRequest::Open { .. } => "open",
4456 }
4457 }
4458}
4459
4460#[derive(Debug, Clone)]
4461pub struct FileBackedVolumeProviderControlHandle {
4462 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4463}
4464
4465impl fidl::endpoints::ControlHandle for FileBackedVolumeProviderControlHandle {
4466 fn shutdown(&self) {
4467 self.inner.shutdown()
4468 }
4469 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4470 self.inner.shutdown_with_epitaph(status)
4471 }
4472
4473 fn is_closed(&self) -> bool {
4474 self.inner.channel().is_closed()
4475 }
4476 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4477 self.inner.channel().on_closed()
4478 }
4479
4480 #[cfg(target_os = "fuchsia")]
4481 fn signal_peer(
4482 &self,
4483 clear_mask: zx::Signals,
4484 set_mask: zx::Signals,
4485 ) -> Result<(), zx_status::Status> {
4486 use fidl::Peered;
4487 self.inner.channel().signal_peer(clear_mask, set_mask)
4488 }
4489}
4490
4491impl FileBackedVolumeProviderControlHandle {}
4492
4493#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4494pub struct ProjectIdMarker;
4495
4496impl fidl::endpoints::ProtocolMarker for ProjectIdMarker {
4497 type Proxy = ProjectIdProxy;
4498 type RequestStream = ProjectIdRequestStream;
4499 #[cfg(target_os = "fuchsia")]
4500 type SynchronousProxy = ProjectIdSynchronousProxy;
4501
4502 const DEBUG_NAME: &'static str = "fuchsia.fxfs.ProjectId";
4503}
4504impl fidl::endpoints::DiscoverableProtocolMarker for ProjectIdMarker {}
4505pub type ProjectIdSetLimitResult = Result<(), i32>;
4506pub type ProjectIdClearResult = Result<(), i32>;
4507pub type ProjectIdSetForNodeResult = Result<(), i32>;
4508pub type ProjectIdGetForNodeResult = Result<u64, i32>;
4509pub type ProjectIdClearForNodeResult = Result<(), i32>;
4510pub type ProjectIdListResult = Result<(Vec<u64>, Option<Box<ProjectIterToken>>), i32>;
4511pub type ProjectIdInfoResult = Result<(BytesAndNodes, BytesAndNodes), i32>;
4512
4513pub trait ProjectIdProxyInterface: Send + Sync {
4514 type SetLimitResponseFut: std::future::Future<Output = Result<ProjectIdSetLimitResult, fidl::Error>>
4515 + Send;
4516 fn r#set_limit(&self, project_id: u64, bytes: u64, nodes: u64) -> Self::SetLimitResponseFut;
4517 type ClearResponseFut: std::future::Future<Output = Result<ProjectIdClearResult, fidl::Error>>
4518 + Send;
4519 fn r#clear(&self, project_id: u64) -> Self::ClearResponseFut;
4520 type SetForNodeResponseFut: std::future::Future<Output = Result<ProjectIdSetForNodeResult, fidl::Error>>
4521 + Send;
4522 fn r#set_for_node(&self, node_id: u64, project_id: u64) -> Self::SetForNodeResponseFut;
4523 type GetForNodeResponseFut: std::future::Future<Output = Result<ProjectIdGetForNodeResult, fidl::Error>>
4524 + Send;
4525 fn r#get_for_node(&self, node_id: u64) -> Self::GetForNodeResponseFut;
4526 type ClearForNodeResponseFut: std::future::Future<Output = Result<ProjectIdClearForNodeResult, fidl::Error>>
4527 + Send;
4528 fn r#clear_for_node(&self, node_id: u64) -> Self::ClearForNodeResponseFut;
4529 type ListResponseFut: std::future::Future<Output = Result<ProjectIdListResult, fidl::Error>>
4530 + Send;
4531 fn r#list(&self, token: Option<&ProjectIterToken>) -> Self::ListResponseFut;
4532 type InfoResponseFut: std::future::Future<Output = Result<ProjectIdInfoResult, fidl::Error>>
4533 + Send;
4534 fn r#info(&self, project_id: u64) -> Self::InfoResponseFut;
4535}
4536#[derive(Debug)]
4537#[cfg(target_os = "fuchsia")]
4538pub struct ProjectIdSynchronousProxy {
4539 client: fidl::client::sync::Client,
4540}
4541
4542#[cfg(target_os = "fuchsia")]
4543impl fidl::endpoints::SynchronousProxy for ProjectIdSynchronousProxy {
4544 type Proxy = ProjectIdProxy;
4545 type Protocol = ProjectIdMarker;
4546
4547 fn from_channel(inner: fidl::Channel) -> Self {
4548 Self::new(inner)
4549 }
4550
4551 fn into_channel(self) -> fidl::Channel {
4552 self.client.into_channel()
4553 }
4554
4555 fn as_channel(&self) -> &fidl::Channel {
4556 self.client.as_channel()
4557 }
4558}
4559
4560#[cfg(target_os = "fuchsia")]
4561impl ProjectIdSynchronousProxy {
4562 pub fn new(channel: fidl::Channel) -> Self {
4563 let protocol_name = <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4564 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4565 }
4566
4567 pub fn into_channel(self) -> fidl::Channel {
4568 self.client.into_channel()
4569 }
4570
4571 pub fn wait_for_event(
4574 &self,
4575 deadline: zx::MonotonicInstant,
4576 ) -> Result<ProjectIdEvent, fidl::Error> {
4577 ProjectIdEvent::decode(self.client.wait_for_event(deadline)?)
4578 }
4579
4580 pub fn r#set_limit(
4584 &self,
4585 mut project_id: u64,
4586 mut bytes: u64,
4587 mut nodes: u64,
4588 ___deadline: zx::MonotonicInstant,
4589 ) -> Result<ProjectIdSetLimitResult, fidl::Error> {
4590 let _response = self.client.send_query::<
4591 ProjectIdSetLimitRequest,
4592 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4593 >(
4594 (project_id, bytes, nodes,),
4595 0x20b0fc1e0413876f,
4596 fidl::encoding::DynamicFlags::empty(),
4597 ___deadline,
4598 )?;
4599 Ok(_response.map(|x| x))
4600 }
4601
4602 pub fn r#clear(
4606 &self,
4607 mut project_id: u64,
4608 ___deadline: zx::MonotonicInstant,
4609 ) -> Result<ProjectIdClearResult, fidl::Error> {
4610 let _response = self.client.send_query::<
4611 ProjectIdClearRequest,
4612 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4613 >(
4614 (project_id,),
4615 0x165b5f1e707863c1,
4616 fidl::encoding::DynamicFlags::empty(),
4617 ___deadline,
4618 )?;
4619 Ok(_response.map(|x| x))
4620 }
4621
4622 pub fn r#set_for_node(
4625 &self,
4626 mut node_id: u64,
4627 mut project_id: u64,
4628 ___deadline: zx::MonotonicInstant,
4629 ) -> Result<ProjectIdSetForNodeResult, fidl::Error> {
4630 let _response = self.client.send_query::<
4631 ProjectIdSetForNodeRequest,
4632 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4633 >(
4634 (node_id, project_id,),
4635 0x4d7a8442dc58324c,
4636 fidl::encoding::DynamicFlags::empty(),
4637 ___deadline,
4638 )?;
4639 Ok(_response.map(|x| x))
4640 }
4641
4642 pub fn r#get_for_node(
4646 &self,
4647 mut node_id: u64,
4648 ___deadline: zx::MonotonicInstant,
4649 ) -> Result<ProjectIdGetForNodeResult, fidl::Error> {
4650 let _response = self.client.send_query::<
4651 ProjectIdGetForNodeRequest,
4652 fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>,
4653 >(
4654 (node_id,),
4655 0x644073bdf2542573,
4656 fidl::encoding::DynamicFlags::empty(),
4657 ___deadline,
4658 )?;
4659 Ok(_response.map(|x| x.project_id))
4660 }
4661
4662 pub fn r#clear_for_node(
4666 &self,
4667 mut node_id: u64,
4668 ___deadline: zx::MonotonicInstant,
4669 ) -> Result<ProjectIdClearForNodeResult, fidl::Error> {
4670 let _response = self.client.send_query::<
4671 ProjectIdClearForNodeRequest,
4672 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4673 >(
4674 (node_id,),
4675 0x3f2ca287bbfe6a62,
4676 fidl::encoding::DynamicFlags::empty(),
4677 ___deadline,
4678 )?;
4679 Ok(_response.map(|x| x))
4680 }
4681
4682 pub fn r#list(
4687 &self,
4688 mut token: Option<&ProjectIterToken>,
4689 ___deadline: zx::MonotonicInstant,
4690 ) -> Result<ProjectIdListResult, fidl::Error> {
4691 let _response = self.client.send_query::<
4692 ProjectIdListRequest,
4693 fidl::encoding::ResultType<ProjectIdListResponse, i32>,
4694 >(
4695 (token,),
4696 0x5505f95a36d522cc,
4697 fidl::encoding::DynamicFlags::empty(),
4698 ___deadline,
4699 )?;
4700 Ok(_response.map(|x| (x.entries, x.next_token)))
4701 }
4702
4703 pub fn r#info(
4706 &self,
4707 mut project_id: u64,
4708 ___deadline: zx::MonotonicInstant,
4709 ) -> Result<ProjectIdInfoResult, fidl::Error> {
4710 let _response = self.client.send_query::<
4711 ProjectIdInfoRequest,
4712 fidl::encoding::ResultType<ProjectIdInfoResponse, i32>,
4713 >(
4714 (project_id,),
4715 0x51b47743c9e2d1ab,
4716 fidl::encoding::DynamicFlags::empty(),
4717 ___deadline,
4718 )?;
4719 Ok(_response.map(|x| (x.limit, x.usage)))
4720 }
4721}
4722
4723#[cfg(target_os = "fuchsia")]
4724impl From<ProjectIdSynchronousProxy> for zx::Handle {
4725 fn from(value: ProjectIdSynchronousProxy) -> Self {
4726 value.into_channel().into()
4727 }
4728}
4729
4730#[cfg(target_os = "fuchsia")]
4731impl From<fidl::Channel> for ProjectIdSynchronousProxy {
4732 fn from(value: fidl::Channel) -> Self {
4733 Self::new(value)
4734 }
4735}
4736
4737#[cfg(target_os = "fuchsia")]
4738impl fidl::endpoints::FromClient for ProjectIdSynchronousProxy {
4739 type Protocol = ProjectIdMarker;
4740
4741 fn from_client(value: fidl::endpoints::ClientEnd<ProjectIdMarker>) -> Self {
4742 Self::new(value.into_channel())
4743 }
4744}
4745
4746#[derive(Debug, Clone)]
4747pub struct ProjectIdProxy {
4748 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4749}
4750
4751impl fidl::endpoints::Proxy for ProjectIdProxy {
4752 type Protocol = ProjectIdMarker;
4753
4754 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4755 Self::new(inner)
4756 }
4757
4758 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4759 self.client.into_channel().map_err(|client| Self { client })
4760 }
4761
4762 fn as_channel(&self) -> &::fidl::AsyncChannel {
4763 self.client.as_channel()
4764 }
4765}
4766
4767impl ProjectIdProxy {
4768 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4770 let protocol_name = <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4771 Self { client: fidl::client::Client::new(channel, protocol_name) }
4772 }
4773
4774 pub fn take_event_stream(&self) -> ProjectIdEventStream {
4780 ProjectIdEventStream { event_receiver: self.client.take_event_receiver() }
4781 }
4782
4783 pub fn r#set_limit(
4787 &self,
4788 mut project_id: u64,
4789 mut bytes: u64,
4790 mut nodes: u64,
4791 ) -> fidl::client::QueryResponseFut<
4792 ProjectIdSetLimitResult,
4793 fidl::encoding::DefaultFuchsiaResourceDialect,
4794 > {
4795 ProjectIdProxyInterface::r#set_limit(self, project_id, bytes, nodes)
4796 }
4797
4798 pub fn r#clear(
4802 &self,
4803 mut project_id: u64,
4804 ) -> fidl::client::QueryResponseFut<
4805 ProjectIdClearResult,
4806 fidl::encoding::DefaultFuchsiaResourceDialect,
4807 > {
4808 ProjectIdProxyInterface::r#clear(self, project_id)
4809 }
4810
4811 pub fn r#set_for_node(
4814 &self,
4815 mut node_id: u64,
4816 mut project_id: u64,
4817 ) -> fidl::client::QueryResponseFut<
4818 ProjectIdSetForNodeResult,
4819 fidl::encoding::DefaultFuchsiaResourceDialect,
4820 > {
4821 ProjectIdProxyInterface::r#set_for_node(self, node_id, project_id)
4822 }
4823
4824 pub fn r#get_for_node(
4828 &self,
4829 mut node_id: u64,
4830 ) -> fidl::client::QueryResponseFut<
4831 ProjectIdGetForNodeResult,
4832 fidl::encoding::DefaultFuchsiaResourceDialect,
4833 > {
4834 ProjectIdProxyInterface::r#get_for_node(self, node_id)
4835 }
4836
4837 pub fn r#clear_for_node(
4841 &self,
4842 mut node_id: u64,
4843 ) -> fidl::client::QueryResponseFut<
4844 ProjectIdClearForNodeResult,
4845 fidl::encoding::DefaultFuchsiaResourceDialect,
4846 > {
4847 ProjectIdProxyInterface::r#clear_for_node(self, node_id)
4848 }
4849
4850 pub fn r#list(
4855 &self,
4856 mut token: Option<&ProjectIterToken>,
4857 ) -> fidl::client::QueryResponseFut<
4858 ProjectIdListResult,
4859 fidl::encoding::DefaultFuchsiaResourceDialect,
4860 > {
4861 ProjectIdProxyInterface::r#list(self, token)
4862 }
4863
4864 pub fn r#info(
4867 &self,
4868 mut project_id: u64,
4869 ) -> fidl::client::QueryResponseFut<
4870 ProjectIdInfoResult,
4871 fidl::encoding::DefaultFuchsiaResourceDialect,
4872 > {
4873 ProjectIdProxyInterface::r#info(self, project_id)
4874 }
4875}
4876
4877impl ProjectIdProxyInterface for ProjectIdProxy {
4878 type SetLimitResponseFut = fidl::client::QueryResponseFut<
4879 ProjectIdSetLimitResult,
4880 fidl::encoding::DefaultFuchsiaResourceDialect,
4881 >;
4882 fn r#set_limit(
4883 &self,
4884 mut project_id: u64,
4885 mut bytes: u64,
4886 mut nodes: u64,
4887 ) -> Self::SetLimitResponseFut {
4888 fn _decode(
4889 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4890 ) -> Result<ProjectIdSetLimitResult, fidl::Error> {
4891 let _response = fidl::client::decode_transaction_body::<
4892 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4893 fidl::encoding::DefaultFuchsiaResourceDialect,
4894 0x20b0fc1e0413876f,
4895 >(_buf?)?;
4896 Ok(_response.map(|x| x))
4897 }
4898 self.client.send_query_and_decode::<ProjectIdSetLimitRequest, ProjectIdSetLimitResult>(
4899 (project_id, bytes, nodes),
4900 0x20b0fc1e0413876f,
4901 fidl::encoding::DynamicFlags::empty(),
4902 _decode,
4903 )
4904 }
4905
4906 type ClearResponseFut = fidl::client::QueryResponseFut<
4907 ProjectIdClearResult,
4908 fidl::encoding::DefaultFuchsiaResourceDialect,
4909 >;
4910 fn r#clear(&self, mut project_id: u64) -> Self::ClearResponseFut {
4911 fn _decode(
4912 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4913 ) -> Result<ProjectIdClearResult, fidl::Error> {
4914 let _response = fidl::client::decode_transaction_body::<
4915 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4916 fidl::encoding::DefaultFuchsiaResourceDialect,
4917 0x165b5f1e707863c1,
4918 >(_buf?)?;
4919 Ok(_response.map(|x| x))
4920 }
4921 self.client.send_query_and_decode::<ProjectIdClearRequest, ProjectIdClearResult>(
4922 (project_id,),
4923 0x165b5f1e707863c1,
4924 fidl::encoding::DynamicFlags::empty(),
4925 _decode,
4926 )
4927 }
4928
4929 type SetForNodeResponseFut = fidl::client::QueryResponseFut<
4930 ProjectIdSetForNodeResult,
4931 fidl::encoding::DefaultFuchsiaResourceDialect,
4932 >;
4933 fn r#set_for_node(&self, mut node_id: u64, mut project_id: u64) -> Self::SetForNodeResponseFut {
4934 fn _decode(
4935 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4936 ) -> Result<ProjectIdSetForNodeResult, fidl::Error> {
4937 let _response = fidl::client::decode_transaction_body::<
4938 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4939 fidl::encoding::DefaultFuchsiaResourceDialect,
4940 0x4d7a8442dc58324c,
4941 >(_buf?)?;
4942 Ok(_response.map(|x| x))
4943 }
4944 self.client.send_query_and_decode::<ProjectIdSetForNodeRequest, ProjectIdSetForNodeResult>(
4945 (node_id, project_id),
4946 0x4d7a8442dc58324c,
4947 fidl::encoding::DynamicFlags::empty(),
4948 _decode,
4949 )
4950 }
4951
4952 type GetForNodeResponseFut = fidl::client::QueryResponseFut<
4953 ProjectIdGetForNodeResult,
4954 fidl::encoding::DefaultFuchsiaResourceDialect,
4955 >;
4956 fn r#get_for_node(&self, mut node_id: u64) -> Self::GetForNodeResponseFut {
4957 fn _decode(
4958 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4959 ) -> Result<ProjectIdGetForNodeResult, fidl::Error> {
4960 let _response = fidl::client::decode_transaction_body::<
4961 fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>,
4962 fidl::encoding::DefaultFuchsiaResourceDialect,
4963 0x644073bdf2542573,
4964 >(_buf?)?;
4965 Ok(_response.map(|x| x.project_id))
4966 }
4967 self.client.send_query_and_decode::<ProjectIdGetForNodeRequest, ProjectIdGetForNodeResult>(
4968 (node_id,),
4969 0x644073bdf2542573,
4970 fidl::encoding::DynamicFlags::empty(),
4971 _decode,
4972 )
4973 }
4974
4975 type ClearForNodeResponseFut = fidl::client::QueryResponseFut<
4976 ProjectIdClearForNodeResult,
4977 fidl::encoding::DefaultFuchsiaResourceDialect,
4978 >;
4979 fn r#clear_for_node(&self, mut node_id: u64) -> Self::ClearForNodeResponseFut {
4980 fn _decode(
4981 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4982 ) -> Result<ProjectIdClearForNodeResult, fidl::Error> {
4983 let _response = fidl::client::decode_transaction_body::<
4984 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4985 fidl::encoding::DefaultFuchsiaResourceDialect,
4986 0x3f2ca287bbfe6a62,
4987 >(_buf?)?;
4988 Ok(_response.map(|x| x))
4989 }
4990 self.client
4991 .send_query_and_decode::<ProjectIdClearForNodeRequest, ProjectIdClearForNodeResult>(
4992 (node_id,),
4993 0x3f2ca287bbfe6a62,
4994 fidl::encoding::DynamicFlags::empty(),
4995 _decode,
4996 )
4997 }
4998
4999 type ListResponseFut = fidl::client::QueryResponseFut<
5000 ProjectIdListResult,
5001 fidl::encoding::DefaultFuchsiaResourceDialect,
5002 >;
5003 fn r#list(&self, mut token: Option<&ProjectIterToken>) -> Self::ListResponseFut {
5004 fn _decode(
5005 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5006 ) -> Result<ProjectIdListResult, fidl::Error> {
5007 let _response = fidl::client::decode_transaction_body::<
5008 fidl::encoding::ResultType<ProjectIdListResponse, i32>,
5009 fidl::encoding::DefaultFuchsiaResourceDialect,
5010 0x5505f95a36d522cc,
5011 >(_buf?)?;
5012 Ok(_response.map(|x| (x.entries, x.next_token)))
5013 }
5014 self.client.send_query_and_decode::<ProjectIdListRequest, ProjectIdListResult>(
5015 (token,),
5016 0x5505f95a36d522cc,
5017 fidl::encoding::DynamicFlags::empty(),
5018 _decode,
5019 )
5020 }
5021
5022 type InfoResponseFut = fidl::client::QueryResponseFut<
5023 ProjectIdInfoResult,
5024 fidl::encoding::DefaultFuchsiaResourceDialect,
5025 >;
5026 fn r#info(&self, mut project_id: u64) -> Self::InfoResponseFut {
5027 fn _decode(
5028 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5029 ) -> Result<ProjectIdInfoResult, fidl::Error> {
5030 let _response = fidl::client::decode_transaction_body::<
5031 fidl::encoding::ResultType<ProjectIdInfoResponse, i32>,
5032 fidl::encoding::DefaultFuchsiaResourceDialect,
5033 0x51b47743c9e2d1ab,
5034 >(_buf?)?;
5035 Ok(_response.map(|x| (x.limit, x.usage)))
5036 }
5037 self.client.send_query_and_decode::<ProjectIdInfoRequest, ProjectIdInfoResult>(
5038 (project_id,),
5039 0x51b47743c9e2d1ab,
5040 fidl::encoding::DynamicFlags::empty(),
5041 _decode,
5042 )
5043 }
5044}
5045
5046pub struct ProjectIdEventStream {
5047 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5048}
5049
5050impl std::marker::Unpin for ProjectIdEventStream {}
5051
5052impl futures::stream::FusedStream for ProjectIdEventStream {
5053 fn is_terminated(&self) -> bool {
5054 self.event_receiver.is_terminated()
5055 }
5056}
5057
5058impl futures::Stream for ProjectIdEventStream {
5059 type Item = Result<ProjectIdEvent, fidl::Error>;
5060
5061 fn poll_next(
5062 mut self: std::pin::Pin<&mut Self>,
5063 cx: &mut std::task::Context<'_>,
5064 ) -> std::task::Poll<Option<Self::Item>> {
5065 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5066 &mut self.event_receiver,
5067 cx
5068 )?) {
5069 Some(buf) => std::task::Poll::Ready(Some(ProjectIdEvent::decode(buf))),
5070 None => std::task::Poll::Ready(None),
5071 }
5072 }
5073}
5074
5075#[derive(Debug)]
5076pub enum ProjectIdEvent {}
5077
5078impl ProjectIdEvent {
5079 fn decode(
5081 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5082 ) -> Result<ProjectIdEvent, fidl::Error> {
5083 let (bytes, _handles) = buf.split_mut();
5084 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5085 debug_assert_eq!(tx_header.tx_id, 0);
5086 match tx_header.ordinal {
5087 _ => Err(fidl::Error::UnknownOrdinal {
5088 ordinal: tx_header.ordinal,
5089 protocol_name: <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5090 }),
5091 }
5092 }
5093}
5094
5095pub struct ProjectIdRequestStream {
5097 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5098 is_terminated: bool,
5099}
5100
5101impl std::marker::Unpin for ProjectIdRequestStream {}
5102
5103impl futures::stream::FusedStream for ProjectIdRequestStream {
5104 fn is_terminated(&self) -> bool {
5105 self.is_terminated
5106 }
5107}
5108
5109impl fidl::endpoints::RequestStream for ProjectIdRequestStream {
5110 type Protocol = ProjectIdMarker;
5111 type ControlHandle = ProjectIdControlHandle;
5112
5113 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5114 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5115 }
5116
5117 fn control_handle(&self) -> Self::ControlHandle {
5118 ProjectIdControlHandle { inner: self.inner.clone() }
5119 }
5120
5121 fn into_inner(
5122 self,
5123 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5124 {
5125 (self.inner, self.is_terminated)
5126 }
5127
5128 fn from_inner(
5129 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5130 is_terminated: bool,
5131 ) -> Self {
5132 Self { inner, is_terminated }
5133 }
5134}
5135
5136impl futures::Stream for ProjectIdRequestStream {
5137 type Item = Result<ProjectIdRequest, fidl::Error>;
5138
5139 fn poll_next(
5140 mut self: std::pin::Pin<&mut Self>,
5141 cx: &mut std::task::Context<'_>,
5142 ) -> std::task::Poll<Option<Self::Item>> {
5143 let this = &mut *self;
5144 if this.inner.check_shutdown(cx) {
5145 this.is_terminated = true;
5146 return std::task::Poll::Ready(None);
5147 }
5148 if this.is_terminated {
5149 panic!("polled ProjectIdRequestStream after completion");
5150 }
5151 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5152 |bytes, handles| {
5153 match this.inner.channel().read_etc(cx, bytes, handles) {
5154 std::task::Poll::Ready(Ok(())) => {}
5155 std::task::Poll::Pending => return std::task::Poll::Pending,
5156 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5157 this.is_terminated = true;
5158 return std::task::Poll::Ready(None);
5159 }
5160 std::task::Poll::Ready(Err(e)) => {
5161 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5162 e.into(),
5163 ))));
5164 }
5165 }
5166
5167 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5169
5170 std::task::Poll::Ready(Some(match header.ordinal {
5171 0x20b0fc1e0413876f => {
5172 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5173 let mut req = fidl::new_empty!(
5174 ProjectIdSetLimitRequest,
5175 fidl::encoding::DefaultFuchsiaResourceDialect
5176 );
5177 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdSetLimitRequest>(&header, _body_bytes, handles, &mut req)?;
5178 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5179 Ok(ProjectIdRequest::SetLimit {
5180 project_id: req.project_id,
5181 bytes: req.bytes,
5182 nodes: req.nodes,
5183
5184 responder: ProjectIdSetLimitResponder {
5185 control_handle: std::mem::ManuallyDrop::new(control_handle),
5186 tx_id: header.tx_id,
5187 },
5188 })
5189 }
5190 0x165b5f1e707863c1 => {
5191 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5192 let mut req = fidl::new_empty!(
5193 ProjectIdClearRequest,
5194 fidl::encoding::DefaultFuchsiaResourceDialect
5195 );
5196 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdClearRequest>(&header, _body_bytes, handles, &mut req)?;
5197 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5198 Ok(ProjectIdRequest::Clear {
5199 project_id: req.project_id,
5200
5201 responder: ProjectIdClearResponder {
5202 control_handle: std::mem::ManuallyDrop::new(control_handle),
5203 tx_id: header.tx_id,
5204 },
5205 })
5206 }
5207 0x4d7a8442dc58324c => {
5208 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5209 let mut req = fidl::new_empty!(
5210 ProjectIdSetForNodeRequest,
5211 fidl::encoding::DefaultFuchsiaResourceDialect
5212 );
5213 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdSetForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
5214 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5215 Ok(ProjectIdRequest::SetForNode {
5216 node_id: req.node_id,
5217 project_id: req.project_id,
5218
5219 responder: ProjectIdSetForNodeResponder {
5220 control_handle: std::mem::ManuallyDrop::new(control_handle),
5221 tx_id: header.tx_id,
5222 },
5223 })
5224 }
5225 0x644073bdf2542573 => {
5226 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5227 let mut req = fidl::new_empty!(
5228 ProjectIdGetForNodeRequest,
5229 fidl::encoding::DefaultFuchsiaResourceDialect
5230 );
5231 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdGetForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
5232 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5233 Ok(ProjectIdRequest::GetForNode {
5234 node_id: req.node_id,
5235
5236 responder: ProjectIdGetForNodeResponder {
5237 control_handle: std::mem::ManuallyDrop::new(control_handle),
5238 tx_id: header.tx_id,
5239 },
5240 })
5241 }
5242 0x3f2ca287bbfe6a62 => {
5243 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5244 let mut req = fidl::new_empty!(
5245 ProjectIdClearForNodeRequest,
5246 fidl::encoding::DefaultFuchsiaResourceDialect
5247 );
5248 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdClearForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
5249 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5250 Ok(ProjectIdRequest::ClearForNode {
5251 node_id: req.node_id,
5252
5253 responder: ProjectIdClearForNodeResponder {
5254 control_handle: std::mem::ManuallyDrop::new(control_handle),
5255 tx_id: header.tx_id,
5256 },
5257 })
5258 }
5259 0x5505f95a36d522cc => {
5260 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5261 let mut req = fidl::new_empty!(
5262 ProjectIdListRequest,
5263 fidl::encoding::DefaultFuchsiaResourceDialect
5264 );
5265 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdListRequest>(&header, _body_bytes, handles, &mut req)?;
5266 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5267 Ok(ProjectIdRequest::List {
5268 token: req.token,
5269
5270 responder: ProjectIdListResponder {
5271 control_handle: std::mem::ManuallyDrop::new(control_handle),
5272 tx_id: header.tx_id,
5273 },
5274 })
5275 }
5276 0x51b47743c9e2d1ab => {
5277 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5278 let mut req = fidl::new_empty!(
5279 ProjectIdInfoRequest,
5280 fidl::encoding::DefaultFuchsiaResourceDialect
5281 );
5282 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdInfoRequest>(&header, _body_bytes, handles, &mut req)?;
5283 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5284 Ok(ProjectIdRequest::Info {
5285 project_id: req.project_id,
5286
5287 responder: ProjectIdInfoResponder {
5288 control_handle: std::mem::ManuallyDrop::new(control_handle),
5289 tx_id: header.tx_id,
5290 },
5291 })
5292 }
5293 _ => Err(fidl::Error::UnknownOrdinal {
5294 ordinal: header.ordinal,
5295 protocol_name:
5296 <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5297 }),
5298 }))
5299 },
5300 )
5301 }
5302}
5303
5304#[derive(Debug)]
5305pub enum ProjectIdRequest {
5306 SetLimit { project_id: u64, bytes: u64, nodes: u64, responder: ProjectIdSetLimitResponder },
5310 Clear { project_id: u64, responder: ProjectIdClearResponder },
5314 SetForNode { node_id: u64, project_id: u64, responder: ProjectIdSetForNodeResponder },
5317 GetForNode { node_id: u64, responder: ProjectIdGetForNodeResponder },
5321 ClearForNode { node_id: u64, responder: ProjectIdClearForNodeResponder },
5325 List { token: Option<Box<ProjectIterToken>>, responder: ProjectIdListResponder },
5330 Info { project_id: u64, responder: ProjectIdInfoResponder },
5333}
5334
5335impl ProjectIdRequest {
5336 #[allow(irrefutable_let_patterns)]
5337 pub fn into_set_limit(self) -> Option<(u64, u64, u64, ProjectIdSetLimitResponder)> {
5338 if let ProjectIdRequest::SetLimit { project_id, bytes, nodes, responder } = self {
5339 Some((project_id, bytes, nodes, responder))
5340 } else {
5341 None
5342 }
5343 }
5344
5345 #[allow(irrefutable_let_patterns)]
5346 pub fn into_clear(self) -> Option<(u64, ProjectIdClearResponder)> {
5347 if let ProjectIdRequest::Clear { project_id, responder } = self {
5348 Some((project_id, responder))
5349 } else {
5350 None
5351 }
5352 }
5353
5354 #[allow(irrefutable_let_patterns)]
5355 pub fn into_set_for_node(self) -> Option<(u64, u64, ProjectIdSetForNodeResponder)> {
5356 if let ProjectIdRequest::SetForNode { node_id, project_id, responder } = self {
5357 Some((node_id, project_id, responder))
5358 } else {
5359 None
5360 }
5361 }
5362
5363 #[allow(irrefutable_let_patterns)]
5364 pub fn into_get_for_node(self) -> Option<(u64, ProjectIdGetForNodeResponder)> {
5365 if let ProjectIdRequest::GetForNode { node_id, responder } = self {
5366 Some((node_id, responder))
5367 } else {
5368 None
5369 }
5370 }
5371
5372 #[allow(irrefutable_let_patterns)]
5373 pub fn into_clear_for_node(self) -> Option<(u64, ProjectIdClearForNodeResponder)> {
5374 if let ProjectIdRequest::ClearForNode { node_id, responder } = self {
5375 Some((node_id, responder))
5376 } else {
5377 None
5378 }
5379 }
5380
5381 #[allow(irrefutable_let_patterns)]
5382 pub fn into_list(self) -> Option<(Option<Box<ProjectIterToken>>, ProjectIdListResponder)> {
5383 if let ProjectIdRequest::List { token, responder } = self {
5384 Some((token, responder))
5385 } else {
5386 None
5387 }
5388 }
5389
5390 #[allow(irrefutable_let_patterns)]
5391 pub fn into_info(self) -> Option<(u64, ProjectIdInfoResponder)> {
5392 if let ProjectIdRequest::Info { project_id, responder } = self {
5393 Some((project_id, responder))
5394 } else {
5395 None
5396 }
5397 }
5398
5399 pub fn method_name(&self) -> &'static str {
5401 match *self {
5402 ProjectIdRequest::SetLimit { .. } => "set_limit",
5403 ProjectIdRequest::Clear { .. } => "clear",
5404 ProjectIdRequest::SetForNode { .. } => "set_for_node",
5405 ProjectIdRequest::GetForNode { .. } => "get_for_node",
5406 ProjectIdRequest::ClearForNode { .. } => "clear_for_node",
5407 ProjectIdRequest::List { .. } => "list",
5408 ProjectIdRequest::Info { .. } => "info",
5409 }
5410 }
5411}
5412
5413#[derive(Debug, Clone)]
5414pub struct ProjectIdControlHandle {
5415 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5416}
5417
5418impl fidl::endpoints::ControlHandle for ProjectIdControlHandle {
5419 fn shutdown(&self) {
5420 self.inner.shutdown()
5421 }
5422 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5423 self.inner.shutdown_with_epitaph(status)
5424 }
5425
5426 fn is_closed(&self) -> bool {
5427 self.inner.channel().is_closed()
5428 }
5429 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5430 self.inner.channel().on_closed()
5431 }
5432
5433 #[cfg(target_os = "fuchsia")]
5434 fn signal_peer(
5435 &self,
5436 clear_mask: zx::Signals,
5437 set_mask: zx::Signals,
5438 ) -> Result<(), zx_status::Status> {
5439 use fidl::Peered;
5440 self.inner.channel().signal_peer(clear_mask, set_mask)
5441 }
5442}
5443
5444impl ProjectIdControlHandle {}
5445
5446#[must_use = "FIDL methods require a response to be sent"]
5447#[derive(Debug)]
5448pub struct ProjectIdSetLimitResponder {
5449 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5450 tx_id: u32,
5451}
5452
5453impl std::ops::Drop for ProjectIdSetLimitResponder {
5457 fn drop(&mut self) {
5458 self.control_handle.shutdown();
5459 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5461 }
5462}
5463
5464impl fidl::endpoints::Responder for ProjectIdSetLimitResponder {
5465 type ControlHandle = ProjectIdControlHandle;
5466
5467 fn control_handle(&self) -> &ProjectIdControlHandle {
5468 &self.control_handle
5469 }
5470
5471 fn drop_without_shutdown(mut self) {
5472 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5474 std::mem::forget(self);
5476 }
5477}
5478
5479impl ProjectIdSetLimitResponder {
5480 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5484 let _result = self.send_raw(result);
5485 if _result.is_err() {
5486 self.control_handle.shutdown();
5487 }
5488 self.drop_without_shutdown();
5489 _result
5490 }
5491
5492 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5494 let _result = self.send_raw(result);
5495 self.drop_without_shutdown();
5496 _result
5497 }
5498
5499 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5500 self.control_handle
5501 .inner
5502 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5503 result,
5504 self.tx_id,
5505 0x20b0fc1e0413876f,
5506 fidl::encoding::DynamicFlags::empty(),
5507 )
5508 }
5509}
5510
5511#[must_use = "FIDL methods require a response to be sent"]
5512#[derive(Debug)]
5513pub struct ProjectIdClearResponder {
5514 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5515 tx_id: u32,
5516}
5517
5518impl std::ops::Drop for ProjectIdClearResponder {
5522 fn drop(&mut self) {
5523 self.control_handle.shutdown();
5524 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5526 }
5527}
5528
5529impl fidl::endpoints::Responder for ProjectIdClearResponder {
5530 type ControlHandle = ProjectIdControlHandle;
5531
5532 fn control_handle(&self) -> &ProjectIdControlHandle {
5533 &self.control_handle
5534 }
5535
5536 fn drop_without_shutdown(mut self) {
5537 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5539 std::mem::forget(self);
5541 }
5542}
5543
5544impl ProjectIdClearResponder {
5545 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5549 let _result = self.send_raw(result);
5550 if _result.is_err() {
5551 self.control_handle.shutdown();
5552 }
5553 self.drop_without_shutdown();
5554 _result
5555 }
5556
5557 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5559 let _result = self.send_raw(result);
5560 self.drop_without_shutdown();
5561 _result
5562 }
5563
5564 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5565 self.control_handle
5566 .inner
5567 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5568 result,
5569 self.tx_id,
5570 0x165b5f1e707863c1,
5571 fidl::encoding::DynamicFlags::empty(),
5572 )
5573 }
5574}
5575
5576#[must_use = "FIDL methods require a response to be sent"]
5577#[derive(Debug)]
5578pub struct ProjectIdSetForNodeResponder {
5579 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5580 tx_id: u32,
5581}
5582
5583impl std::ops::Drop for ProjectIdSetForNodeResponder {
5587 fn drop(&mut self) {
5588 self.control_handle.shutdown();
5589 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5591 }
5592}
5593
5594impl fidl::endpoints::Responder for ProjectIdSetForNodeResponder {
5595 type ControlHandle = ProjectIdControlHandle;
5596
5597 fn control_handle(&self) -> &ProjectIdControlHandle {
5598 &self.control_handle
5599 }
5600
5601 fn drop_without_shutdown(mut self) {
5602 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5604 std::mem::forget(self);
5606 }
5607}
5608
5609impl ProjectIdSetForNodeResponder {
5610 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5614 let _result = self.send_raw(result);
5615 if _result.is_err() {
5616 self.control_handle.shutdown();
5617 }
5618 self.drop_without_shutdown();
5619 _result
5620 }
5621
5622 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5624 let _result = self.send_raw(result);
5625 self.drop_without_shutdown();
5626 _result
5627 }
5628
5629 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5630 self.control_handle
5631 .inner
5632 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5633 result,
5634 self.tx_id,
5635 0x4d7a8442dc58324c,
5636 fidl::encoding::DynamicFlags::empty(),
5637 )
5638 }
5639}
5640
5641#[must_use = "FIDL methods require a response to be sent"]
5642#[derive(Debug)]
5643pub struct ProjectIdGetForNodeResponder {
5644 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5645 tx_id: u32,
5646}
5647
5648impl std::ops::Drop for ProjectIdGetForNodeResponder {
5652 fn drop(&mut self) {
5653 self.control_handle.shutdown();
5654 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5656 }
5657}
5658
5659impl fidl::endpoints::Responder for ProjectIdGetForNodeResponder {
5660 type ControlHandle = ProjectIdControlHandle;
5661
5662 fn control_handle(&self) -> &ProjectIdControlHandle {
5663 &self.control_handle
5664 }
5665
5666 fn drop_without_shutdown(mut self) {
5667 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5669 std::mem::forget(self);
5671 }
5672}
5673
5674impl ProjectIdGetForNodeResponder {
5675 pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
5679 let _result = self.send_raw(result);
5680 if _result.is_err() {
5681 self.control_handle.shutdown();
5682 }
5683 self.drop_without_shutdown();
5684 _result
5685 }
5686
5687 pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
5689 let _result = self.send_raw(result);
5690 self.drop_without_shutdown();
5691 _result
5692 }
5693
5694 fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
5695 self.control_handle
5696 .inner
5697 .send::<fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>>(
5698 result.map(|project_id| (project_id,)),
5699 self.tx_id,
5700 0x644073bdf2542573,
5701 fidl::encoding::DynamicFlags::empty(),
5702 )
5703 }
5704}
5705
5706#[must_use = "FIDL methods require a response to be sent"]
5707#[derive(Debug)]
5708pub struct ProjectIdClearForNodeResponder {
5709 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5710 tx_id: u32,
5711}
5712
5713impl std::ops::Drop for ProjectIdClearForNodeResponder {
5717 fn drop(&mut self) {
5718 self.control_handle.shutdown();
5719 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5721 }
5722}
5723
5724impl fidl::endpoints::Responder for ProjectIdClearForNodeResponder {
5725 type ControlHandle = ProjectIdControlHandle;
5726
5727 fn control_handle(&self) -> &ProjectIdControlHandle {
5728 &self.control_handle
5729 }
5730
5731 fn drop_without_shutdown(mut self) {
5732 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5734 std::mem::forget(self);
5736 }
5737}
5738
5739impl ProjectIdClearForNodeResponder {
5740 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5744 let _result = self.send_raw(result);
5745 if _result.is_err() {
5746 self.control_handle.shutdown();
5747 }
5748 self.drop_without_shutdown();
5749 _result
5750 }
5751
5752 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5754 let _result = self.send_raw(result);
5755 self.drop_without_shutdown();
5756 _result
5757 }
5758
5759 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5760 self.control_handle
5761 .inner
5762 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5763 result,
5764 self.tx_id,
5765 0x3f2ca287bbfe6a62,
5766 fidl::encoding::DynamicFlags::empty(),
5767 )
5768 }
5769}
5770
5771#[must_use = "FIDL methods require a response to be sent"]
5772#[derive(Debug)]
5773pub struct ProjectIdListResponder {
5774 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5775 tx_id: u32,
5776}
5777
5778impl std::ops::Drop for ProjectIdListResponder {
5782 fn drop(&mut self) {
5783 self.control_handle.shutdown();
5784 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5786 }
5787}
5788
5789impl fidl::endpoints::Responder for ProjectIdListResponder {
5790 type ControlHandle = ProjectIdControlHandle;
5791
5792 fn control_handle(&self) -> &ProjectIdControlHandle {
5793 &self.control_handle
5794 }
5795
5796 fn drop_without_shutdown(mut self) {
5797 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5799 std::mem::forget(self);
5801 }
5802}
5803
5804impl ProjectIdListResponder {
5805 pub fn send(
5809 self,
5810 mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
5811 ) -> Result<(), fidl::Error> {
5812 let _result = self.send_raw(result);
5813 if _result.is_err() {
5814 self.control_handle.shutdown();
5815 }
5816 self.drop_without_shutdown();
5817 _result
5818 }
5819
5820 pub fn send_no_shutdown_on_err(
5822 self,
5823 mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
5824 ) -> Result<(), fidl::Error> {
5825 let _result = self.send_raw(result);
5826 self.drop_without_shutdown();
5827 _result
5828 }
5829
5830 fn send_raw(
5831 &self,
5832 mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
5833 ) -> Result<(), fidl::Error> {
5834 self.control_handle.inner.send::<fidl::encoding::ResultType<ProjectIdListResponse, i32>>(
5835 result,
5836 self.tx_id,
5837 0x5505f95a36d522cc,
5838 fidl::encoding::DynamicFlags::empty(),
5839 )
5840 }
5841}
5842
5843#[must_use = "FIDL methods require a response to be sent"]
5844#[derive(Debug)]
5845pub struct ProjectIdInfoResponder {
5846 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5847 tx_id: u32,
5848}
5849
5850impl std::ops::Drop for ProjectIdInfoResponder {
5854 fn drop(&mut self) {
5855 self.control_handle.shutdown();
5856 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5858 }
5859}
5860
5861impl fidl::endpoints::Responder for ProjectIdInfoResponder {
5862 type ControlHandle = ProjectIdControlHandle;
5863
5864 fn control_handle(&self) -> &ProjectIdControlHandle {
5865 &self.control_handle
5866 }
5867
5868 fn drop_without_shutdown(mut self) {
5869 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5871 std::mem::forget(self);
5873 }
5874}
5875
5876impl ProjectIdInfoResponder {
5877 pub fn send(
5881 self,
5882 mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
5883 ) -> Result<(), fidl::Error> {
5884 let _result = self.send_raw(result);
5885 if _result.is_err() {
5886 self.control_handle.shutdown();
5887 }
5888 self.drop_without_shutdown();
5889 _result
5890 }
5891
5892 pub fn send_no_shutdown_on_err(
5894 self,
5895 mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
5896 ) -> Result<(), fidl::Error> {
5897 let _result = self.send_raw(result);
5898 self.drop_without_shutdown();
5899 _result
5900 }
5901
5902 fn send_raw(
5903 &self,
5904 mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
5905 ) -> Result<(), fidl::Error> {
5906 self.control_handle.inner.send::<fidl::encoding::ResultType<ProjectIdInfoResponse, i32>>(
5907 result,
5908 self.tx_id,
5909 0x51b47743c9e2d1ab,
5910 fidl::encoding::DynamicFlags::empty(),
5911 )
5912 }
5913}
5914
5915#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5916pub struct VolumeInstallerMarker;
5917
5918impl fidl::endpoints::ProtocolMarker for VolumeInstallerMarker {
5919 type Proxy = VolumeInstallerProxy;
5920 type RequestStream = VolumeInstallerRequestStream;
5921 #[cfg(target_os = "fuchsia")]
5922 type SynchronousProxy = VolumeInstallerSynchronousProxy;
5923
5924 const DEBUG_NAME: &'static str = "fuchsia.fxfs.VolumeInstaller";
5925}
5926impl fidl::endpoints::DiscoverableProtocolMarker for VolumeInstallerMarker {}
5927pub type VolumeInstallerInstallResult = Result<(), i32>;
5928
5929pub trait VolumeInstallerProxyInterface: Send + Sync {
5930 type InstallResponseFut: std::future::Future<Output = Result<VolumeInstallerInstallResult, fidl::Error>>
5931 + Send;
5932 fn r#install(&self, src: &str, image_file: &str, dst: &str) -> Self::InstallResponseFut;
5933}
5934#[derive(Debug)]
5935#[cfg(target_os = "fuchsia")]
5936pub struct VolumeInstallerSynchronousProxy {
5937 client: fidl::client::sync::Client,
5938}
5939
5940#[cfg(target_os = "fuchsia")]
5941impl fidl::endpoints::SynchronousProxy for VolumeInstallerSynchronousProxy {
5942 type Proxy = VolumeInstallerProxy;
5943 type Protocol = VolumeInstallerMarker;
5944
5945 fn from_channel(inner: fidl::Channel) -> Self {
5946 Self::new(inner)
5947 }
5948
5949 fn into_channel(self) -> fidl::Channel {
5950 self.client.into_channel()
5951 }
5952
5953 fn as_channel(&self) -> &fidl::Channel {
5954 self.client.as_channel()
5955 }
5956}
5957
5958#[cfg(target_os = "fuchsia")]
5959impl VolumeInstallerSynchronousProxy {
5960 pub fn new(channel: fidl::Channel) -> Self {
5961 let protocol_name = <VolumeInstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5962 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5963 }
5964
5965 pub fn into_channel(self) -> fidl::Channel {
5966 self.client.into_channel()
5967 }
5968
5969 pub fn wait_for_event(
5972 &self,
5973 deadline: zx::MonotonicInstant,
5974 ) -> Result<VolumeInstallerEvent, fidl::Error> {
5975 VolumeInstallerEvent::decode(self.client.wait_for_event(deadline)?)
5976 }
5977
5978 pub fn r#install(
5985 &self,
5986 mut src: &str,
5987 mut image_file: &str,
5988 mut dst: &str,
5989 ___deadline: zx::MonotonicInstant,
5990 ) -> Result<VolumeInstallerInstallResult, fidl::Error> {
5991 let _response = self.client.send_query::<
5992 VolumeInstallerInstallRequest,
5993 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5994 >(
5995 (src, image_file, dst,),
5996 0x4c340be8a504ee1c,
5997 fidl::encoding::DynamicFlags::empty(),
5998 ___deadline,
5999 )?;
6000 Ok(_response.map(|x| x))
6001 }
6002}
6003
6004#[cfg(target_os = "fuchsia")]
6005impl From<VolumeInstallerSynchronousProxy> for zx::Handle {
6006 fn from(value: VolumeInstallerSynchronousProxy) -> Self {
6007 value.into_channel().into()
6008 }
6009}
6010
6011#[cfg(target_os = "fuchsia")]
6012impl From<fidl::Channel> for VolumeInstallerSynchronousProxy {
6013 fn from(value: fidl::Channel) -> Self {
6014 Self::new(value)
6015 }
6016}
6017
6018#[cfg(target_os = "fuchsia")]
6019impl fidl::endpoints::FromClient for VolumeInstallerSynchronousProxy {
6020 type Protocol = VolumeInstallerMarker;
6021
6022 fn from_client(value: fidl::endpoints::ClientEnd<VolumeInstallerMarker>) -> Self {
6023 Self::new(value.into_channel())
6024 }
6025}
6026
6027#[derive(Debug, Clone)]
6028pub struct VolumeInstallerProxy {
6029 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6030}
6031
6032impl fidl::endpoints::Proxy for VolumeInstallerProxy {
6033 type Protocol = VolumeInstallerMarker;
6034
6035 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6036 Self::new(inner)
6037 }
6038
6039 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6040 self.client.into_channel().map_err(|client| Self { client })
6041 }
6042
6043 fn as_channel(&self) -> &::fidl::AsyncChannel {
6044 self.client.as_channel()
6045 }
6046}
6047
6048impl VolumeInstallerProxy {
6049 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6051 let protocol_name = <VolumeInstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6052 Self { client: fidl::client::Client::new(channel, protocol_name) }
6053 }
6054
6055 pub fn take_event_stream(&self) -> VolumeInstallerEventStream {
6061 VolumeInstallerEventStream { event_receiver: self.client.take_event_receiver() }
6062 }
6063
6064 pub fn r#install(
6071 &self,
6072 mut src: &str,
6073 mut image_file: &str,
6074 mut dst: &str,
6075 ) -> fidl::client::QueryResponseFut<
6076 VolumeInstallerInstallResult,
6077 fidl::encoding::DefaultFuchsiaResourceDialect,
6078 > {
6079 VolumeInstallerProxyInterface::r#install(self, src, image_file, dst)
6080 }
6081}
6082
6083impl VolumeInstallerProxyInterface for VolumeInstallerProxy {
6084 type InstallResponseFut = fidl::client::QueryResponseFut<
6085 VolumeInstallerInstallResult,
6086 fidl::encoding::DefaultFuchsiaResourceDialect,
6087 >;
6088 fn r#install(
6089 &self,
6090 mut src: &str,
6091 mut image_file: &str,
6092 mut dst: &str,
6093 ) -> Self::InstallResponseFut {
6094 fn _decode(
6095 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6096 ) -> Result<VolumeInstallerInstallResult, fidl::Error> {
6097 let _response = fidl::client::decode_transaction_body::<
6098 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6099 fidl::encoding::DefaultFuchsiaResourceDialect,
6100 0x4c340be8a504ee1c,
6101 >(_buf?)?;
6102 Ok(_response.map(|x| x))
6103 }
6104 self.client
6105 .send_query_and_decode::<VolumeInstallerInstallRequest, VolumeInstallerInstallResult>(
6106 (src, image_file, dst),
6107 0x4c340be8a504ee1c,
6108 fidl::encoding::DynamicFlags::empty(),
6109 _decode,
6110 )
6111 }
6112}
6113
6114pub struct VolumeInstallerEventStream {
6115 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6116}
6117
6118impl std::marker::Unpin for VolumeInstallerEventStream {}
6119
6120impl futures::stream::FusedStream for VolumeInstallerEventStream {
6121 fn is_terminated(&self) -> bool {
6122 self.event_receiver.is_terminated()
6123 }
6124}
6125
6126impl futures::Stream for VolumeInstallerEventStream {
6127 type Item = Result<VolumeInstallerEvent, fidl::Error>;
6128
6129 fn poll_next(
6130 mut self: std::pin::Pin<&mut Self>,
6131 cx: &mut std::task::Context<'_>,
6132 ) -> std::task::Poll<Option<Self::Item>> {
6133 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6134 &mut self.event_receiver,
6135 cx
6136 )?) {
6137 Some(buf) => std::task::Poll::Ready(Some(VolumeInstallerEvent::decode(buf))),
6138 None => std::task::Poll::Ready(None),
6139 }
6140 }
6141}
6142
6143#[derive(Debug)]
6144pub enum VolumeInstallerEvent {}
6145
6146impl VolumeInstallerEvent {
6147 fn decode(
6149 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6150 ) -> Result<VolumeInstallerEvent, fidl::Error> {
6151 let (bytes, _handles) = buf.split_mut();
6152 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6153 debug_assert_eq!(tx_header.tx_id, 0);
6154 match tx_header.ordinal {
6155 _ => Err(fidl::Error::UnknownOrdinal {
6156 ordinal: tx_header.ordinal,
6157 protocol_name:
6158 <VolumeInstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6159 }),
6160 }
6161 }
6162}
6163
6164pub struct VolumeInstallerRequestStream {
6166 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6167 is_terminated: bool,
6168}
6169
6170impl std::marker::Unpin for VolumeInstallerRequestStream {}
6171
6172impl futures::stream::FusedStream for VolumeInstallerRequestStream {
6173 fn is_terminated(&self) -> bool {
6174 self.is_terminated
6175 }
6176}
6177
6178impl fidl::endpoints::RequestStream for VolumeInstallerRequestStream {
6179 type Protocol = VolumeInstallerMarker;
6180 type ControlHandle = VolumeInstallerControlHandle;
6181
6182 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6183 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6184 }
6185
6186 fn control_handle(&self) -> Self::ControlHandle {
6187 VolumeInstallerControlHandle { inner: self.inner.clone() }
6188 }
6189
6190 fn into_inner(
6191 self,
6192 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6193 {
6194 (self.inner, self.is_terminated)
6195 }
6196
6197 fn from_inner(
6198 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6199 is_terminated: bool,
6200 ) -> Self {
6201 Self { inner, is_terminated }
6202 }
6203}
6204
6205impl futures::Stream for VolumeInstallerRequestStream {
6206 type Item = Result<VolumeInstallerRequest, fidl::Error>;
6207
6208 fn poll_next(
6209 mut self: std::pin::Pin<&mut Self>,
6210 cx: &mut std::task::Context<'_>,
6211 ) -> std::task::Poll<Option<Self::Item>> {
6212 let this = &mut *self;
6213 if this.inner.check_shutdown(cx) {
6214 this.is_terminated = true;
6215 return std::task::Poll::Ready(None);
6216 }
6217 if this.is_terminated {
6218 panic!("polled VolumeInstallerRequestStream after completion");
6219 }
6220 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6221 |bytes, handles| {
6222 match this.inner.channel().read_etc(cx, bytes, handles) {
6223 std::task::Poll::Ready(Ok(())) => {}
6224 std::task::Poll::Pending => return std::task::Poll::Pending,
6225 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6226 this.is_terminated = true;
6227 return std::task::Poll::Ready(None);
6228 }
6229 std::task::Poll::Ready(Err(e)) => {
6230 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6231 e.into(),
6232 ))));
6233 }
6234 }
6235
6236 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6238
6239 std::task::Poll::Ready(Some(match header.ordinal {
6240 0x4c340be8a504ee1c => {
6241 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6242 let mut req = fidl::new_empty!(
6243 VolumeInstallerInstallRequest,
6244 fidl::encoding::DefaultFuchsiaResourceDialect
6245 );
6246 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeInstallerInstallRequest>(&header, _body_bytes, handles, &mut req)?;
6247 let control_handle =
6248 VolumeInstallerControlHandle { inner: this.inner.clone() };
6249 Ok(VolumeInstallerRequest::Install {
6250 src: req.src,
6251 image_file: req.image_file,
6252 dst: req.dst,
6253
6254 responder: VolumeInstallerInstallResponder {
6255 control_handle: std::mem::ManuallyDrop::new(control_handle),
6256 tx_id: header.tx_id,
6257 },
6258 })
6259 }
6260 _ => Err(fidl::Error::UnknownOrdinal {
6261 ordinal: header.ordinal,
6262 protocol_name:
6263 <VolumeInstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6264 }),
6265 }))
6266 },
6267 )
6268 }
6269}
6270
6271#[derive(Debug)]
6273pub enum VolumeInstallerRequest {
6274 Install {
6281 src: String,
6282 image_file: String,
6283 dst: String,
6284 responder: VolumeInstallerInstallResponder,
6285 },
6286}
6287
6288impl VolumeInstallerRequest {
6289 #[allow(irrefutable_let_patterns)]
6290 pub fn into_install(self) -> Option<(String, String, String, VolumeInstallerInstallResponder)> {
6291 if let VolumeInstallerRequest::Install { src, image_file, dst, responder } = self {
6292 Some((src, image_file, dst, responder))
6293 } else {
6294 None
6295 }
6296 }
6297
6298 pub fn method_name(&self) -> &'static str {
6300 match *self {
6301 VolumeInstallerRequest::Install { .. } => "install",
6302 }
6303 }
6304}
6305
6306#[derive(Debug, Clone)]
6307pub struct VolumeInstallerControlHandle {
6308 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6309}
6310
6311impl fidl::endpoints::ControlHandle for VolumeInstallerControlHandle {
6312 fn shutdown(&self) {
6313 self.inner.shutdown()
6314 }
6315 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6316 self.inner.shutdown_with_epitaph(status)
6317 }
6318
6319 fn is_closed(&self) -> bool {
6320 self.inner.channel().is_closed()
6321 }
6322 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6323 self.inner.channel().on_closed()
6324 }
6325
6326 #[cfg(target_os = "fuchsia")]
6327 fn signal_peer(
6328 &self,
6329 clear_mask: zx::Signals,
6330 set_mask: zx::Signals,
6331 ) -> Result<(), zx_status::Status> {
6332 use fidl::Peered;
6333 self.inner.channel().signal_peer(clear_mask, set_mask)
6334 }
6335}
6336
6337impl VolumeInstallerControlHandle {}
6338
6339#[must_use = "FIDL methods require a response to be sent"]
6340#[derive(Debug)]
6341pub struct VolumeInstallerInstallResponder {
6342 control_handle: std::mem::ManuallyDrop<VolumeInstallerControlHandle>,
6343 tx_id: u32,
6344}
6345
6346impl std::ops::Drop for VolumeInstallerInstallResponder {
6350 fn drop(&mut self) {
6351 self.control_handle.shutdown();
6352 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6354 }
6355}
6356
6357impl fidl::endpoints::Responder for VolumeInstallerInstallResponder {
6358 type ControlHandle = VolumeInstallerControlHandle;
6359
6360 fn control_handle(&self) -> &VolumeInstallerControlHandle {
6361 &self.control_handle
6362 }
6363
6364 fn drop_without_shutdown(mut self) {
6365 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6367 std::mem::forget(self);
6369 }
6370}
6371
6372impl VolumeInstallerInstallResponder {
6373 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6377 let _result = self.send_raw(result);
6378 if _result.is_err() {
6379 self.control_handle.shutdown();
6380 }
6381 self.drop_without_shutdown();
6382 _result
6383 }
6384
6385 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6387 let _result = self.send_raw(result);
6388 self.drop_without_shutdown();
6389 _result
6390 }
6391
6392 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6393 self.control_handle
6394 .inner
6395 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6396 result,
6397 self.tx_id,
6398 0x4c340be8a504ee1c,
6399 fidl::encoding::DynamicFlags::empty(),
6400 )
6401 }
6402}
6403
6404mod internal {
6405 use super::*;
6406
6407 impl fidl::encoding::ResourceTypeMarker for BlobCreatorCreateResponse {
6408 type Borrowed<'a> = &'a mut Self;
6409 fn take_or_borrow<'a>(
6410 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6411 ) -> Self::Borrowed<'a> {
6412 value
6413 }
6414 }
6415
6416 unsafe impl fidl::encoding::TypeMarker for BlobCreatorCreateResponse {
6417 type Owned = Self;
6418
6419 #[inline(always)]
6420 fn inline_align(_context: fidl::encoding::Context) -> usize {
6421 4
6422 }
6423
6424 #[inline(always)]
6425 fn inline_size(_context: fidl::encoding::Context) -> usize {
6426 4
6427 }
6428 }
6429
6430 unsafe impl
6431 fidl::encoding::Encode<
6432 BlobCreatorCreateResponse,
6433 fidl::encoding::DefaultFuchsiaResourceDialect,
6434 > for &mut BlobCreatorCreateResponse
6435 {
6436 #[inline]
6437 unsafe fn encode(
6438 self,
6439 encoder: &mut fidl::encoding::Encoder<
6440 '_,
6441 fidl::encoding::DefaultFuchsiaResourceDialect,
6442 >,
6443 offset: usize,
6444 _depth: fidl::encoding::Depth,
6445 ) -> fidl::Result<()> {
6446 encoder.debug_check_bounds::<BlobCreatorCreateResponse>(offset);
6447 fidl::encoding::Encode::<BlobCreatorCreateResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
6449 (
6450 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
6451 ),
6452 encoder, offset, _depth
6453 )
6454 }
6455 }
6456 unsafe impl<
6457 T0: fidl::encoding::Encode<
6458 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
6459 fidl::encoding::DefaultFuchsiaResourceDialect,
6460 >,
6461 >
6462 fidl::encoding::Encode<
6463 BlobCreatorCreateResponse,
6464 fidl::encoding::DefaultFuchsiaResourceDialect,
6465 > for (T0,)
6466 {
6467 #[inline]
6468 unsafe fn encode(
6469 self,
6470 encoder: &mut fidl::encoding::Encoder<
6471 '_,
6472 fidl::encoding::DefaultFuchsiaResourceDialect,
6473 >,
6474 offset: usize,
6475 depth: fidl::encoding::Depth,
6476 ) -> fidl::Result<()> {
6477 encoder.debug_check_bounds::<BlobCreatorCreateResponse>(offset);
6478 self.0.encode(encoder, offset + 0, depth)?;
6482 Ok(())
6483 }
6484 }
6485
6486 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6487 for BlobCreatorCreateResponse
6488 {
6489 #[inline(always)]
6490 fn new_empty() -> Self {
6491 Self {
6492 writer: fidl::new_empty!(
6493 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
6494 fidl::encoding::DefaultFuchsiaResourceDialect
6495 ),
6496 }
6497 }
6498
6499 #[inline]
6500 unsafe fn decode(
6501 &mut self,
6502 decoder: &mut fidl::encoding::Decoder<
6503 '_,
6504 fidl::encoding::DefaultFuchsiaResourceDialect,
6505 >,
6506 offset: usize,
6507 _depth: fidl::encoding::Depth,
6508 ) -> fidl::Result<()> {
6509 decoder.debug_check_bounds::<Self>(offset);
6510 fidl::decode!(
6512 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
6513 fidl::encoding::DefaultFuchsiaResourceDialect,
6514 &mut self.writer,
6515 decoder,
6516 offset + 0,
6517 _depth
6518 )?;
6519 Ok(())
6520 }
6521 }
6522
6523 impl fidl::encoding::ResourceTypeMarker for BlobReaderGetVmoResponse {
6524 type Borrowed<'a> = &'a mut Self;
6525 fn take_or_borrow<'a>(
6526 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6527 ) -> Self::Borrowed<'a> {
6528 value
6529 }
6530 }
6531
6532 unsafe impl fidl::encoding::TypeMarker for BlobReaderGetVmoResponse {
6533 type Owned = Self;
6534
6535 #[inline(always)]
6536 fn inline_align(_context: fidl::encoding::Context) -> usize {
6537 4
6538 }
6539
6540 #[inline(always)]
6541 fn inline_size(_context: fidl::encoding::Context) -> usize {
6542 4
6543 }
6544 }
6545
6546 unsafe impl
6547 fidl::encoding::Encode<
6548 BlobReaderGetVmoResponse,
6549 fidl::encoding::DefaultFuchsiaResourceDialect,
6550 > for &mut BlobReaderGetVmoResponse
6551 {
6552 #[inline]
6553 unsafe fn encode(
6554 self,
6555 encoder: &mut fidl::encoding::Encoder<
6556 '_,
6557 fidl::encoding::DefaultFuchsiaResourceDialect,
6558 >,
6559 offset: usize,
6560 _depth: fidl::encoding::Depth,
6561 ) -> fidl::Result<()> {
6562 encoder.debug_check_bounds::<BlobReaderGetVmoResponse>(offset);
6563 fidl::encoding::Encode::<
6565 BlobReaderGetVmoResponse,
6566 fidl::encoding::DefaultFuchsiaResourceDialect,
6567 >::encode(
6568 (<fidl::encoding::HandleType<
6569 fidl::Vmo,
6570 { fidl::ObjectType::VMO.into_raw() },
6571 2147483648,
6572 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6573 &mut self.vmo
6574 ),),
6575 encoder,
6576 offset,
6577 _depth,
6578 )
6579 }
6580 }
6581 unsafe impl<
6582 T0: fidl::encoding::Encode<
6583 fidl::encoding::HandleType<
6584 fidl::Vmo,
6585 { fidl::ObjectType::VMO.into_raw() },
6586 2147483648,
6587 >,
6588 fidl::encoding::DefaultFuchsiaResourceDialect,
6589 >,
6590 >
6591 fidl::encoding::Encode<
6592 BlobReaderGetVmoResponse,
6593 fidl::encoding::DefaultFuchsiaResourceDialect,
6594 > for (T0,)
6595 {
6596 #[inline]
6597 unsafe fn encode(
6598 self,
6599 encoder: &mut fidl::encoding::Encoder<
6600 '_,
6601 fidl::encoding::DefaultFuchsiaResourceDialect,
6602 >,
6603 offset: usize,
6604 depth: fidl::encoding::Depth,
6605 ) -> fidl::Result<()> {
6606 encoder.debug_check_bounds::<BlobReaderGetVmoResponse>(offset);
6607 self.0.encode(encoder, offset + 0, depth)?;
6611 Ok(())
6612 }
6613 }
6614
6615 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6616 for BlobReaderGetVmoResponse
6617 {
6618 #[inline(always)]
6619 fn new_empty() -> Self {
6620 Self {
6621 vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6622 }
6623 }
6624
6625 #[inline]
6626 unsafe fn decode(
6627 &mut self,
6628 decoder: &mut fidl::encoding::Decoder<
6629 '_,
6630 fidl::encoding::DefaultFuchsiaResourceDialect,
6631 >,
6632 offset: usize,
6633 _depth: fidl::encoding::Depth,
6634 ) -> fidl::Result<()> {
6635 decoder.debug_check_bounds::<Self>(offset);
6636 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
6638 Ok(())
6639 }
6640 }
6641
6642 impl fidl::encoding::ResourceTypeMarker for BlobWriterGetVmoResponse {
6643 type Borrowed<'a> = &'a mut Self;
6644 fn take_or_borrow<'a>(
6645 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6646 ) -> Self::Borrowed<'a> {
6647 value
6648 }
6649 }
6650
6651 unsafe impl fidl::encoding::TypeMarker for BlobWriterGetVmoResponse {
6652 type Owned = Self;
6653
6654 #[inline(always)]
6655 fn inline_align(_context: fidl::encoding::Context) -> usize {
6656 4
6657 }
6658
6659 #[inline(always)]
6660 fn inline_size(_context: fidl::encoding::Context) -> usize {
6661 4
6662 }
6663 }
6664
6665 unsafe impl
6666 fidl::encoding::Encode<
6667 BlobWriterGetVmoResponse,
6668 fidl::encoding::DefaultFuchsiaResourceDialect,
6669 > for &mut BlobWriterGetVmoResponse
6670 {
6671 #[inline]
6672 unsafe fn encode(
6673 self,
6674 encoder: &mut fidl::encoding::Encoder<
6675 '_,
6676 fidl::encoding::DefaultFuchsiaResourceDialect,
6677 >,
6678 offset: usize,
6679 _depth: fidl::encoding::Depth,
6680 ) -> fidl::Result<()> {
6681 encoder.debug_check_bounds::<BlobWriterGetVmoResponse>(offset);
6682 fidl::encoding::Encode::<
6684 BlobWriterGetVmoResponse,
6685 fidl::encoding::DefaultFuchsiaResourceDialect,
6686 >::encode(
6687 (<fidl::encoding::HandleType<
6688 fidl::Vmo,
6689 { fidl::ObjectType::VMO.into_raw() },
6690 2147483648,
6691 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6692 &mut self.vmo
6693 ),),
6694 encoder,
6695 offset,
6696 _depth,
6697 )
6698 }
6699 }
6700 unsafe impl<
6701 T0: fidl::encoding::Encode<
6702 fidl::encoding::HandleType<
6703 fidl::Vmo,
6704 { fidl::ObjectType::VMO.into_raw() },
6705 2147483648,
6706 >,
6707 fidl::encoding::DefaultFuchsiaResourceDialect,
6708 >,
6709 >
6710 fidl::encoding::Encode<
6711 BlobWriterGetVmoResponse,
6712 fidl::encoding::DefaultFuchsiaResourceDialect,
6713 > for (T0,)
6714 {
6715 #[inline]
6716 unsafe fn encode(
6717 self,
6718 encoder: &mut fidl::encoding::Encoder<
6719 '_,
6720 fidl::encoding::DefaultFuchsiaResourceDialect,
6721 >,
6722 offset: usize,
6723 depth: fidl::encoding::Depth,
6724 ) -> fidl::Result<()> {
6725 encoder.debug_check_bounds::<BlobWriterGetVmoResponse>(offset);
6726 self.0.encode(encoder, offset + 0, depth)?;
6730 Ok(())
6731 }
6732 }
6733
6734 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6735 for BlobWriterGetVmoResponse
6736 {
6737 #[inline(always)]
6738 fn new_empty() -> Self {
6739 Self {
6740 vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6741 }
6742 }
6743
6744 #[inline]
6745 unsafe fn decode(
6746 &mut self,
6747 decoder: &mut fidl::encoding::Decoder<
6748 '_,
6749 fidl::encoding::DefaultFuchsiaResourceDialect,
6750 >,
6751 offset: usize,
6752 _depth: fidl::encoding::Depth,
6753 ) -> fidl::Result<()> {
6754 decoder.debug_check_bounds::<Self>(offset);
6755 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
6757 Ok(())
6758 }
6759 }
6760
6761 impl fidl::encoding::ResourceTypeMarker for FileBackedVolumeProviderOpenRequest {
6762 type Borrowed<'a> = &'a mut Self;
6763 fn take_or_borrow<'a>(
6764 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6765 ) -> Self::Borrowed<'a> {
6766 value
6767 }
6768 }
6769
6770 unsafe impl fidl::encoding::TypeMarker for FileBackedVolumeProviderOpenRequest {
6771 type Owned = Self;
6772
6773 #[inline(always)]
6774 fn inline_align(_context: fidl::encoding::Context) -> usize {
6775 8
6776 }
6777
6778 #[inline(always)]
6779 fn inline_size(_context: fidl::encoding::Context) -> usize {
6780 32
6781 }
6782 }
6783
6784 unsafe impl
6785 fidl::encoding::Encode<
6786 FileBackedVolumeProviderOpenRequest,
6787 fidl::encoding::DefaultFuchsiaResourceDialect,
6788 > for &mut FileBackedVolumeProviderOpenRequest
6789 {
6790 #[inline]
6791 unsafe fn encode(
6792 self,
6793 encoder: &mut fidl::encoding::Encoder<
6794 '_,
6795 fidl::encoding::DefaultFuchsiaResourceDialect,
6796 >,
6797 offset: usize,
6798 _depth: fidl::encoding::Depth,
6799 ) -> fidl::Result<()> {
6800 encoder.debug_check_bounds::<FileBackedVolumeProviderOpenRequest>(offset);
6801 fidl::encoding::Encode::<
6803 FileBackedVolumeProviderOpenRequest,
6804 fidl::encoding::DefaultFuchsiaResourceDialect,
6805 >::encode(
6806 (
6807 <fidl::encoding::HandleType<
6808 fidl::Handle,
6809 { fidl::ObjectType::NONE.into_raw() },
6810 2147483648,
6811 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6812 &mut self.parent_directory_token,
6813 ),
6814 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
6815 &self.name,
6816 ),
6817 <fidl::encoding::Endpoint<
6818 fidl::endpoints::ServerEnd<
6819 fidl_fuchsia_hardware_block_volume::VolumeMarker,
6820 >,
6821 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6822 &mut self.server_end
6823 ),
6824 ),
6825 encoder,
6826 offset,
6827 _depth,
6828 )
6829 }
6830 }
6831 unsafe impl<
6832 T0: fidl::encoding::Encode<
6833 fidl::encoding::HandleType<
6834 fidl::Handle,
6835 { fidl::ObjectType::NONE.into_raw() },
6836 2147483648,
6837 >,
6838 fidl::encoding::DefaultFuchsiaResourceDialect,
6839 >,
6840 T1: fidl::encoding::Encode<
6841 fidl::encoding::BoundedString<255>,
6842 fidl::encoding::DefaultFuchsiaResourceDialect,
6843 >,
6844 T2: fidl::encoding::Encode<
6845 fidl::encoding::Endpoint<
6846 fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block_volume::VolumeMarker>,
6847 >,
6848 fidl::encoding::DefaultFuchsiaResourceDialect,
6849 >,
6850 >
6851 fidl::encoding::Encode<
6852 FileBackedVolumeProviderOpenRequest,
6853 fidl::encoding::DefaultFuchsiaResourceDialect,
6854 > for (T0, T1, T2)
6855 {
6856 #[inline]
6857 unsafe fn encode(
6858 self,
6859 encoder: &mut fidl::encoding::Encoder<
6860 '_,
6861 fidl::encoding::DefaultFuchsiaResourceDialect,
6862 >,
6863 offset: usize,
6864 depth: fidl::encoding::Depth,
6865 ) -> fidl::Result<()> {
6866 encoder.debug_check_bounds::<FileBackedVolumeProviderOpenRequest>(offset);
6867 unsafe {
6870 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6871 (ptr as *mut u64).write_unaligned(0);
6872 }
6873 unsafe {
6874 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
6875 (ptr as *mut u64).write_unaligned(0);
6876 }
6877 self.0.encode(encoder, offset + 0, depth)?;
6879 self.1.encode(encoder, offset + 8, depth)?;
6880 self.2.encode(encoder, offset + 24, depth)?;
6881 Ok(())
6882 }
6883 }
6884
6885 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6886 for FileBackedVolumeProviderOpenRequest
6887 {
6888 #[inline(always)]
6889 fn new_empty() -> Self {
6890 Self {
6891 parent_directory_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
6892 name: fidl::new_empty!(
6893 fidl::encoding::BoundedString<255>,
6894 fidl::encoding::DefaultFuchsiaResourceDialect
6895 ),
6896 server_end: fidl::new_empty!(
6897 fidl::encoding::Endpoint<
6898 fidl::endpoints::ServerEnd<
6899 fidl_fuchsia_hardware_block_volume::VolumeMarker,
6900 >,
6901 >,
6902 fidl::encoding::DefaultFuchsiaResourceDialect
6903 ),
6904 }
6905 }
6906
6907 #[inline]
6908 unsafe fn decode(
6909 &mut self,
6910 decoder: &mut fidl::encoding::Decoder<
6911 '_,
6912 fidl::encoding::DefaultFuchsiaResourceDialect,
6913 >,
6914 offset: usize,
6915 _depth: fidl::encoding::Depth,
6916 ) -> fidl::Result<()> {
6917 decoder.debug_check_bounds::<Self>(offset);
6918 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
6920 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6921 let mask = 0xffffffff00000000u64;
6922 let maskedval = padval & mask;
6923 if maskedval != 0 {
6924 return Err(fidl::Error::NonZeroPadding {
6925 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6926 });
6927 }
6928 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
6929 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6930 let mask = 0xffffffff00000000u64;
6931 let maskedval = padval & mask;
6932 if maskedval != 0 {
6933 return Err(fidl::Error::NonZeroPadding {
6934 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
6935 });
6936 }
6937 fidl::decode!(fidl::encoding::HandleType<fidl::Handle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.parent_directory_token, decoder, offset + 0, _depth)?;
6938 fidl::decode!(
6939 fidl::encoding::BoundedString<255>,
6940 fidl::encoding::DefaultFuchsiaResourceDialect,
6941 &mut self.name,
6942 decoder,
6943 offset + 8,
6944 _depth
6945 )?;
6946 fidl::decode!(
6947 fidl::encoding::Endpoint<
6948 fidl::endpoints::ServerEnd<fidl_fuchsia_hardware_block_volume::VolumeMarker>,
6949 >,
6950 fidl::encoding::DefaultFuchsiaResourceDialect,
6951 &mut self.server_end,
6952 decoder,
6953 offset + 24,
6954 _depth
6955 )?;
6956 Ok(())
6957 }
6958 }
6959}