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