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_security_keymint__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct AdminMarker;
16
17impl fidl::endpoints::ProtocolMarker for AdminMarker {
18 type Proxy = AdminProxy;
19 type RequestStream = AdminRequestStream;
20 #[cfg(target_os = "fuchsia")]
21 type SynchronousProxy = AdminSynchronousProxy;
22
23 const DEBUG_NAME: &'static str = "fuchsia.security.keymint.Admin";
24}
25impl fidl::endpoints::DiscoverableProtocolMarker for AdminMarker {}
26pub type AdminDeleteAllKeysResult = Result<(), DeleteError>;
27
28pub trait AdminProxyInterface: Send + Sync {
29 type DeleteAllKeysResponseFut: std::future::Future<Output = Result<AdminDeleteAllKeysResult, fidl::Error>>
30 + Send;
31 fn r#delete_all_keys(&self) -> Self::DeleteAllKeysResponseFut;
32}
33#[derive(Debug)]
34#[cfg(target_os = "fuchsia")]
35pub struct AdminSynchronousProxy {
36 client: fidl::client::sync::Client,
37}
38
39#[cfg(target_os = "fuchsia")]
40impl fidl::endpoints::SynchronousProxy for AdminSynchronousProxy {
41 type Proxy = AdminProxy;
42 type Protocol = AdminMarker;
43
44 fn from_channel(inner: fidl::Channel) -> Self {
45 Self::new(inner)
46 }
47
48 fn into_channel(self) -> fidl::Channel {
49 self.client.into_channel()
50 }
51
52 fn as_channel(&self) -> &fidl::Channel {
53 self.client.as_channel()
54 }
55}
56
57#[cfg(target_os = "fuchsia")]
58impl AdminSynchronousProxy {
59 pub fn new(channel: fidl::Channel) -> Self {
60 let protocol_name = <AdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
61 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
62 }
63
64 pub fn into_channel(self) -> fidl::Channel {
65 self.client.into_channel()
66 }
67
68 pub fn wait_for_event(
71 &self,
72 deadline: zx::MonotonicInstant,
73 ) -> Result<AdminEvent, fidl::Error> {
74 AdminEvent::decode(self.client.wait_for_event(deadline)?)
75 }
76
77 pub fn r#delete_all_keys(
83 &self,
84 ___deadline: zx::MonotonicInstant,
85 ) -> Result<AdminDeleteAllKeysResult, fidl::Error> {
86 let _response = self.client.send_query::<
87 fidl::encoding::EmptyPayload,
88 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeleteError>,
89 >(
90 (),
91 0x7865f60b70087392,
92 fidl::encoding::DynamicFlags::empty(),
93 ___deadline,
94 )?;
95 Ok(_response.map(|x| x))
96 }
97}
98
99#[cfg(target_os = "fuchsia")]
100impl From<AdminSynchronousProxy> for zx::NullableHandle {
101 fn from(value: AdminSynchronousProxy) -> Self {
102 value.into_channel().into()
103 }
104}
105
106#[cfg(target_os = "fuchsia")]
107impl From<fidl::Channel> for AdminSynchronousProxy {
108 fn from(value: fidl::Channel) -> Self {
109 Self::new(value)
110 }
111}
112
113#[cfg(target_os = "fuchsia")]
114impl fidl::endpoints::FromClient for AdminSynchronousProxy {
115 type Protocol = AdminMarker;
116
117 fn from_client(value: fidl::endpoints::ClientEnd<AdminMarker>) -> Self {
118 Self::new(value.into_channel())
119 }
120}
121
122#[derive(Debug, Clone)]
123pub struct AdminProxy {
124 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
125}
126
127impl fidl::endpoints::Proxy for AdminProxy {
128 type Protocol = AdminMarker;
129
130 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
131 Self::new(inner)
132 }
133
134 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
135 self.client.into_channel().map_err(|client| Self { client })
136 }
137
138 fn as_channel(&self) -> &::fidl::AsyncChannel {
139 self.client.as_channel()
140 }
141}
142
143impl AdminProxy {
144 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
146 let protocol_name = <AdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
147 Self { client: fidl::client::Client::new(channel, protocol_name) }
148 }
149
150 pub fn take_event_stream(&self) -> AdminEventStream {
156 AdminEventStream { event_receiver: self.client.take_event_receiver() }
157 }
158
159 pub fn r#delete_all_keys(
165 &self,
166 ) -> fidl::client::QueryResponseFut<
167 AdminDeleteAllKeysResult,
168 fidl::encoding::DefaultFuchsiaResourceDialect,
169 > {
170 AdminProxyInterface::r#delete_all_keys(self)
171 }
172}
173
174impl AdminProxyInterface for AdminProxy {
175 type DeleteAllKeysResponseFut = fidl::client::QueryResponseFut<
176 AdminDeleteAllKeysResult,
177 fidl::encoding::DefaultFuchsiaResourceDialect,
178 >;
179 fn r#delete_all_keys(&self) -> Self::DeleteAllKeysResponseFut {
180 fn _decode(
181 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
182 ) -> Result<AdminDeleteAllKeysResult, fidl::Error> {
183 let _response = fidl::client::decode_transaction_body::<
184 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeleteError>,
185 fidl::encoding::DefaultFuchsiaResourceDialect,
186 0x7865f60b70087392,
187 >(_buf?)?;
188 Ok(_response.map(|x| x))
189 }
190 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, AdminDeleteAllKeysResult>(
191 (),
192 0x7865f60b70087392,
193 fidl::encoding::DynamicFlags::empty(),
194 _decode,
195 )
196 }
197}
198
199pub struct AdminEventStream {
200 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
201}
202
203impl std::marker::Unpin for AdminEventStream {}
204
205impl futures::stream::FusedStream for AdminEventStream {
206 fn is_terminated(&self) -> bool {
207 self.event_receiver.is_terminated()
208 }
209}
210
211impl futures::Stream for AdminEventStream {
212 type Item = Result<AdminEvent, fidl::Error>;
213
214 fn poll_next(
215 mut self: std::pin::Pin<&mut Self>,
216 cx: &mut std::task::Context<'_>,
217 ) -> std::task::Poll<Option<Self::Item>> {
218 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
219 &mut self.event_receiver,
220 cx
221 )?) {
222 Some(buf) => std::task::Poll::Ready(Some(AdminEvent::decode(buf))),
223 None => std::task::Poll::Ready(None),
224 }
225 }
226}
227
228#[derive(Debug)]
229pub enum AdminEvent {}
230
231impl AdminEvent {
232 fn decode(
234 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
235 ) -> Result<AdminEvent, fidl::Error> {
236 let (bytes, _handles) = buf.split_mut();
237 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
238 debug_assert_eq!(tx_header.tx_id, 0);
239 match tx_header.ordinal {
240 _ => Err(fidl::Error::UnknownOrdinal {
241 ordinal: tx_header.ordinal,
242 protocol_name: <AdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
243 }),
244 }
245 }
246}
247
248pub struct AdminRequestStream {
250 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
251 is_terminated: bool,
252}
253
254impl std::marker::Unpin for AdminRequestStream {}
255
256impl futures::stream::FusedStream for AdminRequestStream {
257 fn is_terminated(&self) -> bool {
258 self.is_terminated
259 }
260}
261
262impl fidl::endpoints::RequestStream for AdminRequestStream {
263 type Protocol = AdminMarker;
264 type ControlHandle = AdminControlHandle;
265
266 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
267 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
268 }
269
270 fn control_handle(&self) -> Self::ControlHandle {
271 AdminControlHandle { inner: self.inner.clone() }
272 }
273
274 fn into_inner(
275 self,
276 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
277 {
278 (self.inner, self.is_terminated)
279 }
280
281 fn from_inner(
282 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
283 is_terminated: bool,
284 ) -> Self {
285 Self { inner, is_terminated }
286 }
287}
288
289impl futures::Stream for AdminRequestStream {
290 type Item = Result<AdminRequest, fidl::Error>;
291
292 fn poll_next(
293 mut self: std::pin::Pin<&mut Self>,
294 cx: &mut std::task::Context<'_>,
295 ) -> std::task::Poll<Option<Self::Item>> {
296 let this = &mut *self;
297 if this.inner.check_shutdown(cx) {
298 this.is_terminated = true;
299 return std::task::Poll::Ready(None);
300 }
301 if this.is_terminated {
302 panic!("polled AdminRequestStream after completion");
303 }
304 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
305 |bytes, handles| {
306 match this.inner.channel().read_etc(cx, bytes, handles) {
307 std::task::Poll::Ready(Ok(())) => {}
308 std::task::Poll::Pending => return std::task::Poll::Pending,
309 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
310 this.is_terminated = true;
311 return std::task::Poll::Ready(None);
312 }
313 std::task::Poll::Ready(Err(e)) => {
314 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
315 e.into(),
316 ))));
317 }
318 }
319
320 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
322
323 std::task::Poll::Ready(Some(match header.ordinal {
324 0x7865f60b70087392 => {
325 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
326 let mut req = fidl::new_empty!(
327 fidl::encoding::EmptyPayload,
328 fidl::encoding::DefaultFuchsiaResourceDialect
329 );
330 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
331 let control_handle = AdminControlHandle { inner: this.inner.clone() };
332 Ok(AdminRequest::DeleteAllKeys {
333 responder: AdminDeleteAllKeysResponder {
334 control_handle: std::mem::ManuallyDrop::new(control_handle),
335 tx_id: header.tx_id,
336 },
337 })
338 }
339 _ => Err(fidl::Error::UnknownOrdinal {
340 ordinal: header.ordinal,
341 protocol_name: <AdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
342 }),
343 }))
344 },
345 )
346 }
347}
348
349#[derive(Debug)]
351pub enum AdminRequest {
352 DeleteAllKeys { responder: AdminDeleteAllKeysResponder },
358}
359
360impl AdminRequest {
361 #[allow(irrefutable_let_patterns)]
362 pub fn into_delete_all_keys(self) -> Option<(AdminDeleteAllKeysResponder)> {
363 if let AdminRequest::DeleteAllKeys { responder } = self { Some((responder)) } else { None }
364 }
365
366 pub fn method_name(&self) -> &'static str {
368 match *self {
369 AdminRequest::DeleteAllKeys { .. } => "delete_all_keys",
370 }
371 }
372}
373
374#[derive(Debug, Clone)]
375pub struct AdminControlHandle {
376 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
377}
378
379impl fidl::endpoints::ControlHandle for AdminControlHandle {
380 fn shutdown(&self) {
381 self.inner.shutdown()
382 }
383
384 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
385 self.inner.shutdown_with_epitaph(status)
386 }
387
388 fn is_closed(&self) -> bool {
389 self.inner.channel().is_closed()
390 }
391 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
392 self.inner.channel().on_closed()
393 }
394
395 #[cfg(target_os = "fuchsia")]
396 fn signal_peer(
397 &self,
398 clear_mask: zx::Signals,
399 set_mask: zx::Signals,
400 ) -> Result<(), zx_status::Status> {
401 use fidl::Peered;
402 self.inner.channel().signal_peer(clear_mask, set_mask)
403 }
404}
405
406impl AdminControlHandle {}
407
408#[must_use = "FIDL methods require a response to be sent"]
409#[derive(Debug)]
410pub struct AdminDeleteAllKeysResponder {
411 control_handle: std::mem::ManuallyDrop<AdminControlHandle>,
412 tx_id: u32,
413}
414
415impl std::ops::Drop for AdminDeleteAllKeysResponder {
419 fn drop(&mut self) {
420 self.control_handle.shutdown();
421 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
423 }
424}
425
426impl fidl::endpoints::Responder for AdminDeleteAllKeysResponder {
427 type ControlHandle = AdminControlHandle;
428
429 fn control_handle(&self) -> &AdminControlHandle {
430 &self.control_handle
431 }
432
433 fn drop_without_shutdown(mut self) {
434 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
436 std::mem::forget(self);
438 }
439}
440
441impl AdminDeleteAllKeysResponder {
442 pub fn send(self, mut result: Result<(), DeleteError>) -> Result<(), fidl::Error> {
446 let _result = self.send_raw(result);
447 if _result.is_err() {
448 self.control_handle.shutdown();
449 }
450 self.drop_without_shutdown();
451 _result
452 }
453
454 pub fn send_no_shutdown_on_err(
456 self,
457 mut result: Result<(), DeleteError>,
458 ) -> Result<(), fidl::Error> {
459 let _result = self.send_raw(result);
460 self.drop_without_shutdown();
461 _result
462 }
463
464 fn send_raw(&self, mut result: Result<(), DeleteError>) -> Result<(), fidl::Error> {
465 self.control_handle.inner.send::<fidl::encoding::ResultType<
466 fidl::encoding::EmptyStruct,
467 DeleteError,
468 >>(
469 result,
470 self.tx_id,
471 0x7865f60b70087392,
472 fidl::encoding::DynamicFlags::empty(),
473 )
474 }
475}
476
477#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
478pub struct SealingKeysMarker;
479
480impl fidl::endpoints::ProtocolMarker for SealingKeysMarker {
481 type Proxy = SealingKeysProxy;
482 type RequestStream = SealingKeysRequestStream;
483 #[cfg(target_os = "fuchsia")]
484 type SynchronousProxy = SealingKeysSynchronousProxy;
485
486 const DEBUG_NAME: &'static str = "fuchsia.security.keymint.SealingKeys";
487}
488impl fidl::endpoints::DiscoverableProtocolMarker for SealingKeysMarker {}
489pub type SealingKeysCreateSealingKeyResult = Result<Vec<u8>, CreateError>;
490pub type SealingKeysSealResult = Result<Vec<u8>, SealError>;
491pub type SealingKeysUnsealResult = Result<Vec<u8>, UnsealError>;
492pub type SealingKeysUpgradeSealingKeyResult = Result<Vec<u8>, UpgradeError>;
493pub type SealingKeysDeleteSealingKeyResult = Result<(), DeleteError>;
494
495pub trait SealingKeysProxyInterface: Send + Sync {
496 type CreateSealingKeyResponseFut: std::future::Future<Output = Result<SealingKeysCreateSealingKeyResult, fidl::Error>>
497 + Send;
498 fn r#create_sealing_key(&self, key_info: &[u8]) -> Self::CreateSealingKeyResponseFut;
499 type SealResponseFut: std::future::Future<Output = Result<SealingKeysSealResult, fidl::Error>>
500 + Send;
501 fn r#seal(&self, key_info: &[u8], key_blob: &[u8], secret: &[u8]) -> Self::SealResponseFut;
502 type UnsealResponseFut: std::future::Future<Output = Result<SealingKeysUnsealResult, fidl::Error>>
503 + Send;
504 fn r#unseal(
505 &self,
506 key_info: &[u8],
507 key_blob: &[u8],
508 sealed_secret: &[u8],
509 ) -> Self::UnsealResponseFut;
510 type UpgradeSealingKeyResponseFut: std::future::Future<Output = Result<SealingKeysUpgradeSealingKeyResult, fidl::Error>>
511 + Send;
512 fn r#upgrade_sealing_key(
513 &self,
514 key_info: &[u8],
515 key_blob: &[u8],
516 ) -> Self::UpgradeSealingKeyResponseFut;
517 type DeleteSealingKeyResponseFut: std::future::Future<Output = Result<SealingKeysDeleteSealingKeyResult, fidl::Error>>
518 + Send;
519 fn r#delete_sealing_key(&self, key_blob: &[u8]) -> Self::DeleteSealingKeyResponseFut;
520}
521#[derive(Debug)]
522#[cfg(target_os = "fuchsia")]
523pub struct SealingKeysSynchronousProxy {
524 client: fidl::client::sync::Client,
525}
526
527#[cfg(target_os = "fuchsia")]
528impl fidl::endpoints::SynchronousProxy for SealingKeysSynchronousProxy {
529 type Proxy = SealingKeysProxy;
530 type Protocol = SealingKeysMarker;
531
532 fn from_channel(inner: fidl::Channel) -> Self {
533 Self::new(inner)
534 }
535
536 fn into_channel(self) -> fidl::Channel {
537 self.client.into_channel()
538 }
539
540 fn as_channel(&self) -> &fidl::Channel {
541 self.client.as_channel()
542 }
543}
544
545#[cfg(target_os = "fuchsia")]
546impl SealingKeysSynchronousProxy {
547 pub fn new(channel: fidl::Channel) -> Self {
548 let protocol_name = <SealingKeysMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
549 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
550 }
551
552 pub fn into_channel(self) -> fidl::Channel {
553 self.client.into_channel()
554 }
555
556 pub fn wait_for_event(
559 &self,
560 deadline: zx::MonotonicInstant,
561 ) -> Result<SealingKeysEvent, fidl::Error> {
562 SealingKeysEvent::decode(self.client.wait_for_event(deadline)?)
563 }
564
565 pub fn r#create_sealing_key(
588 &self,
589 mut key_info: &[u8],
590 ___deadline: zx::MonotonicInstant,
591 ) -> Result<SealingKeysCreateSealingKeyResult, fidl::Error> {
592 let _response = self.client.send_query::<
593 SealingKeysCreateSealingKeyRequest,
594 fidl::encoding::ResultType<SealingKeysCreateSealingKeyResponse, CreateError>,
595 >(
596 (key_info,),
597 0x5a191cbb6a8081bc,
598 fidl::encoding::DynamicFlags::empty(),
599 ___deadline,
600 )?;
601 Ok(_response.map(|x| x.key_blob))
602 }
603
604 pub fn r#seal(
615 &self,
616 mut key_info: &[u8],
617 mut key_blob: &[u8],
618 mut secret: &[u8],
619 ___deadline: zx::MonotonicInstant,
620 ) -> Result<SealingKeysSealResult, fidl::Error> {
621 let _response = self.client.send_query::<
622 SealingKeysSealRequest,
623 fidl::encoding::ResultType<SealingKeysSealResponse, SealError>,
624 >(
625 (key_info, key_blob, secret,),
626 0x10d41255013918d1,
627 fidl::encoding::DynamicFlags::empty(),
628 ___deadline,
629 )?;
630 Ok(_response.map(|x| x.sealed_secret))
631 }
632
633 pub fn r#unseal(
645 &self,
646 mut key_info: &[u8],
647 mut key_blob: &[u8],
648 mut sealed_secret: &[u8],
649 ___deadline: zx::MonotonicInstant,
650 ) -> Result<SealingKeysUnsealResult, fidl::Error> {
651 let _response = self.client.send_query::<
652 SealingKeysUnsealRequest,
653 fidl::encoding::ResultType<SealingKeysUnsealResponse, UnsealError>,
654 >(
655 (key_info, key_blob, sealed_secret,),
656 0x7037d75ecb579c83,
657 fidl::encoding::DynamicFlags::empty(),
658 ___deadline,
659 )?;
660 Ok(_response.map(|x| x.unsealed_secret))
661 }
662
663 pub fn r#upgrade_sealing_key(
685 &self,
686 mut key_info: &[u8],
687 mut key_blob: &[u8],
688 ___deadline: zx::MonotonicInstant,
689 ) -> Result<SealingKeysUpgradeSealingKeyResult, fidl::Error> {
690 let _response = self.client.send_query::<
691 SealingKeysUpgradeSealingKeyRequest,
692 fidl::encoding::ResultType<SealingKeysUpgradeSealingKeyResponse, UpgradeError>,
693 >(
694 (key_info, key_blob,),
695 0x68584c5a799181e7,
696 fidl::encoding::DynamicFlags::empty(),
697 ___deadline,
698 )?;
699 Ok(_response.map(|x| x.key_blob))
700 }
701
702 pub fn r#delete_sealing_key(
710 &self,
711 mut key_blob: &[u8],
712 ___deadline: zx::MonotonicInstant,
713 ) -> Result<SealingKeysDeleteSealingKeyResult, fidl::Error> {
714 let _response = self.client.send_query::<
715 SealingKeysDeleteSealingKeyRequest,
716 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeleteError>,
717 >(
718 (key_blob,),
719 0xad65bae761e8c3,
720 fidl::encoding::DynamicFlags::empty(),
721 ___deadline,
722 )?;
723 Ok(_response.map(|x| x))
724 }
725}
726
727#[cfg(target_os = "fuchsia")]
728impl From<SealingKeysSynchronousProxy> for zx::NullableHandle {
729 fn from(value: SealingKeysSynchronousProxy) -> Self {
730 value.into_channel().into()
731 }
732}
733
734#[cfg(target_os = "fuchsia")]
735impl From<fidl::Channel> for SealingKeysSynchronousProxy {
736 fn from(value: fidl::Channel) -> Self {
737 Self::new(value)
738 }
739}
740
741#[cfg(target_os = "fuchsia")]
742impl fidl::endpoints::FromClient for SealingKeysSynchronousProxy {
743 type Protocol = SealingKeysMarker;
744
745 fn from_client(value: fidl::endpoints::ClientEnd<SealingKeysMarker>) -> Self {
746 Self::new(value.into_channel())
747 }
748}
749
750#[derive(Debug, Clone)]
751pub struct SealingKeysProxy {
752 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
753}
754
755impl fidl::endpoints::Proxy for SealingKeysProxy {
756 type Protocol = SealingKeysMarker;
757
758 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
759 Self::new(inner)
760 }
761
762 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
763 self.client.into_channel().map_err(|client| Self { client })
764 }
765
766 fn as_channel(&self) -> &::fidl::AsyncChannel {
767 self.client.as_channel()
768 }
769}
770
771impl SealingKeysProxy {
772 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
774 let protocol_name = <SealingKeysMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
775 Self { client: fidl::client::Client::new(channel, protocol_name) }
776 }
777
778 pub fn take_event_stream(&self) -> SealingKeysEventStream {
784 SealingKeysEventStream { event_receiver: self.client.take_event_receiver() }
785 }
786
787 pub fn r#create_sealing_key(
810 &self,
811 mut key_info: &[u8],
812 ) -> fidl::client::QueryResponseFut<
813 SealingKeysCreateSealingKeyResult,
814 fidl::encoding::DefaultFuchsiaResourceDialect,
815 > {
816 SealingKeysProxyInterface::r#create_sealing_key(self, key_info)
817 }
818
819 pub fn r#seal(
830 &self,
831 mut key_info: &[u8],
832 mut key_blob: &[u8],
833 mut secret: &[u8],
834 ) -> fidl::client::QueryResponseFut<
835 SealingKeysSealResult,
836 fidl::encoding::DefaultFuchsiaResourceDialect,
837 > {
838 SealingKeysProxyInterface::r#seal(self, key_info, key_blob, secret)
839 }
840
841 pub fn r#unseal(
853 &self,
854 mut key_info: &[u8],
855 mut key_blob: &[u8],
856 mut sealed_secret: &[u8],
857 ) -> fidl::client::QueryResponseFut<
858 SealingKeysUnsealResult,
859 fidl::encoding::DefaultFuchsiaResourceDialect,
860 > {
861 SealingKeysProxyInterface::r#unseal(self, key_info, key_blob, sealed_secret)
862 }
863
864 pub fn r#upgrade_sealing_key(
886 &self,
887 mut key_info: &[u8],
888 mut key_blob: &[u8],
889 ) -> fidl::client::QueryResponseFut<
890 SealingKeysUpgradeSealingKeyResult,
891 fidl::encoding::DefaultFuchsiaResourceDialect,
892 > {
893 SealingKeysProxyInterface::r#upgrade_sealing_key(self, key_info, key_blob)
894 }
895
896 pub fn r#delete_sealing_key(
904 &self,
905 mut key_blob: &[u8],
906 ) -> fidl::client::QueryResponseFut<
907 SealingKeysDeleteSealingKeyResult,
908 fidl::encoding::DefaultFuchsiaResourceDialect,
909 > {
910 SealingKeysProxyInterface::r#delete_sealing_key(self, key_blob)
911 }
912}
913
914impl SealingKeysProxyInterface for SealingKeysProxy {
915 type CreateSealingKeyResponseFut = fidl::client::QueryResponseFut<
916 SealingKeysCreateSealingKeyResult,
917 fidl::encoding::DefaultFuchsiaResourceDialect,
918 >;
919 fn r#create_sealing_key(&self, mut key_info: &[u8]) -> Self::CreateSealingKeyResponseFut {
920 fn _decode(
921 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
922 ) -> Result<SealingKeysCreateSealingKeyResult, fidl::Error> {
923 let _response = fidl::client::decode_transaction_body::<
924 fidl::encoding::ResultType<SealingKeysCreateSealingKeyResponse, CreateError>,
925 fidl::encoding::DefaultFuchsiaResourceDialect,
926 0x5a191cbb6a8081bc,
927 >(_buf?)?;
928 Ok(_response.map(|x| x.key_blob))
929 }
930 self.client.send_query_and_decode::<
931 SealingKeysCreateSealingKeyRequest,
932 SealingKeysCreateSealingKeyResult,
933 >(
934 (key_info,),
935 0x5a191cbb6a8081bc,
936 fidl::encoding::DynamicFlags::empty(),
937 _decode,
938 )
939 }
940
941 type SealResponseFut = fidl::client::QueryResponseFut<
942 SealingKeysSealResult,
943 fidl::encoding::DefaultFuchsiaResourceDialect,
944 >;
945 fn r#seal(
946 &self,
947 mut key_info: &[u8],
948 mut key_blob: &[u8],
949 mut secret: &[u8],
950 ) -> Self::SealResponseFut {
951 fn _decode(
952 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
953 ) -> Result<SealingKeysSealResult, fidl::Error> {
954 let _response = fidl::client::decode_transaction_body::<
955 fidl::encoding::ResultType<SealingKeysSealResponse, SealError>,
956 fidl::encoding::DefaultFuchsiaResourceDialect,
957 0x10d41255013918d1,
958 >(_buf?)?;
959 Ok(_response.map(|x| x.sealed_secret))
960 }
961 self.client.send_query_and_decode::<SealingKeysSealRequest, SealingKeysSealResult>(
962 (key_info, key_blob, secret),
963 0x10d41255013918d1,
964 fidl::encoding::DynamicFlags::empty(),
965 _decode,
966 )
967 }
968
969 type UnsealResponseFut = fidl::client::QueryResponseFut<
970 SealingKeysUnsealResult,
971 fidl::encoding::DefaultFuchsiaResourceDialect,
972 >;
973 fn r#unseal(
974 &self,
975 mut key_info: &[u8],
976 mut key_blob: &[u8],
977 mut sealed_secret: &[u8],
978 ) -> Self::UnsealResponseFut {
979 fn _decode(
980 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
981 ) -> Result<SealingKeysUnsealResult, fidl::Error> {
982 let _response = fidl::client::decode_transaction_body::<
983 fidl::encoding::ResultType<SealingKeysUnsealResponse, UnsealError>,
984 fidl::encoding::DefaultFuchsiaResourceDialect,
985 0x7037d75ecb579c83,
986 >(_buf?)?;
987 Ok(_response.map(|x| x.unsealed_secret))
988 }
989 self.client.send_query_and_decode::<SealingKeysUnsealRequest, SealingKeysUnsealResult>(
990 (key_info, key_blob, sealed_secret),
991 0x7037d75ecb579c83,
992 fidl::encoding::DynamicFlags::empty(),
993 _decode,
994 )
995 }
996
997 type UpgradeSealingKeyResponseFut = fidl::client::QueryResponseFut<
998 SealingKeysUpgradeSealingKeyResult,
999 fidl::encoding::DefaultFuchsiaResourceDialect,
1000 >;
1001 fn r#upgrade_sealing_key(
1002 &self,
1003 mut key_info: &[u8],
1004 mut key_blob: &[u8],
1005 ) -> Self::UpgradeSealingKeyResponseFut {
1006 fn _decode(
1007 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1008 ) -> Result<SealingKeysUpgradeSealingKeyResult, fidl::Error> {
1009 let _response = fidl::client::decode_transaction_body::<
1010 fidl::encoding::ResultType<SealingKeysUpgradeSealingKeyResponse, UpgradeError>,
1011 fidl::encoding::DefaultFuchsiaResourceDialect,
1012 0x68584c5a799181e7,
1013 >(_buf?)?;
1014 Ok(_response.map(|x| x.key_blob))
1015 }
1016 self.client.send_query_and_decode::<
1017 SealingKeysUpgradeSealingKeyRequest,
1018 SealingKeysUpgradeSealingKeyResult,
1019 >(
1020 (key_info, key_blob,),
1021 0x68584c5a799181e7,
1022 fidl::encoding::DynamicFlags::empty(),
1023 _decode,
1024 )
1025 }
1026
1027 type DeleteSealingKeyResponseFut = fidl::client::QueryResponseFut<
1028 SealingKeysDeleteSealingKeyResult,
1029 fidl::encoding::DefaultFuchsiaResourceDialect,
1030 >;
1031 fn r#delete_sealing_key(&self, mut key_blob: &[u8]) -> Self::DeleteSealingKeyResponseFut {
1032 fn _decode(
1033 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1034 ) -> Result<SealingKeysDeleteSealingKeyResult, fidl::Error> {
1035 let _response = fidl::client::decode_transaction_body::<
1036 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeleteError>,
1037 fidl::encoding::DefaultFuchsiaResourceDialect,
1038 0xad65bae761e8c3,
1039 >(_buf?)?;
1040 Ok(_response.map(|x| x))
1041 }
1042 self.client.send_query_and_decode::<
1043 SealingKeysDeleteSealingKeyRequest,
1044 SealingKeysDeleteSealingKeyResult,
1045 >(
1046 (key_blob,),
1047 0xad65bae761e8c3,
1048 fidl::encoding::DynamicFlags::empty(),
1049 _decode,
1050 )
1051 }
1052}
1053
1054pub struct SealingKeysEventStream {
1055 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1056}
1057
1058impl std::marker::Unpin for SealingKeysEventStream {}
1059
1060impl futures::stream::FusedStream for SealingKeysEventStream {
1061 fn is_terminated(&self) -> bool {
1062 self.event_receiver.is_terminated()
1063 }
1064}
1065
1066impl futures::Stream for SealingKeysEventStream {
1067 type Item = Result<SealingKeysEvent, fidl::Error>;
1068
1069 fn poll_next(
1070 mut self: std::pin::Pin<&mut Self>,
1071 cx: &mut std::task::Context<'_>,
1072 ) -> std::task::Poll<Option<Self::Item>> {
1073 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1074 &mut self.event_receiver,
1075 cx
1076 )?) {
1077 Some(buf) => std::task::Poll::Ready(Some(SealingKeysEvent::decode(buf))),
1078 None => std::task::Poll::Ready(None),
1079 }
1080 }
1081}
1082
1083#[derive(Debug)]
1084pub enum SealingKeysEvent {}
1085
1086impl SealingKeysEvent {
1087 fn decode(
1089 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1090 ) -> Result<SealingKeysEvent, fidl::Error> {
1091 let (bytes, _handles) = buf.split_mut();
1092 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1093 debug_assert_eq!(tx_header.tx_id, 0);
1094 match tx_header.ordinal {
1095 _ => Err(fidl::Error::UnknownOrdinal {
1096 ordinal: tx_header.ordinal,
1097 protocol_name: <SealingKeysMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1098 }),
1099 }
1100 }
1101}
1102
1103pub struct SealingKeysRequestStream {
1105 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1106 is_terminated: bool,
1107}
1108
1109impl std::marker::Unpin for SealingKeysRequestStream {}
1110
1111impl futures::stream::FusedStream for SealingKeysRequestStream {
1112 fn is_terminated(&self) -> bool {
1113 self.is_terminated
1114 }
1115}
1116
1117impl fidl::endpoints::RequestStream for SealingKeysRequestStream {
1118 type Protocol = SealingKeysMarker;
1119 type ControlHandle = SealingKeysControlHandle;
1120
1121 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1122 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1123 }
1124
1125 fn control_handle(&self) -> Self::ControlHandle {
1126 SealingKeysControlHandle { inner: self.inner.clone() }
1127 }
1128
1129 fn into_inner(
1130 self,
1131 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1132 {
1133 (self.inner, self.is_terminated)
1134 }
1135
1136 fn from_inner(
1137 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1138 is_terminated: bool,
1139 ) -> Self {
1140 Self { inner, is_terminated }
1141 }
1142}
1143
1144impl futures::Stream for SealingKeysRequestStream {
1145 type Item = Result<SealingKeysRequest, fidl::Error>;
1146
1147 fn poll_next(
1148 mut self: std::pin::Pin<&mut Self>,
1149 cx: &mut std::task::Context<'_>,
1150 ) -> std::task::Poll<Option<Self::Item>> {
1151 let this = &mut *self;
1152 if this.inner.check_shutdown(cx) {
1153 this.is_terminated = true;
1154 return std::task::Poll::Ready(None);
1155 }
1156 if this.is_terminated {
1157 panic!("polled SealingKeysRequestStream after completion");
1158 }
1159 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1160 |bytes, handles| {
1161 match this.inner.channel().read_etc(cx, bytes, handles) {
1162 std::task::Poll::Ready(Ok(())) => {}
1163 std::task::Poll::Pending => return std::task::Poll::Pending,
1164 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1165 this.is_terminated = true;
1166 return std::task::Poll::Ready(None);
1167 }
1168 std::task::Poll::Ready(Err(e)) => {
1169 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1170 e.into(),
1171 ))));
1172 }
1173 }
1174
1175 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1177
1178 std::task::Poll::Ready(Some(match header.ordinal {
1179 0x5a191cbb6a8081bc => {
1180 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1181 let mut req = fidl::new_empty!(
1182 SealingKeysCreateSealingKeyRequest,
1183 fidl::encoding::DefaultFuchsiaResourceDialect
1184 );
1185 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SealingKeysCreateSealingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
1186 let control_handle = SealingKeysControlHandle { inner: this.inner.clone() };
1187 Ok(SealingKeysRequest::CreateSealingKey {
1188 key_info: req.key_info,
1189
1190 responder: SealingKeysCreateSealingKeyResponder {
1191 control_handle: std::mem::ManuallyDrop::new(control_handle),
1192 tx_id: header.tx_id,
1193 },
1194 })
1195 }
1196 0x10d41255013918d1 => {
1197 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1198 let mut req = fidl::new_empty!(
1199 SealingKeysSealRequest,
1200 fidl::encoding::DefaultFuchsiaResourceDialect
1201 );
1202 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SealingKeysSealRequest>(&header, _body_bytes, handles, &mut req)?;
1203 let control_handle = SealingKeysControlHandle { inner: this.inner.clone() };
1204 Ok(SealingKeysRequest::Seal {
1205 key_info: req.key_info,
1206 key_blob: req.key_blob,
1207 secret: req.secret,
1208
1209 responder: SealingKeysSealResponder {
1210 control_handle: std::mem::ManuallyDrop::new(control_handle),
1211 tx_id: header.tx_id,
1212 },
1213 })
1214 }
1215 0x7037d75ecb579c83 => {
1216 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1217 let mut req = fidl::new_empty!(
1218 SealingKeysUnsealRequest,
1219 fidl::encoding::DefaultFuchsiaResourceDialect
1220 );
1221 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SealingKeysUnsealRequest>(&header, _body_bytes, handles, &mut req)?;
1222 let control_handle = SealingKeysControlHandle { inner: this.inner.clone() };
1223 Ok(SealingKeysRequest::Unseal {
1224 key_info: req.key_info,
1225 key_blob: req.key_blob,
1226 sealed_secret: req.sealed_secret,
1227
1228 responder: SealingKeysUnsealResponder {
1229 control_handle: std::mem::ManuallyDrop::new(control_handle),
1230 tx_id: header.tx_id,
1231 },
1232 })
1233 }
1234 0x68584c5a799181e7 => {
1235 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1236 let mut req = fidl::new_empty!(
1237 SealingKeysUpgradeSealingKeyRequest,
1238 fidl::encoding::DefaultFuchsiaResourceDialect
1239 );
1240 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SealingKeysUpgradeSealingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
1241 let control_handle = SealingKeysControlHandle { inner: this.inner.clone() };
1242 Ok(SealingKeysRequest::UpgradeSealingKey {
1243 key_info: req.key_info,
1244 key_blob: req.key_blob,
1245
1246 responder: SealingKeysUpgradeSealingKeyResponder {
1247 control_handle: std::mem::ManuallyDrop::new(control_handle),
1248 tx_id: header.tx_id,
1249 },
1250 })
1251 }
1252 0xad65bae761e8c3 => {
1253 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1254 let mut req = fidl::new_empty!(
1255 SealingKeysDeleteSealingKeyRequest,
1256 fidl::encoding::DefaultFuchsiaResourceDialect
1257 );
1258 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SealingKeysDeleteSealingKeyRequest>(&header, _body_bytes, handles, &mut req)?;
1259 let control_handle = SealingKeysControlHandle { inner: this.inner.clone() };
1260 Ok(SealingKeysRequest::DeleteSealingKey {
1261 key_blob: req.key_blob,
1262
1263 responder: SealingKeysDeleteSealingKeyResponder {
1264 control_handle: std::mem::ManuallyDrop::new(control_handle),
1265 tx_id: header.tx_id,
1266 },
1267 })
1268 }
1269 _ => Err(fidl::Error::UnknownOrdinal {
1270 ordinal: header.ordinal,
1271 protocol_name:
1272 <SealingKeysMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1273 }),
1274 }))
1275 },
1276 )
1277 }
1278}
1279
1280#[derive(Debug)]
1286pub enum SealingKeysRequest {
1287 CreateSealingKey { key_info: Vec<u8>, responder: SealingKeysCreateSealingKeyResponder },
1310 Seal {
1321 key_info: Vec<u8>,
1322 key_blob: Vec<u8>,
1323 secret: Vec<u8>,
1324 responder: SealingKeysSealResponder,
1325 },
1326 Unseal {
1338 key_info: Vec<u8>,
1339 key_blob: Vec<u8>,
1340 sealed_secret: Vec<u8>,
1341 responder: SealingKeysUnsealResponder,
1342 },
1343 UpgradeSealingKey {
1365 key_info: Vec<u8>,
1366 key_blob: Vec<u8>,
1367 responder: SealingKeysUpgradeSealingKeyResponder,
1368 },
1369 DeleteSealingKey { key_blob: Vec<u8>, responder: SealingKeysDeleteSealingKeyResponder },
1377}
1378
1379impl SealingKeysRequest {
1380 #[allow(irrefutable_let_patterns)]
1381 pub fn into_create_sealing_key(
1382 self,
1383 ) -> Option<(Vec<u8>, SealingKeysCreateSealingKeyResponder)> {
1384 if let SealingKeysRequest::CreateSealingKey { key_info, responder } = self {
1385 Some((key_info, responder))
1386 } else {
1387 None
1388 }
1389 }
1390
1391 #[allow(irrefutable_let_patterns)]
1392 pub fn into_seal(self) -> Option<(Vec<u8>, Vec<u8>, Vec<u8>, SealingKeysSealResponder)> {
1393 if let SealingKeysRequest::Seal { key_info, key_blob, secret, responder } = self {
1394 Some((key_info, key_blob, secret, responder))
1395 } else {
1396 None
1397 }
1398 }
1399
1400 #[allow(irrefutable_let_patterns)]
1401 pub fn into_unseal(self) -> Option<(Vec<u8>, Vec<u8>, Vec<u8>, SealingKeysUnsealResponder)> {
1402 if let SealingKeysRequest::Unseal { key_info, key_blob, sealed_secret, responder } = self {
1403 Some((key_info, key_blob, sealed_secret, responder))
1404 } else {
1405 None
1406 }
1407 }
1408
1409 #[allow(irrefutable_let_patterns)]
1410 pub fn into_upgrade_sealing_key(
1411 self,
1412 ) -> Option<(Vec<u8>, Vec<u8>, SealingKeysUpgradeSealingKeyResponder)> {
1413 if let SealingKeysRequest::UpgradeSealingKey { key_info, key_blob, responder } = self {
1414 Some((key_info, key_blob, responder))
1415 } else {
1416 None
1417 }
1418 }
1419
1420 #[allow(irrefutable_let_patterns)]
1421 pub fn into_delete_sealing_key(
1422 self,
1423 ) -> Option<(Vec<u8>, SealingKeysDeleteSealingKeyResponder)> {
1424 if let SealingKeysRequest::DeleteSealingKey { key_blob, responder } = self {
1425 Some((key_blob, responder))
1426 } else {
1427 None
1428 }
1429 }
1430
1431 pub fn method_name(&self) -> &'static str {
1433 match *self {
1434 SealingKeysRequest::CreateSealingKey { .. } => "create_sealing_key",
1435 SealingKeysRequest::Seal { .. } => "seal",
1436 SealingKeysRequest::Unseal { .. } => "unseal",
1437 SealingKeysRequest::UpgradeSealingKey { .. } => "upgrade_sealing_key",
1438 SealingKeysRequest::DeleteSealingKey { .. } => "delete_sealing_key",
1439 }
1440 }
1441}
1442
1443#[derive(Debug, Clone)]
1444pub struct SealingKeysControlHandle {
1445 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1446}
1447
1448impl fidl::endpoints::ControlHandle for SealingKeysControlHandle {
1449 fn shutdown(&self) {
1450 self.inner.shutdown()
1451 }
1452
1453 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1454 self.inner.shutdown_with_epitaph(status)
1455 }
1456
1457 fn is_closed(&self) -> bool {
1458 self.inner.channel().is_closed()
1459 }
1460 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1461 self.inner.channel().on_closed()
1462 }
1463
1464 #[cfg(target_os = "fuchsia")]
1465 fn signal_peer(
1466 &self,
1467 clear_mask: zx::Signals,
1468 set_mask: zx::Signals,
1469 ) -> Result<(), zx_status::Status> {
1470 use fidl::Peered;
1471 self.inner.channel().signal_peer(clear_mask, set_mask)
1472 }
1473}
1474
1475impl SealingKeysControlHandle {}
1476
1477#[must_use = "FIDL methods require a response to be sent"]
1478#[derive(Debug)]
1479pub struct SealingKeysCreateSealingKeyResponder {
1480 control_handle: std::mem::ManuallyDrop<SealingKeysControlHandle>,
1481 tx_id: u32,
1482}
1483
1484impl std::ops::Drop for SealingKeysCreateSealingKeyResponder {
1488 fn drop(&mut self) {
1489 self.control_handle.shutdown();
1490 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1492 }
1493}
1494
1495impl fidl::endpoints::Responder for SealingKeysCreateSealingKeyResponder {
1496 type ControlHandle = SealingKeysControlHandle;
1497
1498 fn control_handle(&self) -> &SealingKeysControlHandle {
1499 &self.control_handle
1500 }
1501
1502 fn drop_without_shutdown(mut self) {
1503 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1505 std::mem::forget(self);
1507 }
1508}
1509
1510impl SealingKeysCreateSealingKeyResponder {
1511 pub fn send(self, mut result: Result<&[u8], CreateError>) -> Result<(), fidl::Error> {
1515 let _result = self.send_raw(result);
1516 if _result.is_err() {
1517 self.control_handle.shutdown();
1518 }
1519 self.drop_without_shutdown();
1520 _result
1521 }
1522
1523 pub fn send_no_shutdown_on_err(
1525 self,
1526 mut result: Result<&[u8], CreateError>,
1527 ) -> Result<(), fidl::Error> {
1528 let _result = self.send_raw(result);
1529 self.drop_without_shutdown();
1530 _result
1531 }
1532
1533 fn send_raw(&self, mut result: Result<&[u8], CreateError>) -> Result<(), fidl::Error> {
1534 self.control_handle.inner.send::<fidl::encoding::ResultType<
1535 SealingKeysCreateSealingKeyResponse,
1536 CreateError,
1537 >>(
1538 result.map(|key_blob| (key_blob,)),
1539 self.tx_id,
1540 0x5a191cbb6a8081bc,
1541 fidl::encoding::DynamicFlags::empty(),
1542 )
1543 }
1544}
1545
1546#[must_use = "FIDL methods require a response to be sent"]
1547#[derive(Debug)]
1548pub struct SealingKeysSealResponder {
1549 control_handle: std::mem::ManuallyDrop<SealingKeysControlHandle>,
1550 tx_id: u32,
1551}
1552
1553impl std::ops::Drop for SealingKeysSealResponder {
1557 fn drop(&mut self) {
1558 self.control_handle.shutdown();
1559 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1561 }
1562}
1563
1564impl fidl::endpoints::Responder for SealingKeysSealResponder {
1565 type ControlHandle = SealingKeysControlHandle;
1566
1567 fn control_handle(&self) -> &SealingKeysControlHandle {
1568 &self.control_handle
1569 }
1570
1571 fn drop_without_shutdown(mut self) {
1572 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1574 std::mem::forget(self);
1576 }
1577}
1578
1579impl SealingKeysSealResponder {
1580 pub fn send(self, mut result: Result<&[u8], SealError>) -> Result<(), fidl::Error> {
1584 let _result = self.send_raw(result);
1585 if _result.is_err() {
1586 self.control_handle.shutdown();
1587 }
1588 self.drop_without_shutdown();
1589 _result
1590 }
1591
1592 pub fn send_no_shutdown_on_err(
1594 self,
1595 mut result: Result<&[u8], SealError>,
1596 ) -> Result<(), fidl::Error> {
1597 let _result = self.send_raw(result);
1598 self.drop_without_shutdown();
1599 _result
1600 }
1601
1602 fn send_raw(&self, mut result: Result<&[u8], SealError>) -> Result<(), fidl::Error> {
1603 self.control_handle
1604 .inner
1605 .send::<fidl::encoding::ResultType<SealingKeysSealResponse, SealError>>(
1606 result.map(|sealed_secret| (sealed_secret,)),
1607 self.tx_id,
1608 0x10d41255013918d1,
1609 fidl::encoding::DynamicFlags::empty(),
1610 )
1611 }
1612}
1613
1614#[must_use = "FIDL methods require a response to be sent"]
1615#[derive(Debug)]
1616pub struct SealingKeysUnsealResponder {
1617 control_handle: std::mem::ManuallyDrop<SealingKeysControlHandle>,
1618 tx_id: u32,
1619}
1620
1621impl std::ops::Drop for SealingKeysUnsealResponder {
1625 fn drop(&mut self) {
1626 self.control_handle.shutdown();
1627 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1629 }
1630}
1631
1632impl fidl::endpoints::Responder for SealingKeysUnsealResponder {
1633 type ControlHandle = SealingKeysControlHandle;
1634
1635 fn control_handle(&self) -> &SealingKeysControlHandle {
1636 &self.control_handle
1637 }
1638
1639 fn drop_without_shutdown(mut self) {
1640 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1642 std::mem::forget(self);
1644 }
1645}
1646
1647impl SealingKeysUnsealResponder {
1648 pub fn send(self, mut result: Result<&[u8], UnsealError>) -> Result<(), fidl::Error> {
1652 let _result = self.send_raw(result);
1653 if _result.is_err() {
1654 self.control_handle.shutdown();
1655 }
1656 self.drop_without_shutdown();
1657 _result
1658 }
1659
1660 pub fn send_no_shutdown_on_err(
1662 self,
1663 mut result: Result<&[u8], UnsealError>,
1664 ) -> Result<(), fidl::Error> {
1665 let _result = self.send_raw(result);
1666 self.drop_without_shutdown();
1667 _result
1668 }
1669
1670 fn send_raw(&self, mut result: Result<&[u8], UnsealError>) -> Result<(), fidl::Error> {
1671 self.control_handle
1672 .inner
1673 .send::<fidl::encoding::ResultType<SealingKeysUnsealResponse, UnsealError>>(
1674 result.map(|unsealed_secret| (unsealed_secret,)),
1675 self.tx_id,
1676 0x7037d75ecb579c83,
1677 fidl::encoding::DynamicFlags::empty(),
1678 )
1679 }
1680}
1681
1682#[must_use = "FIDL methods require a response to be sent"]
1683#[derive(Debug)]
1684pub struct SealingKeysUpgradeSealingKeyResponder {
1685 control_handle: std::mem::ManuallyDrop<SealingKeysControlHandle>,
1686 tx_id: u32,
1687}
1688
1689impl std::ops::Drop for SealingKeysUpgradeSealingKeyResponder {
1693 fn drop(&mut self) {
1694 self.control_handle.shutdown();
1695 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1697 }
1698}
1699
1700impl fidl::endpoints::Responder for SealingKeysUpgradeSealingKeyResponder {
1701 type ControlHandle = SealingKeysControlHandle;
1702
1703 fn control_handle(&self) -> &SealingKeysControlHandle {
1704 &self.control_handle
1705 }
1706
1707 fn drop_without_shutdown(mut self) {
1708 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1710 std::mem::forget(self);
1712 }
1713}
1714
1715impl SealingKeysUpgradeSealingKeyResponder {
1716 pub fn send(self, mut result: Result<&[u8], UpgradeError>) -> Result<(), fidl::Error> {
1720 let _result = self.send_raw(result);
1721 if _result.is_err() {
1722 self.control_handle.shutdown();
1723 }
1724 self.drop_without_shutdown();
1725 _result
1726 }
1727
1728 pub fn send_no_shutdown_on_err(
1730 self,
1731 mut result: Result<&[u8], UpgradeError>,
1732 ) -> Result<(), fidl::Error> {
1733 let _result = self.send_raw(result);
1734 self.drop_without_shutdown();
1735 _result
1736 }
1737
1738 fn send_raw(&self, mut result: Result<&[u8], UpgradeError>) -> Result<(), fidl::Error> {
1739 self.control_handle.inner.send::<fidl::encoding::ResultType<
1740 SealingKeysUpgradeSealingKeyResponse,
1741 UpgradeError,
1742 >>(
1743 result.map(|key_blob| (key_blob,)),
1744 self.tx_id,
1745 0x68584c5a799181e7,
1746 fidl::encoding::DynamicFlags::empty(),
1747 )
1748 }
1749}
1750
1751#[must_use = "FIDL methods require a response to be sent"]
1752#[derive(Debug)]
1753pub struct SealingKeysDeleteSealingKeyResponder {
1754 control_handle: std::mem::ManuallyDrop<SealingKeysControlHandle>,
1755 tx_id: u32,
1756}
1757
1758impl std::ops::Drop for SealingKeysDeleteSealingKeyResponder {
1762 fn drop(&mut self) {
1763 self.control_handle.shutdown();
1764 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1766 }
1767}
1768
1769impl fidl::endpoints::Responder for SealingKeysDeleteSealingKeyResponder {
1770 type ControlHandle = SealingKeysControlHandle;
1771
1772 fn control_handle(&self) -> &SealingKeysControlHandle {
1773 &self.control_handle
1774 }
1775
1776 fn drop_without_shutdown(mut self) {
1777 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1779 std::mem::forget(self);
1781 }
1782}
1783
1784impl SealingKeysDeleteSealingKeyResponder {
1785 pub fn send(self, mut result: Result<(), DeleteError>) -> Result<(), fidl::Error> {
1789 let _result = self.send_raw(result);
1790 if _result.is_err() {
1791 self.control_handle.shutdown();
1792 }
1793 self.drop_without_shutdown();
1794 _result
1795 }
1796
1797 pub fn send_no_shutdown_on_err(
1799 self,
1800 mut result: Result<(), DeleteError>,
1801 ) -> Result<(), fidl::Error> {
1802 let _result = self.send_raw(result);
1803 self.drop_without_shutdown();
1804 _result
1805 }
1806
1807 fn send_raw(&self, mut result: Result<(), DeleteError>) -> Result<(), fidl::Error> {
1808 self.control_handle.inner.send::<fidl::encoding::ResultType<
1809 fidl::encoding::EmptyStruct,
1810 DeleteError,
1811 >>(
1812 result,
1813 self.tx_id,
1814 0xad65bae761e8c3,
1815 fidl::encoding::DynamicFlags::empty(),
1816 )
1817 }
1818}
1819
1820mod internal {
1821 use super::*;
1822}