1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_fxfs_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct BlobCreatorCreateResponse {
16 pub writer: fidl::endpoints::ClientEnd<BlobWriterMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobCreatorCreateResponse {}
20
21#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct BlobReaderGetVmoResponse {
23 pub vmo: fidl::Vmo,
24}
25
26impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobReaderGetVmoResponse {}
27
28#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29pub struct BlobWriterGetVmoResponse {
30 pub vmo: fidl::Vmo,
31}
32
33impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for BlobWriterGetVmoResponse {}
34
35#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
36pub struct BlobCreatorMarker;
37
38impl fidl::endpoints::ProtocolMarker for BlobCreatorMarker {
39 type Proxy = BlobCreatorProxy;
40 type RequestStream = BlobCreatorRequestStream;
41 #[cfg(target_os = "fuchsia")]
42 type SynchronousProxy = BlobCreatorSynchronousProxy;
43
44 const DEBUG_NAME: &'static str = "fuchsia.fxfs.BlobCreator";
45}
46impl fidl::endpoints::DiscoverableProtocolMarker for BlobCreatorMarker {}
47pub type BlobCreatorCreateResult =
48 Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>;
49
50pub trait BlobCreatorProxyInterface: Send + Sync {
51 type CreateResponseFut: std::future::Future<Output = Result<BlobCreatorCreateResult, fidl::Error>>
52 + Send;
53 fn r#create(&self, hash: &[u8; 32], allow_existing: bool) -> Self::CreateResponseFut;
54}
55#[derive(Debug)]
56#[cfg(target_os = "fuchsia")]
57pub struct BlobCreatorSynchronousProxy {
58 client: fidl::client::sync::Client,
59}
60
61#[cfg(target_os = "fuchsia")]
62impl fidl::endpoints::SynchronousProxy for BlobCreatorSynchronousProxy {
63 type Proxy = BlobCreatorProxy;
64 type Protocol = BlobCreatorMarker;
65
66 fn from_channel(inner: fidl::Channel) -> Self {
67 Self::new(inner)
68 }
69
70 fn into_channel(self) -> fidl::Channel {
71 self.client.into_channel()
72 }
73
74 fn as_channel(&self) -> &fidl::Channel {
75 self.client.as_channel()
76 }
77}
78
79#[cfg(target_os = "fuchsia")]
80impl BlobCreatorSynchronousProxy {
81 pub fn new(channel: fidl::Channel) -> Self {
82 let protocol_name = <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
83 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
84 }
85
86 pub fn into_channel(self) -> fidl::Channel {
87 self.client.into_channel()
88 }
89
90 pub fn wait_for_event(
93 &self,
94 deadline: zx::MonotonicInstant,
95 ) -> Result<BlobCreatorEvent, fidl::Error> {
96 BlobCreatorEvent::decode(self.client.wait_for_event(deadline)?)
97 }
98
99 pub fn r#create(
105 &self,
106 mut hash: &[u8; 32],
107 mut allow_existing: bool,
108 ___deadline: zx::MonotonicInstant,
109 ) -> Result<BlobCreatorCreateResult, fidl::Error> {
110 let _response = self.client.send_query::<
111 BlobCreatorCreateRequest,
112 fidl::encoding::ResultType<BlobCreatorCreateResponse, CreateBlobError>,
113 >(
114 (hash, allow_existing,),
115 0x4288fe720cca70d7,
116 fidl::encoding::DynamicFlags::empty(),
117 ___deadline,
118 )?;
119 Ok(_response.map(|x| x.writer))
120 }
121}
122
123#[derive(Debug, Clone)]
124pub struct BlobCreatorProxy {
125 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
126}
127
128impl fidl::endpoints::Proxy for BlobCreatorProxy {
129 type Protocol = BlobCreatorMarker;
130
131 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
132 Self::new(inner)
133 }
134
135 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
136 self.client.into_channel().map_err(|client| Self { client })
137 }
138
139 fn as_channel(&self) -> &::fidl::AsyncChannel {
140 self.client.as_channel()
141 }
142}
143
144impl BlobCreatorProxy {
145 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
147 let protocol_name = <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
148 Self { client: fidl::client::Client::new(channel, protocol_name) }
149 }
150
151 pub fn take_event_stream(&self) -> BlobCreatorEventStream {
157 BlobCreatorEventStream { event_receiver: self.client.take_event_receiver() }
158 }
159
160 pub fn r#create(
166 &self,
167 mut hash: &[u8; 32],
168 mut allow_existing: bool,
169 ) -> fidl::client::QueryResponseFut<
170 BlobCreatorCreateResult,
171 fidl::encoding::DefaultFuchsiaResourceDialect,
172 > {
173 BlobCreatorProxyInterface::r#create(self, hash, allow_existing)
174 }
175}
176
177impl BlobCreatorProxyInterface for BlobCreatorProxy {
178 type CreateResponseFut = fidl::client::QueryResponseFut<
179 BlobCreatorCreateResult,
180 fidl::encoding::DefaultFuchsiaResourceDialect,
181 >;
182 fn r#create(&self, mut hash: &[u8; 32], mut allow_existing: bool) -> Self::CreateResponseFut {
183 fn _decode(
184 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
185 ) -> Result<BlobCreatorCreateResult, fidl::Error> {
186 let _response = fidl::client::decode_transaction_body::<
187 fidl::encoding::ResultType<BlobCreatorCreateResponse, CreateBlobError>,
188 fidl::encoding::DefaultFuchsiaResourceDialect,
189 0x4288fe720cca70d7,
190 >(_buf?)?;
191 Ok(_response.map(|x| x.writer))
192 }
193 self.client.send_query_and_decode::<BlobCreatorCreateRequest, BlobCreatorCreateResult>(
194 (hash, allow_existing),
195 0x4288fe720cca70d7,
196 fidl::encoding::DynamicFlags::empty(),
197 _decode,
198 )
199 }
200}
201
202pub struct BlobCreatorEventStream {
203 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
204}
205
206impl std::marker::Unpin for BlobCreatorEventStream {}
207
208impl futures::stream::FusedStream for BlobCreatorEventStream {
209 fn is_terminated(&self) -> bool {
210 self.event_receiver.is_terminated()
211 }
212}
213
214impl futures::Stream for BlobCreatorEventStream {
215 type Item = Result<BlobCreatorEvent, fidl::Error>;
216
217 fn poll_next(
218 mut self: std::pin::Pin<&mut Self>,
219 cx: &mut std::task::Context<'_>,
220 ) -> std::task::Poll<Option<Self::Item>> {
221 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
222 &mut self.event_receiver,
223 cx
224 )?) {
225 Some(buf) => std::task::Poll::Ready(Some(BlobCreatorEvent::decode(buf))),
226 None => std::task::Poll::Ready(None),
227 }
228 }
229}
230
231#[derive(Debug)]
232pub enum BlobCreatorEvent {}
233
234impl BlobCreatorEvent {
235 fn decode(
237 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
238 ) -> Result<BlobCreatorEvent, fidl::Error> {
239 let (bytes, _handles) = buf.split_mut();
240 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
241 debug_assert_eq!(tx_header.tx_id, 0);
242 match tx_header.ordinal {
243 _ => Err(fidl::Error::UnknownOrdinal {
244 ordinal: tx_header.ordinal,
245 protocol_name: <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
246 }),
247 }
248 }
249}
250
251pub struct BlobCreatorRequestStream {
253 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
254 is_terminated: bool,
255}
256
257impl std::marker::Unpin for BlobCreatorRequestStream {}
258
259impl futures::stream::FusedStream for BlobCreatorRequestStream {
260 fn is_terminated(&self) -> bool {
261 self.is_terminated
262 }
263}
264
265impl fidl::endpoints::RequestStream for BlobCreatorRequestStream {
266 type Protocol = BlobCreatorMarker;
267 type ControlHandle = BlobCreatorControlHandle;
268
269 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
270 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
271 }
272
273 fn control_handle(&self) -> Self::ControlHandle {
274 BlobCreatorControlHandle { inner: self.inner.clone() }
275 }
276
277 fn into_inner(
278 self,
279 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
280 {
281 (self.inner, self.is_terminated)
282 }
283
284 fn from_inner(
285 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
286 is_terminated: bool,
287 ) -> Self {
288 Self { inner, is_terminated }
289 }
290}
291
292impl futures::Stream for BlobCreatorRequestStream {
293 type Item = Result<BlobCreatorRequest, fidl::Error>;
294
295 fn poll_next(
296 mut self: std::pin::Pin<&mut Self>,
297 cx: &mut std::task::Context<'_>,
298 ) -> std::task::Poll<Option<Self::Item>> {
299 let this = &mut *self;
300 if this.inner.check_shutdown(cx) {
301 this.is_terminated = true;
302 return std::task::Poll::Ready(None);
303 }
304 if this.is_terminated {
305 panic!("polled BlobCreatorRequestStream after completion");
306 }
307 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
308 |bytes, handles| {
309 match this.inner.channel().read_etc(cx, bytes, handles) {
310 std::task::Poll::Ready(Ok(())) => {}
311 std::task::Poll::Pending => return std::task::Poll::Pending,
312 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
313 this.is_terminated = true;
314 return std::task::Poll::Ready(None);
315 }
316 std::task::Poll::Ready(Err(e)) => {
317 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
318 e.into(),
319 ))))
320 }
321 }
322
323 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
325
326 std::task::Poll::Ready(Some(match header.ordinal {
327 0x4288fe720cca70d7 => {
328 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
329 let mut req = fidl::new_empty!(
330 BlobCreatorCreateRequest,
331 fidl::encoding::DefaultFuchsiaResourceDialect
332 );
333 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobCreatorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
334 let control_handle = BlobCreatorControlHandle { inner: this.inner.clone() };
335 Ok(BlobCreatorRequest::Create {
336 hash: req.hash,
337 allow_existing: req.allow_existing,
338
339 responder: BlobCreatorCreateResponder {
340 control_handle: std::mem::ManuallyDrop::new(control_handle),
341 tx_id: header.tx_id,
342 },
343 })
344 }
345 _ => Err(fidl::Error::UnknownOrdinal {
346 ordinal: header.ordinal,
347 protocol_name:
348 <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
349 }),
350 }))
351 },
352 )
353 }
354}
355
356#[derive(Debug)]
357pub enum BlobCreatorRequest {
358 Create { hash: [u8; 32], allow_existing: bool, responder: BlobCreatorCreateResponder },
364}
365
366impl BlobCreatorRequest {
367 #[allow(irrefutable_let_patterns)]
368 pub fn into_create(self) -> Option<([u8; 32], bool, BlobCreatorCreateResponder)> {
369 if let BlobCreatorRequest::Create { hash, allow_existing, responder } = self {
370 Some((hash, allow_existing, responder))
371 } else {
372 None
373 }
374 }
375
376 pub fn method_name(&self) -> &'static str {
378 match *self {
379 BlobCreatorRequest::Create { .. } => "create",
380 }
381 }
382}
383
384#[derive(Debug, Clone)]
385pub struct BlobCreatorControlHandle {
386 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
387}
388
389impl fidl::endpoints::ControlHandle for BlobCreatorControlHandle {
390 fn shutdown(&self) {
391 self.inner.shutdown()
392 }
393 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
394 self.inner.shutdown_with_epitaph(status)
395 }
396
397 fn is_closed(&self) -> bool {
398 self.inner.channel().is_closed()
399 }
400 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
401 self.inner.channel().on_closed()
402 }
403
404 #[cfg(target_os = "fuchsia")]
405 fn signal_peer(
406 &self,
407 clear_mask: zx::Signals,
408 set_mask: zx::Signals,
409 ) -> Result<(), zx_status::Status> {
410 use fidl::Peered;
411 self.inner.channel().signal_peer(clear_mask, set_mask)
412 }
413}
414
415impl BlobCreatorControlHandle {}
416
417#[must_use = "FIDL methods require a response to be sent"]
418#[derive(Debug)]
419pub struct BlobCreatorCreateResponder {
420 control_handle: std::mem::ManuallyDrop<BlobCreatorControlHandle>,
421 tx_id: u32,
422}
423
424impl std::ops::Drop for BlobCreatorCreateResponder {
428 fn drop(&mut self) {
429 self.control_handle.shutdown();
430 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
432 }
433}
434
435impl fidl::endpoints::Responder for BlobCreatorCreateResponder {
436 type ControlHandle = BlobCreatorControlHandle;
437
438 fn control_handle(&self) -> &BlobCreatorControlHandle {
439 &self.control_handle
440 }
441
442 fn drop_without_shutdown(mut self) {
443 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
445 std::mem::forget(self);
447 }
448}
449
450impl BlobCreatorCreateResponder {
451 pub fn send(
455 self,
456 mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
457 ) -> Result<(), fidl::Error> {
458 let _result = self.send_raw(result);
459 if _result.is_err() {
460 self.control_handle.shutdown();
461 }
462 self.drop_without_shutdown();
463 _result
464 }
465
466 pub fn send_no_shutdown_on_err(
468 self,
469 mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
470 ) -> Result<(), fidl::Error> {
471 let _result = self.send_raw(result);
472 self.drop_without_shutdown();
473 _result
474 }
475
476 fn send_raw(
477 &self,
478 mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
479 ) -> Result<(), fidl::Error> {
480 self.control_handle.inner.send::<fidl::encoding::ResultType<
481 BlobCreatorCreateResponse,
482 CreateBlobError,
483 >>(
484 result.map(|writer| (writer,)),
485 self.tx_id,
486 0x4288fe720cca70d7,
487 fidl::encoding::DynamicFlags::empty(),
488 )
489 }
490}
491
492#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
493pub struct BlobReaderMarker;
494
495impl fidl::endpoints::ProtocolMarker for BlobReaderMarker {
496 type Proxy = BlobReaderProxy;
497 type RequestStream = BlobReaderRequestStream;
498 #[cfg(target_os = "fuchsia")]
499 type SynchronousProxy = BlobReaderSynchronousProxy;
500
501 const DEBUG_NAME: &'static str = "fuchsia.fxfs.BlobReader";
502}
503impl fidl::endpoints::DiscoverableProtocolMarker for BlobReaderMarker {}
504pub type BlobReaderGetVmoResult = Result<fidl::Vmo, i32>;
505
506pub trait BlobReaderProxyInterface: Send + Sync {
507 type GetVmoResponseFut: std::future::Future<Output = Result<BlobReaderGetVmoResult, fidl::Error>>
508 + Send;
509 fn r#get_vmo(&self, blob_hash: &[u8; 32]) -> Self::GetVmoResponseFut;
510}
511#[derive(Debug)]
512#[cfg(target_os = "fuchsia")]
513pub struct BlobReaderSynchronousProxy {
514 client: fidl::client::sync::Client,
515}
516
517#[cfg(target_os = "fuchsia")]
518impl fidl::endpoints::SynchronousProxy for BlobReaderSynchronousProxy {
519 type Proxy = BlobReaderProxy;
520 type Protocol = BlobReaderMarker;
521
522 fn from_channel(inner: fidl::Channel) -> Self {
523 Self::new(inner)
524 }
525
526 fn into_channel(self) -> fidl::Channel {
527 self.client.into_channel()
528 }
529
530 fn as_channel(&self) -> &fidl::Channel {
531 self.client.as_channel()
532 }
533}
534
535#[cfg(target_os = "fuchsia")]
536impl BlobReaderSynchronousProxy {
537 pub fn new(channel: fidl::Channel) -> Self {
538 let protocol_name = <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
539 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
540 }
541
542 pub fn into_channel(self) -> fidl::Channel {
543 self.client.into_channel()
544 }
545
546 pub fn wait_for_event(
549 &self,
550 deadline: zx::MonotonicInstant,
551 ) -> Result<BlobReaderEvent, fidl::Error> {
552 BlobReaderEvent::decode(self.client.wait_for_event(deadline)?)
553 }
554
555 pub fn r#get_vmo(
557 &self,
558 mut blob_hash: &[u8; 32],
559 ___deadline: zx::MonotonicInstant,
560 ) -> Result<BlobReaderGetVmoResult, fidl::Error> {
561 let _response = self.client.send_query::<
562 BlobReaderGetVmoRequest,
563 fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>,
564 >(
565 (blob_hash,),
566 0x2fa72823ef7f11f4,
567 fidl::encoding::DynamicFlags::empty(),
568 ___deadline,
569 )?;
570 Ok(_response.map(|x| x.vmo))
571 }
572}
573
574#[derive(Debug, Clone)]
575pub struct BlobReaderProxy {
576 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
577}
578
579impl fidl::endpoints::Proxy for BlobReaderProxy {
580 type Protocol = BlobReaderMarker;
581
582 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
583 Self::new(inner)
584 }
585
586 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
587 self.client.into_channel().map_err(|client| Self { client })
588 }
589
590 fn as_channel(&self) -> &::fidl::AsyncChannel {
591 self.client.as_channel()
592 }
593}
594
595impl BlobReaderProxy {
596 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
598 let protocol_name = <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
599 Self { client: fidl::client::Client::new(channel, protocol_name) }
600 }
601
602 pub fn take_event_stream(&self) -> BlobReaderEventStream {
608 BlobReaderEventStream { event_receiver: self.client.take_event_receiver() }
609 }
610
611 pub fn r#get_vmo(
613 &self,
614 mut blob_hash: &[u8; 32],
615 ) -> fidl::client::QueryResponseFut<
616 BlobReaderGetVmoResult,
617 fidl::encoding::DefaultFuchsiaResourceDialect,
618 > {
619 BlobReaderProxyInterface::r#get_vmo(self, blob_hash)
620 }
621}
622
623impl BlobReaderProxyInterface for BlobReaderProxy {
624 type GetVmoResponseFut = fidl::client::QueryResponseFut<
625 BlobReaderGetVmoResult,
626 fidl::encoding::DefaultFuchsiaResourceDialect,
627 >;
628 fn r#get_vmo(&self, mut blob_hash: &[u8; 32]) -> Self::GetVmoResponseFut {
629 fn _decode(
630 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
631 ) -> Result<BlobReaderGetVmoResult, fidl::Error> {
632 let _response = fidl::client::decode_transaction_body::<
633 fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>,
634 fidl::encoding::DefaultFuchsiaResourceDialect,
635 0x2fa72823ef7f11f4,
636 >(_buf?)?;
637 Ok(_response.map(|x| x.vmo))
638 }
639 self.client.send_query_and_decode::<BlobReaderGetVmoRequest, BlobReaderGetVmoResult>(
640 (blob_hash,),
641 0x2fa72823ef7f11f4,
642 fidl::encoding::DynamicFlags::empty(),
643 _decode,
644 )
645 }
646}
647
648pub struct BlobReaderEventStream {
649 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
650}
651
652impl std::marker::Unpin for BlobReaderEventStream {}
653
654impl futures::stream::FusedStream for BlobReaderEventStream {
655 fn is_terminated(&self) -> bool {
656 self.event_receiver.is_terminated()
657 }
658}
659
660impl futures::Stream for BlobReaderEventStream {
661 type Item = Result<BlobReaderEvent, fidl::Error>;
662
663 fn poll_next(
664 mut self: std::pin::Pin<&mut Self>,
665 cx: &mut std::task::Context<'_>,
666 ) -> std::task::Poll<Option<Self::Item>> {
667 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
668 &mut self.event_receiver,
669 cx
670 )?) {
671 Some(buf) => std::task::Poll::Ready(Some(BlobReaderEvent::decode(buf))),
672 None => std::task::Poll::Ready(None),
673 }
674 }
675}
676
677#[derive(Debug)]
678pub enum BlobReaderEvent {}
679
680impl BlobReaderEvent {
681 fn decode(
683 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
684 ) -> Result<BlobReaderEvent, fidl::Error> {
685 let (bytes, _handles) = buf.split_mut();
686 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
687 debug_assert_eq!(tx_header.tx_id, 0);
688 match tx_header.ordinal {
689 _ => Err(fidl::Error::UnknownOrdinal {
690 ordinal: tx_header.ordinal,
691 protocol_name: <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
692 }),
693 }
694 }
695}
696
697pub struct BlobReaderRequestStream {
699 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
700 is_terminated: bool,
701}
702
703impl std::marker::Unpin for BlobReaderRequestStream {}
704
705impl futures::stream::FusedStream for BlobReaderRequestStream {
706 fn is_terminated(&self) -> bool {
707 self.is_terminated
708 }
709}
710
711impl fidl::endpoints::RequestStream for BlobReaderRequestStream {
712 type Protocol = BlobReaderMarker;
713 type ControlHandle = BlobReaderControlHandle;
714
715 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
716 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
717 }
718
719 fn control_handle(&self) -> Self::ControlHandle {
720 BlobReaderControlHandle { inner: self.inner.clone() }
721 }
722
723 fn into_inner(
724 self,
725 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
726 {
727 (self.inner, self.is_terminated)
728 }
729
730 fn from_inner(
731 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
732 is_terminated: bool,
733 ) -> Self {
734 Self { inner, is_terminated }
735 }
736}
737
738impl futures::Stream for BlobReaderRequestStream {
739 type Item = Result<BlobReaderRequest, fidl::Error>;
740
741 fn poll_next(
742 mut self: std::pin::Pin<&mut Self>,
743 cx: &mut std::task::Context<'_>,
744 ) -> std::task::Poll<Option<Self::Item>> {
745 let this = &mut *self;
746 if this.inner.check_shutdown(cx) {
747 this.is_terminated = true;
748 return std::task::Poll::Ready(None);
749 }
750 if this.is_terminated {
751 panic!("polled BlobReaderRequestStream after completion");
752 }
753 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
754 |bytes, handles| {
755 match this.inner.channel().read_etc(cx, bytes, handles) {
756 std::task::Poll::Ready(Ok(())) => {}
757 std::task::Poll::Pending => return std::task::Poll::Pending,
758 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
759 this.is_terminated = true;
760 return std::task::Poll::Ready(None);
761 }
762 std::task::Poll::Ready(Err(e)) => {
763 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
764 e.into(),
765 ))))
766 }
767 }
768
769 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
771
772 std::task::Poll::Ready(Some(match header.ordinal {
773 0x2fa72823ef7f11f4 => {
774 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
775 let mut req = fidl::new_empty!(
776 BlobReaderGetVmoRequest,
777 fidl::encoding::DefaultFuchsiaResourceDialect
778 );
779 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobReaderGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
780 let control_handle = BlobReaderControlHandle { inner: this.inner.clone() };
781 Ok(BlobReaderRequest::GetVmo {
782 blob_hash: req.blob_hash,
783
784 responder: BlobReaderGetVmoResponder {
785 control_handle: std::mem::ManuallyDrop::new(control_handle),
786 tx_id: header.tx_id,
787 },
788 })
789 }
790 _ => Err(fidl::Error::UnknownOrdinal {
791 ordinal: header.ordinal,
792 protocol_name:
793 <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
794 }),
795 }))
796 },
797 )
798 }
799}
800
801#[derive(Debug)]
802pub enum BlobReaderRequest {
803 GetVmo { blob_hash: [u8; 32], responder: BlobReaderGetVmoResponder },
805}
806
807impl BlobReaderRequest {
808 #[allow(irrefutable_let_patterns)]
809 pub fn into_get_vmo(self) -> Option<([u8; 32], BlobReaderGetVmoResponder)> {
810 if let BlobReaderRequest::GetVmo { blob_hash, responder } = self {
811 Some((blob_hash, responder))
812 } else {
813 None
814 }
815 }
816
817 pub fn method_name(&self) -> &'static str {
819 match *self {
820 BlobReaderRequest::GetVmo { .. } => "get_vmo",
821 }
822 }
823}
824
825#[derive(Debug, Clone)]
826pub struct BlobReaderControlHandle {
827 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
828}
829
830impl fidl::endpoints::ControlHandle for BlobReaderControlHandle {
831 fn shutdown(&self) {
832 self.inner.shutdown()
833 }
834 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
835 self.inner.shutdown_with_epitaph(status)
836 }
837
838 fn is_closed(&self) -> bool {
839 self.inner.channel().is_closed()
840 }
841 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
842 self.inner.channel().on_closed()
843 }
844
845 #[cfg(target_os = "fuchsia")]
846 fn signal_peer(
847 &self,
848 clear_mask: zx::Signals,
849 set_mask: zx::Signals,
850 ) -> Result<(), zx_status::Status> {
851 use fidl::Peered;
852 self.inner.channel().signal_peer(clear_mask, set_mask)
853 }
854}
855
856impl BlobReaderControlHandle {}
857
858#[must_use = "FIDL methods require a response to be sent"]
859#[derive(Debug)]
860pub struct BlobReaderGetVmoResponder {
861 control_handle: std::mem::ManuallyDrop<BlobReaderControlHandle>,
862 tx_id: u32,
863}
864
865impl std::ops::Drop for BlobReaderGetVmoResponder {
869 fn drop(&mut self) {
870 self.control_handle.shutdown();
871 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
873 }
874}
875
876impl fidl::endpoints::Responder for BlobReaderGetVmoResponder {
877 type ControlHandle = BlobReaderControlHandle;
878
879 fn control_handle(&self) -> &BlobReaderControlHandle {
880 &self.control_handle
881 }
882
883 fn drop_without_shutdown(mut self) {
884 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
886 std::mem::forget(self);
888 }
889}
890
891impl BlobReaderGetVmoResponder {
892 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
896 let _result = self.send_raw(result);
897 if _result.is_err() {
898 self.control_handle.shutdown();
899 }
900 self.drop_without_shutdown();
901 _result
902 }
903
904 pub fn send_no_shutdown_on_err(
906 self,
907 mut result: Result<fidl::Vmo, i32>,
908 ) -> Result<(), fidl::Error> {
909 let _result = self.send_raw(result);
910 self.drop_without_shutdown();
911 _result
912 }
913
914 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
915 self.control_handle.inner.send::<fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>>(
916 result.map(|vmo| (vmo,)),
917 self.tx_id,
918 0x2fa72823ef7f11f4,
919 fidl::encoding::DynamicFlags::empty(),
920 )
921 }
922}
923
924#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
925pub struct BlobWriterMarker;
926
927impl fidl::endpoints::ProtocolMarker for BlobWriterMarker {
928 type Proxy = BlobWriterProxy;
929 type RequestStream = BlobWriterRequestStream;
930 #[cfg(target_os = "fuchsia")]
931 type SynchronousProxy = BlobWriterSynchronousProxy;
932
933 const DEBUG_NAME: &'static str = "(anonymous) BlobWriter";
934}
935pub type BlobWriterGetVmoResult = Result<fidl::Vmo, i32>;
936pub type BlobWriterBytesReadyResult = Result<(), i32>;
937
938pub trait BlobWriterProxyInterface: Send + Sync {
939 type GetVmoResponseFut: std::future::Future<Output = Result<BlobWriterGetVmoResult, fidl::Error>>
940 + Send;
941 fn r#get_vmo(&self, size: u64) -> Self::GetVmoResponseFut;
942 type BytesReadyResponseFut: std::future::Future<Output = Result<BlobWriterBytesReadyResult, fidl::Error>>
943 + Send;
944 fn r#bytes_ready(&self, bytes_written: u64) -> Self::BytesReadyResponseFut;
945}
946#[derive(Debug)]
947#[cfg(target_os = "fuchsia")]
948pub struct BlobWriterSynchronousProxy {
949 client: fidl::client::sync::Client,
950}
951
952#[cfg(target_os = "fuchsia")]
953impl fidl::endpoints::SynchronousProxy for BlobWriterSynchronousProxy {
954 type Proxy = BlobWriterProxy;
955 type Protocol = BlobWriterMarker;
956
957 fn from_channel(inner: fidl::Channel) -> Self {
958 Self::new(inner)
959 }
960
961 fn into_channel(self) -> fidl::Channel {
962 self.client.into_channel()
963 }
964
965 fn as_channel(&self) -> &fidl::Channel {
966 self.client.as_channel()
967 }
968}
969
970#[cfg(target_os = "fuchsia")]
971impl BlobWriterSynchronousProxy {
972 pub fn new(channel: fidl::Channel) -> Self {
973 let protocol_name = <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
974 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
975 }
976
977 pub fn into_channel(self) -> fidl::Channel {
978 self.client.into_channel()
979 }
980
981 pub fn wait_for_event(
984 &self,
985 deadline: zx::MonotonicInstant,
986 ) -> Result<BlobWriterEvent, fidl::Error> {
987 BlobWriterEvent::decode(self.client.wait_for_event(deadline)?)
988 }
989
990 pub fn r#get_vmo(
1002 &self,
1003 mut size: u64,
1004 ___deadline: zx::MonotonicInstant,
1005 ) -> Result<BlobWriterGetVmoResult, fidl::Error> {
1006 let _response = self.client.send_query::<
1007 BlobWriterGetVmoRequest,
1008 fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>,
1009 >(
1010 (size,),
1011 0x50c8988b12b6f893,
1012 fidl::encoding::DynamicFlags::empty(),
1013 ___deadline,
1014 )?;
1015 Ok(_response.map(|x| x.vmo))
1016 }
1017
1018 pub fn r#bytes_ready(
1022 &self,
1023 mut bytes_written: u64,
1024 ___deadline: zx::MonotonicInstant,
1025 ) -> Result<BlobWriterBytesReadyResult, fidl::Error> {
1026 let _response = self.client.send_query::<
1027 BlobWriterBytesReadyRequest,
1028 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1029 >(
1030 (bytes_written,),
1031 0x7b308b473606c573,
1032 fidl::encoding::DynamicFlags::empty(),
1033 ___deadline,
1034 )?;
1035 Ok(_response.map(|x| x))
1036 }
1037}
1038
1039#[derive(Debug, Clone)]
1040pub struct BlobWriterProxy {
1041 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1042}
1043
1044impl fidl::endpoints::Proxy for BlobWriterProxy {
1045 type Protocol = BlobWriterMarker;
1046
1047 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1048 Self::new(inner)
1049 }
1050
1051 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1052 self.client.into_channel().map_err(|client| Self { client })
1053 }
1054
1055 fn as_channel(&self) -> &::fidl::AsyncChannel {
1056 self.client.as_channel()
1057 }
1058}
1059
1060impl BlobWriterProxy {
1061 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1063 let protocol_name = <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1064 Self { client: fidl::client::Client::new(channel, protocol_name) }
1065 }
1066
1067 pub fn take_event_stream(&self) -> BlobWriterEventStream {
1073 BlobWriterEventStream { event_receiver: self.client.take_event_receiver() }
1074 }
1075
1076 pub fn r#get_vmo(
1088 &self,
1089 mut size: u64,
1090 ) -> fidl::client::QueryResponseFut<
1091 BlobWriterGetVmoResult,
1092 fidl::encoding::DefaultFuchsiaResourceDialect,
1093 > {
1094 BlobWriterProxyInterface::r#get_vmo(self, size)
1095 }
1096
1097 pub fn r#bytes_ready(
1101 &self,
1102 mut bytes_written: u64,
1103 ) -> fidl::client::QueryResponseFut<
1104 BlobWriterBytesReadyResult,
1105 fidl::encoding::DefaultFuchsiaResourceDialect,
1106 > {
1107 BlobWriterProxyInterface::r#bytes_ready(self, bytes_written)
1108 }
1109}
1110
1111impl BlobWriterProxyInterface for BlobWriterProxy {
1112 type GetVmoResponseFut = fidl::client::QueryResponseFut<
1113 BlobWriterGetVmoResult,
1114 fidl::encoding::DefaultFuchsiaResourceDialect,
1115 >;
1116 fn r#get_vmo(&self, mut size: u64) -> Self::GetVmoResponseFut {
1117 fn _decode(
1118 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1119 ) -> Result<BlobWriterGetVmoResult, fidl::Error> {
1120 let _response = fidl::client::decode_transaction_body::<
1121 fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>,
1122 fidl::encoding::DefaultFuchsiaResourceDialect,
1123 0x50c8988b12b6f893,
1124 >(_buf?)?;
1125 Ok(_response.map(|x| x.vmo))
1126 }
1127 self.client.send_query_and_decode::<BlobWriterGetVmoRequest, BlobWriterGetVmoResult>(
1128 (size,),
1129 0x50c8988b12b6f893,
1130 fidl::encoding::DynamicFlags::empty(),
1131 _decode,
1132 )
1133 }
1134
1135 type BytesReadyResponseFut = fidl::client::QueryResponseFut<
1136 BlobWriterBytesReadyResult,
1137 fidl::encoding::DefaultFuchsiaResourceDialect,
1138 >;
1139 fn r#bytes_ready(&self, mut bytes_written: u64) -> Self::BytesReadyResponseFut {
1140 fn _decode(
1141 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1142 ) -> Result<BlobWriterBytesReadyResult, fidl::Error> {
1143 let _response = fidl::client::decode_transaction_body::<
1144 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1145 fidl::encoding::DefaultFuchsiaResourceDialect,
1146 0x7b308b473606c573,
1147 >(_buf?)?;
1148 Ok(_response.map(|x| x))
1149 }
1150 self.client
1151 .send_query_and_decode::<BlobWriterBytesReadyRequest, BlobWriterBytesReadyResult>(
1152 (bytes_written,),
1153 0x7b308b473606c573,
1154 fidl::encoding::DynamicFlags::empty(),
1155 _decode,
1156 )
1157 }
1158}
1159
1160pub struct BlobWriterEventStream {
1161 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1162}
1163
1164impl std::marker::Unpin for BlobWriterEventStream {}
1165
1166impl futures::stream::FusedStream for BlobWriterEventStream {
1167 fn is_terminated(&self) -> bool {
1168 self.event_receiver.is_terminated()
1169 }
1170}
1171
1172impl futures::Stream for BlobWriterEventStream {
1173 type Item = Result<BlobWriterEvent, fidl::Error>;
1174
1175 fn poll_next(
1176 mut self: std::pin::Pin<&mut Self>,
1177 cx: &mut std::task::Context<'_>,
1178 ) -> std::task::Poll<Option<Self::Item>> {
1179 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1180 &mut self.event_receiver,
1181 cx
1182 )?) {
1183 Some(buf) => std::task::Poll::Ready(Some(BlobWriterEvent::decode(buf))),
1184 None => std::task::Poll::Ready(None),
1185 }
1186 }
1187}
1188
1189#[derive(Debug)]
1190pub enum BlobWriterEvent {}
1191
1192impl BlobWriterEvent {
1193 fn decode(
1195 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1196 ) -> Result<BlobWriterEvent, fidl::Error> {
1197 let (bytes, _handles) = buf.split_mut();
1198 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1199 debug_assert_eq!(tx_header.tx_id, 0);
1200 match tx_header.ordinal {
1201 _ => Err(fidl::Error::UnknownOrdinal {
1202 ordinal: tx_header.ordinal,
1203 protocol_name: <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1204 }),
1205 }
1206 }
1207}
1208
1209pub struct BlobWriterRequestStream {
1211 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1212 is_terminated: bool,
1213}
1214
1215impl std::marker::Unpin for BlobWriterRequestStream {}
1216
1217impl futures::stream::FusedStream for BlobWriterRequestStream {
1218 fn is_terminated(&self) -> bool {
1219 self.is_terminated
1220 }
1221}
1222
1223impl fidl::endpoints::RequestStream for BlobWriterRequestStream {
1224 type Protocol = BlobWriterMarker;
1225 type ControlHandle = BlobWriterControlHandle;
1226
1227 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1228 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1229 }
1230
1231 fn control_handle(&self) -> Self::ControlHandle {
1232 BlobWriterControlHandle { inner: self.inner.clone() }
1233 }
1234
1235 fn into_inner(
1236 self,
1237 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1238 {
1239 (self.inner, self.is_terminated)
1240 }
1241
1242 fn from_inner(
1243 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1244 is_terminated: bool,
1245 ) -> Self {
1246 Self { inner, is_terminated }
1247 }
1248}
1249
1250impl futures::Stream for BlobWriterRequestStream {
1251 type Item = Result<BlobWriterRequest, fidl::Error>;
1252
1253 fn poll_next(
1254 mut self: std::pin::Pin<&mut Self>,
1255 cx: &mut std::task::Context<'_>,
1256 ) -> std::task::Poll<Option<Self::Item>> {
1257 let this = &mut *self;
1258 if this.inner.check_shutdown(cx) {
1259 this.is_terminated = true;
1260 return std::task::Poll::Ready(None);
1261 }
1262 if this.is_terminated {
1263 panic!("polled BlobWriterRequestStream after completion");
1264 }
1265 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1266 |bytes, handles| {
1267 match this.inner.channel().read_etc(cx, bytes, handles) {
1268 std::task::Poll::Ready(Ok(())) => {}
1269 std::task::Poll::Pending => return std::task::Poll::Pending,
1270 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1271 this.is_terminated = true;
1272 return std::task::Poll::Ready(None);
1273 }
1274 std::task::Poll::Ready(Err(e)) => {
1275 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1276 e.into(),
1277 ))))
1278 }
1279 }
1280
1281 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1283
1284 std::task::Poll::Ready(Some(match header.ordinal {
1285 0x50c8988b12b6f893 => {
1286 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1287 let mut req = fidl::new_empty!(
1288 BlobWriterGetVmoRequest,
1289 fidl::encoding::DefaultFuchsiaResourceDialect
1290 );
1291 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobWriterGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
1292 let control_handle = BlobWriterControlHandle { inner: this.inner.clone() };
1293 Ok(BlobWriterRequest::GetVmo {
1294 size: req.size,
1295
1296 responder: BlobWriterGetVmoResponder {
1297 control_handle: std::mem::ManuallyDrop::new(control_handle),
1298 tx_id: header.tx_id,
1299 },
1300 })
1301 }
1302 0x7b308b473606c573 => {
1303 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1304 let mut req = fidl::new_empty!(
1305 BlobWriterBytesReadyRequest,
1306 fidl::encoding::DefaultFuchsiaResourceDialect
1307 );
1308 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobWriterBytesReadyRequest>(&header, _body_bytes, handles, &mut req)?;
1309 let control_handle = BlobWriterControlHandle { inner: this.inner.clone() };
1310 Ok(BlobWriterRequest::BytesReady {
1311 bytes_written: req.bytes_written,
1312
1313 responder: BlobWriterBytesReadyResponder {
1314 control_handle: std::mem::ManuallyDrop::new(control_handle),
1315 tx_id: header.tx_id,
1316 },
1317 })
1318 }
1319 _ => Err(fidl::Error::UnknownOrdinal {
1320 ordinal: header.ordinal,
1321 protocol_name:
1322 <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1323 }),
1324 }))
1325 },
1326 )
1327 }
1328}
1329
1330#[derive(Debug)]
1331pub enum BlobWriterRequest {
1332 GetVmo { size: u64, responder: BlobWriterGetVmoResponder },
1344 BytesReady { bytes_written: u64, responder: BlobWriterBytesReadyResponder },
1348}
1349
1350impl BlobWriterRequest {
1351 #[allow(irrefutable_let_patterns)]
1352 pub fn into_get_vmo(self) -> Option<(u64, BlobWriterGetVmoResponder)> {
1353 if let BlobWriterRequest::GetVmo { size, responder } = self {
1354 Some((size, responder))
1355 } else {
1356 None
1357 }
1358 }
1359
1360 #[allow(irrefutable_let_patterns)]
1361 pub fn into_bytes_ready(self) -> Option<(u64, BlobWriterBytesReadyResponder)> {
1362 if let BlobWriterRequest::BytesReady { bytes_written, responder } = self {
1363 Some((bytes_written, responder))
1364 } else {
1365 None
1366 }
1367 }
1368
1369 pub fn method_name(&self) -> &'static str {
1371 match *self {
1372 BlobWriterRequest::GetVmo { .. } => "get_vmo",
1373 BlobWriterRequest::BytesReady { .. } => "bytes_ready",
1374 }
1375 }
1376}
1377
1378#[derive(Debug, Clone)]
1379pub struct BlobWriterControlHandle {
1380 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1381}
1382
1383impl fidl::endpoints::ControlHandle for BlobWriterControlHandle {
1384 fn shutdown(&self) {
1385 self.inner.shutdown()
1386 }
1387 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1388 self.inner.shutdown_with_epitaph(status)
1389 }
1390
1391 fn is_closed(&self) -> bool {
1392 self.inner.channel().is_closed()
1393 }
1394 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1395 self.inner.channel().on_closed()
1396 }
1397
1398 #[cfg(target_os = "fuchsia")]
1399 fn signal_peer(
1400 &self,
1401 clear_mask: zx::Signals,
1402 set_mask: zx::Signals,
1403 ) -> Result<(), zx_status::Status> {
1404 use fidl::Peered;
1405 self.inner.channel().signal_peer(clear_mask, set_mask)
1406 }
1407}
1408
1409impl BlobWriterControlHandle {}
1410
1411#[must_use = "FIDL methods require a response to be sent"]
1412#[derive(Debug)]
1413pub struct BlobWriterGetVmoResponder {
1414 control_handle: std::mem::ManuallyDrop<BlobWriterControlHandle>,
1415 tx_id: u32,
1416}
1417
1418impl std::ops::Drop for BlobWriterGetVmoResponder {
1422 fn drop(&mut self) {
1423 self.control_handle.shutdown();
1424 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1426 }
1427}
1428
1429impl fidl::endpoints::Responder for BlobWriterGetVmoResponder {
1430 type ControlHandle = BlobWriterControlHandle;
1431
1432 fn control_handle(&self) -> &BlobWriterControlHandle {
1433 &self.control_handle
1434 }
1435
1436 fn drop_without_shutdown(mut self) {
1437 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1439 std::mem::forget(self);
1441 }
1442}
1443
1444impl BlobWriterGetVmoResponder {
1445 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1449 let _result = self.send_raw(result);
1450 if _result.is_err() {
1451 self.control_handle.shutdown();
1452 }
1453 self.drop_without_shutdown();
1454 _result
1455 }
1456
1457 pub fn send_no_shutdown_on_err(
1459 self,
1460 mut result: Result<fidl::Vmo, i32>,
1461 ) -> Result<(), fidl::Error> {
1462 let _result = self.send_raw(result);
1463 self.drop_without_shutdown();
1464 _result
1465 }
1466
1467 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1468 self.control_handle.inner.send::<fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>>(
1469 result.map(|vmo| (vmo,)),
1470 self.tx_id,
1471 0x50c8988b12b6f893,
1472 fidl::encoding::DynamicFlags::empty(),
1473 )
1474 }
1475}
1476
1477#[must_use = "FIDL methods require a response to be sent"]
1478#[derive(Debug)]
1479pub struct BlobWriterBytesReadyResponder {
1480 control_handle: std::mem::ManuallyDrop<BlobWriterControlHandle>,
1481 tx_id: u32,
1482}
1483
1484impl std::ops::Drop for BlobWriterBytesReadyResponder {
1488 fn drop(&mut self) {
1489 self.control_handle.shutdown();
1490 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1492 }
1493}
1494
1495impl fidl::endpoints::Responder for BlobWriterBytesReadyResponder {
1496 type ControlHandle = BlobWriterControlHandle;
1497
1498 fn control_handle(&self) -> &BlobWriterControlHandle {
1499 &self.control_handle
1500 }
1501
1502 fn drop_without_shutdown(mut self) {
1503 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1505 std::mem::forget(self);
1507 }
1508}
1509
1510impl BlobWriterBytesReadyResponder {
1511 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1515 let _result = self.send_raw(result);
1516 if _result.is_err() {
1517 self.control_handle.shutdown();
1518 }
1519 self.drop_without_shutdown();
1520 _result
1521 }
1522
1523 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1525 let _result = self.send_raw(result);
1526 self.drop_without_shutdown();
1527 _result
1528 }
1529
1530 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1531 self.control_handle
1532 .inner
1533 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1534 result,
1535 self.tx_id,
1536 0x7b308b473606c573,
1537 fidl::encoding::DynamicFlags::empty(),
1538 )
1539 }
1540}
1541
1542#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1543pub struct CryptMarker;
1544
1545impl fidl::endpoints::ProtocolMarker for CryptMarker {
1546 type Proxy = CryptProxy;
1547 type RequestStream = CryptRequestStream;
1548 #[cfg(target_os = "fuchsia")]
1549 type SynchronousProxy = CryptSynchronousProxy;
1550
1551 const DEBUG_NAME: &'static str = "fuchsia.fxfs.Crypt";
1552}
1553impl fidl::endpoints::DiscoverableProtocolMarker for CryptMarker {}
1554pub type CryptCreateKeyResult = Result<([u8; 16], Vec<u8>, Vec<u8>), i32>;
1555pub type CryptCreateKeyWithIdResult = Result<(Vec<u8>, Vec<u8>), i32>;
1556pub type CryptUnwrapKeyResult = Result<Vec<u8>, i32>;
1557
1558pub trait CryptProxyInterface: Send + Sync {
1559 type CreateKeyResponseFut: std::future::Future<Output = Result<CryptCreateKeyResult, fidl::Error>>
1560 + Send;
1561 fn r#create_key(&self, owner: u64, purpose: KeyPurpose) -> Self::CreateKeyResponseFut;
1562 type CreateKeyWithIdResponseFut: std::future::Future<Output = Result<CryptCreateKeyWithIdResult, fidl::Error>>
1563 + Send;
1564 fn r#create_key_with_id(
1565 &self,
1566 owner: u64,
1567 wrapping_key_id: &[u8; 16],
1568 ) -> Self::CreateKeyWithIdResponseFut;
1569 type UnwrapKeyResponseFut: std::future::Future<Output = Result<CryptUnwrapKeyResult, fidl::Error>>
1570 + Send;
1571 fn r#unwrap_key(
1572 &self,
1573 wrapping_key_id: &[u8; 16],
1574 owner: u64,
1575 key: &[u8],
1576 ) -> Self::UnwrapKeyResponseFut;
1577}
1578#[derive(Debug)]
1579#[cfg(target_os = "fuchsia")]
1580pub struct CryptSynchronousProxy {
1581 client: fidl::client::sync::Client,
1582}
1583
1584#[cfg(target_os = "fuchsia")]
1585impl fidl::endpoints::SynchronousProxy for CryptSynchronousProxy {
1586 type Proxy = CryptProxy;
1587 type Protocol = CryptMarker;
1588
1589 fn from_channel(inner: fidl::Channel) -> Self {
1590 Self::new(inner)
1591 }
1592
1593 fn into_channel(self) -> fidl::Channel {
1594 self.client.into_channel()
1595 }
1596
1597 fn as_channel(&self) -> &fidl::Channel {
1598 self.client.as_channel()
1599 }
1600}
1601
1602#[cfg(target_os = "fuchsia")]
1603impl CryptSynchronousProxy {
1604 pub fn new(channel: fidl::Channel) -> Self {
1605 let protocol_name = <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1606 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1607 }
1608
1609 pub fn into_channel(self) -> fidl::Channel {
1610 self.client.into_channel()
1611 }
1612
1613 pub fn wait_for_event(
1616 &self,
1617 deadline: zx::MonotonicInstant,
1618 ) -> Result<CryptEvent, fidl::Error> {
1619 CryptEvent::decode(self.client.wait_for_event(deadline)?)
1620 }
1621
1622 pub fn r#create_key(
1627 &self,
1628 mut owner: u64,
1629 mut purpose: KeyPurpose,
1630 ___deadline: zx::MonotonicInstant,
1631 ) -> Result<CryptCreateKeyResult, fidl::Error> {
1632 let _response = self.client.send_query::<
1633 CryptCreateKeyRequest,
1634 fidl::encoding::ResultType<CryptCreateKeyResponse, i32>,
1635 >(
1636 (owner, purpose,),
1637 0x6ec69b3aee7fdbba,
1638 fidl::encoding::DynamicFlags::empty(),
1639 ___deadline,
1640 )?;
1641 Ok(_response.map(|x| (x.wrapping_key_id, x.wrapped_key, x.unwrapped_key)))
1642 }
1643
1644 pub fn r#create_key_with_id(
1648 &self,
1649 mut owner: u64,
1650 mut wrapping_key_id: &[u8; 16],
1651 ___deadline: zx::MonotonicInstant,
1652 ) -> Result<CryptCreateKeyWithIdResult, fidl::Error> {
1653 let _response = self.client.send_query::<
1654 CryptCreateKeyWithIdRequest,
1655 fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>,
1656 >(
1657 (owner, wrapping_key_id,),
1658 0x21e8076688700b50,
1659 fidl::encoding::DynamicFlags::empty(),
1660 ___deadline,
1661 )?;
1662 Ok(_response.map(|x| (x.wrapped_key, x.unwrapped_key)))
1663 }
1664
1665 pub fn r#unwrap_key(
1670 &self,
1671 mut wrapping_key_id: &[u8; 16],
1672 mut owner: u64,
1673 mut key: &[u8],
1674 ___deadline: zx::MonotonicInstant,
1675 ) -> Result<CryptUnwrapKeyResult, fidl::Error> {
1676 let _response = self.client.send_query::<
1677 CryptUnwrapKeyRequest,
1678 fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>,
1679 >(
1680 (wrapping_key_id, owner, key,),
1681 0x6ec34e2b64d46be9,
1682 fidl::encoding::DynamicFlags::empty(),
1683 ___deadline,
1684 )?;
1685 Ok(_response.map(|x| x.unwrapped_key))
1686 }
1687}
1688
1689#[derive(Debug, Clone)]
1690pub struct CryptProxy {
1691 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1692}
1693
1694impl fidl::endpoints::Proxy for CryptProxy {
1695 type Protocol = CryptMarker;
1696
1697 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1698 Self::new(inner)
1699 }
1700
1701 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1702 self.client.into_channel().map_err(|client| Self { client })
1703 }
1704
1705 fn as_channel(&self) -> &::fidl::AsyncChannel {
1706 self.client.as_channel()
1707 }
1708}
1709
1710impl CryptProxy {
1711 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1713 let protocol_name = <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1714 Self { client: fidl::client::Client::new(channel, protocol_name) }
1715 }
1716
1717 pub fn take_event_stream(&self) -> CryptEventStream {
1723 CryptEventStream { event_receiver: self.client.take_event_receiver() }
1724 }
1725
1726 pub fn r#create_key(
1731 &self,
1732 mut owner: u64,
1733 mut purpose: KeyPurpose,
1734 ) -> fidl::client::QueryResponseFut<
1735 CryptCreateKeyResult,
1736 fidl::encoding::DefaultFuchsiaResourceDialect,
1737 > {
1738 CryptProxyInterface::r#create_key(self, owner, purpose)
1739 }
1740
1741 pub fn r#create_key_with_id(
1745 &self,
1746 mut owner: u64,
1747 mut wrapping_key_id: &[u8; 16],
1748 ) -> fidl::client::QueryResponseFut<
1749 CryptCreateKeyWithIdResult,
1750 fidl::encoding::DefaultFuchsiaResourceDialect,
1751 > {
1752 CryptProxyInterface::r#create_key_with_id(self, owner, wrapping_key_id)
1753 }
1754
1755 pub fn r#unwrap_key(
1760 &self,
1761 mut wrapping_key_id: &[u8; 16],
1762 mut owner: u64,
1763 mut key: &[u8],
1764 ) -> fidl::client::QueryResponseFut<
1765 CryptUnwrapKeyResult,
1766 fidl::encoding::DefaultFuchsiaResourceDialect,
1767 > {
1768 CryptProxyInterface::r#unwrap_key(self, wrapping_key_id, owner, key)
1769 }
1770}
1771
1772impl CryptProxyInterface for CryptProxy {
1773 type CreateKeyResponseFut = fidl::client::QueryResponseFut<
1774 CryptCreateKeyResult,
1775 fidl::encoding::DefaultFuchsiaResourceDialect,
1776 >;
1777 fn r#create_key(&self, mut owner: u64, mut purpose: KeyPurpose) -> Self::CreateKeyResponseFut {
1778 fn _decode(
1779 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1780 ) -> Result<CryptCreateKeyResult, fidl::Error> {
1781 let _response = fidl::client::decode_transaction_body::<
1782 fidl::encoding::ResultType<CryptCreateKeyResponse, i32>,
1783 fidl::encoding::DefaultFuchsiaResourceDialect,
1784 0x6ec69b3aee7fdbba,
1785 >(_buf?)?;
1786 Ok(_response.map(|x| (x.wrapping_key_id, x.wrapped_key, x.unwrapped_key)))
1787 }
1788 self.client.send_query_and_decode::<CryptCreateKeyRequest, CryptCreateKeyResult>(
1789 (owner, purpose),
1790 0x6ec69b3aee7fdbba,
1791 fidl::encoding::DynamicFlags::empty(),
1792 _decode,
1793 )
1794 }
1795
1796 type CreateKeyWithIdResponseFut = fidl::client::QueryResponseFut<
1797 CryptCreateKeyWithIdResult,
1798 fidl::encoding::DefaultFuchsiaResourceDialect,
1799 >;
1800 fn r#create_key_with_id(
1801 &self,
1802 mut owner: u64,
1803 mut wrapping_key_id: &[u8; 16],
1804 ) -> Self::CreateKeyWithIdResponseFut {
1805 fn _decode(
1806 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1807 ) -> Result<CryptCreateKeyWithIdResult, fidl::Error> {
1808 let _response = fidl::client::decode_transaction_body::<
1809 fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>,
1810 fidl::encoding::DefaultFuchsiaResourceDialect,
1811 0x21e8076688700b50,
1812 >(_buf?)?;
1813 Ok(_response.map(|x| (x.wrapped_key, x.unwrapped_key)))
1814 }
1815 self.client
1816 .send_query_and_decode::<CryptCreateKeyWithIdRequest, CryptCreateKeyWithIdResult>(
1817 (owner, wrapping_key_id),
1818 0x21e8076688700b50,
1819 fidl::encoding::DynamicFlags::empty(),
1820 _decode,
1821 )
1822 }
1823
1824 type UnwrapKeyResponseFut = fidl::client::QueryResponseFut<
1825 CryptUnwrapKeyResult,
1826 fidl::encoding::DefaultFuchsiaResourceDialect,
1827 >;
1828 fn r#unwrap_key(
1829 &self,
1830 mut wrapping_key_id: &[u8; 16],
1831 mut owner: u64,
1832 mut key: &[u8],
1833 ) -> Self::UnwrapKeyResponseFut {
1834 fn _decode(
1835 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1836 ) -> Result<CryptUnwrapKeyResult, fidl::Error> {
1837 let _response = fidl::client::decode_transaction_body::<
1838 fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>,
1839 fidl::encoding::DefaultFuchsiaResourceDialect,
1840 0x6ec34e2b64d46be9,
1841 >(_buf?)?;
1842 Ok(_response.map(|x| x.unwrapped_key))
1843 }
1844 self.client.send_query_and_decode::<CryptUnwrapKeyRequest, CryptUnwrapKeyResult>(
1845 (wrapping_key_id, owner, key),
1846 0x6ec34e2b64d46be9,
1847 fidl::encoding::DynamicFlags::empty(),
1848 _decode,
1849 )
1850 }
1851}
1852
1853pub struct CryptEventStream {
1854 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1855}
1856
1857impl std::marker::Unpin for CryptEventStream {}
1858
1859impl futures::stream::FusedStream for CryptEventStream {
1860 fn is_terminated(&self) -> bool {
1861 self.event_receiver.is_terminated()
1862 }
1863}
1864
1865impl futures::Stream for CryptEventStream {
1866 type Item = Result<CryptEvent, fidl::Error>;
1867
1868 fn poll_next(
1869 mut self: std::pin::Pin<&mut Self>,
1870 cx: &mut std::task::Context<'_>,
1871 ) -> std::task::Poll<Option<Self::Item>> {
1872 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1873 &mut self.event_receiver,
1874 cx
1875 )?) {
1876 Some(buf) => std::task::Poll::Ready(Some(CryptEvent::decode(buf))),
1877 None => std::task::Poll::Ready(None),
1878 }
1879 }
1880}
1881
1882#[derive(Debug)]
1883pub enum CryptEvent {}
1884
1885impl CryptEvent {
1886 fn decode(
1888 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1889 ) -> Result<CryptEvent, fidl::Error> {
1890 let (bytes, _handles) = buf.split_mut();
1891 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1892 debug_assert_eq!(tx_header.tx_id, 0);
1893 match tx_header.ordinal {
1894 _ => Err(fidl::Error::UnknownOrdinal {
1895 ordinal: tx_header.ordinal,
1896 protocol_name: <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1897 }),
1898 }
1899 }
1900}
1901
1902pub struct CryptRequestStream {
1904 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1905 is_terminated: bool,
1906}
1907
1908impl std::marker::Unpin for CryptRequestStream {}
1909
1910impl futures::stream::FusedStream for CryptRequestStream {
1911 fn is_terminated(&self) -> bool {
1912 self.is_terminated
1913 }
1914}
1915
1916impl fidl::endpoints::RequestStream for CryptRequestStream {
1917 type Protocol = CryptMarker;
1918 type ControlHandle = CryptControlHandle;
1919
1920 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1921 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1922 }
1923
1924 fn control_handle(&self) -> Self::ControlHandle {
1925 CryptControlHandle { inner: self.inner.clone() }
1926 }
1927
1928 fn into_inner(
1929 self,
1930 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1931 {
1932 (self.inner, self.is_terminated)
1933 }
1934
1935 fn from_inner(
1936 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1937 is_terminated: bool,
1938 ) -> Self {
1939 Self { inner, is_terminated }
1940 }
1941}
1942
1943impl futures::Stream for CryptRequestStream {
1944 type Item = Result<CryptRequest, fidl::Error>;
1945
1946 fn poll_next(
1947 mut self: std::pin::Pin<&mut Self>,
1948 cx: &mut std::task::Context<'_>,
1949 ) -> std::task::Poll<Option<Self::Item>> {
1950 let this = &mut *self;
1951 if this.inner.check_shutdown(cx) {
1952 this.is_terminated = true;
1953 return std::task::Poll::Ready(None);
1954 }
1955 if this.is_terminated {
1956 panic!("polled CryptRequestStream after completion");
1957 }
1958 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1959 |bytes, handles| {
1960 match this.inner.channel().read_etc(cx, bytes, handles) {
1961 std::task::Poll::Ready(Ok(())) => {}
1962 std::task::Poll::Pending => return std::task::Poll::Pending,
1963 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1964 this.is_terminated = true;
1965 return std::task::Poll::Ready(None);
1966 }
1967 std::task::Poll::Ready(Err(e)) => {
1968 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1969 e.into(),
1970 ))))
1971 }
1972 }
1973
1974 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1976
1977 std::task::Poll::Ready(Some(match header.ordinal {
1978 0x6ec69b3aee7fdbba => {
1979 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1980 let mut req = fidl::new_empty!(
1981 CryptCreateKeyRequest,
1982 fidl::encoding::DefaultFuchsiaResourceDialect
1983 );
1984 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptCreateKeyRequest>(&header, _body_bytes, handles, &mut req)?;
1985 let control_handle = CryptControlHandle { inner: this.inner.clone() };
1986 Ok(CryptRequest::CreateKey {
1987 owner: req.owner,
1988 purpose: req.purpose,
1989
1990 responder: CryptCreateKeyResponder {
1991 control_handle: std::mem::ManuallyDrop::new(control_handle),
1992 tx_id: header.tx_id,
1993 },
1994 })
1995 }
1996 0x21e8076688700b50 => {
1997 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1998 let mut req = fidl::new_empty!(
1999 CryptCreateKeyWithIdRequest,
2000 fidl::encoding::DefaultFuchsiaResourceDialect
2001 );
2002 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptCreateKeyWithIdRequest>(&header, _body_bytes, handles, &mut req)?;
2003 let control_handle = CryptControlHandle { inner: this.inner.clone() };
2004 Ok(CryptRequest::CreateKeyWithId {
2005 owner: req.owner,
2006 wrapping_key_id: req.wrapping_key_id,
2007
2008 responder: CryptCreateKeyWithIdResponder {
2009 control_handle: std::mem::ManuallyDrop::new(control_handle),
2010 tx_id: header.tx_id,
2011 },
2012 })
2013 }
2014 0x6ec34e2b64d46be9 => {
2015 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2016 let mut req = fidl::new_empty!(
2017 CryptUnwrapKeyRequest,
2018 fidl::encoding::DefaultFuchsiaResourceDialect
2019 );
2020 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptUnwrapKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2021 let control_handle = CryptControlHandle { inner: this.inner.clone() };
2022 Ok(CryptRequest::UnwrapKey {
2023 wrapping_key_id: req.wrapping_key_id,
2024 owner: req.owner,
2025 key: req.key,
2026
2027 responder: CryptUnwrapKeyResponder {
2028 control_handle: std::mem::ManuallyDrop::new(control_handle),
2029 tx_id: header.tx_id,
2030 },
2031 })
2032 }
2033 _ => Err(fidl::Error::UnknownOrdinal {
2034 ordinal: header.ordinal,
2035 protocol_name: <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2036 }),
2037 }))
2038 },
2039 )
2040 }
2041}
2042
2043#[derive(Debug)]
2044pub enum CryptRequest {
2045 CreateKey { owner: u64, purpose: KeyPurpose, responder: CryptCreateKeyResponder },
2050 CreateKeyWithId {
2054 owner: u64,
2055 wrapping_key_id: [u8; 16],
2056 responder: CryptCreateKeyWithIdResponder,
2057 },
2058 UnwrapKey {
2063 wrapping_key_id: [u8; 16],
2064 owner: u64,
2065 key: Vec<u8>,
2066 responder: CryptUnwrapKeyResponder,
2067 },
2068}
2069
2070impl CryptRequest {
2071 #[allow(irrefutable_let_patterns)]
2072 pub fn into_create_key(self) -> Option<(u64, KeyPurpose, CryptCreateKeyResponder)> {
2073 if let CryptRequest::CreateKey { owner, purpose, responder } = self {
2074 Some((owner, purpose, responder))
2075 } else {
2076 None
2077 }
2078 }
2079
2080 #[allow(irrefutable_let_patterns)]
2081 pub fn into_create_key_with_id(self) -> Option<(u64, [u8; 16], CryptCreateKeyWithIdResponder)> {
2082 if let CryptRequest::CreateKeyWithId { owner, wrapping_key_id, responder } = self {
2083 Some((owner, wrapping_key_id, responder))
2084 } else {
2085 None
2086 }
2087 }
2088
2089 #[allow(irrefutable_let_patterns)]
2090 pub fn into_unwrap_key(self) -> Option<([u8; 16], u64, Vec<u8>, CryptUnwrapKeyResponder)> {
2091 if let CryptRequest::UnwrapKey { wrapping_key_id, owner, key, responder } = self {
2092 Some((wrapping_key_id, owner, key, responder))
2093 } else {
2094 None
2095 }
2096 }
2097
2098 pub fn method_name(&self) -> &'static str {
2100 match *self {
2101 CryptRequest::CreateKey { .. } => "create_key",
2102 CryptRequest::CreateKeyWithId { .. } => "create_key_with_id",
2103 CryptRequest::UnwrapKey { .. } => "unwrap_key",
2104 }
2105 }
2106}
2107
2108#[derive(Debug, Clone)]
2109pub struct CryptControlHandle {
2110 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2111}
2112
2113impl fidl::endpoints::ControlHandle for CryptControlHandle {
2114 fn shutdown(&self) {
2115 self.inner.shutdown()
2116 }
2117 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2118 self.inner.shutdown_with_epitaph(status)
2119 }
2120
2121 fn is_closed(&self) -> bool {
2122 self.inner.channel().is_closed()
2123 }
2124 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2125 self.inner.channel().on_closed()
2126 }
2127
2128 #[cfg(target_os = "fuchsia")]
2129 fn signal_peer(
2130 &self,
2131 clear_mask: zx::Signals,
2132 set_mask: zx::Signals,
2133 ) -> Result<(), zx_status::Status> {
2134 use fidl::Peered;
2135 self.inner.channel().signal_peer(clear_mask, set_mask)
2136 }
2137}
2138
2139impl CryptControlHandle {}
2140
2141#[must_use = "FIDL methods require a response to be sent"]
2142#[derive(Debug)]
2143pub struct CryptCreateKeyResponder {
2144 control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
2145 tx_id: u32,
2146}
2147
2148impl std::ops::Drop for CryptCreateKeyResponder {
2152 fn drop(&mut self) {
2153 self.control_handle.shutdown();
2154 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2156 }
2157}
2158
2159impl fidl::endpoints::Responder for CryptCreateKeyResponder {
2160 type ControlHandle = CryptControlHandle;
2161
2162 fn control_handle(&self) -> &CryptControlHandle {
2163 &self.control_handle
2164 }
2165
2166 fn drop_without_shutdown(mut self) {
2167 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2169 std::mem::forget(self);
2171 }
2172}
2173
2174impl CryptCreateKeyResponder {
2175 pub fn send(
2179 self,
2180 mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
2181 ) -> Result<(), fidl::Error> {
2182 let _result = self.send_raw(result);
2183 if _result.is_err() {
2184 self.control_handle.shutdown();
2185 }
2186 self.drop_without_shutdown();
2187 _result
2188 }
2189
2190 pub fn send_no_shutdown_on_err(
2192 self,
2193 mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
2194 ) -> Result<(), fidl::Error> {
2195 let _result = self.send_raw(result);
2196 self.drop_without_shutdown();
2197 _result
2198 }
2199
2200 fn send_raw(
2201 &self,
2202 mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
2203 ) -> Result<(), fidl::Error> {
2204 self.control_handle.inner.send::<fidl::encoding::ResultType<CryptCreateKeyResponse, i32>>(
2205 result,
2206 self.tx_id,
2207 0x6ec69b3aee7fdbba,
2208 fidl::encoding::DynamicFlags::empty(),
2209 )
2210 }
2211}
2212
2213#[must_use = "FIDL methods require a response to be sent"]
2214#[derive(Debug)]
2215pub struct CryptCreateKeyWithIdResponder {
2216 control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
2217 tx_id: u32,
2218}
2219
2220impl std::ops::Drop for CryptCreateKeyWithIdResponder {
2224 fn drop(&mut self) {
2225 self.control_handle.shutdown();
2226 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2228 }
2229}
2230
2231impl fidl::endpoints::Responder for CryptCreateKeyWithIdResponder {
2232 type ControlHandle = CryptControlHandle;
2233
2234 fn control_handle(&self) -> &CryptControlHandle {
2235 &self.control_handle
2236 }
2237
2238 fn drop_without_shutdown(mut self) {
2239 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2241 std::mem::forget(self);
2243 }
2244}
2245
2246impl CryptCreateKeyWithIdResponder {
2247 pub fn send(self, mut result: Result<(&[u8], &[u8]), i32>) -> Result<(), fidl::Error> {
2251 let _result = self.send_raw(result);
2252 if _result.is_err() {
2253 self.control_handle.shutdown();
2254 }
2255 self.drop_without_shutdown();
2256 _result
2257 }
2258
2259 pub fn send_no_shutdown_on_err(
2261 self,
2262 mut result: Result<(&[u8], &[u8]), i32>,
2263 ) -> Result<(), fidl::Error> {
2264 let _result = self.send_raw(result);
2265 self.drop_without_shutdown();
2266 _result
2267 }
2268
2269 fn send_raw(&self, mut result: Result<(&[u8], &[u8]), i32>) -> Result<(), fidl::Error> {
2270 self.control_handle
2271 .inner
2272 .send::<fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>>(
2273 result,
2274 self.tx_id,
2275 0x21e8076688700b50,
2276 fidl::encoding::DynamicFlags::empty(),
2277 )
2278 }
2279}
2280
2281#[must_use = "FIDL methods require a response to be sent"]
2282#[derive(Debug)]
2283pub struct CryptUnwrapKeyResponder {
2284 control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
2285 tx_id: u32,
2286}
2287
2288impl std::ops::Drop for CryptUnwrapKeyResponder {
2292 fn drop(&mut self) {
2293 self.control_handle.shutdown();
2294 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2296 }
2297}
2298
2299impl fidl::endpoints::Responder for CryptUnwrapKeyResponder {
2300 type ControlHandle = CryptControlHandle;
2301
2302 fn control_handle(&self) -> &CryptControlHandle {
2303 &self.control_handle
2304 }
2305
2306 fn drop_without_shutdown(mut self) {
2307 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2309 std::mem::forget(self);
2311 }
2312}
2313
2314impl CryptUnwrapKeyResponder {
2315 pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2319 let _result = self.send_raw(result);
2320 if _result.is_err() {
2321 self.control_handle.shutdown();
2322 }
2323 self.drop_without_shutdown();
2324 _result
2325 }
2326
2327 pub fn send_no_shutdown_on_err(
2329 self,
2330 mut result: Result<&[u8], i32>,
2331 ) -> Result<(), fidl::Error> {
2332 let _result = self.send_raw(result);
2333 self.drop_without_shutdown();
2334 _result
2335 }
2336
2337 fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2338 self.control_handle.inner.send::<fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>>(
2339 result.map(|unwrapped_key| (unwrapped_key,)),
2340 self.tx_id,
2341 0x6ec34e2b64d46be9,
2342 fidl::encoding::DynamicFlags::empty(),
2343 )
2344 }
2345}
2346
2347#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2348pub struct CryptManagementMarker;
2349
2350impl fidl::endpoints::ProtocolMarker for CryptManagementMarker {
2351 type Proxy = CryptManagementProxy;
2352 type RequestStream = CryptManagementRequestStream;
2353 #[cfg(target_os = "fuchsia")]
2354 type SynchronousProxy = CryptManagementSynchronousProxy;
2355
2356 const DEBUG_NAME: &'static str = "fuchsia.fxfs.CryptManagement";
2357}
2358impl fidl::endpoints::DiscoverableProtocolMarker for CryptManagementMarker {}
2359pub type CryptManagementAddWrappingKeyResult = Result<(), i32>;
2360pub type CryptManagementSetActiveKeyResult = Result<(), i32>;
2361pub type CryptManagementForgetWrappingKeyResult = Result<(), i32>;
2362
2363pub trait CryptManagementProxyInterface: Send + Sync {
2364 type AddWrappingKeyResponseFut: std::future::Future<Output = Result<CryptManagementAddWrappingKeyResult, fidl::Error>>
2365 + Send;
2366 fn r#add_wrapping_key(
2367 &self,
2368 wrapping_key_id: &[u8; 16],
2369 key: &[u8],
2370 ) -> Self::AddWrappingKeyResponseFut;
2371 type SetActiveKeyResponseFut: std::future::Future<Output = Result<CryptManagementSetActiveKeyResult, fidl::Error>>
2372 + Send;
2373 fn r#set_active_key(
2374 &self,
2375 purpose: KeyPurpose,
2376 wrapping_key_id: &[u8; 16],
2377 ) -> Self::SetActiveKeyResponseFut;
2378 type ForgetWrappingKeyResponseFut: std::future::Future<Output = Result<CryptManagementForgetWrappingKeyResult, fidl::Error>>
2379 + Send;
2380 fn r#forget_wrapping_key(
2381 &self,
2382 wrapping_key_id: &[u8; 16],
2383 ) -> Self::ForgetWrappingKeyResponseFut;
2384}
2385#[derive(Debug)]
2386#[cfg(target_os = "fuchsia")]
2387pub struct CryptManagementSynchronousProxy {
2388 client: fidl::client::sync::Client,
2389}
2390
2391#[cfg(target_os = "fuchsia")]
2392impl fidl::endpoints::SynchronousProxy for CryptManagementSynchronousProxy {
2393 type Proxy = CryptManagementProxy;
2394 type Protocol = CryptManagementMarker;
2395
2396 fn from_channel(inner: fidl::Channel) -> Self {
2397 Self::new(inner)
2398 }
2399
2400 fn into_channel(self) -> fidl::Channel {
2401 self.client.into_channel()
2402 }
2403
2404 fn as_channel(&self) -> &fidl::Channel {
2405 self.client.as_channel()
2406 }
2407}
2408
2409#[cfg(target_os = "fuchsia")]
2410impl CryptManagementSynchronousProxy {
2411 pub fn new(channel: fidl::Channel) -> Self {
2412 let protocol_name = <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2413 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2414 }
2415
2416 pub fn into_channel(self) -> fidl::Channel {
2417 self.client.into_channel()
2418 }
2419
2420 pub fn wait_for_event(
2423 &self,
2424 deadline: zx::MonotonicInstant,
2425 ) -> Result<CryptManagementEvent, fidl::Error> {
2426 CryptManagementEvent::decode(self.client.wait_for_event(deadline)?)
2427 }
2428
2429 pub fn r#add_wrapping_key(
2433 &self,
2434 mut wrapping_key_id: &[u8; 16],
2435 mut key: &[u8],
2436 ___deadline: zx::MonotonicInstant,
2437 ) -> Result<CryptManagementAddWrappingKeyResult, fidl::Error> {
2438 let _response = self.client.send_query::<
2439 CryptManagementAddWrappingKeyRequest,
2440 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2441 >(
2442 (wrapping_key_id, key,),
2443 0x59a5076762318bf,
2444 fidl::encoding::DynamicFlags::empty(),
2445 ___deadline,
2446 )?;
2447 Ok(_response.map(|x| x))
2448 }
2449
2450 pub fn r#set_active_key(
2453 &self,
2454 mut purpose: KeyPurpose,
2455 mut wrapping_key_id: &[u8; 16],
2456 ___deadline: zx::MonotonicInstant,
2457 ) -> Result<CryptManagementSetActiveKeyResult, fidl::Error> {
2458 let _response = self.client.send_query::<
2459 CryptManagementSetActiveKeyRequest,
2460 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2461 >(
2462 (purpose, wrapping_key_id,),
2463 0x5e81d600442f2872,
2464 fidl::encoding::DynamicFlags::empty(),
2465 ___deadline,
2466 )?;
2467 Ok(_response.map(|x| x))
2468 }
2469
2470 pub fn r#forget_wrapping_key(
2474 &self,
2475 mut wrapping_key_id: &[u8; 16],
2476 ___deadline: zx::MonotonicInstant,
2477 ) -> Result<CryptManagementForgetWrappingKeyResult, fidl::Error> {
2478 let _response = self.client.send_query::<
2479 CryptManagementForgetWrappingKeyRequest,
2480 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2481 >(
2482 (wrapping_key_id,),
2483 0x436d6d27696dfcf4,
2484 fidl::encoding::DynamicFlags::empty(),
2485 ___deadline,
2486 )?;
2487 Ok(_response.map(|x| x))
2488 }
2489}
2490
2491#[derive(Debug, Clone)]
2492pub struct CryptManagementProxy {
2493 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2494}
2495
2496impl fidl::endpoints::Proxy for CryptManagementProxy {
2497 type Protocol = CryptManagementMarker;
2498
2499 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2500 Self::new(inner)
2501 }
2502
2503 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2504 self.client.into_channel().map_err(|client| Self { client })
2505 }
2506
2507 fn as_channel(&self) -> &::fidl::AsyncChannel {
2508 self.client.as_channel()
2509 }
2510}
2511
2512impl CryptManagementProxy {
2513 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2515 let protocol_name = <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2516 Self { client: fidl::client::Client::new(channel, protocol_name) }
2517 }
2518
2519 pub fn take_event_stream(&self) -> CryptManagementEventStream {
2525 CryptManagementEventStream { event_receiver: self.client.take_event_receiver() }
2526 }
2527
2528 pub fn r#add_wrapping_key(
2532 &self,
2533 mut wrapping_key_id: &[u8; 16],
2534 mut key: &[u8],
2535 ) -> fidl::client::QueryResponseFut<
2536 CryptManagementAddWrappingKeyResult,
2537 fidl::encoding::DefaultFuchsiaResourceDialect,
2538 > {
2539 CryptManagementProxyInterface::r#add_wrapping_key(self, wrapping_key_id, key)
2540 }
2541
2542 pub fn r#set_active_key(
2545 &self,
2546 mut purpose: KeyPurpose,
2547 mut wrapping_key_id: &[u8; 16],
2548 ) -> fidl::client::QueryResponseFut<
2549 CryptManagementSetActiveKeyResult,
2550 fidl::encoding::DefaultFuchsiaResourceDialect,
2551 > {
2552 CryptManagementProxyInterface::r#set_active_key(self, purpose, wrapping_key_id)
2553 }
2554
2555 pub fn r#forget_wrapping_key(
2559 &self,
2560 mut wrapping_key_id: &[u8; 16],
2561 ) -> fidl::client::QueryResponseFut<
2562 CryptManagementForgetWrappingKeyResult,
2563 fidl::encoding::DefaultFuchsiaResourceDialect,
2564 > {
2565 CryptManagementProxyInterface::r#forget_wrapping_key(self, wrapping_key_id)
2566 }
2567}
2568
2569impl CryptManagementProxyInterface for CryptManagementProxy {
2570 type AddWrappingKeyResponseFut = fidl::client::QueryResponseFut<
2571 CryptManagementAddWrappingKeyResult,
2572 fidl::encoding::DefaultFuchsiaResourceDialect,
2573 >;
2574 fn r#add_wrapping_key(
2575 &self,
2576 mut wrapping_key_id: &[u8; 16],
2577 mut key: &[u8],
2578 ) -> Self::AddWrappingKeyResponseFut {
2579 fn _decode(
2580 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2581 ) -> Result<CryptManagementAddWrappingKeyResult, fidl::Error> {
2582 let _response = fidl::client::decode_transaction_body::<
2583 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2584 fidl::encoding::DefaultFuchsiaResourceDialect,
2585 0x59a5076762318bf,
2586 >(_buf?)?;
2587 Ok(_response.map(|x| x))
2588 }
2589 self.client.send_query_and_decode::<
2590 CryptManagementAddWrappingKeyRequest,
2591 CryptManagementAddWrappingKeyResult,
2592 >(
2593 (wrapping_key_id, key,),
2594 0x59a5076762318bf,
2595 fidl::encoding::DynamicFlags::empty(),
2596 _decode,
2597 )
2598 }
2599
2600 type SetActiveKeyResponseFut = fidl::client::QueryResponseFut<
2601 CryptManagementSetActiveKeyResult,
2602 fidl::encoding::DefaultFuchsiaResourceDialect,
2603 >;
2604 fn r#set_active_key(
2605 &self,
2606 mut purpose: KeyPurpose,
2607 mut wrapping_key_id: &[u8; 16],
2608 ) -> Self::SetActiveKeyResponseFut {
2609 fn _decode(
2610 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2611 ) -> Result<CryptManagementSetActiveKeyResult, fidl::Error> {
2612 let _response = fidl::client::decode_transaction_body::<
2613 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2614 fidl::encoding::DefaultFuchsiaResourceDialect,
2615 0x5e81d600442f2872,
2616 >(_buf?)?;
2617 Ok(_response.map(|x| x))
2618 }
2619 self.client.send_query_and_decode::<
2620 CryptManagementSetActiveKeyRequest,
2621 CryptManagementSetActiveKeyResult,
2622 >(
2623 (purpose, wrapping_key_id,),
2624 0x5e81d600442f2872,
2625 fidl::encoding::DynamicFlags::empty(),
2626 _decode,
2627 )
2628 }
2629
2630 type ForgetWrappingKeyResponseFut = fidl::client::QueryResponseFut<
2631 CryptManagementForgetWrappingKeyResult,
2632 fidl::encoding::DefaultFuchsiaResourceDialect,
2633 >;
2634 fn r#forget_wrapping_key(
2635 &self,
2636 mut wrapping_key_id: &[u8; 16],
2637 ) -> Self::ForgetWrappingKeyResponseFut {
2638 fn _decode(
2639 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2640 ) -> Result<CryptManagementForgetWrappingKeyResult, fidl::Error> {
2641 let _response = fidl::client::decode_transaction_body::<
2642 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2643 fidl::encoding::DefaultFuchsiaResourceDialect,
2644 0x436d6d27696dfcf4,
2645 >(_buf?)?;
2646 Ok(_response.map(|x| x))
2647 }
2648 self.client.send_query_and_decode::<
2649 CryptManagementForgetWrappingKeyRequest,
2650 CryptManagementForgetWrappingKeyResult,
2651 >(
2652 (wrapping_key_id,),
2653 0x436d6d27696dfcf4,
2654 fidl::encoding::DynamicFlags::empty(),
2655 _decode,
2656 )
2657 }
2658}
2659
2660pub struct CryptManagementEventStream {
2661 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2662}
2663
2664impl std::marker::Unpin for CryptManagementEventStream {}
2665
2666impl futures::stream::FusedStream for CryptManagementEventStream {
2667 fn is_terminated(&self) -> bool {
2668 self.event_receiver.is_terminated()
2669 }
2670}
2671
2672impl futures::Stream for CryptManagementEventStream {
2673 type Item = Result<CryptManagementEvent, fidl::Error>;
2674
2675 fn poll_next(
2676 mut self: std::pin::Pin<&mut Self>,
2677 cx: &mut std::task::Context<'_>,
2678 ) -> std::task::Poll<Option<Self::Item>> {
2679 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2680 &mut self.event_receiver,
2681 cx
2682 )?) {
2683 Some(buf) => std::task::Poll::Ready(Some(CryptManagementEvent::decode(buf))),
2684 None => std::task::Poll::Ready(None),
2685 }
2686 }
2687}
2688
2689#[derive(Debug)]
2690pub enum CryptManagementEvent {}
2691
2692impl CryptManagementEvent {
2693 fn decode(
2695 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2696 ) -> Result<CryptManagementEvent, fidl::Error> {
2697 let (bytes, _handles) = buf.split_mut();
2698 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2699 debug_assert_eq!(tx_header.tx_id, 0);
2700 match tx_header.ordinal {
2701 _ => Err(fidl::Error::UnknownOrdinal {
2702 ordinal: tx_header.ordinal,
2703 protocol_name:
2704 <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2705 }),
2706 }
2707 }
2708}
2709
2710pub struct CryptManagementRequestStream {
2712 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2713 is_terminated: bool,
2714}
2715
2716impl std::marker::Unpin for CryptManagementRequestStream {}
2717
2718impl futures::stream::FusedStream for CryptManagementRequestStream {
2719 fn is_terminated(&self) -> bool {
2720 self.is_terminated
2721 }
2722}
2723
2724impl fidl::endpoints::RequestStream for CryptManagementRequestStream {
2725 type Protocol = CryptManagementMarker;
2726 type ControlHandle = CryptManagementControlHandle;
2727
2728 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2729 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2730 }
2731
2732 fn control_handle(&self) -> Self::ControlHandle {
2733 CryptManagementControlHandle { inner: self.inner.clone() }
2734 }
2735
2736 fn into_inner(
2737 self,
2738 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2739 {
2740 (self.inner, self.is_terminated)
2741 }
2742
2743 fn from_inner(
2744 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2745 is_terminated: bool,
2746 ) -> Self {
2747 Self { inner, is_terminated }
2748 }
2749}
2750
2751impl futures::Stream for CryptManagementRequestStream {
2752 type Item = Result<CryptManagementRequest, fidl::Error>;
2753
2754 fn poll_next(
2755 mut self: std::pin::Pin<&mut Self>,
2756 cx: &mut std::task::Context<'_>,
2757 ) -> std::task::Poll<Option<Self::Item>> {
2758 let this = &mut *self;
2759 if this.inner.check_shutdown(cx) {
2760 this.is_terminated = true;
2761 return std::task::Poll::Ready(None);
2762 }
2763 if this.is_terminated {
2764 panic!("polled CryptManagementRequestStream after completion");
2765 }
2766 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2767 |bytes, handles| {
2768 match this.inner.channel().read_etc(cx, bytes, handles) {
2769 std::task::Poll::Ready(Ok(())) => {}
2770 std::task::Poll::Pending => return std::task::Poll::Pending,
2771 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2772 this.is_terminated = true;
2773 return std::task::Poll::Ready(None);
2774 }
2775 std::task::Poll::Ready(Err(e)) => {
2776 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2777 e.into(),
2778 ))))
2779 }
2780 }
2781
2782 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2784
2785 std::task::Poll::Ready(Some(match header.ordinal {
2786 0x59a5076762318bf => {
2787 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2788 let mut req = fidl::new_empty!(
2789 CryptManagementAddWrappingKeyRequest,
2790 fidl::encoding::DefaultFuchsiaResourceDialect
2791 );
2792 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementAddWrappingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2793 let control_handle =
2794 CryptManagementControlHandle { inner: this.inner.clone() };
2795 Ok(CryptManagementRequest::AddWrappingKey {
2796 wrapping_key_id: req.wrapping_key_id,
2797 key: req.key,
2798
2799 responder: CryptManagementAddWrappingKeyResponder {
2800 control_handle: std::mem::ManuallyDrop::new(control_handle),
2801 tx_id: header.tx_id,
2802 },
2803 })
2804 }
2805 0x5e81d600442f2872 => {
2806 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2807 let mut req = fidl::new_empty!(
2808 CryptManagementSetActiveKeyRequest,
2809 fidl::encoding::DefaultFuchsiaResourceDialect
2810 );
2811 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementSetActiveKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2812 let control_handle =
2813 CryptManagementControlHandle { inner: this.inner.clone() };
2814 Ok(CryptManagementRequest::SetActiveKey {
2815 purpose: req.purpose,
2816 wrapping_key_id: req.wrapping_key_id,
2817
2818 responder: CryptManagementSetActiveKeyResponder {
2819 control_handle: std::mem::ManuallyDrop::new(control_handle),
2820 tx_id: header.tx_id,
2821 },
2822 })
2823 }
2824 0x436d6d27696dfcf4 => {
2825 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2826 let mut req = fidl::new_empty!(
2827 CryptManagementForgetWrappingKeyRequest,
2828 fidl::encoding::DefaultFuchsiaResourceDialect
2829 );
2830 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementForgetWrappingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2831 let control_handle =
2832 CryptManagementControlHandle { inner: this.inner.clone() };
2833 Ok(CryptManagementRequest::ForgetWrappingKey {
2834 wrapping_key_id: req.wrapping_key_id,
2835
2836 responder: CryptManagementForgetWrappingKeyResponder {
2837 control_handle: std::mem::ManuallyDrop::new(control_handle),
2838 tx_id: header.tx_id,
2839 },
2840 })
2841 }
2842 _ => Err(fidl::Error::UnknownOrdinal {
2843 ordinal: header.ordinal,
2844 protocol_name:
2845 <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2846 }),
2847 }))
2848 },
2849 )
2850 }
2851}
2852
2853#[derive(Debug)]
2854pub enum CryptManagementRequest {
2855 AddWrappingKey {
2859 wrapping_key_id: [u8; 16],
2860 key: Vec<u8>,
2861 responder: CryptManagementAddWrappingKeyResponder,
2862 },
2863 SetActiveKey {
2866 purpose: KeyPurpose,
2867 wrapping_key_id: [u8; 16],
2868 responder: CryptManagementSetActiveKeyResponder,
2869 },
2870 ForgetWrappingKey {
2874 wrapping_key_id: [u8; 16],
2875 responder: CryptManagementForgetWrappingKeyResponder,
2876 },
2877}
2878
2879impl CryptManagementRequest {
2880 #[allow(irrefutable_let_patterns)]
2881 pub fn into_add_wrapping_key(
2882 self,
2883 ) -> Option<([u8; 16], Vec<u8>, CryptManagementAddWrappingKeyResponder)> {
2884 if let CryptManagementRequest::AddWrappingKey { wrapping_key_id, key, responder } = self {
2885 Some((wrapping_key_id, key, responder))
2886 } else {
2887 None
2888 }
2889 }
2890
2891 #[allow(irrefutable_let_patterns)]
2892 pub fn into_set_active_key(
2893 self,
2894 ) -> Option<(KeyPurpose, [u8; 16], CryptManagementSetActiveKeyResponder)> {
2895 if let CryptManagementRequest::SetActiveKey { purpose, wrapping_key_id, responder } = self {
2896 Some((purpose, wrapping_key_id, responder))
2897 } else {
2898 None
2899 }
2900 }
2901
2902 #[allow(irrefutable_let_patterns)]
2903 pub fn into_forget_wrapping_key(
2904 self,
2905 ) -> Option<([u8; 16], CryptManagementForgetWrappingKeyResponder)> {
2906 if let CryptManagementRequest::ForgetWrappingKey { wrapping_key_id, responder } = self {
2907 Some((wrapping_key_id, responder))
2908 } else {
2909 None
2910 }
2911 }
2912
2913 pub fn method_name(&self) -> &'static str {
2915 match *self {
2916 CryptManagementRequest::AddWrappingKey { .. } => "add_wrapping_key",
2917 CryptManagementRequest::SetActiveKey { .. } => "set_active_key",
2918 CryptManagementRequest::ForgetWrappingKey { .. } => "forget_wrapping_key",
2919 }
2920 }
2921}
2922
2923#[derive(Debug, Clone)]
2924pub struct CryptManagementControlHandle {
2925 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2926}
2927
2928impl fidl::endpoints::ControlHandle for CryptManagementControlHandle {
2929 fn shutdown(&self) {
2930 self.inner.shutdown()
2931 }
2932 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2933 self.inner.shutdown_with_epitaph(status)
2934 }
2935
2936 fn is_closed(&self) -> bool {
2937 self.inner.channel().is_closed()
2938 }
2939 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2940 self.inner.channel().on_closed()
2941 }
2942
2943 #[cfg(target_os = "fuchsia")]
2944 fn signal_peer(
2945 &self,
2946 clear_mask: zx::Signals,
2947 set_mask: zx::Signals,
2948 ) -> Result<(), zx_status::Status> {
2949 use fidl::Peered;
2950 self.inner.channel().signal_peer(clear_mask, set_mask)
2951 }
2952}
2953
2954impl CryptManagementControlHandle {}
2955
2956#[must_use = "FIDL methods require a response to be sent"]
2957#[derive(Debug)]
2958pub struct CryptManagementAddWrappingKeyResponder {
2959 control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
2960 tx_id: u32,
2961}
2962
2963impl std::ops::Drop for CryptManagementAddWrappingKeyResponder {
2967 fn drop(&mut self) {
2968 self.control_handle.shutdown();
2969 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2971 }
2972}
2973
2974impl fidl::endpoints::Responder for CryptManagementAddWrappingKeyResponder {
2975 type ControlHandle = CryptManagementControlHandle;
2976
2977 fn control_handle(&self) -> &CryptManagementControlHandle {
2978 &self.control_handle
2979 }
2980
2981 fn drop_without_shutdown(mut self) {
2982 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2984 std::mem::forget(self);
2986 }
2987}
2988
2989impl CryptManagementAddWrappingKeyResponder {
2990 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2994 let _result = self.send_raw(result);
2995 if _result.is_err() {
2996 self.control_handle.shutdown();
2997 }
2998 self.drop_without_shutdown();
2999 _result
3000 }
3001
3002 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3004 let _result = self.send_raw(result);
3005 self.drop_without_shutdown();
3006 _result
3007 }
3008
3009 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3010 self.control_handle
3011 .inner
3012 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3013 result,
3014 self.tx_id,
3015 0x59a5076762318bf,
3016 fidl::encoding::DynamicFlags::empty(),
3017 )
3018 }
3019}
3020
3021#[must_use = "FIDL methods require a response to be sent"]
3022#[derive(Debug)]
3023pub struct CryptManagementSetActiveKeyResponder {
3024 control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
3025 tx_id: u32,
3026}
3027
3028impl std::ops::Drop for CryptManagementSetActiveKeyResponder {
3032 fn drop(&mut self) {
3033 self.control_handle.shutdown();
3034 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3036 }
3037}
3038
3039impl fidl::endpoints::Responder for CryptManagementSetActiveKeyResponder {
3040 type ControlHandle = CryptManagementControlHandle;
3041
3042 fn control_handle(&self) -> &CryptManagementControlHandle {
3043 &self.control_handle
3044 }
3045
3046 fn drop_without_shutdown(mut self) {
3047 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3049 std::mem::forget(self);
3051 }
3052}
3053
3054impl CryptManagementSetActiveKeyResponder {
3055 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3059 let _result = self.send_raw(result);
3060 if _result.is_err() {
3061 self.control_handle.shutdown();
3062 }
3063 self.drop_without_shutdown();
3064 _result
3065 }
3066
3067 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3069 let _result = self.send_raw(result);
3070 self.drop_without_shutdown();
3071 _result
3072 }
3073
3074 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3075 self.control_handle
3076 .inner
3077 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3078 result,
3079 self.tx_id,
3080 0x5e81d600442f2872,
3081 fidl::encoding::DynamicFlags::empty(),
3082 )
3083 }
3084}
3085
3086#[must_use = "FIDL methods require a response to be sent"]
3087#[derive(Debug)]
3088pub struct CryptManagementForgetWrappingKeyResponder {
3089 control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
3090 tx_id: u32,
3091}
3092
3093impl std::ops::Drop for CryptManagementForgetWrappingKeyResponder {
3097 fn drop(&mut self) {
3098 self.control_handle.shutdown();
3099 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3101 }
3102}
3103
3104impl fidl::endpoints::Responder for CryptManagementForgetWrappingKeyResponder {
3105 type ControlHandle = CryptManagementControlHandle;
3106
3107 fn control_handle(&self) -> &CryptManagementControlHandle {
3108 &self.control_handle
3109 }
3110
3111 fn drop_without_shutdown(mut self) {
3112 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3114 std::mem::forget(self);
3116 }
3117}
3118
3119impl CryptManagementForgetWrappingKeyResponder {
3120 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3124 let _result = self.send_raw(result);
3125 if _result.is_err() {
3126 self.control_handle.shutdown();
3127 }
3128 self.drop_without_shutdown();
3129 _result
3130 }
3131
3132 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3134 let _result = self.send_raw(result);
3135 self.drop_without_shutdown();
3136 _result
3137 }
3138
3139 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3140 self.control_handle
3141 .inner
3142 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3143 result,
3144 self.tx_id,
3145 0x436d6d27696dfcf4,
3146 fidl::encoding::DynamicFlags::empty(),
3147 )
3148 }
3149}
3150
3151#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3152pub struct DebugMarker;
3153
3154impl fidl::endpoints::ProtocolMarker for DebugMarker {
3155 type Proxy = DebugProxy;
3156 type RequestStream = DebugRequestStream;
3157 #[cfg(target_os = "fuchsia")]
3158 type SynchronousProxy = DebugSynchronousProxy;
3159
3160 const DEBUG_NAME: &'static str = "fuchsia.fxfs.Debug";
3161}
3162impl fidl::endpoints::DiscoverableProtocolMarker for DebugMarker {}
3163pub type DebugCompactResult = Result<(), i32>;
3164pub type DebugDeleteProfileResult = Result<(), i32>;
3165pub type DebugStopProfileTasksResult = Result<(), i32>;
3166
3167pub trait DebugProxyInterface: Send + Sync {
3168 type CompactResponseFut: std::future::Future<Output = Result<DebugCompactResult, fidl::Error>>
3169 + Send;
3170 fn r#compact(&self) -> Self::CompactResponseFut;
3171 type DeleteProfileResponseFut: std::future::Future<Output = Result<DebugDeleteProfileResult, fidl::Error>>
3172 + Send;
3173 fn r#delete_profile(&self, volume: &str, profile: &str) -> Self::DeleteProfileResponseFut;
3174 type StopProfileTasksResponseFut: std::future::Future<Output = Result<DebugStopProfileTasksResult, fidl::Error>>
3175 + Send;
3176 fn r#stop_profile_tasks(&self) -> Self::StopProfileTasksResponseFut;
3177}
3178#[derive(Debug)]
3179#[cfg(target_os = "fuchsia")]
3180pub struct DebugSynchronousProxy {
3181 client: fidl::client::sync::Client,
3182}
3183
3184#[cfg(target_os = "fuchsia")]
3185impl fidl::endpoints::SynchronousProxy for DebugSynchronousProxy {
3186 type Proxy = DebugProxy;
3187 type Protocol = DebugMarker;
3188
3189 fn from_channel(inner: fidl::Channel) -> Self {
3190 Self::new(inner)
3191 }
3192
3193 fn into_channel(self) -> fidl::Channel {
3194 self.client.into_channel()
3195 }
3196
3197 fn as_channel(&self) -> &fidl::Channel {
3198 self.client.as_channel()
3199 }
3200}
3201
3202#[cfg(target_os = "fuchsia")]
3203impl DebugSynchronousProxy {
3204 pub fn new(channel: fidl::Channel) -> Self {
3205 let protocol_name = <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3206 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3207 }
3208
3209 pub fn into_channel(self) -> fidl::Channel {
3210 self.client.into_channel()
3211 }
3212
3213 pub fn wait_for_event(
3216 &self,
3217 deadline: zx::MonotonicInstant,
3218 ) -> Result<DebugEvent, fidl::Error> {
3219 DebugEvent::decode(self.client.wait_for_event(deadline)?)
3220 }
3221
3222 pub fn r#compact(
3224 &self,
3225 ___deadline: zx::MonotonicInstant,
3226 ) -> Result<DebugCompactResult, fidl::Error> {
3227 let _response = self.client.send_query::<
3228 fidl::encoding::EmptyPayload,
3229 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3230 >(
3231 (),
3232 0x6553eb197306e489,
3233 fidl::encoding::DynamicFlags::empty(),
3234 ___deadline,
3235 )?;
3236 Ok(_response.map(|x| x))
3237 }
3238
3239 pub fn r#delete_profile(
3242 &self,
3243 mut volume: &str,
3244 mut profile: &str,
3245 ___deadline: zx::MonotonicInstant,
3246 ) -> Result<DebugDeleteProfileResult, fidl::Error> {
3247 let _response = self.client.send_query::<
3248 DebugDeleteProfileRequest,
3249 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3250 >(
3251 (volume, profile,),
3252 0x54d9d4c9cf300a1e,
3253 fidl::encoding::DynamicFlags::empty(),
3254 ___deadline,
3255 )?;
3256 Ok(_response.map(|x| x))
3257 }
3258
3259 pub fn r#stop_profile_tasks(
3262 &self,
3263 ___deadline: zx::MonotonicInstant,
3264 ) -> Result<DebugStopProfileTasksResult, fidl::Error> {
3265 let _response = self.client.send_query::<
3266 fidl::encoding::EmptyPayload,
3267 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3268 >(
3269 (),
3270 0x1657b945dd629177,
3271 fidl::encoding::DynamicFlags::empty(),
3272 ___deadline,
3273 )?;
3274 Ok(_response.map(|x| x))
3275 }
3276}
3277
3278#[derive(Debug, Clone)]
3279pub struct DebugProxy {
3280 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3281}
3282
3283impl fidl::endpoints::Proxy for DebugProxy {
3284 type Protocol = DebugMarker;
3285
3286 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3287 Self::new(inner)
3288 }
3289
3290 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3291 self.client.into_channel().map_err(|client| Self { client })
3292 }
3293
3294 fn as_channel(&self) -> &::fidl::AsyncChannel {
3295 self.client.as_channel()
3296 }
3297}
3298
3299impl DebugProxy {
3300 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3302 let protocol_name = <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3303 Self { client: fidl::client::Client::new(channel, protocol_name) }
3304 }
3305
3306 pub fn take_event_stream(&self) -> DebugEventStream {
3312 DebugEventStream { event_receiver: self.client.take_event_receiver() }
3313 }
3314
3315 pub fn r#compact(
3317 &self,
3318 ) -> fidl::client::QueryResponseFut<
3319 DebugCompactResult,
3320 fidl::encoding::DefaultFuchsiaResourceDialect,
3321 > {
3322 DebugProxyInterface::r#compact(self)
3323 }
3324
3325 pub fn r#delete_profile(
3328 &self,
3329 mut volume: &str,
3330 mut profile: &str,
3331 ) -> fidl::client::QueryResponseFut<
3332 DebugDeleteProfileResult,
3333 fidl::encoding::DefaultFuchsiaResourceDialect,
3334 > {
3335 DebugProxyInterface::r#delete_profile(self, volume, profile)
3336 }
3337
3338 pub fn r#stop_profile_tasks(
3341 &self,
3342 ) -> fidl::client::QueryResponseFut<
3343 DebugStopProfileTasksResult,
3344 fidl::encoding::DefaultFuchsiaResourceDialect,
3345 > {
3346 DebugProxyInterface::r#stop_profile_tasks(self)
3347 }
3348}
3349
3350impl DebugProxyInterface for DebugProxy {
3351 type CompactResponseFut = fidl::client::QueryResponseFut<
3352 DebugCompactResult,
3353 fidl::encoding::DefaultFuchsiaResourceDialect,
3354 >;
3355 fn r#compact(&self) -> Self::CompactResponseFut {
3356 fn _decode(
3357 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3358 ) -> Result<DebugCompactResult, fidl::Error> {
3359 let _response = fidl::client::decode_transaction_body::<
3360 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3361 fidl::encoding::DefaultFuchsiaResourceDialect,
3362 0x6553eb197306e489,
3363 >(_buf?)?;
3364 Ok(_response.map(|x| x))
3365 }
3366 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DebugCompactResult>(
3367 (),
3368 0x6553eb197306e489,
3369 fidl::encoding::DynamicFlags::empty(),
3370 _decode,
3371 )
3372 }
3373
3374 type DeleteProfileResponseFut = fidl::client::QueryResponseFut<
3375 DebugDeleteProfileResult,
3376 fidl::encoding::DefaultFuchsiaResourceDialect,
3377 >;
3378 fn r#delete_profile(
3379 &self,
3380 mut volume: &str,
3381 mut profile: &str,
3382 ) -> Self::DeleteProfileResponseFut {
3383 fn _decode(
3384 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3385 ) -> Result<DebugDeleteProfileResult, fidl::Error> {
3386 let _response = fidl::client::decode_transaction_body::<
3387 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3388 fidl::encoding::DefaultFuchsiaResourceDialect,
3389 0x54d9d4c9cf300a1e,
3390 >(_buf?)?;
3391 Ok(_response.map(|x| x))
3392 }
3393 self.client.send_query_and_decode::<DebugDeleteProfileRequest, DebugDeleteProfileResult>(
3394 (volume, profile),
3395 0x54d9d4c9cf300a1e,
3396 fidl::encoding::DynamicFlags::empty(),
3397 _decode,
3398 )
3399 }
3400
3401 type StopProfileTasksResponseFut = fidl::client::QueryResponseFut<
3402 DebugStopProfileTasksResult,
3403 fidl::encoding::DefaultFuchsiaResourceDialect,
3404 >;
3405 fn r#stop_profile_tasks(&self) -> Self::StopProfileTasksResponseFut {
3406 fn _decode(
3407 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3408 ) -> Result<DebugStopProfileTasksResult, fidl::Error> {
3409 let _response = fidl::client::decode_transaction_body::<
3410 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3411 fidl::encoding::DefaultFuchsiaResourceDialect,
3412 0x1657b945dd629177,
3413 >(_buf?)?;
3414 Ok(_response.map(|x| x))
3415 }
3416 self.client
3417 .send_query_and_decode::<fidl::encoding::EmptyPayload, DebugStopProfileTasksResult>(
3418 (),
3419 0x1657b945dd629177,
3420 fidl::encoding::DynamicFlags::empty(),
3421 _decode,
3422 )
3423 }
3424}
3425
3426pub struct DebugEventStream {
3427 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3428}
3429
3430impl std::marker::Unpin for DebugEventStream {}
3431
3432impl futures::stream::FusedStream for DebugEventStream {
3433 fn is_terminated(&self) -> bool {
3434 self.event_receiver.is_terminated()
3435 }
3436}
3437
3438impl futures::Stream for DebugEventStream {
3439 type Item = Result<DebugEvent, fidl::Error>;
3440
3441 fn poll_next(
3442 mut self: std::pin::Pin<&mut Self>,
3443 cx: &mut std::task::Context<'_>,
3444 ) -> std::task::Poll<Option<Self::Item>> {
3445 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3446 &mut self.event_receiver,
3447 cx
3448 )?) {
3449 Some(buf) => std::task::Poll::Ready(Some(DebugEvent::decode(buf))),
3450 None => std::task::Poll::Ready(None),
3451 }
3452 }
3453}
3454
3455#[derive(Debug)]
3456pub enum DebugEvent {}
3457
3458impl DebugEvent {
3459 fn decode(
3461 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3462 ) -> Result<DebugEvent, fidl::Error> {
3463 let (bytes, _handles) = buf.split_mut();
3464 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3465 debug_assert_eq!(tx_header.tx_id, 0);
3466 match tx_header.ordinal {
3467 _ => Err(fidl::Error::UnknownOrdinal {
3468 ordinal: tx_header.ordinal,
3469 protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3470 }),
3471 }
3472 }
3473}
3474
3475pub struct DebugRequestStream {
3477 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3478 is_terminated: bool,
3479}
3480
3481impl std::marker::Unpin for DebugRequestStream {}
3482
3483impl futures::stream::FusedStream for DebugRequestStream {
3484 fn is_terminated(&self) -> bool {
3485 self.is_terminated
3486 }
3487}
3488
3489impl fidl::endpoints::RequestStream for DebugRequestStream {
3490 type Protocol = DebugMarker;
3491 type ControlHandle = DebugControlHandle;
3492
3493 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3494 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3495 }
3496
3497 fn control_handle(&self) -> Self::ControlHandle {
3498 DebugControlHandle { inner: self.inner.clone() }
3499 }
3500
3501 fn into_inner(
3502 self,
3503 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3504 {
3505 (self.inner, self.is_terminated)
3506 }
3507
3508 fn from_inner(
3509 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3510 is_terminated: bool,
3511 ) -> Self {
3512 Self { inner, is_terminated }
3513 }
3514}
3515
3516impl futures::Stream for DebugRequestStream {
3517 type Item = Result<DebugRequest, fidl::Error>;
3518
3519 fn poll_next(
3520 mut self: std::pin::Pin<&mut Self>,
3521 cx: &mut std::task::Context<'_>,
3522 ) -> std::task::Poll<Option<Self::Item>> {
3523 let this = &mut *self;
3524 if this.inner.check_shutdown(cx) {
3525 this.is_terminated = true;
3526 return std::task::Poll::Ready(None);
3527 }
3528 if this.is_terminated {
3529 panic!("polled DebugRequestStream after completion");
3530 }
3531 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3532 |bytes, handles| {
3533 match this.inner.channel().read_etc(cx, bytes, handles) {
3534 std::task::Poll::Ready(Ok(())) => {}
3535 std::task::Poll::Pending => return std::task::Poll::Pending,
3536 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3537 this.is_terminated = true;
3538 return std::task::Poll::Ready(None);
3539 }
3540 std::task::Poll::Ready(Err(e)) => {
3541 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3542 e.into(),
3543 ))))
3544 }
3545 }
3546
3547 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3549
3550 std::task::Poll::Ready(Some(match header.ordinal {
3551 0x6553eb197306e489 => {
3552 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3553 let mut req = fidl::new_empty!(
3554 fidl::encoding::EmptyPayload,
3555 fidl::encoding::DefaultFuchsiaResourceDialect
3556 );
3557 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3558 let control_handle = DebugControlHandle { inner: this.inner.clone() };
3559 Ok(DebugRequest::Compact {
3560 responder: DebugCompactResponder {
3561 control_handle: std::mem::ManuallyDrop::new(control_handle),
3562 tx_id: header.tx_id,
3563 },
3564 })
3565 }
3566 0x54d9d4c9cf300a1e => {
3567 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3568 let mut req = fidl::new_empty!(
3569 DebugDeleteProfileRequest,
3570 fidl::encoding::DefaultFuchsiaResourceDialect
3571 );
3572 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugDeleteProfileRequest>(&header, _body_bytes, handles, &mut req)?;
3573 let control_handle = DebugControlHandle { inner: this.inner.clone() };
3574 Ok(DebugRequest::DeleteProfile {
3575 volume: req.volume,
3576 profile: req.profile,
3577
3578 responder: DebugDeleteProfileResponder {
3579 control_handle: std::mem::ManuallyDrop::new(control_handle),
3580 tx_id: header.tx_id,
3581 },
3582 })
3583 }
3584 0x1657b945dd629177 => {
3585 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3586 let mut req = fidl::new_empty!(
3587 fidl::encoding::EmptyPayload,
3588 fidl::encoding::DefaultFuchsiaResourceDialect
3589 );
3590 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3591 let control_handle = DebugControlHandle { inner: this.inner.clone() };
3592 Ok(DebugRequest::StopProfileTasks {
3593 responder: DebugStopProfileTasksResponder {
3594 control_handle: std::mem::ManuallyDrop::new(control_handle),
3595 tx_id: header.tx_id,
3596 },
3597 })
3598 }
3599 _ => Err(fidl::Error::UnknownOrdinal {
3600 ordinal: header.ordinal,
3601 protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3602 }),
3603 }))
3604 },
3605 )
3606 }
3607}
3608
3609#[derive(Debug)]
3612pub enum DebugRequest {
3613 Compact { responder: DebugCompactResponder },
3615 DeleteProfile { volume: String, profile: String, responder: DebugDeleteProfileResponder },
3618 StopProfileTasks { responder: DebugStopProfileTasksResponder },
3621}
3622
3623impl DebugRequest {
3624 #[allow(irrefutable_let_patterns)]
3625 pub fn into_compact(self) -> Option<(DebugCompactResponder)> {
3626 if let DebugRequest::Compact { responder } = self {
3627 Some((responder))
3628 } else {
3629 None
3630 }
3631 }
3632
3633 #[allow(irrefutable_let_patterns)]
3634 pub fn into_delete_profile(self) -> Option<(String, String, DebugDeleteProfileResponder)> {
3635 if let DebugRequest::DeleteProfile { volume, profile, responder } = self {
3636 Some((volume, profile, responder))
3637 } else {
3638 None
3639 }
3640 }
3641
3642 #[allow(irrefutable_let_patterns)]
3643 pub fn into_stop_profile_tasks(self) -> Option<(DebugStopProfileTasksResponder)> {
3644 if let DebugRequest::StopProfileTasks { responder } = self {
3645 Some((responder))
3646 } else {
3647 None
3648 }
3649 }
3650
3651 pub fn method_name(&self) -> &'static str {
3653 match *self {
3654 DebugRequest::Compact { .. } => "compact",
3655 DebugRequest::DeleteProfile { .. } => "delete_profile",
3656 DebugRequest::StopProfileTasks { .. } => "stop_profile_tasks",
3657 }
3658 }
3659}
3660
3661#[derive(Debug, Clone)]
3662pub struct DebugControlHandle {
3663 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3664}
3665
3666impl fidl::endpoints::ControlHandle for DebugControlHandle {
3667 fn shutdown(&self) {
3668 self.inner.shutdown()
3669 }
3670 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3671 self.inner.shutdown_with_epitaph(status)
3672 }
3673
3674 fn is_closed(&self) -> bool {
3675 self.inner.channel().is_closed()
3676 }
3677 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3678 self.inner.channel().on_closed()
3679 }
3680
3681 #[cfg(target_os = "fuchsia")]
3682 fn signal_peer(
3683 &self,
3684 clear_mask: zx::Signals,
3685 set_mask: zx::Signals,
3686 ) -> Result<(), zx_status::Status> {
3687 use fidl::Peered;
3688 self.inner.channel().signal_peer(clear_mask, set_mask)
3689 }
3690}
3691
3692impl DebugControlHandle {}
3693
3694#[must_use = "FIDL methods require a response to be sent"]
3695#[derive(Debug)]
3696pub struct DebugCompactResponder {
3697 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
3698 tx_id: u32,
3699}
3700
3701impl std::ops::Drop for DebugCompactResponder {
3705 fn drop(&mut self) {
3706 self.control_handle.shutdown();
3707 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3709 }
3710}
3711
3712impl fidl::endpoints::Responder for DebugCompactResponder {
3713 type ControlHandle = DebugControlHandle;
3714
3715 fn control_handle(&self) -> &DebugControlHandle {
3716 &self.control_handle
3717 }
3718
3719 fn drop_without_shutdown(mut self) {
3720 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3722 std::mem::forget(self);
3724 }
3725}
3726
3727impl DebugCompactResponder {
3728 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3732 let _result = self.send_raw(result);
3733 if _result.is_err() {
3734 self.control_handle.shutdown();
3735 }
3736 self.drop_without_shutdown();
3737 _result
3738 }
3739
3740 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3742 let _result = self.send_raw(result);
3743 self.drop_without_shutdown();
3744 _result
3745 }
3746
3747 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3748 self.control_handle
3749 .inner
3750 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3751 result,
3752 self.tx_id,
3753 0x6553eb197306e489,
3754 fidl::encoding::DynamicFlags::empty(),
3755 )
3756 }
3757}
3758
3759#[must_use = "FIDL methods require a response to be sent"]
3760#[derive(Debug)]
3761pub struct DebugDeleteProfileResponder {
3762 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
3763 tx_id: u32,
3764}
3765
3766impl std::ops::Drop for DebugDeleteProfileResponder {
3770 fn drop(&mut self) {
3771 self.control_handle.shutdown();
3772 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3774 }
3775}
3776
3777impl fidl::endpoints::Responder for DebugDeleteProfileResponder {
3778 type ControlHandle = DebugControlHandle;
3779
3780 fn control_handle(&self) -> &DebugControlHandle {
3781 &self.control_handle
3782 }
3783
3784 fn drop_without_shutdown(mut self) {
3785 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3787 std::mem::forget(self);
3789 }
3790}
3791
3792impl DebugDeleteProfileResponder {
3793 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3797 let _result = self.send_raw(result);
3798 if _result.is_err() {
3799 self.control_handle.shutdown();
3800 }
3801 self.drop_without_shutdown();
3802 _result
3803 }
3804
3805 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3807 let _result = self.send_raw(result);
3808 self.drop_without_shutdown();
3809 _result
3810 }
3811
3812 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3813 self.control_handle
3814 .inner
3815 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3816 result,
3817 self.tx_id,
3818 0x54d9d4c9cf300a1e,
3819 fidl::encoding::DynamicFlags::empty(),
3820 )
3821 }
3822}
3823
3824#[must_use = "FIDL methods require a response to be sent"]
3825#[derive(Debug)]
3826pub struct DebugStopProfileTasksResponder {
3827 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
3828 tx_id: u32,
3829}
3830
3831impl std::ops::Drop for DebugStopProfileTasksResponder {
3835 fn drop(&mut self) {
3836 self.control_handle.shutdown();
3837 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3839 }
3840}
3841
3842impl fidl::endpoints::Responder for DebugStopProfileTasksResponder {
3843 type ControlHandle = DebugControlHandle;
3844
3845 fn control_handle(&self) -> &DebugControlHandle {
3846 &self.control_handle
3847 }
3848
3849 fn drop_without_shutdown(mut self) {
3850 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3852 std::mem::forget(self);
3854 }
3855}
3856
3857impl DebugStopProfileTasksResponder {
3858 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3862 let _result = self.send_raw(result);
3863 if _result.is_err() {
3864 self.control_handle.shutdown();
3865 }
3866 self.drop_without_shutdown();
3867 _result
3868 }
3869
3870 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3872 let _result = self.send_raw(result);
3873 self.drop_without_shutdown();
3874 _result
3875 }
3876
3877 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3878 self.control_handle
3879 .inner
3880 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3881 result,
3882 self.tx_id,
3883 0x1657b945dd629177,
3884 fidl::encoding::DynamicFlags::empty(),
3885 )
3886 }
3887}
3888
3889#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3890pub struct ProjectIdMarker;
3891
3892impl fidl::endpoints::ProtocolMarker for ProjectIdMarker {
3893 type Proxy = ProjectIdProxy;
3894 type RequestStream = ProjectIdRequestStream;
3895 #[cfg(target_os = "fuchsia")]
3896 type SynchronousProxy = ProjectIdSynchronousProxy;
3897
3898 const DEBUG_NAME: &'static str = "fuchsia.fxfs.ProjectId";
3899}
3900impl fidl::endpoints::DiscoverableProtocolMarker for ProjectIdMarker {}
3901pub type ProjectIdSetLimitResult = Result<(), i32>;
3902pub type ProjectIdClearResult = Result<(), i32>;
3903pub type ProjectIdSetForNodeResult = Result<(), i32>;
3904pub type ProjectIdGetForNodeResult = Result<u64, i32>;
3905pub type ProjectIdClearForNodeResult = Result<(), i32>;
3906pub type ProjectIdListResult = Result<(Vec<u64>, Option<Box<ProjectIterToken>>), i32>;
3907pub type ProjectIdInfoResult = Result<(BytesAndNodes, BytesAndNodes), i32>;
3908
3909pub trait ProjectIdProxyInterface: Send + Sync {
3910 type SetLimitResponseFut: std::future::Future<Output = Result<ProjectIdSetLimitResult, fidl::Error>>
3911 + Send;
3912 fn r#set_limit(&self, project_id: u64, bytes: u64, nodes: u64) -> Self::SetLimitResponseFut;
3913 type ClearResponseFut: std::future::Future<Output = Result<ProjectIdClearResult, fidl::Error>>
3914 + Send;
3915 fn r#clear(&self, project_id: u64) -> Self::ClearResponseFut;
3916 type SetForNodeResponseFut: std::future::Future<Output = Result<ProjectIdSetForNodeResult, fidl::Error>>
3917 + Send;
3918 fn r#set_for_node(&self, node_id: u64, project_id: u64) -> Self::SetForNodeResponseFut;
3919 type GetForNodeResponseFut: std::future::Future<Output = Result<ProjectIdGetForNodeResult, fidl::Error>>
3920 + Send;
3921 fn r#get_for_node(&self, node_id: u64) -> Self::GetForNodeResponseFut;
3922 type ClearForNodeResponseFut: std::future::Future<Output = Result<ProjectIdClearForNodeResult, fidl::Error>>
3923 + Send;
3924 fn r#clear_for_node(&self, node_id: u64) -> Self::ClearForNodeResponseFut;
3925 type ListResponseFut: std::future::Future<Output = Result<ProjectIdListResult, fidl::Error>>
3926 + Send;
3927 fn r#list(&self, token: Option<&ProjectIterToken>) -> Self::ListResponseFut;
3928 type InfoResponseFut: std::future::Future<Output = Result<ProjectIdInfoResult, fidl::Error>>
3929 + Send;
3930 fn r#info(&self, project_id: u64) -> Self::InfoResponseFut;
3931}
3932#[derive(Debug)]
3933#[cfg(target_os = "fuchsia")]
3934pub struct ProjectIdSynchronousProxy {
3935 client: fidl::client::sync::Client,
3936}
3937
3938#[cfg(target_os = "fuchsia")]
3939impl fidl::endpoints::SynchronousProxy for ProjectIdSynchronousProxy {
3940 type Proxy = ProjectIdProxy;
3941 type Protocol = ProjectIdMarker;
3942
3943 fn from_channel(inner: fidl::Channel) -> Self {
3944 Self::new(inner)
3945 }
3946
3947 fn into_channel(self) -> fidl::Channel {
3948 self.client.into_channel()
3949 }
3950
3951 fn as_channel(&self) -> &fidl::Channel {
3952 self.client.as_channel()
3953 }
3954}
3955
3956#[cfg(target_os = "fuchsia")]
3957impl ProjectIdSynchronousProxy {
3958 pub fn new(channel: fidl::Channel) -> Self {
3959 let protocol_name = <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3960 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3961 }
3962
3963 pub fn into_channel(self) -> fidl::Channel {
3964 self.client.into_channel()
3965 }
3966
3967 pub fn wait_for_event(
3970 &self,
3971 deadline: zx::MonotonicInstant,
3972 ) -> Result<ProjectIdEvent, fidl::Error> {
3973 ProjectIdEvent::decode(self.client.wait_for_event(deadline)?)
3974 }
3975
3976 pub fn r#set_limit(
3980 &self,
3981 mut project_id: u64,
3982 mut bytes: u64,
3983 mut nodes: u64,
3984 ___deadline: zx::MonotonicInstant,
3985 ) -> Result<ProjectIdSetLimitResult, fidl::Error> {
3986 let _response = self.client.send_query::<
3987 ProjectIdSetLimitRequest,
3988 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3989 >(
3990 (project_id, bytes, nodes,),
3991 0x20b0fc1e0413876f,
3992 fidl::encoding::DynamicFlags::empty(),
3993 ___deadline,
3994 )?;
3995 Ok(_response.map(|x| x))
3996 }
3997
3998 pub fn r#clear(
4002 &self,
4003 mut project_id: u64,
4004 ___deadline: zx::MonotonicInstant,
4005 ) -> Result<ProjectIdClearResult, fidl::Error> {
4006 let _response = self.client.send_query::<
4007 ProjectIdClearRequest,
4008 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4009 >(
4010 (project_id,),
4011 0x165b5f1e707863c1,
4012 fidl::encoding::DynamicFlags::empty(),
4013 ___deadline,
4014 )?;
4015 Ok(_response.map(|x| x))
4016 }
4017
4018 pub fn r#set_for_node(
4021 &self,
4022 mut node_id: u64,
4023 mut project_id: u64,
4024 ___deadline: zx::MonotonicInstant,
4025 ) -> Result<ProjectIdSetForNodeResult, fidl::Error> {
4026 let _response = self.client.send_query::<
4027 ProjectIdSetForNodeRequest,
4028 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4029 >(
4030 (node_id, project_id,),
4031 0x4d7a8442dc58324c,
4032 fidl::encoding::DynamicFlags::empty(),
4033 ___deadline,
4034 )?;
4035 Ok(_response.map(|x| x))
4036 }
4037
4038 pub fn r#get_for_node(
4042 &self,
4043 mut node_id: u64,
4044 ___deadline: zx::MonotonicInstant,
4045 ) -> Result<ProjectIdGetForNodeResult, fidl::Error> {
4046 let _response = self.client.send_query::<
4047 ProjectIdGetForNodeRequest,
4048 fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>,
4049 >(
4050 (node_id,),
4051 0x644073bdf2542573,
4052 fidl::encoding::DynamicFlags::empty(),
4053 ___deadline,
4054 )?;
4055 Ok(_response.map(|x| x.project_id))
4056 }
4057
4058 pub fn r#clear_for_node(
4062 &self,
4063 mut node_id: u64,
4064 ___deadline: zx::MonotonicInstant,
4065 ) -> Result<ProjectIdClearForNodeResult, fidl::Error> {
4066 let _response = self.client.send_query::<
4067 ProjectIdClearForNodeRequest,
4068 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4069 >(
4070 (node_id,),
4071 0x3f2ca287bbfe6a62,
4072 fidl::encoding::DynamicFlags::empty(),
4073 ___deadline,
4074 )?;
4075 Ok(_response.map(|x| x))
4076 }
4077
4078 pub fn r#list(
4083 &self,
4084 mut token: Option<&ProjectIterToken>,
4085 ___deadline: zx::MonotonicInstant,
4086 ) -> Result<ProjectIdListResult, fidl::Error> {
4087 let _response = self.client.send_query::<
4088 ProjectIdListRequest,
4089 fidl::encoding::ResultType<ProjectIdListResponse, i32>,
4090 >(
4091 (token,),
4092 0x5505f95a36d522cc,
4093 fidl::encoding::DynamicFlags::empty(),
4094 ___deadline,
4095 )?;
4096 Ok(_response.map(|x| (x.entries, x.next_token)))
4097 }
4098
4099 pub fn r#info(
4102 &self,
4103 mut project_id: u64,
4104 ___deadline: zx::MonotonicInstant,
4105 ) -> Result<ProjectIdInfoResult, fidl::Error> {
4106 let _response = self.client.send_query::<
4107 ProjectIdInfoRequest,
4108 fidl::encoding::ResultType<ProjectIdInfoResponse, i32>,
4109 >(
4110 (project_id,),
4111 0x51b47743c9e2d1ab,
4112 fidl::encoding::DynamicFlags::empty(),
4113 ___deadline,
4114 )?;
4115 Ok(_response.map(|x| (x.limit, x.usage)))
4116 }
4117}
4118
4119#[derive(Debug, Clone)]
4120pub struct ProjectIdProxy {
4121 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4122}
4123
4124impl fidl::endpoints::Proxy for ProjectIdProxy {
4125 type Protocol = ProjectIdMarker;
4126
4127 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4128 Self::new(inner)
4129 }
4130
4131 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4132 self.client.into_channel().map_err(|client| Self { client })
4133 }
4134
4135 fn as_channel(&self) -> &::fidl::AsyncChannel {
4136 self.client.as_channel()
4137 }
4138}
4139
4140impl ProjectIdProxy {
4141 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4143 let protocol_name = <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4144 Self { client: fidl::client::Client::new(channel, protocol_name) }
4145 }
4146
4147 pub fn take_event_stream(&self) -> ProjectIdEventStream {
4153 ProjectIdEventStream { event_receiver: self.client.take_event_receiver() }
4154 }
4155
4156 pub fn r#set_limit(
4160 &self,
4161 mut project_id: u64,
4162 mut bytes: u64,
4163 mut nodes: u64,
4164 ) -> fidl::client::QueryResponseFut<
4165 ProjectIdSetLimitResult,
4166 fidl::encoding::DefaultFuchsiaResourceDialect,
4167 > {
4168 ProjectIdProxyInterface::r#set_limit(self, project_id, bytes, nodes)
4169 }
4170
4171 pub fn r#clear(
4175 &self,
4176 mut project_id: u64,
4177 ) -> fidl::client::QueryResponseFut<
4178 ProjectIdClearResult,
4179 fidl::encoding::DefaultFuchsiaResourceDialect,
4180 > {
4181 ProjectIdProxyInterface::r#clear(self, project_id)
4182 }
4183
4184 pub fn r#set_for_node(
4187 &self,
4188 mut node_id: u64,
4189 mut project_id: u64,
4190 ) -> fidl::client::QueryResponseFut<
4191 ProjectIdSetForNodeResult,
4192 fidl::encoding::DefaultFuchsiaResourceDialect,
4193 > {
4194 ProjectIdProxyInterface::r#set_for_node(self, node_id, project_id)
4195 }
4196
4197 pub fn r#get_for_node(
4201 &self,
4202 mut node_id: u64,
4203 ) -> fidl::client::QueryResponseFut<
4204 ProjectIdGetForNodeResult,
4205 fidl::encoding::DefaultFuchsiaResourceDialect,
4206 > {
4207 ProjectIdProxyInterface::r#get_for_node(self, node_id)
4208 }
4209
4210 pub fn r#clear_for_node(
4214 &self,
4215 mut node_id: u64,
4216 ) -> fidl::client::QueryResponseFut<
4217 ProjectIdClearForNodeResult,
4218 fidl::encoding::DefaultFuchsiaResourceDialect,
4219 > {
4220 ProjectIdProxyInterface::r#clear_for_node(self, node_id)
4221 }
4222
4223 pub fn r#list(
4228 &self,
4229 mut token: Option<&ProjectIterToken>,
4230 ) -> fidl::client::QueryResponseFut<
4231 ProjectIdListResult,
4232 fidl::encoding::DefaultFuchsiaResourceDialect,
4233 > {
4234 ProjectIdProxyInterface::r#list(self, token)
4235 }
4236
4237 pub fn r#info(
4240 &self,
4241 mut project_id: u64,
4242 ) -> fidl::client::QueryResponseFut<
4243 ProjectIdInfoResult,
4244 fidl::encoding::DefaultFuchsiaResourceDialect,
4245 > {
4246 ProjectIdProxyInterface::r#info(self, project_id)
4247 }
4248}
4249
4250impl ProjectIdProxyInterface for ProjectIdProxy {
4251 type SetLimitResponseFut = fidl::client::QueryResponseFut<
4252 ProjectIdSetLimitResult,
4253 fidl::encoding::DefaultFuchsiaResourceDialect,
4254 >;
4255 fn r#set_limit(
4256 &self,
4257 mut project_id: u64,
4258 mut bytes: u64,
4259 mut nodes: u64,
4260 ) -> Self::SetLimitResponseFut {
4261 fn _decode(
4262 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4263 ) -> Result<ProjectIdSetLimitResult, fidl::Error> {
4264 let _response = fidl::client::decode_transaction_body::<
4265 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4266 fidl::encoding::DefaultFuchsiaResourceDialect,
4267 0x20b0fc1e0413876f,
4268 >(_buf?)?;
4269 Ok(_response.map(|x| x))
4270 }
4271 self.client.send_query_and_decode::<ProjectIdSetLimitRequest, ProjectIdSetLimitResult>(
4272 (project_id, bytes, nodes),
4273 0x20b0fc1e0413876f,
4274 fidl::encoding::DynamicFlags::empty(),
4275 _decode,
4276 )
4277 }
4278
4279 type ClearResponseFut = fidl::client::QueryResponseFut<
4280 ProjectIdClearResult,
4281 fidl::encoding::DefaultFuchsiaResourceDialect,
4282 >;
4283 fn r#clear(&self, mut project_id: u64) -> Self::ClearResponseFut {
4284 fn _decode(
4285 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4286 ) -> Result<ProjectIdClearResult, fidl::Error> {
4287 let _response = fidl::client::decode_transaction_body::<
4288 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4289 fidl::encoding::DefaultFuchsiaResourceDialect,
4290 0x165b5f1e707863c1,
4291 >(_buf?)?;
4292 Ok(_response.map(|x| x))
4293 }
4294 self.client.send_query_and_decode::<ProjectIdClearRequest, ProjectIdClearResult>(
4295 (project_id,),
4296 0x165b5f1e707863c1,
4297 fidl::encoding::DynamicFlags::empty(),
4298 _decode,
4299 )
4300 }
4301
4302 type SetForNodeResponseFut = fidl::client::QueryResponseFut<
4303 ProjectIdSetForNodeResult,
4304 fidl::encoding::DefaultFuchsiaResourceDialect,
4305 >;
4306 fn r#set_for_node(&self, mut node_id: u64, mut project_id: u64) -> Self::SetForNodeResponseFut {
4307 fn _decode(
4308 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4309 ) -> Result<ProjectIdSetForNodeResult, fidl::Error> {
4310 let _response = fidl::client::decode_transaction_body::<
4311 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4312 fidl::encoding::DefaultFuchsiaResourceDialect,
4313 0x4d7a8442dc58324c,
4314 >(_buf?)?;
4315 Ok(_response.map(|x| x))
4316 }
4317 self.client.send_query_and_decode::<ProjectIdSetForNodeRequest, ProjectIdSetForNodeResult>(
4318 (node_id, project_id),
4319 0x4d7a8442dc58324c,
4320 fidl::encoding::DynamicFlags::empty(),
4321 _decode,
4322 )
4323 }
4324
4325 type GetForNodeResponseFut = fidl::client::QueryResponseFut<
4326 ProjectIdGetForNodeResult,
4327 fidl::encoding::DefaultFuchsiaResourceDialect,
4328 >;
4329 fn r#get_for_node(&self, mut node_id: u64) -> Self::GetForNodeResponseFut {
4330 fn _decode(
4331 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4332 ) -> Result<ProjectIdGetForNodeResult, fidl::Error> {
4333 let _response = fidl::client::decode_transaction_body::<
4334 fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>,
4335 fidl::encoding::DefaultFuchsiaResourceDialect,
4336 0x644073bdf2542573,
4337 >(_buf?)?;
4338 Ok(_response.map(|x| x.project_id))
4339 }
4340 self.client.send_query_and_decode::<ProjectIdGetForNodeRequest, ProjectIdGetForNodeResult>(
4341 (node_id,),
4342 0x644073bdf2542573,
4343 fidl::encoding::DynamicFlags::empty(),
4344 _decode,
4345 )
4346 }
4347
4348 type ClearForNodeResponseFut = fidl::client::QueryResponseFut<
4349 ProjectIdClearForNodeResult,
4350 fidl::encoding::DefaultFuchsiaResourceDialect,
4351 >;
4352 fn r#clear_for_node(&self, mut node_id: u64) -> Self::ClearForNodeResponseFut {
4353 fn _decode(
4354 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4355 ) -> Result<ProjectIdClearForNodeResult, fidl::Error> {
4356 let _response = fidl::client::decode_transaction_body::<
4357 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4358 fidl::encoding::DefaultFuchsiaResourceDialect,
4359 0x3f2ca287bbfe6a62,
4360 >(_buf?)?;
4361 Ok(_response.map(|x| x))
4362 }
4363 self.client
4364 .send_query_and_decode::<ProjectIdClearForNodeRequest, ProjectIdClearForNodeResult>(
4365 (node_id,),
4366 0x3f2ca287bbfe6a62,
4367 fidl::encoding::DynamicFlags::empty(),
4368 _decode,
4369 )
4370 }
4371
4372 type ListResponseFut = fidl::client::QueryResponseFut<
4373 ProjectIdListResult,
4374 fidl::encoding::DefaultFuchsiaResourceDialect,
4375 >;
4376 fn r#list(&self, mut token: Option<&ProjectIterToken>) -> Self::ListResponseFut {
4377 fn _decode(
4378 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4379 ) -> Result<ProjectIdListResult, fidl::Error> {
4380 let _response = fidl::client::decode_transaction_body::<
4381 fidl::encoding::ResultType<ProjectIdListResponse, i32>,
4382 fidl::encoding::DefaultFuchsiaResourceDialect,
4383 0x5505f95a36d522cc,
4384 >(_buf?)?;
4385 Ok(_response.map(|x| (x.entries, x.next_token)))
4386 }
4387 self.client.send_query_and_decode::<ProjectIdListRequest, ProjectIdListResult>(
4388 (token,),
4389 0x5505f95a36d522cc,
4390 fidl::encoding::DynamicFlags::empty(),
4391 _decode,
4392 )
4393 }
4394
4395 type InfoResponseFut = fidl::client::QueryResponseFut<
4396 ProjectIdInfoResult,
4397 fidl::encoding::DefaultFuchsiaResourceDialect,
4398 >;
4399 fn r#info(&self, mut project_id: u64) -> Self::InfoResponseFut {
4400 fn _decode(
4401 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4402 ) -> Result<ProjectIdInfoResult, fidl::Error> {
4403 let _response = fidl::client::decode_transaction_body::<
4404 fidl::encoding::ResultType<ProjectIdInfoResponse, i32>,
4405 fidl::encoding::DefaultFuchsiaResourceDialect,
4406 0x51b47743c9e2d1ab,
4407 >(_buf?)?;
4408 Ok(_response.map(|x| (x.limit, x.usage)))
4409 }
4410 self.client.send_query_and_decode::<ProjectIdInfoRequest, ProjectIdInfoResult>(
4411 (project_id,),
4412 0x51b47743c9e2d1ab,
4413 fidl::encoding::DynamicFlags::empty(),
4414 _decode,
4415 )
4416 }
4417}
4418
4419pub struct ProjectIdEventStream {
4420 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4421}
4422
4423impl std::marker::Unpin for ProjectIdEventStream {}
4424
4425impl futures::stream::FusedStream for ProjectIdEventStream {
4426 fn is_terminated(&self) -> bool {
4427 self.event_receiver.is_terminated()
4428 }
4429}
4430
4431impl futures::Stream for ProjectIdEventStream {
4432 type Item = Result<ProjectIdEvent, fidl::Error>;
4433
4434 fn poll_next(
4435 mut self: std::pin::Pin<&mut Self>,
4436 cx: &mut std::task::Context<'_>,
4437 ) -> std::task::Poll<Option<Self::Item>> {
4438 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4439 &mut self.event_receiver,
4440 cx
4441 )?) {
4442 Some(buf) => std::task::Poll::Ready(Some(ProjectIdEvent::decode(buf))),
4443 None => std::task::Poll::Ready(None),
4444 }
4445 }
4446}
4447
4448#[derive(Debug)]
4449pub enum ProjectIdEvent {}
4450
4451impl ProjectIdEvent {
4452 fn decode(
4454 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4455 ) -> Result<ProjectIdEvent, fidl::Error> {
4456 let (bytes, _handles) = buf.split_mut();
4457 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4458 debug_assert_eq!(tx_header.tx_id, 0);
4459 match tx_header.ordinal {
4460 _ => Err(fidl::Error::UnknownOrdinal {
4461 ordinal: tx_header.ordinal,
4462 protocol_name: <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4463 }),
4464 }
4465 }
4466}
4467
4468pub struct ProjectIdRequestStream {
4470 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4471 is_terminated: bool,
4472}
4473
4474impl std::marker::Unpin for ProjectIdRequestStream {}
4475
4476impl futures::stream::FusedStream for ProjectIdRequestStream {
4477 fn is_terminated(&self) -> bool {
4478 self.is_terminated
4479 }
4480}
4481
4482impl fidl::endpoints::RequestStream for ProjectIdRequestStream {
4483 type Protocol = ProjectIdMarker;
4484 type ControlHandle = ProjectIdControlHandle;
4485
4486 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4487 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4488 }
4489
4490 fn control_handle(&self) -> Self::ControlHandle {
4491 ProjectIdControlHandle { inner: self.inner.clone() }
4492 }
4493
4494 fn into_inner(
4495 self,
4496 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4497 {
4498 (self.inner, self.is_terminated)
4499 }
4500
4501 fn from_inner(
4502 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4503 is_terminated: bool,
4504 ) -> Self {
4505 Self { inner, is_terminated }
4506 }
4507}
4508
4509impl futures::Stream for ProjectIdRequestStream {
4510 type Item = Result<ProjectIdRequest, fidl::Error>;
4511
4512 fn poll_next(
4513 mut self: std::pin::Pin<&mut Self>,
4514 cx: &mut std::task::Context<'_>,
4515 ) -> std::task::Poll<Option<Self::Item>> {
4516 let this = &mut *self;
4517 if this.inner.check_shutdown(cx) {
4518 this.is_terminated = true;
4519 return std::task::Poll::Ready(None);
4520 }
4521 if this.is_terminated {
4522 panic!("polled ProjectIdRequestStream after completion");
4523 }
4524 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4525 |bytes, handles| {
4526 match this.inner.channel().read_etc(cx, bytes, handles) {
4527 std::task::Poll::Ready(Ok(())) => {}
4528 std::task::Poll::Pending => return std::task::Poll::Pending,
4529 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4530 this.is_terminated = true;
4531 return std::task::Poll::Ready(None);
4532 }
4533 std::task::Poll::Ready(Err(e)) => {
4534 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4535 e.into(),
4536 ))))
4537 }
4538 }
4539
4540 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4542
4543 std::task::Poll::Ready(Some(match header.ordinal {
4544 0x20b0fc1e0413876f => {
4545 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4546 let mut req = fidl::new_empty!(
4547 ProjectIdSetLimitRequest,
4548 fidl::encoding::DefaultFuchsiaResourceDialect
4549 );
4550 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdSetLimitRequest>(&header, _body_bytes, handles, &mut req)?;
4551 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
4552 Ok(ProjectIdRequest::SetLimit {
4553 project_id: req.project_id,
4554 bytes: req.bytes,
4555 nodes: req.nodes,
4556
4557 responder: ProjectIdSetLimitResponder {
4558 control_handle: std::mem::ManuallyDrop::new(control_handle),
4559 tx_id: header.tx_id,
4560 },
4561 })
4562 }
4563 0x165b5f1e707863c1 => {
4564 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4565 let mut req = fidl::new_empty!(
4566 ProjectIdClearRequest,
4567 fidl::encoding::DefaultFuchsiaResourceDialect
4568 );
4569 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdClearRequest>(&header, _body_bytes, handles, &mut req)?;
4570 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
4571 Ok(ProjectIdRequest::Clear {
4572 project_id: req.project_id,
4573
4574 responder: ProjectIdClearResponder {
4575 control_handle: std::mem::ManuallyDrop::new(control_handle),
4576 tx_id: header.tx_id,
4577 },
4578 })
4579 }
4580 0x4d7a8442dc58324c => {
4581 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4582 let mut req = fidl::new_empty!(
4583 ProjectIdSetForNodeRequest,
4584 fidl::encoding::DefaultFuchsiaResourceDialect
4585 );
4586 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdSetForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
4587 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
4588 Ok(ProjectIdRequest::SetForNode {
4589 node_id: req.node_id,
4590 project_id: req.project_id,
4591
4592 responder: ProjectIdSetForNodeResponder {
4593 control_handle: std::mem::ManuallyDrop::new(control_handle),
4594 tx_id: header.tx_id,
4595 },
4596 })
4597 }
4598 0x644073bdf2542573 => {
4599 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4600 let mut req = fidl::new_empty!(
4601 ProjectIdGetForNodeRequest,
4602 fidl::encoding::DefaultFuchsiaResourceDialect
4603 );
4604 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdGetForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
4605 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
4606 Ok(ProjectIdRequest::GetForNode {
4607 node_id: req.node_id,
4608
4609 responder: ProjectIdGetForNodeResponder {
4610 control_handle: std::mem::ManuallyDrop::new(control_handle),
4611 tx_id: header.tx_id,
4612 },
4613 })
4614 }
4615 0x3f2ca287bbfe6a62 => {
4616 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4617 let mut req = fidl::new_empty!(
4618 ProjectIdClearForNodeRequest,
4619 fidl::encoding::DefaultFuchsiaResourceDialect
4620 );
4621 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdClearForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
4622 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
4623 Ok(ProjectIdRequest::ClearForNode {
4624 node_id: req.node_id,
4625
4626 responder: ProjectIdClearForNodeResponder {
4627 control_handle: std::mem::ManuallyDrop::new(control_handle),
4628 tx_id: header.tx_id,
4629 },
4630 })
4631 }
4632 0x5505f95a36d522cc => {
4633 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4634 let mut req = fidl::new_empty!(
4635 ProjectIdListRequest,
4636 fidl::encoding::DefaultFuchsiaResourceDialect
4637 );
4638 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdListRequest>(&header, _body_bytes, handles, &mut req)?;
4639 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
4640 Ok(ProjectIdRequest::List {
4641 token: req.token,
4642
4643 responder: ProjectIdListResponder {
4644 control_handle: std::mem::ManuallyDrop::new(control_handle),
4645 tx_id: header.tx_id,
4646 },
4647 })
4648 }
4649 0x51b47743c9e2d1ab => {
4650 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4651 let mut req = fidl::new_empty!(
4652 ProjectIdInfoRequest,
4653 fidl::encoding::DefaultFuchsiaResourceDialect
4654 );
4655 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdInfoRequest>(&header, _body_bytes, handles, &mut req)?;
4656 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
4657 Ok(ProjectIdRequest::Info {
4658 project_id: req.project_id,
4659
4660 responder: ProjectIdInfoResponder {
4661 control_handle: std::mem::ManuallyDrop::new(control_handle),
4662 tx_id: header.tx_id,
4663 },
4664 })
4665 }
4666 _ => Err(fidl::Error::UnknownOrdinal {
4667 ordinal: header.ordinal,
4668 protocol_name:
4669 <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4670 }),
4671 }))
4672 },
4673 )
4674 }
4675}
4676
4677#[derive(Debug)]
4678pub enum ProjectIdRequest {
4679 SetLimit { project_id: u64, bytes: u64, nodes: u64, responder: ProjectIdSetLimitResponder },
4683 Clear { project_id: u64, responder: ProjectIdClearResponder },
4687 SetForNode { node_id: u64, project_id: u64, responder: ProjectIdSetForNodeResponder },
4690 GetForNode { node_id: u64, responder: ProjectIdGetForNodeResponder },
4694 ClearForNode { node_id: u64, responder: ProjectIdClearForNodeResponder },
4698 List { token: Option<Box<ProjectIterToken>>, responder: ProjectIdListResponder },
4703 Info { project_id: u64, responder: ProjectIdInfoResponder },
4706}
4707
4708impl ProjectIdRequest {
4709 #[allow(irrefutable_let_patterns)]
4710 pub fn into_set_limit(self) -> Option<(u64, u64, u64, ProjectIdSetLimitResponder)> {
4711 if let ProjectIdRequest::SetLimit { project_id, bytes, nodes, responder } = self {
4712 Some((project_id, bytes, nodes, responder))
4713 } else {
4714 None
4715 }
4716 }
4717
4718 #[allow(irrefutable_let_patterns)]
4719 pub fn into_clear(self) -> Option<(u64, ProjectIdClearResponder)> {
4720 if let ProjectIdRequest::Clear { project_id, responder } = self {
4721 Some((project_id, responder))
4722 } else {
4723 None
4724 }
4725 }
4726
4727 #[allow(irrefutable_let_patterns)]
4728 pub fn into_set_for_node(self) -> Option<(u64, u64, ProjectIdSetForNodeResponder)> {
4729 if let ProjectIdRequest::SetForNode { node_id, project_id, responder } = self {
4730 Some((node_id, project_id, responder))
4731 } else {
4732 None
4733 }
4734 }
4735
4736 #[allow(irrefutable_let_patterns)]
4737 pub fn into_get_for_node(self) -> Option<(u64, ProjectIdGetForNodeResponder)> {
4738 if let ProjectIdRequest::GetForNode { node_id, responder } = self {
4739 Some((node_id, responder))
4740 } else {
4741 None
4742 }
4743 }
4744
4745 #[allow(irrefutable_let_patterns)]
4746 pub fn into_clear_for_node(self) -> Option<(u64, ProjectIdClearForNodeResponder)> {
4747 if let ProjectIdRequest::ClearForNode { node_id, responder } = self {
4748 Some((node_id, responder))
4749 } else {
4750 None
4751 }
4752 }
4753
4754 #[allow(irrefutable_let_patterns)]
4755 pub fn into_list(self) -> Option<(Option<Box<ProjectIterToken>>, ProjectIdListResponder)> {
4756 if let ProjectIdRequest::List { token, responder } = self {
4757 Some((token, responder))
4758 } else {
4759 None
4760 }
4761 }
4762
4763 #[allow(irrefutable_let_patterns)]
4764 pub fn into_info(self) -> Option<(u64, ProjectIdInfoResponder)> {
4765 if let ProjectIdRequest::Info { project_id, responder } = self {
4766 Some((project_id, responder))
4767 } else {
4768 None
4769 }
4770 }
4771
4772 pub fn method_name(&self) -> &'static str {
4774 match *self {
4775 ProjectIdRequest::SetLimit { .. } => "set_limit",
4776 ProjectIdRequest::Clear { .. } => "clear",
4777 ProjectIdRequest::SetForNode { .. } => "set_for_node",
4778 ProjectIdRequest::GetForNode { .. } => "get_for_node",
4779 ProjectIdRequest::ClearForNode { .. } => "clear_for_node",
4780 ProjectIdRequest::List { .. } => "list",
4781 ProjectIdRequest::Info { .. } => "info",
4782 }
4783 }
4784}
4785
4786#[derive(Debug, Clone)]
4787pub struct ProjectIdControlHandle {
4788 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4789}
4790
4791impl fidl::endpoints::ControlHandle for ProjectIdControlHandle {
4792 fn shutdown(&self) {
4793 self.inner.shutdown()
4794 }
4795 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4796 self.inner.shutdown_with_epitaph(status)
4797 }
4798
4799 fn is_closed(&self) -> bool {
4800 self.inner.channel().is_closed()
4801 }
4802 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4803 self.inner.channel().on_closed()
4804 }
4805
4806 #[cfg(target_os = "fuchsia")]
4807 fn signal_peer(
4808 &self,
4809 clear_mask: zx::Signals,
4810 set_mask: zx::Signals,
4811 ) -> Result<(), zx_status::Status> {
4812 use fidl::Peered;
4813 self.inner.channel().signal_peer(clear_mask, set_mask)
4814 }
4815}
4816
4817impl ProjectIdControlHandle {}
4818
4819#[must_use = "FIDL methods require a response to be sent"]
4820#[derive(Debug)]
4821pub struct ProjectIdSetLimitResponder {
4822 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
4823 tx_id: u32,
4824}
4825
4826impl std::ops::Drop for ProjectIdSetLimitResponder {
4830 fn drop(&mut self) {
4831 self.control_handle.shutdown();
4832 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4834 }
4835}
4836
4837impl fidl::endpoints::Responder for ProjectIdSetLimitResponder {
4838 type ControlHandle = ProjectIdControlHandle;
4839
4840 fn control_handle(&self) -> &ProjectIdControlHandle {
4841 &self.control_handle
4842 }
4843
4844 fn drop_without_shutdown(mut self) {
4845 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4847 std::mem::forget(self);
4849 }
4850}
4851
4852impl ProjectIdSetLimitResponder {
4853 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4857 let _result = self.send_raw(result);
4858 if _result.is_err() {
4859 self.control_handle.shutdown();
4860 }
4861 self.drop_without_shutdown();
4862 _result
4863 }
4864
4865 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4867 let _result = self.send_raw(result);
4868 self.drop_without_shutdown();
4869 _result
4870 }
4871
4872 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4873 self.control_handle
4874 .inner
4875 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4876 result,
4877 self.tx_id,
4878 0x20b0fc1e0413876f,
4879 fidl::encoding::DynamicFlags::empty(),
4880 )
4881 }
4882}
4883
4884#[must_use = "FIDL methods require a response to be sent"]
4885#[derive(Debug)]
4886pub struct ProjectIdClearResponder {
4887 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
4888 tx_id: u32,
4889}
4890
4891impl std::ops::Drop for ProjectIdClearResponder {
4895 fn drop(&mut self) {
4896 self.control_handle.shutdown();
4897 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4899 }
4900}
4901
4902impl fidl::endpoints::Responder for ProjectIdClearResponder {
4903 type ControlHandle = ProjectIdControlHandle;
4904
4905 fn control_handle(&self) -> &ProjectIdControlHandle {
4906 &self.control_handle
4907 }
4908
4909 fn drop_without_shutdown(mut self) {
4910 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4912 std::mem::forget(self);
4914 }
4915}
4916
4917impl ProjectIdClearResponder {
4918 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4922 let _result = self.send_raw(result);
4923 if _result.is_err() {
4924 self.control_handle.shutdown();
4925 }
4926 self.drop_without_shutdown();
4927 _result
4928 }
4929
4930 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4932 let _result = self.send_raw(result);
4933 self.drop_without_shutdown();
4934 _result
4935 }
4936
4937 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4938 self.control_handle
4939 .inner
4940 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4941 result,
4942 self.tx_id,
4943 0x165b5f1e707863c1,
4944 fidl::encoding::DynamicFlags::empty(),
4945 )
4946 }
4947}
4948
4949#[must_use = "FIDL methods require a response to be sent"]
4950#[derive(Debug)]
4951pub struct ProjectIdSetForNodeResponder {
4952 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
4953 tx_id: u32,
4954}
4955
4956impl std::ops::Drop for ProjectIdSetForNodeResponder {
4960 fn drop(&mut self) {
4961 self.control_handle.shutdown();
4962 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4964 }
4965}
4966
4967impl fidl::endpoints::Responder for ProjectIdSetForNodeResponder {
4968 type ControlHandle = ProjectIdControlHandle;
4969
4970 fn control_handle(&self) -> &ProjectIdControlHandle {
4971 &self.control_handle
4972 }
4973
4974 fn drop_without_shutdown(mut self) {
4975 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4977 std::mem::forget(self);
4979 }
4980}
4981
4982impl ProjectIdSetForNodeResponder {
4983 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4987 let _result = self.send_raw(result);
4988 if _result.is_err() {
4989 self.control_handle.shutdown();
4990 }
4991 self.drop_without_shutdown();
4992 _result
4993 }
4994
4995 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4997 let _result = self.send_raw(result);
4998 self.drop_without_shutdown();
4999 _result
5000 }
5001
5002 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5003 self.control_handle
5004 .inner
5005 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5006 result,
5007 self.tx_id,
5008 0x4d7a8442dc58324c,
5009 fidl::encoding::DynamicFlags::empty(),
5010 )
5011 }
5012}
5013
5014#[must_use = "FIDL methods require a response to be sent"]
5015#[derive(Debug)]
5016pub struct ProjectIdGetForNodeResponder {
5017 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5018 tx_id: u32,
5019}
5020
5021impl std::ops::Drop for ProjectIdGetForNodeResponder {
5025 fn drop(&mut self) {
5026 self.control_handle.shutdown();
5027 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5029 }
5030}
5031
5032impl fidl::endpoints::Responder for ProjectIdGetForNodeResponder {
5033 type ControlHandle = ProjectIdControlHandle;
5034
5035 fn control_handle(&self) -> &ProjectIdControlHandle {
5036 &self.control_handle
5037 }
5038
5039 fn drop_without_shutdown(mut self) {
5040 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5042 std::mem::forget(self);
5044 }
5045}
5046
5047impl ProjectIdGetForNodeResponder {
5048 pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
5052 let _result = self.send_raw(result);
5053 if _result.is_err() {
5054 self.control_handle.shutdown();
5055 }
5056 self.drop_without_shutdown();
5057 _result
5058 }
5059
5060 pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
5062 let _result = self.send_raw(result);
5063 self.drop_without_shutdown();
5064 _result
5065 }
5066
5067 fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
5068 self.control_handle
5069 .inner
5070 .send::<fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>>(
5071 result.map(|project_id| (project_id,)),
5072 self.tx_id,
5073 0x644073bdf2542573,
5074 fidl::encoding::DynamicFlags::empty(),
5075 )
5076 }
5077}
5078
5079#[must_use = "FIDL methods require a response to be sent"]
5080#[derive(Debug)]
5081pub struct ProjectIdClearForNodeResponder {
5082 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5083 tx_id: u32,
5084}
5085
5086impl std::ops::Drop for ProjectIdClearForNodeResponder {
5090 fn drop(&mut self) {
5091 self.control_handle.shutdown();
5092 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5094 }
5095}
5096
5097impl fidl::endpoints::Responder for ProjectIdClearForNodeResponder {
5098 type ControlHandle = ProjectIdControlHandle;
5099
5100 fn control_handle(&self) -> &ProjectIdControlHandle {
5101 &self.control_handle
5102 }
5103
5104 fn drop_without_shutdown(mut self) {
5105 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5107 std::mem::forget(self);
5109 }
5110}
5111
5112impl ProjectIdClearForNodeResponder {
5113 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5117 let _result = self.send_raw(result);
5118 if _result.is_err() {
5119 self.control_handle.shutdown();
5120 }
5121 self.drop_without_shutdown();
5122 _result
5123 }
5124
5125 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5127 let _result = self.send_raw(result);
5128 self.drop_without_shutdown();
5129 _result
5130 }
5131
5132 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5133 self.control_handle
5134 .inner
5135 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5136 result,
5137 self.tx_id,
5138 0x3f2ca287bbfe6a62,
5139 fidl::encoding::DynamicFlags::empty(),
5140 )
5141 }
5142}
5143
5144#[must_use = "FIDL methods require a response to be sent"]
5145#[derive(Debug)]
5146pub struct ProjectIdListResponder {
5147 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5148 tx_id: u32,
5149}
5150
5151impl std::ops::Drop for ProjectIdListResponder {
5155 fn drop(&mut self) {
5156 self.control_handle.shutdown();
5157 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5159 }
5160}
5161
5162impl fidl::endpoints::Responder for ProjectIdListResponder {
5163 type ControlHandle = ProjectIdControlHandle;
5164
5165 fn control_handle(&self) -> &ProjectIdControlHandle {
5166 &self.control_handle
5167 }
5168
5169 fn drop_without_shutdown(mut self) {
5170 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5172 std::mem::forget(self);
5174 }
5175}
5176
5177impl ProjectIdListResponder {
5178 pub fn send(
5182 self,
5183 mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
5184 ) -> Result<(), fidl::Error> {
5185 let _result = self.send_raw(result);
5186 if _result.is_err() {
5187 self.control_handle.shutdown();
5188 }
5189 self.drop_without_shutdown();
5190 _result
5191 }
5192
5193 pub fn send_no_shutdown_on_err(
5195 self,
5196 mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
5197 ) -> Result<(), fidl::Error> {
5198 let _result = self.send_raw(result);
5199 self.drop_without_shutdown();
5200 _result
5201 }
5202
5203 fn send_raw(
5204 &self,
5205 mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
5206 ) -> Result<(), fidl::Error> {
5207 self.control_handle.inner.send::<fidl::encoding::ResultType<ProjectIdListResponse, i32>>(
5208 result,
5209 self.tx_id,
5210 0x5505f95a36d522cc,
5211 fidl::encoding::DynamicFlags::empty(),
5212 )
5213 }
5214}
5215
5216#[must_use = "FIDL methods require a response to be sent"]
5217#[derive(Debug)]
5218pub struct ProjectIdInfoResponder {
5219 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
5220 tx_id: u32,
5221}
5222
5223impl std::ops::Drop for ProjectIdInfoResponder {
5227 fn drop(&mut self) {
5228 self.control_handle.shutdown();
5229 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5231 }
5232}
5233
5234impl fidl::endpoints::Responder for ProjectIdInfoResponder {
5235 type ControlHandle = ProjectIdControlHandle;
5236
5237 fn control_handle(&self) -> &ProjectIdControlHandle {
5238 &self.control_handle
5239 }
5240
5241 fn drop_without_shutdown(mut self) {
5242 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5244 std::mem::forget(self);
5246 }
5247}
5248
5249impl ProjectIdInfoResponder {
5250 pub fn send(
5254 self,
5255 mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
5256 ) -> Result<(), fidl::Error> {
5257 let _result = self.send_raw(result);
5258 if _result.is_err() {
5259 self.control_handle.shutdown();
5260 }
5261 self.drop_without_shutdown();
5262 _result
5263 }
5264
5265 pub fn send_no_shutdown_on_err(
5267 self,
5268 mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
5269 ) -> Result<(), fidl::Error> {
5270 let _result = self.send_raw(result);
5271 self.drop_without_shutdown();
5272 _result
5273 }
5274
5275 fn send_raw(
5276 &self,
5277 mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
5278 ) -> Result<(), fidl::Error> {
5279 self.control_handle.inner.send::<fidl::encoding::ResultType<ProjectIdInfoResponse, i32>>(
5280 result,
5281 self.tx_id,
5282 0x51b47743c9e2d1ab,
5283 fidl::encoding::DynamicFlags::empty(),
5284 )
5285 }
5286}
5287
5288mod internal {
5289 use super::*;
5290
5291 impl fidl::encoding::ResourceTypeMarker for BlobCreatorCreateResponse {
5292 type Borrowed<'a> = &'a mut Self;
5293 fn take_or_borrow<'a>(
5294 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5295 ) -> Self::Borrowed<'a> {
5296 value
5297 }
5298 }
5299
5300 unsafe impl fidl::encoding::TypeMarker for BlobCreatorCreateResponse {
5301 type Owned = Self;
5302
5303 #[inline(always)]
5304 fn inline_align(_context: fidl::encoding::Context) -> usize {
5305 4
5306 }
5307
5308 #[inline(always)]
5309 fn inline_size(_context: fidl::encoding::Context) -> usize {
5310 4
5311 }
5312 }
5313
5314 unsafe impl
5315 fidl::encoding::Encode<
5316 BlobCreatorCreateResponse,
5317 fidl::encoding::DefaultFuchsiaResourceDialect,
5318 > for &mut BlobCreatorCreateResponse
5319 {
5320 #[inline]
5321 unsafe fn encode(
5322 self,
5323 encoder: &mut fidl::encoding::Encoder<
5324 '_,
5325 fidl::encoding::DefaultFuchsiaResourceDialect,
5326 >,
5327 offset: usize,
5328 _depth: fidl::encoding::Depth,
5329 ) -> fidl::Result<()> {
5330 encoder.debug_check_bounds::<BlobCreatorCreateResponse>(offset);
5331 fidl::encoding::Encode::<BlobCreatorCreateResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5333 (
5334 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
5335 ),
5336 encoder, offset, _depth
5337 )
5338 }
5339 }
5340 unsafe impl<
5341 T0: fidl::encoding::Encode<
5342 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
5343 fidl::encoding::DefaultFuchsiaResourceDialect,
5344 >,
5345 >
5346 fidl::encoding::Encode<
5347 BlobCreatorCreateResponse,
5348 fidl::encoding::DefaultFuchsiaResourceDialect,
5349 > for (T0,)
5350 {
5351 #[inline]
5352 unsafe fn encode(
5353 self,
5354 encoder: &mut fidl::encoding::Encoder<
5355 '_,
5356 fidl::encoding::DefaultFuchsiaResourceDialect,
5357 >,
5358 offset: usize,
5359 depth: fidl::encoding::Depth,
5360 ) -> fidl::Result<()> {
5361 encoder.debug_check_bounds::<BlobCreatorCreateResponse>(offset);
5362 self.0.encode(encoder, offset + 0, depth)?;
5366 Ok(())
5367 }
5368 }
5369
5370 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5371 for BlobCreatorCreateResponse
5372 {
5373 #[inline(always)]
5374 fn new_empty() -> Self {
5375 Self {
5376 writer: fidl::new_empty!(
5377 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
5378 fidl::encoding::DefaultFuchsiaResourceDialect
5379 ),
5380 }
5381 }
5382
5383 #[inline]
5384 unsafe fn decode(
5385 &mut self,
5386 decoder: &mut fidl::encoding::Decoder<
5387 '_,
5388 fidl::encoding::DefaultFuchsiaResourceDialect,
5389 >,
5390 offset: usize,
5391 _depth: fidl::encoding::Depth,
5392 ) -> fidl::Result<()> {
5393 decoder.debug_check_bounds::<Self>(offset);
5394 fidl::decode!(
5396 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
5397 fidl::encoding::DefaultFuchsiaResourceDialect,
5398 &mut self.writer,
5399 decoder,
5400 offset + 0,
5401 _depth
5402 )?;
5403 Ok(())
5404 }
5405 }
5406
5407 impl fidl::encoding::ResourceTypeMarker for BlobReaderGetVmoResponse {
5408 type Borrowed<'a> = &'a mut Self;
5409 fn take_or_borrow<'a>(
5410 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5411 ) -> Self::Borrowed<'a> {
5412 value
5413 }
5414 }
5415
5416 unsafe impl fidl::encoding::TypeMarker for BlobReaderGetVmoResponse {
5417 type Owned = Self;
5418
5419 #[inline(always)]
5420 fn inline_align(_context: fidl::encoding::Context) -> usize {
5421 4
5422 }
5423
5424 #[inline(always)]
5425 fn inline_size(_context: fidl::encoding::Context) -> usize {
5426 4
5427 }
5428 }
5429
5430 unsafe impl
5431 fidl::encoding::Encode<
5432 BlobReaderGetVmoResponse,
5433 fidl::encoding::DefaultFuchsiaResourceDialect,
5434 > for &mut BlobReaderGetVmoResponse
5435 {
5436 #[inline]
5437 unsafe fn encode(
5438 self,
5439 encoder: &mut fidl::encoding::Encoder<
5440 '_,
5441 fidl::encoding::DefaultFuchsiaResourceDialect,
5442 >,
5443 offset: usize,
5444 _depth: fidl::encoding::Depth,
5445 ) -> fidl::Result<()> {
5446 encoder.debug_check_bounds::<BlobReaderGetVmoResponse>(offset);
5447 fidl::encoding::Encode::<
5449 BlobReaderGetVmoResponse,
5450 fidl::encoding::DefaultFuchsiaResourceDialect,
5451 >::encode(
5452 (<fidl::encoding::HandleType<
5453 fidl::Vmo,
5454 { fidl::ObjectType::VMO.into_raw() },
5455 2147483648,
5456 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5457 &mut self.vmo
5458 ),),
5459 encoder,
5460 offset,
5461 _depth,
5462 )
5463 }
5464 }
5465 unsafe impl<
5466 T0: fidl::encoding::Encode<
5467 fidl::encoding::HandleType<
5468 fidl::Vmo,
5469 { fidl::ObjectType::VMO.into_raw() },
5470 2147483648,
5471 >,
5472 fidl::encoding::DefaultFuchsiaResourceDialect,
5473 >,
5474 >
5475 fidl::encoding::Encode<
5476 BlobReaderGetVmoResponse,
5477 fidl::encoding::DefaultFuchsiaResourceDialect,
5478 > for (T0,)
5479 {
5480 #[inline]
5481 unsafe fn encode(
5482 self,
5483 encoder: &mut fidl::encoding::Encoder<
5484 '_,
5485 fidl::encoding::DefaultFuchsiaResourceDialect,
5486 >,
5487 offset: usize,
5488 depth: fidl::encoding::Depth,
5489 ) -> fidl::Result<()> {
5490 encoder.debug_check_bounds::<BlobReaderGetVmoResponse>(offset);
5491 self.0.encode(encoder, offset + 0, depth)?;
5495 Ok(())
5496 }
5497 }
5498
5499 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5500 for BlobReaderGetVmoResponse
5501 {
5502 #[inline(always)]
5503 fn new_empty() -> Self {
5504 Self {
5505 vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5506 }
5507 }
5508
5509 #[inline]
5510 unsafe fn decode(
5511 &mut self,
5512 decoder: &mut fidl::encoding::Decoder<
5513 '_,
5514 fidl::encoding::DefaultFuchsiaResourceDialect,
5515 >,
5516 offset: usize,
5517 _depth: fidl::encoding::Depth,
5518 ) -> fidl::Result<()> {
5519 decoder.debug_check_bounds::<Self>(offset);
5520 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
5522 Ok(())
5523 }
5524 }
5525
5526 impl fidl::encoding::ResourceTypeMarker for BlobWriterGetVmoResponse {
5527 type Borrowed<'a> = &'a mut Self;
5528 fn take_or_borrow<'a>(
5529 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5530 ) -> Self::Borrowed<'a> {
5531 value
5532 }
5533 }
5534
5535 unsafe impl fidl::encoding::TypeMarker for BlobWriterGetVmoResponse {
5536 type Owned = Self;
5537
5538 #[inline(always)]
5539 fn inline_align(_context: fidl::encoding::Context) -> usize {
5540 4
5541 }
5542
5543 #[inline(always)]
5544 fn inline_size(_context: fidl::encoding::Context) -> usize {
5545 4
5546 }
5547 }
5548
5549 unsafe impl
5550 fidl::encoding::Encode<
5551 BlobWriterGetVmoResponse,
5552 fidl::encoding::DefaultFuchsiaResourceDialect,
5553 > for &mut BlobWriterGetVmoResponse
5554 {
5555 #[inline]
5556 unsafe fn encode(
5557 self,
5558 encoder: &mut fidl::encoding::Encoder<
5559 '_,
5560 fidl::encoding::DefaultFuchsiaResourceDialect,
5561 >,
5562 offset: usize,
5563 _depth: fidl::encoding::Depth,
5564 ) -> fidl::Result<()> {
5565 encoder.debug_check_bounds::<BlobWriterGetVmoResponse>(offset);
5566 fidl::encoding::Encode::<
5568 BlobWriterGetVmoResponse,
5569 fidl::encoding::DefaultFuchsiaResourceDialect,
5570 >::encode(
5571 (<fidl::encoding::HandleType<
5572 fidl::Vmo,
5573 { fidl::ObjectType::VMO.into_raw() },
5574 2147483648,
5575 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5576 &mut self.vmo
5577 ),),
5578 encoder,
5579 offset,
5580 _depth,
5581 )
5582 }
5583 }
5584 unsafe impl<
5585 T0: fidl::encoding::Encode<
5586 fidl::encoding::HandleType<
5587 fidl::Vmo,
5588 { fidl::ObjectType::VMO.into_raw() },
5589 2147483648,
5590 >,
5591 fidl::encoding::DefaultFuchsiaResourceDialect,
5592 >,
5593 >
5594 fidl::encoding::Encode<
5595 BlobWriterGetVmoResponse,
5596 fidl::encoding::DefaultFuchsiaResourceDialect,
5597 > for (T0,)
5598 {
5599 #[inline]
5600 unsafe fn encode(
5601 self,
5602 encoder: &mut fidl::encoding::Encoder<
5603 '_,
5604 fidl::encoding::DefaultFuchsiaResourceDialect,
5605 >,
5606 offset: usize,
5607 depth: fidl::encoding::Depth,
5608 ) -> fidl::Result<()> {
5609 encoder.debug_check_bounds::<BlobWriterGetVmoResponse>(offset);
5610 self.0.encode(encoder, offset + 0, depth)?;
5614 Ok(())
5615 }
5616 }
5617
5618 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5619 for BlobWriterGetVmoResponse
5620 {
5621 #[inline(always)]
5622 fn new_empty() -> Self {
5623 Self {
5624 vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
5625 }
5626 }
5627
5628 #[inline]
5629 unsafe fn decode(
5630 &mut self,
5631 decoder: &mut fidl::encoding::Decoder<
5632 '_,
5633 fidl::encoding::DefaultFuchsiaResourceDialect,
5634 >,
5635 offset: usize,
5636 _depth: fidl::encoding::Depth,
5637 ) -> fidl::Result<()> {
5638 decoder.debug_check_bounds::<Self>(offset);
5639 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
5641 Ok(())
5642 }
5643 }
5644}