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 Self { client: fidl::client::sync::Client::new(channel) }
99 }
100
101 pub fn into_channel(self) -> fidl::Channel {
102 self.client.into_channel()
103 }
104
105 pub fn wait_for_event(
108 &self,
109 deadline: zx::MonotonicInstant,
110 ) -> Result<BlobCreatorEvent, fidl::Error> {
111 BlobCreatorEvent::decode(self.client.wait_for_event::<BlobCreatorMarker>(deadline)?)
112 }
113
114 pub fn r#create(
122 &self,
123 mut hash: &[u8; 32],
124 mut allow_existing: bool,
125 ___deadline: zx::MonotonicInstant,
126 ) -> Result<BlobCreatorCreateResult, fidl::Error> {
127 let _response = self.client.send_query::<
128 BlobCreatorCreateRequest,
129 fidl::encoding::ResultType<BlobCreatorCreateResponse, CreateBlobError>,
130 BlobCreatorMarker,
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 BlobCreatorMarker,
152 >(
153 (blob_hash,),
154 0x512e347a6be3e426,
155 fidl::encoding::DynamicFlags::empty(),
156 ___deadline,
157 )?;
158 Ok(_response.map(|x| x.needs_overwrite))
159 }
160}
161
162#[cfg(target_os = "fuchsia")]
163impl From<BlobCreatorSynchronousProxy> for zx::NullableHandle {
164 fn from(value: BlobCreatorSynchronousProxy) -> Self {
165 value.into_channel().into()
166 }
167}
168
169#[cfg(target_os = "fuchsia")]
170impl From<fidl::Channel> for BlobCreatorSynchronousProxy {
171 fn from(value: fidl::Channel) -> Self {
172 Self::new(value)
173 }
174}
175
176#[cfg(target_os = "fuchsia")]
177impl fidl::endpoints::FromClient for BlobCreatorSynchronousProxy {
178 type Protocol = BlobCreatorMarker;
179
180 fn from_client(value: fidl::endpoints::ClientEnd<BlobCreatorMarker>) -> Self {
181 Self::new(value.into_channel())
182 }
183}
184
185#[derive(Debug, Clone)]
186pub struct BlobCreatorProxy {
187 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
188}
189
190impl fidl::endpoints::Proxy for BlobCreatorProxy {
191 type Protocol = BlobCreatorMarker;
192
193 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
194 Self::new(inner)
195 }
196
197 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
198 self.client.into_channel().map_err(|client| Self { client })
199 }
200
201 fn as_channel(&self) -> &::fidl::AsyncChannel {
202 self.client.as_channel()
203 }
204}
205
206impl BlobCreatorProxy {
207 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
209 let protocol_name = <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
210 Self { client: fidl::client::Client::new(channel, protocol_name) }
211 }
212
213 pub fn take_event_stream(&self) -> BlobCreatorEventStream {
219 BlobCreatorEventStream { event_receiver: self.client.take_event_receiver() }
220 }
221
222 pub fn r#create(
230 &self,
231 mut hash: &[u8; 32],
232 mut allow_existing: bool,
233 ) -> fidl::client::QueryResponseFut<
234 BlobCreatorCreateResult,
235 fidl::encoding::DefaultFuchsiaResourceDialect,
236 > {
237 BlobCreatorProxyInterface::r#create(self, hash, allow_existing)
238 }
239
240 pub fn r#needs_overwrite(
244 &self,
245 mut blob_hash: &[u8; 32],
246 ) -> fidl::client::QueryResponseFut<
247 BlobCreatorNeedsOverwriteResult,
248 fidl::encoding::DefaultFuchsiaResourceDialect,
249 > {
250 BlobCreatorProxyInterface::r#needs_overwrite(self, blob_hash)
251 }
252}
253
254impl BlobCreatorProxyInterface for BlobCreatorProxy {
255 type CreateResponseFut = fidl::client::QueryResponseFut<
256 BlobCreatorCreateResult,
257 fidl::encoding::DefaultFuchsiaResourceDialect,
258 >;
259 fn r#create(&self, mut hash: &[u8; 32], mut allow_existing: bool) -> Self::CreateResponseFut {
260 fn _decode(
261 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
262 ) -> Result<BlobCreatorCreateResult, fidl::Error> {
263 let _response = fidl::client::decode_transaction_body::<
264 fidl::encoding::ResultType<BlobCreatorCreateResponse, CreateBlobError>,
265 fidl::encoding::DefaultFuchsiaResourceDialect,
266 0x4288fe720cca70d7,
267 >(_buf?)?;
268 Ok(_response.map(|x| x.writer))
269 }
270 self.client.send_query_and_decode::<BlobCreatorCreateRequest, BlobCreatorCreateResult>(
271 (hash, allow_existing),
272 0x4288fe720cca70d7,
273 fidl::encoding::DynamicFlags::empty(),
274 _decode,
275 )
276 }
277
278 type NeedsOverwriteResponseFut = fidl::client::QueryResponseFut<
279 BlobCreatorNeedsOverwriteResult,
280 fidl::encoding::DefaultFuchsiaResourceDialect,
281 >;
282 fn r#needs_overwrite(&self, mut blob_hash: &[u8; 32]) -> Self::NeedsOverwriteResponseFut {
283 fn _decode(
284 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
285 ) -> Result<BlobCreatorNeedsOverwriteResult, fidl::Error> {
286 let _response = fidl::client::decode_transaction_body::<
287 fidl::encoding::ResultType<BlobCreatorNeedsOverwriteResponse, i32>,
288 fidl::encoding::DefaultFuchsiaResourceDialect,
289 0x512e347a6be3e426,
290 >(_buf?)?;
291 Ok(_response.map(|x| x.needs_overwrite))
292 }
293 self.client.send_query_and_decode::<
294 BlobCreatorNeedsOverwriteRequest,
295 BlobCreatorNeedsOverwriteResult,
296 >(
297 (blob_hash,),
298 0x512e347a6be3e426,
299 fidl::encoding::DynamicFlags::empty(),
300 _decode,
301 )
302 }
303}
304
305pub struct BlobCreatorEventStream {
306 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
307}
308
309impl std::marker::Unpin for BlobCreatorEventStream {}
310
311impl futures::stream::FusedStream for BlobCreatorEventStream {
312 fn is_terminated(&self) -> bool {
313 self.event_receiver.is_terminated()
314 }
315}
316
317impl futures::Stream for BlobCreatorEventStream {
318 type Item = Result<BlobCreatorEvent, fidl::Error>;
319
320 fn poll_next(
321 mut self: std::pin::Pin<&mut Self>,
322 cx: &mut std::task::Context<'_>,
323 ) -> std::task::Poll<Option<Self::Item>> {
324 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
325 &mut self.event_receiver,
326 cx
327 )?) {
328 Some(buf) => std::task::Poll::Ready(Some(BlobCreatorEvent::decode(buf))),
329 None => std::task::Poll::Ready(None),
330 }
331 }
332}
333
334#[derive(Debug)]
335pub enum BlobCreatorEvent {}
336
337impl BlobCreatorEvent {
338 fn decode(
340 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
341 ) -> Result<BlobCreatorEvent, fidl::Error> {
342 let (bytes, _handles) = buf.split_mut();
343 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
344 debug_assert_eq!(tx_header.tx_id, 0);
345 match tx_header.ordinal {
346 _ => Err(fidl::Error::UnknownOrdinal {
347 ordinal: tx_header.ordinal,
348 protocol_name: <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
349 }),
350 }
351 }
352}
353
354pub struct BlobCreatorRequestStream {
356 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
357 is_terminated: bool,
358}
359
360impl std::marker::Unpin for BlobCreatorRequestStream {}
361
362impl futures::stream::FusedStream for BlobCreatorRequestStream {
363 fn is_terminated(&self) -> bool {
364 self.is_terminated
365 }
366}
367
368impl fidl::endpoints::RequestStream for BlobCreatorRequestStream {
369 type Protocol = BlobCreatorMarker;
370 type ControlHandle = BlobCreatorControlHandle;
371
372 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
373 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
374 }
375
376 fn control_handle(&self) -> Self::ControlHandle {
377 BlobCreatorControlHandle { inner: self.inner.clone() }
378 }
379
380 fn into_inner(
381 self,
382 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
383 {
384 (self.inner, self.is_terminated)
385 }
386
387 fn from_inner(
388 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
389 is_terminated: bool,
390 ) -> Self {
391 Self { inner, is_terminated }
392 }
393}
394
395impl futures::Stream for BlobCreatorRequestStream {
396 type Item = Result<BlobCreatorRequest, fidl::Error>;
397
398 fn poll_next(
399 mut self: std::pin::Pin<&mut Self>,
400 cx: &mut std::task::Context<'_>,
401 ) -> std::task::Poll<Option<Self::Item>> {
402 let this = &mut *self;
403 if this.inner.check_shutdown(cx) {
404 this.is_terminated = true;
405 return std::task::Poll::Ready(None);
406 }
407 if this.is_terminated {
408 panic!("polled BlobCreatorRequestStream after completion");
409 }
410 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
411 |bytes, handles| {
412 match this.inner.channel().read_etc(cx, bytes, handles) {
413 std::task::Poll::Ready(Ok(())) => {}
414 std::task::Poll::Pending => return std::task::Poll::Pending,
415 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
416 this.is_terminated = true;
417 return std::task::Poll::Ready(None);
418 }
419 std::task::Poll::Ready(Err(e)) => {
420 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
421 e.into(),
422 ))));
423 }
424 }
425
426 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
428
429 std::task::Poll::Ready(Some(match header.ordinal {
430 0x4288fe720cca70d7 => {
431 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
432 let mut req = fidl::new_empty!(
433 BlobCreatorCreateRequest,
434 fidl::encoding::DefaultFuchsiaResourceDialect
435 );
436 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobCreatorCreateRequest>(&header, _body_bytes, handles, &mut req)?;
437 let control_handle = BlobCreatorControlHandle { inner: this.inner.clone() };
438 Ok(BlobCreatorRequest::Create {
439 hash: req.hash,
440 allow_existing: req.allow_existing,
441
442 responder: BlobCreatorCreateResponder {
443 control_handle: std::mem::ManuallyDrop::new(control_handle),
444 tx_id: header.tx_id,
445 },
446 })
447 }
448 0x512e347a6be3e426 => {
449 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
450 let mut req = fidl::new_empty!(
451 BlobCreatorNeedsOverwriteRequest,
452 fidl::encoding::DefaultFuchsiaResourceDialect
453 );
454 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobCreatorNeedsOverwriteRequest>(&header, _body_bytes, handles, &mut req)?;
455 let control_handle = BlobCreatorControlHandle { inner: this.inner.clone() };
456 Ok(BlobCreatorRequest::NeedsOverwrite {
457 blob_hash: req.blob_hash,
458
459 responder: BlobCreatorNeedsOverwriteResponder {
460 control_handle: std::mem::ManuallyDrop::new(control_handle),
461 tx_id: header.tx_id,
462 },
463 })
464 }
465 _ => Err(fidl::Error::UnknownOrdinal {
466 ordinal: header.ordinal,
467 protocol_name:
468 <BlobCreatorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
469 }),
470 }))
471 },
472 )
473 }
474}
475
476#[derive(Debug)]
477pub enum BlobCreatorRequest {
478 Create { hash: [u8; 32], allow_existing: bool, responder: BlobCreatorCreateResponder },
486 NeedsOverwrite { blob_hash: [u8; 32], responder: BlobCreatorNeedsOverwriteResponder },
490}
491
492impl BlobCreatorRequest {
493 #[allow(irrefutable_let_patterns)]
494 pub fn into_create(self) -> Option<([u8; 32], bool, BlobCreatorCreateResponder)> {
495 if let BlobCreatorRequest::Create { hash, allow_existing, responder } = self {
496 Some((hash, allow_existing, responder))
497 } else {
498 None
499 }
500 }
501
502 #[allow(irrefutable_let_patterns)]
503 pub fn into_needs_overwrite(self) -> Option<([u8; 32], BlobCreatorNeedsOverwriteResponder)> {
504 if let BlobCreatorRequest::NeedsOverwrite { blob_hash, responder } = self {
505 Some((blob_hash, responder))
506 } else {
507 None
508 }
509 }
510
511 pub fn method_name(&self) -> &'static str {
513 match *self {
514 BlobCreatorRequest::Create { .. } => "create",
515 BlobCreatorRequest::NeedsOverwrite { .. } => "needs_overwrite",
516 }
517 }
518}
519
520#[derive(Debug, Clone)]
521pub struct BlobCreatorControlHandle {
522 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
523}
524
525impl fidl::endpoints::ControlHandle for BlobCreatorControlHandle {
526 fn shutdown(&self) {
527 self.inner.shutdown()
528 }
529
530 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
531 self.inner.shutdown_with_epitaph(status)
532 }
533
534 fn is_closed(&self) -> bool {
535 self.inner.channel().is_closed()
536 }
537 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
538 self.inner.channel().on_closed()
539 }
540
541 #[cfg(target_os = "fuchsia")]
542 fn signal_peer(
543 &self,
544 clear_mask: zx::Signals,
545 set_mask: zx::Signals,
546 ) -> Result<(), zx_status::Status> {
547 use fidl::Peered;
548 self.inner.channel().signal_peer(clear_mask, set_mask)
549 }
550}
551
552impl BlobCreatorControlHandle {}
553
554#[must_use = "FIDL methods require a response to be sent"]
555#[derive(Debug)]
556pub struct BlobCreatorCreateResponder {
557 control_handle: std::mem::ManuallyDrop<BlobCreatorControlHandle>,
558 tx_id: u32,
559}
560
561impl std::ops::Drop for BlobCreatorCreateResponder {
565 fn drop(&mut self) {
566 self.control_handle.shutdown();
567 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
569 }
570}
571
572impl fidl::endpoints::Responder for BlobCreatorCreateResponder {
573 type ControlHandle = BlobCreatorControlHandle;
574
575 fn control_handle(&self) -> &BlobCreatorControlHandle {
576 &self.control_handle
577 }
578
579 fn drop_without_shutdown(mut self) {
580 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
582 std::mem::forget(self);
584 }
585}
586
587impl BlobCreatorCreateResponder {
588 pub fn send(
592 self,
593 mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
594 ) -> Result<(), fidl::Error> {
595 let _result = self.send_raw(result);
596 if _result.is_err() {
597 self.control_handle.shutdown();
598 }
599 self.drop_without_shutdown();
600 _result
601 }
602
603 pub fn send_no_shutdown_on_err(
605 self,
606 mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
607 ) -> Result<(), fidl::Error> {
608 let _result = self.send_raw(result);
609 self.drop_without_shutdown();
610 _result
611 }
612
613 fn send_raw(
614 &self,
615 mut result: Result<fidl::endpoints::ClientEnd<BlobWriterMarker>, CreateBlobError>,
616 ) -> Result<(), fidl::Error> {
617 self.control_handle.inner.send::<fidl::encoding::ResultType<
618 BlobCreatorCreateResponse,
619 CreateBlobError,
620 >>(
621 result.map(|writer| (writer,)),
622 self.tx_id,
623 0x4288fe720cca70d7,
624 fidl::encoding::DynamicFlags::empty(),
625 )
626 }
627}
628
629#[must_use = "FIDL methods require a response to be sent"]
630#[derive(Debug)]
631pub struct BlobCreatorNeedsOverwriteResponder {
632 control_handle: std::mem::ManuallyDrop<BlobCreatorControlHandle>,
633 tx_id: u32,
634}
635
636impl std::ops::Drop for BlobCreatorNeedsOverwriteResponder {
640 fn drop(&mut self) {
641 self.control_handle.shutdown();
642 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
644 }
645}
646
647impl fidl::endpoints::Responder for BlobCreatorNeedsOverwriteResponder {
648 type ControlHandle = BlobCreatorControlHandle;
649
650 fn control_handle(&self) -> &BlobCreatorControlHandle {
651 &self.control_handle
652 }
653
654 fn drop_without_shutdown(mut self) {
655 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
657 std::mem::forget(self);
659 }
660}
661
662impl BlobCreatorNeedsOverwriteResponder {
663 pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
667 let _result = self.send_raw(result);
668 if _result.is_err() {
669 self.control_handle.shutdown();
670 }
671 self.drop_without_shutdown();
672 _result
673 }
674
675 pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
677 let _result = self.send_raw(result);
678 self.drop_without_shutdown();
679 _result
680 }
681
682 fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
683 self.control_handle
684 .inner
685 .send::<fidl::encoding::ResultType<BlobCreatorNeedsOverwriteResponse, i32>>(
686 result.map(|needs_overwrite| (needs_overwrite,)),
687 self.tx_id,
688 0x512e347a6be3e426,
689 fidl::encoding::DynamicFlags::empty(),
690 )
691 }
692}
693
694#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
695pub struct BlobReaderMarker;
696
697impl fidl::endpoints::ProtocolMarker for BlobReaderMarker {
698 type Proxy = BlobReaderProxy;
699 type RequestStream = BlobReaderRequestStream;
700 #[cfg(target_os = "fuchsia")]
701 type SynchronousProxy = BlobReaderSynchronousProxy;
702
703 const DEBUG_NAME: &'static str = "fuchsia.fxfs.BlobReader";
704}
705impl fidl::endpoints::DiscoverableProtocolMarker for BlobReaderMarker {}
706pub type BlobReaderGetVmoResult = Result<fidl::Vmo, i32>;
707
708pub trait BlobReaderProxyInterface: Send + Sync {
709 type GetVmoResponseFut: std::future::Future<Output = Result<BlobReaderGetVmoResult, fidl::Error>>
710 + Send;
711 fn r#get_vmo(&self, blob_hash: &[u8; 32]) -> Self::GetVmoResponseFut;
712}
713#[derive(Debug)]
714#[cfg(target_os = "fuchsia")]
715pub struct BlobReaderSynchronousProxy {
716 client: fidl::client::sync::Client,
717}
718
719#[cfg(target_os = "fuchsia")]
720impl fidl::endpoints::SynchronousProxy for BlobReaderSynchronousProxy {
721 type Proxy = BlobReaderProxy;
722 type Protocol = BlobReaderMarker;
723
724 fn from_channel(inner: fidl::Channel) -> Self {
725 Self::new(inner)
726 }
727
728 fn into_channel(self) -> fidl::Channel {
729 self.client.into_channel()
730 }
731
732 fn as_channel(&self) -> &fidl::Channel {
733 self.client.as_channel()
734 }
735}
736
737#[cfg(target_os = "fuchsia")]
738impl BlobReaderSynchronousProxy {
739 pub fn new(channel: fidl::Channel) -> Self {
740 Self { client: fidl::client::sync::Client::new(channel) }
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::<BlobReaderMarker>(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 BlobReaderMarker,
766 >(
767 (blob_hash,),
768 0x2fa72823ef7f11f4,
769 fidl::encoding::DynamicFlags::empty(),
770 ___deadline,
771 )?;
772 Ok(_response.map(|x| x.vmo))
773 }
774}
775
776#[cfg(target_os = "fuchsia")]
777impl From<BlobReaderSynchronousProxy> for zx::NullableHandle {
778 fn from(value: BlobReaderSynchronousProxy) -> Self {
779 value.into_channel().into()
780 }
781}
782
783#[cfg(target_os = "fuchsia")]
784impl From<fidl::Channel> for BlobReaderSynchronousProxy {
785 fn from(value: fidl::Channel) -> Self {
786 Self::new(value)
787 }
788}
789
790#[cfg(target_os = "fuchsia")]
791impl fidl::endpoints::FromClient for BlobReaderSynchronousProxy {
792 type Protocol = BlobReaderMarker;
793
794 fn from_client(value: fidl::endpoints::ClientEnd<BlobReaderMarker>) -> Self {
795 Self::new(value.into_channel())
796 }
797}
798
799#[derive(Debug, Clone)]
800pub struct BlobReaderProxy {
801 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
802}
803
804impl fidl::endpoints::Proxy for BlobReaderProxy {
805 type Protocol = BlobReaderMarker;
806
807 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
808 Self::new(inner)
809 }
810
811 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
812 self.client.into_channel().map_err(|client| Self { client })
813 }
814
815 fn as_channel(&self) -> &::fidl::AsyncChannel {
816 self.client.as_channel()
817 }
818}
819
820impl BlobReaderProxy {
821 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
823 let protocol_name = <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
824 Self { client: fidl::client::Client::new(channel, protocol_name) }
825 }
826
827 pub fn take_event_stream(&self) -> BlobReaderEventStream {
833 BlobReaderEventStream { event_receiver: self.client.take_event_receiver() }
834 }
835
836 pub fn r#get_vmo(
838 &self,
839 mut blob_hash: &[u8; 32],
840 ) -> fidl::client::QueryResponseFut<
841 BlobReaderGetVmoResult,
842 fidl::encoding::DefaultFuchsiaResourceDialect,
843 > {
844 BlobReaderProxyInterface::r#get_vmo(self, blob_hash)
845 }
846}
847
848impl BlobReaderProxyInterface for BlobReaderProxy {
849 type GetVmoResponseFut = fidl::client::QueryResponseFut<
850 BlobReaderGetVmoResult,
851 fidl::encoding::DefaultFuchsiaResourceDialect,
852 >;
853 fn r#get_vmo(&self, mut blob_hash: &[u8; 32]) -> Self::GetVmoResponseFut {
854 fn _decode(
855 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
856 ) -> Result<BlobReaderGetVmoResult, fidl::Error> {
857 let _response = fidl::client::decode_transaction_body::<
858 fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>,
859 fidl::encoding::DefaultFuchsiaResourceDialect,
860 0x2fa72823ef7f11f4,
861 >(_buf?)?;
862 Ok(_response.map(|x| x.vmo))
863 }
864 self.client.send_query_and_decode::<BlobReaderGetVmoRequest, BlobReaderGetVmoResult>(
865 (blob_hash,),
866 0x2fa72823ef7f11f4,
867 fidl::encoding::DynamicFlags::empty(),
868 _decode,
869 )
870 }
871}
872
873pub struct BlobReaderEventStream {
874 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
875}
876
877impl std::marker::Unpin for BlobReaderEventStream {}
878
879impl futures::stream::FusedStream for BlobReaderEventStream {
880 fn is_terminated(&self) -> bool {
881 self.event_receiver.is_terminated()
882 }
883}
884
885impl futures::Stream for BlobReaderEventStream {
886 type Item = Result<BlobReaderEvent, fidl::Error>;
887
888 fn poll_next(
889 mut self: std::pin::Pin<&mut Self>,
890 cx: &mut std::task::Context<'_>,
891 ) -> std::task::Poll<Option<Self::Item>> {
892 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
893 &mut self.event_receiver,
894 cx
895 )?) {
896 Some(buf) => std::task::Poll::Ready(Some(BlobReaderEvent::decode(buf))),
897 None => std::task::Poll::Ready(None),
898 }
899 }
900}
901
902#[derive(Debug)]
903pub enum BlobReaderEvent {}
904
905impl BlobReaderEvent {
906 fn decode(
908 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
909 ) -> Result<BlobReaderEvent, fidl::Error> {
910 let (bytes, _handles) = buf.split_mut();
911 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
912 debug_assert_eq!(tx_header.tx_id, 0);
913 match tx_header.ordinal {
914 _ => Err(fidl::Error::UnknownOrdinal {
915 ordinal: tx_header.ordinal,
916 protocol_name: <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
917 }),
918 }
919 }
920}
921
922pub struct BlobReaderRequestStream {
924 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
925 is_terminated: bool,
926}
927
928impl std::marker::Unpin for BlobReaderRequestStream {}
929
930impl futures::stream::FusedStream for BlobReaderRequestStream {
931 fn is_terminated(&self) -> bool {
932 self.is_terminated
933 }
934}
935
936impl fidl::endpoints::RequestStream for BlobReaderRequestStream {
937 type Protocol = BlobReaderMarker;
938 type ControlHandle = BlobReaderControlHandle;
939
940 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
941 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
942 }
943
944 fn control_handle(&self) -> Self::ControlHandle {
945 BlobReaderControlHandle { inner: self.inner.clone() }
946 }
947
948 fn into_inner(
949 self,
950 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
951 {
952 (self.inner, self.is_terminated)
953 }
954
955 fn from_inner(
956 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
957 is_terminated: bool,
958 ) -> Self {
959 Self { inner, is_terminated }
960 }
961}
962
963impl futures::Stream for BlobReaderRequestStream {
964 type Item = Result<BlobReaderRequest, fidl::Error>;
965
966 fn poll_next(
967 mut self: std::pin::Pin<&mut Self>,
968 cx: &mut std::task::Context<'_>,
969 ) -> std::task::Poll<Option<Self::Item>> {
970 let this = &mut *self;
971 if this.inner.check_shutdown(cx) {
972 this.is_terminated = true;
973 return std::task::Poll::Ready(None);
974 }
975 if this.is_terminated {
976 panic!("polled BlobReaderRequestStream after completion");
977 }
978 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
979 |bytes, handles| {
980 match this.inner.channel().read_etc(cx, bytes, handles) {
981 std::task::Poll::Ready(Ok(())) => {}
982 std::task::Poll::Pending => return std::task::Poll::Pending,
983 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
984 this.is_terminated = true;
985 return std::task::Poll::Ready(None);
986 }
987 std::task::Poll::Ready(Err(e)) => {
988 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
989 e.into(),
990 ))));
991 }
992 }
993
994 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
996
997 std::task::Poll::Ready(Some(match header.ordinal {
998 0x2fa72823ef7f11f4 => {
999 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1000 let mut req = fidl::new_empty!(
1001 BlobReaderGetVmoRequest,
1002 fidl::encoding::DefaultFuchsiaResourceDialect
1003 );
1004 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobReaderGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
1005 let control_handle = BlobReaderControlHandle { inner: this.inner.clone() };
1006 Ok(BlobReaderRequest::GetVmo {
1007 blob_hash: req.blob_hash,
1008
1009 responder: BlobReaderGetVmoResponder {
1010 control_handle: std::mem::ManuallyDrop::new(control_handle),
1011 tx_id: header.tx_id,
1012 },
1013 })
1014 }
1015 _ => Err(fidl::Error::UnknownOrdinal {
1016 ordinal: header.ordinal,
1017 protocol_name:
1018 <BlobReaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1019 }),
1020 }))
1021 },
1022 )
1023 }
1024}
1025
1026#[derive(Debug)]
1027pub enum BlobReaderRequest {
1028 GetVmo { blob_hash: [u8; 32], responder: BlobReaderGetVmoResponder },
1030}
1031
1032impl BlobReaderRequest {
1033 #[allow(irrefutable_let_patterns)]
1034 pub fn into_get_vmo(self) -> Option<([u8; 32], BlobReaderGetVmoResponder)> {
1035 if let BlobReaderRequest::GetVmo { blob_hash, responder } = self {
1036 Some((blob_hash, responder))
1037 } else {
1038 None
1039 }
1040 }
1041
1042 pub fn method_name(&self) -> &'static str {
1044 match *self {
1045 BlobReaderRequest::GetVmo { .. } => "get_vmo",
1046 }
1047 }
1048}
1049
1050#[derive(Debug, Clone)]
1051pub struct BlobReaderControlHandle {
1052 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1053}
1054
1055impl fidl::endpoints::ControlHandle for BlobReaderControlHandle {
1056 fn shutdown(&self) {
1057 self.inner.shutdown()
1058 }
1059
1060 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1061 self.inner.shutdown_with_epitaph(status)
1062 }
1063
1064 fn is_closed(&self) -> bool {
1065 self.inner.channel().is_closed()
1066 }
1067 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1068 self.inner.channel().on_closed()
1069 }
1070
1071 #[cfg(target_os = "fuchsia")]
1072 fn signal_peer(
1073 &self,
1074 clear_mask: zx::Signals,
1075 set_mask: zx::Signals,
1076 ) -> Result<(), zx_status::Status> {
1077 use fidl::Peered;
1078 self.inner.channel().signal_peer(clear_mask, set_mask)
1079 }
1080}
1081
1082impl BlobReaderControlHandle {}
1083
1084#[must_use = "FIDL methods require a response to be sent"]
1085#[derive(Debug)]
1086pub struct BlobReaderGetVmoResponder {
1087 control_handle: std::mem::ManuallyDrop<BlobReaderControlHandle>,
1088 tx_id: u32,
1089}
1090
1091impl std::ops::Drop for BlobReaderGetVmoResponder {
1095 fn drop(&mut self) {
1096 self.control_handle.shutdown();
1097 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1099 }
1100}
1101
1102impl fidl::endpoints::Responder for BlobReaderGetVmoResponder {
1103 type ControlHandle = BlobReaderControlHandle;
1104
1105 fn control_handle(&self) -> &BlobReaderControlHandle {
1106 &self.control_handle
1107 }
1108
1109 fn drop_without_shutdown(mut self) {
1110 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1112 std::mem::forget(self);
1114 }
1115}
1116
1117impl BlobReaderGetVmoResponder {
1118 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1122 let _result = self.send_raw(result);
1123 if _result.is_err() {
1124 self.control_handle.shutdown();
1125 }
1126 self.drop_without_shutdown();
1127 _result
1128 }
1129
1130 pub fn send_no_shutdown_on_err(
1132 self,
1133 mut result: Result<fidl::Vmo, i32>,
1134 ) -> Result<(), fidl::Error> {
1135 let _result = self.send_raw(result);
1136 self.drop_without_shutdown();
1137 _result
1138 }
1139
1140 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1141 self.control_handle.inner.send::<fidl::encoding::ResultType<BlobReaderGetVmoResponse, i32>>(
1142 result.map(|vmo| (vmo,)),
1143 self.tx_id,
1144 0x2fa72823ef7f11f4,
1145 fidl::encoding::DynamicFlags::empty(),
1146 )
1147 }
1148}
1149
1150#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1151pub struct BlobWriterMarker;
1152
1153impl fidl::endpoints::ProtocolMarker for BlobWriterMarker {
1154 type Proxy = BlobWriterProxy;
1155 type RequestStream = BlobWriterRequestStream;
1156 #[cfg(target_os = "fuchsia")]
1157 type SynchronousProxy = BlobWriterSynchronousProxy;
1158
1159 const DEBUG_NAME: &'static str = "(anonymous) BlobWriter";
1160}
1161pub type BlobWriterGetVmoResult = Result<fidl::Vmo, i32>;
1162pub type BlobWriterBytesReadyResult = Result<(), i32>;
1163
1164pub trait BlobWriterProxyInterface: Send + Sync {
1165 type GetVmoResponseFut: std::future::Future<Output = Result<BlobWriterGetVmoResult, fidl::Error>>
1166 + Send;
1167 fn r#get_vmo(&self, size: u64) -> Self::GetVmoResponseFut;
1168 type BytesReadyResponseFut: std::future::Future<Output = Result<BlobWriterBytesReadyResult, fidl::Error>>
1169 + Send;
1170 fn r#bytes_ready(&self, bytes_written: u64) -> Self::BytesReadyResponseFut;
1171}
1172#[derive(Debug)]
1173#[cfg(target_os = "fuchsia")]
1174pub struct BlobWriterSynchronousProxy {
1175 client: fidl::client::sync::Client,
1176}
1177
1178#[cfg(target_os = "fuchsia")]
1179impl fidl::endpoints::SynchronousProxy for BlobWriterSynchronousProxy {
1180 type Proxy = BlobWriterProxy;
1181 type Protocol = BlobWriterMarker;
1182
1183 fn from_channel(inner: fidl::Channel) -> Self {
1184 Self::new(inner)
1185 }
1186
1187 fn into_channel(self) -> fidl::Channel {
1188 self.client.into_channel()
1189 }
1190
1191 fn as_channel(&self) -> &fidl::Channel {
1192 self.client.as_channel()
1193 }
1194}
1195
1196#[cfg(target_os = "fuchsia")]
1197impl BlobWriterSynchronousProxy {
1198 pub fn new(channel: fidl::Channel) -> Self {
1199 Self { client: fidl::client::sync::Client::new(channel) }
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::<BlobWriterMarker>(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 BlobWriterMarker,
1235 >(
1236 (size,),
1237 0x50c8988b12b6f893,
1238 fidl::encoding::DynamicFlags::empty(),
1239 ___deadline,
1240 )?;
1241 Ok(_response.map(|x| x.vmo))
1242 }
1243
1244 pub fn r#bytes_ready(
1248 &self,
1249 mut bytes_written: u64,
1250 ___deadline: zx::MonotonicInstant,
1251 ) -> Result<BlobWriterBytesReadyResult, fidl::Error> {
1252 let _response = self.client.send_query::<
1253 BlobWriterBytesReadyRequest,
1254 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1255 BlobWriterMarker,
1256 >(
1257 (bytes_written,),
1258 0x7b308b473606c573,
1259 fidl::encoding::DynamicFlags::empty(),
1260 ___deadline,
1261 )?;
1262 Ok(_response.map(|x| x))
1263 }
1264}
1265
1266#[cfg(target_os = "fuchsia")]
1267impl From<BlobWriterSynchronousProxy> for zx::NullableHandle {
1268 fn from(value: BlobWriterSynchronousProxy) -> Self {
1269 value.into_channel().into()
1270 }
1271}
1272
1273#[cfg(target_os = "fuchsia")]
1274impl From<fidl::Channel> for BlobWriterSynchronousProxy {
1275 fn from(value: fidl::Channel) -> Self {
1276 Self::new(value)
1277 }
1278}
1279
1280#[cfg(target_os = "fuchsia")]
1281impl fidl::endpoints::FromClient for BlobWriterSynchronousProxy {
1282 type Protocol = BlobWriterMarker;
1283
1284 fn from_client(value: fidl::endpoints::ClientEnd<BlobWriterMarker>) -> Self {
1285 Self::new(value.into_channel())
1286 }
1287}
1288
1289#[derive(Debug, Clone)]
1290pub struct BlobWriterProxy {
1291 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1292}
1293
1294impl fidl::endpoints::Proxy for BlobWriterProxy {
1295 type Protocol = BlobWriterMarker;
1296
1297 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1298 Self::new(inner)
1299 }
1300
1301 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1302 self.client.into_channel().map_err(|client| Self { client })
1303 }
1304
1305 fn as_channel(&self) -> &::fidl::AsyncChannel {
1306 self.client.as_channel()
1307 }
1308}
1309
1310impl BlobWriterProxy {
1311 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1313 let protocol_name = <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1314 Self { client: fidl::client::Client::new(channel, protocol_name) }
1315 }
1316
1317 pub fn take_event_stream(&self) -> BlobWriterEventStream {
1323 BlobWriterEventStream { event_receiver: self.client.take_event_receiver() }
1324 }
1325
1326 pub fn r#get_vmo(
1338 &self,
1339 mut size: u64,
1340 ) -> fidl::client::QueryResponseFut<
1341 BlobWriterGetVmoResult,
1342 fidl::encoding::DefaultFuchsiaResourceDialect,
1343 > {
1344 BlobWriterProxyInterface::r#get_vmo(self, size)
1345 }
1346
1347 pub fn r#bytes_ready(
1351 &self,
1352 mut bytes_written: u64,
1353 ) -> fidl::client::QueryResponseFut<
1354 BlobWriterBytesReadyResult,
1355 fidl::encoding::DefaultFuchsiaResourceDialect,
1356 > {
1357 BlobWriterProxyInterface::r#bytes_ready(self, bytes_written)
1358 }
1359}
1360
1361impl BlobWriterProxyInterface for BlobWriterProxy {
1362 type GetVmoResponseFut = fidl::client::QueryResponseFut<
1363 BlobWriterGetVmoResult,
1364 fidl::encoding::DefaultFuchsiaResourceDialect,
1365 >;
1366 fn r#get_vmo(&self, mut size: u64) -> Self::GetVmoResponseFut {
1367 fn _decode(
1368 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1369 ) -> Result<BlobWriterGetVmoResult, fidl::Error> {
1370 let _response = fidl::client::decode_transaction_body::<
1371 fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>,
1372 fidl::encoding::DefaultFuchsiaResourceDialect,
1373 0x50c8988b12b6f893,
1374 >(_buf?)?;
1375 Ok(_response.map(|x| x.vmo))
1376 }
1377 self.client.send_query_and_decode::<BlobWriterGetVmoRequest, BlobWriterGetVmoResult>(
1378 (size,),
1379 0x50c8988b12b6f893,
1380 fidl::encoding::DynamicFlags::empty(),
1381 _decode,
1382 )
1383 }
1384
1385 type BytesReadyResponseFut = fidl::client::QueryResponseFut<
1386 BlobWriterBytesReadyResult,
1387 fidl::encoding::DefaultFuchsiaResourceDialect,
1388 >;
1389 fn r#bytes_ready(&self, mut bytes_written: u64) -> Self::BytesReadyResponseFut {
1390 fn _decode(
1391 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1392 ) -> Result<BlobWriterBytesReadyResult, fidl::Error> {
1393 let _response = fidl::client::decode_transaction_body::<
1394 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1395 fidl::encoding::DefaultFuchsiaResourceDialect,
1396 0x7b308b473606c573,
1397 >(_buf?)?;
1398 Ok(_response.map(|x| x))
1399 }
1400 self.client
1401 .send_query_and_decode::<BlobWriterBytesReadyRequest, BlobWriterBytesReadyResult>(
1402 (bytes_written,),
1403 0x7b308b473606c573,
1404 fidl::encoding::DynamicFlags::empty(),
1405 _decode,
1406 )
1407 }
1408}
1409
1410pub struct BlobWriterEventStream {
1411 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1412}
1413
1414impl std::marker::Unpin for BlobWriterEventStream {}
1415
1416impl futures::stream::FusedStream for BlobWriterEventStream {
1417 fn is_terminated(&self) -> bool {
1418 self.event_receiver.is_terminated()
1419 }
1420}
1421
1422impl futures::Stream for BlobWriterEventStream {
1423 type Item = Result<BlobWriterEvent, fidl::Error>;
1424
1425 fn poll_next(
1426 mut self: std::pin::Pin<&mut Self>,
1427 cx: &mut std::task::Context<'_>,
1428 ) -> std::task::Poll<Option<Self::Item>> {
1429 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1430 &mut self.event_receiver,
1431 cx
1432 )?) {
1433 Some(buf) => std::task::Poll::Ready(Some(BlobWriterEvent::decode(buf))),
1434 None => std::task::Poll::Ready(None),
1435 }
1436 }
1437}
1438
1439#[derive(Debug)]
1440pub enum BlobWriterEvent {}
1441
1442impl BlobWriterEvent {
1443 fn decode(
1445 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1446 ) -> Result<BlobWriterEvent, fidl::Error> {
1447 let (bytes, _handles) = buf.split_mut();
1448 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1449 debug_assert_eq!(tx_header.tx_id, 0);
1450 match tx_header.ordinal {
1451 _ => Err(fidl::Error::UnknownOrdinal {
1452 ordinal: tx_header.ordinal,
1453 protocol_name: <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1454 }),
1455 }
1456 }
1457}
1458
1459pub struct BlobWriterRequestStream {
1461 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1462 is_terminated: bool,
1463}
1464
1465impl std::marker::Unpin for BlobWriterRequestStream {}
1466
1467impl futures::stream::FusedStream for BlobWriterRequestStream {
1468 fn is_terminated(&self) -> bool {
1469 self.is_terminated
1470 }
1471}
1472
1473impl fidl::endpoints::RequestStream for BlobWriterRequestStream {
1474 type Protocol = BlobWriterMarker;
1475 type ControlHandle = BlobWriterControlHandle;
1476
1477 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1478 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1479 }
1480
1481 fn control_handle(&self) -> Self::ControlHandle {
1482 BlobWriterControlHandle { inner: self.inner.clone() }
1483 }
1484
1485 fn into_inner(
1486 self,
1487 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1488 {
1489 (self.inner, self.is_terminated)
1490 }
1491
1492 fn from_inner(
1493 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1494 is_terminated: bool,
1495 ) -> Self {
1496 Self { inner, is_terminated }
1497 }
1498}
1499
1500impl futures::Stream for BlobWriterRequestStream {
1501 type Item = Result<BlobWriterRequest, fidl::Error>;
1502
1503 fn poll_next(
1504 mut self: std::pin::Pin<&mut Self>,
1505 cx: &mut std::task::Context<'_>,
1506 ) -> std::task::Poll<Option<Self::Item>> {
1507 let this = &mut *self;
1508 if this.inner.check_shutdown(cx) {
1509 this.is_terminated = true;
1510 return std::task::Poll::Ready(None);
1511 }
1512 if this.is_terminated {
1513 panic!("polled BlobWriterRequestStream after completion");
1514 }
1515 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1516 |bytes, handles| {
1517 match this.inner.channel().read_etc(cx, bytes, handles) {
1518 std::task::Poll::Ready(Ok(())) => {}
1519 std::task::Poll::Pending => return std::task::Poll::Pending,
1520 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1521 this.is_terminated = true;
1522 return std::task::Poll::Ready(None);
1523 }
1524 std::task::Poll::Ready(Err(e)) => {
1525 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1526 e.into(),
1527 ))));
1528 }
1529 }
1530
1531 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1533
1534 std::task::Poll::Ready(Some(match header.ordinal {
1535 0x50c8988b12b6f893 => {
1536 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1537 let mut req = fidl::new_empty!(
1538 BlobWriterGetVmoRequest,
1539 fidl::encoding::DefaultFuchsiaResourceDialect
1540 );
1541 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobWriterGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
1542 let control_handle = BlobWriterControlHandle { inner: this.inner.clone() };
1543 Ok(BlobWriterRequest::GetVmo {
1544 size: req.size,
1545
1546 responder: BlobWriterGetVmoResponder {
1547 control_handle: std::mem::ManuallyDrop::new(control_handle),
1548 tx_id: header.tx_id,
1549 },
1550 })
1551 }
1552 0x7b308b473606c573 => {
1553 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1554 let mut req = fidl::new_empty!(
1555 BlobWriterBytesReadyRequest,
1556 fidl::encoding::DefaultFuchsiaResourceDialect
1557 );
1558 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BlobWriterBytesReadyRequest>(&header, _body_bytes, handles, &mut req)?;
1559 let control_handle = BlobWriterControlHandle { inner: this.inner.clone() };
1560 Ok(BlobWriterRequest::BytesReady {
1561 bytes_written: req.bytes_written,
1562
1563 responder: BlobWriterBytesReadyResponder {
1564 control_handle: std::mem::ManuallyDrop::new(control_handle),
1565 tx_id: header.tx_id,
1566 },
1567 })
1568 }
1569 _ => Err(fidl::Error::UnknownOrdinal {
1570 ordinal: header.ordinal,
1571 protocol_name:
1572 <BlobWriterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1573 }),
1574 }))
1575 },
1576 )
1577 }
1578}
1579
1580#[derive(Debug)]
1581pub enum BlobWriterRequest {
1582 GetVmo { size: u64, responder: BlobWriterGetVmoResponder },
1594 BytesReady { bytes_written: u64, responder: BlobWriterBytesReadyResponder },
1598}
1599
1600impl BlobWriterRequest {
1601 #[allow(irrefutable_let_patterns)]
1602 pub fn into_get_vmo(self) -> Option<(u64, BlobWriterGetVmoResponder)> {
1603 if let BlobWriterRequest::GetVmo { size, responder } = self {
1604 Some((size, responder))
1605 } else {
1606 None
1607 }
1608 }
1609
1610 #[allow(irrefutable_let_patterns)]
1611 pub fn into_bytes_ready(self) -> Option<(u64, BlobWriterBytesReadyResponder)> {
1612 if let BlobWriterRequest::BytesReady { bytes_written, responder } = self {
1613 Some((bytes_written, responder))
1614 } else {
1615 None
1616 }
1617 }
1618
1619 pub fn method_name(&self) -> &'static str {
1621 match *self {
1622 BlobWriterRequest::GetVmo { .. } => "get_vmo",
1623 BlobWriterRequest::BytesReady { .. } => "bytes_ready",
1624 }
1625 }
1626}
1627
1628#[derive(Debug, Clone)]
1629pub struct BlobWriterControlHandle {
1630 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1631}
1632
1633impl fidl::endpoints::ControlHandle for BlobWriterControlHandle {
1634 fn shutdown(&self) {
1635 self.inner.shutdown()
1636 }
1637
1638 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1639 self.inner.shutdown_with_epitaph(status)
1640 }
1641
1642 fn is_closed(&self) -> bool {
1643 self.inner.channel().is_closed()
1644 }
1645 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1646 self.inner.channel().on_closed()
1647 }
1648
1649 #[cfg(target_os = "fuchsia")]
1650 fn signal_peer(
1651 &self,
1652 clear_mask: zx::Signals,
1653 set_mask: zx::Signals,
1654 ) -> Result<(), zx_status::Status> {
1655 use fidl::Peered;
1656 self.inner.channel().signal_peer(clear_mask, set_mask)
1657 }
1658}
1659
1660impl BlobWriterControlHandle {}
1661
1662#[must_use = "FIDL methods require a response to be sent"]
1663#[derive(Debug)]
1664pub struct BlobWriterGetVmoResponder {
1665 control_handle: std::mem::ManuallyDrop<BlobWriterControlHandle>,
1666 tx_id: u32,
1667}
1668
1669impl std::ops::Drop for BlobWriterGetVmoResponder {
1673 fn drop(&mut self) {
1674 self.control_handle.shutdown();
1675 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1677 }
1678}
1679
1680impl fidl::endpoints::Responder for BlobWriterGetVmoResponder {
1681 type ControlHandle = BlobWriterControlHandle;
1682
1683 fn control_handle(&self) -> &BlobWriterControlHandle {
1684 &self.control_handle
1685 }
1686
1687 fn drop_without_shutdown(mut self) {
1688 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1690 std::mem::forget(self);
1692 }
1693}
1694
1695impl BlobWriterGetVmoResponder {
1696 pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1700 let _result = self.send_raw(result);
1701 if _result.is_err() {
1702 self.control_handle.shutdown();
1703 }
1704 self.drop_without_shutdown();
1705 _result
1706 }
1707
1708 pub fn send_no_shutdown_on_err(
1710 self,
1711 mut result: Result<fidl::Vmo, i32>,
1712 ) -> Result<(), fidl::Error> {
1713 let _result = self.send_raw(result);
1714 self.drop_without_shutdown();
1715 _result
1716 }
1717
1718 fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
1719 self.control_handle.inner.send::<fidl::encoding::ResultType<BlobWriterGetVmoResponse, i32>>(
1720 result.map(|vmo| (vmo,)),
1721 self.tx_id,
1722 0x50c8988b12b6f893,
1723 fidl::encoding::DynamicFlags::empty(),
1724 )
1725 }
1726}
1727
1728#[must_use = "FIDL methods require a response to be sent"]
1729#[derive(Debug)]
1730pub struct BlobWriterBytesReadyResponder {
1731 control_handle: std::mem::ManuallyDrop<BlobWriterControlHandle>,
1732 tx_id: u32,
1733}
1734
1735impl std::ops::Drop for BlobWriterBytesReadyResponder {
1739 fn drop(&mut self) {
1740 self.control_handle.shutdown();
1741 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1743 }
1744}
1745
1746impl fidl::endpoints::Responder for BlobWriterBytesReadyResponder {
1747 type ControlHandle = BlobWriterControlHandle;
1748
1749 fn control_handle(&self) -> &BlobWriterControlHandle {
1750 &self.control_handle
1751 }
1752
1753 fn drop_without_shutdown(mut self) {
1754 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1756 std::mem::forget(self);
1758 }
1759}
1760
1761impl BlobWriterBytesReadyResponder {
1762 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1766 let _result = self.send_raw(result);
1767 if _result.is_err() {
1768 self.control_handle.shutdown();
1769 }
1770 self.drop_without_shutdown();
1771 _result
1772 }
1773
1774 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1776 let _result = self.send_raw(result);
1777 self.drop_without_shutdown();
1778 _result
1779 }
1780
1781 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1782 self.control_handle
1783 .inner
1784 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1785 result,
1786 self.tx_id,
1787 0x7b308b473606c573,
1788 fidl::encoding::DynamicFlags::empty(),
1789 )
1790 }
1791}
1792
1793#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1794pub struct CryptMarker;
1795
1796impl fidl::endpoints::ProtocolMarker for CryptMarker {
1797 type Proxy = CryptProxy;
1798 type RequestStream = CryptRequestStream;
1799 #[cfg(target_os = "fuchsia")]
1800 type SynchronousProxy = CryptSynchronousProxy;
1801
1802 const DEBUG_NAME: &'static str = "fuchsia.fxfs.Crypt";
1803}
1804impl fidl::endpoints::DiscoverableProtocolMarker for CryptMarker {}
1805pub type CryptCreateKeyResult = Result<([u8; 16], Vec<u8>, Vec<u8>), i32>;
1806pub type CryptCreateKeyWithIdResult = Result<(WrappedKey, Vec<u8>), i32>;
1807pub type CryptUnwrapKeyResult = Result<Vec<u8>, i32>;
1808
1809pub trait CryptProxyInterface: Send + Sync {
1810 type CreateKeyResponseFut: std::future::Future<Output = Result<CryptCreateKeyResult, fidl::Error>>
1811 + Send;
1812 fn r#create_key(&self, owner: u64, purpose: KeyPurpose) -> Self::CreateKeyResponseFut;
1813 type CreateKeyWithIdResponseFut: std::future::Future<Output = Result<CryptCreateKeyWithIdResult, fidl::Error>>
1814 + Send;
1815 fn r#create_key_with_id(
1816 &self,
1817 owner: u64,
1818 wrapping_key_id: &[u8; 16],
1819 object_type: ObjectType,
1820 ) -> Self::CreateKeyWithIdResponseFut;
1821 type UnwrapKeyResponseFut: std::future::Future<Output = Result<CryptUnwrapKeyResult, fidl::Error>>
1822 + Send;
1823 fn r#unwrap_key(&self, owner: u64, wrapped_key: &WrappedKey) -> Self::UnwrapKeyResponseFut;
1824}
1825#[derive(Debug)]
1826#[cfg(target_os = "fuchsia")]
1827pub struct CryptSynchronousProxy {
1828 client: fidl::client::sync::Client,
1829}
1830
1831#[cfg(target_os = "fuchsia")]
1832impl fidl::endpoints::SynchronousProxy for CryptSynchronousProxy {
1833 type Proxy = CryptProxy;
1834 type Protocol = CryptMarker;
1835
1836 fn from_channel(inner: fidl::Channel) -> Self {
1837 Self::new(inner)
1838 }
1839
1840 fn into_channel(self) -> fidl::Channel {
1841 self.client.into_channel()
1842 }
1843
1844 fn as_channel(&self) -> &fidl::Channel {
1845 self.client.as_channel()
1846 }
1847}
1848
1849#[cfg(target_os = "fuchsia")]
1850impl CryptSynchronousProxy {
1851 pub fn new(channel: fidl::Channel) -> Self {
1852 Self { client: fidl::client::sync::Client::new(channel) }
1853 }
1854
1855 pub fn into_channel(self) -> fidl::Channel {
1856 self.client.into_channel()
1857 }
1858
1859 pub fn wait_for_event(
1862 &self,
1863 deadline: zx::MonotonicInstant,
1864 ) -> Result<CryptEvent, fidl::Error> {
1865 CryptEvent::decode(self.client.wait_for_event::<CryptMarker>(deadline)?)
1866 }
1867
1868 pub fn r#create_key(
1874 &self,
1875 mut owner: u64,
1876 mut purpose: KeyPurpose,
1877 ___deadline: zx::MonotonicInstant,
1878 ) -> Result<CryptCreateKeyResult, fidl::Error> {
1879 let _response = self.client.send_query::<
1880 CryptCreateKeyRequest,
1881 fidl::encoding::ResultType<CryptCreateKeyResponse, i32>,
1882 CryptMarker,
1883 >(
1884 (owner, purpose,),
1885 0x6ec69b3aee7fdbba,
1886 fidl::encoding::DynamicFlags::empty(),
1887 ___deadline,
1888 )?;
1889 Ok(_response.map(|x| (x.wrapping_key_id, x.wrapped_key, x.unwrapped_key)))
1890 }
1891
1892 pub fn r#create_key_with_id(
1896 &self,
1897 mut owner: u64,
1898 mut wrapping_key_id: &[u8; 16],
1899 mut object_type: ObjectType,
1900 ___deadline: zx::MonotonicInstant,
1901 ) -> Result<CryptCreateKeyWithIdResult, fidl::Error> {
1902 let _response = self.client.send_query::<
1903 CryptCreateKeyWithIdRequest,
1904 fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>,
1905 CryptMarker,
1906 >(
1907 (owner, wrapping_key_id, object_type,),
1908 0x21e8076688700b50,
1909 fidl::encoding::DynamicFlags::empty(),
1910 ___deadline,
1911 )?;
1912 Ok(_response.map(|x| (x.wrapped_key, x.unwrapped_key)))
1913 }
1914
1915 pub fn r#unwrap_key(
1924 &self,
1925 mut owner: u64,
1926 mut wrapped_key: &WrappedKey,
1927 ___deadline: zx::MonotonicInstant,
1928 ) -> Result<CryptUnwrapKeyResult, fidl::Error> {
1929 let _response = self.client.send_query::<
1930 CryptUnwrapKeyRequest,
1931 fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>,
1932 CryptMarker,
1933 >(
1934 (owner, wrapped_key,),
1935 0x6ec34e2b64d46be9,
1936 fidl::encoding::DynamicFlags::empty(),
1937 ___deadline,
1938 )?;
1939 Ok(_response.map(|x| x.unwrapped_key))
1940 }
1941}
1942
1943#[cfg(target_os = "fuchsia")]
1944impl From<CryptSynchronousProxy> for zx::NullableHandle {
1945 fn from(value: CryptSynchronousProxy) -> Self {
1946 value.into_channel().into()
1947 }
1948}
1949
1950#[cfg(target_os = "fuchsia")]
1951impl From<fidl::Channel> for CryptSynchronousProxy {
1952 fn from(value: fidl::Channel) -> Self {
1953 Self::new(value)
1954 }
1955}
1956
1957#[cfg(target_os = "fuchsia")]
1958impl fidl::endpoints::FromClient for CryptSynchronousProxy {
1959 type Protocol = CryptMarker;
1960
1961 fn from_client(value: fidl::endpoints::ClientEnd<CryptMarker>) -> Self {
1962 Self::new(value.into_channel())
1963 }
1964}
1965
1966#[derive(Debug, Clone)]
1967pub struct CryptProxy {
1968 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1969}
1970
1971impl fidl::endpoints::Proxy for CryptProxy {
1972 type Protocol = CryptMarker;
1973
1974 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1975 Self::new(inner)
1976 }
1977
1978 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1979 self.client.into_channel().map_err(|client| Self { client })
1980 }
1981
1982 fn as_channel(&self) -> &::fidl::AsyncChannel {
1983 self.client.as_channel()
1984 }
1985}
1986
1987impl CryptProxy {
1988 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1990 let protocol_name = <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1991 Self { client: fidl::client::Client::new(channel, protocol_name) }
1992 }
1993
1994 pub fn take_event_stream(&self) -> CryptEventStream {
2000 CryptEventStream { event_receiver: self.client.take_event_receiver() }
2001 }
2002
2003 pub fn r#create_key(
2009 &self,
2010 mut owner: u64,
2011 mut purpose: KeyPurpose,
2012 ) -> fidl::client::QueryResponseFut<
2013 CryptCreateKeyResult,
2014 fidl::encoding::DefaultFuchsiaResourceDialect,
2015 > {
2016 CryptProxyInterface::r#create_key(self, owner, purpose)
2017 }
2018
2019 pub fn r#create_key_with_id(
2023 &self,
2024 mut owner: u64,
2025 mut wrapping_key_id: &[u8; 16],
2026 mut object_type: ObjectType,
2027 ) -> fidl::client::QueryResponseFut<
2028 CryptCreateKeyWithIdResult,
2029 fidl::encoding::DefaultFuchsiaResourceDialect,
2030 > {
2031 CryptProxyInterface::r#create_key_with_id(self, owner, wrapping_key_id, object_type)
2032 }
2033
2034 pub fn r#unwrap_key(
2043 &self,
2044 mut owner: u64,
2045 mut wrapped_key: &WrappedKey,
2046 ) -> fidl::client::QueryResponseFut<
2047 CryptUnwrapKeyResult,
2048 fidl::encoding::DefaultFuchsiaResourceDialect,
2049 > {
2050 CryptProxyInterface::r#unwrap_key(self, owner, wrapped_key)
2051 }
2052}
2053
2054impl CryptProxyInterface for CryptProxy {
2055 type CreateKeyResponseFut = fidl::client::QueryResponseFut<
2056 CryptCreateKeyResult,
2057 fidl::encoding::DefaultFuchsiaResourceDialect,
2058 >;
2059 fn r#create_key(&self, mut owner: u64, mut purpose: KeyPurpose) -> Self::CreateKeyResponseFut {
2060 fn _decode(
2061 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2062 ) -> Result<CryptCreateKeyResult, fidl::Error> {
2063 let _response = fidl::client::decode_transaction_body::<
2064 fidl::encoding::ResultType<CryptCreateKeyResponse, i32>,
2065 fidl::encoding::DefaultFuchsiaResourceDialect,
2066 0x6ec69b3aee7fdbba,
2067 >(_buf?)?;
2068 Ok(_response.map(|x| (x.wrapping_key_id, x.wrapped_key, x.unwrapped_key)))
2069 }
2070 self.client.send_query_and_decode::<CryptCreateKeyRequest, CryptCreateKeyResult>(
2071 (owner, purpose),
2072 0x6ec69b3aee7fdbba,
2073 fidl::encoding::DynamicFlags::empty(),
2074 _decode,
2075 )
2076 }
2077
2078 type CreateKeyWithIdResponseFut = fidl::client::QueryResponseFut<
2079 CryptCreateKeyWithIdResult,
2080 fidl::encoding::DefaultFuchsiaResourceDialect,
2081 >;
2082 fn r#create_key_with_id(
2083 &self,
2084 mut owner: u64,
2085 mut wrapping_key_id: &[u8; 16],
2086 mut object_type: ObjectType,
2087 ) -> Self::CreateKeyWithIdResponseFut {
2088 fn _decode(
2089 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2090 ) -> Result<CryptCreateKeyWithIdResult, fidl::Error> {
2091 let _response = fidl::client::decode_transaction_body::<
2092 fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>,
2093 fidl::encoding::DefaultFuchsiaResourceDialect,
2094 0x21e8076688700b50,
2095 >(_buf?)?;
2096 Ok(_response.map(|x| (x.wrapped_key, x.unwrapped_key)))
2097 }
2098 self.client
2099 .send_query_and_decode::<CryptCreateKeyWithIdRequest, CryptCreateKeyWithIdResult>(
2100 (owner, wrapping_key_id, object_type),
2101 0x21e8076688700b50,
2102 fidl::encoding::DynamicFlags::empty(),
2103 _decode,
2104 )
2105 }
2106
2107 type UnwrapKeyResponseFut = fidl::client::QueryResponseFut<
2108 CryptUnwrapKeyResult,
2109 fidl::encoding::DefaultFuchsiaResourceDialect,
2110 >;
2111 fn r#unwrap_key(
2112 &self,
2113 mut owner: u64,
2114 mut wrapped_key: &WrappedKey,
2115 ) -> Self::UnwrapKeyResponseFut {
2116 fn _decode(
2117 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2118 ) -> Result<CryptUnwrapKeyResult, fidl::Error> {
2119 let _response = fidl::client::decode_transaction_body::<
2120 fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>,
2121 fidl::encoding::DefaultFuchsiaResourceDialect,
2122 0x6ec34e2b64d46be9,
2123 >(_buf?)?;
2124 Ok(_response.map(|x| x.unwrapped_key))
2125 }
2126 self.client.send_query_and_decode::<CryptUnwrapKeyRequest, CryptUnwrapKeyResult>(
2127 (owner, wrapped_key),
2128 0x6ec34e2b64d46be9,
2129 fidl::encoding::DynamicFlags::empty(),
2130 _decode,
2131 )
2132 }
2133}
2134
2135pub struct CryptEventStream {
2136 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2137}
2138
2139impl std::marker::Unpin for CryptEventStream {}
2140
2141impl futures::stream::FusedStream for CryptEventStream {
2142 fn is_terminated(&self) -> bool {
2143 self.event_receiver.is_terminated()
2144 }
2145}
2146
2147impl futures::Stream for CryptEventStream {
2148 type Item = Result<CryptEvent, fidl::Error>;
2149
2150 fn poll_next(
2151 mut self: std::pin::Pin<&mut Self>,
2152 cx: &mut std::task::Context<'_>,
2153 ) -> std::task::Poll<Option<Self::Item>> {
2154 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2155 &mut self.event_receiver,
2156 cx
2157 )?) {
2158 Some(buf) => std::task::Poll::Ready(Some(CryptEvent::decode(buf))),
2159 None => std::task::Poll::Ready(None),
2160 }
2161 }
2162}
2163
2164#[derive(Debug)]
2165pub enum CryptEvent {}
2166
2167impl CryptEvent {
2168 fn decode(
2170 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2171 ) -> Result<CryptEvent, fidl::Error> {
2172 let (bytes, _handles) = buf.split_mut();
2173 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2174 debug_assert_eq!(tx_header.tx_id, 0);
2175 match tx_header.ordinal {
2176 _ => Err(fidl::Error::UnknownOrdinal {
2177 ordinal: tx_header.ordinal,
2178 protocol_name: <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2179 }),
2180 }
2181 }
2182}
2183
2184pub struct CryptRequestStream {
2186 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2187 is_terminated: bool,
2188}
2189
2190impl std::marker::Unpin for CryptRequestStream {}
2191
2192impl futures::stream::FusedStream for CryptRequestStream {
2193 fn is_terminated(&self) -> bool {
2194 self.is_terminated
2195 }
2196}
2197
2198impl fidl::endpoints::RequestStream for CryptRequestStream {
2199 type Protocol = CryptMarker;
2200 type ControlHandle = CryptControlHandle;
2201
2202 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2203 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2204 }
2205
2206 fn control_handle(&self) -> Self::ControlHandle {
2207 CryptControlHandle { inner: self.inner.clone() }
2208 }
2209
2210 fn into_inner(
2211 self,
2212 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2213 {
2214 (self.inner, self.is_terminated)
2215 }
2216
2217 fn from_inner(
2218 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2219 is_terminated: bool,
2220 ) -> Self {
2221 Self { inner, is_terminated }
2222 }
2223}
2224
2225impl futures::Stream for CryptRequestStream {
2226 type Item = Result<CryptRequest, fidl::Error>;
2227
2228 fn poll_next(
2229 mut self: std::pin::Pin<&mut Self>,
2230 cx: &mut std::task::Context<'_>,
2231 ) -> std::task::Poll<Option<Self::Item>> {
2232 let this = &mut *self;
2233 if this.inner.check_shutdown(cx) {
2234 this.is_terminated = true;
2235 return std::task::Poll::Ready(None);
2236 }
2237 if this.is_terminated {
2238 panic!("polled CryptRequestStream after completion");
2239 }
2240 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2241 |bytes, handles| {
2242 match this.inner.channel().read_etc(cx, bytes, handles) {
2243 std::task::Poll::Ready(Ok(())) => {}
2244 std::task::Poll::Pending => return std::task::Poll::Pending,
2245 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2246 this.is_terminated = true;
2247 return std::task::Poll::Ready(None);
2248 }
2249 std::task::Poll::Ready(Err(e)) => {
2250 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2251 e.into(),
2252 ))));
2253 }
2254 }
2255
2256 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2258
2259 std::task::Poll::Ready(Some(match header.ordinal {
2260 0x6ec69b3aee7fdbba => {
2261 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2262 let mut req = fidl::new_empty!(
2263 CryptCreateKeyRequest,
2264 fidl::encoding::DefaultFuchsiaResourceDialect
2265 );
2266 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptCreateKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2267 let control_handle = CryptControlHandle { inner: this.inner.clone() };
2268 Ok(CryptRequest::CreateKey {
2269 owner: req.owner,
2270 purpose: req.purpose,
2271
2272 responder: CryptCreateKeyResponder {
2273 control_handle: std::mem::ManuallyDrop::new(control_handle),
2274 tx_id: header.tx_id,
2275 },
2276 })
2277 }
2278 0x21e8076688700b50 => {
2279 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2280 let mut req = fidl::new_empty!(
2281 CryptCreateKeyWithIdRequest,
2282 fidl::encoding::DefaultFuchsiaResourceDialect
2283 );
2284 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptCreateKeyWithIdRequest>(&header, _body_bytes, handles, &mut req)?;
2285 let control_handle = CryptControlHandle { inner: this.inner.clone() };
2286 Ok(CryptRequest::CreateKeyWithId {
2287 owner: req.owner,
2288 wrapping_key_id: req.wrapping_key_id,
2289 object_type: req.object_type,
2290
2291 responder: CryptCreateKeyWithIdResponder {
2292 control_handle: std::mem::ManuallyDrop::new(control_handle),
2293 tx_id: header.tx_id,
2294 },
2295 })
2296 }
2297 0x6ec34e2b64d46be9 => {
2298 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2299 let mut req = fidl::new_empty!(
2300 CryptUnwrapKeyRequest,
2301 fidl::encoding::DefaultFuchsiaResourceDialect
2302 );
2303 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptUnwrapKeyRequest>(&header, _body_bytes, handles, &mut req)?;
2304 let control_handle = CryptControlHandle { inner: this.inner.clone() };
2305 Ok(CryptRequest::UnwrapKey {
2306 owner: req.owner,
2307 wrapped_key: req.wrapped_key,
2308
2309 responder: CryptUnwrapKeyResponder {
2310 control_handle: std::mem::ManuallyDrop::new(control_handle),
2311 tx_id: header.tx_id,
2312 },
2313 })
2314 }
2315 _ => Err(fidl::Error::UnknownOrdinal {
2316 ordinal: header.ordinal,
2317 protocol_name: <CryptMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2318 }),
2319 }))
2320 },
2321 )
2322 }
2323}
2324
2325#[derive(Debug)]
2326pub enum CryptRequest {
2327 CreateKey { owner: u64, purpose: KeyPurpose, responder: CryptCreateKeyResponder },
2333 CreateKeyWithId {
2337 owner: u64,
2338 wrapping_key_id: [u8; 16],
2339 object_type: ObjectType,
2340 responder: CryptCreateKeyWithIdResponder,
2341 },
2342 UnwrapKey { owner: u64, wrapped_key: WrappedKey, responder: CryptUnwrapKeyResponder },
2351}
2352
2353impl CryptRequest {
2354 #[allow(irrefutable_let_patterns)]
2355 pub fn into_create_key(self) -> Option<(u64, KeyPurpose, CryptCreateKeyResponder)> {
2356 if let CryptRequest::CreateKey { owner, purpose, responder } = self {
2357 Some((owner, purpose, responder))
2358 } else {
2359 None
2360 }
2361 }
2362
2363 #[allow(irrefutable_let_patterns)]
2364 pub fn into_create_key_with_id(
2365 self,
2366 ) -> Option<(u64, [u8; 16], ObjectType, CryptCreateKeyWithIdResponder)> {
2367 if let CryptRequest::CreateKeyWithId { owner, wrapping_key_id, object_type, responder } =
2368 self
2369 {
2370 Some((owner, wrapping_key_id, object_type, responder))
2371 } else {
2372 None
2373 }
2374 }
2375
2376 #[allow(irrefutable_let_patterns)]
2377 pub fn into_unwrap_key(self) -> Option<(u64, WrappedKey, CryptUnwrapKeyResponder)> {
2378 if let CryptRequest::UnwrapKey { owner, wrapped_key, responder } = self {
2379 Some((owner, wrapped_key, responder))
2380 } else {
2381 None
2382 }
2383 }
2384
2385 pub fn method_name(&self) -> &'static str {
2387 match *self {
2388 CryptRequest::CreateKey { .. } => "create_key",
2389 CryptRequest::CreateKeyWithId { .. } => "create_key_with_id",
2390 CryptRequest::UnwrapKey { .. } => "unwrap_key",
2391 }
2392 }
2393}
2394
2395#[derive(Debug, Clone)]
2396pub struct CryptControlHandle {
2397 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2398}
2399
2400impl fidl::endpoints::ControlHandle for CryptControlHandle {
2401 fn shutdown(&self) {
2402 self.inner.shutdown()
2403 }
2404
2405 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2406 self.inner.shutdown_with_epitaph(status)
2407 }
2408
2409 fn is_closed(&self) -> bool {
2410 self.inner.channel().is_closed()
2411 }
2412 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2413 self.inner.channel().on_closed()
2414 }
2415
2416 #[cfg(target_os = "fuchsia")]
2417 fn signal_peer(
2418 &self,
2419 clear_mask: zx::Signals,
2420 set_mask: zx::Signals,
2421 ) -> Result<(), zx_status::Status> {
2422 use fidl::Peered;
2423 self.inner.channel().signal_peer(clear_mask, set_mask)
2424 }
2425}
2426
2427impl CryptControlHandle {}
2428
2429#[must_use = "FIDL methods require a response to be sent"]
2430#[derive(Debug)]
2431pub struct CryptCreateKeyResponder {
2432 control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
2433 tx_id: u32,
2434}
2435
2436impl std::ops::Drop for CryptCreateKeyResponder {
2440 fn drop(&mut self) {
2441 self.control_handle.shutdown();
2442 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2444 }
2445}
2446
2447impl fidl::endpoints::Responder for CryptCreateKeyResponder {
2448 type ControlHandle = CryptControlHandle;
2449
2450 fn control_handle(&self) -> &CryptControlHandle {
2451 &self.control_handle
2452 }
2453
2454 fn drop_without_shutdown(mut self) {
2455 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2457 std::mem::forget(self);
2459 }
2460}
2461
2462impl CryptCreateKeyResponder {
2463 pub fn send(
2467 self,
2468 mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
2469 ) -> Result<(), fidl::Error> {
2470 let _result = self.send_raw(result);
2471 if _result.is_err() {
2472 self.control_handle.shutdown();
2473 }
2474 self.drop_without_shutdown();
2475 _result
2476 }
2477
2478 pub fn send_no_shutdown_on_err(
2480 self,
2481 mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
2482 ) -> Result<(), fidl::Error> {
2483 let _result = self.send_raw(result);
2484 self.drop_without_shutdown();
2485 _result
2486 }
2487
2488 fn send_raw(
2489 &self,
2490 mut result: Result<(&[u8; 16], &[u8], &[u8]), i32>,
2491 ) -> Result<(), fidl::Error> {
2492 self.control_handle.inner.send::<fidl::encoding::ResultType<CryptCreateKeyResponse, i32>>(
2493 result,
2494 self.tx_id,
2495 0x6ec69b3aee7fdbba,
2496 fidl::encoding::DynamicFlags::empty(),
2497 )
2498 }
2499}
2500
2501#[must_use = "FIDL methods require a response to be sent"]
2502#[derive(Debug)]
2503pub struct CryptCreateKeyWithIdResponder {
2504 control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
2505 tx_id: u32,
2506}
2507
2508impl std::ops::Drop for CryptCreateKeyWithIdResponder {
2512 fn drop(&mut self) {
2513 self.control_handle.shutdown();
2514 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2516 }
2517}
2518
2519impl fidl::endpoints::Responder for CryptCreateKeyWithIdResponder {
2520 type ControlHandle = CryptControlHandle;
2521
2522 fn control_handle(&self) -> &CryptControlHandle {
2523 &self.control_handle
2524 }
2525
2526 fn drop_without_shutdown(mut self) {
2527 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2529 std::mem::forget(self);
2531 }
2532}
2533
2534impl CryptCreateKeyWithIdResponder {
2535 pub fn send(self, mut result: Result<(&WrappedKey, &[u8]), i32>) -> Result<(), fidl::Error> {
2539 let _result = self.send_raw(result);
2540 if _result.is_err() {
2541 self.control_handle.shutdown();
2542 }
2543 self.drop_without_shutdown();
2544 _result
2545 }
2546
2547 pub fn send_no_shutdown_on_err(
2549 self,
2550 mut result: Result<(&WrappedKey, &[u8]), i32>,
2551 ) -> Result<(), fidl::Error> {
2552 let _result = self.send_raw(result);
2553 self.drop_without_shutdown();
2554 _result
2555 }
2556
2557 fn send_raw(&self, mut result: Result<(&WrappedKey, &[u8]), i32>) -> Result<(), fidl::Error> {
2558 self.control_handle
2559 .inner
2560 .send::<fidl::encoding::ResultType<CryptCreateKeyWithIdResponse, i32>>(
2561 result,
2562 self.tx_id,
2563 0x21e8076688700b50,
2564 fidl::encoding::DynamicFlags::empty(),
2565 )
2566 }
2567}
2568
2569#[must_use = "FIDL methods require a response to be sent"]
2570#[derive(Debug)]
2571pub struct CryptUnwrapKeyResponder {
2572 control_handle: std::mem::ManuallyDrop<CryptControlHandle>,
2573 tx_id: u32,
2574}
2575
2576impl std::ops::Drop for CryptUnwrapKeyResponder {
2580 fn drop(&mut self) {
2581 self.control_handle.shutdown();
2582 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2584 }
2585}
2586
2587impl fidl::endpoints::Responder for CryptUnwrapKeyResponder {
2588 type ControlHandle = CryptControlHandle;
2589
2590 fn control_handle(&self) -> &CryptControlHandle {
2591 &self.control_handle
2592 }
2593
2594 fn drop_without_shutdown(mut self) {
2595 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2597 std::mem::forget(self);
2599 }
2600}
2601
2602impl CryptUnwrapKeyResponder {
2603 pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2607 let _result = self.send_raw(result);
2608 if _result.is_err() {
2609 self.control_handle.shutdown();
2610 }
2611 self.drop_without_shutdown();
2612 _result
2613 }
2614
2615 pub fn send_no_shutdown_on_err(
2617 self,
2618 mut result: Result<&[u8], i32>,
2619 ) -> Result<(), fidl::Error> {
2620 let _result = self.send_raw(result);
2621 self.drop_without_shutdown();
2622 _result
2623 }
2624
2625 fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2626 self.control_handle.inner.send::<fidl::encoding::ResultType<CryptUnwrapKeyResponse, i32>>(
2627 result.map(|unwrapped_key| (unwrapped_key,)),
2628 self.tx_id,
2629 0x6ec34e2b64d46be9,
2630 fidl::encoding::DynamicFlags::empty(),
2631 )
2632 }
2633}
2634
2635#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2636pub struct CryptManagementMarker;
2637
2638impl fidl::endpoints::ProtocolMarker for CryptManagementMarker {
2639 type Proxy = CryptManagementProxy;
2640 type RequestStream = CryptManagementRequestStream;
2641 #[cfg(target_os = "fuchsia")]
2642 type SynchronousProxy = CryptManagementSynchronousProxy;
2643
2644 const DEBUG_NAME: &'static str = "fuchsia.fxfs.CryptManagement";
2645}
2646impl fidl::endpoints::DiscoverableProtocolMarker for CryptManagementMarker {}
2647pub type CryptManagementAddWrappingKeyResult = Result<(), i32>;
2648pub type CryptManagementSetActiveKeyResult = Result<(), i32>;
2649pub type CryptManagementForgetWrappingKeyResult = Result<(), i32>;
2650
2651pub trait CryptManagementProxyInterface: Send + Sync {
2652 type AddWrappingKeyResponseFut: std::future::Future<Output = Result<CryptManagementAddWrappingKeyResult, fidl::Error>>
2653 + Send;
2654 fn r#add_wrapping_key(
2655 &self,
2656 wrapping_key_id: &[u8; 16],
2657 key: &[u8],
2658 ) -> Self::AddWrappingKeyResponseFut;
2659 type SetActiveKeyResponseFut: std::future::Future<Output = Result<CryptManagementSetActiveKeyResult, fidl::Error>>
2660 + Send;
2661 fn r#set_active_key(
2662 &self,
2663 purpose: KeyPurpose,
2664 wrapping_key_id: &[u8; 16],
2665 ) -> Self::SetActiveKeyResponseFut;
2666 type ForgetWrappingKeyResponseFut: std::future::Future<Output = Result<CryptManagementForgetWrappingKeyResult, fidl::Error>>
2667 + Send;
2668 fn r#forget_wrapping_key(
2669 &self,
2670 wrapping_key_id: &[u8; 16],
2671 ) -> Self::ForgetWrappingKeyResponseFut;
2672}
2673#[derive(Debug)]
2674#[cfg(target_os = "fuchsia")]
2675pub struct CryptManagementSynchronousProxy {
2676 client: fidl::client::sync::Client,
2677}
2678
2679#[cfg(target_os = "fuchsia")]
2680impl fidl::endpoints::SynchronousProxy for CryptManagementSynchronousProxy {
2681 type Proxy = CryptManagementProxy;
2682 type Protocol = CryptManagementMarker;
2683
2684 fn from_channel(inner: fidl::Channel) -> Self {
2685 Self::new(inner)
2686 }
2687
2688 fn into_channel(self) -> fidl::Channel {
2689 self.client.into_channel()
2690 }
2691
2692 fn as_channel(&self) -> &fidl::Channel {
2693 self.client.as_channel()
2694 }
2695}
2696
2697#[cfg(target_os = "fuchsia")]
2698impl CryptManagementSynchronousProxy {
2699 pub fn new(channel: fidl::Channel) -> Self {
2700 Self { client: fidl::client::sync::Client::new(channel) }
2701 }
2702
2703 pub fn into_channel(self) -> fidl::Channel {
2704 self.client.into_channel()
2705 }
2706
2707 pub fn wait_for_event(
2710 &self,
2711 deadline: zx::MonotonicInstant,
2712 ) -> Result<CryptManagementEvent, fidl::Error> {
2713 CryptManagementEvent::decode(self.client.wait_for_event::<CryptManagementMarker>(deadline)?)
2714 }
2715
2716 pub fn r#add_wrapping_key(
2720 &self,
2721 mut wrapping_key_id: &[u8; 16],
2722 mut key: &[u8],
2723 ___deadline: zx::MonotonicInstant,
2724 ) -> Result<CryptManagementAddWrappingKeyResult, fidl::Error> {
2725 let _response = self.client.send_query::<
2726 CryptManagementAddWrappingKeyRequest,
2727 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2728 CryptManagementMarker,
2729 >(
2730 (wrapping_key_id, key,),
2731 0x59a5076762318bf,
2732 fidl::encoding::DynamicFlags::empty(),
2733 ___deadline,
2734 )?;
2735 Ok(_response.map(|x| x))
2736 }
2737
2738 pub fn r#set_active_key(
2741 &self,
2742 mut purpose: KeyPurpose,
2743 mut wrapping_key_id: &[u8; 16],
2744 ___deadline: zx::MonotonicInstant,
2745 ) -> Result<CryptManagementSetActiveKeyResult, fidl::Error> {
2746 let _response = self.client.send_query::<
2747 CryptManagementSetActiveKeyRequest,
2748 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2749 CryptManagementMarker,
2750 >(
2751 (purpose, wrapping_key_id,),
2752 0x5e81d600442f2872,
2753 fidl::encoding::DynamicFlags::empty(),
2754 ___deadline,
2755 )?;
2756 Ok(_response.map(|x| x))
2757 }
2758
2759 pub fn r#forget_wrapping_key(
2763 &self,
2764 mut wrapping_key_id: &[u8; 16],
2765 ___deadline: zx::MonotonicInstant,
2766 ) -> Result<CryptManagementForgetWrappingKeyResult, fidl::Error> {
2767 let _response = self.client.send_query::<
2768 CryptManagementForgetWrappingKeyRequest,
2769 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2770 CryptManagementMarker,
2771 >(
2772 (wrapping_key_id,),
2773 0x436d6d27696dfcf4,
2774 fidl::encoding::DynamicFlags::empty(),
2775 ___deadline,
2776 )?;
2777 Ok(_response.map(|x| x))
2778 }
2779}
2780
2781#[cfg(target_os = "fuchsia")]
2782impl From<CryptManagementSynchronousProxy> for zx::NullableHandle {
2783 fn from(value: CryptManagementSynchronousProxy) -> Self {
2784 value.into_channel().into()
2785 }
2786}
2787
2788#[cfg(target_os = "fuchsia")]
2789impl From<fidl::Channel> for CryptManagementSynchronousProxy {
2790 fn from(value: fidl::Channel) -> Self {
2791 Self::new(value)
2792 }
2793}
2794
2795#[cfg(target_os = "fuchsia")]
2796impl fidl::endpoints::FromClient for CryptManagementSynchronousProxy {
2797 type Protocol = CryptManagementMarker;
2798
2799 fn from_client(value: fidl::endpoints::ClientEnd<CryptManagementMarker>) -> Self {
2800 Self::new(value.into_channel())
2801 }
2802}
2803
2804#[derive(Debug, Clone)]
2805pub struct CryptManagementProxy {
2806 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2807}
2808
2809impl fidl::endpoints::Proxy for CryptManagementProxy {
2810 type Protocol = CryptManagementMarker;
2811
2812 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2813 Self::new(inner)
2814 }
2815
2816 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2817 self.client.into_channel().map_err(|client| Self { client })
2818 }
2819
2820 fn as_channel(&self) -> &::fidl::AsyncChannel {
2821 self.client.as_channel()
2822 }
2823}
2824
2825impl CryptManagementProxy {
2826 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2828 let protocol_name = <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2829 Self { client: fidl::client::Client::new(channel, protocol_name) }
2830 }
2831
2832 pub fn take_event_stream(&self) -> CryptManagementEventStream {
2838 CryptManagementEventStream { event_receiver: self.client.take_event_receiver() }
2839 }
2840
2841 pub fn r#add_wrapping_key(
2845 &self,
2846 mut wrapping_key_id: &[u8; 16],
2847 mut key: &[u8],
2848 ) -> fidl::client::QueryResponseFut<
2849 CryptManagementAddWrappingKeyResult,
2850 fidl::encoding::DefaultFuchsiaResourceDialect,
2851 > {
2852 CryptManagementProxyInterface::r#add_wrapping_key(self, wrapping_key_id, key)
2853 }
2854
2855 pub fn r#set_active_key(
2858 &self,
2859 mut purpose: KeyPurpose,
2860 mut wrapping_key_id: &[u8; 16],
2861 ) -> fidl::client::QueryResponseFut<
2862 CryptManagementSetActiveKeyResult,
2863 fidl::encoding::DefaultFuchsiaResourceDialect,
2864 > {
2865 CryptManagementProxyInterface::r#set_active_key(self, purpose, wrapping_key_id)
2866 }
2867
2868 pub fn r#forget_wrapping_key(
2872 &self,
2873 mut wrapping_key_id: &[u8; 16],
2874 ) -> fidl::client::QueryResponseFut<
2875 CryptManagementForgetWrappingKeyResult,
2876 fidl::encoding::DefaultFuchsiaResourceDialect,
2877 > {
2878 CryptManagementProxyInterface::r#forget_wrapping_key(self, wrapping_key_id)
2879 }
2880}
2881
2882impl CryptManagementProxyInterface for CryptManagementProxy {
2883 type AddWrappingKeyResponseFut = fidl::client::QueryResponseFut<
2884 CryptManagementAddWrappingKeyResult,
2885 fidl::encoding::DefaultFuchsiaResourceDialect,
2886 >;
2887 fn r#add_wrapping_key(
2888 &self,
2889 mut wrapping_key_id: &[u8; 16],
2890 mut key: &[u8],
2891 ) -> Self::AddWrappingKeyResponseFut {
2892 fn _decode(
2893 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2894 ) -> Result<CryptManagementAddWrappingKeyResult, fidl::Error> {
2895 let _response = fidl::client::decode_transaction_body::<
2896 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2897 fidl::encoding::DefaultFuchsiaResourceDialect,
2898 0x59a5076762318bf,
2899 >(_buf?)?;
2900 Ok(_response.map(|x| x))
2901 }
2902 self.client.send_query_and_decode::<
2903 CryptManagementAddWrappingKeyRequest,
2904 CryptManagementAddWrappingKeyResult,
2905 >(
2906 (wrapping_key_id, key,),
2907 0x59a5076762318bf,
2908 fidl::encoding::DynamicFlags::empty(),
2909 _decode,
2910 )
2911 }
2912
2913 type SetActiveKeyResponseFut = fidl::client::QueryResponseFut<
2914 CryptManagementSetActiveKeyResult,
2915 fidl::encoding::DefaultFuchsiaResourceDialect,
2916 >;
2917 fn r#set_active_key(
2918 &self,
2919 mut purpose: KeyPurpose,
2920 mut wrapping_key_id: &[u8; 16],
2921 ) -> Self::SetActiveKeyResponseFut {
2922 fn _decode(
2923 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2924 ) -> Result<CryptManagementSetActiveKeyResult, fidl::Error> {
2925 let _response = fidl::client::decode_transaction_body::<
2926 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2927 fidl::encoding::DefaultFuchsiaResourceDialect,
2928 0x5e81d600442f2872,
2929 >(_buf?)?;
2930 Ok(_response.map(|x| x))
2931 }
2932 self.client.send_query_and_decode::<
2933 CryptManagementSetActiveKeyRequest,
2934 CryptManagementSetActiveKeyResult,
2935 >(
2936 (purpose, wrapping_key_id,),
2937 0x5e81d600442f2872,
2938 fidl::encoding::DynamicFlags::empty(),
2939 _decode,
2940 )
2941 }
2942
2943 type ForgetWrappingKeyResponseFut = fidl::client::QueryResponseFut<
2944 CryptManagementForgetWrappingKeyResult,
2945 fidl::encoding::DefaultFuchsiaResourceDialect,
2946 >;
2947 fn r#forget_wrapping_key(
2948 &self,
2949 mut wrapping_key_id: &[u8; 16],
2950 ) -> Self::ForgetWrappingKeyResponseFut {
2951 fn _decode(
2952 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2953 ) -> Result<CryptManagementForgetWrappingKeyResult, fidl::Error> {
2954 let _response = fidl::client::decode_transaction_body::<
2955 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2956 fidl::encoding::DefaultFuchsiaResourceDialect,
2957 0x436d6d27696dfcf4,
2958 >(_buf?)?;
2959 Ok(_response.map(|x| x))
2960 }
2961 self.client.send_query_and_decode::<
2962 CryptManagementForgetWrappingKeyRequest,
2963 CryptManagementForgetWrappingKeyResult,
2964 >(
2965 (wrapping_key_id,),
2966 0x436d6d27696dfcf4,
2967 fidl::encoding::DynamicFlags::empty(),
2968 _decode,
2969 )
2970 }
2971}
2972
2973pub struct CryptManagementEventStream {
2974 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2975}
2976
2977impl std::marker::Unpin for CryptManagementEventStream {}
2978
2979impl futures::stream::FusedStream for CryptManagementEventStream {
2980 fn is_terminated(&self) -> bool {
2981 self.event_receiver.is_terminated()
2982 }
2983}
2984
2985impl futures::Stream for CryptManagementEventStream {
2986 type Item = Result<CryptManagementEvent, fidl::Error>;
2987
2988 fn poll_next(
2989 mut self: std::pin::Pin<&mut Self>,
2990 cx: &mut std::task::Context<'_>,
2991 ) -> std::task::Poll<Option<Self::Item>> {
2992 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2993 &mut self.event_receiver,
2994 cx
2995 )?) {
2996 Some(buf) => std::task::Poll::Ready(Some(CryptManagementEvent::decode(buf))),
2997 None => std::task::Poll::Ready(None),
2998 }
2999 }
3000}
3001
3002#[derive(Debug)]
3003pub enum CryptManagementEvent {}
3004
3005impl CryptManagementEvent {
3006 fn decode(
3008 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3009 ) -> Result<CryptManagementEvent, fidl::Error> {
3010 let (bytes, _handles) = buf.split_mut();
3011 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3012 debug_assert_eq!(tx_header.tx_id, 0);
3013 match tx_header.ordinal {
3014 _ => Err(fidl::Error::UnknownOrdinal {
3015 ordinal: tx_header.ordinal,
3016 protocol_name:
3017 <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3018 }),
3019 }
3020 }
3021}
3022
3023pub struct CryptManagementRequestStream {
3025 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3026 is_terminated: bool,
3027}
3028
3029impl std::marker::Unpin for CryptManagementRequestStream {}
3030
3031impl futures::stream::FusedStream for CryptManagementRequestStream {
3032 fn is_terminated(&self) -> bool {
3033 self.is_terminated
3034 }
3035}
3036
3037impl fidl::endpoints::RequestStream for CryptManagementRequestStream {
3038 type Protocol = CryptManagementMarker;
3039 type ControlHandle = CryptManagementControlHandle;
3040
3041 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3042 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3043 }
3044
3045 fn control_handle(&self) -> Self::ControlHandle {
3046 CryptManagementControlHandle { inner: self.inner.clone() }
3047 }
3048
3049 fn into_inner(
3050 self,
3051 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3052 {
3053 (self.inner, self.is_terminated)
3054 }
3055
3056 fn from_inner(
3057 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3058 is_terminated: bool,
3059 ) -> Self {
3060 Self { inner, is_terminated }
3061 }
3062}
3063
3064impl futures::Stream for CryptManagementRequestStream {
3065 type Item = Result<CryptManagementRequest, fidl::Error>;
3066
3067 fn poll_next(
3068 mut self: std::pin::Pin<&mut Self>,
3069 cx: &mut std::task::Context<'_>,
3070 ) -> std::task::Poll<Option<Self::Item>> {
3071 let this = &mut *self;
3072 if this.inner.check_shutdown(cx) {
3073 this.is_terminated = true;
3074 return std::task::Poll::Ready(None);
3075 }
3076 if this.is_terminated {
3077 panic!("polled CryptManagementRequestStream after completion");
3078 }
3079 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3080 |bytes, handles| {
3081 match this.inner.channel().read_etc(cx, bytes, handles) {
3082 std::task::Poll::Ready(Ok(())) => {}
3083 std::task::Poll::Pending => return std::task::Poll::Pending,
3084 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3085 this.is_terminated = true;
3086 return std::task::Poll::Ready(None);
3087 }
3088 std::task::Poll::Ready(Err(e)) => {
3089 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3090 e.into(),
3091 ))));
3092 }
3093 }
3094
3095 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3097
3098 std::task::Poll::Ready(Some(match header.ordinal {
3099 0x59a5076762318bf => {
3100 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3101 let mut req = fidl::new_empty!(
3102 CryptManagementAddWrappingKeyRequest,
3103 fidl::encoding::DefaultFuchsiaResourceDialect
3104 );
3105 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementAddWrappingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
3106 let control_handle =
3107 CryptManagementControlHandle { inner: this.inner.clone() };
3108 Ok(CryptManagementRequest::AddWrappingKey {
3109 wrapping_key_id: req.wrapping_key_id,
3110 key: req.key,
3111
3112 responder: CryptManagementAddWrappingKeyResponder {
3113 control_handle: std::mem::ManuallyDrop::new(control_handle),
3114 tx_id: header.tx_id,
3115 },
3116 })
3117 }
3118 0x5e81d600442f2872 => {
3119 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3120 let mut req = fidl::new_empty!(
3121 CryptManagementSetActiveKeyRequest,
3122 fidl::encoding::DefaultFuchsiaResourceDialect
3123 );
3124 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementSetActiveKeyRequest>(&header, _body_bytes, handles, &mut req)?;
3125 let control_handle =
3126 CryptManagementControlHandle { inner: this.inner.clone() };
3127 Ok(CryptManagementRequest::SetActiveKey {
3128 purpose: req.purpose,
3129 wrapping_key_id: req.wrapping_key_id,
3130
3131 responder: CryptManagementSetActiveKeyResponder {
3132 control_handle: std::mem::ManuallyDrop::new(control_handle),
3133 tx_id: header.tx_id,
3134 },
3135 })
3136 }
3137 0x436d6d27696dfcf4 => {
3138 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3139 let mut req = fidl::new_empty!(
3140 CryptManagementForgetWrappingKeyRequest,
3141 fidl::encoding::DefaultFuchsiaResourceDialect
3142 );
3143 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CryptManagementForgetWrappingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
3144 let control_handle =
3145 CryptManagementControlHandle { inner: this.inner.clone() };
3146 Ok(CryptManagementRequest::ForgetWrappingKey {
3147 wrapping_key_id: req.wrapping_key_id,
3148
3149 responder: CryptManagementForgetWrappingKeyResponder {
3150 control_handle: std::mem::ManuallyDrop::new(control_handle),
3151 tx_id: header.tx_id,
3152 },
3153 })
3154 }
3155 _ => Err(fidl::Error::UnknownOrdinal {
3156 ordinal: header.ordinal,
3157 protocol_name:
3158 <CryptManagementMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3159 }),
3160 }))
3161 },
3162 )
3163 }
3164}
3165
3166#[derive(Debug)]
3167pub enum CryptManagementRequest {
3168 AddWrappingKey {
3172 wrapping_key_id: [u8; 16],
3173 key: Vec<u8>,
3174 responder: CryptManagementAddWrappingKeyResponder,
3175 },
3176 SetActiveKey {
3179 purpose: KeyPurpose,
3180 wrapping_key_id: [u8; 16],
3181 responder: CryptManagementSetActiveKeyResponder,
3182 },
3183 ForgetWrappingKey {
3187 wrapping_key_id: [u8; 16],
3188 responder: CryptManagementForgetWrappingKeyResponder,
3189 },
3190}
3191
3192impl CryptManagementRequest {
3193 #[allow(irrefutable_let_patterns)]
3194 pub fn into_add_wrapping_key(
3195 self,
3196 ) -> Option<([u8; 16], Vec<u8>, CryptManagementAddWrappingKeyResponder)> {
3197 if let CryptManagementRequest::AddWrappingKey { wrapping_key_id, key, responder } = self {
3198 Some((wrapping_key_id, key, responder))
3199 } else {
3200 None
3201 }
3202 }
3203
3204 #[allow(irrefutable_let_patterns)]
3205 pub fn into_set_active_key(
3206 self,
3207 ) -> Option<(KeyPurpose, [u8; 16], CryptManagementSetActiveKeyResponder)> {
3208 if let CryptManagementRequest::SetActiveKey { purpose, wrapping_key_id, responder } = self {
3209 Some((purpose, wrapping_key_id, responder))
3210 } else {
3211 None
3212 }
3213 }
3214
3215 #[allow(irrefutable_let_patterns)]
3216 pub fn into_forget_wrapping_key(
3217 self,
3218 ) -> Option<([u8; 16], CryptManagementForgetWrappingKeyResponder)> {
3219 if let CryptManagementRequest::ForgetWrappingKey { wrapping_key_id, responder } = self {
3220 Some((wrapping_key_id, responder))
3221 } else {
3222 None
3223 }
3224 }
3225
3226 pub fn method_name(&self) -> &'static str {
3228 match *self {
3229 CryptManagementRequest::AddWrappingKey { .. } => "add_wrapping_key",
3230 CryptManagementRequest::SetActiveKey { .. } => "set_active_key",
3231 CryptManagementRequest::ForgetWrappingKey { .. } => "forget_wrapping_key",
3232 }
3233 }
3234}
3235
3236#[derive(Debug, Clone)]
3237pub struct CryptManagementControlHandle {
3238 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3239}
3240
3241impl fidl::endpoints::ControlHandle for CryptManagementControlHandle {
3242 fn shutdown(&self) {
3243 self.inner.shutdown()
3244 }
3245
3246 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3247 self.inner.shutdown_with_epitaph(status)
3248 }
3249
3250 fn is_closed(&self) -> bool {
3251 self.inner.channel().is_closed()
3252 }
3253 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3254 self.inner.channel().on_closed()
3255 }
3256
3257 #[cfg(target_os = "fuchsia")]
3258 fn signal_peer(
3259 &self,
3260 clear_mask: zx::Signals,
3261 set_mask: zx::Signals,
3262 ) -> Result<(), zx_status::Status> {
3263 use fidl::Peered;
3264 self.inner.channel().signal_peer(clear_mask, set_mask)
3265 }
3266}
3267
3268impl CryptManagementControlHandle {}
3269
3270#[must_use = "FIDL methods require a response to be sent"]
3271#[derive(Debug)]
3272pub struct CryptManagementAddWrappingKeyResponder {
3273 control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
3274 tx_id: u32,
3275}
3276
3277impl std::ops::Drop for CryptManagementAddWrappingKeyResponder {
3281 fn drop(&mut self) {
3282 self.control_handle.shutdown();
3283 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3285 }
3286}
3287
3288impl fidl::endpoints::Responder for CryptManagementAddWrappingKeyResponder {
3289 type ControlHandle = CryptManagementControlHandle;
3290
3291 fn control_handle(&self) -> &CryptManagementControlHandle {
3292 &self.control_handle
3293 }
3294
3295 fn drop_without_shutdown(mut self) {
3296 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3298 std::mem::forget(self);
3300 }
3301}
3302
3303impl CryptManagementAddWrappingKeyResponder {
3304 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3308 let _result = self.send_raw(result);
3309 if _result.is_err() {
3310 self.control_handle.shutdown();
3311 }
3312 self.drop_without_shutdown();
3313 _result
3314 }
3315
3316 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3318 let _result = self.send_raw(result);
3319 self.drop_without_shutdown();
3320 _result
3321 }
3322
3323 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3324 self.control_handle
3325 .inner
3326 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3327 result,
3328 self.tx_id,
3329 0x59a5076762318bf,
3330 fidl::encoding::DynamicFlags::empty(),
3331 )
3332 }
3333}
3334
3335#[must_use = "FIDL methods require a response to be sent"]
3336#[derive(Debug)]
3337pub struct CryptManagementSetActiveKeyResponder {
3338 control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
3339 tx_id: u32,
3340}
3341
3342impl std::ops::Drop for CryptManagementSetActiveKeyResponder {
3346 fn drop(&mut self) {
3347 self.control_handle.shutdown();
3348 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3350 }
3351}
3352
3353impl fidl::endpoints::Responder for CryptManagementSetActiveKeyResponder {
3354 type ControlHandle = CryptManagementControlHandle;
3355
3356 fn control_handle(&self) -> &CryptManagementControlHandle {
3357 &self.control_handle
3358 }
3359
3360 fn drop_without_shutdown(mut self) {
3361 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3363 std::mem::forget(self);
3365 }
3366}
3367
3368impl CryptManagementSetActiveKeyResponder {
3369 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3373 let _result = self.send_raw(result);
3374 if _result.is_err() {
3375 self.control_handle.shutdown();
3376 }
3377 self.drop_without_shutdown();
3378 _result
3379 }
3380
3381 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3383 let _result = self.send_raw(result);
3384 self.drop_without_shutdown();
3385 _result
3386 }
3387
3388 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3389 self.control_handle
3390 .inner
3391 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3392 result,
3393 self.tx_id,
3394 0x5e81d600442f2872,
3395 fidl::encoding::DynamicFlags::empty(),
3396 )
3397 }
3398}
3399
3400#[must_use = "FIDL methods require a response to be sent"]
3401#[derive(Debug)]
3402pub struct CryptManagementForgetWrappingKeyResponder {
3403 control_handle: std::mem::ManuallyDrop<CryptManagementControlHandle>,
3404 tx_id: u32,
3405}
3406
3407impl std::ops::Drop for CryptManagementForgetWrappingKeyResponder {
3411 fn drop(&mut self) {
3412 self.control_handle.shutdown();
3413 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3415 }
3416}
3417
3418impl fidl::endpoints::Responder for CryptManagementForgetWrappingKeyResponder {
3419 type ControlHandle = CryptManagementControlHandle;
3420
3421 fn control_handle(&self) -> &CryptManagementControlHandle {
3422 &self.control_handle
3423 }
3424
3425 fn drop_without_shutdown(mut self) {
3426 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3428 std::mem::forget(self);
3430 }
3431}
3432
3433impl CryptManagementForgetWrappingKeyResponder {
3434 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3438 let _result = self.send_raw(result);
3439 if _result.is_err() {
3440 self.control_handle.shutdown();
3441 }
3442 self.drop_without_shutdown();
3443 _result
3444 }
3445
3446 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3448 let _result = self.send_raw(result);
3449 self.drop_without_shutdown();
3450 _result
3451 }
3452
3453 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3454 self.control_handle
3455 .inner
3456 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3457 result,
3458 self.tx_id,
3459 0x436d6d27696dfcf4,
3460 fidl::encoding::DynamicFlags::empty(),
3461 )
3462 }
3463}
3464
3465#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3466pub struct DebugMarker;
3467
3468impl fidl::endpoints::ProtocolMarker for DebugMarker {
3469 type Proxy = DebugProxy;
3470 type RequestStream = DebugRequestStream;
3471 #[cfg(target_os = "fuchsia")]
3472 type SynchronousProxy = DebugSynchronousProxy;
3473
3474 const DEBUG_NAME: &'static str = "fuchsia.fxfs.Debug";
3475}
3476impl fidl::endpoints::DiscoverableProtocolMarker for DebugMarker {}
3477pub type DebugCompactResult = Result<(), i32>;
3478pub type DebugDeleteProfileResult = Result<(), i32>;
3479pub type DebugRecordAndReplayProfileResult = Result<(), i32>;
3480pub type DebugReplayXorRecordProfileResult = Result<(), i32>;
3481pub type DebugStopProfileTasksResult = Result<(), i32>;
3482pub type DebugClearCachesResult = Result<(), i32>;
3483
3484pub trait DebugProxyInterface: Send + Sync {
3485 type CompactResponseFut: std::future::Future<Output = Result<DebugCompactResult, fidl::Error>>
3486 + Send;
3487 fn r#compact(&self) -> Self::CompactResponseFut;
3488 type DeleteProfileResponseFut: std::future::Future<Output = Result<DebugDeleteProfileResult, fidl::Error>>
3489 + Send;
3490 fn r#delete_profile(&self, volume: &str, profile: &str) -> Self::DeleteProfileResponseFut;
3491 type RecordAndReplayProfileResponseFut: std::future::Future<Output = Result<DebugRecordAndReplayProfileResult, fidl::Error>>
3492 + Send;
3493 fn r#record_and_replay_profile(
3494 &self,
3495 volume: Option<&str>,
3496 profile: &str,
3497 duration_secs: u32,
3498 ) -> Self::RecordAndReplayProfileResponseFut;
3499 type ReplayXorRecordProfileResponseFut: std::future::Future<Output = Result<DebugReplayXorRecordProfileResult, fidl::Error>>
3500 + Send;
3501 fn r#replay_xor_record_profile(
3502 &self,
3503 volume: &str,
3504 profile: &str,
3505 duration_secs: u32,
3506 ) -> Self::ReplayXorRecordProfileResponseFut;
3507 type StopProfileTasksResponseFut: std::future::Future<Output = Result<DebugStopProfileTasksResult, fidl::Error>>
3508 + Send;
3509 fn r#stop_profile_tasks(&self) -> Self::StopProfileTasksResponseFut;
3510 type ClearCachesResponseFut: std::future::Future<Output = Result<DebugClearCachesResult, fidl::Error>>
3511 + Send;
3512 fn r#clear_caches(&self) -> Self::ClearCachesResponseFut;
3513}
3514#[derive(Debug)]
3515#[cfg(target_os = "fuchsia")]
3516pub struct DebugSynchronousProxy {
3517 client: fidl::client::sync::Client,
3518}
3519
3520#[cfg(target_os = "fuchsia")]
3521impl fidl::endpoints::SynchronousProxy for DebugSynchronousProxy {
3522 type Proxy = DebugProxy;
3523 type Protocol = DebugMarker;
3524
3525 fn from_channel(inner: fidl::Channel) -> Self {
3526 Self::new(inner)
3527 }
3528
3529 fn into_channel(self) -> fidl::Channel {
3530 self.client.into_channel()
3531 }
3532
3533 fn as_channel(&self) -> &fidl::Channel {
3534 self.client.as_channel()
3535 }
3536}
3537
3538#[cfg(target_os = "fuchsia")]
3539impl DebugSynchronousProxy {
3540 pub fn new(channel: fidl::Channel) -> Self {
3541 Self { client: fidl::client::sync::Client::new(channel) }
3542 }
3543
3544 pub fn into_channel(self) -> fidl::Channel {
3545 self.client.into_channel()
3546 }
3547
3548 pub fn wait_for_event(
3551 &self,
3552 deadline: zx::MonotonicInstant,
3553 ) -> Result<DebugEvent, fidl::Error> {
3554 DebugEvent::decode(self.client.wait_for_event::<DebugMarker>(deadline)?)
3555 }
3556
3557 pub fn r#compact(
3559 &self,
3560 ___deadline: zx::MonotonicInstant,
3561 ) -> Result<DebugCompactResult, fidl::Error> {
3562 let _response = self.client.send_query::<
3563 fidl::encoding::EmptyPayload,
3564 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3565 DebugMarker,
3566 >(
3567 (),
3568 0x6553eb197306e489,
3569 fidl::encoding::DynamicFlags::empty(),
3570 ___deadline,
3571 )?;
3572 Ok(_response.map(|x| x))
3573 }
3574
3575 pub fn r#delete_profile(
3578 &self,
3579 mut volume: &str,
3580 mut profile: &str,
3581 ___deadline: zx::MonotonicInstant,
3582 ) -> Result<DebugDeleteProfileResult, fidl::Error> {
3583 let _response = self.client.send_query::<
3584 DebugDeleteProfileRequest,
3585 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3586 DebugMarker,
3587 >(
3588 (volume, profile,),
3589 0x54d9d4c9cf300a1e,
3590 fidl::encoding::DynamicFlags::empty(),
3591 ___deadline,
3592 )?;
3593 Ok(_response.map(|x| x))
3594 }
3595
3596 pub fn r#record_and_replay_profile(
3607 &self,
3608 mut volume: Option<&str>,
3609 mut profile: &str,
3610 mut duration_secs: u32,
3611 ___deadline: zx::MonotonicInstant,
3612 ) -> Result<DebugRecordAndReplayProfileResult, fidl::Error> {
3613 let _response = self.client.send_query::<
3614 DebugRecordAndReplayProfileRequest,
3615 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3616 DebugMarker,
3617 >(
3618 (volume, profile, duration_secs,),
3619 0x3973943f9b3a9010,
3620 fidl::encoding::DynamicFlags::empty(),
3621 ___deadline,
3622 )?;
3623 Ok(_response.map(|x| x))
3624 }
3625
3626 pub fn r#replay_xor_record_profile(
3633 &self,
3634 mut volume: &str,
3635 mut profile: &str,
3636 mut duration_secs: u32,
3637 ___deadline: zx::MonotonicInstant,
3638 ) -> Result<DebugReplayXorRecordProfileResult, fidl::Error> {
3639 let _response = self.client.send_query::<
3640 DebugReplayXorRecordProfileRequest,
3641 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3642 DebugMarker,
3643 >(
3644 (volume, profile, duration_secs,),
3645 0x301678a1cebeef20,
3646 fidl::encoding::DynamicFlags::empty(),
3647 ___deadline,
3648 )?;
3649 Ok(_response.map(|x| x))
3650 }
3651
3652 pub fn r#stop_profile_tasks(
3655 &self,
3656 ___deadline: zx::MonotonicInstant,
3657 ) -> Result<DebugStopProfileTasksResult, fidl::Error> {
3658 let _response = self.client.send_query::<
3659 fidl::encoding::EmptyPayload,
3660 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3661 DebugMarker,
3662 >(
3663 (),
3664 0x1657b945dd629177,
3665 fidl::encoding::DynamicFlags::empty(),
3666 ___deadline,
3667 )?;
3668 Ok(_response.map(|x| x))
3669 }
3670
3671 pub fn r#clear_caches(
3678 &self,
3679 ___deadline: zx::MonotonicInstant,
3680 ) -> Result<DebugClearCachesResult, fidl::Error> {
3681 let _response = self.client.send_query::<
3682 fidl::encoding::EmptyPayload,
3683 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3684 DebugMarker,
3685 >(
3686 (),
3687 0x539de2a4580de767,
3688 fidl::encoding::DynamicFlags::empty(),
3689 ___deadline,
3690 )?;
3691 Ok(_response.map(|x| x))
3692 }
3693}
3694
3695#[cfg(target_os = "fuchsia")]
3696impl From<DebugSynchronousProxy> for zx::NullableHandle {
3697 fn from(value: DebugSynchronousProxy) -> Self {
3698 value.into_channel().into()
3699 }
3700}
3701
3702#[cfg(target_os = "fuchsia")]
3703impl From<fidl::Channel> for DebugSynchronousProxy {
3704 fn from(value: fidl::Channel) -> Self {
3705 Self::new(value)
3706 }
3707}
3708
3709#[cfg(target_os = "fuchsia")]
3710impl fidl::endpoints::FromClient for DebugSynchronousProxy {
3711 type Protocol = DebugMarker;
3712
3713 fn from_client(value: fidl::endpoints::ClientEnd<DebugMarker>) -> Self {
3714 Self::new(value.into_channel())
3715 }
3716}
3717
3718#[derive(Debug, Clone)]
3719pub struct DebugProxy {
3720 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3721}
3722
3723impl fidl::endpoints::Proxy for DebugProxy {
3724 type Protocol = DebugMarker;
3725
3726 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3727 Self::new(inner)
3728 }
3729
3730 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3731 self.client.into_channel().map_err(|client| Self { client })
3732 }
3733
3734 fn as_channel(&self) -> &::fidl::AsyncChannel {
3735 self.client.as_channel()
3736 }
3737}
3738
3739impl DebugProxy {
3740 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3742 let protocol_name = <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3743 Self { client: fidl::client::Client::new(channel, protocol_name) }
3744 }
3745
3746 pub fn take_event_stream(&self) -> DebugEventStream {
3752 DebugEventStream { event_receiver: self.client.take_event_receiver() }
3753 }
3754
3755 pub fn r#compact(
3757 &self,
3758 ) -> fidl::client::QueryResponseFut<
3759 DebugCompactResult,
3760 fidl::encoding::DefaultFuchsiaResourceDialect,
3761 > {
3762 DebugProxyInterface::r#compact(self)
3763 }
3764
3765 pub fn r#delete_profile(
3768 &self,
3769 mut volume: &str,
3770 mut profile: &str,
3771 ) -> fidl::client::QueryResponseFut<
3772 DebugDeleteProfileResult,
3773 fidl::encoding::DefaultFuchsiaResourceDialect,
3774 > {
3775 DebugProxyInterface::r#delete_profile(self, volume, profile)
3776 }
3777
3778 pub fn r#record_and_replay_profile(
3789 &self,
3790 mut volume: Option<&str>,
3791 mut profile: &str,
3792 mut duration_secs: u32,
3793 ) -> fidl::client::QueryResponseFut<
3794 DebugRecordAndReplayProfileResult,
3795 fidl::encoding::DefaultFuchsiaResourceDialect,
3796 > {
3797 DebugProxyInterface::r#record_and_replay_profile(self, volume, profile, duration_secs)
3798 }
3799
3800 pub fn r#replay_xor_record_profile(
3807 &self,
3808 mut volume: &str,
3809 mut profile: &str,
3810 mut duration_secs: u32,
3811 ) -> fidl::client::QueryResponseFut<
3812 DebugReplayXorRecordProfileResult,
3813 fidl::encoding::DefaultFuchsiaResourceDialect,
3814 > {
3815 DebugProxyInterface::r#replay_xor_record_profile(self, volume, profile, duration_secs)
3816 }
3817
3818 pub fn r#stop_profile_tasks(
3821 &self,
3822 ) -> fidl::client::QueryResponseFut<
3823 DebugStopProfileTasksResult,
3824 fidl::encoding::DefaultFuchsiaResourceDialect,
3825 > {
3826 DebugProxyInterface::r#stop_profile_tasks(self)
3827 }
3828
3829 pub fn r#clear_caches(
3836 &self,
3837 ) -> fidl::client::QueryResponseFut<
3838 DebugClearCachesResult,
3839 fidl::encoding::DefaultFuchsiaResourceDialect,
3840 > {
3841 DebugProxyInterface::r#clear_caches(self)
3842 }
3843}
3844
3845impl DebugProxyInterface for DebugProxy {
3846 type CompactResponseFut = fidl::client::QueryResponseFut<
3847 DebugCompactResult,
3848 fidl::encoding::DefaultFuchsiaResourceDialect,
3849 >;
3850 fn r#compact(&self) -> Self::CompactResponseFut {
3851 fn _decode(
3852 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3853 ) -> Result<DebugCompactResult, fidl::Error> {
3854 let _response = fidl::client::decode_transaction_body::<
3855 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3856 fidl::encoding::DefaultFuchsiaResourceDialect,
3857 0x6553eb197306e489,
3858 >(_buf?)?;
3859 Ok(_response.map(|x| x))
3860 }
3861 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DebugCompactResult>(
3862 (),
3863 0x6553eb197306e489,
3864 fidl::encoding::DynamicFlags::empty(),
3865 _decode,
3866 )
3867 }
3868
3869 type DeleteProfileResponseFut = fidl::client::QueryResponseFut<
3870 DebugDeleteProfileResult,
3871 fidl::encoding::DefaultFuchsiaResourceDialect,
3872 >;
3873 fn r#delete_profile(
3874 &self,
3875 mut volume: &str,
3876 mut profile: &str,
3877 ) -> Self::DeleteProfileResponseFut {
3878 fn _decode(
3879 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3880 ) -> Result<DebugDeleteProfileResult, fidl::Error> {
3881 let _response = fidl::client::decode_transaction_body::<
3882 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3883 fidl::encoding::DefaultFuchsiaResourceDialect,
3884 0x54d9d4c9cf300a1e,
3885 >(_buf?)?;
3886 Ok(_response.map(|x| x))
3887 }
3888 self.client.send_query_and_decode::<DebugDeleteProfileRequest, DebugDeleteProfileResult>(
3889 (volume, profile),
3890 0x54d9d4c9cf300a1e,
3891 fidl::encoding::DynamicFlags::empty(),
3892 _decode,
3893 )
3894 }
3895
3896 type RecordAndReplayProfileResponseFut = fidl::client::QueryResponseFut<
3897 DebugRecordAndReplayProfileResult,
3898 fidl::encoding::DefaultFuchsiaResourceDialect,
3899 >;
3900 fn r#record_and_replay_profile(
3901 &self,
3902 mut volume: Option<&str>,
3903 mut profile: &str,
3904 mut duration_secs: u32,
3905 ) -> Self::RecordAndReplayProfileResponseFut {
3906 fn _decode(
3907 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3908 ) -> Result<DebugRecordAndReplayProfileResult, fidl::Error> {
3909 let _response = fidl::client::decode_transaction_body::<
3910 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3911 fidl::encoding::DefaultFuchsiaResourceDialect,
3912 0x3973943f9b3a9010,
3913 >(_buf?)?;
3914 Ok(_response.map(|x| x))
3915 }
3916 self.client.send_query_and_decode::<
3917 DebugRecordAndReplayProfileRequest,
3918 DebugRecordAndReplayProfileResult,
3919 >(
3920 (volume, profile, duration_secs,),
3921 0x3973943f9b3a9010,
3922 fidl::encoding::DynamicFlags::empty(),
3923 _decode,
3924 )
3925 }
3926
3927 type ReplayXorRecordProfileResponseFut = fidl::client::QueryResponseFut<
3928 DebugReplayXorRecordProfileResult,
3929 fidl::encoding::DefaultFuchsiaResourceDialect,
3930 >;
3931 fn r#replay_xor_record_profile(
3932 &self,
3933 mut volume: &str,
3934 mut profile: &str,
3935 mut duration_secs: u32,
3936 ) -> Self::ReplayXorRecordProfileResponseFut {
3937 fn _decode(
3938 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3939 ) -> Result<DebugReplayXorRecordProfileResult, fidl::Error> {
3940 let _response = fidl::client::decode_transaction_body::<
3941 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3942 fidl::encoding::DefaultFuchsiaResourceDialect,
3943 0x301678a1cebeef20,
3944 >(_buf?)?;
3945 Ok(_response.map(|x| x))
3946 }
3947 self.client.send_query_and_decode::<
3948 DebugReplayXorRecordProfileRequest,
3949 DebugReplayXorRecordProfileResult,
3950 >(
3951 (volume, profile, duration_secs,),
3952 0x301678a1cebeef20,
3953 fidl::encoding::DynamicFlags::empty(),
3954 _decode,
3955 )
3956 }
3957
3958 type StopProfileTasksResponseFut = fidl::client::QueryResponseFut<
3959 DebugStopProfileTasksResult,
3960 fidl::encoding::DefaultFuchsiaResourceDialect,
3961 >;
3962 fn r#stop_profile_tasks(&self) -> Self::StopProfileTasksResponseFut {
3963 fn _decode(
3964 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3965 ) -> Result<DebugStopProfileTasksResult, fidl::Error> {
3966 let _response = fidl::client::decode_transaction_body::<
3967 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3968 fidl::encoding::DefaultFuchsiaResourceDialect,
3969 0x1657b945dd629177,
3970 >(_buf?)?;
3971 Ok(_response.map(|x| x))
3972 }
3973 self.client
3974 .send_query_and_decode::<fidl::encoding::EmptyPayload, DebugStopProfileTasksResult>(
3975 (),
3976 0x1657b945dd629177,
3977 fidl::encoding::DynamicFlags::empty(),
3978 _decode,
3979 )
3980 }
3981
3982 type ClearCachesResponseFut = fidl::client::QueryResponseFut<
3983 DebugClearCachesResult,
3984 fidl::encoding::DefaultFuchsiaResourceDialect,
3985 >;
3986 fn r#clear_caches(&self) -> Self::ClearCachesResponseFut {
3987 fn _decode(
3988 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3989 ) -> Result<DebugClearCachesResult, fidl::Error> {
3990 let _response = fidl::client::decode_transaction_body::<
3991 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3992 fidl::encoding::DefaultFuchsiaResourceDialect,
3993 0x539de2a4580de767,
3994 >(_buf?)?;
3995 Ok(_response.map(|x| x))
3996 }
3997 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DebugClearCachesResult>(
3998 (),
3999 0x539de2a4580de767,
4000 fidl::encoding::DynamicFlags::empty(),
4001 _decode,
4002 )
4003 }
4004}
4005
4006pub struct DebugEventStream {
4007 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4008}
4009
4010impl std::marker::Unpin for DebugEventStream {}
4011
4012impl futures::stream::FusedStream for DebugEventStream {
4013 fn is_terminated(&self) -> bool {
4014 self.event_receiver.is_terminated()
4015 }
4016}
4017
4018impl futures::Stream for DebugEventStream {
4019 type Item = Result<DebugEvent, fidl::Error>;
4020
4021 fn poll_next(
4022 mut self: std::pin::Pin<&mut Self>,
4023 cx: &mut std::task::Context<'_>,
4024 ) -> std::task::Poll<Option<Self::Item>> {
4025 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4026 &mut self.event_receiver,
4027 cx
4028 )?) {
4029 Some(buf) => std::task::Poll::Ready(Some(DebugEvent::decode(buf))),
4030 None => std::task::Poll::Ready(None),
4031 }
4032 }
4033}
4034
4035#[derive(Debug)]
4036pub enum DebugEvent {}
4037
4038impl DebugEvent {
4039 fn decode(
4041 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4042 ) -> Result<DebugEvent, fidl::Error> {
4043 let (bytes, _handles) = buf.split_mut();
4044 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4045 debug_assert_eq!(tx_header.tx_id, 0);
4046 match tx_header.ordinal {
4047 _ => Err(fidl::Error::UnknownOrdinal {
4048 ordinal: tx_header.ordinal,
4049 protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4050 }),
4051 }
4052 }
4053}
4054
4055pub struct DebugRequestStream {
4057 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4058 is_terminated: bool,
4059}
4060
4061impl std::marker::Unpin for DebugRequestStream {}
4062
4063impl futures::stream::FusedStream for DebugRequestStream {
4064 fn is_terminated(&self) -> bool {
4065 self.is_terminated
4066 }
4067}
4068
4069impl fidl::endpoints::RequestStream for DebugRequestStream {
4070 type Protocol = DebugMarker;
4071 type ControlHandle = DebugControlHandle;
4072
4073 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4074 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4075 }
4076
4077 fn control_handle(&self) -> Self::ControlHandle {
4078 DebugControlHandle { inner: self.inner.clone() }
4079 }
4080
4081 fn into_inner(
4082 self,
4083 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4084 {
4085 (self.inner, self.is_terminated)
4086 }
4087
4088 fn from_inner(
4089 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4090 is_terminated: bool,
4091 ) -> Self {
4092 Self { inner, is_terminated }
4093 }
4094}
4095
4096impl futures::Stream for DebugRequestStream {
4097 type Item = Result<DebugRequest, fidl::Error>;
4098
4099 fn poll_next(
4100 mut self: std::pin::Pin<&mut Self>,
4101 cx: &mut std::task::Context<'_>,
4102 ) -> std::task::Poll<Option<Self::Item>> {
4103 let this = &mut *self;
4104 if this.inner.check_shutdown(cx) {
4105 this.is_terminated = true;
4106 return std::task::Poll::Ready(None);
4107 }
4108 if this.is_terminated {
4109 panic!("polled DebugRequestStream after completion");
4110 }
4111 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4112 |bytes, handles| {
4113 match this.inner.channel().read_etc(cx, bytes, handles) {
4114 std::task::Poll::Ready(Ok(())) => {}
4115 std::task::Poll::Pending => return std::task::Poll::Pending,
4116 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4117 this.is_terminated = true;
4118 return std::task::Poll::Ready(None);
4119 }
4120 std::task::Poll::Ready(Err(e)) => {
4121 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4122 e.into(),
4123 ))));
4124 }
4125 }
4126
4127 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4129
4130 std::task::Poll::Ready(Some(match header.ordinal {
4131 0x6553eb197306e489 => {
4132 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4133 let mut req = fidl::new_empty!(
4134 fidl::encoding::EmptyPayload,
4135 fidl::encoding::DefaultFuchsiaResourceDialect
4136 );
4137 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4138 let control_handle = DebugControlHandle { inner: this.inner.clone() };
4139 Ok(DebugRequest::Compact {
4140 responder: DebugCompactResponder {
4141 control_handle: std::mem::ManuallyDrop::new(control_handle),
4142 tx_id: header.tx_id,
4143 },
4144 })
4145 }
4146 0x54d9d4c9cf300a1e => {
4147 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4148 let mut req = fidl::new_empty!(
4149 DebugDeleteProfileRequest,
4150 fidl::encoding::DefaultFuchsiaResourceDialect
4151 );
4152 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugDeleteProfileRequest>(&header, _body_bytes, handles, &mut req)?;
4153 let control_handle = DebugControlHandle { inner: this.inner.clone() };
4154 Ok(DebugRequest::DeleteProfile {
4155 volume: req.volume,
4156 profile: req.profile,
4157
4158 responder: DebugDeleteProfileResponder {
4159 control_handle: std::mem::ManuallyDrop::new(control_handle),
4160 tx_id: header.tx_id,
4161 },
4162 })
4163 }
4164 0x3973943f9b3a9010 => {
4165 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4166 let mut req = fidl::new_empty!(
4167 DebugRecordAndReplayProfileRequest,
4168 fidl::encoding::DefaultFuchsiaResourceDialect
4169 );
4170 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugRecordAndReplayProfileRequest>(&header, _body_bytes, handles, &mut req)?;
4171 let control_handle = DebugControlHandle { inner: this.inner.clone() };
4172 Ok(DebugRequest::RecordAndReplayProfile {
4173 volume: req.volume,
4174 profile: req.profile,
4175 duration_secs: req.duration_secs,
4176
4177 responder: DebugRecordAndReplayProfileResponder {
4178 control_handle: std::mem::ManuallyDrop::new(control_handle),
4179 tx_id: header.tx_id,
4180 },
4181 })
4182 }
4183 0x301678a1cebeef20 => {
4184 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4185 let mut req = fidl::new_empty!(
4186 DebugReplayXorRecordProfileRequest,
4187 fidl::encoding::DefaultFuchsiaResourceDialect
4188 );
4189 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DebugReplayXorRecordProfileRequest>(&header, _body_bytes, handles, &mut req)?;
4190 let control_handle = DebugControlHandle { inner: this.inner.clone() };
4191 Ok(DebugRequest::ReplayXorRecordProfile {
4192 volume: req.volume,
4193 profile: req.profile,
4194 duration_secs: req.duration_secs,
4195
4196 responder: DebugReplayXorRecordProfileResponder {
4197 control_handle: std::mem::ManuallyDrop::new(control_handle),
4198 tx_id: header.tx_id,
4199 },
4200 })
4201 }
4202 0x1657b945dd629177 => {
4203 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4204 let mut req = fidl::new_empty!(
4205 fidl::encoding::EmptyPayload,
4206 fidl::encoding::DefaultFuchsiaResourceDialect
4207 );
4208 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4209 let control_handle = DebugControlHandle { inner: this.inner.clone() };
4210 Ok(DebugRequest::StopProfileTasks {
4211 responder: DebugStopProfileTasksResponder {
4212 control_handle: std::mem::ManuallyDrop::new(control_handle),
4213 tx_id: header.tx_id,
4214 },
4215 })
4216 }
4217 0x539de2a4580de767 => {
4218 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4219 let mut req = fidl::new_empty!(
4220 fidl::encoding::EmptyPayload,
4221 fidl::encoding::DefaultFuchsiaResourceDialect
4222 );
4223 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4224 let control_handle = DebugControlHandle { inner: this.inner.clone() };
4225 Ok(DebugRequest::ClearCaches {
4226 responder: DebugClearCachesResponder {
4227 control_handle: std::mem::ManuallyDrop::new(control_handle),
4228 tx_id: header.tx_id,
4229 },
4230 })
4231 }
4232 _ => Err(fidl::Error::UnknownOrdinal {
4233 ordinal: header.ordinal,
4234 protocol_name: <DebugMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4235 }),
4236 }))
4237 },
4238 )
4239 }
4240}
4241
4242#[derive(Debug)]
4245pub enum DebugRequest {
4246 Compact { responder: DebugCompactResponder },
4248 DeleteProfile { volume: String, profile: String, responder: DebugDeleteProfileResponder },
4251 RecordAndReplayProfile {
4262 volume: Option<String>,
4263 profile: String,
4264 duration_secs: u32,
4265 responder: DebugRecordAndReplayProfileResponder,
4266 },
4267 ReplayXorRecordProfile {
4274 volume: String,
4275 profile: String,
4276 duration_secs: u32,
4277 responder: DebugReplayXorRecordProfileResponder,
4278 },
4279 StopProfileTasks { responder: DebugStopProfileTasksResponder },
4282 ClearCaches { responder: DebugClearCachesResponder },
4289}
4290
4291impl DebugRequest {
4292 #[allow(irrefutable_let_patterns)]
4293 pub fn into_compact(self) -> Option<(DebugCompactResponder)> {
4294 if let DebugRequest::Compact { responder } = self { Some((responder)) } else { None }
4295 }
4296
4297 #[allow(irrefutable_let_patterns)]
4298 pub fn into_delete_profile(self) -> Option<(String, String, DebugDeleteProfileResponder)> {
4299 if let DebugRequest::DeleteProfile { volume, profile, responder } = self {
4300 Some((volume, profile, responder))
4301 } else {
4302 None
4303 }
4304 }
4305
4306 #[allow(irrefutable_let_patterns)]
4307 pub fn into_record_and_replay_profile(
4308 self,
4309 ) -> Option<(Option<String>, String, u32, DebugRecordAndReplayProfileResponder)> {
4310 if let DebugRequest::RecordAndReplayProfile { volume, profile, duration_secs, responder } =
4311 self
4312 {
4313 Some((volume, profile, duration_secs, responder))
4314 } else {
4315 None
4316 }
4317 }
4318
4319 #[allow(irrefutable_let_patterns)]
4320 pub fn into_replay_xor_record_profile(
4321 self,
4322 ) -> Option<(String, String, u32, DebugReplayXorRecordProfileResponder)> {
4323 if let DebugRequest::ReplayXorRecordProfile { volume, profile, duration_secs, responder } =
4324 self
4325 {
4326 Some((volume, profile, duration_secs, responder))
4327 } else {
4328 None
4329 }
4330 }
4331
4332 #[allow(irrefutable_let_patterns)]
4333 pub fn into_stop_profile_tasks(self) -> Option<(DebugStopProfileTasksResponder)> {
4334 if let DebugRequest::StopProfileTasks { responder } = self {
4335 Some((responder))
4336 } else {
4337 None
4338 }
4339 }
4340
4341 #[allow(irrefutable_let_patterns)]
4342 pub fn into_clear_caches(self) -> Option<(DebugClearCachesResponder)> {
4343 if let DebugRequest::ClearCaches { responder } = self { Some((responder)) } else { None }
4344 }
4345
4346 pub fn method_name(&self) -> &'static str {
4348 match *self {
4349 DebugRequest::Compact { .. } => "compact",
4350 DebugRequest::DeleteProfile { .. } => "delete_profile",
4351 DebugRequest::RecordAndReplayProfile { .. } => "record_and_replay_profile",
4352 DebugRequest::ReplayXorRecordProfile { .. } => "replay_xor_record_profile",
4353 DebugRequest::StopProfileTasks { .. } => "stop_profile_tasks",
4354 DebugRequest::ClearCaches { .. } => "clear_caches",
4355 }
4356 }
4357}
4358
4359#[derive(Debug, Clone)]
4360pub struct DebugControlHandle {
4361 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4362}
4363
4364impl fidl::endpoints::ControlHandle for DebugControlHandle {
4365 fn shutdown(&self) {
4366 self.inner.shutdown()
4367 }
4368
4369 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4370 self.inner.shutdown_with_epitaph(status)
4371 }
4372
4373 fn is_closed(&self) -> bool {
4374 self.inner.channel().is_closed()
4375 }
4376 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4377 self.inner.channel().on_closed()
4378 }
4379
4380 #[cfg(target_os = "fuchsia")]
4381 fn signal_peer(
4382 &self,
4383 clear_mask: zx::Signals,
4384 set_mask: zx::Signals,
4385 ) -> Result<(), zx_status::Status> {
4386 use fidl::Peered;
4387 self.inner.channel().signal_peer(clear_mask, set_mask)
4388 }
4389}
4390
4391impl DebugControlHandle {}
4392
4393#[must_use = "FIDL methods require a response to be sent"]
4394#[derive(Debug)]
4395pub struct DebugCompactResponder {
4396 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
4397 tx_id: u32,
4398}
4399
4400impl std::ops::Drop for DebugCompactResponder {
4404 fn drop(&mut self) {
4405 self.control_handle.shutdown();
4406 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4408 }
4409}
4410
4411impl fidl::endpoints::Responder for DebugCompactResponder {
4412 type ControlHandle = DebugControlHandle;
4413
4414 fn control_handle(&self) -> &DebugControlHandle {
4415 &self.control_handle
4416 }
4417
4418 fn drop_without_shutdown(mut self) {
4419 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4421 std::mem::forget(self);
4423 }
4424}
4425
4426impl DebugCompactResponder {
4427 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4431 let _result = self.send_raw(result);
4432 if _result.is_err() {
4433 self.control_handle.shutdown();
4434 }
4435 self.drop_without_shutdown();
4436 _result
4437 }
4438
4439 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4441 let _result = self.send_raw(result);
4442 self.drop_without_shutdown();
4443 _result
4444 }
4445
4446 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4447 self.control_handle
4448 .inner
4449 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4450 result,
4451 self.tx_id,
4452 0x6553eb197306e489,
4453 fidl::encoding::DynamicFlags::empty(),
4454 )
4455 }
4456}
4457
4458#[must_use = "FIDL methods require a response to be sent"]
4459#[derive(Debug)]
4460pub struct DebugDeleteProfileResponder {
4461 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
4462 tx_id: u32,
4463}
4464
4465impl std::ops::Drop for DebugDeleteProfileResponder {
4469 fn drop(&mut self) {
4470 self.control_handle.shutdown();
4471 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4473 }
4474}
4475
4476impl fidl::endpoints::Responder for DebugDeleteProfileResponder {
4477 type ControlHandle = DebugControlHandle;
4478
4479 fn control_handle(&self) -> &DebugControlHandle {
4480 &self.control_handle
4481 }
4482
4483 fn drop_without_shutdown(mut self) {
4484 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4486 std::mem::forget(self);
4488 }
4489}
4490
4491impl DebugDeleteProfileResponder {
4492 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4496 let _result = self.send_raw(result);
4497 if _result.is_err() {
4498 self.control_handle.shutdown();
4499 }
4500 self.drop_without_shutdown();
4501 _result
4502 }
4503
4504 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4506 let _result = self.send_raw(result);
4507 self.drop_without_shutdown();
4508 _result
4509 }
4510
4511 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4512 self.control_handle
4513 .inner
4514 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4515 result,
4516 self.tx_id,
4517 0x54d9d4c9cf300a1e,
4518 fidl::encoding::DynamicFlags::empty(),
4519 )
4520 }
4521}
4522
4523#[must_use = "FIDL methods require a response to be sent"]
4524#[derive(Debug)]
4525pub struct DebugRecordAndReplayProfileResponder {
4526 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
4527 tx_id: u32,
4528}
4529
4530impl std::ops::Drop for DebugRecordAndReplayProfileResponder {
4534 fn drop(&mut self) {
4535 self.control_handle.shutdown();
4536 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4538 }
4539}
4540
4541impl fidl::endpoints::Responder for DebugRecordAndReplayProfileResponder {
4542 type ControlHandle = DebugControlHandle;
4543
4544 fn control_handle(&self) -> &DebugControlHandle {
4545 &self.control_handle
4546 }
4547
4548 fn drop_without_shutdown(mut self) {
4549 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4551 std::mem::forget(self);
4553 }
4554}
4555
4556impl DebugRecordAndReplayProfileResponder {
4557 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4561 let _result = self.send_raw(result);
4562 if _result.is_err() {
4563 self.control_handle.shutdown();
4564 }
4565 self.drop_without_shutdown();
4566 _result
4567 }
4568
4569 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4571 let _result = self.send_raw(result);
4572 self.drop_without_shutdown();
4573 _result
4574 }
4575
4576 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4577 self.control_handle
4578 .inner
4579 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4580 result,
4581 self.tx_id,
4582 0x3973943f9b3a9010,
4583 fidl::encoding::DynamicFlags::empty(),
4584 )
4585 }
4586}
4587
4588#[must_use = "FIDL methods require a response to be sent"]
4589#[derive(Debug)]
4590pub struct DebugReplayXorRecordProfileResponder {
4591 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
4592 tx_id: u32,
4593}
4594
4595impl std::ops::Drop for DebugReplayXorRecordProfileResponder {
4599 fn drop(&mut self) {
4600 self.control_handle.shutdown();
4601 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4603 }
4604}
4605
4606impl fidl::endpoints::Responder for DebugReplayXorRecordProfileResponder {
4607 type ControlHandle = DebugControlHandle;
4608
4609 fn control_handle(&self) -> &DebugControlHandle {
4610 &self.control_handle
4611 }
4612
4613 fn drop_without_shutdown(mut self) {
4614 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4616 std::mem::forget(self);
4618 }
4619}
4620
4621impl DebugReplayXorRecordProfileResponder {
4622 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4626 let _result = self.send_raw(result);
4627 if _result.is_err() {
4628 self.control_handle.shutdown();
4629 }
4630 self.drop_without_shutdown();
4631 _result
4632 }
4633
4634 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4636 let _result = self.send_raw(result);
4637 self.drop_without_shutdown();
4638 _result
4639 }
4640
4641 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4642 self.control_handle
4643 .inner
4644 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4645 result,
4646 self.tx_id,
4647 0x301678a1cebeef20,
4648 fidl::encoding::DynamicFlags::empty(),
4649 )
4650 }
4651}
4652
4653#[must_use = "FIDL methods require a response to be sent"]
4654#[derive(Debug)]
4655pub struct DebugStopProfileTasksResponder {
4656 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
4657 tx_id: u32,
4658}
4659
4660impl std::ops::Drop for DebugStopProfileTasksResponder {
4664 fn drop(&mut self) {
4665 self.control_handle.shutdown();
4666 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4668 }
4669}
4670
4671impl fidl::endpoints::Responder for DebugStopProfileTasksResponder {
4672 type ControlHandle = DebugControlHandle;
4673
4674 fn control_handle(&self) -> &DebugControlHandle {
4675 &self.control_handle
4676 }
4677
4678 fn drop_without_shutdown(mut self) {
4679 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4681 std::mem::forget(self);
4683 }
4684}
4685
4686impl DebugStopProfileTasksResponder {
4687 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4691 let _result = self.send_raw(result);
4692 if _result.is_err() {
4693 self.control_handle.shutdown();
4694 }
4695 self.drop_without_shutdown();
4696 _result
4697 }
4698
4699 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4701 let _result = self.send_raw(result);
4702 self.drop_without_shutdown();
4703 _result
4704 }
4705
4706 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4707 self.control_handle
4708 .inner
4709 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4710 result,
4711 self.tx_id,
4712 0x1657b945dd629177,
4713 fidl::encoding::DynamicFlags::empty(),
4714 )
4715 }
4716}
4717
4718#[must_use = "FIDL methods require a response to be sent"]
4719#[derive(Debug)]
4720pub struct DebugClearCachesResponder {
4721 control_handle: std::mem::ManuallyDrop<DebugControlHandle>,
4722 tx_id: u32,
4723}
4724
4725impl std::ops::Drop for DebugClearCachesResponder {
4729 fn drop(&mut self) {
4730 self.control_handle.shutdown();
4731 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4733 }
4734}
4735
4736impl fidl::endpoints::Responder for DebugClearCachesResponder {
4737 type ControlHandle = DebugControlHandle;
4738
4739 fn control_handle(&self) -> &DebugControlHandle {
4740 &self.control_handle
4741 }
4742
4743 fn drop_without_shutdown(mut self) {
4744 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4746 std::mem::forget(self);
4748 }
4749}
4750
4751impl DebugClearCachesResponder {
4752 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4756 let _result = self.send_raw(result);
4757 if _result.is_err() {
4758 self.control_handle.shutdown();
4759 }
4760 self.drop_without_shutdown();
4761 _result
4762 }
4763
4764 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4766 let _result = self.send_raw(result);
4767 self.drop_without_shutdown();
4768 _result
4769 }
4770
4771 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4772 self.control_handle
4773 .inner
4774 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4775 result,
4776 self.tx_id,
4777 0x539de2a4580de767,
4778 fidl::encoding::DynamicFlags::empty(),
4779 )
4780 }
4781}
4782
4783#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4784pub struct FileBackedVolumeProviderMarker;
4785
4786impl fidl::endpoints::ProtocolMarker for FileBackedVolumeProviderMarker {
4787 type Proxy = FileBackedVolumeProviderProxy;
4788 type RequestStream = FileBackedVolumeProviderRequestStream;
4789 #[cfg(target_os = "fuchsia")]
4790 type SynchronousProxy = FileBackedVolumeProviderSynchronousProxy;
4791
4792 const DEBUG_NAME: &'static str = "fuchsia.fxfs.FileBackedVolumeProvider";
4793}
4794impl fidl::endpoints::DiscoverableProtocolMarker for FileBackedVolumeProviderMarker {}
4795
4796pub trait FileBackedVolumeProviderProxyInterface: Send + Sync {
4797 fn r#open(
4798 &self,
4799 parent_directory_token: fidl::NullableHandle,
4800 name: &str,
4801 server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
4802 ) -> Result<(), fidl::Error>;
4803}
4804#[derive(Debug)]
4805#[cfg(target_os = "fuchsia")]
4806pub struct FileBackedVolumeProviderSynchronousProxy {
4807 client: fidl::client::sync::Client,
4808}
4809
4810#[cfg(target_os = "fuchsia")]
4811impl fidl::endpoints::SynchronousProxy for FileBackedVolumeProviderSynchronousProxy {
4812 type Proxy = FileBackedVolumeProviderProxy;
4813 type Protocol = FileBackedVolumeProviderMarker;
4814
4815 fn from_channel(inner: fidl::Channel) -> Self {
4816 Self::new(inner)
4817 }
4818
4819 fn into_channel(self) -> fidl::Channel {
4820 self.client.into_channel()
4821 }
4822
4823 fn as_channel(&self) -> &fidl::Channel {
4824 self.client.as_channel()
4825 }
4826}
4827
4828#[cfg(target_os = "fuchsia")]
4829impl FileBackedVolumeProviderSynchronousProxy {
4830 pub fn new(channel: fidl::Channel) -> Self {
4831 Self { client: fidl::client::sync::Client::new(channel) }
4832 }
4833
4834 pub fn into_channel(self) -> fidl::Channel {
4835 self.client.into_channel()
4836 }
4837
4838 pub fn wait_for_event(
4841 &self,
4842 deadline: zx::MonotonicInstant,
4843 ) -> Result<FileBackedVolumeProviderEvent, fidl::Error> {
4844 FileBackedVolumeProviderEvent::decode(
4845 self.client.wait_for_event::<FileBackedVolumeProviderMarker>(deadline)?,
4846 )
4847 }
4848
4849 pub fn r#open(
4863 &self,
4864 mut parent_directory_token: fidl::NullableHandle,
4865 mut name: &str,
4866 mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
4867 ) -> Result<(), fidl::Error> {
4868 self.client.send::<FileBackedVolumeProviderOpenRequest>(
4869 (parent_directory_token, name, server_end),
4870 0x67120b9fc9f319ee,
4871 fidl::encoding::DynamicFlags::empty(),
4872 )
4873 }
4874}
4875
4876#[cfg(target_os = "fuchsia")]
4877impl From<FileBackedVolumeProviderSynchronousProxy> for zx::NullableHandle {
4878 fn from(value: FileBackedVolumeProviderSynchronousProxy) -> Self {
4879 value.into_channel().into()
4880 }
4881}
4882
4883#[cfg(target_os = "fuchsia")]
4884impl From<fidl::Channel> for FileBackedVolumeProviderSynchronousProxy {
4885 fn from(value: fidl::Channel) -> Self {
4886 Self::new(value)
4887 }
4888}
4889
4890#[cfg(target_os = "fuchsia")]
4891impl fidl::endpoints::FromClient for FileBackedVolumeProviderSynchronousProxy {
4892 type Protocol = FileBackedVolumeProviderMarker;
4893
4894 fn from_client(value: fidl::endpoints::ClientEnd<FileBackedVolumeProviderMarker>) -> Self {
4895 Self::new(value.into_channel())
4896 }
4897}
4898
4899#[derive(Debug, Clone)]
4900pub struct FileBackedVolumeProviderProxy {
4901 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4902}
4903
4904impl fidl::endpoints::Proxy for FileBackedVolumeProviderProxy {
4905 type Protocol = FileBackedVolumeProviderMarker;
4906
4907 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4908 Self::new(inner)
4909 }
4910
4911 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4912 self.client.into_channel().map_err(|client| Self { client })
4913 }
4914
4915 fn as_channel(&self) -> &::fidl::AsyncChannel {
4916 self.client.as_channel()
4917 }
4918}
4919
4920impl FileBackedVolumeProviderProxy {
4921 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4923 let protocol_name =
4924 <FileBackedVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4925 Self { client: fidl::client::Client::new(channel, protocol_name) }
4926 }
4927
4928 pub fn take_event_stream(&self) -> FileBackedVolumeProviderEventStream {
4934 FileBackedVolumeProviderEventStream { event_receiver: self.client.take_event_receiver() }
4935 }
4936
4937 pub fn r#open(
4951 &self,
4952 mut parent_directory_token: fidl::NullableHandle,
4953 mut name: &str,
4954 mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
4955 ) -> Result<(), fidl::Error> {
4956 FileBackedVolumeProviderProxyInterface::r#open(
4957 self,
4958 parent_directory_token,
4959 name,
4960 server_end,
4961 )
4962 }
4963}
4964
4965impl FileBackedVolumeProviderProxyInterface for FileBackedVolumeProviderProxy {
4966 fn r#open(
4967 &self,
4968 mut parent_directory_token: fidl::NullableHandle,
4969 mut name: &str,
4970 mut server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
4971 ) -> Result<(), fidl::Error> {
4972 self.client.send::<FileBackedVolumeProviderOpenRequest>(
4973 (parent_directory_token, name, server_end),
4974 0x67120b9fc9f319ee,
4975 fidl::encoding::DynamicFlags::empty(),
4976 )
4977 }
4978}
4979
4980pub struct FileBackedVolumeProviderEventStream {
4981 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4982}
4983
4984impl std::marker::Unpin for FileBackedVolumeProviderEventStream {}
4985
4986impl futures::stream::FusedStream for FileBackedVolumeProviderEventStream {
4987 fn is_terminated(&self) -> bool {
4988 self.event_receiver.is_terminated()
4989 }
4990}
4991
4992impl futures::Stream for FileBackedVolumeProviderEventStream {
4993 type Item = Result<FileBackedVolumeProviderEvent, fidl::Error>;
4994
4995 fn poll_next(
4996 mut self: std::pin::Pin<&mut Self>,
4997 cx: &mut std::task::Context<'_>,
4998 ) -> std::task::Poll<Option<Self::Item>> {
4999 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5000 &mut self.event_receiver,
5001 cx
5002 )?) {
5003 Some(buf) => std::task::Poll::Ready(Some(FileBackedVolumeProviderEvent::decode(buf))),
5004 None => std::task::Poll::Ready(None),
5005 }
5006 }
5007}
5008
5009#[derive(Debug)]
5010pub enum FileBackedVolumeProviderEvent {}
5011
5012impl FileBackedVolumeProviderEvent {
5013 fn decode(
5015 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5016 ) -> Result<FileBackedVolumeProviderEvent, fidl::Error> {
5017 let (bytes, _handles) = buf.split_mut();
5018 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5019 debug_assert_eq!(tx_header.tx_id, 0);
5020 match tx_header.ordinal {
5021 _ => Err(fidl::Error::UnknownOrdinal {
5022 ordinal: tx_header.ordinal,
5023 protocol_name:
5024 <FileBackedVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5025 }),
5026 }
5027 }
5028}
5029
5030pub struct FileBackedVolumeProviderRequestStream {
5032 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5033 is_terminated: bool,
5034}
5035
5036impl std::marker::Unpin for FileBackedVolumeProviderRequestStream {}
5037
5038impl futures::stream::FusedStream for FileBackedVolumeProviderRequestStream {
5039 fn is_terminated(&self) -> bool {
5040 self.is_terminated
5041 }
5042}
5043
5044impl fidl::endpoints::RequestStream for FileBackedVolumeProviderRequestStream {
5045 type Protocol = FileBackedVolumeProviderMarker;
5046 type ControlHandle = FileBackedVolumeProviderControlHandle;
5047
5048 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5049 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5050 }
5051
5052 fn control_handle(&self) -> Self::ControlHandle {
5053 FileBackedVolumeProviderControlHandle { inner: self.inner.clone() }
5054 }
5055
5056 fn into_inner(
5057 self,
5058 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5059 {
5060 (self.inner, self.is_terminated)
5061 }
5062
5063 fn from_inner(
5064 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5065 is_terminated: bool,
5066 ) -> Self {
5067 Self { inner, is_terminated }
5068 }
5069}
5070
5071impl futures::Stream for FileBackedVolumeProviderRequestStream {
5072 type Item = Result<FileBackedVolumeProviderRequest, fidl::Error>;
5073
5074 fn poll_next(
5075 mut self: std::pin::Pin<&mut Self>,
5076 cx: &mut std::task::Context<'_>,
5077 ) -> std::task::Poll<Option<Self::Item>> {
5078 let this = &mut *self;
5079 if this.inner.check_shutdown(cx) {
5080 this.is_terminated = true;
5081 return std::task::Poll::Ready(None);
5082 }
5083 if this.is_terminated {
5084 panic!("polled FileBackedVolumeProviderRequestStream after completion");
5085 }
5086 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5087 |bytes, handles| {
5088 match this.inner.channel().read_etc(cx, bytes, handles) {
5089 std::task::Poll::Ready(Ok(())) => {}
5090 std::task::Poll::Pending => return std::task::Poll::Pending,
5091 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5092 this.is_terminated = true;
5093 return std::task::Poll::Ready(None);
5094 }
5095 std::task::Poll::Ready(Err(e)) => {
5096 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5097 e.into(),
5098 ))));
5099 }
5100 }
5101
5102 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5104
5105 std::task::Poll::Ready(Some(match header.ordinal {
5106 0x67120b9fc9f319ee => {
5107 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
5108 let mut req = fidl::new_empty!(FileBackedVolumeProviderOpenRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
5109 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FileBackedVolumeProviderOpenRequest>(&header, _body_bytes, handles, &mut req)?;
5110 let control_handle = FileBackedVolumeProviderControlHandle {
5111 inner: this.inner.clone(),
5112 };
5113 Ok(FileBackedVolumeProviderRequest::Open {parent_directory_token: req.parent_directory_token,
5114name: req.name,
5115server_end: req.server_end,
5116
5117 control_handle,
5118 })
5119 }
5120 _ => Err(fidl::Error::UnknownOrdinal {
5121 ordinal: header.ordinal,
5122 protocol_name: <FileBackedVolumeProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5123 }),
5124 }))
5125 },
5126 )
5127 }
5128}
5129
5130#[derive(Debug)]
5132pub enum FileBackedVolumeProviderRequest {
5133 Open {
5147 parent_directory_token: fidl::NullableHandle,
5148 name: String,
5149 server_end: fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
5150 control_handle: FileBackedVolumeProviderControlHandle,
5151 },
5152}
5153
5154impl FileBackedVolumeProviderRequest {
5155 #[allow(irrefutable_let_patterns)]
5156 pub fn into_open(
5157 self,
5158 ) -> Option<(
5159 fidl::NullableHandle,
5160 String,
5161 fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
5162 FileBackedVolumeProviderControlHandle,
5163 )> {
5164 if let FileBackedVolumeProviderRequest::Open {
5165 parent_directory_token,
5166 name,
5167 server_end,
5168 control_handle,
5169 } = self
5170 {
5171 Some((parent_directory_token, name, server_end, control_handle))
5172 } else {
5173 None
5174 }
5175 }
5176
5177 pub fn method_name(&self) -> &'static str {
5179 match *self {
5180 FileBackedVolumeProviderRequest::Open { .. } => "open",
5181 }
5182 }
5183}
5184
5185#[derive(Debug, Clone)]
5186pub struct FileBackedVolumeProviderControlHandle {
5187 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5188}
5189
5190impl fidl::endpoints::ControlHandle for FileBackedVolumeProviderControlHandle {
5191 fn shutdown(&self) {
5192 self.inner.shutdown()
5193 }
5194
5195 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5196 self.inner.shutdown_with_epitaph(status)
5197 }
5198
5199 fn is_closed(&self) -> bool {
5200 self.inner.channel().is_closed()
5201 }
5202 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5203 self.inner.channel().on_closed()
5204 }
5205
5206 #[cfg(target_os = "fuchsia")]
5207 fn signal_peer(
5208 &self,
5209 clear_mask: zx::Signals,
5210 set_mask: zx::Signals,
5211 ) -> Result<(), zx_status::Status> {
5212 use fidl::Peered;
5213 self.inner.channel().signal_peer(clear_mask, set_mask)
5214 }
5215}
5216
5217impl FileBackedVolumeProviderControlHandle {}
5218
5219#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5220pub struct ProjectIdMarker;
5221
5222impl fidl::endpoints::ProtocolMarker for ProjectIdMarker {
5223 type Proxy = ProjectIdProxy;
5224 type RequestStream = ProjectIdRequestStream;
5225 #[cfg(target_os = "fuchsia")]
5226 type SynchronousProxy = ProjectIdSynchronousProxy;
5227
5228 const DEBUG_NAME: &'static str = "fuchsia.fxfs.ProjectId";
5229}
5230impl fidl::endpoints::DiscoverableProtocolMarker for ProjectIdMarker {}
5231pub type ProjectIdSetLimitResult = Result<(), i32>;
5232pub type ProjectIdClearResult = Result<(), i32>;
5233pub type ProjectIdSetForNodeResult = Result<(), i32>;
5234pub type ProjectIdGetForNodeResult = Result<u64, i32>;
5235pub type ProjectIdClearForNodeResult = Result<(), i32>;
5236pub type ProjectIdListResult = Result<(Vec<u64>, Option<Box<ProjectIterToken>>), i32>;
5237pub type ProjectIdInfoResult = Result<(BytesAndNodes, BytesAndNodes), i32>;
5238
5239pub trait ProjectIdProxyInterface: Send + Sync {
5240 type SetLimitResponseFut: std::future::Future<Output = Result<ProjectIdSetLimitResult, fidl::Error>>
5241 + Send;
5242 fn r#set_limit(&self, project_id: u64, bytes: u64, nodes: u64) -> Self::SetLimitResponseFut;
5243 type ClearResponseFut: std::future::Future<Output = Result<ProjectIdClearResult, fidl::Error>>
5244 + Send;
5245 fn r#clear(&self, project_id: u64) -> Self::ClearResponseFut;
5246 type SetForNodeResponseFut: std::future::Future<Output = Result<ProjectIdSetForNodeResult, fidl::Error>>
5247 + Send;
5248 fn r#set_for_node(&self, node_id: u64, project_id: u64) -> Self::SetForNodeResponseFut;
5249 type GetForNodeResponseFut: std::future::Future<Output = Result<ProjectIdGetForNodeResult, fidl::Error>>
5250 + Send;
5251 fn r#get_for_node(&self, node_id: u64) -> Self::GetForNodeResponseFut;
5252 type ClearForNodeResponseFut: std::future::Future<Output = Result<ProjectIdClearForNodeResult, fidl::Error>>
5253 + Send;
5254 fn r#clear_for_node(&self, node_id: u64) -> Self::ClearForNodeResponseFut;
5255 type ListResponseFut: std::future::Future<Output = Result<ProjectIdListResult, fidl::Error>>
5256 + Send;
5257 fn r#list(&self, token: Option<&ProjectIterToken>) -> Self::ListResponseFut;
5258 type InfoResponseFut: std::future::Future<Output = Result<ProjectIdInfoResult, fidl::Error>>
5259 + Send;
5260 fn r#info(&self, project_id: u64) -> Self::InfoResponseFut;
5261}
5262#[derive(Debug)]
5263#[cfg(target_os = "fuchsia")]
5264pub struct ProjectIdSynchronousProxy {
5265 client: fidl::client::sync::Client,
5266}
5267
5268#[cfg(target_os = "fuchsia")]
5269impl fidl::endpoints::SynchronousProxy for ProjectIdSynchronousProxy {
5270 type Proxy = ProjectIdProxy;
5271 type Protocol = ProjectIdMarker;
5272
5273 fn from_channel(inner: fidl::Channel) -> Self {
5274 Self::new(inner)
5275 }
5276
5277 fn into_channel(self) -> fidl::Channel {
5278 self.client.into_channel()
5279 }
5280
5281 fn as_channel(&self) -> &fidl::Channel {
5282 self.client.as_channel()
5283 }
5284}
5285
5286#[cfg(target_os = "fuchsia")]
5287impl ProjectIdSynchronousProxy {
5288 pub fn new(channel: fidl::Channel) -> Self {
5289 Self { client: fidl::client::sync::Client::new(channel) }
5290 }
5291
5292 pub fn into_channel(self) -> fidl::Channel {
5293 self.client.into_channel()
5294 }
5295
5296 pub fn wait_for_event(
5299 &self,
5300 deadline: zx::MonotonicInstant,
5301 ) -> Result<ProjectIdEvent, fidl::Error> {
5302 ProjectIdEvent::decode(self.client.wait_for_event::<ProjectIdMarker>(deadline)?)
5303 }
5304
5305 pub fn r#set_limit(
5309 &self,
5310 mut project_id: u64,
5311 mut bytes: u64,
5312 mut nodes: u64,
5313 ___deadline: zx::MonotonicInstant,
5314 ) -> Result<ProjectIdSetLimitResult, fidl::Error> {
5315 let _response = self.client.send_query::<
5316 ProjectIdSetLimitRequest,
5317 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5318 ProjectIdMarker,
5319 >(
5320 (project_id, bytes, nodes,),
5321 0x20b0fc1e0413876f,
5322 fidl::encoding::DynamicFlags::empty(),
5323 ___deadline,
5324 )?;
5325 Ok(_response.map(|x| x))
5326 }
5327
5328 pub fn r#clear(
5332 &self,
5333 mut project_id: u64,
5334 ___deadline: zx::MonotonicInstant,
5335 ) -> Result<ProjectIdClearResult, fidl::Error> {
5336 let _response = self.client.send_query::<
5337 ProjectIdClearRequest,
5338 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5339 ProjectIdMarker,
5340 >(
5341 (project_id,),
5342 0x165b5f1e707863c1,
5343 fidl::encoding::DynamicFlags::empty(),
5344 ___deadline,
5345 )?;
5346 Ok(_response.map(|x| x))
5347 }
5348
5349 pub fn r#set_for_node(
5352 &self,
5353 mut node_id: u64,
5354 mut project_id: u64,
5355 ___deadline: zx::MonotonicInstant,
5356 ) -> Result<ProjectIdSetForNodeResult, fidl::Error> {
5357 let _response = self.client.send_query::<
5358 ProjectIdSetForNodeRequest,
5359 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5360 ProjectIdMarker,
5361 >(
5362 (node_id, project_id,),
5363 0x4d7a8442dc58324c,
5364 fidl::encoding::DynamicFlags::empty(),
5365 ___deadline,
5366 )?;
5367 Ok(_response.map(|x| x))
5368 }
5369
5370 pub fn r#get_for_node(
5374 &self,
5375 mut node_id: u64,
5376 ___deadline: zx::MonotonicInstant,
5377 ) -> Result<ProjectIdGetForNodeResult, fidl::Error> {
5378 let _response = self.client.send_query::<
5379 ProjectIdGetForNodeRequest,
5380 fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>,
5381 ProjectIdMarker,
5382 >(
5383 (node_id,),
5384 0x644073bdf2542573,
5385 fidl::encoding::DynamicFlags::empty(),
5386 ___deadline,
5387 )?;
5388 Ok(_response.map(|x| x.project_id))
5389 }
5390
5391 pub fn r#clear_for_node(
5395 &self,
5396 mut node_id: u64,
5397 ___deadline: zx::MonotonicInstant,
5398 ) -> Result<ProjectIdClearForNodeResult, fidl::Error> {
5399 let _response = self.client.send_query::<
5400 ProjectIdClearForNodeRequest,
5401 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5402 ProjectIdMarker,
5403 >(
5404 (node_id,),
5405 0x3f2ca287bbfe6a62,
5406 fidl::encoding::DynamicFlags::empty(),
5407 ___deadline,
5408 )?;
5409 Ok(_response.map(|x| x))
5410 }
5411
5412 pub fn r#list(
5417 &self,
5418 mut token: Option<&ProjectIterToken>,
5419 ___deadline: zx::MonotonicInstant,
5420 ) -> Result<ProjectIdListResult, fidl::Error> {
5421 let _response = self.client.send_query::<
5422 ProjectIdListRequest,
5423 fidl::encoding::ResultType<ProjectIdListResponse, i32>,
5424 ProjectIdMarker,
5425 >(
5426 (token,),
5427 0x5505f95a36d522cc,
5428 fidl::encoding::DynamicFlags::empty(),
5429 ___deadline,
5430 )?;
5431 Ok(_response.map(|x| (x.entries, x.next_token)))
5432 }
5433
5434 pub fn r#info(
5437 &self,
5438 mut project_id: u64,
5439 ___deadline: zx::MonotonicInstant,
5440 ) -> Result<ProjectIdInfoResult, fidl::Error> {
5441 let _response = self.client.send_query::<
5442 ProjectIdInfoRequest,
5443 fidl::encoding::ResultType<ProjectIdInfoResponse, i32>,
5444 ProjectIdMarker,
5445 >(
5446 (project_id,),
5447 0x51b47743c9e2d1ab,
5448 fidl::encoding::DynamicFlags::empty(),
5449 ___deadline,
5450 )?;
5451 Ok(_response.map(|x| (x.limit, x.usage)))
5452 }
5453}
5454
5455#[cfg(target_os = "fuchsia")]
5456impl From<ProjectIdSynchronousProxy> for zx::NullableHandle {
5457 fn from(value: ProjectIdSynchronousProxy) -> Self {
5458 value.into_channel().into()
5459 }
5460}
5461
5462#[cfg(target_os = "fuchsia")]
5463impl From<fidl::Channel> for ProjectIdSynchronousProxy {
5464 fn from(value: fidl::Channel) -> Self {
5465 Self::new(value)
5466 }
5467}
5468
5469#[cfg(target_os = "fuchsia")]
5470impl fidl::endpoints::FromClient for ProjectIdSynchronousProxy {
5471 type Protocol = ProjectIdMarker;
5472
5473 fn from_client(value: fidl::endpoints::ClientEnd<ProjectIdMarker>) -> Self {
5474 Self::new(value.into_channel())
5475 }
5476}
5477
5478#[derive(Debug, Clone)]
5479pub struct ProjectIdProxy {
5480 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5481}
5482
5483impl fidl::endpoints::Proxy for ProjectIdProxy {
5484 type Protocol = ProjectIdMarker;
5485
5486 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5487 Self::new(inner)
5488 }
5489
5490 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5491 self.client.into_channel().map_err(|client| Self { client })
5492 }
5493
5494 fn as_channel(&self) -> &::fidl::AsyncChannel {
5495 self.client.as_channel()
5496 }
5497}
5498
5499impl ProjectIdProxy {
5500 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5502 let protocol_name = <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5503 Self { client: fidl::client::Client::new(channel, protocol_name) }
5504 }
5505
5506 pub fn take_event_stream(&self) -> ProjectIdEventStream {
5512 ProjectIdEventStream { event_receiver: self.client.take_event_receiver() }
5513 }
5514
5515 pub fn r#set_limit(
5519 &self,
5520 mut project_id: u64,
5521 mut bytes: u64,
5522 mut nodes: u64,
5523 ) -> fidl::client::QueryResponseFut<
5524 ProjectIdSetLimitResult,
5525 fidl::encoding::DefaultFuchsiaResourceDialect,
5526 > {
5527 ProjectIdProxyInterface::r#set_limit(self, project_id, bytes, nodes)
5528 }
5529
5530 pub fn r#clear(
5534 &self,
5535 mut project_id: u64,
5536 ) -> fidl::client::QueryResponseFut<
5537 ProjectIdClearResult,
5538 fidl::encoding::DefaultFuchsiaResourceDialect,
5539 > {
5540 ProjectIdProxyInterface::r#clear(self, project_id)
5541 }
5542
5543 pub fn r#set_for_node(
5546 &self,
5547 mut node_id: u64,
5548 mut project_id: u64,
5549 ) -> fidl::client::QueryResponseFut<
5550 ProjectIdSetForNodeResult,
5551 fidl::encoding::DefaultFuchsiaResourceDialect,
5552 > {
5553 ProjectIdProxyInterface::r#set_for_node(self, node_id, project_id)
5554 }
5555
5556 pub fn r#get_for_node(
5560 &self,
5561 mut node_id: u64,
5562 ) -> fidl::client::QueryResponseFut<
5563 ProjectIdGetForNodeResult,
5564 fidl::encoding::DefaultFuchsiaResourceDialect,
5565 > {
5566 ProjectIdProxyInterface::r#get_for_node(self, node_id)
5567 }
5568
5569 pub fn r#clear_for_node(
5573 &self,
5574 mut node_id: u64,
5575 ) -> fidl::client::QueryResponseFut<
5576 ProjectIdClearForNodeResult,
5577 fidl::encoding::DefaultFuchsiaResourceDialect,
5578 > {
5579 ProjectIdProxyInterface::r#clear_for_node(self, node_id)
5580 }
5581
5582 pub fn r#list(
5587 &self,
5588 mut token: Option<&ProjectIterToken>,
5589 ) -> fidl::client::QueryResponseFut<
5590 ProjectIdListResult,
5591 fidl::encoding::DefaultFuchsiaResourceDialect,
5592 > {
5593 ProjectIdProxyInterface::r#list(self, token)
5594 }
5595
5596 pub fn r#info(
5599 &self,
5600 mut project_id: u64,
5601 ) -> fidl::client::QueryResponseFut<
5602 ProjectIdInfoResult,
5603 fidl::encoding::DefaultFuchsiaResourceDialect,
5604 > {
5605 ProjectIdProxyInterface::r#info(self, project_id)
5606 }
5607}
5608
5609impl ProjectIdProxyInterface for ProjectIdProxy {
5610 type SetLimitResponseFut = fidl::client::QueryResponseFut<
5611 ProjectIdSetLimitResult,
5612 fidl::encoding::DefaultFuchsiaResourceDialect,
5613 >;
5614 fn r#set_limit(
5615 &self,
5616 mut project_id: u64,
5617 mut bytes: u64,
5618 mut nodes: u64,
5619 ) -> Self::SetLimitResponseFut {
5620 fn _decode(
5621 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5622 ) -> Result<ProjectIdSetLimitResult, fidl::Error> {
5623 let _response = fidl::client::decode_transaction_body::<
5624 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5625 fidl::encoding::DefaultFuchsiaResourceDialect,
5626 0x20b0fc1e0413876f,
5627 >(_buf?)?;
5628 Ok(_response.map(|x| x))
5629 }
5630 self.client.send_query_and_decode::<ProjectIdSetLimitRequest, ProjectIdSetLimitResult>(
5631 (project_id, bytes, nodes),
5632 0x20b0fc1e0413876f,
5633 fidl::encoding::DynamicFlags::empty(),
5634 _decode,
5635 )
5636 }
5637
5638 type ClearResponseFut = fidl::client::QueryResponseFut<
5639 ProjectIdClearResult,
5640 fidl::encoding::DefaultFuchsiaResourceDialect,
5641 >;
5642 fn r#clear(&self, mut project_id: u64) -> Self::ClearResponseFut {
5643 fn _decode(
5644 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5645 ) -> Result<ProjectIdClearResult, fidl::Error> {
5646 let _response = fidl::client::decode_transaction_body::<
5647 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5648 fidl::encoding::DefaultFuchsiaResourceDialect,
5649 0x165b5f1e707863c1,
5650 >(_buf?)?;
5651 Ok(_response.map(|x| x))
5652 }
5653 self.client.send_query_and_decode::<ProjectIdClearRequest, ProjectIdClearResult>(
5654 (project_id,),
5655 0x165b5f1e707863c1,
5656 fidl::encoding::DynamicFlags::empty(),
5657 _decode,
5658 )
5659 }
5660
5661 type SetForNodeResponseFut = fidl::client::QueryResponseFut<
5662 ProjectIdSetForNodeResult,
5663 fidl::encoding::DefaultFuchsiaResourceDialect,
5664 >;
5665 fn r#set_for_node(&self, mut node_id: u64, mut project_id: u64) -> Self::SetForNodeResponseFut {
5666 fn _decode(
5667 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5668 ) -> Result<ProjectIdSetForNodeResult, fidl::Error> {
5669 let _response = fidl::client::decode_transaction_body::<
5670 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5671 fidl::encoding::DefaultFuchsiaResourceDialect,
5672 0x4d7a8442dc58324c,
5673 >(_buf?)?;
5674 Ok(_response.map(|x| x))
5675 }
5676 self.client.send_query_and_decode::<ProjectIdSetForNodeRequest, ProjectIdSetForNodeResult>(
5677 (node_id, project_id),
5678 0x4d7a8442dc58324c,
5679 fidl::encoding::DynamicFlags::empty(),
5680 _decode,
5681 )
5682 }
5683
5684 type GetForNodeResponseFut = fidl::client::QueryResponseFut<
5685 ProjectIdGetForNodeResult,
5686 fidl::encoding::DefaultFuchsiaResourceDialect,
5687 >;
5688 fn r#get_for_node(&self, mut node_id: u64) -> Self::GetForNodeResponseFut {
5689 fn _decode(
5690 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5691 ) -> Result<ProjectIdGetForNodeResult, fidl::Error> {
5692 let _response = fidl::client::decode_transaction_body::<
5693 fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>,
5694 fidl::encoding::DefaultFuchsiaResourceDialect,
5695 0x644073bdf2542573,
5696 >(_buf?)?;
5697 Ok(_response.map(|x| x.project_id))
5698 }
5699 self.client.send_query_and_decode::<ProjectIdGetForNodeRequest, ProjectIdGetForNodeResult>(
5700 (node_id,),
5701 0x644073bdf2542573,
5702 fidl::encoding::DynamicFlags::empty(),
5703 _decode,
5704 )
5705 }
5706
5707 type ClearForNodeResponseFut = fidl::client::QueryResponseFut<
5708 ProjectIdClearForNodeResult,
5709 fidl::encoding::DefaultFuchsiaResourceDialect,
5710 >;
5711 fn r#clear_for_node(&self, mut node_id: u64) -> Self::ClearForNodeResponseFut {
5712 fn _decode(
5713 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5714 ) -> Result<ProjectIdClearForNodeResult, fidl::Error> {
5715 let _response = fidl::client::decode_transaction_body::<
5716 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5717 fidl::encoding::DefaultFuchsiaResourceDialect,
5718 0x3f2ca287bbfe6a62,
5719 >(_buf?)?;
5720 Ok(_response.map(|x| x))
5721 }
5722 self.client
5723 .send_query_and_decode::<ProjectIdClearForNodeRequest, ProjectIdClearForNodeResult>(
5724 (node_id,),
5725 0x3f2ca287bbfe6a62,
5726 fidl::encoding::DynamicFlags::empty(),
5727 _decode,
5728 )
5729 }
5730
5731 type ListResponseFut = fidl::client::QueryResponseFut<
5732 ProjectIdListResult,
5733 fidl::encoding::DefaultFuchsiaResourceDialect,
5734 >;
5735 fn r#list(&self, mut token: Option<&ProjectIterToken>) -> Self::ListResponseFut {
5736 fn _decode(
5737 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5738 ) -> Result<ProjectIdListResult, fidl::Error> {
5739 let _response = fidl::client::decode_transaction_body::<
5740 fidl::encoding::ResultType<ProjectIdListResponse, i32>,
5741 fidl::encoding::DefaultFuchsiaResourceDialect,
5742 0x5505f95a36d522cc,
5743 >(_buf?)?;
5744 Ok(_response.map(|x| (x.entries, x.next_token)))
5745 }
5746 self.client.send_query_and_decode::<ProjectIdListRequest, ProjectIdListResult>(
5747 (token,),
5748 0x5505f95a36d522cc,
5749 fidl::encoding::DynamicFlags::empty(),
5750 _decode,
5751 )
5752 }
5753
5754 type InfoResponseFut = fidl::client::QueryResponseFut<
5755 ProjectIdInfoResult,
5756 fidl::encoding::DefaultFuchsiaResourceDialect,
5757 >;
5758 fn r#info(&self, mut project_id: u64) -> Self::InfoResponseFut {
5759 fn _decode(
5760 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5761 ) -> Result<ProjectIdInfoResult, fidl::Error> {
5762 let _response = fidl::client::decode_transaction_body::<
5763 fidl::encoding::ResultType<ProjectIdInfoResponse, i32>,
5764 fidl::encoding::DefaultFuchsiaResourceDialect,
5765 0x51b47743c9e2d1ab,
5766 >(_buf?)?;
5767 Ok(_response.map(|x| (x.limit, x.usage)))
5768 }
5769 self.client.send_query_and_decode::<ProjectIdInfoRequest, ProjectIdInfoResult>(
5770 (project_id,),
5771 0x51b47743c9e2d1ab,
5772 fidl::encoding::DynamicFlags::empty(),
5773 _decode,
5774 )
5775 }
5776}
5777
5778pub struct ProjectIdEventStream {
5779 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5780}
5781
5782impl std::marker::Unpin for ProjectIdEventStream {}
5783
5784impl futures::stream::FusedStream for ProjectIdEventStream {
5785 fn is_terminated(&self) -> bool {
5786 self.event_receiver.is_terminated()
5787 }
5788}
5789
5790impl futures::Stream for ProjectIdEventStream {
5791 type Item = Result<ProjectIdEvent, fidl::Error>;
5792
5793 fn poll_next(
5794 mut self: std::pin::Pin<&mut Self>,
5795 cx: &mut std::task::Context<'_>,
5796 ) -> std::task::Poll<Option<Self::Item>> {
5797 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5798 &mut self.event_receiver,
5799 cx
5800 )?) {
5801 Some(buf) => std::task::Poll::Ready(Some(ProjectIdEvent::decode(buf))),
5802 None => std::task::Poll::Ready(None),
5803 }
5804 }
5805}
5806
5807#[derive(Debug)]
5808pub enum ProjectIdEvent {}
5809
5810impl ProjectIdEvent {
5811 fn decode(
5813 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5814 ) -> Result<ProjectIdEvent, fidl::Error> {
5815 let (bytes, _handles) = buf.split_mut();
5816 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5817 debug_assert_eq!(tx_header.tx_id, 0);
5818 match tx_header.ordinal {
5819 _ => Err(fidl::Error::UnknownOrdinal {
5820 ordinal: tx_header.ordinal,
5821 protocol_name: <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5822 }),
5823 }
5824 }
5825}
5826
5827pub struct ProjectIdRequestStream {
5829 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5830 is_terminated: bool,
5831}
5832
5833impl std::marker::Unpin for ProjectIdRequestStream {}
5834
5835impl futures::stream::FusedStream for ProjectIdRequestStream {
5836 fn is_terminated(&self) -> bool {
5837 self.is_terminated
5838 }
5839}
5840
5841impl fidl::endpoints::RequestStream for ProjectIdRequestStream {
5842 type Protocol = ProjectIdMarker;
5843 type ControlHandle = ProjectIdControlHandle;
5844
5845 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5846 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5847 }
5848
5849 fn control_handle(&self) -> Self::ControlHandle {
5850 ProjectIdControlHandle { inner: self.inner.clone() }
5851 }
5852
5853 fn into_inner(
5854 self,
5855 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5856 {
5857 (self.inner, self.is_terminated)
5858 }
5859
5860 fn from_inner(
5861 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5862 is_terminated: bool,
5863 ) -> Self {
5864 Self { inner, is_terminated }
5865 }
5866}
5867
5868impl futures::Stream for ProjectIdRequestStream {
5869 type Item = Result<ProjectIdRequest, fidl::Error>;
5870
5871 fn poll_next(
5872 mut self: std::pin::Pin<&mut Self>,
5873 cx: &mut std::task::Context<'_>,
5874 ) -> std::task::Poll<Option<Self::Item>> {
5875 let this = &mut *self;
5876 if this.inner.check_shutdown(cx) {
5877 this.is_terminated = true;
5878 return std::task::Poll::Ready(None);
5879 }
5880 if this.is_terminated {
5881 panic!("polled ProjectIdRequestStream after completion");
5882 }
5883 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5884 |bytes, handles| {
5885 match this.inner.channel().read_etc(cx, bytes, handles) {
5886 std::task::Poll::Ready(Ok(())) => {}
5887 std::task::Poll::Pending => return std::task::Poll::Pending,
5888 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5889 this.is_terminated = true;
5890 return std::task::Poll::Ready(None);
5891 }
5892 std::task::Poll::Ready(Err(e)) => {
5893 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5894 e.into(),
5895 ))));
5896 }
5897 }
5898
5899 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5901
5902 std::task::Poll::Ready(Some(match header.ordinal {
5903 0x20b0fc1e0413876f => {
5904 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5905 let mut req = fidl::new_empty!(
5906 ProjectIdSetLimitRequest,
5907 fidl::encoding::DefaultFuchsiaResourceDialect
5908 );
5909 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdSetLimitRequest>(&header, _body_bytes, handles, &mut req)?;
5910 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5911 Ok(ProjectIdRequest::SetLimit {
5912 project_id: req.project_id,
5913 bytes: req.bytes,
5914 nodes: req.nodes,
5915
5916 responder: ProjectIdSetLimitResponder {
5917 control_handle: std::mem::ManuallyDrop::new(control_handle),
5918 tx_id: header.tx_id,
5919 },
5920 })
5921 }
5922 0x165b5f1e707863c1 => {
5923 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5924 let mut req = fidl::new_empty!(
5925 ProjectIdClearRequest,
5926 fidl::encoding::DefaultFuchsiaResourceDialect
5927 );
5928 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdClearRequest>(&header, _body_bytes, handles, &mut req)?;
5929 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5930 Ok(ProjectIdRequest::Clear {
5931 project_id: req.project_id,
5932
5933 responder: ProjectIdClearResponder {
5934 control_handle: std::mem::ManuallyDrop::new(control_handle),
5935 tx_id: header.tx_id,
5936 },
5937 })
5938 }
5939 0x4d7a8442dc58324c => {
5940 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5941 let mut req = fidl::new_empty!(
5942 ProjectIdSetForNodeRequest,
5943 fidl::encoding::DefaultFuchsiaResourceDialect
5944 );
5945 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdSetForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
5946 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5947 Ok(ProjectIdRequest::SetForNode {
5948 node_id: req.node_id,
5949 project_id: req.project_id,
5950
5951 responder: ProjectIdSetForNodeResponder {
5952 control_handle: std::mem::ManuallyDrop::new(control_handle),
5953 tx_id: header.tx_id,
5954 },
5955 })
5956 }
5957 0x644073bdf2542573 => {
5958 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5959 let mut req = fidl::new_empty!(
5960 ProjectIdGetForNodeRequest,
5961 fidl::encoding::DefaultFuchsiaResourceDialect
5962 );
5963 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdGetForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
5964 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5965 Ok(ProjectIdRequest::GetForNode {
5966 node_id: req.node_id,
5967
5968 responder: ProjectIdGetForNodeResponder {
5969 control_handle: std::mem::ManuallyDrop::new(control_handle),
5970 tx_id: header.tx_id,
5971 },
5972 })
5973 }
5974 0x3f2ca287bbfe6a62 => {
5975 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5976 let mut req = fidl::new_empty!(
5977 ProjectIdClearForNodeRequest,
5978 fidl::encoding::DefaultFuchsiaResourceDialect
5979 );
5980 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdClearForNodeRequest>(&header, _body_bytes, handles, &mut req)?;
5981 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5982 Ok(ProjectIdRequest::ClearForNode {
5983 node_id: req.node_id,
5984
5985 responder: ProjectIdClearForNodeResponder {
5986 control_handle: std::mem::ManuallyDrop::new(control_handle),
5987 tx_id: header.tx_id,
5988 },
5989 })
5990 }
5991 0x5505f95a36d522cc => {
5992 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5993 let mut req = fidl::new_empty!(
5994 ProjectIdListRequest,
5995 fidl::encoding::DefaultFuchsiaResourceDialect
5996 );
5997 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdListRequest>(&header, _body_bytes, handles, &mut req)?;
5998 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
5999 Ok(ProjectIdRequest::List {
6000 token: req.token,
6001
6002 responder: ProjectIdListResponder {
6003 control_handle: std::mem::ManuallyDrop::new(control_handle),
6004 tx_id: header.tx_id,
6005 },
6006 })
6007 }
6008 0x51b47743c9e2d1ab => {
6009 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6010 let mut req = fidl::new_empty!(
6011 ProjectIdInfoRequest,
6012 fidl::encoding::DefaultFuchsiaResourceDialect
6013 );
6014 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ProjectIdInfoRequest>(&header, _body_bytes, handles, &mut req)?;
6015 let control_handle = ProjectIdControlHandle { inner: this.inner.clone() };
6016 Ok(ProjectIdRequest::Info {
6017 project_id: req.project_id,
6018
6019 responder: ProjectIdInfoResponder {
6020 control_handle: std::mem::ManuallyDrop::new(control_handle),
6021 tx_id: header.tx_id,
6022 },
6023 })
6024 }
6025 _ => Err(fidl::Error::UnknownOrdinal {
6026 ordinal: header.ordinal,
6027 protocol_name:
6028 <ProjectIdMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6029 }),
6030 }))
6031 },
6032 )
6033 }
6034}
6035
6036#[derive(Debug)]
6037pub enum ProjectIdRequest {
6038 SetLimit { project_id: u64, bytes: u64, nodes: u64, responder: ProjectIdSetLimitResponder },
6042 Clear { project_id: u64, responder: ProjectIdClearResponder },
6046 SetForNode { node_id: u64, project_id: u64, responder: ProjectIdSetForNodeResponder },
6049 GetForNode { node_id: u64, responder: ProjectIdGetForNodeResponder },
6053 ClearForNode { node_id: u64, responder: ProjectIdClearForNodeResponder },
6057 List { token: Option<Box<ProjectIterToken>>, responder: ProjectIdListResponder },
6062 Info { project_id: u64, responder: ProjectIdInfoResponder },
6065}
6066
6067impl ProjectIdRequest {
6068 #[allow(irrefutable_let_patterns)]
6069 pub fn into_set_limit(self) -> Option<(u64, u64, u64, ProjectIdSetLimitResponder)> {
6070 if let ProjectIdRequest::SetLimit { project_id, bytes, nodes, responder } = self {
6071 Some((project_id, bytes, nodes, responder))
6072 } else {
6073 None
6074 }
6075 }
6076
6077 #[allow(irrefutable_let_patterns)]
6078 pub fn into_clear(self) -> Option<(u64, ProjectIdClearResponder)> {
6079 if let ProjectIdRequest::Clear { project_id, responder } = self {
6080 Some((project_id, responder))
6081 } else {
6082 None
6083 }
6084 }
6085
6086 #[allow(irrefutable_let_patterns)]
6087 pub fn into_set_for_node(self) -> Option<(u64, u64, ProjectIdSetForNodeResponder)> {
6088 if let ProjectIdRequest::SetForNode { node_id, project_id, responder } = self {
6089 Some((node_id, project_id, responder))
6090 } else {
6091 None
6092 }
6093 }
6094
6095 #[allow(irrefutable_let_patterns)]
6096 pub fn into_get_for_node(self) -> Option<(u64, ProjectIdGetForNodeResponder)> {
6097 if let ProjectIdRequest::GetForNode { node_id, responder } = self {
6098 Some((node_id, responder))
6099 } else {
6100 None
6101 }
6102 }
6103
6104 #[allow(irrefutable_let_patterns)]
6105 pub fn into_clear_for_node(self) -> Option<(u64, ProjectIdClearForNodeResponder)> {
6106 if let ProjectIdRequest::ClearForNode { node_id, responder } = self {
6107 Some((node_id, responder))
6108 } else {
6109 None
6110 }
6111 }
6112
6113 #[allow(irrefutable_let_patterns)]
6114 pub fn into_list(self) -> Option<(Option<Box<ProjectIterToken>>, ProjectIdListResponder)> {
6115 if let ProjectIdRequest::List { token, responder } = self {
6116 Some((token, responder))
6117 } else {
6118 None
6119 }
6120 }
6121
6122 #[allow(irrefutable_let_patterns)]
6123 pub fn into_info(self) -> Option<(u64, ProjectIdInfoResponder)> {
6124 if let ProjectIdRequest::Info { project_id, responder } = self {
6125 Some((project_id, responder))
6126 } else {
6127 None
6128 }
6129 }
6130
6131 pub fn method_name(&self) -> &'static str {
6133 match *self {
6134 ProjectIdRequest::SetLimit { .. } => "set_limit",
6135 ProjectIdRequest::Clear { .. } => "clear",
6136 ProjectIdRequest::SetForNode { .. } => "set_for_node",
6137 ProjectIdRequest::GetForNode { .. } => "get_for_node",
6138 ProjectIdRequest::ClearForNode { .. } => "clear_for_node",
6139 ProjectIdRequest::List { .. } => "list",
6140 ProjectIdRequest::Info { .. } => "info",
6141 }
6142 }
6143}
6144
6145#[derive(Debug, Clone)]
6146pub struct ProjectIdControlHandle {
6147 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6148}
6149
6150impl fidl::endpoints::ControlHandle for ProjectIdControlHandle {
6151 fn shutdown(&self) {
6152 self.inner.shutdown()
6153 }
6154
6155 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6156 self.inner.shutdown_with_epitaph(status)
6157 }
6158
6159 fn is_closed(&self) -> bool {
6160 self.inner.channel().is_closed()
6161 }
6162 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6163 self.inner.channel().on_closed()
6164 }
6165
6166 #[cfg(target_os = "fuchsia")]
6167 fn signal_peer(
6168 &self,
6169 clear_mask: zx::Signals,
6170 set_mask: zx::Signals,
6171 ) -> Result<(), zx_status::Status> {
6172 use fidl::Peered;
6173 self.inner.channel().signal_peer(clear_mask, set_mask)
6174 }
6175}
6176
6177impl ProjectIdControlHandle {}
6178
6179#[must_use = "FIDL methods require a response to be sent"]
6180#[derive(Debug)]
6181pub struct ProjectIdSetLimitResponder {
6182 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
6183 tx_id: u32,
6184}
6185
6186impl std::ops::Drop for ProjectIdSetLimitResponder {
6190 fn drop(&mut self) {
6191 self.control_handle.shutdown();
6192 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6194 }
6195}
6196
6197impl fidl::endpoints::Responder for ProjectIdSetLimitResponder {
6198 type ControlHandle = ProjectIdControlHandle;
6199
6200 fn control_handle(&self) -> &ProjectIdControlHandle {
6201 &self.control_handle
6202 }
6203
6204 fn drop_without_shutdown(mut self) {
6205 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6207 std::mem::forget(self);
6209 }
6210}
6211
6212impl ProjectIdSetLimitResponder {
6213 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6217 let _result = self.send_raw(result);
6218 if _result.is_err() {
6219 self.control_handle.shutdown();
6220 }
6221 self.drop_without_shutdown();
6222 _result
6223 }
6224
6225 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6227 let _result = self.send_raw(result);
6228 self.drop_without_shutdown();
6229 _result
6230 }
6231
6232 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6233 self.control_handle
6234 .inner
6235 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6236 result,
6237 self.tx_id,
6238 0x20b0fc1e0413876f,
6239 fidl::encoding::DynamicFlags::empty(),
6240 )
6241 }
6242}
6243
6244#[must_use = "FIDL methods require a response to be sent"]
6245#[derive(Debug)]
6246pub struct ProjectIdClearResponder {
6247 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
6248 tx_id: u32,
6249}
6250
6251impl std::ops::Drop for ProjectIdClearResponder {
6255 fn drop(&mut self) {
6256 self.control_handle.shutdown();
6257 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6259 }
6260}
6261
6262impl fidl::endpoints::Responder for ProjectIdClearResponder {
6263 type ControlHandle = ProjectIdControlHandle;
6264
6265 fn control_handle(&self) -> &ProjectIdControlHandle {
6266 &self.control_handle
6267 }
6268
6269 fn drop_without_shutdown(mut self) {
6270 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6272 std::mem::forget(self);
6274 }
6275}
6276
6277impl ProjectIdClearResponder {
6278 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6282 let _result = self.send_raw(result);
6283 if _result.is_err() {
6284 self.control_handle.shutdown();
6285 }
6286 self.drop_without_shutdown();
6287 _result
6288 }
6289
6290 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6292 let _result = self.send_raw(result);
6293 self.drop_without_shutdown();
6294 _result
6295 }
6296
6297 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6298 self.control_handle
6299 .inner
6300 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6301 result,
6302 self.tx_id,
6303 0x165b5f1e707863c1,
6304 fidl::encoding::DynamicFlags::empty(),
6305 )
6306 }
6307}
6308
6309#[must_use = "FIDL methods require a response to be sent"]
6310#[derive(Debug)]
6311pub struct ProjectIdSetForNodeResponder {
6312 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
6313 tx_id: u32,
6314}
6315
6316impl std::ops::Drop for ProjectIdSetForNodeResponder {
6320 fn drop(&mut self) {
6321 self.control_handle.shutdown();
6322 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6324 }
6325}
6326
6327impl fidl::endpoints::Responder for ProjectIdSetForNodeResponder {
6328 type ControlHandle = ProjectIdControlHandle;
6329
6330 fn control_handle(&self) -> &ProjectIdControlHandle {
6331 &self.control_handle
6332 }
6333
6334 fn drop_without_shutdown(mut self) {
6335 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6337 std::mem::forget(self);
6339 }
6340}
6341
6342impl ProjectIdSetForNodeResponder {
6343 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6347 let _result = self.send_raw(result);
6348 if _result.is_err() {
6349 self.control_handle.shutdown();
6350 }
6351 self.drop_without_shutdown();
6352 _result
6353 }
6354
6355 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6357 let _result = self.send_raw(result);
6358 self.drop_without_shutdown();
6359 _result
6360 }
6361
6362 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6363 self.control_handle
6364 .inner
6365 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6366 result,
6367 self.tx_id,
6368 0x4d7a8442dc58324c,
6369 fidl::encoding::DynamicFlags::empty(),
6370 )
6371 }
6372}
6373
6374#[must_use = "FIDL methods require a response to be sent"]
6375#[derive(Debug)]
6376pub struct ProjectIdGetForNodeResponder {
6377 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
6378 tx_id: u32,
6379}
6380
6381impl std::ops::Drop for ProjectIdGetForNodeResponder {
6385 fn drop(&mut self) {
6386 self.control_handle.shutdown();
6387 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6389 }
6390}
6391
6392impl fidl::endpoints::Responder for ProjectIdGetForNodeResponder {
6393 type ControlHandle = ProjectIdControlHandle;
6394
6395 fn control_handle(&self) -> &ProjectIdControlHandle {
6396 &self.control_handle
6397 }
6398
6399 fn drop_without_shutdown(mut self) {
6400 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6402 std::mem::forget(self);
6404 }
6405}
6406
6407impl ProjectIdGetForNodeResponder {
6408 pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
6412 let _result = self.send_raw(result);
6413 if _result.is_err() {
6414 self.control_handle.shutdown();
6415 }
6416 self.drop_without_shutdown();
6417 _result
6418 }
6419
6420 pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
6422 let _result = self.send_raw(result);
6423 self.drop_without_shutdown();
6424 _result
6425 }
6426
6427 fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
6428 self.control_handle
6429 .inner
6430 .send::<fidl::encoding::ResultType<ProjectIdGetForNodeResponse, i32>>(
6431 result.map(|project_id| (project_id,)),
6432 self.tx_id,
6433 0x644073bdf2542573,
6434 fidl::encoding::DynamicFlags::empty(),
6435 )
6436 }
6437}
6438
6439#[must_use = "FIDL methods require a response to be sent"]
6440#[derive(Debug)]
6441pub struct ProjectIdClearForNodeResponder {
6442 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
6443 tx_id: u32,
6444}
6445
6446impl std::ops::Drop for ProjectIdClearForNodeResponder {
6450 fn drop(&mut self) {
6451 self.control_handle.shutdown();
6452 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6454 }
6455}
6456
6457impl fidl::endpoints::Responder for ProjectIdClearForNodeResponder {
6458 type ControlHandle = ProjectIdControlHandle;
6459
6460 fn control_handle(&self) -> &ProjectIdControlHandle {
6461 &self.control_handle
6462 }
6463
6464 fn drop_without_shutdown(mut self) {
6465 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6467 std::mem::forget(self);
6469 }
6470}
6471
6472impl ProjectIdClearForNodeResponder {
6473 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6477 let _result = self.send_raw(result);
6478 if _result.is_err() {
6479 self.control_handle.shutdown();
6480 }
6481 self.drop_without_shutdown();
6482 _result
6483 }
6484
6485 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6487 let _result = self.send_raw(result);
6488 self.drop_without_shutdown();
6489 _result
6490 }
6491
6492 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6493 self.control_handle
6494 .inner
6495 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6496 result,
6497 self.tx_id,
6498 0x3f2ca287bbfe6a62,
6499 fidl::encoding::DynamicFlags::empty(),
6500 )
6501 }
6502}
6503
6504#[must_use = "FIDL methods require a response to be sent"]
6505#[derive(Debug)]
6506pub struct ProjectIdListResponder {
6507 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
6508 tx_id: u32,
6509}
6510
6511impl std::ops::Drop for ProjectIdListResponder {
6515 fn drop(&mut self) {
6516 self.control_handle.shutdown();
6517 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6519 }
6520}
6521
6522impl fidl::endpoints::Responder for ProjectIdListResponder {
6523 type ControlHandle = ProjectIdControlHandle;
6524
6525 fn control_handle(&self) -> &ProjectIdControlHandle {
6526 &self.control_handle
6527 }
6528
6529 fn drop_without_shutdown(mut self) {
6530 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6532 std::mem::forget(self);
6534 }
6535}
6536
6537impl ProjectIdListResponder {
6538 pub fn send(
6542 self,
6543 mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
6544 ) -> Result<(), fidl::Error> {
6545 let _result = self.send_raw(result);
6546 if _result.is_err() {
6547 self.control_handle.shutdown();
6548 }
6549 self.drop_without_shutdown();
6550 _result
6551 }
6552
6553 pub fn send_no_shutdown_on_err(
6555 self,
6556 mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
6557 ) -> Result<(), fidl::Error> {
6558 let _result = self.send_raw(result);
6559 self.drop_without_shutdown();
6560 _result
6561 }
6562
6563 fn send_raw(
6564 &self,
6565 mut result: Result<(&[u64], Option<&ProjectIterToken>), i32>,
6566 ) -> Result<(), fidl::Error> {
6567 self.control_handle.inner.send::<fidl::encoding::ResultType<ProjectIdListResponse, i32>>(
6568 result,
6569 self.tx_id,
6570 0x5505f95a36d522cc,
6571 fidl::encoding::DynamicFlags::empty(),
6572 )
6573 }
6574}
6575
6576#[must_use = "FIDL methods require a response to be sent"]
6577#[derive(Debug)]
6578pub struct ProjectIdInfoResponder {
6579 control_handle: std::mem::ManuallyDrop<ProjectIdControlHandle>,
6580 tx_id: u32,
6581}
6582
6583impl std::ops::Drop for ProjectIdInfoResponder {
6587 fn drop(&mut self) {
6588 self.control_handle.shutdown();
6589 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6591 }
6592}
6593
6594impl fidl::endpoints::Responder for ProjectIdInfoResponder {
6595 type ControlHandle = ProjectIdControlHandle;
6596
6597 fn control_handle(&self) -> &ProjectIdControlHandle {
6598 &self.control_handle
6599 }
6600
6601 fn drop_without_shutdown(mut self) {
6602 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6604 std::mem::forget(self);
6606 }
6607}
6608
6609impl ProjectIdInfoResponder {
6610 pub fn send(
6614 self,
6615 mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
6616 ) -> Result<(), fidl::Error> {
6617 let _result = self.send_raw(result);
6618 if _result.is_err() {
6619 self.control_handle.shutdown();
6620 }
6621 self.drop_without_shutdown();
6622 _result
6623 }
6624
6625 pub fn send_no_shutdown_on_err(
6627 self,
6628 mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
6629 ) -> Result<(), fidl::Error> {
6630 let _result = self.send_raw(result);
6631 self.drop_without_shutdown();
6632 _result
6633 }
6634
6635 fn send_raw(
6636 &self,
6637 mut result: Result<(&BytesAndNodes, &BytesAndNodes), i32>,
6638 ) -> Result<(), fidl::Error> {
6639 self.control_handle.inner.send::<fidl::encoding::ResultType<ProjectIdInfoResponse, i32>>(
6640 result,
6641 self.tx_id,
6642 0x51b47743c9e2d1ab,
6643 fidl::encoding::DynamicFlags::empty(),
6644 )
6645 }
6646}
6647
6648#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6649pub struct VolumeInstallerMarker;
6650
6651impl fidl::endpoints::ProtocolMarker for VolumeInstallerMarker {
6652 type Proxy = VolumeInstallerProxy;
6653 type RequestStream = VolumeInstallerRequestStream;
6654 #[cfg(target_os = "fuchsia")]
6655 type SynchronousProxy = VolumeInstallerSynchronousProxy;
6656
6657 const DEBUG_NAME: &'static str = "fuchsia.fxfs.VolumeInstaller";
6658}
6659impl fidl::endpoints::DiscoverableProtocolMarker for VolumeInstallerMarker {}
6660pub type VolumeInstallerInstallResult = Result<(), i32>;
6661
6662pub trait VolumeInstallerProxyInterface: Send + Sync {
6663 type InstallResponseFut: std::future::Future<Output = Result<VolumeInstallerInstallResult, fidl::Error>>
6664 + Send;
6665 fn r#install(&self, src: &str, image_file: &str, dst: &str) -> Self::InstallResponseFut;
6666}
6667#[derive(Debug)]
6668#[cfg(target_os = "fuchsia")]
6669pub struct VolumeInstallerSynchronousProxy {
6670 client: fidl::client::sync::Client,
6671}
6672
6673#[cfg(target_os = "fuchsia")]
6674impl fidl::endpoints::SynchronousProxy for VolumeInstallerSynchronousProxy {
6675 type Proxy = VolumeInstallerProxy;
6676 type Protocol = VolumeInstallerMarker;
6677
6678 fn from_channel(inner: fidl::Channel) -> Self {
6679 Self::new(inner)
6680 }
6681
6682 fn into_channel(self) -> fidl::Channel {
6683 self.client.into_channel()
6684 }
6685
6686 fn as_channel(&self) -> &fidl::Channel {
6687 self.client.as_channel()
6688 }
6689}
6690
6691#[cfg(target_os = "fuchsia")]
6692impl VolumeInstallerSynchronousProxy {
6693 pub fn new(channel: fidl::Channel) -> Self {
6694 Self { client: fidl::client::sync::Client::new(channel) }
6695 }
6696
6697 pub fn into_channel(self) -> fidl::Channel {
6698 self.client.into_channel()
6699 }
6700
6701 pub fn wait_for_event(
6704 &self,
6705 deadline: zx::MonotonicInstant,
6706 ) -> Result<VolumeInstallerEvent, fidl::Error> {
6707 VolumeInstallerEvent::decode(self.client.wait_for_event::<VolumeInstallerMarker>(deadline)?)
6708 }
6709
6710 pub fn r#install(
6717 &self,
6718 mut src: &str,
6719 mut image_file: &str,
6720 mut dst: &str,
6721 ___deadline: zx::MonotonicInstant,
6722 ) -> Result<VolumeInstallerInstallResult, fidl::Error> {
6723 let _response = self.client.send_query::<
6724 VolumeInstallerInstallRequest,
6725 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6726 VolumeInstallerMarker,
6727 >(
6728 (src, image_file, dst,),
6729 0x4c340be8a504ee1c,
6730 fidl::encoding::DynamicFlags::empty(),
6731 ___deadline,
6732 )?;
6733 Ok(_response.map(|x| x))
6734 }
6735}
6736
6737#[cfg(target_os = "fuchsia")]
6738impl From<VolumeInstallerSynchronousProxy> for zx::NullableHandle {
6739 fn from(value: VolumeInstallerSynchronousProxy) -> Self {
6740 value.into_channel().into()
6741 }
6742}
6743
6744#[cfg(target_os = "fuchsia")]
6745impl From<fidl::Channel> for VolumeInstallerSynchronousProxy {
6746 fn from(value: fidl::Channel) -> Self {
6747 Self::new(value)
6748 }
6749}
6750
6751#[cfg(target_os = "fuchsia")]
6752impl fidl::endpoints::FromClient for VolumeInstallerSynchronousProxy {
6753 type Protocol = VolumeInstallerMarker;
6754
6755 fn from_client(value: fidl::endpoints::ClientEnd<VolumeInstallerMarker>) -> Self {
6756 Self::new(value.into_channel())
6757 }
6758}
6759
6760#[derive(Debug, Clone)]
6761pub struct VolumeInstallerProxy {
6762 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6763}
6764
6765impl fidl::endpoints::Proxy for VolumeInstallerProxy {
6766 type Protocol = VolumeInstallerMarker;
6767
6768 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6769 Self::new(inner)
6770 }
6771
6772 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6773 self.client.into_channel().map_err(|client| Self { client })
6774 }
6775
6776 fn as_channel(&self) -> &::fidl::AsyncChannel {
6777 self.client.as_channel()
6778 }
6779}
6780
6781impl VolumeInstallerProxy {
6782 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6784 let protocol_name = <VolumeInstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6785 Self { client: fidl::client::Client::new(channel, protocol_name) }
6786 }
6787
6788 pub fn take_event_stream(&self) -> VolumeInstallerEventStream {
6794 VolumeInstallerEventStream { event_receiver: self.client.take_event_receiver() }
6795 }
6796
6797 pub fn r#install(
6804 &self,
6805 mut src: &str,
6806 mut image_file: &str,
6807 mut dst: &str,
6808 ) -> fidl::client::QueryResponseFut<
6809 VolumeInstallerInstallResult,
6810 fidl::encoding::DefaultFuchsiaResourceDialect,
6811 > {
6812 VolumeInstallerProxyInterface::r#install(self, src, image_file, dst)
6813 }
6814}
6815
6816impl VolumeInstallerProxyInterface for VolumeInstallerProxy {
6817 type InstallResponseFut = fidl::client::QueryResponseFut<
6818 VolumeInstallerInstallResult,
6819 fidl::encoding::DefaultFuchsiaResourceDialect,
6820 >;
6821 fn r#install(
6822 &self,
6823 mut src: &str,
6824 mut image_file: &str,
6825 mut dst: &str,
6826 ) -> Self::InstallResponseFut {
6827 fn _decode(
6828 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6829 ) -> Result<VolumeInstallerInstallResult, fidl::Error> {
6830 let _response = fidl::client::decode_transaction_body::<
6831 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6832 fidl::encoding::DefaultFuchsiaResourceDialect,
6833 0x4c340be8a504ee1c,
6834 >(_buf?)?;
6835 Ok(_response.map(|x| x))
6836 }
6837 self.client
6838 .send_query_and_decode::<VolumeInstallerInstallRequest, VolumeInstallerInstallResult>(
6839 (src, image_file, dst),
6840 0x4c340be8a504ee1c,
6841 fidl::encoding::DynamicFlags::empty(),
6842 _decode,
6843 )
6844 }
6845}
6846
6847pub struct VolumeInstallerEventStream {
6848 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6849}
6850
6851impl std::marker::Unpin for VolumeInstallerEventStream {}
6852
6853impl futures::stream::FusedStream for VolumeInstallerEventStream {
6854 fn is_terminated(&self) -> bool {
6855 self.event_receiver.is_terminated()
6856 }
6857}
6858
6859impl futures::Stream for VolumeInstallerEventStream {
6860 type Item = Result<VolumeInstallerEvent, fidl::Error>;
6861
6862 fn poll_next(
6863 mut self: std::pin::Pin<&mut Self>,
6864 cx: &mut std::task::Context<'_>,
6865 ) -> std::task::Poll<Option<Self::Item>> {
6866 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6867 &mut self.event_receiver,
6868 cx
6869 )?) {
6870 Some(buf) => std::task::Poll::Ready(Some(VolumeInstallerEvent::decode(buf))),
6871 None => std::task::Poll::Ready(None),
6872 }
6873 }
6874}
6875
6876#[derive(Debug)]
6877pub enum VolumeInstallerEvent {}
6878
6879impl VolumeInstallerEvent {
6880 fn decode(
6882 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6883 ) -> Result<VolumeInstallerEvent, fidl::Error> {
6884 let (bytes, _handles) = buf.split_mut();
6885 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6886 debug_assert_eq!(tx_header.tx_id, 0);
6887 match tx_header.ordinal {
6888 _ => Err(fidl::Error::UnknownOrdinal {
6889 ordinal: tx_header.ordinal,
6890 protocol_name:
6891 <VolumeInstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6892 }),
6893 }
6894 }
6895}
6896
6897pub struct VolumeInstallerRequestStream {
6899 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6900 is_terminated: bool,
6901}
6902
6903impl std::marker::Unpin for VolumeInstallerRequestStream {}
6904
6905impl futures::stream::FusedStream for VolumeInstallerRequestStream {
6906 fn is_terminated(&self) -> bool {
6907 self.is_terminated
6908 }
6909}
6910
6911impl fidl::endpoints::RequestStream for VolumeInstallerRequestStream {
6912 type Protocol = VolumeInstallerMarker;
6913 type ControlHandle = VolumeInstallerControlHandle;
6914
6915 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6916 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6917 }
6918
6919 fn control_handle(&self) -> Self::ControlHandle {
6920 VolumeInstallerControlHandle { inner: self.inner.clone() }
6921 }
6922
6923 fn into_inner(
6924 self,
6925 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6926 {
6927 (self.inner, self.is_terminated)
6928 }
6929
6930 fn from_inner(
6931 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6932 is_terminated: bool,
6933 ) -> Self {
6934 Self { inner, is_terminated }
6935 }
6936}
6937
6938impl futures::Stream for VolumeInstallerRequestStream {
6939 type Item = Result<VolumeInstallerRequest, fidl::Error>;
6940
6941 fn poll_next(
6942 mut self: std::pin::Pin<&mut Self>,
6943 cx: &mut std::task::Context<'_>,
6944 ) -> std::task::Poll<Option<Self::Item>> {
6945 let this = &mut *self;
6946 if this.inner.check_shutdown(cx) {
6947 this.is_terminated = true;
6948 return std::task::Poll::Ready(None);
6949 }
6950 if this.is_terminated {
6951 panic!("polled VolumeInstallerRequestStream after completion");
6952 }
6953 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6954 |bytes, handles| {
6955 match this.inner.channel().read_etc(cx, bytes, handles) {
6956 std::task::Poll::Ready(Ok(())) => {}
6957 std::task::Poll::Pending => return std::task::Poll::Pending,
6958 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6959 this.is_terminated = true;
6960 return std::task::Poll::Ready(None);
6961 }
6962 std::task::Poll::Ready(Err(e)) => {
6963 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6964 e.into(),
6965 ))));
6966 }
6967 }
6968
6969 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6971
6972 std::task::Poll::Ready(Some(match header.ordinal {
6973 0x4c340be8a504ee1c => {
6974 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6975 let mut req = fidl::new_empty!(
6976 VolumeInstallerInstallRequest,
6977 fidl::encoding::DefaultFuchsiaResourceDialect
6978 );
6979 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeInstallerInstallRequest>(&header, _body_bytes, handles, &mut req)?;
6980 let control_handle =
6981 VolumeInstallerControlHandle { inner: this.inner.clone() };
6982 Ok(VolumeInstallerRequest::Install {
6983 src: req.src,
6984 image_file: req.image_file,
6985 dst: req.dst,
6986
6987 responder: VolumeInstallerInstallResponder {
6988 control_handle: std::mem::ManuallyDrop::new(control_handle),
6989 tx_id: header.tx_id,
6990 },
6991 })
6992 }
6993 _ => Err(fidl::Error::UnknownOrdinal {
6994 ordinal: header.ordinal,
6995 protocol_name:
6996 <VolumeInstallerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6997 }),
6998 }))
6999 },
7000 )
7001 }
7002}
7003
7004#[derive(Debug)]
7006pub enum VolumeInstallerRequest {
7007 Install {
7014 src: String,
7015 image_file: String,
7016 dst: String,
7017 responder: VolumeInstallerInstallResponder,
7018 },
7019}
7020
7021impl VolumeInstallerRequest {
7022 #[allow(irrefutable_let_patterns)]
7023 pub fn into_install(self) -> Option<(String, String, String, VolumeInstallerInstallResponder)> {
7024 if let VolumeInstallerRequest::Install { src, image_file, dst, responder } = self {
7025 Some((src, image_file, dst, responder))
7026 } else {
7027 None
7028 }
7029 }
7030
7031 pub fn method_name(&self) -> &'static str {
7033 match *self {
7034 VolumeInstallerRequest::Install { .. } => "install",
7035 }
7036 }
7037}
7038
7039#[derive(Debug, Clone)]
7040pub struct VolumeInstallerControlHandle {
7041 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7042}
7043
7044impl fidl::endpoints::ControlHandle for VolumeInstallerControlHandle {
7045 fn shutdown(&self) {
7046 self.inner.shutdown()
7047 }
7048
7049 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7050 self.inner.shutdown_with_epitaph(status)
7051 }
7052
7053 fn is_closed(&self) -> bool {
7054 self.inner.channel().is_closed()
7055 }
7056 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7057 self.inner.channel().on_closed()
7058 }
7059
7060 #[cfg(target_os = "fuchsia")]
7061 fn signal_peer(
7062 &self,
7063 clear_mask: zx::Signals,
7064 set_mask: zx::Signals,
7065 ) -> Result<(), zx_status::Status> {
7066 use fidl::Peered;
7067 self.inner.channel().signal_peer(clear_mask, set_mask)
7068 }
7069}
7070
7071impl VolumeInstallerControlHandle {}
7072
7073#[must_use = "FIDL methods require a response to be sent"]
7074#[derive(Debug)]
7075pub struct VolumeInstallerInstallResponder {
7076 control_handle: std::mem::ManuallyDrop<VolumeInstallerControlHandle>,
7077 tx_id: u32,
7078}
7079
7080impl std::ops::Drop for VolumeInstallerInstallResponder {
7084 fn drop(&mut self) {
7085 self.control_handle.shutdown();
7086 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7088 }
7089}
7090
7091impl fidl::endpoints::Responder for VolumeInstallerInstallResponder {
7092 type ControlHandle = VolumeInstallerControlHandle;
7093
7094 fn control_handle(&self) -> &VolumeInstallerControlHandle {
7095 &self.control_handle
7096 }
7097
7098 fn drop_without_shutdown(mut self) {
7099 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7101 std::mem::forget(self);
7103 }
7104}
7105
7106impl VolumeInstallerInstallResponder {
7107 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7111 let _result = self.send_raw(result);
7112 if _result.is_err() {
7113 self.control_handle.shutdown();
7114 }
7115 self.drop_without_shutdown();
7116 _result
7117 }
7118
7119 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7121 let _result = self.send_raw(result);
7122 self.drop_without_shutdown();
7123 _result
7124 }
7125
7126 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
7127 self.control_handle
7128 .inner
7129 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
7130 result,
7131 self.tx_id,
7132 0x4c340be8a504ee1c,
7133 fidl::encoding::DynamicFlags::empty(),
7134 )
7135 }
7136}
7137
7138mod internal {
7139 use super::*;
7140
7141 impl fidl::encoding::ResourceTypeMarker for BlobCreatorCreateResponse {
7142 type Borrowed<'a> = &'a mut Self;
7143 fn take_or_borrow<'a>(
7144 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7145 ) -> Self::Borrowed<'a> {
7146 value
7147 }
7148 }
7149
7150 unsafe impl fidl::encoding::TypeMarker for BlobCreatorCreateResponse {
7151 type Owned = Self;
7152
7153 #[inline(always)]
7154 fn inline_align(_context: fidl::encoding::Context) -> usize {
7155 4
7156 }
7157
7158 #[inline(always)]
7159 fn inline_size(_context: fidl::encoding::Context) -> usize {
7160 4
7161 }
7162 }
7163
7164 unsafe impl
7165 fidl::encoding::Encode<
7166 BlobCreatorCreateResponse,
7167 fidl::encoding::DefaultFuchsiaResourceDialect,
7168 > for &mut BlobCreatorCreateResponse
7169 {
7170 #[inline]
7171 unsafe fn encode(
7172 self,
7173 encoder: &mut fidl::encoding::Encoder<
7174 '_,
7175 fidl::encoding::DefaultFuchsiaResourceDialect,
7176 >,
7177 offset: usize,
7178 _depth: fidl::encoding::Depth,
7179 ) -> fidl::Result<()> {
7180 encoder.debug_check_bounds::<BlobCreatorCreateResponse>(offset);
7181 fidl::encoding::Encode::<BlobCreatorCreateResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7183 (
7184 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.writer),
7185 ),
7186 encoder, offset, _depth
7187 )
7188 }
7189 }
7190 unsafe impl<
7191 T0: fidl::encoding::Encode<
7192 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
7193 fidl::encoding::DefaultFuchsiaResourceDialect,
7194 >,
7195 >
7196 fidl::encoding::Encode<
7197 BlobCreatorCreateResponse,
7198 fidl::encoding::DefaultFuchsiaResourceDialect,
7199 > for (T0,)
7200 {
7201 #[inline]
7202 unsafe fn encode(
7203 self,
7204 encoder: &mut fidl::encoding::Encoder<
7205 '_,
7206 fidl::encoding::DefaultFuchsiaResourceDialect,
7207 >,
7208 offset: usize,
7209 depth: fidl::encoding::Depth,
7210 ) -> fidl::Result<()> {
7211 encoder.debug_check_bounds::<BlobCreatorCreateResponse>(offset);
7212 self.0.encode(encoder, offset + 0, depth)?;
7216 Ok(())
7217 }
7218 }
7219
7220 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7221 for BlobCreatorCreateResponse
7222 {
7223 #[inline(always)]
7224 fn new_empty() -> Self {
7225 Self {
7226 writer: fidl::new_empty!(
7227 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
7228 fidl::encoding::DefaultFuchsiaResourceDialect
7229 ),
7230 }
7231 }
7232
7233 #[inline]
7234 unsafe fn decode(
7235 &mut self,
7236 decoder: &mut fidl::encoding::Decoder<
7237 '_,
7238 fidl::encoding::DefaultFuchsiaResourceDialect,
7239 >,
7240 offset: usize,
7241 _depth: fidl::encoding::Depth,
7242 ) -> fidl::Result<()> {
7243 decoder.debug_check_bounds::<Self>(offset);
7244 fidl::decode!(
7246 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<BlobWriterMarker>>,
7247 fidl::encoding::DefaultFuchsiaResourceDialect,
7248 &mut self.writer,
7249 decoder,
7250 offset + 0,
7251 _depth
7252 )?;
7253 Ok(())
7254 }
7255 }
7256
7257 impl fidl::encoding::ResourceTypeMarker for BlobReaderGetVmoResponse {
7258 type Borrowed<'a> = &'a mut Self;
7259 fn take_or_borrow<'a>(
7260 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7261 ) -> Self::Borrowed<'a> {
7262 value
7263 }
7264 }
7265
7266 unsafe impl fidl::encoding::TypeMarker for BlobReaderGetVmoResponse {
7267 type Owned = Self;
7268
7269 #[inline(always)]
7270 fn inline_align(_context: fidl::encoding::Context) -> usize {
7271 4
7272 }
7273
7274 #[inline(always)]
7275 fn inline_size(_context: fidl::encoding::Context) -> usize {
7276 4
7277 }
7278 }
7279
7280 unsafe impl
7281 fidl::encoding::Encode<
7282 BlobReaderGetVmoResponse,
7283 fidl::encoding::DefaultFuchsiaResourceDialect,
7284 > for &mut BlobReaderGetVmoResponse
7285 {
7286 #[inline]
7287 unsafe fn encode(
7288 self,
7289 encoder: &mut fidl::encoding::Encoder<
7290 '_,
7291 fidl::encoding::DefaultFuchsiaResourceDialect,
7292 >,
7293 offset: usize,
7294 _depth: fidl::encoding::Depth,
7295 ) -> fidl::Result<()> {
7296 encoder.debug_check_bounds::<BlobReaderGetVmoResponse>(offset);
7297 fidl::encoding::Encode::<
7299 BlobReaderGetVmoResponse,
7300 fidl::encoding::DefaultFuchsiaResourceDialect,
7301 >::encode(
7302 (<fidl::encoding::HandleType<
7303 fidl::Vmo,
7304 { fidl::ObjectType::VMO.into_raw() },
7305 2147483648,
7306 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7307 &mut self.vmo
7308 ),),
7309 encoder,
7310 offset,
7311 _depth,
7312 )
7313 }
7314 }
7315 unsafe impl<
7316 T0: fidl::encoding::Encode<
7317 fidl::encoding::HandleType<
7318 fidl::Vmo,
7319 { fidl::ObjectType::VMO.into_raw() },
7320 2147483648,
7321 >,
7322 fidl::encoding::DefaultFuchsiaResourceDialect,
7323 >,
7324 >
7325 fidl::encoding::Encode<
7326 BlobReaderGetVmoResponse,
7327 fidl::encoding::DefaultFuchsiaResourceDialect,
7328 > for (T0,)
7329 {
7330 #[inline]
7331 unsafe fn encode(
7332 self,
7333 encoder: &mut fidl::encoding::Encoder<
7334 '_,
7335 fidl::encoding::DefaultFuchsiaResourceDialect,
7336 >,
7337 offset: usize,
7338 depth: fidl::encoding::Depth,
7339 ) -> fidl::Result<()> {
7340 encoder.debug_check_bounds::<BlobReaderGetVmoResponse>(offset);
7341 self.0.encode(encoder, offset + 0, depth)?;
7345 Ok(())
7346 }
7347 }
7348
7349 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7350 for BlobReaderGetVmoResponse
7351 {
7352 #[inline(always)]
7353 fn new_empty() -> Self {
7354 Self {
7355 vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7356 }
7357 }
7358
7359 #[inline]
7360 unsafe fn decode(
7361 &mut self,
7362 decoder: &mut fidl::encoding::Decoder<
7363 '_,
7364 fidl::encoding::DefaultFuchsiaResourceDialect,
7365 >,
7366 offset: usize,
7367 _depth: fidl::encoding::Depth,
7368 ) -> fidl::Result<()> {
7369 decoder.debug_check_bounds::<Self>(offset);
7370 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
7372 Ok(())
7373 }
7374 }
7375
7376 impl fidl::encoding::ResourceTypeMarker for BlobWriterGetVmoResponse {
7377 type Borrowed<'a> = &'a mut Self;
7378 fn take_or_borrow<'a>(
7379 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7380 ) -> Self::Borrowed<'a> {
7381 value
7382 }
7383 }
7384
7385 unsafe impl fidl::encoding::TypeMarker for BlobWriterGetVmoResponse {
7386 type Owned = Self;
7387
7388 #[inline(always)]
7389 fn inline_align(_context: fidl::encoding::Context) -> usize {
7390 4
7391 }
7392
7393 #[inline(always)]
7394 fn inline_size(_context: fidl::encoding::Context) -> usize {
7395 4
7396 }
7397 }
7398
7399 unsafe impl
7400 fidl::encoding::Encode<
7401 BlobWriterGetVmoResponse,
7402 fidl::encoding::DefaultFuchsiaResourceDialect,
7403 > for &mut BlobWriterGetVmoResponse
7404 {
7405 #[inline]
7406 unsafe fn encode(
7407 self,
7408 encoder: &mut fidl::encoding::Encoder<
7409 '_,
7410 fidl::encoding::DefaultFuchsiaResourceDialect,
7411 >,
7412 offset: usize,
7413 _depth: fidl::encoding::Depth,
7414 ) -> fidl::Result<()> {
7415 encoder.debug_check_bounds::<BlobWriterGetVmoResponse>(offset);
7416 fidl::encoding::Encode::<
7418 BlobWriterGetVmoResponse,
7419 fidl::encoding::DefaultFuchsiaResourceDialect,
7420 >::encode(
7421 (<fidl::encoding::HandleType<
7422 fidl::Vmo,
7423 { fidl::ObjectType::VMO.into_raw() },
7424 2147483648,
7425 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7426 &mut self.vmo
7427 ),),
7428 encoder,
7429 offset,
7430 _depth,
7431 )
7432 }
7433 }
7434 unsafe impl<
7435 T0: fidl::encoding::Encode<
7436 fidl::encoding::HandleType<
7437 fidl::Vmo,
7438 { fidl::ObjectType::VMO.into_raw() },
7439 2147483648,
7440 >,
7441 fidl::encoding::DefaultFuchsiaResourceDialect,
7442 >,
7443 >
7444 fidl::encoding::Encode<
7445 BlobWriterGetVmoResponse,
7446 fidl::encoding::DefaultFuchsiaResourceDialect,
7447 > for (T0,)
7448 {
7449 #[inline]
7450 unsafe fn encode(
7451 self,
7452 encoder: &mut fidl::encoding::Encoder<
7453 '_,
7454 fidl::encoding::DefaultFuchsiaResourceDialect,
7455 >,
7456 offset: usize,
7457 depth: fidl::encoding::Depth,
7458 ) -> fidl::Result<()> {
7459 encoder.debug_check_bounds::<BlobWriterGetVmoResponse>(offset);
7460 self.0.encode(encoder, offset + 0, depth)?;
7464 Ok(())
7465 }
7466 }
7467
7468 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7469 for BlobWriterGetVmoResponse
7470 {
7471 #[inline(always)]
7472 fn new_empty() -> Self {
7473 Self {
7474 vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7475 }
7476 }
7477
7478 #[inline]
7479 unsafe fn decode(
7480 &mut self,
7481 decoder: &mut fidl::encoding::Decoder<
7482 '_,
7483 fidl::encoding::DefaultFuchsiaResourceDialect,
7484 >,
7485 offset: usize,
7486 _depth: fidl::encoding::Depth,
7487 ) -> fidl::Result<()> {
7488 decoder.debug_check_bounds::<Self>(offset);
7489 fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.vmo, decoder, offset + 0, _depth)?;
7491 Ok(())
7492 }
7493 }
7494
7495 impl fidl::encoding::ResourceTypeMarker for FileBackedVolumeProviderOpenRequest {
7496 type Borrowed<'a> = &'a mut Self;
7497 fn take_or_borrow<'a>(
7498 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7499 ) -> Self::Borrowed<'a> {
7500 value
7501 }
7502 }
7503
7504 unsafe impl fidl::encoding::TypeMarker for FileBackedVolumeProviderOpenRequest {
7505 type Owned = Self;
7506
7507 #[inline(always)]
7508 fn inline_align(_context: fidl::encoding::Context) -> usize {
7509 8
7510 }
7511
7512 #[inline(always)]
7513 fn inline_size(_context: fidl::encoding::Context) -> usize {
7514 32
7515 }
7516 }
7517
7518 unsafe impl
7519 fidl::encoding::Encode<
7520 FileBackedVolumeProviderOpenRequest,
7521 fidl::encoding::DefaultFuchsiaResourceDialect,
7522 > for &mut FileBackedVolumeProviderOpenRequest
7523 {
7524 #[inline]
7525 unsafe fn encode(
7526 self,
7527 encoder: &mut fidl::encoding::Encoder<
7528 '_,
7529 fidl::encoding::DefaultFuchsiaResourceDialect,
7530 >,
7531 offset: usize,
7532 _depth: fidl::encoding::Depth,
7533 ) -> fidl::Result<()> {
7534 encoder.debug_check_bounds::<FileBackedVolumeProviderOpenRequest>(offset);
7535 fidl::encoding::Encode::<
7537 FileBackedVolumeProviderOpenRequest,
7538 fidl::encoding::DefaultFuchsiaResourceDialect,
7539 >::encode(
7540 (
7541 <fidl::encoding::HandleType<
7542 fidl::NullableHandle,
7543 { fidl::ObjectType::NONE.into_raw() },
7544 2147483648,
7545 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7546 &mut self.parent_directory_token,
7547 ),
7548 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
7549 &self.name,
7550 ),
7551 <fidl::encoding::Endpoint<
7552 fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
7553 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7554 &mut self.server_end
7555 ),
7556 ),
7557 encoder,
7558 offset,
7559 _depth,
7560 )
7561 }
7562 }
7563 unsafe impl<
7564 T0: fidl::encoding::Encode<
7565 fidl::encoding::HandleType<
7566 fidl::NullableHandle,
7567 { fidl::ObjectType::NONE.into_raw() },
7568 2147483648,
7569 >,
7570 fidl::encoding::DefaultFuchsiaResourceDialect,
7571 >,
7572 T1: fidl::encoding::Encode<
7573 fidl::encoding::BoundedString<255>,
7574 fidl::encoding::DefaultFuchsiaResourceDialect,
7575 >,
7576 T2: fidl::encoding::Encode<
7577 fidl::encoding::Endpoint<
7578 fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
7579 >,
7580 fidl::encoding::DefaultFuchsiaResourceDialect,
7581 >,
7582 >
7583 fidl::encoding::Encode<
7584 FileBackedVolumeProviderOpenRequest,
7585 fidl::encoding::DefaultFuchsiaResourceDialect,
7586 > for (T0, T1, T2)
7587 {
7588 #[inline]
7589 unsafe fn encode(
7590 self,
7591 encoder: &mut fidl::encoding::Encoder<
7592 '_,
7593 fidl::encoding::DefaultFuchsiaResourceDialect,
7594 >,
7595 offset: usize,
7596 depth: fidl::encoding::Depth,
7597 ) -> fidl::Result<()> {
7598 encoder.debug_check_bounds::<FileBackedVolumeProviderOpenRequest>(offset);
7599 unsafe {
7602 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7603 (ptr as *mut u64).write_unaligned(0);
7604 }
7605 unsafe {
7606 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
7607 (ptr as *mut u64).write_unaligned(0);
7608 }
7609 self.0.encode(encoder, offset + 0, depth)?;
7611 self.1.encode(encoder, offset + 8, depth)?;
7612 self.2.encode(encoder, offset + 24, depth)?;
7613 Ok(())
7614 }
7615 }
7616
7617 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7618 for FileBackedVolumeProviderOpenRequest
7619 {
7620 #[inline(always)]
7621 fn new_empty() -> Self {
7622 Self {
7623 parent_directory_token: fidl::new_empty!(fidl::encoding::HandleType<fidl::NullableHandle, { fidl::ObjectType::NONE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7624 name: fidl::new_empty!(
7625 fidl::encoding::BoundedString<255>,
7626 fidl::encoding::DefaultFuchsiaResourceDialect
7627 ),
7628 server_end: fidl::new_empty!(
7629 fidl::encoding::Endpoint<
7630 fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
7631 >,
7632 fidl::encoding::DefaultFuchsiaResourceDialect
7633 ),
7634 }
7635 }
7636
7637 #[inline]
7638 unsafe fn decode(
7639 &mut self,
7640 decoder: &mut fidl::encoding::Decoder<
7641 '_,
7642 fidl::encoding::DefaultFuchsiaResourceDialect,
7643 >,
7644 offset: usize,
7645 _depth: fidl::encoding::Depth,
7646 ) -> fidl::Result<()> {
7647 decoder.debug_check_bounds::<Self>(offset);
7648 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7650 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7651 let mask = 0xffffffff00000000u64;
7652 let maskedval = padval & mask;
7653 if maskedval != 0 {
7654 return Err(fidl::Error::NonZeroPadding {
7655 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7656 });
7657 }
7658 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
7659 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7660 let mask = 0xffffffff00000000u64;
7661 let maskedval = padval & mask;
7662 if maskedval != 0 {
7663 return Err(fidl::Error::NonZeroPadding {
7664 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
7665 });
7666 }
7667 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)?;
7668 fidl::decode!(
7669 fidl::encoding::BoundedString<255>,
7670 fidl::encoding::DefaultFuchsiaResourceDialect,
7671 &mut self.name,
7672 decoder,
7673 offset + 8,
7674 _depth
7675 )?;
7676 fidl::decode!(
7677 fidl::encoding::Endpoint<
7678 fidl::endpoints::ServerEnd<fidl_fuchsia_storage_block::BlockMarker>,
7679 >,
7680 fidl::encoding::DefaultFuchsiaResourceDialect,
7681 &mut self.server_end,
7682 decoder,
7683 offset + 24,
7684 _depth
7685 )?;
7686 Ok(())
7687 }
7688 }
7689}