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