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