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