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 _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13pub const MAX_KEY_SIZE: u64 = 256;
14
15pub const MAX_STRING_SIZE: u64 = 12000;
18
19#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
20#[repr(u32)]
21pub enum FlushError {
22 ReadOnly = 1,
23 CommitFailed = 2,
24}
25
26impl FlushError {
27 #[inline]
28 pub fn from_primitive(prim: u32) -> Option<Self> {
29 match prim {
30 1 => Some(Self::ReadOnly),
31 2 => Some(Self::CommitFailed),
32 _ => None,
33 }
34 }
35
36 #[inline]
37 pub const fn into_primitive(self) -> u32 {
38 self as u32
39 }
40
41 #[deprecated = "Strict enums should not use `is_unknown`"]
42 #[inline]
43 pub fn is_unknown(&self) -> bool {
44 false
45 }
46}
47
48#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
50#[repr(u8)]
51pub enum ValueType {
52 IntVal = 1,
53 FloatVal = 2,
54 BoolVal = 3,
55 StringVal = 4,
56 BytesVal = 5,
57}
58
59impl ValueType {
60 #[inline]
61 pub fn from_primitive(prim: u8) -> Option<Self> {
62 match prim {
63 1 => Some(Self::IntVal),
64 2 => Some(Self::FloatVal),
65 3 => Some(Self::BoolVal),
66 4 => Some(Self::StringVal),
67 5 => Some(Self::BytesVal),
68 _ => None,
69 }
70 }
71
72 #[inline]
73 pub const fn into_primitive(self) -> u8 {
74 self as u8
75 }
76
77 #[deprecated = "Strict enums should not use `is_unknown`"]
78 #[inline]
79 pub fn is_unknown(&self) -> bool {
80 false
81 }
82}
83
84#[derive(Debug, PartialEq)]
85pub struct GetIteratorGetNextResponse {
86 pub kvs: Vec<KeyValue>,
87}
88
89impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
90 for GetIteratorGetNextResponse
91{
92}
93
94#[derive(Debug, PartialEq)]
97pub struct KeyValue {
98 pub key: String,
99 pub val: Value,
100}
101
102impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for KeyValue {}
103
104#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
106pub struct ListItem {
107 pub key: String,
108 pub type_: ValueType,
109}
110
111impl fidl::Persistable for ListItem {}
112
113#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
114pub struct ListIteratorGetNextResponse {
115 pub keys: Vec<ListItem>,
116}
117
118impl fidl::Persistable for ListIteratorGetNextResponse {}
119
120#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
121pub struct StoreAccessorDeletePrefixRequest {
122 pub prefix: String,
123}
124
125impl fidl::Persistable for StoreAccessorDeletePrefixRequest {}
126
127#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
128pub struct StoreAccessorDeleteValueRequest {
129 pub key: String,
130}
131
132impl fidl::Persistable for StoreAccessorDeleteValueRequest {}
133
134#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
135pub struct StoreAccessorGetPrefixRequest {
136 pub prefix: String,
137 pub it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
138}
139
140impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
141 for StoreAccessorGetPrefixRequest
142{
143}
144
145#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
146pub struct StoreAccessorGetValueRequest {
147 pub key: String,
148}
149
150impl fidl::Persistable for StoreAccessorGetValueRequest {}
151
152#[derive(Debug, PartialEq)]
153pub struct StoreAccessorGetValueResponse {
154 pub val: Option<Box<Value>>,
155}
156
157impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
158 for StoreAccessorGetValueResponse
159{
160}
161
162#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
163pub struct StoreAccessorListPrefixRequest {
164 pub prefix: String,
165 pub it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
166}
167
168impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
169 for StoreAccessorListPrefixRequest
170{
171}
172
173#[derive(Debug, PartialEq)]
174pub struct StoreAccessorSetValueRequest {
175 pub key: String,
176 pub val: Value,
177}
178
179impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
180 for StoreAccessorSetValueRequest
181{
182}
183
184#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
185pub struct StoreCreateAccessorRequest {
186 pub read_only: bool,
187 pub accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
188}
189
190impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
191 for StoreCreateAccessorRequest
192{
193}
194
195#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
196pub struct StoreIdentifyRequest {
197 pub name: String,
198}
199
200impl fidl::Persistable for StoreIdentifyRequest {}
201
202#[derive(Debug, PartialEq)]
204pub enum Value {
205 Intval(i64),
206 Floatval(f64),
207 Boolval(bool),
208 Stringval(String),
209 Bytesval(fidl_fuchsia_mem::Buffer),
210}
211
212impl Value {
213 #[inline]
214 pub fn ordinal(&self) -> u64 {
215 match *self {
216 Self::Intval(_) => 1,
217 Self::Floatval(_) => 2,
218 Self::Boolval(_) => 3,
219 Self::Stringval(_) => 4,
220 Self::Bytesval(_) => 5,
221 }
222 }
223
224 #[deprecated = "Strict unions should not use `is_unknown`"]
225 #[inline]
226 pub fn is_unknown(&self) -> bool {
227 false
228 }
229}
230
231impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Value {}
232
233#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
234pub struct GetIteratorMarker;
235
236impl fidl::endpoints::ProtocolMarker for GetIteratorMarker {
237 type Proxy = GetIteratorProxy;
238 type RequestStream = GetIteratorRequestStream;
239 #[cfg(target_os = "fuchsia")]
240 type SynchronousProxy = GetIteratorSynchronousProxy;
241
242 const DEBUG_NAME: &'static str = "(anonymous) GetIterator";
243}
244
245pub trait GetIteratorProxyInterface: Send + Sync {
246 type GetNextResponseFut: std::future::Future<Output = Result<Vec<KeyValue>, fidl::Error>> + Send;
247 fn r#get_next(&self) -> Self::GetNextResponseFut;
248}
249#[derive(Debug)]
250#[cfg(target_os = "fuchsia")]
251pub struct GetIteratorSynchronousProxy {
252 client: fidl::client::sync::Client,
253}
254
255#[cfg(target_os = "fuchsia")]
256impl fidl::endpoints::SynchronousProxy for GetIteratorSynchronousProxy {
257 type Proxy = GetIteratorProxy;
258 type Protocol = GetIteratorMarker;
259
260 fn from_channel(inner: fidl::Channel) -> Self {
261 Self::new(inner)
262 }
263
264 fn into_channel(self) -> fidl::Channel {
265 self.client.into_channel()
266 }
267
268 fn as_channel(&self) -> &fidl::Channel {
269 self.client.as_channel()
270 }
271}
272
273#[cfg(target_os = "fuchsia")]
274impl GetIteratorSynchronousProxy {
275 pub fn new(channel: fidl::Channel) -> Self {
276 let protocol_name = <GetIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
277 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
278 }
279
280 pub fn into_channel(self) -> fidl::Channel {
281 self.client.into_channel()
282 }
283
284 pub fn wait_for_event(
287 &self,
288 deadline: zx::MonotonicInstant,
289 ) -> Result<GetIteratorEvent, fidl::Error> {
290 GetIteratorEvent::decode(self.client.wait_for_event(deadline)?)
291 }
292
293 pub fn r#get_next(
294 &self,
295 ___deadline: zx::MonotonicInstant,
296 ) -> Result<Vec<KeyValue>, fidl::Error> {
297 let _response =
298 self.client.send_query::<fidl::encoding::EmptyPayload, GetIteratorGetNextResponse>(
299 (),
300 0xe0a5a8ea5dbfbf5,
301 fidl::encoding::DynamicFlags::empty(),
302 ___deadline,
303 )?;
304 Ok(_response.kvs)
305 }
306}
307
308#[derive(Debug, Clone)]
309pub struct GetIteratorProxy {
310 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
311}
312
313impl fidl::endpoints::Proxy for GetIteratorProxy {
314 type Protocol = GetIteratorMarker;
315
316 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
317 Self::new(inner)
318 }
319
320 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
321 self.client.into_channel().map_err(|client| Self { client })
322 }
323
324 fn as_channel(&self) -> &::fidl::AsyncChannel {
325 self.client.as_channel()
326 }
327}
328
329impl GetIteratorProxy {
330 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
332 let protocol_name = <GetIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
333 Self { client: fidl::client::Client::new(channel, protocol_name) }
334 }
335
336 pub fn take_event_stream(&self) -> GetIteratorEventStream {
342 GetIteratorEventStream { event_receiver: self.client.take_event_receiver() }
343 }
344
345 pub fn r#get_next(
346 &self,
347 ) -> fidl::client::QueryResponseFut<Vec<KeyValue>, fidl::encoding::DefaultFuchsiaResourceDialect>
348 {
349 GetIteratorProxyInterface::r#get_next(self)
350 }
351}
352
353impl GetIteratorProxyInterface for GetIteratorProxy {
354 type GetNextResponseFut = fidl::client::QueryResponseFut<
355 Vec<KeyValue>,
356 fidl::encoding::DefaultFuchsiaResourceDialect,
357 >;
358 fn r#get_next(&self) -> Self::GetNextResponseFut {
359 fn _decode(
360 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
361 ) -> Result<Vec<KeyValue>, fidl::Error> {
362 let _response = fidl::client::decode_transaction_body::<
363 GetIteratorGetNextResponse,
364 fidl::encoding::DefaultFuchsiaResourceDialect,
365 0xe0a5a8ea5dbfbf5,
366 >(_buf?)?;
367 Ok(_response.kvs)
368 }
369 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<KeyValue>>(
370 (),
371 0xe0a5a8ea5dbfbf5,
372 fidl::encoding::DynamicFlags::empty(),
373 _decode,
374 )
375 }
376}
377
378pub struct GetIteratorEventStream {
379 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
380}
381
382impl std::marker::Unpin for GetIteratorEventStream {}
383
384impl futures::stream::FusedStream for GetIteratorEventStream {
385 fn is_terminated(&self) -> bool {
386 self.event_receiver.is_terminated()
387 }
388}
389
390impl futures::Stream for GetIteratorEventStream {
391 type Item = Result<GetIteratorEvent, fidl::Error>;
392
393 fn poll_next(
394 mut self: std::pin::Pin<&mut Self>,
395 cx: &mut std::task::Context<'_>,
396 ) -> std::task::Poll<Option<Self::Item>> {
397 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
398 &mut self.event_receiver,
399 cx
400 )?) {
401 Some(buf) => std::task::Poll::Ready(Some(GetIteratorEvent::decode(buf))),
402 None => std::task::Poll::Ready(None),
403 }
404 }
405}
406
407#[derive(Debug)]
408pub enum GetIteratorEvent {}
409
410impl GetIteratorEvent {
411 fn decode(
413 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
414 ) -> Result<GetIteratorEvent, fidl::Error> {
415 let (bytes, _handles) = buf.split_mut();
416 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
417 debug_assert_eq!(tx_header.tx_id, 0);
418 match tx_header.ordinal {
419 _ => Err(fidl::Error::UnknownOrdinal {
420 ordinal: tx_header.ordinal,
421 protocol_name: <GetIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
422 }),
423 }
424 }
425}
426
427pub struct GetIteratorRequestStream {
429 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
430 is_terminated: bool,
431}
432
433impl std::marker::Unpin for GetIteratorRequestStream {}
434
435impl futures::stream::FusedStream for GetIteratorRequestStream {
436 fn is_terminated(&self) -> bool {
437 self.is_terminated
438 }
439}
440
441impl fidl::endpoints::RequestStream for GetIteratorRequestStream {
442 type Protocol = GetIteratorMarker;
443 type ControlHandle = GetIteratorControlHandle;
444
445 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
446 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
447 }
448
449 fn control_handle(&self) -> Self::ControlHandle {
450 GetIteratorControlHandle { inner: self.inner.clone() }
451 }
452
453 fn into_inner(
454 self,
455 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
456 {
457 (self.inner, self.is_terminated)
458 }
459
460 fn from_inner(
461 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
462 is_terminated: bool,
463 ) -> Self {
464 Self { inner, is_terminated }
465 }
466}
467
468impl futures::Stream for GetIteratorRequestStream {
469 type Item = Result<GetIteratorRequest, fidl::Error>;
470
471 fn poll_next(
472 mut self: std::pin::Pin<&mut Self>,
473 cx: &mut std::task::Context<'_>,
474 ) -> std::task::Poll<Option<Self::Item>> {
475 let this = &mut *self;
476 if this.inner.check_shutdown(cx) {
477 this.is_terminated = true;
478 return std::task::Poll::Ready(None);
479 }
480 if this.is_terminated {
481 panic!("polled GetIteratorRequestStream after completion");
482 }
483 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
484 |bytes, handles| {
485 match this.inner.channel().read_etc(cx, bytes, handles) {
486 std::task::Poll::Ready(Ok(())) => {}
487 std::task::Poll::Pending => return std::task::Poll::Pending,
488 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
489 this.is_terminated = true;
490 return std::task::Poll::Ready(None);
491 }
492 std::task::Poll::Ready(Err(e)) => {
493 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
494 e.into(),
495 ))))
496 }
497 }
498
499 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
501
502 std::task::Poll::Ready(Some(match header.ordinal {
503 0xe0a5a8ea5dbfbf5 => {
504 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
505 let mut req = fidl::new_empty!(
506 fidl::encoding::EmptyPayload,
507 fidl::encoding::DefaultFuchsiaResourceDialect
508 );
509 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
510 let control_handle = GetIteratorControlHandle { inner: this.inner.clone() };
511 Ok(GetIteratorRequest::GetNext {
512 responder: GetIteratorGetNextResponder {
513 control_handle: std::mem::ManuallyDrop::new(control_handle),
514 tx_id: header.tx_id,
515 },
516 })
517 }
518 _ => Err(fidl::Error::UnknownOrdinal {
519 ordinal: header.ordinal,
520 protocol_name:
521 <GetIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
522 }),
523 }))
524 },
525 )
526 }
527}
528
529#[derive(Debug)]
532pub enum GetIteratorRequest {
533 GetNext { responder: GetIteratorGetNextResponder },
534}
535
536impl GetIteratorRequest {
537 #[allow(irrefutable_let_patterns)]
538 pub fn into_get_next(self) -> Option<(GetIteratorGetNextResponder)> {
539 if let GetIteratorRequest::GetNext { responder } = self {
540 Some((responder))
541 } else {
542 None
543 }
544 }
545
546 pub fn method_name(&self) -> &'static str {
548 match *self {
549 GetIteratorRequest::GetNext { .. } => "get_next",
550 }
551 }
552}
553
554#[derive(Debug, Clone)]
555pub struct GetIteratorControlHandle {
556 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
557}
558
559impl fidl::endpoints::ControlHandle for GetIteratorControlHandle {
560 fn shutdown(&self) {
561 self.inner.shutdown()
562 }
563 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
564 self.inner.shutdown_with_epitaph(status)
565 }
566
567 fn is_closed(&self) -> bool {
568 self.inner.channel().is_closed()
569 }
570 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
571 self.inner.channel().on_closed()
572 }
573
574 #[cfg(target_os = "fuchsia")]
575 fn signal_peer(
576 &self,
577 clear_mask: zx::Signals,
578 set_mask: zx::Signals,
579 ) -> Result<(), zx_status::Status> {
580 use fidl::Peered;
581 self.inner.channel().signal_peer(clear_mask, set_mask)
582 }
583}
584
585impl GetIteratorControlHandle {}
586
587#[must_use = "FIDL methods require a response to be sent"]
588#[derive(Debug)]
589pub struct GetIteratorGetNextResponder {
590 control_handle: std::mem::ManuallyDrop<GetIteratorControlHandle>,
591 tx_id: u32,
592}
593
594impl std::ops::Drop for GetIteratorGetNextResponder {
598 fn drop(&mut self) {
599 self.control_handle.shutdown();
600 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
602 }
603}
604
605impl fidl::endpoints::Responder for GetIteratorGetNextResponder {
606 type ControlHandle = GetIteratorControlHandle;
607
608 fn control_handle(&self) -> &GetIteratorControlHandle {
609 &self.control_handle
610 }
611
612 fn drop_without_shutdown(mut self) {
613 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
615 std::mem::forget(self);
617 }
618}
619
620impl GetIteratorGetNextResponder {
621 pub fn send(self, mut kvs: Vec<KeyValue>) -> Result<(), fidl::Error> {
625 let _result = self.send_raw(kvs);
626 if _result.is_err() {
627 self.control_handle.shutdown();
628 }
629 self.drop_without_shutdown();
630 _result
631 }
632
633 pub fn send_no_shutdown_on_err(self, mut kvs: Vec<KeyValue>) -> Result<(), fidl::Error> {
635 let _result = self.send_raw(kvs);
636 self.drop_without_shutdown();
637 _result
638 }
639
640 fn send_raw(&self, mut kvs: Vec<KeyValue>) -> Result<(), fidl::Error> {
641 self.control_handle.inner.send::<GetIteratorGetNextResponse>(
642 (kvs.as_mut(),),
643 self.tx_id,
644 0xe0a5a8ea5dbfbf5,
645 fidl::encoding::DynamicFlags::empty(),
646 )
647 }
648}
649
650#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
651pub struct ListIteratorMarker;
652
653impl fidl::endpoints::ProtocolMarker for ListIteratorMarker {
654 type Proxy = ListIteratorProxy;
655 type RequestStream = ListIteratorRequestStream;
656 #[cfg(target_os = "fuchsia")]
657 type SynchronousProxy = ListIteratorSynchronousProxy;
658
659 const DEBUG_NAME: &'static str = "(anonymous) ListIterator";
660}
661
662pub trait ListIteratorProxyInterface: Send + Sync {
663 type GetNextResponseFut: std::future::Future<Output = Result<Vec<ListItem>, fidl::Error>> + Send;
664 fn r#get_next(&self) -> Self::GetNextResponseFut;
665}
666#[derive(Debug)]
667#[cfg(target_os = "fuchsia")]
668pub struct ListIteratorSynchronousProxy {
669 client: fidl::client::sync::Client,
670}
671
672#[cfg(target_os = "fuchsia")]
673impl fidl::endpoints::SynchronousProxy for ListIteratorSynchronousProxy {
674 type Proxy = ListIteratorProxy;
675 type Protocol = ListIteratorMarker;
676
677 fn from_channel(inner: fidl::Channel) -> Self {
678 Self::new(inner)
679 }
680
681 fn into_channel(self) -> fidl::Channel {
682 self.client.into_channel()
683 }
684
685 fn as_channel(&self) -> &fidl::Channel {
686 self.client.as_channel()
687 }
688}
689
690#[cfg(target_os = "fuchsia")]
691impl ListIteratorSynchronousProxy {
692 pub fn new(channel: fidl::Channel) -> Self {
693 let protocol_name = <ListIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
694 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
695 }
696
697 pub fn into_channel(self) -> fidl::Channel {
698 self.client.into_channel()
699 }
700
701 pub fn wait_for_event(
704 &self,
705 deadline: zx::MonotonicInstant,
706 ) -> Result<ListIteratorEvent, fidl::Error> {
707 ListIteratorEvent::decode(self.client.wait_for_event(deadline)?)
708 }
709
710 pub fn r#get_next(
711 &self,
712 ___deadline: zx::MonotonicInstant,
713 ) -> Result<Vec<ListItem>, fidl::Error> {
714 let _response =
715 self.client.send_query::<fidl::encoding::EmptyPayload, ListIteratorGetNextResponse>(
716 (),
717 0x6d8646b717dd56a2,
718 fidl::encoding::DynamicFlags::empty(),
719 ___deadline,
720 )?;
721 Ok(_response.keys)
722 }
723}
724
725#[derive(Debug, Clone)]
726pub struct ListIteratorProxy {
727 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
728}
729
730impl fidl::endpoints::Proxy for ListIteratorProxy {
731 type Protocol = ListIteratorMarker;
732
733 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
734 Self::new(inner)
735 }
736
737 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
738 self.client.into_channel().map_err(|client| Self { client })
739 }
740
741 fn as_channel(&self) -> &::fidl::AsyncChannel {
742 self.client.as_channel()
743 }
744}
745
746impl ListIteratorProxy {
747 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
749 let protocol_name = <ListIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
750 Self { client: fidl::client::Client::new(channel, protocol_name) }
751 }
752
753 pub fn take_event_stream(&self) -> ListIteratorEventStream {
759 ListIteratorEventStream { event_receiver: self.client.take_event_receiver() }
760 }
761
762 pub fn r#get_next(
763 &self,
764 ) -> fidl::client::QueryResponseFut<Vec<ListItem>, fidl::encoding::DefaultFuchsiaResourceDialect>
765 {
766 ListIteratorProxyInterface::r#get_next(self)
767 }
768}
769
770impl ListIteratorProxyInterface for ListIteratorProxy {
771 type GetNextResponseFut = fidl::client::QueryResponseFut<
772 Vec<ListItem>,
773 fidl::encoding::DefaultFuchsiaResourceDialect,
774 >;
775 fn r#get_next(&self) -> Self::GetNextResponseFut {
776 fn _decode(
777 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
778 ) -> Result<Vec<ListItem>, fidl::Error> {
779 let _response = fidl::client::decode_transaction_body::<
780 ListIteratorGetNextResponse,
781 fidl::encoding::DefaultFuchsiaResourceDialect,
782 0x6d8646b717dd56a2,
783 >(_buf?)?;
784 Ok(_response.keys)
785 }
786 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<ListItem>>(
787 (),
788 0x6d8646b717dd56a2,
789 fidl::encoding::DynamicFlags::empty(),
790 _decode,
791 )
792 }
793}
794
795pub struct ListIteratorEventStream {
796 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
797}
798
799impl std::marker::Unpin for ListIteratorEventStream {}
800
801impl futures::stream::FusedStream for ListIteratorEventStream {
802 fn is_terminated(&self) -> bool {
803 self.event_receiver.is_terminated()
804 }
805}
806
807impl futures::Stream for ListIteratorEventStream {
808 type Item = Result<ListIteratorEvent, fidl::Error>;
809
810 fn poll_next(
811 mut self: std::pin::Pin<&mut Self>,
812 cx: &mut std::task::Context<'_>,
813 ) -> std::task::Poll<Option<Self::Item>> {
814 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
815 &mut self.event_receiver,
816 cx
817 )?) {
818 Some(buf) => std::task::Poll::Ready(Some(ListIteratorEvent::decode(buf))),
819 None => std::task::Poll::Ready(None),
820 }
821 }
822}
823
824#[derive(Debug)]
825pub enum ListIteratorEvent {}
826
827impl ListIteratorEvent {
828 fn decode(
830 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
831 ) -> Result<ListIteratorEvent, fidl::Error> {
832 let (bytes, _handles) = buf.split_mut();
833 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
834 debug_assert_eq!(tx_header.tx_id, 0);
835 match tx_header.ordinal {
836 _ => Err(fidl::Error::UnknownOrdinal {
837 ordinal: tx_header.ordinal,
838 protocol_name: <ListIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
839 }),
840 }
841 }
842}
843
844pub struct ListIteratorRequestStream {
846 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
847 is_terminated: bool,
848}
849
850impl std::marker::Unpin for ListIteratorRequestStream {}
851
852impl futures::stream::FusedStream for ListIteratorRequestStream {
853 fn is_terminated(&self) -> bool {
854 self.is_terminated
855 }
856}
857
858impl fidl::endpoints::RequestStream for ListIteratorRequestStream {
859 type Protocol = ListIteratorMarker;
860 type ControlHandle = ListIteratorControlHandle;
861
862 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
863 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
864 }
865
866 fn control_handle(&self) -> Self::ControlHandle {
867 ListIteratorControlHandle { inner: self.inner.clone() }
868 }
869
870 fn into_inner(
871 self,
872 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
873 {
874 (self.inner, self.is_terminated)
875 }
876
877 fn from_inner(
878 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
879 is_terminated: bool,
880 ) -> Self {
881 Self { inner, is_terminated }
882 }
883}
884
885impl futures::Stream for ListIteratorRequestStream {
886 type Item = Result<ListIteratorRequest, 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 let this = &mut *self;
893 if this.inner.check_shutdown(cx) {
894 this.is_terminated = true;
895 return std::task::Poll::Ready(None);
896 }
897 if this.is_terminated {
898 panic!("polled ListIteratorRequestStream after completion");
899 }
900 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
901 |bytes, handles| {
902 match this.inner.channel().read_etc(cx, bytes, handles) {
903 std::task::Poll::Ready(Ok(())) => {}
904 std::task::Poll::Pending => return std::task::Poll::Pending,
905 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
906 this.is_terminated = true;
907 return std::task::Poll::Ready(None);
908 }
909 std::task::Poll::Ready(Err(e)) => {
910 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
911 e.into(),
912 ))))
913 }
914 }
915
916 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
918
919 std::task::Poll::Ready(Some(match header.ordinal {
920 0x6d8646b717dd56a2 => {
921 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
922 let mut req = fidl::new_empty!(
923 fidl::encoding::EmptyPayload,
924 fidl::encoding::DefaultFuchsiaResourceDialect
925 );
926 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
927 let control_handle =
928 ListIteratorControlHandle { inner: this.inner.clone() };
929 Ok(ListIteratorRequest::GetNext {
930 responder: ListIteratorGetNextResponder {
931 control_handle: std::mem::ManuallyDrop::new(control_handle),
932 tx_id: header.tx_id,
933 },
934 })
935 }
936 _ => Err(fidl::Error::UnknownOrdinal {
937 ordinal: header.ordinal,
938 protocol_name:
939 <ListIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
940 }),
941 }))
942 },
943 )
944 }
945}
946
947#[derive(Debug)]
950pub enum ListIteratorRequest {
951 GetNext { responder: ListIteratorGetNextResponder },
952}
953
954impl ListIteratorRequest {
955 #[allow(irrefutable_let_patterns)]
956 pub fn into_get_next(self) -> Option<(ListIteratorGetNextResponder)> {
957 if let ListIteratorRequest::GetNext { responder } = self {
958 Some((responder))
959 } else {
960 None
961 }
962 }
963
964 pub fn method_name(&self) -> &'static str {
966 match *self {
967 ListIteratorRequest::GetNext { .. } => "get_next",
968 }
969 }
970}
971
972#[derive(Debug, Clone)]
973pub struct ListIteratorControlHandle {
974 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
975}
976
977impl fidl::endpoints::ControlHandle for ListIteratorControlHandle {
978 fn shutdown(&self) {
979 self.inner.shutdown()
980 }
981 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
982 self.inner.shutdown_with_epitaph(status)
983 }
984
985 fn is_closed(&self) -> bool {
986 self.inner.channel().is_closed()
987 }
988 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
989 self.inner.channel().on_closed()
990 }
991
992 #[cfg(target_os = "fuchsia")]
993 fn signal_peer(
994 &self,
995 clear_mask: zx::Signals,
996 set_mask: zx::Signals,
997 ) -> Result<(), zx_status::Status> {
998 use fidl::Peered;
999 self.inner.channel().signal_peer(clear_mask, set_mask)
1000 }
1001}
1002
1003impl ListIteratorControlHandle {}
1004
1005#[must_use = "FIDL methods require a response to be sent"]
1006#[derive(Debug)]
1007pub struct ListIteratorGetNextResponder {
1008 control_handle: std::mem::ManuallyDrop<ListIteratorControlHandle>,
1009 tx_id: u32,
1010}
1011
1012impl std::ops::Drop for ListIteratorGetNextResponder {
1016 fn drop(&mut self) {
1017 self.control_handle.shutdown();
1018 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1020 }
1021}
1022
1023impl fidl::endpoints::Responder for ListIteratorGetNextResponder {
1024 type ControlHandle = ListIteratorControlHandle;
1025
1026 fn control_handle(&self) -> &ListIteratorControlHandle {
1027 &self.control_handle
1028 }
1029
1030 fn drop_without_shutdown(mut self) {
1031 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1033 std::mem::forget(self);
1035 }
1036}
1037
1038impl ListIteratorGetNextResponder {
1039 pub fn send(self, mut keys: &[ListItem]) -> Result<(), fidl::Error> {
1043 let _result = self.send_raw(keys);
1044 if _result.is_err() {
1045 self.control_handle.shutdown();
1046 }
1047 self.drop_without_shutdown();
1048 _result
1049 }
1050
1051 pub fn send_no_shutdown_on_err(self, mut keys: &[ListItem]) -> Result<(), fidl::Error> {
1053 let _result = self.send_raw(keys);
1054 self.drop_without_shutdown();
1055 _result
1056 }
1057
1058 fn send_raw(&self, mut keys: &[ListItem]) -> Result<(), fidl::Error> {
1059 self.control_handle.inner.send::<ListIteratorGetNextResponse>(
1060 (keys,),
1061 self.tx_id,
1062 0x6d8646b717dd56a2,
1063 fidl::encoding::DynamicFlags::empty(),
1064 )
1065 }
1066}
1067
1068#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1069pub struct SecureStoreMarker;
1070
1071impl fidl::endpoints::ProtocolMarker for SecureStoreMarker {
1072 type Proxy = SecureStoreProxy;
1073 type RequestStream = SecureStoreRequestStream;
1074 #[cfg(target_os = "fuchsia")]
1075 type SynchronousProxy = SecureStoreSynchronousProxy;
1076
1077 const DEBUG_NAME: &'static str = "fuchsia.stash.SecureStore";
1078}
1079impl fidl::endpoints::DiscoverableProtocolMarker for SecureStoreMarker {}
1080
1081pub trait SecureStoreProxyInterface: Send + Sync {
1082 fn r#identify(&self, name: &str) -> Result<(), fidl::Error>;
1083 fn r#create_accessor(
1084 &self,
1085 read_only: bool,
1086 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1087 ) -> Result<(), fidl::Error>;
1088}
1089#[derive(Debug)]
1090#[cfg(target_os = "fuchsia")]
1091pub struct SecureStoreSynchronousProxy {
1092 client: fidl::client::sync::Client,
1093}
1094
1095#[cfg(target_os = "fuchsia")]
1096impl fidl::endpoints::SynchronousProxy for SecureStoreSynchronousProxy {
1097 type Proxy = SecureStoreProxy;
1098 type Protocol = SecureStoreMarker;
1099
1100 fn from_channel(inner: fidl::Channel) -> Self {
1101 Self::new(inner)
1102 }
1103
1104 fn into_channel(self) -> fidl::Channel {
1105 self.client.into_channel()
1106 }
1107
1108 fn as_channel(&self) -> &fidl::Channel {
1109 self.client.as_channel()
1110 }
1111}
1112
1113#[cfg(target_os = "fuchsia")]
1114impl SecureStoreSynchronousProxy {
1115 pub fn new(channel: fidl::Channel) -> Self {
1116 let protocol_name = <SecureStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1117 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1118 }
1119
1120 pub fn into_channel(self) -> fidl::Channel {
1121 self.client.into_channel()
1122 }
1123
1124 pub fn wait_for_event(
1127 &self,
1128 deadline: zx::MonotonicInstant,
1129 ) -> Result<SecureStoreEvent, fidl::Error> {
1130 SecureStoreEvent::decode(self.client.wait_for_event(deadline)?)
1131 }
1132
1133 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1138 self.client.send::<StoreIdentifyRequest>(
1139 (name,),
1140 0x4327d0764bed131b,
1141 fidl::encoding::DynamicFlags::empty(),
1142 )
1143 }
1144
1145 pub fn r#create_accessor(
1148 &self,
1149 mut read_only: bool,
1150 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1151 ) -> Result<(), fidl::Error> {
1152 self.client.send::<StoreCreateAccessorRequest>(
1153 (read_only, accessor_request),
1154 0x5aaed3604b3bcfbb,
1155 fidl::encoding::DynamicFlags::empty(),
1156 )
1157 }
1158}
1159
1160#[derive(Debug, Clone)]
1161pub struct SecureStoreProxy {
1162 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1163}
1164
1165impl fidl::endpoints::Proxy for SecureStoreProxy {
1166 type Protocol = SecureStoreMarker;
1167
1168 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1169 Self::new(inner)
1170 }
1171
1172 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1173 self.client.into_channel().map_err(|client| Self { client })
1174 }
1175
1176 fn as_channel(&self) -> &::fidl::AsyncChannel {
1177 self.client.as_channel()
1178 }
1179}
1180
1181impl SecureStoreProxy {
1182 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1184 let protocol_name = <SecureStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1185 Self { client: fidl::client::Client::new(channel, protocol_name) }
1186 }
1187
1188 pub fn take_event_stream(&self) -> SecureStoreEventStream {
1194 SecureStoreEventStream { event_receiver: self.client.take_event_receiver() }
1195 }
1196
1197 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1202 SecureStoreProxyInterface::r#identify(self, name)
1203 }
1204
1205 pub fn r#create_accessor(
1208 &self,
1209 mut read_only: bool,
1210 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1211 ) -> Result<(), fidl::Error> {
1212 SecureStoreProxyInterface::r#create_accessor(self, read_only, accessor_request)
1213 }
1214}
1215
1216impl SecureStoreProxyInterface for SecureStoreProxy {
1217 fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1218 self.client.send::<StoreIdentifyRequest>(
1219 (name,),
1220 0x4327d0764bed131b,
1221 fidl::encoding::DynamicFlags::empty(),
1222 )
1223 }
1224
1225 fn r#create_accessor(
1226 &self,
1227 mut read_only: bool,
1228 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1229 ) -> Result<(), fidl::Error> {
1230 self.client.send::<StoreCreateAccessorRequest>(
1231 (read_only, accessor_request),
1232 0x5aaed3604b3bcfbb,
1233 fidl::encoding::DynamicFlags::empty(),
1234 )
1235 }
1236}
1237
1238pub struct SecureStoreEventStream {
1239 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1240}
1241
1242impl std::marker::Unpin for SecureStoreEventStream {}
1243
1244impl futures::stream::FusedStream for SecureStoreEventStream {
1245 fn is_terminated(&self) -> bool {
1246 self.event_receiver.is_terminated()
1247 }
1248}
1249
1250impl futures::Stream for SecureStoreEventStream {
1251 type Item = Result<SecureStoreEvent, fidl::Error>;
1252
1253 fn poll_next(
1254 mut self: std::pin::Pin<&mut Self>,
1255 cx: &mut std::task::Context<'_>,
1256 ) -> std::task::Poll<Option<Self::Item>> {
1257 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1258 &mut self.event_receiver,
1259 cx
1260 )?) {
1261 Some(buf) => std::task::Poll::Ready(Some(SecureStoreEvent::decode(buf))),
1262 None => std::task::Poll::Ready(None),
1263 }
1264 }
1265}
1266
1267#[derive(Debug)]
1268pub enum SecureStoreEvent {}
1269
1270impl SecureStoreEvent {
1271 fn decode(
1273 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1274 ) -> Result<SecureStoreEvent, fidl::Error> {
1275 let (bytes, _handles) = buf.split_mut();
1276 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1277 debug_assert_eq!(tx_header.tx_id, 0);
1278 match tx_header.ordinal {
1279 _ => Err(fidl::Error::UnknownOrdinal {
1280 ordinal: tx_header.ordinal,
1281 protocol_name: <SecureStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1282 }),
1283 }
1284 }
1285}
1286
1287pub struct SecureStoreRequestStream {
1289 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1290 is_terminated: bool,
1291}
1292
1293impl std::marker::Unpin for SecureStoreRequestStream {}
1294
1295impl futures::stream::FusedStream for SecureStoreRequestStream {
1296 fn is_terminated(&self) -> bool {
1297 self.is_terminated
1298 }
1299}
1300
1301impl fidl::endpoints::RequestStream for SecureStoreRequestStream {
1302 type Protocol = SecureStoreMarker;
1303 type ControlHandle = SecureStoreControlHandle;
1304
1305 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1306 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1307 }
1308
1309 fn control_handle(&self) -> Self::ControlHandle {
1310 SecureStoreControlHandle { inner: self.inner.clone() }
1311 }
1312
1313 fn into_inner(
1314 self,
1315 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1316 {
1317 (self.inner, self.is_terminated)
1318 }
1319
1320 fn from_inner(
1321 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1322 is_terminated: bool,
1323 ) -> Self {
1324 Self { inner, is_terminated }
1325 }
1326}
1327
1328impl futures::Stream for SecureStoreRequestStream {
1329 type Item = Result<SecureStoreRequest, fidl::Error>;
1330
1331 fn poll_next(
1332 mut self: std::pin::Pin<&mut Self>,
1333 cx: &mut std::task::Context<'_>,
1334 ) -> std::task::Poll<Option<Self::Item>> {
1335 let this = &mut *self;
1336 if this.inner.check_shutdown(cx) {
1337 this.is_terminated = true;
1338 return std::task::Poll::Ready(None);
1339 }
1340 if this.is_terminated {
1341 panic!("polled SecureStoreRequestStream after completion");
1342 }
1343 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1344 |bytes, handles| {
1345 match this.inner.channel().read_etc(cx, bytes, handles) {
1346 std::task::Poll::Ready(Ok(())) => {}
1347 std::task::Poll::Pending => return std::task::Poll::Pending,
1348 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1349 this.is_terminated = true;
1350 return std::task::Poll::Ready(None);
1351 }
1352 std::task::Poll::Ready(Err(e)) => {
1353 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1354 e.into(),
1355 ))))
1356 }
1357 }
1358
1359 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1361
1362 std::task::Poll::Ready(Some(match header.ordinal {
1363 0x4327d0764bed131b => {
1364 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1365 let mut req = fidl::new_empty!(
1366 StoreIdentifyRequest,
1367 fidl::encoding::DefaultFuchsiaResourceDialect
1368 );
1369 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreIdentifyRequest>(&header, _body_bytes, handles, &mut req)?;
1370 let control_handle = SecureStoreControlHandle { inner: this.inner.clone() };
1371 Ok(SecureStoreRequest::Identify { name: req.name, control_handle })
1372 }
1373 0x5aaed3604b3bcfbb => {
1374 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1375 let mut req = fidl::new_empty!(
1376 StoreCreateAccessorRequest,
1377 fidl::encoding::DefaultFuchsiaResourceDialect
1378 );
1379 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreCreateAccessorRequest>(&header, _body_bytes, handles, &mut req)?;
1380 let control_handle = SecureStoreControlHandle { inner: this.inner.clone() };
1381 Ok(SecureStoreRequest::CreateAccessor {
1382 read_only: req.read_only,
1383 accessor_request: req.accessor_request,
1384
1385 control_handle,
1386 })
1387 }
1388 _ => Err(fidl::Error::UnknownOrdinal {
1389 ordinal: header.ordinal,
1390 protocol_name:
1391 <SecureStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1392 }),
1393 }))
1394 },
1395 )
1396 }
1397}
1398
1399#[derive(Debug)]
1402pub enum SecureStoreRequest {
1403 Identify { name: String, control_handle: SecureStoreControlHandle },
1408 CreateAccessor {
1411 read_only: bool,
1412 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1413 control_handle: SecureStoreControlHandle,
1414 },
1415}
1416
1417impl SecureStoreRequest {
1418 #[allow(irrefutable_let_patterns)]
1419 pub fn into_identify(self) -> Option<(String, SecureStoreControlHandle)> {
1420 if let SecureStoreRequest::Identify { name, control_handle } = self {
1421 Some((name, control_handle))
1422 } else {
1423 None
1424 }
1425 }
1426
1427 #[allow(irrefutable_let_patterns)]
1428 pub fn into_create_accessor(
1429 self,
1430 ) -> Option<(bool, fidl::endpoints::ServerEnd<StoreAccessorMarker>, SecureStoreControlHandle)>
1431 {
1432 if let SecureStoreRequest::CreateAccessor { read_only, accessor_request, control_handle } =
1433 self
1434 {
1435 Some((read_only, accessor_request, control_handle))
1436 } else {
1437 None
1438 }
1439 }
1440
1441 pub fn method_name(&self) -> &'static str {
1443 match *self {
1444 SecureStoreRequest::Identify { .. } => "identify",
1445 SecureStoreRequest::CreateAccessor { .. } => "create_accessor",
1446 }
1447 }
1448}
1449
1450#[derive(Debug, Clone)]
1451pub struct SecureStoreControlHandle {
1452 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1453}
1454
1455impl fidl::endpoints::ControlHandle for SecureStoreControlHandle {
1456 fn shutdown(&self) {
1457 self.inner.shutdown()
1458 }
1459 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1460 self.inner.shutdown_with_epitaph(status)
1461 }
1462
1463 fn is_closed(&self) -> bool {
1464 self.inner.channel().is_closed()
1465 }
1466 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1467 self.inner.channel().on_closed()
1468 }
1469
1470 #[cfg(target_os = "fuchsia")]
1471 fn signal_peer(
1472 &self,
1473 clear_mask: zx::Signals,
1474 set_mask: zx::Signals,
1475 ) -> Result<(), zx_status::Status> {
1476 use fidl::Peered;
1477 self.inner.channel().signal_peer(clear_mask, set_mask)
1478 }
1479}
1480
1481impl SecureStoreControlHandle {}
1482
1483#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1484pub struct StoreMarker;
1485
1486impl fidl::endpoints::ProtocolMarker for StoreMarker {
1487 type Proxy = StoreProxy;
1488 type RequestStream = StoreRequestStream;
1489 #[cfg(target_os = "fuchsia")]
1490 type SynchronousProxy = StoreSynchronousProxy;
1491
1492 const DEBUG_NAME: &'static str = "fuchsia.stash.Store";
1493}
1494impl fidl::endpoints::DiscoverableProtocolMarker for StoreMarker {}
1495
1496pub trait StoreProxyInterface: Send + Sync {
1497 fn r#identify(&self, name: &str) -> Result<(), fidl::Error>;
1498 fn r#create_accessor(
1499 &self,
1500 read_only: bool,
1501 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1502 ) -> Result<(), fidl::Error>;
1503}
1504#[derive(Debug)]
1505#[cfg(target_os = "fuchsia")]
1506pub struct StoreSynchronousProxy {
1507 client: fidl::client::sync::Client,
1508}
1509
1510#[cfg(target_os = "fuchsia")]
1511impl fidl::endpoints::SynchronousProxy for StoreSynchronousProxy {
1512 type Proxy = StoreProxy;
1513 type Protocol = StoreMarker;
1514
1515 fn from_channel(inner: fidl::Channel) -> Self {
1516 Self::new(inner)
1517 }
1518
1519 fn into_channel(self) -> fidl::Channel {
1520 self.client.into_channel()
1521 }
1522
1523 fn as_channel(&self) -> &fidl::Channel {
1524 self.client.as_channel()
1525 }
1526}
1527
1528#[cfg(target_os = "fuchsia")]
1529impl StoreSynchronousProxy {
1530 pub fn new(channel: fidl::Channel) -> Self {
1531 let protocol_name = <StoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1532 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1533 }
1534
1535 pub fn into_channel(self) -> fidl::Channel {
1536 self.client.into_channel()
1537 }
1538
1539 pub fn wait_for_event(
1542 &self,
1543 deadline: zx::MonotonicInstant,
1544 ) -> Result<StoreEvent, fidl::Error> {
1545 StoreEvent::decode(self.client.wait_for_event(deadline)?)
1546 }
1547
1548 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1553 self.client.send::<StoreIdentifyRequest>(
1554 (name,),
1555 0x4327d0764bed131b,
1556 fidl::encoding::DynamicFlags::empty(),
1557 )
1558 }
1559
1560 pub fn r#create_accessor(
1563 &self,
1564 mut read_only: bool,
1565 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1566 ) -> Result<(), fidl::Error> {
1567 self.client.send::<StoreCreateAccessorRequest>(
1568 (read_only, accessor_request),
1569 0x5aaed3604b3bcfbb,
1570 fidl::encoding::DynamicFlags::empty(),
1571 )
1572 }
1573}
1574
1575#[derive(Debug, Clone)]
1576pub struct StoreProxy {
1577 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1578}
1579
1580impl fidl::endpoints::Proxy for StoreProxy {
1581 type Protocol = StoreMarker;
1582
1583 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1584 Self::new(inner)
1585 }
1586
1587 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1588 self.client.into_channel().map_err(|client| Self { client })
1589 }
1590
1591 fn as_channel(&self) -> &::fidl::AsyncChannel {
1592 self.client.as_channel()
1593 }
1594}
1595
1596impl StoreProxy {
1597 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1599 let protocol_name = <StoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1600 Self { client: fidl::client::Client::new(channel, protocol_name) }
1601 }
1602
1603 pub fn take_event_stream(&self) -> StoreEventStream {
1609 StoreEventStream { event_receiver: self.client.take_event_receiver() }
1610 }
1611
1612 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1617 StoreProxyInterface::r#identify(self, name)
1618 }
1619
1620 pub fn r#create_accessor(
1623 &self,
1624 mut read_only: bool,
1625 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1626 ) -> Result<(), fidl::Error> {
1627 StoreProxyInterface::r#create_accessor(self, read_only, accessor_request)
1628 }
1629}
1630
1631impl StoreProxyInterface for StoreProxy {
1632 fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1633 self.client.send::<StoreIdentifyRequest>(
1634 (name,),
1635 0x4327d0764bed131b,
1636 fidl::encoding::DynamicFlags::empty(),
1637 )
1638 }
1639
1640 fn r#create_accessor(
1641 &self,
1642 mut read_only: bool,
1643 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1644 ) -> Result<(), fidl::Error> {
1645 self.client.send::<StoreCreateAccessorRequest>(
1646 (read_only, accessor_request),
1647 0x5aaed3604b3bcfbb,
1648 fidl::encoding::DynamicFlags::empty(),
1649 )
1650 }
1651}
1652
1653pub struct StoreEventStream {
1654 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1655}
1656
1657impl std::marker::Unpin for StoreEventStream {}
1658
1659impl futures::stream::FusedStream for StoreEventStream {
1660 fn is_terminated(&self) -> bool {
1661 self.event_receiver.is_terminated()
1662 }
1663}
1664
1665impl futures::Stream for StoreEventStream {
1666 type Item = Result<StoreEvent, fidl::Error>;
1667
1668 fn poll_next(
1669 mut self: std::pin::Pin<&mut Self>,
1670 cx: &mut std::task::Context<'_>,
1671 ) -> std::task::Poll<Option<Self::Item>> {
1672 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1673 &mut self.event_receiver,
1674 cx
1675 )?) {
1676 Some(buf) => std::task::Poll::Ready(Some(StoreEvent::decode(buf))),
1677 None => std::task::Poll::Ready(None),
1678 }
1679 }
1680}
1681
1682#[derive(Debug)]
1683pub enum StoreEvent {}
1684
1685impl StoreEvent {
1686 fn decode(
1688 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1689 ) -> Result<StoreEvent, fidl::Error> {
1690 let (bytes, _handles) = buf.split_mut();
1691 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1692 debug_assert_eq!(tx_header.tx_id, 0);
1693 match tx_header.ordinal {
1694 _ => Err(fidl::Error::UnknownOrdinal {
1695 ordinal: tx_header.ordinal,
1696 protocol_name: <StoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1697 }),
1698 }
1699 }
1700}
1701
1702pub struct StoreRequestStream {
1704 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1705 is_terminated: bool,
1706}
1707
1708impl std::marker::Unpin for StoreRequestStream {}
1709
1710impl futures::stream::FusedStream for StoreRequestStream {
1711 fn is_terminated(&self) -> bool {
1712 self.is_terminated
1713 }
1714}
1715
1716impl fidl::endpoints::RequestStream for StoreRequestStream {
1717 type Protocol = StoreMarker;
1718 type ControlHandle = StoreControlHandle;
1719
1720 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1721 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1722 }
1723
1724 fn control_handle(&self) -> Self::ControlHandle {
1725 StoreControlHandle { inner: self.inner.clone() }
1726 }
1727
1728 fn into_inner(
1729 self,
1730 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1731 {
1732 (self.inner, self.is_terminated)
1733 }
1734
1735 fn from_inner(
1736 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1737 is_terminated: bool,
1738 ) -> Self {
1739 Self { inner, is_terminated }
1740 }
1741}
1742
1743impl futures::Stream for StoreRequestStream {
1744 type Item = Result<StoreRequest, fidl::Error>;
1745
1746 fn poll_next(
1747 mut self: std::pin::Pin<&mut Self>,
1748 cx: &mut std::task::Context<'_>,
1749 ) -> std::task::Poll<Option<Self::Item>> {
1750 let this = &mut *self;
1751 if this.inner.check_shutdown(cx) {
1752 this.is_terminated = true;
1753 return std::task::Poll::Ready(None);
1754 }
1755 if this.is_terminated {
1756 panic!("polled StoreRequestStream after completion");
1757 }
1758 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1759 |bytes, handles| {
1760 match this.inner.channel().read_etc(cx, bytes, handles) {
1761 std::task::Poll::Ready(Ok(())) => {}
1762 std::task::Poll::Pending => return std::task::Poll::Pending,
1763 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1764 this.is_terminated = true;
1765 return std::task::Poll::Ready(None);
1766 }
1767 std::task::Poll::Ready(Err(e)) => {
1768 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1769 e.into(),
1770 ))))
1771 }
1772 }
1773
1774 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1776
1777 std::task::Poll::Ready(Some(match header.ordinal {
1778 0x4327d0764bed131b => {
1779 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1780 let mut req = fidl::new_empty!(
1781 StoreIdentifyRequest,
1782 fidl::encoding::DefaultFuchsiaResourceDialect
1783 );
1784 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreIdentifyRequest>(&header, _body_bytes, handles, &mut req)?;
1785 let control_handle = StoreControlHandle { inner: this.inner.clone() };
1786 Ok(StoreRequest::Identify { name: req.name, control_handle })
1787 }
1788 0x5aaed3604b3bcfbb => {
1789 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1790 let mut req = fidl::new_empty!(
1791 StoreCreateAccessorRequest,
1792 fidl::encoding::DefaultFuchsiaResourceDialect
1793 );
1794 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreCreateAccessorRequest>(&header, _body_bytes, handles, &mut req)?;
1795 let control_handle = StoreControlHandle { inner: this.inner.clone() };
1796 Ok(StoreRequest::CreateAccessor {
1797 read_only: req.read_only,
1798 accessor_request: req.accessor_request,
1799
1800 control_handle,
1801 })
1802 }
1803 _ => Err(fidl::Error::UnknownOrdinal {
1804 ordinal: header.ordinal,
1805 protocol_name: <StoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1806 }),
1807 }))
1808 },
1809 )
1810 }
1811}
1812
1813#[derive(Debug)]
1815pub enum StoreRequest {
1816 Identify { name: String, control_handle: StoreControlHandle },
1821 CreateAccessor {
1824 read_only: bool,
1825 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1826 control_handle: StoreControlHandle,
1827 },
1828}
1829
1830impl StoreRequest {
1831 #[allow(irrefutable_let_patterns)]
1832 pub fn into_identify(self) -> Option<(String, StoreControlHandle)> {
1833 if let StoreRequest::Identify { name, control_handle } = self {
1834 Some((name, control_handle))
1835 } else {
1836 None
1837 }
1838 }
1839
1840 #[allow(irrefutable_let_patterns)]
1841 pub fn into_create_accessor(
1842 self,
1843 ) -> Option<(bool, fidl::endpoints::ServerEnd<StoreAccessorMarker>, StoreControlHandle)> {
1844 if let StoreRequest::CreateAccessor { read_only, accessor_request, control_handle } = self {
1845 Some((read_only, accessor_request, control_handle))
1846 } else {
1847 None
1848 }
1849 }
1850
1851 pub fn method_name(&self) -> &'static str {
1853 match *self {
1854 StoreRequest::Identify { .. } => "identify",
1855 StoreRequest::CreateAccessor { .. } => "create_accessor",
1856 }
1857 }
1858}
1859
1860#[derive(Debug, Clone)]
1861pub struct StoreControlHandle {
1862 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1863}
1864
1865impl fidl::endpoints::ControlHandle for StoreControlHandle {
1866 fn shutdown(&self) {
1867 self.inner.shutdown()
1868 }
1869 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1870 self.inner.shutdown_with_epitaph(status)
1871 }
1872
1873 fn is_closed(&self) -> bool {
1874 self.inner.channel().is_closed()
1875 }
1876 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1877 self.inner.channel().on_closed()
1878 }
1879
1880 #[cfg(target_os = "fuchsia")]
1881 fn signal_peer(
1882 &self,
1883 clear_mask: zx::Signals,
1884 set_mask: zx::Signals,
1885 ) -> Result<(), zx_status::Status> {
1886 use fidl::Peered;
1887 self.inner.channel().signal_peer(clear_mask, set_mask)
1888 }
1889}
1890
1891impl StoreControlHandle {}
1892
1893#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1894pub struct Store2Marker;
1895
1896impl fidl::endpoints::ProtocolMarker for Store2Marker {
1897 type Proxy = Store2Proxy;
1898 type RequestStream = Store2RequestStream;
1899 #[cfg(target_os = "fuchsia")]
1900 type SynchronousProxy = Store2SynchronousProxy;
1901
1902 const DEBUG_NAME: &'static str = "fuchsia.stash.Store2";
1903}
1904impl fidl::endpoints::DiscoverableProtocolMarker for Store2Marker {}
1905
1906pub trait Store2ProxyInterface: Send + Sync {
1907 fn r#identify(&self, name: &str) -> Result<(), fidl::Error>;
1908 fn r#create_accessor(
1909 &self,
1910 read_only: bool,
1911 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1912 ) -> Result<(), fidl::Error>;
1913}
1914#[derive(Debug)]
1915#[cfg(target_os = "fuchsia")]
1916pub struct Store2SynchronousProxy {
1917 client: fidl::client::sync::Client,
1918}
1919
1920#[cfg(target_os = "fuchsia")]
1921impl fidl::endpoints::SynchronousProxy for Store2SynchronousProxy {
1922 type Proxy = Store2Proxy;
1923 type Protocol = Store2Marker;
1924
1925 fn from_channel(inner: fidl::Channel) -> Self {
1926 Self::new(inner)
1927 }
1928
1929 fn into_channel(self) -> fidl::Channel {
1930 self.client.into_channel()
1931 }
1932
1933 fn as_channel(&self) -> &fidl::Channel {
1934 self.client.as_channel()
1935 }
1936}
1937
1938#[cfg(target_os = "fuchsia")]
1939impl Store2SynchronousProxy {
1940 pub fn new(channel: fidl::Channel) -> Self {
1941 let protocol_name = <Store2Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1942 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1943 }
1944
1945 pub fn into_channel(self) -> fidl::Channel {
1946 self.client.into_channel()
1947 }
1948
1949 pub fn wait_for_event(
1952 &self,
1953 deadline: zx::MonotonicInstant,
1954 ) -> Result<Store2Event, fidl::Error> {
1955 Store2Event::decode(self.client.wait_for_event(deadline)?)
1956 }
1957
1958 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1963 self.client.send::<StoreIdentifyRequest>(
1964 (name,),
1965 0x4327d0764bed131b,
1966 fidl::encoding::DynamicFlags::empty(),
1967 )
1968 }
1969
1970 pub fn r#create_accessor(
1973 &self,
1974 mut read_only: bool,
1975 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1976 ) -> Result<(), fidl::Error> {
1977 self.client.send::<StoreCreateAccessorRequest>(
1978 (read_only, accessor_request),
1979 0x5aaed3604b3bcfbb,
1980 fidl::encoding::DynamicFlags::empty(),
1981 )
1982 }
1983}
1984
1985#[derive(Debug, Clone)]
1986pub struct Store2Proxy {
1987 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1988}
1989
1990impl fidl::endpoints::Proxy for Store2Proxy {
1991 type Protocol = Store2Marker;
1992
1993 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1994 Self::new(inner)
1995 }
1996
1997 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1998 self.client.into_channel().map_err(|client| Self { client })
1999 }
2000
2001 fn as_channel(&self) -> &::fidl::AsyncChannel {
2002 self.client.as_channel()
2003 }
2004}
2005
2006impl Store2Proxy {
2007 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2009 let protocol_name = <Store2Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2010 Self { client: fidl::client::Client::new(channel, protocol_name) }
2011 }
2012
2013 pub fn take_event_stream(&self) -> Store2EventStream {
2019 Store2EventStream { event_receiver: self.client.take_event_receiver() }
2020 }
2021
2022 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
2027 Store2ProxyInterface::r#identify(self, name)
2028 }
2029
2030 pub fn r#create_accessor(
2033 &self,
2034 mut read_only: bool,
2035 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
2036 ) -> Result<(), fidl::Error> {
2037 Store2ProxyInterface::r#create_accessor(self, read_only, accessor_request)
2038 }
2039}
2040
2041impl Store2ProxyInterface for Store2Proxy {
2042 fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
2043 self.client.send::<StoreIdentifyRequest>(
2044 (name,),
2045 0x4327d0764bed131b,
2046 fidl::encoding::DynamicFlags::empty(),
2047 )
2048 }
2049
2050 fn r#create_accessor(
2051 &self,
2052 mut read_only: bool,
2053 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
2054 ) -> Result<(), fidl::Error> {
2055 self.client.send::<StoreCreateAccessorRequest>(
2056 (read_only, accessor_request),
2057 0x5aaed3604b3bcfbb,
2058 fidl::encoding::DynamicFlags::empty(),
2059 )
2060 }
2061}
2062
2063pub struct Store2EventStream {
2064 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2065}
2066
2067impl std::marker::Unpin for Store2EventStream {}
2068
2069impl futures::stream::FusedStream for Store2EventStream {
2070 fn is_terminated(&self) -> bool {
2071 self.event_receiver.is_terminated()
2072 }
2073}
2074
2075impl futures::Stream for Store2EventStream {
2076 type Item = Result<Store2Event, fidl::Error>;
2077
2078 fn poll_next(
2079 mut self: std::pin::Pin<&mut Self>,
2080 cx: &mut std::task::Context<'_>,
2081 ) -> std::task::Poll<Option<Self::Item>> {
2082 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2083 &mut self.event_receiver,
2084 cx
2085 )?) {
2086 Some(buf) => std::task::Poll::Ready(Some(Store2Event::decode(buf))),
2087 None => std::task::Poll::Ready(None),
2088 }
2089 }
2090}
2091
2092#[derive(Debug)]
2093pub enum Store2Event {}
2094
2095impl Store2Event {
2096 fn decode(
2098 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2099 ) -> Result<Store2Event, fidl::Error> {
2100 let (bytes, _handles) = buf.split_mut();
2101 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2102 debug_assert_eq!(tx_header.tx_id, 0);
2103 match tx_header.ordinal {
2104 _ => Err(fidl::Error::UnknownOrdinal {
2105 ordinal: tx_header.ordinal,
2106 protocol_name: <Store2Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2107 }),
2108 }
2109 }
2110}
2111
2112pub struct Store2RequestStream {
2114 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2115 is_terminated: bool,
2116}
2117
2118impl std::marker::Unpin for Store2RequestStream {}
2119
2120impl futures::stream::FusedStream for Store2RequestStream {
2121 fn is_terminated(&self) -> bool {
2122 self.is_terminated
2123 }
2124}
2125
2126impl fidl::endpoints::RequestStream for Store2RequestStream {
2127 type Protocol = Store2Marker;
2128 type ControlHandle = Store2ControlHandle;
2129
2130 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2131 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2132 }
2133
2134 fn control_handle(&self) -> Self::ControlHandle {
2135 Store2ControlHandle { inner: self.inner.clone() }
2136 }
2137
2138 fn into_inner(
2139 self,
2140 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2141 {
2142 (self.inner, self.is_terminated)
2143 }
2144
2145 fn from_inner(
2146 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2147 is_terminated: bool,
2148 ) -> Self {
2149 Self { inner, is_terminated }
2150 }
2151}
2152
2153impl futures::Stream for Store2RequestStream {
2154 type Item = Result<Store2Request, fidl::Error>;
2155
2156 fn poll_next(
2157 mut self: std::pin::Pin<&mut Self>,
2158 cx: &mut std::task::Context<'_>,
2159 ) -> std::task::Poll<Option<Self::Item>> {
2160 let this = &mut *self;
2161 if this.inner.check_shutdown(cx) {
2162 this.is_terminated = true;
2163 return std::task::Poll::Ready(None);
2164 }
2165 if this.is_terminated {
2166 panic!("polled Store2RequestStream after completion");
2167 }
2168 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2169 |bytes, handles| {
2170 match this.inner.channel().read_etc(cx, bytes, handles) {
2171 std::task::Poll::Ready(Ok(())) => {}
2172 std::task::Poll::Pending => return std::task::Poll::Pending,
2173 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2174 this.is_terminated = true;
2175 return std::task::Poll::Ready(None);
2176 }
2177 std::task::Poll::Ready(Err(e)) => {
2178 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2179 e.into(),
2180 ))))
2181 }
2182 }
2183
2184 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2186
2187 std::task::Poll::Ready(Some(match header.ordinal {
2188 0x4327d0764bed131b => {
2189 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2190 let mut req = fidl::new_empty!(
2191 StoreIdentifyRequest,
2192 fidl::encoding::DefaultFuchsiaResourceDialect
2193 );
2194 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreIdentifyRequest>(&header, _body_bytes, handles, &mut req)?;
2195 let control_handle = Store2ControlHandle { inner: this.inner.clone() };
2196 Ok(Store2Request::Identify { name: req.name, control_handle })
2197 }
2198 0x5aaed3604b3bcfbb => {
2199 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2200 let mut req = fidl::new_empty!(
2201 StoreCreateAccessorRequest,
2202 fidl::encoding::DefaultFuchsiaResourceDialect
2203 );
2204 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreCreateAccessorRequest>(&header, _body_bytes, handles, &mut req)?;
2205 let control_handle = Store2ControlHandle { inner: this.inner.clone() };
2206 Ok(Store2Request::CreateAccessor {
2207 read_only: req.read_only,
2208 accessor_request: req.accessor_request,
2209
2210 control_handle,
2211 })
2212 }
2213 _ => Err(fidl::Error::UnknownOrdinal {
2214 ordinal: header.ordinal,
2215 protocol_name:
2216 <Store2Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2217 }),
2218 }))
2219 },
2220 )
2221 }
2222}
2223
2224#[derive(Debug)]
2227pub enum Store2Request {
2228 Identify { name: String, control_handle: Store2ControlHandle },
2233 CreateAccessor {
2236 read_only: bool,
2237 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
2238 control_handle: Store2ControlHandle,
2239 },
2240}
2241
2242impl Store2Request {
2243 #[allow(irrefutable_let_patterns)]
2244 pub fn into_identify(self) -> Option<(String, Store2ControlHandle)> {
2245 if let Store2Request::Identify { name, control_handle } = self {
2246 Some((name, control_handle))
2247 } else {
2248 None
2249 }
2250 }
2251
2252 #[allow(irrefutable_let_patterns)]
2253 pub fn into_create_accessor(
2254 self,
2255 ) -> Option<(bool, fidl::endpoints::ServerEnd<StoreAccessorMarker>, Store2ControlHandle)> {
2256 if let Store2Request::CreateAccessor { read_only, accessor_request, control_handle } = self
2257 {
2258 Some((read_only, accessor_request, control_handle))
2259 } else {
2260 None
2261 }
2262 }
2263
2264 pub fn method_name(&self) -> &'static str {
2266 match *self {
2267 Store2Request::Identify { .. } => "identify",
2268 Store2Request::CreateAccessor { .. } => "create_accessor",
2269 }
2270 }
2271}
2272
2273#[derive(Debug, Clone)]
2274pub struct Store2ControlHandle {
2275 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2276}
2277
2278impl fidl::endpoints::ControlHandle for Store2ControlHandle {
2279 fn shutdown(&self) {
2280 self.inner.shutdown()
2281 }
2282 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2283 self.inner.shutdown_with_epitaph(status)
2284 }
2285
2286 fn is_closed(&self) -> bool {
2287 self.inner.channel().is_closed()
2288 }
2289 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2290 self.inner.channel().on_closed()
2291 }
2292
2293 #[cfg(target_os = "fuchsia")]
2294 fn signal_peer(
2295 &self,
2296 clear_mask: zx::Signals,
2297 set_mask: zx::Signals,
2298 ) -> Result<(), zx_status::Status> {
2299 use fidl::Peered;
2300 self.inner.channel().signal_peer(clear_mask, set_mask)
2301 }
2302}
2303
2304impl Store2ControlHandle {}
2305
2306#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2307pub struct StoreAccessorMarker;
2308
2309impl fidl::endpoints::ProtocolMarker for StoreAccessorMarker {
2310 type Proxy = StoreAccessorProxy;
2311 type RequestStream = StoreAccessorRequestStream;
2312 #[cfg(target_os = "fuchsia")]
2313 type SynchronousProxy = StoreAccessorSynchronousProxy;
2314
2315 const DEBUG_NAME: &'static str = "(anonymous) StoreAccessor";
2316}
2317pub type StoreAccessorFlushResult = Result<(), FlushError>;
2318
2319pub trait StoreAccessorProxyInterface: Send + Sync {
2320 type GetValueResponseFut: std::future::Future<Output = Result<Option<Box<Value>>, fidl::Error>>
2321 + Send;
2322 fn r#get_value(&self, key: &str) -> Self::GetValueResponseFut;
2323 fn r#set_value(&self, key: &str, val: Value) -> Result<(), fidl::Error>;
2324 fn r#delete_value(&self, key: &str) -> Result<(), fidl::Error>;
2325 fn r#list_prefix(
2326 &self,
2327 prefix: &str,
2328 it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2329 ) -> Result<(), fidl::Error>;
2330 fn r#get_prefix(
2331 &self,
2332 prefix: &str,
2333 it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2334 ) -> Result<(), fidl::Error>;
2335 fn r#delete_prefix(&self, prefix: &str) -> Result<(), fidl::Error>;
2336 fn r#commit(&self) -> Result<(), fidl::Error>;
2337 type FlushResponseFut: std::future::Future<Output = Result<StoreAccessorFlushResult, fidl::Error>>
2338 + Send;
2339 fn r#flush(&self) -> Self::FlushResponseFut;
2340}
2341#[derive(Debug)]
2342#[cfg(target_os = "fuchsia")]
2343pub struct StoreAccessorSynchronousProxy {
2344 client: fidl::client::sync::Client,
2345}
2346
2347#[cfg(target_os = "fuchsia")]
2348impl fidl::endpoints::SynchronousProxy for StoreAccessorSynchronousProxy {
2349 type Proxy = StoreAccessorProxy;
2350 type Protocol = StoreAccessorMarker;
2351
2352 fn from_channel(inner: fidl::Channel) -> Self {
2353 Self::new(inner)
2354 }
2355
2356 fn into_channel(self) -> fidl::Channel {
2357 self.client.into_channel()
2358 }
2359
2360 fn as_channel(&self) -> &fidl::Channel {
2361 self.client.as_channel()
2362 }
2363}
2364
2365#[cfg(target_os = "fuchsia")]
2366impl StoreAccessorSynchronousProxy {
2367 pub fn new(channel: fidl::Channel) -> Self {
2368 let protocol_name = <StoreAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2369 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2370 }
2371
2372 pub fn into_channel(self) -> fidl::Channel {
2373 self.client.into_channel()
2374 }
2375
2376 pub fn wait_for_event(
2379 &self,
2380 deadline: zx::MonotonicInstant,
2381 ) -> Result<StoreAccessorEvent, fidl::Error> {
2382 StoreAccessorEvent::decode(self.client.wait_for_event(deadline)?)
2383 }
2384
2385 pub fn r#get_value(
2387 &self,
2388 mut key: &str,
2389 ___deadline: zx::MonotonicInstant,
2390 ) -> Result<Option<Box<Value>>, fidl::Error> {
2391 let _response =
2392 self.client.send_query::<StoreAccessorGetValueRequest, StoreAccessorGetValueResponse>(
2393 (key,),
2394 0x757e8893d1347630,
2395 fidl::encoding::DynamicFlags::empty(),
2396 ___deadline,
2397 )?;
2398 Ok(_response.val)
2399 }
2400
2401 pub fn r#set_value(&self, mut key: &str, mut val: Value) -> Result<(), fidl::Error> {
2404 self.client.send::<StoreAccessorSetValueRequest>(
2405 (key, &mut val),
2406 0x58365315c2f38e1c,
2407 fidl::encoding::DynamicFlags::empty(),
2408 )
2409 }
2410
2411 pub fn r#delete_value(&self, mut key: &str) -> Result<(), fidl::Error> {
2414 self.client.send::<StoreAccessorDeleteValueRequest>(
2415 (key,),
2416 0x64e331813e30ec12,
2417 fidl::encoding::DynamicFlags::empty(),
2418 )
2419 }
2420
2421 pub fn r#list_prefix(
2423 &self,
2424 mut prefix: &str,
2425 mut it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2426 ) -> Result<(), fidl::Error> {
2427 self.client.send::<StoreAccessorListPrefixRequest>(
2428 (prefix, it),
2429 0x2e25291acf25331e,
2430 fidl::encoding::DynamicFlags::empty(),
2431 )
2432 }
2433
2434 pub fn r#get_prefix(
2436 &self,
2437 mut prefix: &str,
2438 mut it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2439 ) -> Result<(), fidl::Error> {
2440 self.client.send::<StoreAccessorGetPrefixRequest>(
2441 (prefix, it),
2442 0x753ca25534a85c38,
2443 fidl::encoding::DynamicFlags::empty(),
2444 )
2445 }
2446
2447 pub fn r#delete_prefix(&self, mut prefix: &str) -> Result<(), fidl::Error> {
2449 self.client.send::<StoreAccessorDeletePrefixRequest>(
2450 (prefix,),
2451 0x468405bac20649c9,
2452 fidl::encoding::DynamicFlags::empty(),
2453 )
2454 }
2455
2456 pub fn r#commit(&self) -> Result<(), fidl::Error> {
2459 self.client.send::<fidl::encoding::EmptyPayload>(
2460 (),
2461 0x6daf402bf765768c,
2462 fidl::encoding::DynamicFlags::empty(),
2463 )
2464 }
2465
2466 pub fn r#flush(
2472 &self,
2473 ___deadline: zx::MonotonicInstant,
2474 ) -> Result<StoreAccessorFlushResult, fidl::Error> {
2475 let _response = self.client.send_query::<
2476 fidl::encoding::EmptyPayload,
2477 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FlushError>,
2478 >(
2479 (),
2480 0x463d057712847d12,
2481 fidl::encoding::DynamicFlags::empty(),
2482 ___deadline,
2483 )?;
2484 Ok(_response.map(|x| x))
2485 }
2486}
2487
2488#[derive(Debug, Clone)]
2489pub struct StoreAccessorProxy {
2490 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2491}
2492
2493impl fidl::endpoints::Proxy for StoreAccessorProxy {
2494 type Protocol = StoreAccessorMarker;
2495
2496 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2497 Self::new(inner)
2498 }
2499
2500 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2501 self.client.into_channel().map_err(|client| Self { client })
2502 }
2503
2504 fn as_channel(&self) -> &::fidl::AsyncChannel {
2505 self.client.as_channel()
2506 }
2507}
2508
2509impl StoreAccessorProxy {
2510 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2512 let protocol_name = <StoreAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2513 Self { client: fidl::client::Client::new(channel, protocol_name) }
2514 }
2515
2516 pub fn take_event_stream(&self) -> StoreAccessorEventStream {
2522 StoreAccessorEventStream { event_receiver: self.client.take_event_receiver() }
2523 }
2524
2525 pub fn r#get_value(
2527 &self,
2528 mut key: &str,
2529 ) -> fidl::client::QueryResponseFut<
2530 Option<Box<Value>>,
2531 fidl::encoding::DefaultFuchsiaResourceDialect,
2532 > {
2533 StoreAccessorProxyInterface::r#get_value(self, key)
2534 }
2535
2536 pub fn r#set_value(&self, mut key: &str, mut val: Value) -> Result<(), fidl::Error> {
2539 StoreAccessorProxyInterface::r#set_value(self, key, val)
2540 }
2541
2542 pub fn r#delete_value(&self, mut key: &str) -> Result<(), fidl::Error> {
2545 StoreAccessorProxyInterface::r#delete_value(self, key)
2546 }
2547
2548 pub fn r#list_prefix(
2550 &self,
2551 mut prefix: &str,
2552 mut it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2553 ) -> Result<(), fidl::Error> {
2554 StoreAccessorProxyInterface::r#list_prefix(self, prefix, it)
2555 }
2556
2557 pub fn r#get_prefix(
2559 &self,
2560 mut prefix: &str,
2561 mut it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2562 ) -> Result<(), fidl::Error> {
2563 StoreAccessorProxyInterface::r#get_prefix(self, prefix, it)
2564 }
2565
2566 pub fn r#delete_prefix(&self, mut prefix: &str) -> Result<(), fidl::Error> {
2568 StoreAccessorProxyInterface::r#delete_prefix(self, prefix)
2569 }
2570
2571 pub fn r#commit(&self) -> Result<(), fidl::Error> {
2574 StoreAccessorProxyInterface::r#commit(self)
2575 }
2576
2577 pub fn r#flush(
2583 &self,
2584 ) -> fidl::client::QueryResponseFut<
2585 StoreAccessorFlushResult,
2586 fidl::encoding::DefaultFuchsiaResourceDialect,
2587 > {
2588 StoreAccessorProxyInterface::r#flush(self)
2589 }
2590}
2591
2592impl StoreAccessorProxyInterface for StoreAccessorProxy {
2593 type GetValueResponseFut = fidl::client::QueryResponseFut<
2594 Option<Box<Value>>,
2595 fidl::encoding::DefaultFuchsiaResourceDialect,
2596 >;
2597 fn r#get_value(&self, mut key: &str) -> Self::GetValueResponseFut {
2598 fn _decode(
2599 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2600 ) -> Result<Option<Box<Value>>, fidl::Error> {
2601 let _response = fidl::client::decode_transaction_body::<
2602 StoreAccessorGetValueResponse,
2603 fidl::encoding::DefaultFuchsiaResourceDialect,
2604 0x757e8893d1347630,
2605 >(_buf?)?;
2606 Ok(_response.val)
2607 }
2608 self.client.send_query_and_decode::<StoreAccessorGetValueRequest, Option<Box<Value>>>(
2609 (key,),
2610 0x757e8893d1347630,
2611 fidl::encoding::DynamicFlags::empty(),
2612 _decode,
2613 )
2614 }
2615
2616 fn r#set_value(&self, mut key: &str, mut val: Value) -> Result<(), fidl::Error> {
2617 self.client.send::<StoreAccessorSetValueRequest>(
2618 (key, &mut val),
2619 0x58365315c2f38e1c,
2620 fidl::encoding::DynamicFlags::empty(),
2621 )
2622 }
2623
2624 fn r#delete_value(&self, mut key: &str) -> Result<(), fidl::Error> {
2625 self.client.send::<StoreAccessorDeleteValueRequest>(
2626 (key,),
2627 0x64e331813e30ec12,
2628 fidl::encoding::DynamicFlags::empty(),
2629 )
2630 }
2631
2632 fn r#list_prefix(
2633 &self,
2634 mut prefix: &str,
2635 mut it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2636 ) -> Result<(), fidl::Error> {
2637 self.client.send::<StoreAccessorListPrefixRequest>(
2638 (prefix, it),
2639 0x2e25291acf25331e,
2640 fidl::encoding::DynamicFlags::empty(),
2641 )
2642 }
2643
2644 fn r#get_prefix(
2645 &self,
2646 mut prefix: &str,
2647 mut it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2648 ) -> Result<(), fidl::Error> {
2649 self.client.send::<StoreAccessorGetPrefixRequest>(
2650 (prefix, it),
2651 0x753ca25534a85c38,
2652 fidl::encoding::DynamicFlags::empty(),
2653 )
2654 }
2655
2656 fn r#delete_prefix(&self, mut prefix: &str) -> Result<(), fidl::Error> {
2657 self.client.send::<StoreAccessorDeletePrefixRequest>(
2658 (prefix,),
2659 0x468405bac20649c9,
2660 fidl::encoding::DynamicFlags::empty(),
2661 )
2662 }
2663
2664 fn r#commit(&self) -> Result<(), fidl::Error> {
2665 self.client.send::<fidl::encoding::EmptyPayload>(
2666 (),
2667 0x6daf402bf765768c,
2668 fidl::encoding::DynamicFlags::empty(),
2669 )
2670 }
2671
2672 type FlushResponseFut = fidl::client::QueryResponseFut<
2673 StoreAccessorFlushResult,
2674 fidl::encoding::DefaultFuchsiaResourceDialect,
2675 >;
2676 fn r#flush(&self) -> Self::FlushResponseFut {
2677 fn _decode(
2678 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2679 ) -> Result<StoreAccessorFlushResult, fidl::Error> {
2680 let _response = fidl::client::decode_transaction_body::<
2681 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FlushError>,
2682 fidl::encoding::DefaultFuchsiaResourceDialect,
2683 0x463d057712847d12,
2684 >(_buf?)?;
2685 Ok(_response.map(|x| x))
2686 }
2687 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StoreAccessorFlushResult>(
2688 (),
2689 0x463d057712847d12,
2690 fidl::encoding::DynamicFlags::empty(),
2691 _decode,
2692 )
2693 }
2694}
2695
2696pub struct StoreAccessorEventStream {
2697 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2698}
2699
2700impl std::marker::Unpin for StoreAccessorEventStream {}
2701
2702impl futures::stream::FusedStream for StoreAccessorEventStream {
2703 fn is_terminated(&self) -> bool {
2704 self.event_receiver.is_terminated()
2705 }
2706}
2707
2708impl futures::Stream for StoreAccessorEventStream {
2709 type Item = Result<StoreAccessorEvent, fidl::Error>;
2710
2711 fn poll_next(
2712 mut self: std::pin::Pin<&mut Self>,
2713 cx: &mut std::task::Context<'_>,
2714 ) -> std::task::Poll<Option<Self::Item>> {
2715 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2716 &mut self.event_receiver,
2717 cx
2718 )?) {
2719 Some(buf) => std::task::Poll::Ready(Some(StoreAccessorEvent::decode(buf))),
2720 None => std::task::Poll::Ready(None),
2721 }
2722 }
2723}
2724
2725#[derive(Debug)]
2726pub enum StoreAccessorEvent {}
2727
2728impl StoreAccessorEvent {
2729 fn decode(
2731 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2732 ) -> Result<StoreAccessorEvent, fidl::Error> {
2733 let (bytes, _handles) = buf.split_mut();
2734 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2735 debug_assert_eq!(tx_header.tx_id, 0);
2736 match tx_header.ordinal {
2737 _ => Err(fidl::Error::UnknownOrdinal {
2738 ordinal: tx_header.ordinal,
2739 protocol_name: <StoreAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2740 }),
2741 }
2742 }
2743}
2744
2745pub struct StoreAccessorRequestStream {
2747 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2748 is_terminated: bool,
2749}
2750
2751impl std::marker::Unpin for StoreAccessorRequestStream {}
2752
2753impl futures::stream::FusedStream for StoreAccessorRequestStream {
2754 fn is_terminated(&self) -> bool {
2755 self.is_terminated
2756 }
2757}
2758
2759impl fidl::endpoints::RequestStream for StoreAccessorRequestStream {
2760 type Protocol = StoreAccessorMarker;
2761 type ControlHandle = StoreAccessorControlHandle;
2762
2763 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2764 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2765 }
2766
2767 fn control_handle(&self) -> Self::ControlHandle {
2768 StoreAccessorControlHandle { inner: self.inner.clone() }
2769 }
2770
2771 fn into_inner(
2772 self,
2773 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2774 {
2775 (self.inner, self.is_terminated)
2776 }
2777
2778 fn from_inner(
2779 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2780 is_terminated: bool,
2781 ) -> Self {
2782 Self { inner, is_terminated }
2783 }
2784}
2785
2786impl futures::Stream for StoreAccessorRequestStream {
2787 type Item = Result<StoreAccessorRequest, fidl::Error>;
2788
2789 fn poll_next(
2790 mut self: std::pin::Pin<&mut Self>,
2791 cx: &mut std::task::Context<'_>,
2792 ) -> std::task::Poll<Option<Self::Item>> {
2793 let this = &mut *self;
2794 if this.inner.check_shutdown(cx) {
2795 this.is_terminated = true;
2796 return std::task::Poll::Ready(None);
2797 }
2798 if this.is_terminated {
2799 panic!("polled StoreAccessorRequestStream after completion");
2800 }
2801 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2802 |bytes, handles| {
2803 match this.inner.channel().read_etc(cx, bytes, handles) {
2804 std::task::Poll::Ready(Ok(())) => {}
2805 std::task::Poll::Pending => return std::task::Poll::Pending,
2806 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2807 this.is_terminated = true;
2808 return std::task::Poll::Ready(None);
2809 }
2810 std::task::Poll::Ready(Err(e)) => {
2811 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2812 e.into(),
2813 ))))
2814 }
2815 }
2816
2817 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2819
2820 std::task::Poll::Ready(Some(match header.ordinal {
2821 0x757e8893d1347630 => {
2822 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2823 let mut req = fidl::new_empty!(
2824 StoreAccessorGetValueRequest,
2825 fidl::encoding::DefaultFuchsiaResourceDialect
2826 );
2827 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorGetValueRequest>(&header, _body_bytes, handles, &mut req)?;
2828 let control_handle =
2829 StoreAccessorControlHandle { inner: this.inner.clone() };
2830 Ok(StoreAccessorRequest::GetValue {
2831 key: req.key,
2832
2833 responder: StoreAccessorGetValueResponder {
2834 control_handle: std::mem::ManuallyDrop::new(control_handle),
2835 tx_id: header.tx_id,
2836 },
2837 })
2838 }
2839 0x58365315c2f38e1c => {
2840 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2841 let mut req = fidl::new_empty!(
2842 StoreAccessorSetValueRequest,
2843 fidl::encoding::DefaultFuchsiaResourceDialect
2844 );
2845 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorSetValueRequest>(&header, _body_bytes, handles, &mut req)?;
2846 let control_handle =
2847 StoreAccessorControlHandle { inner: this.inner.clone() };
2848 Ok(StoreAccessorRequest::SetValue {
2849 key: req.key,
2850 val: req.val,
2851
2852 control_handle,
2853 })
2854 }
2855 0x64e331813e30ec12 => {
2856 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2857 let mut req = fidl::new_empty!(
2858 StoreAccessorDeleteValueRequest,
2859 fidl::encoding::DefaultFuchsiaResourceDialect
2860 );
2861 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorDeleteValueRequest>(&header, _body_bytes, handles, &mut req)?;
2862 let control_handle =
2863 StoreAccessorControlHandle { inner: this.inner.clone() };
2864 Ok(StoreAccessorRequest::DeleteValue { key: req.key, control_handle })
2865 }
2866 0x2e25291acf25331e => {
2867 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2868 let mut req = fidl::new_empty!(
2869 StoreAccessorListPrefixRequest,
2870 fidl::encoding::DefaultFuchsiaResourceDialect
2871 );
2872 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorListPrefixRequest>(&header, _body_bytes, handles, &mut req)?;
2873 let control_handle =
2874 StoreAccessorControlHandle { inner: this.inner.clone() };
2875 Ok(StoreAccessorRequest::ListPrefix {
2876 prefix: req.prefix,
2877 it: req.it,
2878
2879 control_handle,
2880 })
2881 }
2882 0x753ca25534a85c38 => {
2883 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2884 let mut req = fidl::new_empty!(
2885 StoreAccessorGetPrefixRequest,
2886 fidl::encoding::DefaultFuchsiaResourceDialect
2887 );
2888 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorGetPrefixRequest>(&header, _body_bytes, handles, &mut req)?;
2889 let control_handle =
2890 StoreAccessorControlHandle { inner: this.inner.clone() };
2891 Ok(StoreAccessorRequest::GetPrefix {
2892 prefix: req.prefix,
2893 it: req.it,
2894
2895 control_handle,
2896 })
2897 }
2898 0x468405bac20649c9 => {
2899 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2900 let mut req = fidl::new_empty!(
2901 StoreAccessorDeletePrefixRequest,
2902 fidl::encoding::DefaultFuchsiaResourceDialect
2903 );
2904 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorDeletePrefixRequest>(&header, _body_bytes, handles, &mut req)?;
2905 let control_handle =
2906 StoreAccessorControlHandle { inner: this.inner.clone() };
2907 Ok(StoreAccessorRequest::DeletePrefix {
2908 prefix: req.prefix,
2909
2910 control_handle,
2911 })
2912 }
2913 0x6daf402bf765768c => {
2914 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2915 let mut req = fidl::new_empty!(
2916 fidl::encoding::EmptyPayload,
2917 fidl::encoding::DefaultFuchsiaResourceDialect
2918 );
2919 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2920 let control_handle =
2921 StoreAccessorControlHandle { inner: this.inner.clone() };
2922 Ok(StoreAccessorRequest::Commit { control_handle })
2923 }
2924 0x463d057712847d12 => {
2925 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2926 let mut req = fidl::new_empty!(
2927 fidl::encoding::EmptyPayload,
2928 fidl::encoding::DefaultFuchsiaResourceDialect
2929 );
2930 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2931 let control_handle =
2932 StoreAccessorControlHandle { inner: this.inner.clone() };
2933 Ok(StoreAccessorRequest::Flush {
2934 responder: StoreAccessorFlushResponder {
2935 control_handle: std::mem::ManuallyDrop::new(control_handle),
2936 tx_id: header.tx_id,
2937 },
2938 })
2939 }
2940 _ => Err(fidl::Error::UnknownOrdinal {
2941 ordinal: header.ordinal,
2942 protocol_name:
2943 <StoreAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2944 }),
2945 }))
2946 },
2947 )
2948 }
2949}
2950
2951#[derive(Debug)]
2953pub enum StoreAccessorRequest {
2954 GetValue { key: String, responder: StoreAccessorGetValueResponder },
2956 SetValue { key: String, val: Value, control_handle: StoreAccessorControlHandle },
2959 DeleteValue { key: String, control_handle: StoreAccessorControlHandle },
2962 ListPrefix {
2964 prefix: String,
2965 it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2966 control_handle: StoreAccessorControlHandle,
2967 },
2968 GetPrefix {
2970 prefix: String,
2971 it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2972 control_handle: StoreAccessorControlHandle,
2973 },
2974 DeletePrefix { prefix: String, control_handle: StoreAccessorControlHandle },
2976 Commit { control_handle: StoreAccessorControlHandle },
2979 Flush { responder: StoreAccessorFlushResponder },
2985}
2986
2987impl StoreAccessorRequest {
2988 #[allow(irrefutable_let_patterns)]
2989 pub fn into_get_value(self) -> Option<(String, StoreAccessorGetValueResponder)> {
2990 if let StoreAccessorRequest::GetValue { key, responder } = self {
2991 Some((key, responder))
2992 } else {
2993 None
2994 }
2995 }
2996
2997 #[allow(irrefutable_let_patterns)]
2998 pub fn into_set_value(self) -> Option<(String, Value, StoreAccessorControlHandle)> {
2999 if let StoreAccessorRequest::SetValue { key, val, control_handle } = self {
3000 Some((key, val, control_handle))
3001 } else {
3002 None
3003 }
3004 }
3005
3006 #[allow(irrefutable_let_patterns)]
3007 pub fn into_delete_value(self) -> Option<(String, StoreAccessorControlHandle)> {
3008 if let StoreAccessorRequest::DeleteValue { key, control_handle } = self {
3009 Some((key, control_handle))
3010 } else {
3011 None
3012 }
3013 }
3014
3015 #[allow(irrefutable_let_patterns)]
3016 pub fn into_list_prefix(
3017 self,
3018 ) -> Option<(String, fidl::endpoints::ServerEnd<ListIteratorMarker>, StoreAccessorControlHandle)>
3019 {
3020 if let StoreAccessorRequest::ListPrefix { prefix, it, control_handle } = self {
3021 Some((prefix, it, control_handle))
3022 } else {
3023 None
3024 }
3025 }
3026
3027 #[allow(irrefutable_let_patterns)]
3028 pub fn into_get_prefix(
3029 self,
3030 ) -> Option<(String, fidl::endpoints::ServerEnd<GetIteratorMarker>, StoreAccessorControlHandle)>
3031 {
3032 if let StoreAccessorRequest::GetPrefix { prefix, it, control_handle } = self {
3033 Some((prefix, it, control_handle))
3034 } else {
3035 None
3036 }
3037 }
3038
3039 #[allow(irrefutable_let_patterns)]
3040 pub fn into_delete_prefix(self) -> Option<(String, StoreAccessorControlHandle)> {
3041 if let StoreAccessorRequest::DeletePrefix { prefix, control_handle } = self {
3042 Some((prefix, control_handle))
3043 } else {
3044 None
3045 }
3046 }
3047
3048 #[allow(irrefutable_let_patterns)]
3049 pub fn into_commit(self) -> Option<(StoreAccessorControlHandle)> {
3050 if let StoreAccessorRequest::Commit { control_handle } = self {
3051 Some((control_handle))
3052 } else {
3053 None
3054 }
3055 }
3056
3057 #[allow(irrefutable_let_patterns)]
3058 pub fn into_flush(self) -> Option<(StoreAccessorFlushResponder)> {
3059 if let StoreAccessorRequest::Flush { responder } = self {
3060 Some((responder))
3061 } else {
3062 None
3063 }
3064 }
3065
3066 pub fn method_name(&self) -> &'static str {
3068 match *self {
3069 StoreAccessorRequest::GetValue { .. } => "get_value",
3070 StoreAccessorRequest::SetValue { .. } => "set_value",
3071 StoreAccessorRequest::DeleteValue { .. } => "delete_value",
3072 StoreAccessorRequest::ListPrefix { .. } => "list_prefix",
3073 StoreAccessorRequest::GetPrefix { .. } => "get_prefix",
3074 StoreAccessorRequest::DeletePrefix { .. } => "delete_prefix",
3075 StoreAccessorRequest::Commit { .. } => "commit",
3076 StoreAccessorRequest::Flush { .. } => "flush",
3077 }
3078 }
3079}
3080
3081#[derive(Debug, Clone)]
3082pub struct StoreAccessorControlHandle {
3083 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3084}
3085
3086impl fidl::endpoints::ControlHandle for StoreAccessorControlHandle {
3087 fn shutdown(&self) {
3088 self.inner.shutdown()
3089 }
3090 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3091 self.inner.shutdown_with_epitaph(status)
3092 }
3093
3094 fn is_closed(&self) -> bool {
3095 self.inner.channel().is_closed()
3096 }
3097 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3098 self.inner.channel().on_closed()
3099 }
3100
3101 #[cfg(target_os = "fuchsia")]
3102 fn signal_peer(
3103 &self,
3104 clear_mask: zx::Signals,
3105 set_mask: zx::Signals,
3106 ) -> Result<(), zx_status::Status> {
3107 use fidl::Peered;
3108 self.inner.channel().signal_peer(clear_mask, set_mask)
3109 }
3110}
3111
3112impl StoreAccessorControlHandle {}
3113
3114#[must_use = "FIDL methods require a response to be sent"]
3115#[derive(Debug)]
3116pub struct StoreAccessorGetValueResponder {
3117 control_handle: std::mem::ManuallyDrop<StoreAccessorControlHandle>,
3118 tx_id: u32,
3119}
3120
3121impl std::ops::Drop for StoreAccessorGetValueResponder {
3125 fn drop(&mut self) {
3126 self.control_handle.shutdown();
3127 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3129 }
3130}
3131
3132impl fidl::endpoints::Responder for StoreAccessorGetValueResponder {
3133 type ControlHandle = StoreAccessorControlHandle;
3134
3135 fn control_handle(&self) -> &StoreAccessorControlHandle {
3136 &self.control_handle
3137 }
3138
3139 fn drop_without_shutdown(mut self) {
3140 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3142 std::mem::forget(self);
3144 }
3145}
3146
3147impl StoreAccessorGetValueResponder {
3148 pub fn send(self, mut val: Option<Value>) -> Result<(), fidl::Error> {
3152 let _result = self.send_raw(val);
3153 if _result.is_err() {
3154 self.control_handle.shutdown();
3155 }
3156 self.drop_without_shutdown();
3157 _result
3158 }
3159
3160 pub fn send_no_shutdown_on_err(self, mut val: Option<Value>) -> Result<(), fidl::Error> {
3162 let _result = self.send_raw(val);
3163 self.drop_without_shutdown();
3164 _result
3165 }
3166
3167 fn send_raw(&self, mut val: Option<Value>) -> Result<(), fidl::Error> {
3168 self.control_handle.inner.send::<StoreAccessorGetValueResponse>(
3169 (val.as_mut(),),
3170 self.tx_id,
3171 0x757e8893d1347630,
3172 fidl::encoding::DynamicFlags::empty(),
3173 )
3174 }
3175}
3176
3177#[must_use = "FIDL methods require a response to be sent"]
3178#[derive(Debug)]
3179pub struct StoreAccessorFlushResponder {
3180 control_handle: std::mem::ManuallyDrop<StoreAccessorControlHandle>,
3181 tx_id: u32,
3182}
3183
3184impl std::ops::Drop for StoreAccessorFlushResponder {
3188 fn drop(&mut self) {
3189 self.control_handle.shutdown();
3190 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3192 }
3193}
3194
3195impl fidl::endpoints::Responder for StoreAccessorFlushResponder {
3196 type ControlHandle = StoreAccessorControlHandle;
3197
3198 fn control_handle(&self) -> &StoreAccessorControlHandle {
3199 &self.control_handle
3200 }
3201
3202 fn drop_without_shutdown(mut self) {
3203 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3205 std::mem::forget(self);
3207 }
3208}
3209
3210impl StoreAccessorFlushResponder {
3211 pub fn send(self, mut result: Result<(), FlushError>) -> Result<(), fidl::Error> {
3215 let _result = self.send_raw(result);
3216 if _result.is_err() {
3217 self.control_handle.shutdown();
3218 }
3219 self.drop_without_shutdown();
3220 _result
3221 }
3222
3223 pub fn send_no_shutdown_on_err(
3225 self,
3226 mut result: Result<(), FlushError>,
3227 ) -> Result<(), fidl::Error> {
3228 let _result = self.send_raw(result);
3229 self.drop_without_shutdown();
3230 _result
3231 }
3232
3233 fn send_raw(&self, mut result: Result<(), FlushError>) -> Result<(), fidl::Error> {
3234 self.control_handle
3235 .inner
3236 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FlushError>>(
3237 result,
3238 self.tx_id,
3239 0x463d057712847d12,
3240 fidl::encoding::DynamicFlags::empty(),
3241 )
3242 }
3243}
3244
3245mod internal {
3246 use super::*;
3247 unsafe impl fidl::encoding::TypeMarker for FlushError {
3248 type Owned = Self;
3249
3250 #[inline(always)]
3251 fn inline_align(_context: fidl::encoding::Context) -> usize {
3252 std::mem::align_of::<u32>()
3253 }
3254
3255 #[inline(always)]
3256 fn inline_size(_context: fidl::encoding::Context) -> usize {
3257 std::mem::size_of::<u32>()
3258 }
3259
3260 #[inline(always)]
3261 fn encode_is_copy() -> bool {
3262 true
3263 }
3264
3265 #[inline(always)]
3266 fn decode_is_copy() -> bool {
3267 false
3268 }
3269 }
3270
3271 impl fidl::encoding::ValueTypeMarker for FlushError {
3272 type Borrowed<'a> = Self;
3273 #[inline(always)]
3274 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3275 *value
3276 }
3277 }
3278
3279 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FlushError {
3280 #[inline]
3281 unsafe fn encode(
3282 self,
3283 encoder: &mut fidl::encoding::Encoder<'_, D>,
3284 offset: usize,
3285 _depth: fidl::encoding::Depth,
3286 ) -> fidl::Result<()> {
3287 encoder.debug_check_bounds::<Self>(offset);
3288 encoder.write_num(self.into_primitive(), offset);
3289 Ok(())
3290 }
3291 }
3292
3293 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FlushError {
3294 #[inline(always)]
3295 fn new_empty() -> Self {
3296 Self::ReadOnly
3297 }
3298
3299 #[inline]
3300 unsafe fn decode(
3301 &mut self,
3302 decoder: &mut fidl::encoding::Decoder<'_, D>,
3303 offset: usize,
3304 _depth: fidl::encoding::Depth,
3305 ) -> fidl::Result<()> {
3306 decoder.debug_check_bounds::<Self>(offset);
3307 let prim = decoder.read_num::<u32>(offset);
3308
3309 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3310 Ok(())
3311 }
3312 }
3313 unsafe impl fidl::encoding::TypeMarker for ValueType {
3314 type Owned = Self;
3315
3316 #[inline(always)]
3317 fn inline_align(_context: fidl::encoding::Context) -> usize {
3318 std::mem::align_of::<u8>()
3319 }
3320
3321 #[inline(always)]
3322 fn inline_size(_context: fidl::encoding::Context) -> usize {
3323 std::mem::size_of::<u8>()
3324 }
3325
3326 #[inline(always)]
3327 fn encode_is_copy() -> bool {
3328 true
3329 }
3330
3331 #[inline(always)]
3332 fn decode_is_copy() -> bool {
3333 false
3334 }
3335 }
3336
3337 impl fidl::encoding::ValueTypeMarker for ValueType {
3338 type Borrowed<'a> = Self;
3339 #[inline(always)]
3340 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3341 *value
3342 }
3343 }
3344
3345 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ValueType {
3346 #[inline]
3347 unsafe fn encode(
3348 self,
3349 encoder: &mut fidl::encoding::Encoder<'_, D>,
3350 offset: usize,
3351 _depth: fidl::encoding::Depth,
3352 ) -> fidl::Result<()> {
3353 encoder.debug_check_bounds::<Self>(offset);
3354 encoder.write_num(self.into_primitive(), offset);
3355 Ok(())
3356 }
3357 }
3358
3359 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ValueType {
3360 #[inline(always)]
3361 fn new_empty() -> Self {
3362 Self::IntVal
3363 }
3364
3365 #[inline]
3366 unsafe fn decode(
3367 &mut self,
3368 decoder: &mut fidl::encoding::Decoder<'_, D>,
3369 offset: usize,
3370 _depth: fidl::encoding::Depth,
3371 ) -> fidl::Result<()> {
3372 decoder.debug_check_bounds::<Self>(offset);
3373 let prim = decoder.read_num::<u8>(offset);
3374
3375 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3376 Ok(())
3377 }
3378 }
3379
3380 impl fidl::encoding::ResourceTypeMarker for GetIteratorGetNextResponse {
3381 type Borrowed<'a> = &'a mut Self;
3382 fn take_or_borrow<'a>(
3383 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3384 ) -> Self::Borrowed<'a> {
3385 value
3386 }
3387 }
3388
3389 unsafe impl fidl::encoding::TypeMarker for GetIteratorGetNextResponse {
3390 type Owned = Self;
3391
3392 #[inline(always)]
3393 fn inline_align(_context: fidl::encoding::Context) -> usize {
3394 8
3395 }
3396
3397 #[inline(always)]
3398 fn inline_size(_context: fidl::encoding::Context) -> usize {
3399 16
3400 }
3401 }
3402
3403 unsafe impl
3404 fidl::encoding::Encode<
3405 GetIteratorGetNextResponse,
3406 fidl::encoding::DefaultFuchsiaResourceDialect,
3407 > for &mut GetIteratorGetNextResponse
3408 {
3409 #[inline]
3410 unsafe fn encode(
3411 self,
3412 encoder: &mut fidl::encoding::Encoder<
3413 '_,
3414 fidl::encoding::DefaultFuchsiaResourceDialect,
3415 >,
3416 offset: usize,
3417 _depth: fidl::encoding::Depth,
3418 ) -> fidl::Result<()> {
3419 encoder.debug_check_bounds::<GetIteratorGetNextResponse>(offset);
3420 fidl::encoding::Encode::<GetIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3422 (
3423 <fidl::encoding::UnboundedVector<KeyValue> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.kvs),
3424 ),
3425 encoder, offset, _depth
3426 )
3427 }
3428 }
3429 unsafe impl<
3430 T0: fidl::encoding::Encode<
3431 fidl::encoding::UnboundedVector<KeyValue>,
3432 fidl::encoding::DefaultFuchsiaResourceDialect,
3433 >,
3434 >
3435 fidl::encoding::Encode<
3436 GetIteratorGetNextResponse,
3437 fidl::encoding::DefaultFuchsiaResourceDialect,
3438 > for (T0,)
3439 {
3440 #[inline]
3441 unsafe fn encode(
3442 self,
3443 encoder: &mut fidl::encoding::Encoder<
3444 '_,
3445 fidl::encoding::DefaultFuchsiaResourceDialect,
3446 >,
3447 offset: usize,
3448 depth: fidl::encoding::Depth,
3449 ) -> fidl::Result<()> {
3450 encoder.debug_check_bounds::<GetIteratorGetNextResponse>(offset);
3451 self.0.encode(encoder, offset + 0, depth)?;
3455 Ok(())
3456 }
3457 }
3458
3459 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3460 for GetIteratorGetNextResponse
3461 {
3462 #[inline(always)]
3463 fn new_empty() -> Self {
3464 Self {
3465 kvs: fidl::new_empty!(
3466 fidl::encoding::UnboundedVector<KeyValue>,
3467 fidl::encoding::DefaultFuchsiaResourceDialect
3468 ),
3469 }
3470 }
3471
3472 #[inline]
3473 unsafe fn decode(
3474 &mut self,
3475 decoder: &mut fidl::encoding::Decoder<
3476 '_,
3477 fidl::encoding::DefaultFuchsiaResourceDialect,
3478 >,
3479 offset: usize,
3480 _depth: fidl::encoding::Depth,
3481 ) -> fidl::Result<()> {
3482 decoder.debug_check_bounds::<Self>(offset);
3483 fidl::decode!(
3485 fidl::encoding::UnboundedVector<KeyValue>,
3486 fidl::encoding::DefaultFuchsiaResourceDialect,
3487 &mut self.kvs,
3488 decoder,
3489 offset + 0,
3490 _depth
3491 )?;
3492 Ok(())
3493 }
3494 }
3495
3496 impl fidl::encoding::ResourceTypeMarker for KeyValue {
3497 type Borrowed<'a> = &'a mut Self;
3498 fn take_or_borrow<'a>(
3499 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3500 ) -> Self::Borrowed<'a> {
3501 value
3502 }
3503 }
3504
3505 unsafe impl fidl::encoding::TypeMarker for KeyValue {
3506 type Owned = Self;
3507
3508 #[inline(always)]
3509 fn inline_align(_context: fidl::encoding::Context) -> usize {
3510 8
3511 }
3512
3513 #[inline(always)]
3514 fn inline_size(_context: fidl::encoding::Context) -> usize {
3515 32
3516 }
3517 }
3518
3519 unsafe impl fidl::encoding::Encode<KeyValue, fidl::encoding::DefaultFuchsiaResourceDialect>
3520 for &mut KeyValue
3521 {
3522 #[inline]
3523 unsafe fn encode(
3524 self,
3525 encoder: &mut fidl::encoding::Encoder<
3526 '_,
3527 fidl::encoding::DefaultFuchsiaResourceDialect,
3528 >,
3529 offset: usize,
3530 _depth: fidl::encoding::Depth,
3531 ) -> fidl::Result<()> {
3532 encoder.debug_check_bounds::<KeyValue>(offset);
3533 fidl::encoding::Encode::<KeyValue, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3535 (
3536 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
3537 <Value as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.val),
3538 ),
3539 encoder, offset, _depth
3540 )
3541 }
3542 }
3543 unsafe impl<
3544 T0: fidl::encoding::Encode<
3545 fidl::encoding::BoundedString<256>,
3546 fidl::encoding::DefaultFuchsiaResourceDialect,
3547 >,
3548 T1: fidl::encoding::Encode<Value, fidl::encoding::DefaultFuchsiaResourceDialect>,
3549 > fidl::encoding::Encode<KeyValue, fidl::encoding::DefaultFuchsiaResourceDialect>
3550 for (T0, T1)
3551 {
3552 #[inline]
3553 unsafe fn encode(
3554 self,
3555 encoder: &mut fidl::encoding::Encoder<
3556 '_,
3557 fidl::encoding::DefaultFuchsiaResourceDialect,
3558 >,
3559 offset: usize,
3560 depth: fidl::encoding::Depth,
3561 ) -> fidl::Result<()> {
3562 encoder.debug_check_bounds::<KeyValue>(offset);
3563 self.0.encode(encoder, offset + 0, depth)?;
3567 self.1.encode(encoder, offset + 16, depth)?;
3568 Ok(())
3569 }
3570 }
3571
3572 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for KeyValue {
3573 #[inline(always)]
3574 fn new_empty() -> Self {
3575 Self {
3576 key: fidl::new_empty!(
3577 fidl::encoding::BoundedString<256>,
3578 fidl::encoding::DefaultFuchsiaResourceDialect
3579 ),
3580 val: fidl::new_empty!(Value, fidl::encoding::DefaultFuchsiaResourceDialect),
3581 }
3582 }
3583
3584 #[inline]
3585 unsafe fn decode(
3586 &mut self,
3587 decoder: &mut fidl::encoding::Decoder<
3588 '_,
3589 fidl::encoding::DefaultFuchsiaResourceDialect,
3590 >,
3591 offset: usize,
3592 _depth: fidl::encoding::Depth,
3593 ) -> fidl::Result<()> {
3594 decoder.debug_check_bounds::<Self>(offset);
3595 fidl::decode!(
3597 fidl::encoding::BoundedString<256>,
3598 fidl::encoding::DefaultFuchsiaResourceDialect,
3599 &mut self.key,
3600 decoder,
3601 offset + 0,
3602 _depth
3603 )?;
3604 fidl::decode!(
3605 Value,
3606 fidl::encoding::DefaultFuchsiaResourceDialect,
3607 &mut self.val,
3608 decoder,
3609 offset + 16,
3610 _depth
3611 )?;
3612 Ok(())
3613 }
3614 }
3615
3616 impl fidl::encoding::ValueTypeMarker for ListItem {
3617 type Borrowed<'a> = &'a Self;
3618 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3619 value
3620 }
3621 }
3622
3623 unsafe impl fidl::encoding::TypeMarker for ListItem {
3624 type Owned = Self;
3625
3626 #[inline(always)]
3627 fn inline_align(_context: fidl::encoding::Context) -> usize {
3628 8
3629 }
3630
3631 #[inline(always)]
3632 fn inline_size(_context: fidl::encoding::Context) -> usize {
3633 24
3634 }
3635 }
3636
3637 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ListItem, D> for &ListItem {
3638 #[inline]
3639 unsafe fn encode(
3640 self,
3641 encoder: &mut fidl::encoding::Encoder<'_, D>,
3642 offset: usize,
3643 _depth: fidl::encoding::Depth,
3644 ) -> fidl::Result<()> {
3645 encoder.debug_check_bounds::<ListItem>(offset);
3646 fidl::encoding::Encode::<ListItem, D>::encode(
3648 (
3649 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
3650 &self.key,
3651 ),
3652 <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
3653 ),
3654 encoder,
3655 offset,
3656 _depth,
3657 )
3658 }
3659 }
3660 unsafe impl<
3661 D: fidl::encoding::ResourceDialect,
3662 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
3663 T1: fidl::encoding::Encode<ValueType, D>,
3664 > fidl::encoding::Encode<ListItem, D> for (T0, T1)
3665 {
3666 #[inline]
3667 unsafe fn encode(
3668 self,
3669 encoder: &mut fidl::encoding::Encoder<'_, D>,
3670 offset: usize,
3671 depth: fidl::encoding::Depth,
3672 ) -> fidl::Result<()> {
3673 encoder.debug_check_bounds::<ListItem>(offset);
3674 unsafe {
3677 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3678 (ptr as *mut u64).write_unaligned(0);
3679 }
3680 self.0.encode(encoder, offset + 0, depth)?;
3682 self.1.encode(encoder, offset + 16, depth)?;
3683 Ok(())
3684 }
3685 }
3686
3687 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ListItem {
3688 #[inline(always)]
3689 fn new_empty() -> Self {
3690 Self {
3691 key: fidl::new_empty!(fidl::encoding::BoundedString<256>, D),
3692 type_: fidl::new_empty!(ValueType, D),
3693 }
3694 }
3695
3696 #[inline]
3697 unsafe fn decode(
3698 &mut self,
3699 decoder: &mut fidl::encoding::Decoder<'_, D>,
3700 offset: usize,
3701 _depth: fidl::encoding::Depth,
3702 ) -> fidl::Result<()> {
3703 decoder.debug_check_bounds::<Self>(offset);
3704 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3706 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3707 let mask = 0xffffffffffffff00u64;
3708 let maskedval = padval & mask;
3709 if maskedval != 0 {
3710 return Err(fidl::Error::NonZeroPadding {
3711 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3712 });
3713 }
3714 fidl::decode!(
3715 fidl::encoding::BoundedString<256>,
3716 D,
3717 &mut self.key,
3718 decoder,
3719 offset + 0,
3720 _depth
3721 )?;
3722 fidl::decode!(ValueType, D, &mut self.type_, decoder, offset + 16, _depth)?;
3723 Ok(())
3724 }
3725 }
3726
3727 impl fidl::encoding::ValueTypeMarker for ListIteratorGetNextResponse {
3728 type Borrowed<'a> = &'a Self;
3729 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3730 value
3731 }
3732 }
3733
3734 unsafe impl fidl::encoding::TypeMarker for ListIteratorGetNextResponse {
3735 type Owned = Self;
3736
3737 #[inline(always)]
3738 fn inline_align(_context: fidl::encoding::Context) -> usize {
3739 8
3740 }
3741
3742 #[inline(always)]
3743 fn inline_size(_context: fidl::encoding::Context) -> usize {
3744 16
3745 }
3746 }
3747
3748 unsafe impl<D: fidl::encoding::ResourceDialect>
3749 fidl::encoding::Encode<ListIteratorGetNextResponse, D> for &ListIteratorGetNextResponse
3750 {
3751 #[inline]
3752 unsafe fn encode(
3753 self,
3754 encoder: &mut fidl::encoding::Encoder<'_, D>,
3755 offset: usize,
3756 _depth: fidl::encoding::Depth,
3757 ) -> fidl::Result<()> {
3758 encoder.debug_check_bounds::<ListIteratorGetNextResponse>(offset);
3759 fidl::encoding::Encode::<ListIteratorGetNextResponse, D>::encode(
3761 (
3762 <fidl::encoding::UnboundedVector<ListItem> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
3763 ),
3764 encoder, offset, _depth
3765 )
3766 }
3767 }
3768 unsafe impl<
3769 D: fidl::encoding::ResourceDialect,
3770 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ListItem>, D>,
3771 > fidl::encoding::Encode<ListIteratorGetNextResponse, D> for (T0,)
3772 {
3773 #[inline]
3774 unsafe fn encode(
3775 self,
3776 encoder: &mut fidl::encoding::Encoder<'_, D>,
3777 offset: usize,
3778 depth: fidl::encoding::Depth,
3779 ) -> fidl::Result<()> {
3780 encoder.debug_check_bounds::<ListIteratorGetNextResponse>(offset);
3781 self.0.encode(encoder, offset + 0, depth)?;
3785 Ok(())
3786 }
3787 }
3788
3789 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3790 for ListIteratorGetNextResponse
3791 {
3792 #[inline(always)]
3793 fn new_empty() -> Self {
3794 Self { keys: fidl::new_empty!(fidl::encoding::UnboundedVector<ListItem>, D) }
3795 }
3796
3797 #[inline]
3798 unsafe fn decode(
3799 &mut self,
3800 decoder: &mut fidl::encoding::Decoder<'_, D>,
3801 offset: usize,
3802 _depth: fidl::encoding::Depth,
3803 ) -> fidl::Result<()> {
3804 decoder.debug_check_bounds::<Self>(offset);
3805 fidl::decode!(
3807 fidl::encoding::UnboundedVector<ListItem>,
3808 D,
3809 &mut self.keys,
3810 decoder,
3811 offset + 0,
3812 _depth
3813 )?;
3814 Ok(())
3815 }
3816 }
3817
3818 impl fidl::encoding::ValueTypeMarker for StoreAccessorDeletePrefixRequest {
3819 type Borrowed<'a> = &'a Self;
3820 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3821 value
3822 }
3823 }
3824
3825 unsafe impl fidl::encoding::TypeMarker for StoreAccessorDeletePrefixRequest {
3826 type Owned = Self;
3827
3828 #[inline(always)]
3829 fn inline_align(_context: fidl::encoding::Context) -> usize {
3830 8
3831 }
3832
3833 #[inline(always)]
3834 fn inline_size(_context: fidl::encoding::Context) -> usize {
3835 16
3836 }
3837 }
3838
3839 unsafe impl<D: fidl::encoding::ResourceDialect>
3840 fidl::encoding::Encode<StoreAccessorDeletePrefixRequest, D>
3841 for &StoreAccessorDeletePrefixRequest
3842 {
3843 #[inline]
3844 unsafe fn encode(
3845 self,
3846 encoder: &mut fidl::encoding::Encoder<'_, D>,
3847 offset: usize,
3848 _depth: fidl::encoding::Depth,
3849 ) -> fidl::Result<()> {
3850 encoder.debug_check_bounds::<StoreAccessorDeletePrefixRequest>(offset);
3851 fidl::encoding::Encode::<StoreAccessorDeletePrefixRequest, D>::encode(
3853 (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
3854 &self.prefix,
3855 ),),
3856 encoder,
3857 offset,
3858 _depth,
3859 )
3860 }
3861 }
3862 unsafe impl<
3863 D: fidl::encoding::ResourceDialect,
3864 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
3865 > fidl::encoding::Encode<StoreAccessorDeletePrefixRequest, D> for (T0,)
3866 {
3867 #[inline]
3868 unsafe fn encode(
3869 self,
3870 encoder: &mut fidl::encoding::Encoder<'_, D>,
3871 offset: usize,
3872 depth: fidl::encoding::Depth,
3873 ) -> fidl::Result<()> {
3874 encoder.debug_check_bounds::<StoreAccessorDeletePrefixRequest>(offset);
3875 self.0.encode(encoder, offset + 0, depth)?;
3879 Ok(())
3880 }
3881 }
3882
3883 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3884 for StoreAccessorDeletePrefixRequest
3885 {
3886 #[inline(always)]
3887 fn new_empty() -> Self {
3888 Self { prefix: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
3889 }
3890
3891 #[inline]
3892 unsafe fn decode(
3893 &mut self,
3894 decoder: &mut fidl::encoding::Decoder<'_, D>,
3895 offset: usize,
3896 _depth: fidl::encoding::Depth,
3897 ) -> fidl::Result<()> {
3898 decoder.debug_check_bounds::<Self>(offset);
3899 fidl::decode!(
3901 fidl::encoding::BoundedString<256>,
3902 D,
3903 &mut self.prefix,
3904 decoder,
3905 offset + 0,
3906 _depth
3907 )?;
3908 Ok(())
3909 }
3910 }
3911
3912 impl fidl::encoding::ValueTypeMarker for StoreAccessorDeleteValueRequest {
3913 type Borrowed<'a> = &'a Self;
3914 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3915 value
3916 }
3917 }
3918
3919 unsafe impl fidl::encoding::TypeMarker for StoreAccessorDeleteValueRequest {
3920 type Owned = Self;
3921
3922 #[inline(always)]
3923 fn inline_align(_context: fidl::encoding::Context) -> usize {
3924 8
3925 }
3926
3927 #[inline(always)]
3928 fn inline_size(_context: fidl::encoding::Context) -> usize {
3929 16
3930 }
3931 }
3932
3933 unsafe impl<D: fidl::encoding::ResourceDialect>
3934 fidl::encoding::Encode<StoreAccessorDeleteValueRequest, D>
3935 for &StoreAccessorDeleteValueRequest
3936 {
3937 #[inline]
3938 unsafe fn encode(
3939 self,
3940 encoder: &mut fidl::encoding::Encoder<'_, D>,
3941 offset: usize,
3942 _depth: fidl::encoding::Depth,
3943 ) -> fidl::Result<()> {
3944 encoder.debug_check_bounds::<StoreAccessorDeleteValueRequest>(offset);
3945 fidl::encoding::Encode::<StoreAccessorDeleteValueRequest, D>::encode(
3947 (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
3948 &self.key,
3949 ),),
3950 encoder,
3951 offset,
3952 _depth,
3953 )
3954 }
3955 }
3956 unsafe impl<
3957 D: fidl::encoding::ResourceDialect,
3958 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
3959 > fidl::encoding::Encode<StoreAccessorDeleteValueRequest, D> for (T0,)
3960 {
3961 #[inline]
3962 unsafe fn encode(
3963 self,
3964 encoder: &mut fidl::encoding::Encoder<'_, D>,
3965 offset: usize,
3966 depth: fidl::encoding::Depth,
3967 ) -> fidl::Result<()> {
3968 encoder.debug_check_bounds::<StoreAccessorDeleteValueRequest>(offset);
3969 self.0.encode(encoder, offset + 0, depth)?;
3973 Ok(())
3974 }
3975 }
3976
3977 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3978 for StoreAccessorDeleteValueRequest
3979 {
3980 #[inline(always)]
3981 fn new_empty() -> Self {
3982 Self { key: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
3983 }
3984
3985 #[inline]
3986 unsafe fn decode(
3987 &mut self,
3988 decoder: &mut fidl::encoding::Decoder<'_, D>,
3989 offset: usize,
3990 _depth: fidl::encoding::Depth,
3991 ) -> fidl::Result<()> {
3992 decoder.debug_check_bounds::<Self>(offset);
3993 fidl::decode!(
3995 fidl::encoding::BoundedString<256>,
3996 D,
3997 &mut self.key,
3998 decoder,
3999 offset + 0,
4000 _depth
4001 )?;
4002 Ok(())
4003 }
4004 }
4005
4006 impl fidl::encoding::ResourceTypeMarker for StoreAccessorGetPrefixRequest {
4007 type Borrowed<'a> = &'a mut Self;
4008 fn take_or_borrow<'a>(
4009 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4010 ) -> Self::Borrowed<'a> {
4011 value
4012 }
4013 }
4014
4015 unsafe impl fidl::encoding::TypeMarker for StoreAccessorGetPrefixRequest {
4016 type Owned = Self;
4017
4018 #[inline(always)]
4019 fn inline_align(_context: fidl::encoding::Context) -> usize {
4020 8
4021 }
4022
4023 #[inline(always)]
4024 fn inline_size(_context: fidl::encoding::Context) -> usize {
4025 24
4026 }
4027 }
4028
4029 unsafe impl
4030 fidl::encoding::Encode<
4031 StoreAccessorGetPrefixRequest,
4032 fidl::encoding::DefaultFuchsiaResourceDialect,
4033 > for &mut StoreAccessorGetPrefixRequest
4034 {
4035 #[inline]
4036 unsafe fn encode(
4037 self,
4038 encoder: &mut fidl::encoding::Encoder<
4039 '_,
4040 fidl::encoding::DefaultFuchsiaResourceDialect,
4041 >,
4042 offset: usize,
4043 _depth: fidl::encoding::Depth,
4044 ) -> fidl::Result<()> {
4045 encoder.debug_check_bounds::<StoreAccessorGetPrefixRequest>(offset);
4046 fidl::encoding::Encode::<StoreAccessorGetPrefixRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4048 (
4049 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(&self.prefix),
4050 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GetIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.it),
4051 ),
4052 encoder, offset, _depth
4053 )
4054 }
4055 }
4056 unsafe impl<
4057 T0: fidl::encoding::Encode<
4058 fidl::encoding::BoundedString<256>,
4059 fidl::encoding::DefaultFuchsiaResourceDialect,
4060 >,
4061 T1: fidl::encoding::Encode<
4062 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GetIteratorMarker>>,
4063 fidl::encoding::DefaultFuchsiaResourceDialect,
4064 >,
4065 >
4066 fidl::encoding::Encode<
4067 StoreAccessorGetPrefixRequest,
4068 fidl::encoding::DefaultFuchsiaResourceDialect,
4069 > for (T0, T1)
4070 {
4071 #[inline]
4072 unsafe fn encode(
4073 self,
4074 encoder: &mut fidl::encoding::Encoder<
4075 '_,
4076 fidl::encoding::DefaultFuchsiaResourceDialect,
4077 >,
4078 offset: usize,
4079 depth: fidl::encoding::Depth,
4080 ) -> fidl::Result<()> {
4081 encoder.debug_check_bounds::<StoreAccessorGetPrefixRequest>(offset);
4082 unsafe {
4085 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4086 (ptr as *mut u64).write_unaligned(0);
4087 }
4088 self.0.encode(encoder, offset + 0, depth)?;
4090 self.1.encode(encoder, offset + 16, depth)?;
4091 Ok(())
4092 }
4093 }
4094
4095 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4096 for StoreAccessorGetPrefixRequest
4097 {
4098 #[inline(always)]
4099 fn new_empty() -> Self {
4100 Self {
4101 prefix: fidl::new_empty!(
4102 fidl::encoding::BoundedString<256>,
4103 fidl::encoding::DefaultFuchsiaResourceDialect
4104 ),
4105 it: fidl::new_empty!(
4106 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GetIteratorMarker>>,
4107 fidl::encoding::DefaultFuchsiaResourceDialect
4108 ),
4109 }
4110 }
4111
4112 #[inline]
4113 unsafe fn decode(
4114 &mut self,
4115 decoder: &mut fidl::encoding::Decoder<
4116 '_,
4117 fidl::encoding::DefaultFuchsiaResourceDialect,
4118 >,
4119 offset: usize,
4120 _depth: fidl::encoding::Depth,
4121 ) -> fidl::Result<()> {
4122 decoder.debug_check_bounds::<Self>(offset);
4123 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4125 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4126 let mask = 0xffffffff00000000u64;
4127 let maskedval = padval & mask;
4128 if maskedval != 0 {
4129 return Err(fidl::Error::NonZeroPadding {
4130 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4131 });
4132 }
4133 fidl::decode!(
4134 fidl::encoding::BoundedString<256>,
4135 fidl::encoding::DefaultFuchsiaResourceDialect,
4136 &mut self.prefix,
4137 decoder,
4138 offset + 0,
4139 _depth
4140 )?;
4141 fidl::decode!(
4142 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GetIteratorMarker>>,
4143 fidl::encoding::DefaultFuchsiaResourceDialect,
4144 &mut self.it,
4145 decoder,
4146 offset + 16,
4147 _depth
4148 )?;
4149 Ok(())
4150 }
4151 }
4152
4153 impl fidl::encoding::ValueTypeMarker for StoreAccessorGetValueRequest {
4154 type Borrowed<'a> = &'a Self;
4155 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4156 value
4157 }
4158 }
4159
4160 unsafe impl fidl::encoding::TypeMarker for StoreAccessorGetValueRequest {
4161 type Owned = Self;
4162
4163 #[inline(always)]
4164 fn inline_align(_context: fidl::encoding::Context) -> usize {
4165 8
4166 }
4167
4168 #[inline(always)]
4169 fn inline_size(_context: fidl::encoding::Context) -> usize {
4170 16
4171 }
4172 }
4173
4174 unsafe impl<D: fidl::encoding::ResourceDialect>
4175 fidl::encoding::Encode<StoreAccessorGetValueRequest, D> for &StoreAccessorGetValueRequest
4176 {
4177 #[inline]
4178 unsafe fn encode(
4179 self,
4180 encoder: &mut fidl::encoding::Encoder<'_, D>,
4181 offset: usize,
4182 _depth: fidl::encoding::Depth,
4183 ) -> fidl::Result<()> {
4184 encoder.debug_check_bounds::<StoreAccessorGetValueRequest>(offset);
4185 fidl::encoding::Encode::<StoreAccessorGetValueRequest, D>::encode(
4187 (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
4188 &self.key,
4189 ),),
4190 encoder,
4191 offset,
4192 _depth,
4193 )
4194 }
4195 }
4196 unsafe impl<
4197 D: fidl::encoding::ResourceDialect,
4198 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
4199 > fidl::encoding::Encode<StoreAccessorGetValueRequest, D> for (T0,)
4200 {
4201 #[inline]
4202 unsafe fn encode(
4203 self,
4204 encoder: &mut fidl::encoding::Encoder<'_, D>,
4205 offset: usize,
4206 depth: fidl::encoding::Depth,
4207 ) -> fidl::Result<()> {
4208 encoder.debug_check_bounds::<StoreAccessorGetValueRequest>(offset);
4209 self.0.encode(encoder, offset + 0, depth)?;
4213 Ok(())
4214 }
4215 }
4216
4217 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4218 for StoreAccessorGetValueRequest
4219 {
4220 #[inline(always)]
4221 fn new_empty() -> Self {
4222 Self { key: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
4223 }
4224
4225 #[inline]
4226 unsafe fn decode(
4227 &mut self,
4228 decoder: &mut fidl::encoding::Decoder<'_, D>,
4229 offset: usize,
4230 _depth: fidl::encoding::Depth,
4231 ) -> fidl::Result<()> {
4232 decoder.debug_check_bounds::<Self>(offset);
4233 fidl::decode!(
4235 fidl::encoding::BoundedString<256>,
4236 D,
4237 &mut self.key,
4238 decoder,
4239 offset + 0,
4240 _depth
4241 )?;
4242 Ok(())
4243 }
4244 }
4245
4246 impl fidl::encoding::ResourceTypeMarker for StoreAccessorGetValueResponse {
4247 type Borrowed<'a> = &'a mut Self;
4248 fn take_or_borrow<'a>(
4249 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4250 ) -> Self::Borrowed<'a> {
4251 value
4252 }
4253 }
4254
4255 unsafe impl fidl::encoding::TypeMarker for StoreAccessorGetValueResponse {
4256 type Owned = Self;
4257
4258 #[inline(always)]
4259 fn inline_align(_context: fidl::encoding::Context) -> usize {
4260 8
4261 }
4262
4263 #[inline(always)]
4264 fn inline_size(_context: fidl::encoding::Context) -> usize {
4265 16
4266 }
4267 }
4268
4269 unsafe impl
4270 fidl::encoding::Encode<
4271 StoreAccessorGetValueResponse,
4272 fidl::encoding::DefaultFuchsiaResourceDialect,
4273 > for &mut StoreAccessorGetValueResponse
4274 {
4275 #[inline]
4276 unsafe fn encode(
4277 self,
4278 encoder: &mut fidl::encoding::Encoder<
4279 '_,
4280 fidl::encoding::DefaultFuchsiaResourceDialect,
4281 >,
4282 offset: usize,
4283 _depth: fidl::encoding::Depth,
4284 ) -> fidl::Result<()> {
4285 encoder.debug_check_bounds::<StoreAccessorGetValueResponse>(offset);
4286 fidl::encoding::Encode::<StoreAccessorGetValueResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4288 (
4289 <fidl::encoding::OptionalUnion<Value> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.val),
4290 ),
4291 encoder, offset, _depth
4292 )
4293 }
4294 }
4295 unsafe impl<
4296 T0: fidl::encoding::Encode<
4297 fidl::encoding::OptionalUnion<Value>,
4298 fidl::encoding::DefaultFuchsiaResourceDialect,
4299 >,
4300 >
4301 fidl::encoding::Encode<
4302 StoreAccessorGetValueResponse,
4303 fidl::encoding::DefaultFuchsiaResourceDialect,
4304 > for (T0,)
4305 {
4306 #[inline]
4307 unsafe fn encode(
4308 self,
4309 encoder: &mut fidl::encoding::Encoder<
4310 '_,
4311 fidl::encoding::DefaultFuchsiaResourceDialect,
4312 >,
4313 offset: usize,
4314 depth: fidl::encoding::Depth,
4315 ) -> fidl::Result<()> {
4316 encoder.debug_check_bounds::<StoreAccessorGetValueResponse>(offset);
4317 self.0.encode(encoder, offset + 0, depth)?;
4321 Ok(())
4322 }
4323 }
4324
4325 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4326 for StoreAccessorGetValueResponse
4327 {
4328 #[inline(always)]
4329 fn new_empty() -> Self {
4330 Self {
4331 val: fidl::new_empty!(
4332 fidl::encoding::OptionalUnion<Value>,
4333 fidl::encoding::DefaultFuchsiaResourceDialect
4334 ),
4335 }
4336 }
4337
4338 #[inline]
4339 unsafe fn decode(
4340 &mut self,
4341 decoder: &mut fidl::encoding::Decoder<
4342 '_,
4343 fidl::encoding::DefaultFuchsiaResourceDialect,
4344 >,
4345 offset: usize,
4346 _depth: fidl::encoding::Depth,
4347 ) -> fidl::Result<()> {
4348 decoder.debug_check_bounds::<Self>(offset);
4349 fidl::decode!(
4351 fidl::encoding::OptionalUnion<Value>,
4352 fidl::encoding::DefaultFuchsiaResourceDialect,
4353 &mut self.val,
4354 decoder,
4355 offset + 0,
4356 _depth
4357 )?;
4358 Ok(())
4359 }
4360 }
4361
4362 impl fidl::encoding::ResourceTypeMarker for StoreAccessorListPrefixRequest {
4363 type Borrowed<'a> = &'a mut Self;
4364 fn take_or_borrow<'a>(
4365 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4366 ) -> Self::Borrowed<'a> {
4367 value
4368 }
4369 }
4370
4371 unsafe impl fidl::encoding::TypeMarker for StoreAccessorListPrefixRequest {
4372 type Owned = Self;
4373
4374 #[inline(always)]
4375 fn inline_align(_context: fidl::encoding::Context) -> usize {
4376 8
4377 }
4378
4379 #[inline(always)]
4380 fn inline_size(_context: fidl::encoding::Context) -> usize {
4381 24
4382 }
4383 }
4384
4385 unsafe impl
4386 fidl::encoding::Encode<
4387 StoreAccessorListPrefixRequest,
4388 fidl::encoding::DefaultFuchsiaResourceDialect,
4389 > for &mut StoreAccessorListPrefixRequest
4390 {
4391 #[inline]
4392 unsafe fn encode(
4393 self,
4394 encoder: &mut fidl::encoding::Encoder<
4395 '_,
4396 fidl::encoding::DefaultFuchsiaResourceDialect,
4397 >,
4398 offset: usize,
4399 _depth: fidl::encoding::Depth,
4400 ) -> fidl::Result<()> {
4401 encoder.debug_check_bounds::<StoreAccessorListPrefixRequest>(offset);
4402 fidl::encoding::Encode::<StoreAccessorListPrefixRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4404 (
4405 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(&self.prefix),
4406 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ListIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.it),
4407 ),
4408 encoder, offset, _depth
4409 )
4410 }
4411 }
4412 unsafe impl<
4413 T0: fidl::encoding::Encode<
4414 fidl::encoding::BoundedString<256>,
4415 fidl::encoding::DefaultFuchsiaResourceDialect,
4416 >,
4417 T1: fidl::encoding::Encode<
4418 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ListIteratorMarker>>,
4419 fidl::encoding::DefaultFuchsiaResourceDialect,
4420 >,
4421 >
4422 fidl::encoding::Encode<
4423 StoreAccessorListPrefixRequest,
4424 fidl::encoding::DefaultFuchsiaResourceDialect,
4425 > for (T0, T1)
4426 {
4427 #[inline]
4428 unsafe fn encode(
4429 self,
4430 encoder: &mut fidl::encoding::Encoder<
4431 '_,
4432 fidl::encoding::DefaultFuchsiaResourceDialect,
4433 >,
4434 offset: usize,
4435 depth: fidl::encoding::Depth,
4436 ) -> fidl::Result<()> {
4437 encoder.debug_check_bounds::<StoreAccessorListPrefixRequest>(offset);
4438 unsafe {
4441 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4442 (ptr as *mut u64).write_unaligned(0);
4443 }
4444 self.0.encode(encoder, offset + 0, depth)?;
4446 self.1.encode(encoder, offset + 16, depth)?;
4447 Ok(())
4448 }
4449 }
4450
4451 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4452 for StoreAccessorListPrefixRequest
4453 {
4454 #[inline(always)]
4455 fn new_empty() -> Self {
4456 Self {
4457 prefix: fidl::new_empty!(
4458 fidl::encoding::BoundedString<256>,
4459 fidl::encoding::DefaultFuchsiaResourceDialect
4460 ),
4461 it: fidl::new_empty!(
4462 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ListIteratorMarker>>,
4463 fidl::encoding::DefaultFuchsiaResourceDialect
4464 ),
4465 }
4466 }
4467
4468 #[inline]
4469 unsafe fn decode(
4470 &mut self,
4471 decoder: &mut fidl::encoding::Decoder<
4472 '_,
4473 fidl::encoding::DefaultFuchsiaResourceDialect,
4474 >,
4475 offset: usize,
4476 _depth: fidl::encoding::Depth,
4477 ) -> fidl::Result<()> {
4478 decoder.debug_check_bounds::<Self>(offset);
4479 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4481 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4482 let mask = 0xffffffff00000000u64;
4483 let maskedval = padval & mask;
4484 if maskedval != 0 {
4485 return Err(fidl::Error::NonZeroPadding {
4486 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4487 });
4488 }
4489 fidl::decode!(
4490 fidl::encoding::BoundedString<256>,
4491 fidl::encoding::DefaultFuchsiaResourceDialect,
4492 &mut self.prefix,
4493 decoder,
4494 offset + 0,
4495 _depth
4496 )?;
4497 fidl::decode!(
4498 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ListIteratorMarker>>,
4499 fidl::encoding::DefaultFuchsiaResourceDialect,
4500 &mut self.it,
4501 decoder,
4502 offset + 16,
4503 _depth
4504 )?;
4505 Ok(())
4506 }
4507 }
4508
4509 impl fidl::encoding::ResourceTypeMarker for StoreAccessorSetValueRequest {
4510 type Borrowed<'a> = &'a mut Self;
4511 fn take_or_borrow<'a>(
4512 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4513 ) -> Self::Borrowed<'a> {
4514 value
4515 }
4516 }
4517
4518 unsafe impl fidl::encoding::TypeMarker for StoreAccessorSetValueRequest {
4519 type Owned = Self;
4520
4521 #[inline(always)]
4522 fn inline_align(_context: fidl::encoding::Context) -> usize {
4523 8
4524 }
4525
4526 #[inline(always)]
4527 fn inline_size(_context: fidl::encoding::Context) -> usize {
4528 32
4529 }
4530 }
4531
4532 unsafe impl
4533 fidl::encoding::Encode<
4534 StoreAccessorSetValueRequest,
4535 fidl::encoding::DefaultFuchsiaResourceDialect,
4536 > for &mut StoreAccessorSetValueRequest
4537 {
4538 #[inline]
4539 unsafe fn encode(
4540 self,
4541 encoder: &mut fidl::encoding::Encoder<
4542 '_,
4543 fidl::encoding::DefaultFuchsiaResourceDialect,
4544 >,
4545 offset: usize,
4546 _depth: fidl::encoding::Depth,
4547 ) -> fidl::Result<()> {
4548 encoder.debug_check_bounds::<StoreAccessorSetValueRequest>(offset);
4549 fidl::encoding::Encode::<
4551 StoreAccessorSetValueRequest,
4552 fidl::encoding::DefaultFuchsiaResourceDialect,
4553 >::encode(
4554 (
4555 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
4556 &self.key,
4557 ),
4558 <Value as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.val),
4559 ),
4560 encoder,
4561 offset,
4562 _depth,
4563 )
4564 }
4565 }
4566 unsafe impl<
4567 T0: fidl::encoding::Encode<
4568 fidl::encoding::BoundedString<256>,
4569 fidl::encoding::DefaultFuchsiaResourceDialect,
4570 >,
4571 T1: fidl::encoding::Encode<Value, fidl::encoding::DefaultFuchsiaResourceDialect>,
4572 >
4573 fidl::encoding::Encode<
4574 StoreAccessorSetValueRequest,
4575 fidl::encoding::DefaultFuchsiaResourceDialect,
4576 > for (T0, T1)
4577 {
4578 #[inline]
4579 unsafe fn encode(
4580 self,
4581 encoder: &mut fidl::encoding::Encoder<
4582 '_,
4583 fidl::encoding::DefaultFuchsiaResourceDialect,
4584 >,
4585 offset: usize,
4586 depth: fidl::encoding::Depth,
4587 ) -> fidl::Result<()> {
4588 encoder.debug_check_bounds::<StoreAccessorSetValueRequest>(offset);
4589 self.0.encode(encoder, offset + 0, depth)?;
4593 self.1.encode(encoder, offset + 16, depth)?;
4594 Ok(())
4595 }
4596 }
4597
4598 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4599 for StoreAccessorSetValueRequest
4600 {
4601 #[inline(always)]
4602 fn new_empty() -> Self {
4603 Self {
4604 key: fidl::new_empty!(
4605 fidl::encoding::BoundedString<256>,
4606 fidl::encoding::DefaultFuchsiaResourceDialect
4607 ),
4608 val: fidl::new_empty!(Value, fidl::encoding::DefaultFuchsiaResourceDialect),
4609 }
4610 }
4611
4612 #[inline]
4613 unsafe fn decode(
4614 &mut self,
4615 decoder: &mut fidl::encoding::Decoder<
4616 '_,
4617 fidl::encoding::DefaultFuchsiaResourceDialect,
4618 >,
4619 offset: usize,
4620 _depth: fidl::encoding::Depth,
4621 ) -> fidl::Result<()> {
4622 decoder.debug_check_bounds::<Self>(offset);
4623 fidl::decode!(
4625 fidl::encoding::BoundedString<256>,
4626 fidl::encoding::DefaultFuchsiaResourceDialect,
4627 &mut self.key,
4628 decoder,
4629 offset + 0,
4630 _depth
4631 )?;
4632 fidl::decode!(
4633 Value,
4634 fidl::encoding::DefaultFuchsiaResourceDialect,
4635 &mut self.val,
4636 decoder,
4637 offset + 16,
4638 _depth
4639 )?;
4640 Ok(())
4641 }
4642 }
4643
4644 impl fidl::encoding::ResourceTypeMarker for StoreCreateAccessorRequest {
4645 type Borrowed<'a> = &'a mut Self;
4646 fn take_or_borrow<'a>(
4647 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4648 ) -> Self::Borrowed<'a> {
4649 value
4650 }
4651 }
4652
4653 unsafe impl fidl::encoding::TypeMarker for StoreCreateAccessorRequest {
4654 type Owned = Self;
4655
4656 #[inline(always)]
4657 fn inline_align(_context: fidl::encoding::Context) -> usize {
4658 4
4659 }
4660
4661 #[inline(always)]
4662 fn inline_size(_context: fidl::encoding::Context) -> usize {
4663 8
4664 }
4665 }
4666
4667 unsafe impl
4668 fidl::encoding::Encode<
4669 StoreCreateAccessorRequest,
4670 fidl::encoding::DefaultFuchsiaResourceDialect,
4671 > for &mut StoreCreateAccessorRequest
4672 {
4673 #[inline]
4674 unsafe fn encode(
4675 self,
4676 encoder: &mut fidl::encoding::Encoder<
4677 '_,
4678 fidl::encoding::DefaultFuchsiaResourceDialect,
4679 >,
4680 offset: usize,
4681 _depth: fidl::encoding::Depth,
4682 ) -> fidl::Result<()> {
4683 encoder.debug_check_bounds::<StoreCreateAccessorRequest>(offset);
4684 fidl::encoding::Encode::<StoreCreateAccessorRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4686 (
4687 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.read_only),
4688 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StoreAccessorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.accessor_request),
4689 ),
4690 encoder, offset, _depth
4691 )
4692 }
4693 }
4694 unsafe impl<
4695 T0: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>,
4696 T1: fidl::encoding::Encode<
4697 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StoreAccessorMarker>>,
4698 fidl::encoding::DefaultFuchsiaResourceDialect,
4699 >,
4700 >
4701 fidl::encoding::Encode<
4702 StoreCreateAccessorRequest,
4703 fidl::encoding::DefaultFuchsiaResourceDialect,
4704 > for (T0, T1)
4705 {
4706 #[inline]
4707 unsafe fn encode(
4708 self,
4709 encoder: &mut fidl::encoding::Encoder<
4710 '_,
4711 fidl::encoding::DefaultFuchsiaResourceDialect,
4712 >,
4713 offset: usize,
4714 depth: fidl::encoding::Depth,
4715 ) -> fidl::Result<()> {
4716 encoder.debug_check_bounds::<StoreCreateAccessorRequest>(offset);
4717 unsafe {
4720 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4721 (ptr as *mut u32).write_unaligned(0);
4722 }
4723 self.0.encode(encoder, offset + 0, depth)?;
4725 self.1.encode(encoder, offset + 4, depth)?;
4726 Ok(())
4727 }
4728 }
4729
4730 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4731 for StoreCreateAccessorRequest
4732 {
4733 #[inline(always)]
4734 fn new_empty() -> Self {
4735 Self {
4736 read_only: fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect),
4737 accessor_request: fidl::new_empty!(
4738 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StoreAccessorMarker>>,
4739 fidl::encoding::DefaultFuchsiaResourceDialect
4740 ),
4741 }
4742 }
4743
4744 #[inline]
4745 unsafe fn decode(
4746 &mut self,
4747 decoder: &mut fidl::encoding::Decoder<
4748 '_,
4749 fidl::encoding::DefaultFuchsiaResourceDialect,
4750 >,
4751 offset: usize,
4752 _depth: fidl::encoding::Depth,
4753 ) -> fidl::Result<()> {
4754 decoder.debug_check_bounds::<Self>(offset);
4755 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4757 let padval = unsafe { (ptr as *const u32).read_unaligned() };
4758 let mask = 0xffffff00u32;
4759 let maskedval = padval & mask;
4760 if maskedval != 0 {
4761 return Err(fidl::Error::NonZeroPadding {
4762 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4763 });
4764 }
4765 fidl::decode!(
4766 bool,
4767 fidl::encoding::DefaultFuchsiaResourceDialect,
4768 &mut self.read_only,
4769 decoder,
4770 offset + 0,
4771 _depth
4772 )?;
4773 fidl::decode!(
4774 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StoreAccessorMarker>>,
4775 fidl::encoding::DefaultFuchsiaResourceDialect,
4776 &mut self.accessor_request,
4777 decoder,
4778 offset + 4,
4779 _depth
4780 )?;
4781 Ok(())
4782 }
4783 }
4784
4785 impl fidl::encoding::ValueTypeMarker for StoreIdentifyRequest {
4786 type Borrowed<'a> = &'a Self;
4787 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4788 value
4789 }
4790 }
4791
4792 unsafe impl fidl::encoding::TypeMarker for StoreIdentifyRequest {
4793 type Owned = Self;
4794
4795 #[inline(always)]
4796 fn inline_align(_context: fidl::encoding::Context) -> usize {
4797 8
4798 }
4799
4800 #[inline(always)]
4801 fn inline_size(_context: fidl::encoding::Context) -> usize {
4802 16
4803 }
4804 }
4805
4806 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StoreIdentifyRequest, D>
4807 for &StoreIdentifyRequest
4808 {
4809 #[inline]
4810 unsafe fn encode(
4811 self,
4812 encoder: &mut fidl::encoding::Encoder<'_, D>,
4813 offset: usize,
4814 _depth: fidl::encoding::Depth,
4815 ) -> fidl::Result<()> {
4816 encoder.debug_check_bounds::<StoreIdentifyRequest>(offset);
4817 fidl::encoding::Encode::<StoreIdentifyRequest, D>::encode(
4819 (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
4820 &self.name,
4821 ),),
4822 encoder,
4823 offset,
4824 _depth,
4825 )
4826 }
4827 }
4828 unsafe impl<
4829 D: fidl::encoding::ResourceDialect,
4830 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
4831 > fidl::encoding::Encode<StoreIdentifyRequest, D> for (T0,)
4832 {
4833 #[inline]
4834 unsafe fn encode(
4835 self,
4836 encoder: &mut fidl::encoding::Encoder<'_, D>,
4837 offset: usize,
4838 depth: fidl::encoding::Depth,
4839 ) -> fidl::Result<()> {
4840 encoder.debug_check_bounds::<StoreIdentifyRequest>(offset);
4841 self.0.encode(encoder, offset + 0, depth)?;
4845 Ok(())
4846 }
4847 }
4848
4849 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StoreIdentifyRequest {
4850 #[inline(always)]
4851 fn new_empty() -> Self {
4852 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
4853 }
4854
4855 #[inline]
4856 unsafe fn decode(
4857 &mut self,
4858 decoder: &mut fidl::encoding::Decoder<'_, D>,
4859 offset: usize,
4860 _depth: fidl::encoding::Depth,
4861 ) -> fidl::Result<()> {
4862 decoder.debug_check_bounds::<Self>(offset);
4863 fidl::decode!(
4865 fidl::encoding::BoundedString<256>,
4866 D,
4867 &mut self.name,
4868 decoder,
4869 offset + 0,
4870 _depth
4871 )?;
4872 Ok(())
4873 }
4874 }
4875
4876 impl fidl::encoding::ResourceTypeMarker for Value {
4877 type Borrowed<'a> = &'a mut Self;
4878 fn take_or_borrow<'a>(
4879 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4880 ) -> Self::Borrowed<'a> {
4881 value
4882 }
4883 }
4884
4885 unsafe impl fidl::encoding::TypeMarker for Value {
4886 type Owned = Self;
4887
4888 #[inline(always)]
4889 fn inline_align(_context: fidl::encoding::Context) -> usize {
4890 8
4891 }
4892
4893 #[inline(always)]
4894 fn inline_size(_context: fidl::encoding::Context) -> usize {
4895 16
4896 }
4897 }
4898
4899 unsafe impl fidl::encoding::Encode<Value, fidl::encoding::DefaultFuchsiaResourceDialect>
4900 for &mut Value
4901 {
4902 #[inline]
4903 unsafe fn encode(
4904 self,
4905 encoder: &mut fidl::encoding::Encoder<
4906 '_,
4907 fidl::encoding::DefaultFuchsiaResourceDialect,
4908 >,
4909 offset: usize,
4910 _depth: fidl::encoding::Depth,
4911 ) -> fidl::Result<()> {
4912 encoder.debug_check_bounds::<Value>(offset);
4913 encoder.write_num::<u64>(self.ordinal(), offset);
4914 match self {
4915 Value::Intval(ref val) => {
4916 fidl::encoding::encode_in_envelope::<i64, fidl::encoding::DefaultFuchsiaResourceDialect>(
4917 <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
4918 encoder, offset + 8, _depth
4919 )
4920 }
4921 Value::Floatval(ref val) => {
4922 fidl::encoding::encode_in_envelope::<f64, fidl::encoding::DefaultFuchsiaResourceDialect>(
4923 <f64 as fidl::encoding::ValueTypeMarker>::borrow(val),
4924 encoder, offset + 8, _depth
4925 )
4926 }
4927 Value::Boolval(ref val) => {
4928 fidl::encoding::encode_in_envelope::<bool, fidl::encoding::DefaultFuchsiaResourceDialect>(
4929 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
4930 encoder, offset + 8, _depth
4931 )
4932 }
4933 Value::Stringval(ref val) => {
4934 fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<12000>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4935 <fidl::encoding::BoundedString<12000> as fidl::encoding::ValueTypeMarker>::borrow(val),
4936 encoder, offset + 8, _depth
4937 )
4938 }
4939 Value::Bytesval(ref mut val) => {
4940 fidl::encoding::encode_in_envelope::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
4941 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
4942 encoder, offset + 8, _depth
4943 )
4944 }
4945 }
4946 }
4947 }
4948
4949 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Value {
4950 #[inline(always)]
4951 fn new_empty() -> Self {
4952 Self::Intval(fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect))
4953 }
4954
4955 #[inline]
4956 unsafe fn decode(
4957 &mut self,
4958 decoder: &mut fidl::encoding::Decoder<
4959 '_,
4960 fidl::encoding::DefaultFuchsiaResourceDialect,
4961 >,
4962 offset: usize,
4963 mut depth: fidl::encoding::Depth,
4964 ) -> fidl::Result<()> {
4965 decoder.debug_check_bounds::<Self>(offset);
4966 #[allow(unused_variables)]
4967 let next_out_of_line = decoder.next_out_of_line();
4968 let handles_before = decoder.remaining_handles();
4969 let (ordinal, inlined, num_bytes, num_handles) =
4970 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4971
4972 let member_inline_size = match ordinal {
4973 1 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4974 2 => <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4975 3 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4976 4 => <fidl::encoding::BoundedString<12000> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4977 5 => <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4978 _ => return Err(fidl::Error::UnknownUnionTag),
4979 };
4980
4981 if inlined != (member_inline_size <= 4) {
4982 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4983 }
4984 let _inner_offset;
4985 if inlined {
4986 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4987 _inner_offset = offset + 8;
4988 } else {
4989 depth.increment()?;
4990 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4991 }
4992 match ordinal {
4993 1 => {
4994 #[allow(irrefutable_let_patterns)]
4995 if let Value::Intval(_) = self {
4996 } else {
4998 *self = Value::Intval(fidl::new_empty!(
5000 i64,
5001 fidl::encoding::DefaultFuchsiaResourceDialect
5002 ));
5003 }
5004 #[allow(irrefutable_let_patterns)]
5005 if let Value::Intval(ref mut val) = self {
5006 fidl::decode!(
5007 i64,
5008 fidl::encoding::DefaultFuchsiaResourceDialect,
5009 val,
5010 decoder,
5011 _inner_offset,
5012 depth
5013 )?;
5014 } else {
5015 unreachable!()
5016 }
5017 }
5018 2 => {
5019 #[allow(irrefutable_let_patterns)]
5020 if let Value::Floatval(_) = self {
5021 } else {
5023 *self = Value::Floatval(fidl::new_empty!(
5025 f64,
5026 fidl::encoding::DefaultFuchsiaResourceDialect
5027 ));
5028 }
5029 #[allow(irrefutable_let_patterns)]
5030 if let Value::Floatval(ref mut val) = self {
5031 fidl::decode!(
5032 f64,
5033 fidl::encoding::DefaultFuchsiaResourceDialect,
5034 val,
5035 decoder,
5036 _inner_offset,
5037 depth
5038 )?;
5039 } else {
5040 unreachable!()
5041 }
5042 }
5043 3 => {
5044 #[allow(irrefutable_let_patterns)]
5045 if let Value::Boolval(_) = self {
5046 } else {
5048 *self = Value::Boolval(fidl::new_empty!(
5050 bool,
5051 fidl::encoding::DefaultFuchsiaResourceDialect
5052 ));
5053 }
5054 #[allow(irrefutable_let_patterns)]
5055 if let Value::Boolval(ref mut val) = self {
5056 fidl::decode!(
5057 bool,
5058 fidl::encoding::DefaultFuchsiaResourceDialect,
5059 val,
5060 decoder,
5061 _inner_offset,
5062 depth
5063 )?;
5064 } else {
5065 unreachable!()
5066 }
5067 }
5068 4 => {
5069 #[allow(irrefutable_let_patterns)]
5070 if let Value::Stringval(_) = self {
5071 } else {
5073 *self = Value::Stringval(fidl::new_empty!(
5075 fidl::encoding::BoundedString<12000>,
5076 fidl::encoding::DefaultFuchsiaResourceDialect
5077 ));
5078 }
5079 #[allow(irrefutable_let_patterns)]
5080 if let Value::Stringval(ref mut val) = self {
5081 fidl::decode!(
5082 fidl::encoding::BoundedString<12000>,
5083 fidl::encoding::DefaultFuchsiaResourceDialect,
5084 val,
5085 decoder,
5086 _inner_offset,
5087 depth
5088 )?;
5089 } else {
5090 unreachable!()
5091 }
5092 }
5093 5 => {
5094 #[allow(irrefutable_let_patterns)]
5095 if let Value::Bytesval(_) = self {
5096 } else {
5098 *self = Value::Bytesval(fidl::new_empty!(
5100 fidl_fuchsia_mem::Buffer,
5101 fidl::encoding::DefaultFuchsiaResourceDialect
5102 ));
5103 }
5104 #[allow(irrefutable_let_patterns)]
5105 if let Value::Bytesval(ref mut val) = self {
5106 fidl::decode!(
5107 fidl_fuchsia_mem::Buffer,
5108 fidl::encoding::DefaultFuchsiaResourceDialect,
5109 val,
5110 decoder,
5111 _inner_offset,
5112 depth
5113 )?;
5114 } else {
5115 unreachable!()
5116 }
5117 }
5118 ordinal => panic!("unexpected ordinal {:?}", ordinal),
5119 }
5120 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5121 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5122 }
5123 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5124 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5125 }
5126 Ok(())
5127 }
5128 }
5129}